Skip to content

Commit bc092f8

Browse files
chore: use nx cloud (#131)
1 parent f873f5b commit bc092f8

File tree

4 files changed

+139
-9
lines changed

4 files changed

+139
-9
lines changed

nx.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
"npmScope": "qwikifiers",
44
"tasksRunnerOptions": {
55
"default": {
6-
"runner": "nx/tasks-runners/default",
6+
"runner": "@nrwl/nx-cloud",
77
"options": {
8-
"cacheableOperations": ["build", "lint", "test", "e2e"]
8+
"cacheableOperations": ["build", "lint", "test", "e2e"],
9+
"runtimeCacheInputs": [
10+
"node ./scripts/get-cache-input.js --type=node",
11+
"node ./scripts/get-cache-input.js --type=os"
12+
],
13+
"accessToken": "MmI5MzJhMDctNGYwMi00OTI1LWJiZjUtNWIwNTQ4NmY2ZjhjfHJlYWQtd3JpdGU="
914
}
1015
}
1116
},

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@nrwl/jest": "15.9.2",
2626
"@nrwl/js": "15.9.2",
2727
"@nrwl/linter": "15.9.2",
28+
"@nrwl/nx-cloud": "15.3.5",
2829
"@nrwl/nx-plugin": "15.9.2",
2930
"@nrwl/storybook": "15.9.2",
3031
"@nrwl/vite": "15.9.2",
@@ -66,7 +67,8 @@
6667
"ts-node": "10.9.1",
6768
"typescript": "4.9.5",
6869
"verdaccio": "5.21.1",
69-
"vite": "4.1.1"
70+
"vite": "4.1.1",
71+
"yargs": "17.7.1"
7072
},
7173
"dependencies": {
7274
"@swc/helpers": "~0.4.11",

pnpm-lock.yaml

Lines changed: 112 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/get-cache-input.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// This script is used as a runtime input for the Nx cache.
2+
const { execSync } = require('child_process');
3+
const os = require('os');
4+
const yargs = require('yargs');
5+
// Things like the version of NodeJS, whether we are running Windows or not, can affect
6+
// the results of the computation but cannot be deduced statically.
7+
8+
let { type } = yargs(process.argv).argv;
9+
10+
if (type === 'os') {
11+
console.log(os.type());
12+
} else if (type === 'node') {
13+
const v = execSync('node -v').toString();
14+
console.log(v.split('.')[0]);
15+
} else {
16+
throw new Error('Could not resolve the "type" arg.');
17+
}

0 commit comments

Comments
 (0)