Gathering detailed insights and metrics for generator-lego
Gathering detailed insights and metrics for generator-lego
Gathering detailed insights and metrics for generator-lego
Gathering detailed insights and metrics for generator-lego
npm install generator-lego
Typescript
Module System
Node Version
NPM Version
CSS (52.6%)
HTML (41.67%)
JavaScript (5.73%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
22 Stars
144 Commits
6 Forks
15 Watchers
3 Branches
8 Contributors
Updated on Nov 02, 2022
Latest Version
0.2.31
Package Id
generator-lego@0.2.31
Size
383.74 kB
NPM Version
2.14.12
Node Version
4.2.4
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
generator-lego 基于gulp的前端工作流
这是一个帮助前端开发工程师简化工作的工具,它的主要功能是:
npm install -g yo gulp
提供以下2种获取方式:
npm
npm install -g generator-lego
yo lego
初始化项目Clone the repo
npm link
链接到全局模块的位置yo lego
初始化项目generator-lego
初始化和执行任务涉及的文件结构:
yourProj/
│
├── package.json // 项目依赖定义
├── gulp.js // gulp配置任务入口
├── tasks/ // gulp任务流,开发、构建、发布等
│
├── node_modules // `npm install` 拉取依赖包
│
├── src/ // 开发目录
│ ├── css/
│ │ └── global.css // 经过sass编译后的出口css文件
│ ├── sass/ // sass源文件
│ ├── img/ // 仅 Copy 不做操作
│ │ └── slice/ // 切片文件夹,拼雪碧图用
│ ├── js/ // 仅 Copy 不做操作
│ ├── tpl/ // 仅 Copy 不做操作,用来存放ejs模板
│ └── _index.html
│
└── dest/ // 发布目录,执行 `gulp build` 生成
├── css/
│ └── global.css
├── img/
├── js/
└── index.html
src/tpl/*.ejs
src/tpl
可内建子文件夹,存放被引用的代码片段;子文件夹不会编译出html文件src/
;如已有同名html文件,覆盖之dest/
;同样覆盖同名html文件src/slice/
,该文件夹可继续创建子文件夹存放切片background-image:url()
引入切片样式,不要使用background
属性的缩写yo lego
,按如下规则初始化
node_modules
,则创建软连接src
,则退出gulp
创建一个链接,自动检测src
文件夹下的静态文件,自动刷新。支持sass、ejs编译。gulp build
将静态文件压缩到 dest/
,该阶段会执行雪碧图合并、ejs编译。gulp publish
将 dest/
静态文件上传到svn。gulp zip
将源码和构建后代码压缩成一个zip包。gulp hint
检测src/
文件下的语法。gulp [-p <port>] [-q] [-w <width-of-design-page>]
-p
port 的简写,给webserver指定端口号;此参数需要指定参数值作为端口号,如:8080-q
qrcode 的简写,指定该参数生成 url的二维码-w
指设计稿像素宽度,默认值 750
,用来生成生成rem单位的切片语法;如不指定-w
将生成px单位的语法gulp build [-p <port>] [-b] [-q] [-w <width-of-design-page>]
-p
指port,给webserver指定端口号;此参数需要指定参数值作为端口号,如:8080-b
移除 HTMl 的注释-q
指qrcode,指定该参数生成 url的二维码-w
指设计稿像素宽度,默认值 750
,将使用rem单位更新定位数据;如不指定-w
将使用px单位更新定位数据gulp publish [-m <message>]
-m
svn提交日记curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | bash
[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh
,并加到 ~/.bashrc
、~/.profile
或~/.zshrc
配置中请使用Mac请使用[nvm] 默认此步骤已完成 (Mac建议使用 Brew 安装 Node.js)
Released under MIT LICENSE
No vulnerabilities found.
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
no binaries found in the repo
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
security policy file not detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More