From 9179f5a4ecbfa845243bcbfe3473c457791e2fff Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Wed, 11 May 2022 20:25:15 +0800 Subject: [PATCH] chore: use npm workspaces. --- .github/workflows/ci.yml | 4 ++-- package.json | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a232db9..6b440f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,10 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v2 with: - node-version: 14 + node-version: 16 - run: npm install - - run: npm run hoist + - run: npm install --workspaces - run: npm run build - run: npm run doc diff --git a/package.json b/package.json index 7a55d14..9054901 100644 --- a/package.json +++ b/package.json @@ -3,14 +3,11 @@ "private": true, "scripts": { "⬇️⬇️⬇️⬇️⬇️ package ⬇️⬇️⬇️⬇️⬇️": "▼▼▼▼▼ package ▼▼▼▼▼", - "build": "npm run build:loader", - "build:loader": "lerna exec --scope markdown-react-code-preview-loader -- npm run build", - "watch:loader": "lerna exec --scope markdown-react-code-preview-loader -- npm run watch", + "watch": "npm run-script watch --workspace markdown-react-code-preview-loader", + "build": "npm run-script build --workspace markdown-react-code-preview-loader", + "doc": "npm run-script build --workspace website", + "start": "npm run-script start --workspace website", "⬆️⬆️⬆️⬆️⬆️ package ⬆️⬆️⬆️⬆️⬆️": "▲▲▲▲▲ package ▲▲▲▲▲", - "start": "lerna exec --scope website -- npm run start", - "doc": "lerna exec --scope website -- npm run build", - "bootstrap": "lerna bootstrap", - "hoist": "lerna bootstrap --hoist", "test": "tsbb test", "coverage": "tsbb test --coverage --bail", "prepare": "husky install", @@ -24,6 +21,10 @@ "prettier --write" ] }, + "workspaces": [ + "core", + "website" + ], "jest": { "collectCoverageFrom": [ "/core/src/**/*.{js,jsx,ts,tsx}"