Skip to content

chore(all): replace esbuild-register with ts-node/register in pm2, sc…#20390

Closed
dschom wants to merge 1 commit intomainfrom
worktree-switch-to-ts-node
Closed

chore(all): replace esbuild-register with ts-node/register in pm2, sc…#20390
dschom wants to merge 1 commit intomainfrom
worktree-switch-to-ts-node

Conversation

@dschom
Copy link
Copy Markdown
Contributor

@dschom dschom commented Apr 16, 2026

…ripts, and mocha commands

This PR has been broken down in to a series of smaller more easily reviewable PRs.

chore(all): Use tsc instead of esbuild

Because:

  • We want to test & develop with what we deploy

This Commit:

  • Removes esbuild
  • Uses tsc & ts-node instead
  • Fixes several nx config issues that were messing up caching
  • Fixes esm hacks for vendored modules
  • Creates dedicated build-ts target for typescript compilation, which makes nx task dependencies easier to configure.
  • Updates startup commands to use ts-node

Because

This pull request

Issue that this pull request solves

Closes: (issue number)

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on:
  • Suggested review order:
  • Risky or complex parts:

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

Any other information that is important to this pull request.


await execAsync(
`node -r esbuild-register scripts/dump-users --emails ${account1Mock.email},${account2Mock.email} > ${USER_DUMP_PATH}`,
`node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --emails ${account1Mock.email},${account2Mock.email} > ${USER_DUMP_PATH}`,
it('succeeds with valid input file and method, writing files to disk', async () => {
await execAsync(
`node -r esbuild-register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method sendPasswordChangedEmail --write ${OUTPUT_DIRECTORY}`,
`node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method sendPasswordChangedEmail --write ${OUTPUT_DIRECTORY}`,
it('succeeds with valid input file and method, writing emails to stdout', async () => {
const output = await execAsync(
`node -r esbuild-register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method sendPasswordChangedEmail`,
`node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method sendPasswordChangedEmail`,
it('succeeds with valid input file and method, sends', async () => {
await execAsync(
`node -r esbuild-register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method sendVerifyEmail --send`,
`node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method sendVerifyEmail --send`,
@dschom dschom force-pushed the worktree-switch-to-ts-node branch 3 times, most recently from 98473ba to 4abad51 Compare April 16, 2026 22:31
…ripts, and mocha commands

chore(all): Use tsc instead of esbuild

Because:
- We want to test & develop with what we deploy

This Commit:
- Removes esbuild
- Uses tsc & ts-node instead
- Fixes several nx config issues that were messing up caching
- Fixes esm hacks for vendored modules
- Creates dedicated build-ts target for typescript compilation, which makes nx task dependencies easier to configure.
- Updates startup commands to use ts-node
@dschom dschom force-pushed the worktree-switch-to-ts-node branch from 4abad51 to a6d1a55 Compare April 16, 2026 23:23
dschom added a commit that referenced this pull request Apr 24, 2026
…hared

Because:
- We want to test & develop with what we deploy.

This commit:
- Part of the esbuild -> tsc/ts-node migration (split of a6d1a55, PR #20390).
- Scope: files under packages/fxa-shared.
dschom added a commit that referenced this pull request Apr 24, 2026
…-event-broker

Because:
- We want to test & develop with what we deploy.

This commit:
- Part of the esbuild -> tsc/ts-node migration (split of a6d1a55, PR #20390).
- Scope: files under packages/fxa-event-broker.
dschom added a commit that referenced this pull request Apr 24, 2026
…auth-client

Because:
- We want to test & develop with what we deploy.

This commit:
- Part of the esbuild -> tsc/ts-node migration (split of a6d1a55, PR #20390).
- Scope: files under packages/fxa-auth-client.
dschom added a commit that referenced this pull request Apr 24, 2026
…-admin-server

Because:
- We want to test & develop with what we deploy.

This commit:
- Part of the esbuild -> tsc/ts-node migration (split of a6d1a55, PR #20390).
- Scope: files under packages/fxa-admin-server.
dschom added a commit that referenced this pull request Apr 24, 2026
Because:
- We want to test & develop with what we deploy.

This commit:
- Part of the esbuild -> tsc/ts-node migration (split of a6d1a55, PR #20390).
- Scope: files under libs/shared.
- Pulls in libs/google/*, which are essentially 'shared' libs
- Pulls in libs/vemdered. which are essentially 'shared' libs
- Pulls in libs/payments/*, which could not be decoupled from libs/shared due to bi directional dependency bewteen shared/cms and payemnts/customer
- Deletes libs/shared/nestjs/customs. This was not referenced, and created an atypical dependency direction with /libs/accounts/rate-limit.
dschom added a commit that referenced this pull request May 4, 2026
…xa-content-server

Because:
- We want to test & develop with what we deploy.

This commit:
- Part of the esbuild -> tsc/ts-node migration (split of a6d1a55, PR #20390).
- Scope: files under packages/fxa-content-server.
dschom added a commit that referenced this pull request May 4, 2026
…xa-content-server

Because:
- We want to test & develop with what we deploy.

This commit:
- Part of the esbuild -> tsc/ts-node migration (split of a6d1a55, PR #20390).
- Scope: files under packages/fxa-content-server.
dschom added a commit that referenced this pull request May 5, 2026
…xa-content-server

Because:
- We want to test & develop with what we deploy.

This commit:
- Part of the esbuild -> tsc/ts-node migration (split of a6d1a55, PR #20390).
- Scope: files under packages/fxa-content-server.
dschom added a commit that referenced this pull request May 5, 2026
…xa-content-server

Because:
- We want to test & develop with what we deploy.

This commit:
- Part of the esbuild -> tsc/ts-node migration (split of a6d1a55, PR #20390).
- Scope: files under packages/fxa-content-server.
dschom added a commit that referenced this pull request May 5, 2026
…ts/next

Because:
- We want to test & develop with what we deploy.

This commit:
- Part of the esbuild -> tsc/ts-node migration (split of a6d1a55, PR #20390).
- Scope: files under apps/payments/next.
dschom added a commit that referenced this pull request May 5, 2026
Because:
- We want to test & develop with what we deploy.

This commit:
- Part of the esbuild -> tsc/ts-node migration (split of a6d1a55, PR #20390).
- Scope: files under libs/shared.
- Pulls in libs/google/*, which are essentially 'shared' libs
- Pulls in libs/vemdered. which are essentially 'shared' libs
- Pulls in libs/payments/*, which could not be decoupled from libs/shared due to bi directional dependency bewteen shared/cms and payemnts/customer
- Deletes libs/shared/nestjs/customs. This was not referenced, and created an atypical dependency direction with /libs/accounts/rate-limit.
dschom added a commit that referenced this pull request May 5, 2026
…xa-content-server

Because:
- We want to test & develop with what we deploy.

This commit:
- Part of the esbuild -> tsc/ts-node migration (split of a6d1a55, PR #20390).
- Scope: files under packages/fxa-content-server.
dschom added a commit that referenced this pull request May 5, 2026
Because:
- We want to test & develop with what we deploy.

This commit:
- Part of the esbuild -> tsc/ts-node migration (split of a6d1a55, PR #20390).
- Pulls in libs/*, which are essentially 'shared' libs
- Deletes libs/shared/nestjs/customs. This was not referenced, and created an atypical dependency direction with /libs/accounts/rate-limit.
@dschom dschom closed this May 5, 2026
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