# nip-node-scripts **Repository Path**: nip-team/nip-node-scripts ## Basic Information - **Project Name**: nip-node-scripts - **Description**: 存放node常用脚本 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-07-16 - **Last Updated**: 2022-11-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # nip-node-scripts node scripts for nip team ## usage ### add nip-node-scripts as submodule ``` git submodule add http://gitee.con/nip-team/nip-node-scripts.git ./scripts git submodule init --recursive --update ``` ### create scripts.packages.js create `scripts.packages.js` under the host packages's root directory and modify the config file ``` module.exports = { env: { office: { registry: { host: "http://192.168.3.100:8081/repository/npm-hosted/", group: "http://192.168.3.100:8081/repository/npm-group/" } }, aliyun: { registry: { host: "http://47.92.81.118:8081/repository/npm-hosted/", group: "http://47.92.81.118:8081/repository/npm-group/" } }, }, packages: [ { package: "@nip/framework", path: "packages/framework" }, { package: "@nip/framework-vue2", path: "packages/framework-vue2" }, { package: "@nip/framework-repo", path: "packages/framework-repo" }, { package: "@nip/bundle-antdv", path: "packages/bundle-antdv" }, { package: "@nip/bundle-sample", path: "packages/bundle-sample" }, { package: "@nip/application-vue2-sample", path: "packages/application-vue2-sample" }, ] } ``` ### add scripts and dependencies to package.json ``` { ... "scripts": { "serve": "node scripts/command.js serve", "lint": "node scripts/command.js lint", "update_version": "node scripts/update.js", "build": "node scripts/command.js build", "publish": "node scripts/command.js publish", "build_and_publish": "node scripts/command.js build_and_publish", "unpublish": "node scripts/command.js unpublish", "remove_node_modules": "node scripts/command.js remove_node_modules", "remove_dist": "node scripts/command.js remove_dist", "clear": "npm run remove_node_modules & npm run remove_dist" }, "devDependencies": { "minimist": "^1.2.6" } ... } ``` ### run scripts install dependencies ``` npm i // or pnpm i ``` update all mono packages version ``` npm run update_version ``` build all mono packages ``` npm run build ``` build specific mono package ``` npm run build -- --packages=@nip/frameworks ``` publish all mono packages ``` npm run publish ``` publish specific mono package ``` npm run publish -- --packages=@nip/frameworks ``` build and publish all mono packages ``` npm run build_and_publish ``` publish specific mono package ``` npm run build_and_publish -- --packages=@nip/frameworks ``` publish to aliyun ``` npm run publish -- --env=aliyun ``` run package's scripts, like lint with --fix options, ``` npm run lint --fix ```