-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix: build mjs in the cli #20889
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
fix: build mjs in the cli #20889
Conversation
Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later.
|
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ 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 |
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.
The PR description an example specifies the tsconfig.json shipped by the Vue CLI as problematic, but really the problem is [preserveValueImports](https://www.typescriptlang.org/tsconfig#preserveValueImports), right?
Can we make the example more minimal and focused on that? Could the tsconfig.json in the system test project just be
{
"preserveValueImports": true
}Or something like this? I feel it's much easier to understand what bug a system test addresses if it's as minimal and focused on the problem as possible. What do you think?
lmiller1990
left a comment
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.
My comments have been addressed, LGTM!
Co-authored-by: Tim Griesser <tgriesser10@gmail.com>
flotwig
left a comment
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.
I think there are some large unknowns here, but since this is required for unblocking some ecosystem support I'll approve it. I think we may see some really weird bug reports from this one so we'll have to keep an eye on it.
* 10.0-release: (92 commits) chore: remove dependency-tree dep (#20905) chore(launchpad): work on infra for scaffold tests (#20818) fix: build mjs in the cli (#20889) fix(unify): Cypress version link should point to Cypress doc's changelog (#20869) fix: windows build (#20854) fix: add index.mjs to the published files of cli (#20884) refactor: lift indexHtmlFile up to component, add validation (#20870) fix: allow migration of pluginsFile using `env` properties (#20770) fix: viewport from CLI on CT (#20849) Don't communicate if process isn't connected Remove config.get Update packages/data-context/src/data/ProjectLifecycleManager.ts fix: git data source unit test failure (#20875) add comment for autoBindDebug fix: Ensuring current browser is synchronized between app and launchpad (#20830) Fix missed await on merge conflict resolution test(unification): move record keys to contexts (#20860) test: move record keys to contexts (#20859) PR comments Fix tests that visit app without a configured testing type ...
closes UNIFY-1438
Build/index.mjs missing
When publishing the Cypress CLI, we move all we need to a
buildfolder. We forgot to moveindex.mjsto that directory.For that reason, cypress was still breaking even after adding
index.mjsto thefilesproperty of thepackage.json.Issues should be resolved.
NOTE: This might create an unexpected behavior when using the
preserveValueImportsflag as it is removed. There is a good chance that this flag would have no effect incommonjsthough.NOTE2: ts-node recommend to use
"module": "commonjs"in thetsconfig.json. Theiresnextsupport is still experimental. Plus, if we set ts-node to sue ESM, CJS will not be understood anymore.Invalid TypeScript config
We used to get the following error when running cypress against
npm init vuewithTypeScript.This PR also changes the
tsconfig.jsonused for reading the config file with ts-node. Since this updated config is not used for building anything, the modified parameter will not impact production.https://www.typescriptlang.org/tsconfig#preserveValueImports
TSError: ⨯ Unable to compile TypeScript:
error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later.