{"id":25322696,"url":"https://github.com/qzruncode/sww-template","last_synced_at":"2025-04-07T22:41:36.172Z","repository":{"id":65549262,"uuid":"457265037","full_name":"qzruncode/sww-template","owner":"qzruncode","description":"Template Project for cacheweb-webpack-plugin","archived":false,"fork":false,"pushed_at":"2022-02-27T13:51:37.000Z","size":461,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T23:47:31.801Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qzruncode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-09T08:07:27.000Z","updated_at":"2022-02-10T08:04:32.000Z","dependencies_parsed_at":"2023-01-28T19:35:10.410Z","dependency_job_id":null,"html_url":"https://github.com/qzruncode/sww-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qzruncode%2Fsww-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qzruncode%2Fsww-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qzruncode%2Fsww-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qzruncode%2Fsww-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qzruncode","download_url":"https://codeload.github.com/qzruncode/sww-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247744128,"owners_count":20988778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-02-13T23:47:33.798Z","updated_at":"2025-04-07T22:41:36.155Z","avatar_url":"https://github.com/qzruncode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## sww-template\n\n1. 本模板是本人在开发[cacheweb-webpack-plugin](https://www.npmjs.com/package/cacheweb-webpack-plugin)时定义的，开箱即用集成了开发前端项目所需要个各种配置。\n2. 使用本模板需要借助[sww-cli](https://www.npmjs.com/package/sww-cli)安装，安装步骤如下\n   \n    ```\n    git init\n    npm install sww-cli\n    npx sww-cli init sww-template\n    npm install\n    npm start 开发\n    npm build 生产\n    ```\n## 模板命令\n\n+ npm start           运行\n+ npm run build       编译\n+ npm run preview     预览\n+ npm run reinstall   重新安装依赖\n+ npm run tsc         验证ts\n+ npm run fix         eslint格式化配合husky使用\n+ npm run prepare     husky预install\n+ 环境变量在根目录.env中声明，代码中通过process.env获取\n\n## 内置开箱即用的husky钩子\n\n+ npx husky add .husky/pre-commit \"npx lint-staged\"\n+ npx husky add .husky/commit-msg 'npx --no-install commitlint --edit \"$1\"'\n+ 利用husky添加pre-commit钩子，在提交到git暂存区之前执行 lint-staged\n  ```\n  lint-staged 执行如下命令\n  \"prettier --write\"  prettier格式化文档\n  \"npm run fix\"       使用eslint修复代码语法格式\n  \"git add\"           提交代码到暂存区\n  ```\n+ 利用husky添加commit-msg钩子，在提交到git暂存区之前验证提交信息的格式\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqzruncode%2Fsww-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqzruncode%2Fsww-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqzruncode%2Fsww-template/lists"}