{"id":17806203,"url":"https://github.com/pdsuwwz/test-vue-cli-plugins","last_synced_at":"2026-05-16T09:35:35.016Z","repository":{"id":104173208,"uuid":"372734300","full_name":"pdsuwwz/test-vue-cli-plugins","owner":"pdsuwwz","description":"🦀 Try to create a vue cli plugin.","archived":false,"fork":false,"pushed_at":"2021-06-01T10:26:57.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T23:19:04.161Z","etag":null,"topics":["plugins","vue","vuecli"],"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/pdsuwwz.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-01T07:07:39.000Z","updated_at":"2021-06-01T10:58:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"e100a8f5-f62c-46d2-8f00-d55d40cc4d1d","html_url":"https://github.com/pdsuwwz/test-vue-cli-plugins","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pdsuwwz/test-vue-cli-plugins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsuwwz%2Ftest-vue-cli-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsuwwz%2Ftest-vue-cli-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsuwwz%2Ftest-vue-cli-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsuwwz%2Ftest-vue-cli-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pdsuwwz","download_url":"https://codeload.github.com/pdsuwwz/test-vue-cli-plugins/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsuwwz%2Ftest-vue-cli-plugins/sbom","scorecard":{"id":725617,"data":{"date":"2025-08-11","repo":{"name":"github.com/pdsuwwz/test-vue-cli-plugins","commit":"758d1ec592c7e3e361206ccf16b4d4bcbfee971b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/8 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":"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":"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":"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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-22T12:42:51.857Z","repository_id":104173208,"created_at":"2025-08-22T12:42:51.857Z","updated_at":"2025-08-22T12:42:51.857Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33097027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["plugins","vue","vuecli"],"created_at":"2024-10-27T13:04:45.599Z","updated_at":"2026-05-16T09:35:35.001Z","avatar_url":"https://github.com/pdsuwwz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 自定义 Vue Cli 的实现方法\n\n1、创建一个模板项目，根目录必须包含一个 `preset.json` 文件\n\n在 `preset.json` 中配置 cli 待使用的插件（要注意，这些插件都需要先发布到 npm 上才能够使用）\n\n如： `@wangwenzhang/vue-cli-plugin-ui-base`，这里先把插件名配上，后续再发布\n\n2、为方便预览，这里把插件代码都放到 plugins 文件夹中，这里可以自己创建文件夹，也可以在外部用 lerna 去指定创建到 plugins 文件夹中: `npx lerna create \u003cmodule-name\u003e plugins`\n\n注意文件夹的名字，需要保持 `vue-cli-plugin-` 开头，避免 vue 从 npm 中长时间检索不到该插件\n\n插件名前面已经配置过了，这里也保持一致，文件夹就叫做 `vue-cli-plugin-ui-base`\n\ncli 插件的代码需要放在 `./vue-cli-plugin-ui-base/generator/index.js` 下\n\nindex.js 中需要导出一个函数，函数内可以对 vue 项目代码做一些前置处理，如模板代码注入，依赖修改等：\n\n```js\nmodule.exports = (api) =\u003e {\n  api.render('./template')\n\n  api.injectImports('src/main.js', `import './ui'`)\n\n  api.extendPackage({\n\n    workspaces: [\n      'packages/*'\n    ],\n\n    husky: {\n      hooks: {\n        \"post-merge\": \"lerna bootstrap\"\n      }\n    },\n\n    scripts: {\n      lib: 'lerna run lib',\n      bootstrap: 'lerna bootstrap'\n    },\n\n    devDependencies: {\n      'webpack-node-externals': '^1.7.2',\n      'less-loader': '^4.1.0'\n    }\n  })\n}\n\n```\n\n模板代码暂不赘述，可见仓库源码，核心还是 `generator/index.js`\n\n完了之后就可以把 `vue-cli-plugin-ui-base` 发布到 npm 上了，这里名字起做： `@wangwenzhang/vue-cli-plugin-ui-base`\n\n发布成功后就可以试了，我们找一个空文件夹, 执行如下命令，其中 `\u003cproject-name\u003e` 为目标项目的名字 ：\n\n```bash\nvue create --preset pdsuwwz/test-vue-cli-plugins \u003cproject-name\u003e --packageManager yarn\n```\n\n\n\n参考官方： [插件开发指南](https://cli.vuejs.org/zh/dev-guide/plugin-dev.html#%E5%BC%80%E5%A7%8B)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdsuwwz%2Ftest-vue-cli-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdsuwwz%2Ftest-vue-cli-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdsuwwz%2Ftest-vue-cli-plugins/lists"}