-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
chore: enable caching for lint task #26791
Changes from all commits
872833e
03e67a0
c18ff43
a0152b7
3b18ca4
7bce65e
0c6b748
bf670a3
2f86a75
764e961
542a38d
a66a89c
42aefb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,46 @@ | |
"default": { | ||
"runner": "nx-cloud", | ||
"options": { | ||
"cacheableOperations": [], | ||
"cacheableOperations": [ | ||
"lint" | ||
], | ||
"accessToken": "ZmNlNjA0YzAtNTM1NS00MDIwLWFlMWItNWYxYzNiMjQ4N2VkfHJlYWQtb25seQ==" | ||
} | ||
} | ||
}, | ||
"targetDefaults": { | ||
"lint": { | ||
"inputs": [ | ||
"default", | ||
"{workspaceRoot}/.eslintrc.js" | ||
] | ||
}, | ||
"build": { | ||
"dependsOn": [ | ||
"^build" | ||
] | ||
}, | ||
"build-prod": { | ||
"dependsOn": [ | ||
"^build-prod" | ||
] | ||
} | ||
}, | ||
"namedInputs": { | ||
"sharedGlobals": [], | ||
"default": [ | ||
"{projectRoot}/**/*", | ||
"sharedGlobals" | ||
], | ||
"production": [ | ||
"default", | ||
"!{projectRoot}/**/*.spec.ts", | ||
"!{projectRoot}/**/*.md", | ||
"!{projectRoot}/tsconfig.spec.json", | ||
"!{projectRoot}/.eslintrc.json", | ||
"!{projectRoot}/.mocharc.{js,json}", | ||
"!{projectRoot/cypress.config.{ts,js}", | ||
"!{projectRoot/**/*.cy.ts" | ||
] | ||
Comment on lines
+13
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jordanpowell88 I am not sure how NX works exactly, so I am not sure how to validate the changes here in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @warrensplayer . Here is the documentation. But yes in short, yes the For Example: the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the explanation. Final question in this section... Is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not currently. But I went ahead and added what I would expect to be starting values we would use. We can certainly remove this if we want for the time being though |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
"binary-upload": "node ./scripts/binary.js upload", | ||
"binary-zip": "node ./scripts/binary.js zip", | ||
"build": "yarn build-npm-modules && lerna run build --stream --no-bail --ignore create-cypress-tests --ignore cypress --ignore \"'@packages/{runner}'\" --ignore \"'@cypress/{angular,react,react18,vue,vue2,mount-utils,svelte}'\" && node ./cli/scripts/post-build.js && lerna run build --stream --scope create-cypress-tests", | ||
"build-npm-modules": "lerna run build --scope cypress --scope @cypress/mount-utils && lerna run build --scope \"'@cypress/{angular,react,react18,vue,vue2,svelte}'\"", | ||
"build-npm-modules": "lerna run build --scope cypress --scope @cypress/mount-utils --scope @cypress/react && lerna run build --scope \"'@cypress/{angular,react18,vue,vue2,svelte}'\"", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jordanpowell88 What is this change doing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Basically because npm/react18 dependsOn npm/react this was failing in CI. It's the same reason why we are building npm/mount-utils before building the rest. By adding Nx into the equation and because we have 2 outputs for the npm libs (their dist and the cli) it was sometimes creating an issue in CI. This change appears to have fixed the inconsistency in CI There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How did your changes for the lint task cause this task to start failing? I saw the issue you had in this branch in CI, but could not find it failing in Is this a problem? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea we have many circular dependencies which is causing this. That is why it requires a bit of change to the build step even though we aren't technically doing anything with build in this PR. This was work that would need to be done either eventually anyways when we cache the build step |
||
"build-prod": "lerna run build-prod-ui --stream && lerna run build-prod --stream --ignore create-cypress-tests && node ./cli/scripts/post-build.js && lerna run build-prod --stream --scope create-cypress-tests --scope", | ||
"build-v8-snapshot-dev": "node --max-old-space-size=8192 tooling/v8-snapshot/scripts/setup-v8-snapshot-in-cypress.js --env=dev", | ||
"build-v8-snapshot-prod": "node --max-old-space-size=8192 tooling/v8-snapshot/scripts/setup-v8-snapshot-in-cypress.js", | ||
|
@@ -41,7 +41,7 @@ | |
"ensure-deps": "./scripts/ensure-dependencies.sh", | ||
"get-next-version": "node scripts/get-next-version.js", | ||
"postinstall": "node ./scripts/run-postInstall.js", | ||
"lint": "lerna run lint --no-bail --concurrency 2 && eslint --ext .js,.ts,.json, scripts", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the linting of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this dropped linting of the root-level js/json files which we want to keep There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The root level files were not being linted before. We were only running |
||
"lint": "lerna run lint --no-bail --concurrency 2", | ||
"prepare-release-artifacts": "node ./scripts/prepare-release-artifacts.js", | ||
"npm-release": "node scripts/npm-release.js", | ||
"prestart": "yarn ensure-deps", | ||
|
@@ -247,7 +247,8 @@ | |
"packages/*", | ||
"npm/*", | ||
"tooling/*", | ||
"system-tests" | ||
"system-tests", | ||
"scripts" | ||
], | ||
"nohoist": [ | ||
"**/webpack-preprocessor/babel-loader", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should be able to re-use the root-level eslint configuration instead of needing to manage another one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using the root
We could certainly ignore these other ways but I feel like a separate config for these scripts makes sense given these warnings. Thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What changed that is is failing with this PR using the same eslint config file and not in develop? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jordanpowell88 I found this PR here from a few months ago that was adding linting to the scripts directory. In it, a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @warrensplayer great catch! I removed that rule in 42aefb1 |
||
"plugins": [ | ||
"cypress", | ||
"@cypress/dev" | ||
], | ||
"extends": [ | ||
"plugin:@cypress/dev/general", | ||
"plugin:@cypress/dev/tests" | ||
], | ||
"env": { | ||
"cypress/globals": true | ||
}, | ||
"rules": { | ||
"no-console": "off", | ||
"prefer-rest-params": "off" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "internal-scripts", | ||
"scripts": { | ||
"lint": "eslint --ext .js,.ts,.json, ." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The root level |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is what enables
lint
tasks to be cached with Nx Cloud