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

[Build] Update tsconfig to explicitly set target and module options #7845

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

unlikelyzero
Copy link
Collaborator

@unlikelyzero unlikelyzero commented Sep 15, 2024

Addresses: VIPEROMCT-547

Describe your changes:

This solves 2 separate issues specifically when building openmct as a submodule from the root dir (using npm install --prefix openmct):

  1. tsc by default targets ES5, which doesn't support the #private syntax.
  2. The module setting by default is CommonJS if we're using ES5 which, since it's not specified, the target option defaults to.

Then something about the consuming project not having its own tsconfig.json causes even more build inconsistency and weirdness, because tsc has to infer which options to use based on the calling environment.

So if the consuming project (as a submodule, because this works with regular npm package resolution since its already built) has no tsconfig.json specified, and is using openmct as a submodule, AND is building openmct using npm install --prefix, the build will fail without these changes.

TL;DR:
Even if we're not generating JavaScript, we should still set these options to enforce consistency in type resolution across the different ways to consume and build Open MCT.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

Copy link

codecov bot commented Sep 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.80%. Comparing base (fa8efa8) to head (fc9e41c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7845      +/-   ##
==========================================
- Coverage   59.13%   58.80%   -0.34%     
==========================================
  Files         675      675              
  Lines       27284    27284              
  Branches     2671     2671              
==========================================
- Hits        16135    16044      -91     
- Misses      11102    11192      +90     
- Partials       47       48       +1     
Flag Coverage Δ
e2e-ci 61.78% <ø> (-0.01%) ⬇️
e2e-full 23.51% <ø> (-18.39%) ⬇️
unit 51.18% <ø> (-0.06%) ⬇️

see 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa8efa8...fc9e41c. Read the comment docs.

@ozyx ozyx added type:maintenance tests, chores, or project maintenance labels Sep 16, 2024
@ozyx ozyx modified the milestone: Target:4.0.1 Sep 16, 2024
@ozyx ozyx changed the title [DNM] [Build] Update tsconfig to explicitly declare use of node [DNM] [Build] Update tsconfig to explicitly set target and module options Sep 16, 2024
@ozyx ozyx changed the title [DNM] [Build] Update tsconfig to explicitly set target and module options [Build] Update tsconfig to explicitly set target and module options Sep 16, 2024
@ozyx ozyx self-requested a review September 16, 2024 20:53
@ozyx ozyx marked this pull request as ready for review September 16, 2024 20:53
tsconfig.json Outdated Show resolved Hide resolved
- the `exclude` option only excludes files in the context of the `include` paths, if there are any. We can remove some of these because they don't match anything in the include paths.
@ozyx ozyx self-requested a review September 16, 2024 22:27
@ozyx ozyx added the pr:e2e:couchdb npm run test:e2e:couchdb label Sep 16, 2024
@ozyx ozyx enabled auto-merge (squash) September 16, 2024 23:20
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Sep 16, 2024
@ozyx ozyx merged commit de122b9 into master Sep 16, 2024
23 checks passed
@ozyx ozyx deleted the fix-submodule-pattern branch September 16, 2024 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:maintenance tests, chores, or project maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants