{"id":20226122,"url":"https://github.com/steamerjs/steamer-plugin-kit","last_synced_at":"2025-04-10T17:06:26.980Z","repository":{"id":57370605,"uuid":"63266000","full_name":"steamerjs/steamer-plugin-kit","owner":"steamerjs","description":"steamerjs脚手架管理工具","archived":false,"fork":false,"pushed_at":"2018-09-21T02:49:00.000Z","size":485,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T14:46:29.080Z","etag":null,"topics":["boilerplate","starterkit","steamerjs"],"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/steamerjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-07-13T17:26:12.000Z","updated_at":"2018-09-21T02:42:04.000Z","dependencies_parsed_at":"2022-08-29T17:02:42.807Z","dependency_job_id":null,"html_url":"https://github.com/steamerjs/steamer-plugin-kit","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-plugin-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-plugin-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-plugin-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-plugin-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steamerjs","download_url":"https://codeload.github.com/steamerjs/steamer-plugin-kit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248112685,"owners_count":21049697,"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":["boilerplate","starterkit","steamerjs"],"created_at":"2024-11-14T07:16:24.521Z","updated_at":"2025-04-10T17:06:26.958Z","avatar_url":"https://github.com/steamerjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# steamer-plugin-kit\n\nstarter kit 管理命令\n\n[![NPM Version](https://img.shields.io/npm/v/steamer-plugin-kit.svg?style=flat)](https://www.npmjs.com/package/steamer-plugin-kit)\n[![Travis](https://img.shields.io/travis/steamerjs/steamer-plugin-kit.svg)](https://travis-ci.org/steamerjs/steamer-plugin-kit)\n[![AppVeyor](https://img.shields.io/appveyor/ci/lcxfs1991/steamer-plugin-kit.svg)](https://ci.appveyor.com/project/lcxfs1991/steamer-plugin-kit)\n[![Deps](https://img.shields.io/david/steamerjs/steamer-plugin-kit.svg)](https://david-dm.org/steamerjs/steamer-plugin-kit)\n[![Coverage](https://img.shields.io/coveralls/steamerjs/steamer-plugin-kit.svg)](https://coveralls.io/github/steamerjs/steamer-plugin-kit)\n\n## 内置\n`steamer-plugin-kit` 已经默认作为 `steamerjs` 的内置插件，全局安装 `steamerjs` 后即可使用。如果你额外安装 `steamer-plugin-kit`，则会优先使用这个额外安装的包。\n\n## 安装\n以下命令全局安装 `steamerjs` 或 `steamer-plugin-kit`，使用时如遇到问题，可先参见文档[[常见问题]](https://steamerjs.github.io/docs/introduction/Steamer-QA.html)，可能是没设置好 `NODE_PATH`\n\n```javascript\n// 必须\nnpm i -g steamerjs\n\n// v2.0 已经内置到 steamerjs，因此可不安装\nnpm i -g steamer-plugin-kit\n```\n\n## 设置 `NODE_PATH`\n\n由于 `steamerjs` 的命令或脚手架都需要全局安装，尽管steamerjs会尝试兼容，但在某些使用场景下会仍然找到不全局安装的位置，因此推荐设置环境变量 `NODE_PATH`。\n\n[常见问题 - NODE_PATH设置](https://steamerjs.github.io/docs/introduction/Steamer-QA.html)\n\n## 更新\n```\nnpm i -g steamer-plugin-kit@latest\n\n// 或者\nsteamer update\n```\n\n## 添加脚手架\n```javascript\n// 添加最新版本\nsteamer kit --add https://github.com/steamerjs/steamer-react.git\n\n// 添加指定tag版本\nsteamer kit --add https://github.com/steamerjs/steamer-react.git --tag v3.0.7\n```\n\n## 基于脚手架初始化项目\n```javascript\n// 运行命令，并进行选择\nsteamer kit\n\n? Which starterkit do you wanna install:  (Use arrow keys)\n❯ steamer-react - alloyteam react starterkit\n  steamer-vue - alloyteam vue starterkit\n  steamer-simple - alloyteam frameworkless starterkit\n? Which version do you need:  (Use arrow keys)\n❯ 3.0.8\n  3.0.5\n? Which folder is your project in:  (./)\n```\n\n## 更新脚手架\n```javascript\nsteamer kit --update --global\n\n? Which starterkit do you wanna update:  (Use arrow keys)\n❯ all starterkits\n  steamer-react - alloyteam react starterkit\n  steamer-vue - alloyteam vue starterkit\n  steamer-simple - alloyteam frameworkless starterkit\n```\n\n## 更新项目使用的脚手架\n```javascript\ncd project\nsteamer kit --update\n```\n\n## 查看可用脚手架\n```javascript\nsteamer kit  --list\n// 或\nsteamer kit -l\n\nYou can use following starterkits:\n* steamer-react\n    - ver: 3.0.8\n    - des: alloyteam react starterkit\n    - url: https://github.com/steamerjs/steamer-react.git\n* steamer-vue\n    - ver: 3.0.5\n    - des: alloyteam vue starterkit\n    - url: https://github.com/steamerjs/steamer-vue.git\n* steamer-simple\n    - ver: 3.0.3\n    - des: alloyteam frameworkless starterkit\n    - url: https://github.com/steamerjs/steamer-simple.git\n```\n\n## 脚手架数据\n```javascript\n// 添加脚手架后，数据会存放在 $HOME/.steamer/starterkits/ 下面，脚手架的相关信息也会存放在 starterkit.js 中\n// 示例信息如下：\nkits = {\n  list: {\n      'steamer-react': {\n          latestVersion: '3.0.8',\n          currentVersion: '3.0.8',\n          description: '',\n          versions: [\n            '3.0.8',\n            '3.0.5'\n          ],\n          url: ''\n      }\n  },\n  timestamp: ''\n};\n```\n\n## 基于模板生成页面\n```javascript\nsteamer kit --template\n// or\nsteamer kit -t\n\n// 初次使用时做好配置，然后选择模板\n? type the template source folder: ./tools/template\n? type your template destination folder:  ./src/page\n? type your npm command(npm|tnpm|cnpm etc):  npm\n? which template do you like:  (Use arrow keys)\n❯ preact-list\n  react-simple-mobx\n  react-simple-redux\n  react-spa-mobx\n  react-spa-redux\n  react-typescript\n```\n\n## 脚手架生命周期\n3.0.0 版本后，新增脚手架生命周期，例如，如果脚手架叫做 `steamer-example`，则在脚手架相关配置文件 `.steamer/steamer-example.js` 中可以写如下生命周期：\n\n```javascript\nconst path = require(\"path\");\nconst fs = require(\"fs\");\n\nmodule.exports = {\n    /**\n     * some other codes here\n     */\n\n    // 初始化脚手架时，在拷贝文件发生前\n    beforeInstallCopy: function (answers, folderPath) {\n        console.log('====beforeInstallCopy====');\n    },\n\n    // 初始化脚手架时，在拷贝文件发生后\n    afterInstallCopy: function (answers, folderPath) {\n        console.log('====afterInstallCopy====');\n    },\n\n    // 初始化脚手架时，在安装依赖发生前\n    beforeInstallDep: function (answers, folderPath) {\n        console.log('====afterInstallDep====');\n    },\n\n    // 初始化脚手架时，在安装依赖发生后\n    afterInstallDep: function (answers, folderPath) {\n        console.log('====afterInstallDep====');\n    },\n\n    // 更新本地项目脚手架时，在拷贝文件发生前\n    beforeUpdateCopy: function (answers, folderPath) {\n        console.log('====beforeUpdateCopy====');\n    },\n\n    // 更新本地项目脚手架时，在拷贝文件发生后\n    afterUpdateCopy: function (answers, folderPath) {\n        console.log('====afterUpdateCopy====');\n    },\n\n    // 更新本地项目脚手架时，在更新依赖发生前\n    beforeUpdateDep: function (answers, folderPath) {\n        console.log('====beforeUpdateDep====');\n    },\n\n    // 更新本地项目脚手架时，在更新依赖发生后\n    afterUpdateDep: function (answers, folderPath) {\n        console.log('====afterUpdateDep====');\n    },\n\n};\n\n```\n\n## Starter Kit 的例子\n符合 `steamer` 规范的 `Starter Kit`，可以参考 [steamer-example](https://github.com/steamerjs/steamer-example/)，并仿照规范，进行接入。如何想开发，可以使用下面命令初始化：\n\n```javascript\nsteamer develop -k [kit name]\n```\n\n官方 Starter Kit:\n* react starter kit: [steamer-react](https://github.com/steamerjs/steamer-react/)\n* vue starter kit: [steamer-vue](https://github.com/steamerjs/steamer-vue/)\n* 无框架 starter kit: [steamer-simple](https://github.com/steamerjs/steamer-simple/)\n* react 组件开发 starter kit: [steamer-react-component](https://github.com/steamerjs/steamer-react-component/)\n* vue 组件开发 starter kit: [steamer-vue-component](https://github.com/steamerjs/steamer-vue-component/)\n* 无框架 组件开发 starter kit: [steamer-simple-component](https://github.com/steamerjs/steamer-simple-component/)\n* 小工具开发 starter kit: [steamer-logic-component](https://github.com/steamerjs/steamer-logic-component)\n\n## 开发脚手架\n在使用 `steamer develop -k [kit name]` 初始脚手架并开发了一定程序之外，若要在本地测试，可使用以下命令：\n\n```javascript\ncd [starterkit path]\n\nsteamer kit --develop\n// or\nsteamer kit -d\n\n// 如果想用别名，则用\nsteamer kit --develop [alias name]\n// or\nsteamer kit -d [alias name]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamerjs%2Fsteamer-plugin-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteamerjs%2Fsteamer-plugin-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamerjs%2Fsteamer-plugin-kit/lists"}