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

fix(js): ensure js libraries' build produce esm output in ts solution setup #29546

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

leosvelperez
Copy link
Member

@leosvelperez leosvelperez commented Jan 8, 2025

  • Update js libraries for bundlers esbuild, swc, and tsc to produce ESM output when using the TS solution setup.
  • Fix esbuild and swc executors so they generate declaration files even when skipping type-checking.
  • Add cjs and cts to the ignoredFiles pattern for the rollup config file in the eslint config.
  • Ensure running an install after a js library is generated when using the TS solution setup.

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #

@leosvelperez leosvelperez self-assigned this Jan 8, 2025
Copy link

vercel bot commented Jan 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Jan 8, 2025 4:49pm

Copy link

nx-cloud bot commented Jan 8, 2025

View your CI Pipeline Execution ↗ for commit 4d49725.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 8m 30s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 19s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx format:check --base=16080... ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗
nx documentation --no-dte ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-08 16:58:28 UTC

@leosvelperez leosvelperez changed the title fix(js): ensure tsc and swc produce esm output in ts solution setup fix(js): ensure js libraries' build produce esm output in ts solution setup Jan 8, 2025
@leosvelperez leosvelperez force-pushed the js/ts-setup-output-esm branch from bc23be2 to 3f97d26 Compare January 8, 2025 15:56
@leosvelperez leosvelperez marked this pull request as ready for review January 8, 2025 15:56
@leosvelperez leosvelperez requested review from a team as code owners January 8, 2025 15:56
@leosvelperez leosvelperez force-pushed the js/ts-setup-output-esm branch from 3f97d26 to 4d49725 Compare January 8, 2025 16:44
const allDiagnostics = ts
.getPreEmitDiagnostics(program as Program)
.concat(result.diagnostics);
const allDiagnostics = options.ignoreDiagnostics
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense for correctness. We should look at it again in the future to see if want to allow builds without typechecks, maybe a separate typedefs task for swc and esbuild so users that do not need d.ts files don't need to pay the penalty.

@leosvelperez leosvelperez merged commit 0334dad into master Jan 8, 2025
6 checks passed
@leosvelperez leosvelperez deleted the js/ts-setup-output-esm branch January 8, 2025 17:21
Copy link

github-actions bot commented Jan 8, 2025

Failed to publish a PR release of this pull request, triggered by @leosvelperez.
See the failed workflow run at: https://github.com/nrwl/nx/actions/runs/12675519945

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.

2 participants