{"id":46459124,"url":"https://github.com/howieyi/water","last_synced_at":"2026-03-06T03:01:39.454Z","repository":{"id":57278806,"uuid":"275982932","full_name":"howieyi/water","owner":"howieyi","description":"基于 react、vue 的 cli 脚手架工具","archived":false,"fork":false,"pushed_at":"2024-02-19T09:01:04.000Z","size":132,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-17T04:52:38.261Z","etag":null,"topics":["cli","react","vue","webpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/howieyi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-30T03:04:22.000Z","updated_at":"2021-11-17T02:45:13.000Z","dependencies_parsed_at":"2022-09-18T08:41:59.939Z","dependency_job_id":null,"html_url":"https://github.com/howieyi/water","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/howieyi/water","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howieyi%2Fwater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howieyi%2Fwater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howieyi%2Fwater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howieyi%2Fwater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/howieyi","download_url":"https://codeload.github.com/howieyi/water/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howieyi%2Fwater/sbom","scorecard":{"id":469927,"data":{"date":"2025-08-11","repo":{"name":"github.com/howieyi/water","commit":"d668318bf19623143e93f33eff5540d951369824"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T13:36:53.970Z","repository_id":57278806,"created_at":"2025-08-19T13:36:53.970Z","updated_at":"2025-08-19T13:36:53.970Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30160022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"online","status_checked_at":"2026-03-06T02:00:08.268Z","response_time":250,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","react","vue","webpack"],"created_at":"2026-03-06T03:01:12.054Z","updated_at":"2026-03-06T03:01:39.442Z","avatar_url":"https://github.com/howieyi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# water cli\n\n## 介绍\n\n- 基于 `webpack` 整合前端项目中构建配置流程，业务和工程解耦，让开发者可以更专注业务；\n- 目前支持 vue/react 项目开发、生产构建流程；\n- v0.1.0+ 开始升级 webpack5+\n\n## 使用说明\n\n### 安装\n\n```bash\n$ npm i -g iwater\nor\n$ yarn global add iwater\n\n$ water\nUsage: water\n  water create\n  water dev\n  water prod -i -m [module]\n  water umd -i\n\nParams:\n\n  dev:\n    -m [module] 模块名称\n    -i 是否打印详细信息\n\n  prod:\n    -m [module] 模块名称\n    -i 是否打印详细信息\n\n  umd:\n    -i 是否打印详细信息\n\nOptions:\n  -V, --version   output the version number\n  -h, --help      display help for command\n\nCommands:\n  create          初始化项目\n  dev             开发环境构建\n  prod            生产环境构建\n  umd             公共包构建\n```\n\n### 命令说明\n\n1. `water create`: 项目模板初始化，内置了 react/vue es/ts 版本的模板；\n2. `water dev`: 开发环境构建，基于 `webpack-dev-server`, 整合 eslint/stylelint 语法监测，支持 hrm 实时热更新；\n3. `water prod -i`: 生产环境构建，统一构建产物，支持代码 `chunk` 拆包，并支持打包分析；\n4. `water umd -i`: umd 打包，可用于制作 cdn 整合包，比如 `react`/`react-router`/`react-router-dom` 合并为一个包；\n\n### 初始化模板说明\n\n\u003e `water create` 调取的模板将是这里中的一个，目前模板比较架构比较简陋，后期会考虑扩展模板功能；\n\n```bash\n# 模板文件结构\n.\n├── react # react jsx 模板\n│   ├── dist # 构建产物\n│   │   ├── index.html\n│   │   └── static\n│   │       ├── images\n│   │       │   └── favicon.ico\n│   │       ├── scripts\n│   │       │   ├── app.66734.js\n│   │       │   ├── app.66734.js.LICENSE.txt\n│   │       │   └── common.05092.js\n│   │       └── styles\n│   │           └── app.78e30.css\n│   ├── package.json\n│   ├── src\n│   │   ├── app.jsx # 必须 主入口文件\n│   │   ├── assets\n│   │   │   ├── images\n│   │   │   │   └── favicon.ico\n│   │   │   └── styles\n│   │   │       ├── animate.scss\n│   │   │       ├── common.scss\n│   │   │       └── variable.scss\n│   │   ├── index.html # 必须 主入口 html\n│   │   ├── index.scss\n│   │   ├── pages\n│   │   │   ├── app.jsx\n│   │   │   ├── index.scss\n│   │   │   └── views\n│   │   │       ├── index.jsx\n│   │   │       └── other.jsx\n│   │   └── source\n│   │       ├── auth.js\n│   │       ├── http.js\n│   │       └── storage.js\n│   ├── water.config.js # 必须 cli 核心配置文件\n│   └── yarn.lock\n├── react-ts # react typescript 模板\n│   ├── dist # 构建产物\n│   │   ├── index.html\n│   │   └── static\n│   │       ├── scripts\n│   │       │   ├── app.870da.js\n│   │       │   ├── app.870da.js.LICENSE.txt\n│   │       │   └── common.05092.js\n│   │       └── styles\n│   │           └── app.78e30.css\n│   ├── package.json\n│   ├── src\n│   │   ├── app.tsx # 必须 主入口文件\n│   │   ├── assets\n│   │   │   ├── images\n│   │   │   │   └── favicon.ico\n│   │   │   └── styles\n│   │   │       ├── animate.scss\n│   │   │       ├── common.scss\n│   │   │       └── variable.scss\n│   │   ├── index.html # 必须 主入口 html\n│   │   ├── index.scss\n│   │   ├── pages\n│   │   │   ├── app.tsx\n│   │   │   ├── index.scss\n│   │   │   └── views\n│   │   │       ├── index.tsx\n│   │   │       └── other.tsx\n│   │   └── source\n│   │       ├── auth.ts\n│   │       ├── http.ts\n│   │       └── storage.ts\n│   ├── tsconfig.json # typescript 配置文件\n│   ├── water.config.js # 必须 cli 核心配置文件\n│   └── yarn.lock\n├── vue # vue js 模板\n│   ├── dist # 构建产物\n│   │   ├── index.html\n│   │   └── static\n│   │       ├── images\n│   │       │   └── favicon.ico\n│   │       ├── scripts\n│   │       │   ├── app.9a6e3.js\n│   │       │   ├── app.9a6e3.js.LICENSE.txt\n│   │       │   └── common.05092.js\n│   │       └── styles\n│   │           └── app.dc868.css\n│   ├── package.json\n│   ├── src\n│   │   ├── app.js # 必须 主入口文件\n│   │   ├── assets\n│   │   │   ├── images\n│   │   │   │   └── favicon.ico\n│   │   │   └── styles\n│   │   │       ├── animate.scss\n│   │   │       ├── common.scss\n│   │   │       └── variable.scss\n│   │   ├── index.html # 必须 主入口 html\n│   │   ├── index.scss\n│   │   ├── pages\n│   │   │   ├── app.vue\n│   │   │   ├── other.vue\n│   │   │   └── routes.js\n│   │   └── source\n│   │       ├── auth.js\n│   │       ├── http.js\n│   │       └── storage.js\n│   ├── water.config.js # 必须 cli 核心配置文件\n│   └── yarn.lock\n└── vue-ts # vue typescript 模板\n    ├── package.json\n    ├── src\n    │   ├── app.ts # 必须 主入口文件\n    │   ├── assets\n    │   │   ├── images\n    │   │   │   └── favicon.ico\n    │   │   └── styles\n    │   │       ├── animate.scss\n    │   │       ├── common.scss\n    │   │       └── variable.scss\n    │   ├── index.html # 必须 主入口 html\n    │   ├── index.scss\n    │   ├── pages\n    │   │   ├── app.vue\n    │   │   ├── other.vue\n    │   │   └── routes.ts\n    │   └── source\n    │       ├── auth.ts\n    │       ├── http.ts\n    │       └── storage.ts\n    ├── tsconfig.json # typescript 配置文件\n    ├── typings # vue 相关 typescript 全局类型说明\n    │   ├── shims-tsx.d.ts\n    │   └── shims-vue.d.ts\n    ├── water.config.js # 必须 cli 核心配置文件\n    └── yarn.lock\n```\n\n### `water.config.js` 核心配置文件说明\n\n\u003e 构建核心依赖文件，`water` 将读取该配置文件，继而进行相应的行为；\n\u003e\n\u003e 1. `vue` 模板默认对 `element-ui` 支持了按需加载\n\u003e 2. `react` 模板默认对 `antd` 支持了按需加载\n\n```javascript\n// 接口前缀\nconst apiPrefix = \"https://api.test.example.com\";\n// const apiPrefix = \"https://api.test.example.com\";\n\nconst proxyMapping = {};\n// 接口 uri 前缀\nconst uriPrefix = [\"/api\"];\n\n// 代理映射\nuriPrefix.map(\n  uri =\u003e\n    (proxyMapping[uri] = {\n      target: apiPrefix,\n      changeOrigin: true,\n      secure: false,\n      pathRewrite: {\n        [`^${uri}`]: apiPrefix + uri,\n      },\n    })\n);\n\nmodule.exports = {\n  // 允许端口\n  port: 3001,\n  // 代码 chunk 打包分析端口，仅在生产打包配置才生效，端口自定义\n  analyzerPort: null,\n  // 解析路径，用于映射 src 下路径为 @/source，@/pages， @/assets\n  resolvePath: \"src\",\n  // 读取 app.ts 根路径\n  target: \"./src\",\n  // 打包 chunk 文件 前缀根路径\n  publicPath: \"/\",\n  // 打包导向路径\n  buildPath: \"./dist\",\n  // 复制路径，需要做文件迁移的路径，该目录下文件将被直接转移到 dist 根路径\n  // 比如 微信校验文件、robot.txt 等无项目依赖类型的文件\n  copyPath: \"./src/assets/public\",\n  // api 代理，仅在开发环境生效\n  proxy: proxyMapping,\n  // css 预编译期配置，内置了 less/sass 按需配置\n  css: [\"sass\"],\n  // 内置了 markdown-loader，项目中可将 markdown 文件直接转义为标准 html\n  markdown: false,\n  // 拆包配置，必须配置 ['antd', 'echarts'] 这里将项目中 antd/echarts 相关的包单独打包到 antd.js/echarts.js 中\n  splitPackages: [\"antd\", \"echarts\"],\n  // vue 项目设置为 true\n  vue: true,\n  // react 项目配置\n  react: {\n    // 项目中是否使用了 antd，对于 antd 引入了优化方案，moment 替换 dayjs 的操作\n    antd: true,\n    // 是否覆盖 antd 主题，这里配置好自定义的主题地址即可，cli 会检测文件存在则启用，否则不生效\n    antdLess: \"./src/assets/styles/antd.less\",\n  },\n  // 外部依赖，打包忽略，这里再 water prod 模式才生效\n  externals: {},\n  // TODO 后续将根据使用情况在进行拓展，以上其实已经可以兼容大多数场景\n};\n```\n\n### umd 打包案例\n\n\u003e 参考 `examples/umd` 下案例，主要用于制作公共工具包\n\n- 目录结构\n\n```bash\n.\n├── package.json\n├── src\n│   ├── react\n│   │   └── index.ts # entry 扫描入口\n│   └── react-router\n│       └── index.ts # entry 扫描入口\n└── water.config.js # 核心配置文件\n```\n\n- `water umd -i` 打包\n\n```bash\n# 打包结构\n.\n├── react\n│   ├── index.js\n│   └── index.js.LICENSE.txt\n└── react-router\n    ├── index.js\n    └── index.js.LICENSE.txt\n```\n\n- `water.config.js` 配置文件\n\n```javascript\nmodule.exports = {\n  // 分析 chunk 包明细监听端口\n  analyzerPort: 8888,\n  // 目的路径，默认检索该目录下 **/index.(t|j)s 结构\n  target: \"./src\",\n  // 构建路径\n  buildPath: \"./dist\",\n};\n```\n\n## TODO\n\n1. 模板优化；\n\n- 范例化，增加更多可选支持，比如 element-ui/antd 相关模板支持，再比如 vuex/mobx 相关模板支持，等等；\n\n2. 集成自动化测试；\n\n## 关于我\n\n\u003e 坚持原创，面向大前端，构建前端、数据结构与算法、面经知识体系，共享优质干货，助力更多前端开发者。\n\n1. 公众号「前端艺匠」作者；\n2. [掘金「水逆」](https://juejin.im/user/5872f2578d6d81005896aa48) 作者;\n3. 欢迎交流，大家共同探讨，共享资源，共同进步。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowieyi%2Fwater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhowieyi%2Fwater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowieyi%2Fwater/lists"}