Skip to content

feat(nx-cloud): organize workspace caching with improved input/outputs #10734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/apps_automated_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
pull_request:
workflow_dispatch:

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand All @@ -19,10 +22,16 @@ jobs:
steps:
- uses: actions/checkout@v4


- uses: actions/setup-node@v4
with:
node-version: 23.5.0

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: 'main'

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
Expand All @@ -36,7 +45,7 @@ jobs:
- name: Install NativeScript
run: |
python3 -m pip install --upgrade pip six
npm i -g nativescript --ignore-scripts --legacy-peer-deps
npm i -g nativescript --ignore-scripts
ns usage-reporting disable
ns error-reporting disable

Expand All @@ -57,4 +66,4 @@ jobs:
with:
api-level: 34
arch: x86_64
script: node tools/scripts/run-automated.js android
script: npx nx test apps-automated -c=android
12 changes: 10 additions & 2 deletions .github/workflows/apps_automated_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
pull_request:
workflow_dispatch:

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand All @@ -27,9 +30,14 @@ jobs:
with:
node-version: 23.5.0

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: 'main'

- name: Install NativeScript
run: |
npm i -g nativescript --ignore-scripts --legacy-peer-deps
npm i -g nativescript --ignore-scripts
ns usage-reporting disable
ns error-reporting disable
# ns doctor
Expand All @@ -47,4 +55,4 @@ jobs:
os_version: '17.5'

- name: Run tests on iOS Simulator
run: node tools/scripts/run-automated.js ios
run: npx nx test apps-automated -c=ios
6 changes: 6 additions & 0 deletions .github/workflows/npm_release_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

env:
NPM_TAG: 'next'
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

jobs:
release:
Expand All @@ -20,6 +21,11 @@ jobs:
- name: Setup
run: npm run setup

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: 'main'

- name: Generate Version
working-directory: packages/core
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm_release_tns_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v2

- name: Setup
run: npm install --legacy-peer-deps
run: npm install

- name: Generate Version
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/npm_release_webpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v2

- name: Setup
run: npm install --legacy-peer-deps
run: npm install

- name: Generate Version
working-directory: packages/webpack
Expand All @@ -32,10 +32,10 @@ jobs:
run: npx nx run webpack:build

