Skip to content
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

Improve TS configuration for target and included libs for monorepo packages #29840

Closed
cacieprins opened this issue Jul 11, 2024 · 2 comments
Closed
Labels
stale no activity on this issue for a long period topic: typescript type: chore Work is required w/ no deliverable to end user

Comments

@cacieprins
Copy link
Contributor

Currently, TSConfig is spread around and not necessarily mutually compatible between packages in the monorepo.

Discovery:

  • align on an ES target version, decide on an upgrade schedule or heuristic for newer ES targets, and catalog all current targets and libs.
  • determine if this is a cosmetic issue with Cypress' ts-check script, or if it is indicative of potential build failures.

DevEx / TechDebt pain point this is intended to fix:

Monorepo packages sometimes have older libs and/or targets than the packages that they import. This can break check-ts in interesting ways. Example:

ts/tsconfig.json declares ES2018 as the default target, and includes libraries for ES2018, ES2020.Promise, ES2021.String.

@packages/source-package overrides the included libraries, but not the target. It's still targeting ES2018, but is including all libs for esnext. It makes extensive use of es2022 features, like the # prefix for truly private fields on classes.

@packages/destination-package uses the defaults, and imports portions of @packages/parent-package that use the # prefix for private fields.

ts-check will fail for @packages/destination-package, but will reference the file that uses the # prefix in @packages/source-package.

Acceptance Criteria:

  • tsconfig lib and target values are either synchronized across all packages, or values are verified such that dependencies are required to have a subset of their dependent's lib and target values
  • Define criteria for upgrading to the next Target. For webpack and browser-targeted ts configurations, this can be derived from a browser version support matrix. For node-targeted tsconfig configurations, this can be derived from the version of node that we build the binary for.
@cacieprins cacieprins changed the title Update TS configuration Improve TS configuration for target and included libs for monorepo packages Jul 11, 2024
@jennifer-shehane jennifer-shehane added type: chore Work is required w/ no deliverable to end user topic: typescript labels Jul 13, 2024
@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Jan 10, 2025
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale no activity on this issue for a long period topic: typescript type: chore Work is required w/ no deliverable to end user
Projects
None yet
Development

No branches or pull requests

3 participants