{"_id":"@c42/vue-b","_rev":"7-edf4428e9e6d1d4da65075dcd86cfb68","time":{"0.0.1":"2018-05-28T06:24:10.511Z","created":"2018-05-31T09:20:29.576Z","0.0.3":"2018-05-31T09:20:30.174Z","modified":"2022-04-04T21:25:22.255Z"},"name":"@c42/vue-b","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.3":{"name":"@c42/vue-b","version":"0.0.3","license":"UNLICENSED","private":false,"engines":{"node":">= 8.11.1","npm":">= 5.6.0","yarn":">= 1.6.0"},"scripts":{"dev":"vue-cli-service serve","test":"echo \"No test specified\" && exit 0","lint":"npm run eslint && npm run stylelint && npm run styluslint","eslint":"eslint . --ext .js,.vue --fix --format node_modules/eslint-friendly-formatter","stylelint":"stylelint \"src/**/*.(vue|html|css)\" --fix --config src/.stylelintrc.js","styluslint":"stylus-supremacy format src/**/*.styl --replace --options src/.styluslintrc.json","build":"vue-cli-service build","start":"start-storybook -p 9001 -c .storybook","build-storybook":"build-storybook","prepublishOnly":"npm run build && echo export { default } from './dist/main.js' > index.js","postpublish":"echo export { default } from './src/export.js' > index.js"},"main":"index.js","files":["dist","index.js"],"browserslist":["> 1%","> 1% in CN","last 3 versions","chrome > 30","not ie <= 8","not op_mini all"],"husky":{"hooks":{"pre-commit":"npm run lint"}},"postcss":{"plugins":{"autoprefixer":{}}},"dependencies":{"@c42/commons":"^18.0.1","axios":"^0.18.0","babel-polyfill":"^6.26.0","dayjs":"^1.6.4","feathers-vuex":"^1.4.2","is-odd":"^2.0.0","is-thirteen":"^2.0.0","vue":"^2.5.16","vue-router":"^3.0.1","vuex":"^3.0.1"},"devDependencies":{"@storybook/vue":"^3.4.6","@vue/cli-plugin-babel":"^3.0.0-beta.12","@vue/cli-service":"^3.0.0-beta.12","babel-eslint":"^8.2.3","eslint":"^4.19.1","eslint-config-airbnb-base":"^12.1.0","eslint-config-google":"^0.9.1","eslint-config-prettier":"^2.9.0","eslint-config-standard":"^11.0.0","eslint-friendly-formatter":"^4.0.1","eslint-plugin-import":"^2.12.0","eslint-plugin-node":"^6.0.1","eslint-plugin-prettier":"^2.6.0","eslint-plugin-promise":"^3.8.0","eslint-plugin-security":"^1.4.0","eslint-plugin-standard":"^3.1.0","eslint-plugin-vue":"^4.5.0","husky":"^1.0.0-rc.2","prettier":"^1.13.2","stylelint":"9.2.0","stylelint-config-standard":"^18.2.0","stylelint-order":"^0.8.1","stylus":"^0.54.5","stylus-loader":"^3.0.2","stylus-supremacy":"^2.11.0","vue-template-compiler":"^2.5.16","webpack-bundle-analyzer":"^2.13.1","webpack-node-externals":"^1.7.2"},"gitHead":"e21a8ffb8d9e9f05ae0959168b68a947f24a22e1","description":"基于 [vue](https://vuejs.org/) 的前端项目样板","_id":"@c42/vue-b@0.0.3","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"beeplin","email":"beeplin@gmail.com"},"dist":{"integrity":"sha512-78fkOdV6DBFzpr6dlOnF6jKS2WruyFItlxPeQHD7DFsQIuaEZZzbT2khdgPOm2alSOfqTacFBBptgqn0UzOlVg==","shasum":"e9dac19a2b8ca962aa69251826f9d68a412f7694","tarball":"https://registry.npmjs.org/@c42/vue-b/-/vue-b-0.0.3.tgz","fileCount":5,"unpackedSize":156086,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbD75eCRA9TVsSAnZWagAAojQP/RfJOHQ3JOAGSaVa7URI\n0NY/ZUB6sODlK4SGZY12ZHpUkvbTG4/FokUISHa0fcHGM7T76mym6hWCWRi9\niF7VLZGQTFvUTP52bCIQvF6L+J7ZkpTr2w1JpRbg0Cy3A2NCxNYCG0NMzW0K\nfuvEe0iv5rJmq4jed44K1jiEobnGkuY5KtMkuVSvvod9WfSn282GNqNPnBPp\neYeAbm7dh4TJqIVNz3dtD4Bz3TahwHtmPau2lO/ztMuW20/woXvPHj/J2jfC\niAlNMU+SwdGsrxkf+xDCbJSQ0rWDlCMMdwOHuColj6CxFFpjPpm/K+Hp7q5a\n5c1l39Us4rqUHgHS+waCzcvjT2pWsp0Oe6q5DPaCjeavE0SUiR26jN7/klUu\nMf4rdTWjq+SCBrY5MhV8SIWfIOP0E4W2xgMKQwDp5EMf+s5ZagKEqNMCIBz3\n0cyCZih4gi5PWnoc1r+KS8bMG57a7N/+SUy+xu5KJTTD9ma48q9Rzj4Y5URP\nJFhsGIESCEHAdZ/1pwlejgB0putqE9pvgUlhXYJZoVlnHq0hEojfL2C4FEyK\n5QVOEMl5AvvIBNWgt/OB6M1K4Jnr+OOHlwy1uJIPeIXkSl/EPFE0w2HJAb5Y\nM7sa31wiPP5U40v8BCPBf3eibfGUizTwsvhPwuSFOm7hCWxTO96gfQCspElc\nq/VH\r\n=cDrY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHqoCZ+SSeMiOYgp8E/+LC0uqGR7RjxCYSVPHHIPxlalAiAKVghtMKUyk63C1pgOvWIbUNubZBPzOQrs5/EQj2GeXw=="}]},"maintainers":[{"name":"beeplin","email":"beeplin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-b_0.0.3_1527758429675_0.8271006376178598"},"_hasShrinkwrap":false}},"maintainers":[{"email":"lanbin_blue@163.com","name":"lanbing45"},{"email":"beeplin@gmail.com","name":"beeplin"}],"description":"基于 [vue](https://vuejs.org/) 的前端项目样板","license":"UNLICENSED","readme":"# c42-template-vue\n\n基于 [vue](https://vuejs.org/) 的前端项目样板\n\n## 安装\n\n按照 [克隆项目](https://code.aliyun.com/alphahr/tasks/tree/master#%E5%85%8B%E9%9A%86%E9%A1%B9%E7%9B%AE) 的提示，克隆本项目到本地，并 copy 到你真正的开发目录。\n\n注意不要 copy /.git 目录，否则会把你真正开发项目的 .git 目录覆盖掉。\n\n如果要使用 linux cp 命令移动项目，注意要加 `-a` 参数，以防遗漏隐藏文件。\n\n克隆并 copy 完毕之后，进入你的开发项目目录，运行 `yarn` 进行初始化安装。强烈建议使用 `yarn` 代替 `npm`\n\n## 开发\n\n```bash\nnpm run dev # 启动 dev server，入口为 src/main.js -> App.vue。支持热重载\n```\n\n项目中 `src/store` `src/router` `src/components` `src/pages` 以及 `src/plugins` 中使用的 feathers、axios 均为示例文件，如项目不需要，请删除。\n\n## Storybook\n\n```bash\nyarn start # 启动 storybook\n```\n\n[storybook](https://storybook.js.org) 是一种组件展示技术，可以展示组件在各种调用环境下的外观和行为，一般用于半自动化测试组件。展示内容列表写在 `./stories/xxx.stories.js` 中。\n\n如果开发的是一个需要对外发布的 vue 组件，当然我们也可以手工构造 `src/main.js` `src/App.vue` 入口，在 `src/App.vue` 中调用你正在开发的组件，然后运行 `npm run dev` 来查看组件行为。\n但是 `storybook` 是一种更方便的预览组件外观和行为的方式，它好处是可以预先定义很多 stories，在每个 story 里面给组件预先传入不同参数，快速预览组件在各种环境下的表现。\n\n当然，storybook 并非组件开发模式专用。如果是开发一个完整的 app，也可以编写 stories 并且利用 storybook 来预览和调试其中的组件。\n\n## lint\n\n```bash\nnpm run lint # 运行 eslint、stylelint、stylues supremacy\n```\n\n每次 git commit 时都会自动先执行 `yarn lint`，所以 commit 一般会花十几秒钟才能完成。\n\n如果 lint 不通过，则拒绝 commit。\n\n## 构建\n\n```bash\nyarn build # 构建并打开构建报告 .build.report.html\n```\n\n1.  如果开发的是一个完整的 vue app，不应该存在 `src/export.js`。此时构建以 `src/main.js` 为入口。\n1.  如果开发的是一个需要对外发布的 vue 组件，应该存在 `src/export.js`。此时构建以 `src/export.js` 为入口。\n\n**请注意，`src/export.js` 文件是否存在，决定了构建的入口以及其他很多具体行为。`src/export.js` 非常重要！**\n\n打包得到的 bundle 文件位置： `./dist/main.js`。如果开发的是一个需要对外发布的 vue 组件，则 bundle 中并不包含 `node_modules` 里面的模块。\n\n构建完成后相关报告会保存在 `.build.report.html` 中。\n\n## 配置\n\n配置文件：`/vue.config.js`。参见 [https://github.com/vuejs/vue-cli/blob/dev/docs/config.md](https://github.com/vuejs/vue-cli/blob/dev/docs/config.md)。\n\n如果开发的是一个需要对外发布的 vue 组件，请勿设置 `css.extract = true`，也不要修改 `baseUrl` `outputDir` 等。\n\n## 发布\n\n如果开发的是一个需要对外发布的 vue 组件，由 `src/export.js` 指定哪个文件是要对外发布的模块的入口。发布流程为：\n\n```bash\nnpm version major|minor|patch # 发布前要先根据本次修改的性质升级版本号\nnpm publish # 之前需要先注册并登录 npmjs.com 帐号，并确保正在使用 npmjs.com 官方源。可以使用 nrm 来切换源。\n```\n\n如果开发的是一个完整的 app，则并不存在发布这个概念。**在此情况下，为了防止误操作发布，请设置 `package.json` 中的 `private` 字段为 `true`。**\n\n## Caveats\n\n如果开发的是一个需要对外发布的 vue 组件，组件内部不能使用异步加载子组件的语法加载其他**自定义**子组件或模块。也就是不能写：\n\n```js\nexport default {\n  components: {\n    Child: () => import('path/to/child'),\n  },\n}\n```\n\n只能写：\n\n```js\nimport Child from 'path/to/child'\n\nexport default {\n  components: {\n    Child,\n  },\n}\n```\n\n但是可以异步加载*第三方*组件或模块。也就是可以写：\n\n```js\nexport default {\n  async mounted() {\n    const something = await import('something') // something 是第三方组件名，也就是 npm 包名\n  },\n}\n```\n\n所谓“自定义”和“第三方”组件、模块的区别，就是 `require` 或 `import` 的路径是否以 `./` 或 `../` 开头。自定义组件和模块是写在自己项目中并用相对路径引用的模块，而第三方组件和模块是通过 npm 安装在 `node_modules` 下的模块。\n","readmeFilename":"README.md"}