Skip to content

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

Merged
leosvelperez merged 2 commits into
masterfrom
js/ts-setup-output-esm
Jan 8, 2025
Merged

fix(js): ensure js libraries' build produce esm output in ts solution setup#29546
leosvelperez merged 2 commits into
masterfrom
js/ts-setup-output-esm

Conversation

@leosvelperez

@leosvelperez leosvelperez commented Jan 8, 2025

Copy link
Copy Markdown
Member
  • 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
@vercel

vercel Bot commented Jan 8, 2025

Copy link
Copy Markdown

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

@nx-cloud

nx-cloud Bot commented Jan 8, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
@leosvelperez leosvelperez deleted the js/ts-setup-output-esm branch January 8, 2025 17:21
@github-actions

github-actions Bot commented Jan 8, 2025

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants