-
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
test(system-tests): support npm for test projects #20664
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
…t always symlinked
2b1b07e
to
360d8b7
Compare
@@ -38,4 +38,6 @@ | |||
// Volar is the main extension that powers Vue's language features. | |||
// "volar.autoCompleteRefs": false, | |||
"volar.takeOverMode.enabled": true, | |||
|
|||
"editor.tabSize": 2, |
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.
not necessarily related to this PR, but I noticed sometimes vscode doesn't know what our tab size is (where does that even come from? eslint?) and will default to 4.
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 looks good. It's difficult to manually test all of the edge cases you're covering, but the basics seem to be working for me.
} | ||
} | ||
|
||
export async function scaffoldCommonNodeModules () { |
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.
Can you add a comment above this line describing what it does?
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.
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.
Seems fine! Left some comments but nothing blocking a merge.
optionalDependencies?: Dependencies | ||
} | ||
|
||
const log = (...args) => console.log('📦', ...args) |
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.
Nitpicking here, but a fun TS trick to get the correct type of ...args
:
const log = (...args: Parameters<typeof console.log>) => console.log('📦', ...args)
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.
Nice, thanks for the tip. I think I'll leave this one as-is since it's so simple and we use this pattern elsewhere but I'll keep Parameters
in mind.
await symlinkNodeModulesFromCache(tmpNodeModulesDir, cacheNodeModulesDir) | ||
} else { | ||
// due to an issue in NPM, we cannot have `node_modules` be a symlink. fall back to copying. | ||
// https://github.com/npm/npm/issues/10013 |
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.
Seems the linked issue is 3-4 years old - I wonder if/when this will be fixed, or if it's a wontfix. 😢
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.
Yeah, I'm not sure, I unfortunately wasn't able to find a corresponding issue in their un-archived repo. But it's definitely still an issue.
await fs.symlink(targetDir, destDir, 'junction') | ||
} | ||
|
||
// 8. If necessary, ensure that the `node_modules` cache is updated by copying `node_modules` back. |
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.
Big 👍 to the comments here
User facing changelog
n/a
Additional details
Actual diff minus lockfile changes is +400 -283
yarn
: test: node_modules installs for system-tests, other improvements #18574npm
.npm
as well ifpackage-lock.json
is detected.vite-ct
project has been converted to usingnpm
to prove that this works.fixtures.ts
, it has been moved to adep-installer
subfolderHow has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?