npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fis-postprocessor-imweb-ques2

v0.0.1

Published

the second fis3 prepackager plugin for q components of imweb team

Downloads

1

Readme

fis3-prepackager-imweb-ques2

the second fis3 prepackager plugin for q components of imweb team just for the h5 project of online education

标识Ques页面

fis.match('pages/**main.html', {
    isQPage: true
})

or

<!DOCTYPE html>
<!--isQPage-->
<html lang="en">
<head></head>
<body></body>
</html>

处理过程

  • components/*.{css,js,scss}

只替换holder成模块名

  • 入口文件 pages/main.html
    • 添加components css/js依赖
    • 展开components
    • 添加components 信息(之前ques不需要,但它需要在components js文件里注册组件,为了简化对components js的处理, 将注册组件统一移至Q.factory中,因此添加组件信息)

输入:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="/pages/start/main.css">
</head>
<body>
    <chead></chead>
    <script src="/libs/mod.js"></script>
    <script src="/libs/jquery.min.js"></script>
    <script>
        require('libs/Q.factory')();
    </script>
</body>
</html>

输出:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="/pages/start/main.css">
    <!-- components css 依赖-->
    <link rel="stylesheet" href="/components/chead/main.css">
</head>
<body>
    <!-- 展开components -->
    <div q-text="text" class="component-1"></div>
    <script src="/libs/mod.js"></script>
    <script src="/libs/jquery.min.js"></script>
    <!-- components js 依赖-->
    <script src="/components/chead/main.js"></script>
    <!-- components 信息 -->
    <script>var _components = {"chead":{"js":"components/chead/main","child":1,"uid":1}};</script>
    <script>
        require('libs/Q.factory')();
    </script>
</body>
</html>

依赖

  • commonJs (包裹js成AMD)

配置

  • classHolder: /___|\$__/g 类名占位符
  • nameHolder: /____|\$__\$/g 名称占位符
  • components: ['/components', getComp] 组件路径
function getComp(name, ret) {
    return {
        root: fis.project.getProjectPath(),
        name: name,
        dir: comDirPath,
        html: htmlFilePathIfExist,
        js: jsFilePathIfExist,
        css: cssFilePathIfExist,
        scss: scssFilePathIfExist,
        less: lessFilePathIfExist
    }
}

问题

  • components是否支持与scss集成
    • 支持, component的样式文件按main.css, main.scss, main.less的顺序查找
    • 使用main.scss main.less时占位符holder请勿使用$__, $对scss会报错, 可以使用3个下划线___
  • 如何使用查找到lego下的component
    • 配置components中传入查找函数,想怎么找就怎么找