{"id":18484134,"url":"https://github.com/jdf2e/gaea4","last_synced_at":"2025-10-12T14:45:43.029Z","repository":{"id":57243742,"uuid":"155173050","full_name":"jdf2e/Gaea4","owner":"jdf2e","description":"Vue单页面应用脚手架Gaea 4.0","archived":false,"fork":false,"pushed_at":"2020-03-19T06:28:10.000Z","size":1022,"stargazers_count":156,"open_issues_count":6,"forks_count":23,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-10-06T22:44:24.840Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jdf2e.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":"2018-10-29T07:57:13.000Z","updated_at":"2025-06-03T03:11:14.000Z","dependencies_parsed_at":"2022-09-15T12:02:12.060Z","dependency_job_id":null,"html_url":"https://github.com/jdf2e/Gaea4","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jdf2e/Gaea4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2FGaea4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2FGaea4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2FGaea4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2FGaea4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdf2e","download_url":"https://codeload.github.com/jdf2e/Gaea4/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2FGaea4/sbom","scorecard":{"id":512477,"data":{"date":"2025-08-11","repo":{"name":"github.com/jdf2e/Gaea4","commit":"45d23e615c369d9dbde2bc948446ec5d14c38797"},"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":"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":"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":"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":"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/30 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":"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-20T00:57:06.056Z","repository_id":57243742,"created_at":"2025-08-20T00:57:06.056Z","updated_at":"2025-08-20T00:57:06.056Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011611,"owners_count":26084964,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"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":[],"created_at":"2024-11-06T12:38:40.943Z","updated_at":"2025-10-12T14:45:42.982Z","avatar_url":"https://github.com/jdf2e.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gaea\n\u003e Vue技术栈单页面构建工具\n\n## Getting Started\nGaea构建工具是基于Node.js、Webpack模版工程等的Vue技术栈的整套解决方案，包含了开发、调试、打包上线完整的工作流程\n\n### Prerequisites\n请先安装node，版本大于10.15.0，如果没有安装，请前往[安装](https://nodejs.org/zh-cn/)\n\n### Installing\n1. `npm i gaea-cmd -g` 全局安装\n2. `g2 init projectName（gaea init projectName)` 初始化项目,项目名字和目录名字一致会默认在当前文件下生成模版\n3. `npm i` 安装依赖\n4. `npm run dll` 编译第三方库\n\n### Npm Scripts\n- `npm run dev` 开发\n- `npm run build` 打包编译\n- `npm run upload` 上传\n- `npm run lint` 代码检查、格式化\n- `npm run carefree` 真机调试\n- `npm run skeleton` 骨架屏注入\n- `npm run compress` 图片压缩转换\n\n## Feature\n* Webpack4.0 + Babel7\n* [Vuex](https://vuex.vuejs.org/zh/guide/)\n* [一键上传](https://www.npmjs.com/package/@nutui/upload)\n* [TypeScript](https://www.typescriptlang.org/)\n* [Smock](https://smock.jd.com)\n* [NutUI2.0](https://nutui.jd.com)\n* [按需加载组件](https://www.npmjs.com/package/@nutui/babel-plugin-separate-import)\n* [CareFree](https://carefree.jd.com)\n* Skeleton\n* ESlint、Prettier\n* TinyPNG图片压缩、Webp转换\n\n## Usage\n安装后，使用之前还需要配置上线路径、项目信息等\n\n### `webpack.config.js` 配置上传\n配置上传测试服务器地址和路径，具体可[参看](https://www.npmjs.com/package/@nutui/upload)，配置上传的host、用户名username、密码password、上传地址target\nexample\n```bash\nnew WebpackUploadPlugin({\n    source:'build',\n    ignoreRegexp:/node_moudles/,\n    httpOption:{\n        host:'测试服务器地址',\n        port:3000,\n        username:'',\n        password:'',\n        target:`/var/www/html/${config.ftpServer}/${config.ftpTarget}`\n   }\n})\n```\n\n### `webpack.config.js` 配置真机调试\n配置carefree真机调试，具体可[参看](https://carefree.jd.com/)，例如：我们将开发阶段的代码打包上传至测试域名page.jd.com，用于真机扫二维码调试\nexample\n```bash\nnew Carefree({\n    justUseWifi: false,\n    publicPath: '//page.jd.com/'+config.ftpTarget+'/'+config.version+'/',\n    ftp: {\n        host: '测试服务器地址',\n        port: 3000,\n        source: 'build',\n        target: '/var/www/html/page.jd.com/'+config.ftpTarget+'/'\n    }\n})\n```\n\n### `webpack.dll.config.js` 配置第三库依赖\n目前的第三方库有 vue、qs、axios、vue-router等，如果增加和删除的话，可以更改字符串：\"vue,qs,axios,vue-router\" ;重新执行npm run dll \n\n### `package.json` 配置项目信息\n* name 项目名称\n* version 项目版本，控制上线静态资源版本 例如： `https://static.360buyimg.com/exploit/mtelink/1.0.0/js/app.js`\n* publicPath  项目上线 html 中静态资源的路径地址前缀 例如：`//static.360buyimg.com/exploit/mtelink` 如果是html和静态资源都交给后端，那么这个值设置成空就行。\n* ftpServer  项目上传根目录 例如：misc.360buyimg.com |  static.360buyimg.com\n* ftpTarget 项目上传的文件目录 例如：exploit/test | exploit/mtelink 不要以 / 开头，否则会被认为是服务器的根目录。\n* tinypngkey 使用TinyPNG 需要去[官网](https://tinypng.com/developers)注册KEY，填入这个字段，后续就可以用`npm run compress`压缩图片。\n* vendorVersion  第三方依赖库的版本控制，提供第三库在上线后，也需要加版本号上线兜底方案 例如：`https://static.360buyimg.com/exploit/mtelink/lib/vendor.dll.js` |  `https://static.360buyimg.com/exploit/mtelink/lib/1.0.0/vendor.dll.js`\n\n\n## Project Catalog \n1. src目录下的文件功能如下：\n* index.html  页面模板\n* app.js  入口文件\n* app.vue  渲染最高级路由匹配到的组件用的出口vue文件\n* router.js  路由文件，在此文件中配置路由信息\n2. src子目录功能如下：\n* view  存放用作页面视图的vue文件\n* component  存放用作组件的vue文件\n* asset  在其中的css、js、img目录存放css/js/图片文件\n* build目录  存放构建出的文件\n  1.0.0 是业务代码版本上线文件夹，lib/vendor.js 是静态文件第三库，不会随着业务代码更改而变化的。\n3. webpack.config.js 是开发和编译项目的配置文件\n4. webpack.dll.config.js 是编译抽离第三方库的配置文件\n5. static/vendor.dll.js 和 static/vendor-manifest.json 是 npm run dll 生成的第三方库静态文件和索引文件\n\n## Other Features\n\n### 图片压缩篇\n采用TinyPNG node.js API 进行在线压缩图片，并且转换Webp格式文件，需要去[官网](https://tinypng.com/developers)注册KEY，填入`package.json`文件\n`tinypngkey`字段。每个账号每个月有500次的免费上传压缩限制。\n\n### 路由篇\n文件router.js 配置了脚手架的相关路由信息，推荐使用【history】路由。脚手架支持history路由和hash路由。在 router.js 中默认是history路由。它是真实的路由地址，所以需要后台那帮你配置重定向。\n\n比如首页的路由是 http://telink.jd.com/index。那么你的路由的首页也是/index 。\n比如搜索页/search 是不存在后端服务器上的。所以需要你让后端把其余的单页面的路由都重定指向首页的vm。\n\n对于carefree，上传到测试服务器page.jd.com 默认是hash路由，方便大家进行测试\n```bash\nconst router = new VueRouter({\n    mode:carefree?'hash':'history',\n    routes\n});\n```\n\n### 骨架屏篇\n脚手架提供了vue的骨架屏注入方案，在命令行工具选择骨架屏，就会下载骨架屏相对应的模板。\n\nsrc/skeleton 就是基于[vue-server-renderer](https://github.com/vuejs/vue/tree/dev/packages/vue-server-renderer)服务端渲染，抽取手写骨架屏的css 和 html 注入到 打包的html中。\n\nsrc/skeleton/skeleton.vue 文件就是手写的骨架屏组件，推荐只渲染入口页首屏骨架\nnpm run skeleton 就会将src/skeleton/index.html  生成到外层src/index.html\n注入完成后，就可以后续正常开发\n\n### SMOCK篇\nsmock 是开发阶段基于swagger的自动化mock假数据工具，需要配置参数如下：\n修改package.json 中字段，具体可以[参看](https://smock.jd.com/)\n\n```bash\n\"smock\": {\n    \"docPath\": \"\", //ip地址\n    \"realHostName\": \"\" //域名\n  },\n```\n\n### eslint 和 prettier篇\n脚手架支持`npm run lint` 一键检查和格式化src目录下的业务`.js`,`.vue`文件，遵循[standard](https://standardjs.com/),[eslint-plugin-vue](https://eslint.vuejs.org/)标准。关闭了一些严格的要求，如果有个性化需求可以在Webpack模版工程下的`.eslintrc.js`文件设置规则。\n\n重点是，由于加了eslintrc相关文件，`Vscode`等编辑器会提示报错，体验比较糟糕，为了不影响开发心情，可以关闭Vscode的提示，只在需要的时候执行一遍命令，就可以自动修改和提示需要修复的报错。\n\n## Note\n* 上线逻辑，前后端分离上线，lib/vendor.js 属于第三方库会发生变动机会比较小，所以在后续迭代可以不需要上线，只需要上线1.0.0/或者1.0.1/版本的文件\n* 如果是覆盖上线，需要统一一次刷新cdn所有静态资源路径，因为整个build包是一个整体。如果是流量较高的业务，建议新增版本上线，覆盖版本上线有小风险。\n* 使用carefree时候，注意自己的cmd等是黑色背景主体，不然二维码是反的。\n\n## Plan\n[开发计划](https://github.com/jdf2e/Gaea4/blob/master/PLANS.md)\n\n## Change Log\n[更新日志](https://github.com/jdf2e/Gaea4/blob/master/CHANGELOG.md)\n\n## License\nMIT License - [LICENSE](./LICENSE)\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdf2e%2Fgaea4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdf2e%2Fgaea4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdf2e%2Fgaea4/lists"}