- name: Publish @nativescript/webpack
working-directory: dist/packages
working-directory: dist/packages/webpack5
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ../../.npmrc
echo "Publishing @nativescript/webpack@$NPM_VERSION to NPM with tag $NPM_TAG..."
npm publish nativescript-webpack.tgz --tag $NPM_TAG --dry-run
npm publish --tag $NPM_TAG --dry-run
6 changes: 0 additions & 6 deletions apps/automated/.npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion apps/automated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@nativescript/android": "~8.8.0",
"@nativescript/ios": "~8.8.0",
"@nativescript/visionos": "~8.8.0",
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
"@nativescript/webpack": "file:../../dist/packages/webpack5",
"circular-dependency-plugin": "^5.2.2",
"typescript": "~5.6.0"
},
Expand Down
28 changes: 24 additions & 4 deletions apps/automated/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@
"targets": {
"build": {
"executor": "@nativescript/nx:build",
"inputs": ["default", "^production"],
"options": {
"noHmr": true,
"production": true,
"uglify": true,
"release": true,
"forDevice": true
},
"configurations": {}
"configurations": {},
"dependsOn": ["^build"]
},
"debug": {
"executor": "@nativescript/nx:debug",
"inputs": ["default", "^production"],
"options": {
"noHmr": true,
"debug": false,
Expand All @@ -30,10 +33,12 @@
"forDevice": false,
"prepare": false
},
"configurations": {}
"configurations": {},
"dependsOn": ["^build"]
},
"prepare": {
"executor": "@nativescript/nx:prepare",
"inputs": ["default", "^production"],
"options": {
"noHmr": true,
"production": true,
Expand All @@ -42,7 +47,21 @@
"forDevice": true,
"prepare": true
},
"configurations": {}
"configurations": {},
"dependsOn": ["^build"]
},
"test": {
"executor": "nx:run-commands",
"defaultConfiguration": "ios",
"configurations": {
"ios": {
"commands": ["node tools/scripts/run-automated.js ios"]
},
"android": {
"commands": ["node tools/scripts/run-automated.js android"]
}
},
"dependsOn": ["^build"]
},
"clean": {
"executor": "@nativescript/nx:clean",
Expand All @@ -54,5 +73,6 @@
"lintFilePatterns": ["apps/automated/**/*.ts", "apps/automated/src/**/*.html"]
}
}
}
},
"implicitDependencies": ["webpack5"]
}
1 change: 0 additions & 1 deletion apps/toolbox/.npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion apps/toolbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@nativescript/android": "~8.8.0",
"@nativescript/ios": "~8.8.0",
"@nativescript/visionos": "~8.8.0",
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
"@nativescript/webpack": "file:../../dist/packages/webpack5",
"typescript": "~5.6.0"
}
}
12 changes: 8 additions & 4 deletions apps/toolbox/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"release": true,
"forDevice": true
},
"configurations": {}
"configurations": {},
"dependsOn": ["^build"]
},
"debug": {
"executor": "@nativescript/nx:debug",
Expand All @@ -29,7 +30,8 @@
"forDevice": false,
"prepare": false
},
"configurations": {}
"configurations": {},
"dependsOn": ["^build"]
},
"prepare": {
"executor": "@nativescript/nx:prepare",
Expand All @@ -41,7 +43,8 @@
"forDevice": true,
"prepare": true
},
"configurations": {}
"configurations": {},
"dependsOn": ["^build"]
},
"clean": {
"executor": "@nativescript/nx:clean",
Expand All @@ -53,5 +56,6 @@
"lintFilePatterns": ["apps/toolbox/**/*.ts", "apps/toolbox/src/**/*.html"]
}
}
}
},
"implicitDependencies": ["webpack5"]
}
1 change: 0 additions & 1 deletion apps/ui/.npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion apps/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@nativescript/android": "~8.8.0",
"@nativescript/ios": "~8.8.0",
"@nativescript/visionos": "~8.8.0",
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
"@nativescript/webpack": "file:../../dist/packages/webpack5",
"typescript": "~5.6.0"
},
"gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4",
Expand Down
12 changes: 8 additions & 4 deletions apps/ui/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"release": true,
"forDevice": true
},
"configurations": {}
"configurations": {},
"dependsOn": ["^build"]
},
"debug": {
"executor": "@nativescript/nx:debug",
Expand All @@ -29,7 +30,8 @@
"forDevice": false,
"prepare": false
},
"configurations": {}
"configurations": {},
"dependsOn": ["^build"]
},
"prepare": {
"executor": "@nativescript/nx:prepare",
Expand All @@ -41,7 +43,8 @@
"forDevice": true,
"prepare": true
},
"configurations": {}
"configurations": {},
"dependsOn": ["^build"]
},
"clean": {
"executor": "@nativescript/nx:clean",
Expand All @@ -53,5 +56,6 @@
"lintFilePatterns": ["apps/ui/**/*.ts", "apps/ui/src/**/*.html"]
}
}
}
},
"implicitDependencies": ["webpack5"]
}
53 changes: 43 additions & 10 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,37 @@
},
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": ["{workspaceRoot}/workspace.json", "{workspaceRoot}/tsconfig.json", "{workspaceRoot}/nx.json"],
"production": ["default", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", "!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/jest.config.[jt]s", "!{projectRoot}/src/test-setup.[jt]s"]
"default": [
"{projectRoot}/**/*",
"sharedGlobals"
],
"sharedGlobals": [
"{workspaceRoot}/workspace.json",
"{workspaceRoot}/tsconfig.json",
"{workspaceRoot}/nx.json"
],
"production": [
"default",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/src/test-setup.[jt]s"
]
},
"targetDefaults": {
"build": {
"inputs": ["production", "^production"],
"inputs": [
"production",
"^production"
],
"cache": true
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"inputs": [
"default",
"^production",
"{workspaceRoot}/jest.preset.js"
],
"cache": true
},
"lint": {
Expand All @@ -95,7 +115,11 @@
"cache": true
},
"@nx/jest:jest": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"inputs": [
"default",
"^production",
"{workspaceRoot}/jest.preset.js"
],
"cache": true,
"options": {
"passWithNoTests": true
Expand All @@ -109,7 +133,10 @@
},
"@nx/vite:test": {
"cache": true,
"inputs": ["default", "^production"]
"inputs": [
"default",
"^production"
]
}
},
"useDaemonProcess": false,
Expand All @@ -119,7 +146,12 @@
"useLegacyCache": true,
"release": {
"releaseTagPattern": "{version}-{projectName}",
"projects": ["packages/*", "!packages/ui-mobile-base", "!packages/types-minimal", "!packages/winter-tc"],
"projects": [
"packages/*",
"!packages/ui-mobile-base",
"!packages/types-minimal",
"!packages/winter-tc"
],
"projectsRelationship": "independent",
"changelog": {
"workspaceChangelog": false,
Expand All @@ -131,5 +163,6 @@
}
}
}
}
}
},
"nxCloudId": "680a89d49c76d63ce41eb397"
}
Loading