From 6789f87ca80de13ff003cd65d0b0dd57181347be Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Wed, 15 Jun 2022 01:22:52 +0800 Subject: [PATCH] chore: use workspaces. --- .github/workflows/ci.yml | 15 +++++++-------- lerna.json | 20 +------------------- package.json | 27 ++++++++++++++------------- packages/less-modules/package.json | 3 +++ packages/raw-modules/package.json | 3 +++ packages/react-library/package.json | 3 +++ packages/stylus-modules/package.json | 3 +++ 7 files changed, 34 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 439eca13..6595336b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,10 @@ jobs: windows: runs-on: windows-2019 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 16 - name: Look Changelog uses: jaywcjlove/changelog-generator@v1.5.0 @@ -30,13 +30,12 @@ jobs: build: runs-on: ubuntu-18.04 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 16 - - run: npm install --unsafe-perm - - run: npm run hoist + - run: npm install - run: npm run kkt:build - run: npm run lib:build diff --git a/lerna.json b/lerna.json index eda1d125..e5fa20ea 100644 --- a/lerna.json +++ b/lerna.json @@ -1,23 +1,5 @@ { "version": "independent", "packages": ["core", "example/*", "packages/*"], - "command": { - "create": { - "homepage": "https://github.com/kktjs/kkt", - "license": "MIT" - }, - "version": { - "allowBranch": "master", - "exact": true, - "message": "chore(release): %s" - }, - "bootstrap": { - "npmClientArgs": ["--no-package-lock"], - "yarnClientArgs": ["--no-yarn-lock"], - "forceLocal": true - }, - "publish": { - "ignorePrepublish": true - } - } + "useWorkspaces": true } diff --git a/package.json b/package.json index 00b45732..4b793a53 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,4 @@ { - "name": "kkt", "description": "Create React apps with no build configuration, Cli tool for creating react apps.", "author": "Kenny Wong (https://github.com/jaywcjlove)", "private": true, @@ -25,12 +24,6 @@ "kkt:coverage": "lerna exec \"tsbb test --coverage\" --scope kkt", "kkt:<<<-----": "<<<<<<<<<<<<<<<<<<<<<<<<<<<", "build": "npm run kkt:build && npm run lib:build", - "hoist": "lerna bootstrap --hoist", - "bootstrap": "lerna bootstrap", - "bootstrap:kkt": "lerna bootstrap --scope kkt", - "bootstrap:basic": "lerna bootstrap --scope @template/basic", - "bootstrap:markdown": "lerna bootstrap --scope @template/markdown", - "bootstrap:example": "lerna bootstrap --scope @template/*", "version": "lerna version --no-changelog --no-git-tag-version --no-push", "publish": "npm run build && lerna publish from-package", "ci:publish": "lerna publish from-package --yes", @@ -42,16 +35,24 @@ "lerna": "lerna" }, "engines": { - "node": ">=12.0.0" + "node": ">=16.0.0" + }, + "workspaces": { + "packages": [ + "core", + "example/*", + "packages/*" + ] }, "lint-staged": { "*.{js,jsx,tsx,ts,less,md,json}": "prettier --write" }, "devDependencies": { - "husky": "~7.0.4", - "lerna": "~4.0.0", - "lint-staged": "~12.3.7", - "prettier": "~2.6.0", - "tsbb": "~3.7.0" + "@babel/runtime": "^7.18.3", + "husky": "~8.0.0", + "lerna": "~5.1.0", + "lint-staged": "~13.0.0", + "prettier": "~2.7.0", + "tsbb": "^3.7.5" } } diff --git a/packages/less-modules/package.json b/packages/less-modules/package.json index ada8b96e..e752f2cf 100644 --- a/packages/less-modules/package.json +++ b/packages/less-modules/package.json @@ -17,6 +17,9 @@ "lib", "src" ], + "scripts": { + "watch": "tsbb watch --no-esm" + }, "dependencies": { "less": "^4.1.2", "less-loader": "^10.2.0" diff --git a/packages/raw-modules/package.json b/packages/raw-modules/package.json index a215c263..8efad629 100644 --- a/packages/raw-modules/package.json +++ b/packages/raw-modules/package.json @@ -16,6 +16,9 @@ "lib", "src" ], + "scripts": { + "watch": "tsbb watch --no-esm" + }, "dependencies": { "raw-loader": "^4.0.2" }, diff --git a/packages/react-library/package.json b/packages/react-library/package.json index ccdb66e4..3fe99e7b 100644 --- a/packages/react-library/package.json +++ b/packages/react-library/package.json @@ -20,6 +20,9 @@ "lib", "src" ], + "scripts": { + "watch": "tsbb watch --no-esm" + }, "dependencies": { "css-minimizer-webpack-plugin": "~3.4.1" }, diff --git a/packages/stylus-modules/package.json b/packages/stylus-modules/package.json index 00b2d5c2..ecb63a60 100644 --- a/packages/stylus-modules/package.json +++ b/packages/stylus-modules/package.json @@ -18,6 +18,9 @@ "lib", "src" ], + "scripts": { + "watch": "tsbb watch --no-esm" + }, "dependencies": { "stylus": "^0.57.0", "stylus-loader": "^6.2.0"