From 3af36a4a0a8ca4daef074734ad50f45a0393e93c Mon Sep 17 00:00:00 2001 From: Nex Zhu Date: Tue, 26 Dec 2023 18:02:44 +0800 Subject: [PATCH] ci(root): switch back to official @traf/nx with --includeFiles option for package.json,nx.json,project.json --- .github/workflows/ci.yml | 6 ++++-- package.json | 2 +- pnpm-lock.yaml | 36 +++++++++++++++++++++++------------- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e10e3f4..56099f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: with: version: 8 run_install: | - - args: [--global, zx, '@daotl/traf-nx@0.0.17-2'] + - args: [--global, zx, '@traf/nx@^0.0.21'] - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 @@ -61,7 +61,9 @@ jobs: - name: Calculate affected projects id: affected run: | - projs=$(traf-nx affected --base=${NX_BASE} --json=true) + # "traf-nx" needs "@daotl/tsconfig" to be present, workaround for "npm install --no-save” error when "package.json"s exist + echo $(pwd) $(pnpm -r exec pwd) | tr ' ' '\n' | xargs -I'{}' sh -c 'mv {}/package.json {}/package.json.bk; npm install --no-save @daotl/tsconfig; mv {}/package.json.bk {}/package.json' + projs=$(traf-nx affected --base=${NX_BASE} --includeFiles=../package.json,../nx.json,../project.json --json=true) projs=${projs#[} projs=${projs%]} projs=$(echo ${projs} | sed -e 's/\"//g') diff --git a/package.json b/package.json index 43e76d7..f9182db 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@nx/vite": "17.1.3", "@swc-node/register": "~1.6.8", "@swc/core": "~1.3.101", - "@traf/nx": "npm:@daotl/traf-nx@0.0.17-2", + "@traf/nx": "^0.0.21", "@tsconfig/esm": "^1.0.5", "@tsconfig/node20": "^20.1.2", "@tsconfig/strictest": "^2.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0144c86..d98c649 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,8 +45,8 @@ importers: specifier: ~1.3.101 version: 1.3.101 '@traf/nx': - specifier: npm:@daotl/traf-nx@0.0.17-2 - version: /@daotl/traf-nx@0.0.17-2 + specifier: ^0.0.21 + version: 0.0.21(@swc-node/register@1.6.8)(@swc/core@1.3.101) '@tsconfig/esm': specifier: ^1.0.5 version: 1.0.5 @@ -1877,17 +1877,6 @@ packages: validate-npm-package-name: 3.0.0 dev: false - /@daotl/traf-nx@0.0.17-2: - resolution: {integrity: sha512-uLWvPm8LN8VQGpBCJzgcP94e7wXOw9tzAAwUBjhePqcbv34qVGDyOm0OZCt7d5L27sATVg6tg6sE1rRoB8AiCg==} - hasBin: true - dependencies: - chalk: 5.3.0 - fast-find-in-files: 1.0.4 - globby: 13.2.2 - ts-morph: 18.0.0 - yargs: 17.7.2 - dev: false - /@daotl/tsconfig@0.1.2: resolution: {integrity: sha512-A304YsVVpfdqH6lUPo3Yd7TR5egfVevbZcbWNe/336aSxvxFqMC+3QqUIH4cqRmwjqOR2hHsTqYZH/SRhuUdjQ==} dev: true @@ -3411,6 +3400,23 @@ packages: defer-to-connect: 2.0.1 dev: false + /@traf/nx@0.0.21(@swc-node/register@1.6.8)(@swc/core@1.3.101): + resolution: {integrity: sha512-5vKv/XCKaY3Cp5WRkDdINfF4kdyAsOb/mG9eFe9SP3H6HyZ0138RqScUFHvncV+qvYExvA0GH0MNf7ylUqy8bQ==} + hasBin: true + dependencies: + chalk: 5.3.0 + fast-find-in-files: 1.0.4 + globby: 13.2.2 + microdiff: 1.3.2 + nx: 17.1.3(@swc-node/register@1.6.8)(@swc/core@1.3.101) + ts-morph: 18.0.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@swc-node/register' + - '@swc/core' + - debug + dev: false + /@ts-morph/common@0.19.0: resolution: {integrity: sha512-Unz/WHmd4pGax91rdIKWi51wnVUW11QttMEPpBiBgIewnc9UQIX7UDLxr5vRlqeByXCwhkF6VabSsI0raWcyAQ==} dependencies: @@ -7220,6 +7226,10 @@ packages: resolution: {integrity: sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==} dev: false + /microdiff@1.3.2: + resolution: {integrity: sha512-pKy60S2febliZIbwdfEQKTtL5bLNxOyiRRmD400gueYl9XcHyNGxzHSlJWn9IMHwYXT0yohPYL08+bGozVk8cQ==} + dev: false + /micromark@2.11.4: resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} dependencies: