Skip to content

Conversation

@elevatebart
Copy link
Contributor

@elevatebart elevatebart commented Apr 1, 2022

closes UNIFY-1438

Build/index.mjs missing

When publishing the Cypress CLI, we move all we need to a build folder. We forgot to move index.mjs to that directory.
For that reason, cypress was still breaking even after adding index.mjs to the files property of the package.json.

Issues should be resolved.

NOTE: This might create an unexpected behavior when using the preserveValueImports flag as it is removed. There is a good chance that this flag would have no effect in commonjs though.

NOTE2: ts-node recommend to use "module": "commonjs" in the tsconfig.json. Their esnext support 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 vue with TypeScript.

This PR also changes the tsconfig.json used 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.

Screen Shot 2022-04-01 at 3 14 37 PM

Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later.
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 1, 2022

Thanks for taking the time to open a PR!

@elevatebart elevatebart marked this pull request as ready for review April 1, 2022 20:22
@elevatebart elevatebart requested a review from a team as a code owner April 1, 2022 20:22
@elevatebart elevatebart requested review from jennifer-shehane and removed request for a team April 1, 2022 20:22
@cypress
Copy link

cypress bot commented Apr 1, 2022



Test summary

4334 0 48 0Flakiness 0


Run details

Project cypress
Status Passed
Commit 50d0594
Started Apr 4, 2022 10:01 PM
Ended Apr 4, 2022 10:13 PM
Duration 12:23 💡
OS Linux Debian - 10.10
Browser Electron 94

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

@elevatebart elevatebart requested a review from a team as a code owner April 3, 2022 18:07
Copy link
Contributor

@lmiller1990 lmiller1990 left a 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 lmiller1990 self-requested a review April 4, 2022 09:25
lmiller1990
lmiller1990 previously approved these changes Apr 4, 2022
Copy link
Contributor

@lmiller1990 lmiller1990 left a 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>
@tgriesser tgriesser self-requested a review April 4, 2022 18:21
Copy link
Contributor

@flotwig flotwig left a 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.

@elevatebart elevatebart merged commit 8381efe into 10.0-release Apr 4, 2022
@elevatebart elevatebart deleted the elevatebart/fix/build-mjs-in-the-cli branch April 4, 2022 22:58
tgriesser added a commit that referenced this pull request Apr 5, 2022
* 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
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants