JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 20
  • Score
    100M100P100Q32350F
  • License ISC

add some frontEnd function for ZWT

Package Exports

  • zwt-fe
  • zwt-fe/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (zwt-fe) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

说明

脚本用于一键安装功能所需依赖,目前支持以下功能:

  • eslint+husky+lint-staged:
    • commit 提交代码时执行 npx lint-staged -q, 使用 lint-staged 校验并自动格式化 git add后的代码(eslintstylelint),通过才可 commit
      • 自动格式化 所有 git add 后的代码,则自动格式化并提交
      • 不能自动格式化 所有 git add 后的代码,则不做处理并提示需手动修改的代码,手动修改该部分代码后,继续提交,工具会自动格式化剩余 可格式化代码提交
      • 注意:如使用 IDEA 系列开发工具,需勾选 设置 -> Version Control -> Git -> Enable staging area,才能使用该工具功能!!! changelist模式下也可用。
    • 使用 npm run lint 检查项目 所有 代码。
    • 使用 npm run lint:fix 格式化项目 所有 代码。
    • 使用 npm run lint-stagednpx lint-staged -q 格式化项目 git add 存储在 staged 里的代码。
    • git commit 时会自动执行上一条里的命令 npx lint-staged -q
  • commitlint+git cz+changelog
    • 提交代码时校验 commit message,符合规范的才可提交。
    • 使用 git cz 代替 git commit,用工作流问答的方式填写符合规范的 commit message
    • 使用 npm run changelognpm run changelog:allCHANGELOG.md 生成版本更新记录。

关于路径

  • USE_XXX: 使用脚本时所在路径,./xxx
  • IN_XXX: 开发的脚本所在的路径,path.resolve(__dirname, './xxx')

TODO

  • windows 平台: eslint+husky 配置 ~/.huksy 中的 PATH 环境变量
  • windows + mac 平台:添加 eslint-loaderstylelint-webpack-plugin,并配置 webpack.dev.js
  • 安装时可选依赖的 versions 版本,添加多个 version 文件
  • 配置 less/css 缩进等格式
  • 添加 lint-stagedgit commit 时只校验 git add 存储在 staged 里的代码