diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 7d11bc285..a1be39f67 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -103,25 +103,25 @@ jobs: # cache-dependency-path: "**/package-lock.json" - name: setup project run: | - echo "::group::install deps" - npm i --ignore-scripts --loglevel=silly - echo "::endgroup::" + npm install --ignore-scripts --loglevel=silly + - name: setup examples + run: | echo "::group::install example javascript" - npm --prefix examples/node/javascript i --ignore-scripts --loglevel=silly + npm run -- dev-setup:examples:js --ignore-scripts --loglevel=silly echo "::endgroup::" echo "::group::install example typescript cjs" - npm --prefix examples/node/typescript/example.cjs i --ignore-scripts --loglevel=silly + npm run -- dev-setup:examples:ts-cjs --ignore-scripts --loglevel=silly echo "::endgroup::" echo "::group::install examples typescript mjs" - npm --prefix examples/node/typescript/example.mjs i --ignore-scripts --loglevel=silly + npm run -- dev-setup:examples:ts-mjs --ignore-scripts --loglevel=silly echo "::endgroup::" - name: setup tools run: | echo "::group::install docs-gen deps" - npm --prefix tools/docs-gen i --ignore-scripts --loglevel=silly + npm run -- dev-setup:docs-gen --ignore-scripts --loglevel=silly echo "::endgroup::" echo "::group::install code-style deps" - npm --prefix tools/code-style i --ignore-scripts --loglevel=silly + npm run -- dev-setup:code-style --ignore-scripts --loglevel=silly echo "::endgroup::" - name: make reports dir run: mkdir -p "$REPORTS_DIR" @@ -509,8 +509,8 @@ jobs: echo "::group::install project" npm install --ignore-scripts --loglevel=silly echo "::endgroup::" - echo "::group::install docs-gen" - npm --prefix tools/docs-gen install --ignore-scripts --loglevel=silly + echo "::group::install docs-gen deps" + npm run -- dev-setup:docs-gen --ignore-scripts --loglevel=silly echo "::endgroup::" - name: api-doc ${{ matrix.target }} run: npm run api-doc:${{ matrix.target }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3126dec1d..b5dd1eabb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,7 +54,7 @@ jobs: run: | set -eux git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com" - git config --local user.name "${GITHUB_ACTOR}" + git config --local user.name "${GITHUB_ACTOR}" - name: Setup Node.js ${{ env.NODE_ACTIVE_LTS }} # see https://github.com/actions/setup-node uses: actions/setup-node@v4 @@ -100,14 +100,25 @@ jobs: node-version: ${{ env.NODE_ACTIVE_LTS }} - name: setup project run: | - echo "::group::install project" npm install --ignore-scripts --include=optional --loglevel=silly + - name: setup examples + run: | + echo "::group::install example javascript" + npm run -- dev-setup:examples:js --ignore-scripts --loglevel=silly + echo "::endgroup::" + echo "::group::install example typescript cjs" + npm run -- dev-setup:examples:ts-cjs --ignore-scripts --loglevel=silly echo "::endgroup::" - echo "::group::install code-style" - npm --prefix tools/code-style install --ignore-scripts --loglevel=silly + echo "::group::install examples typescript mjs" + npm run -- dev-setup:examples:ts-mjs --ignore-scripts --loglevel=silly + echo "::endgroup::" + - name: setup tools + run: | + echo "::group::install docs-gen deps" + npm run -- dev-setup:docs-gen --ignore-scripts --loglevel=silly echo "::endgroup::" - echo "::group::install docs-gen" - npm --prefix tools/docs-gen install --ignore-scripts --loglevel=silly + echo "::group::install code-style deps" + npm run -- dev-setup:code-style --ignore-scripts --loglevel=silly echo "::endgroup::" # no explicit npm build. if a build is required, it should be configured as prepublish/prepublishOnly script of npm. - name: login to registries diff --git a/package.json b/package.json index 2bec2240f..a58eeec7a 100644 --- a/package.json +++ b/package.json @@ -165,19 +165,23 @@ "example": "./examples" }, "scripts": { - "dev-setup": "npm i && run-p --aggregate-output -lc dev-setup:*", - "dev-setup:code-style": "npm --prefix tools/code-style install", + "dev-setup": "npm i && run-p --aggregate-output -lc dev-setup:\\*", "dev-setup:docs-gen": "npm --prefix tools/docs-gen install", + "dev-setup:code-style": "npm --prefix tools/code-style install", + "dev-setup:examples": "run-p --aggregate-output -lc dev-setup:examples:\\*", + "dev-setup:examples:js": "npm --prefix examples/node/javascript i --ignore-scripts", + "dev-setup:examples:ts-cjs": "npm --prefix examples/node/typescript/example.cjs i --ignore-scripts", + "dev-setup:examples:ts-mjs": "npm --prefix examples/node/typescript/example.mjs i --ignore-scripts", "prepublish": "npm run build", "prepublishOnly": "run-s -lc build test", - "build": "run-p --aggregate-output -l build:*", + "build": "run-p --aggregate-output -l build:\\*", "prebuild:node": "rimraf dist.node", "build:node": "tsc -b ./tsconfig.node.json", "prebuild:web": "rimraf dist.web", "build:web": "webpack build", "prebuild:d": "rimraf dist.d", "build:d": "tsc -b ./tsconfig.d.json", - "test": "run-p --aggregate-output -lc test:*", + "test": "run-p --aggregate-output -lc test:\\*", "test:node": "c8 mocha -p", "test:web": "node -e 'console.log(\"TODO: write web test\")'", "test:lint": "tsc --noEmit",