Skip to content

Conversation

@georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Oct 22, 2025

Description

This change mirrors the successful optimization implemented in MetaMask/core#6481 and provides significant performance improvements for TypeScript script execution in large monorepos.

Related issues

Fixes: N/A

Manual testing steps

  • Run yarn lint and verify it completes successfully without hanging
  • Run yarn lint:eslint individually to confirm ESLint processing works
  • Test yarn create-component:react to ensure component generation still works
  • Test yarn update-readme-content to verify documentation scripts work
  • Verify all other scripts using TypeScript execution continue to function

Screenshots/Recordings

Not applicable - this is a build/tooling performance optimization without visual changes.

Pre-merge author checklist

  • I have reviewed the Files changed tab
  • All CI checks pass (yarn lint now works without hanging)
  • The same scripts work in all workspace packages
  • All TypeScript script executions use the faster tsx instead of ts-node
  • LavaMoat configuration updated to allow tsx>esbuild instead of ts-node>@swc/core
  • Dependency configuration updated in depcheck to ignore tsx instead of ts-node
  • Script shebang lines updated in all affected files
  • I have tested this PR on my local machine

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Technical Details

Files Changed:

  • Root package.json: Updated 3 scripts (create-package, lint:eslint, update-readme-content)
  • Dependency updates: Replaced ts-node with tsx in devDependencies
  • LavaMoat config: Updated to allow tsx>esbuild instead of ts-node>@swc/core
  • Package scripts: Updated React and React Native packages to use tsx
  • Build scripts: Updated shebang lines and direct script calls
  • Depcheck config: Updated to ignore tsx instead of ts-node

Performance Impact:

  • Before: yarn lint would hang indefinitely
  • After: yarn lint completes successfully in reasonable time
  • Benefit: Enables faster development cycles and unblocks CI/CD pipelines

References:


Note

Replace ts-node with tsx for TypeScript scripts, updating scripts, configs, shebangs, and dependencies.

  • Tooling:
    • Migrate TypeScript script runner from ts-node to tsx across repo.
    • Update script invocations in root package.json (create-package, lint:eslint, update-readme-content).
    • Switch package scripts in packages/design-system-react and packages/design-system-react-native (create-component, generate-icons, generate-icons:index).
    • Update build step in packages/design-system-react-native/scripts/build.js to call tsx.
    • Change shebangs in scripts/generate-preview-build-message.ts and scripts/update-readme-content.ts to #!yarn tsx.
  • Config:
    • Update LavaMoat allowScripts from ts-node>@swc/core to tsx>esbuild.
    • Adjust .depcheckrc.yml ignores to tsx.
  • Dependencies:
    • Remove ts-node; add tsx and related esbuild entries; refresh yarn.lock.

Written by Cursor Bugbot for commit d403f8d. This will update automatically on new commits. Configure here.

@socket-security
Copy link

socket-security bot commented Oct 22, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedtsx@​4.20.61001008189100

View full report

@socket-security
Copy link

socket-security bot commented Oct 22, 2025

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Action Severity Alert  (click "▶" to expand/collapse)
Warn Low
[email protected] is a AI-detected potential code anomaly.

Notes: This fragment appears to be a bundler-generated bootstrap/initialization piece that imports many modules and executes an initialization function (r). No explicit malicious activity is evident within this fragment itself, but the risk stems from side effects of the imported modules on load. A careful review of the implementations of the imported modules (especially those exporting r and those performing initialization, build-time, or network/file operations) is recommended to rule out hidden telemetry, backdoors, or undesired side effects.

Confidence: 1.00

Severity: 0.60

From: package.jsonnpm/[email protected]

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@github-actions
Copy link
Contributor

📖 Storybook Preview

@georgewrmarshall georgewrmarshall changed the title perf: replace ts-node with tsx to resolve yarn lint hanging issue chore: replace ts-node with tsx to resolve yarn lint hanging issue Oct 22, 2025
@georgewrmarshall georgewrmarshall self-assigned this Oct 22, 2025
@georgewrmarshall
Copy link
Contributor Author

georgewrmarshall commented Oct 22, 2025

@SocketSecurity ignore npm/[email protected]

I reviewed the warnings and alerts they're specified as low risk. I don't think this is an issue. It's also been verified by @mcmire

@georgewrmarshall georgewrmarshall marked this pull request as ready for review October 22, 2025 21:49
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner October 22, 2025 21:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces ts-node with tsx across the monorepo to resolve a hanging issue with yarn lint and improve TypeScript execution performance. The change mirrors a successful optimization from MetaMask/core#6481.

Key Changes:

  • Replaced ts-node with tsx in all package.json scripts
  • Updated script shebang lines from #!yarn ts-node to #!yarn tsx
  • Updated LavaMoat and depcheck configurations to reference tsx instead of ts-node

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/update-readme-content.ts Updated shebang to use tsx
scripts/generate-preview-build-message.ts Updated shebang to use tsx
packages/design-system-react/package.json Replaced ts-node with tsx in scripts and dependencies
packages/design-system-react-native/scripts/build.js Updated execSync call to use tsx
packages/design-system-react-native/package.json Replaced ts-node with tsx in scripts and dependencies
package.json Updated root-level scripts, dependencies, and LavaMoat config
.depcheckrc.yml Updated ignore list to reference tsx

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@georgewrmarshall georgewrmarshall merged commit f373268 into main Oct 22, 2025
43 checks passed
@georgewrmarshall georgewrmarshall deleted the replace-ts-node-with-tsx branch October 22, 2025 23:01
georgewrmarshall added a commit that referenced this pull request Dec 4, 2025
This was missed in #845 when migrating from ts-node to tsx. The workflow
was still calling `yarn ts-node` to generate the preview build message.

This change aligns with the same fix made in MetaMask/core#6889.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
georgewrmarshall added a commit that referenced this pull request Dec 4, 2025
)

## **Description**

This PR fixes a missed instance in #845 where we migrated from ts-node
to tsx. The publish-preview workflow was still using `yarn ts-node` to
execute the `generate-preview-build-message.ts` script, which would
cause the preview build process to fail.

<img width="922" height="186" alt="Screenshot 2025-12-04 at 8 14 35 PM"
src="https://github.com/user-attachments/assets/dafc8a2b-097f-46ad-a2a0-2ad5548f80ce"
/>

The fix updates line 52 in `.github/workflows/publish-preview.yml` to
use `yarn tsx` instead.

This change aligns with the same fix made in the MetaMask/core
repository: https://github.com/MetaMask/core/pull/6889/files

## **Related issues**

Fixes: N/A (follow-up to #845)

## **Manual testing steps**

1. The change can be verified by reviewing the workflow file
2. The preview build workflow will be tested when the next preview build
is triggered via `@metamaskbot publish-preview` comment

## **Screenshots/Recordings**

N/A - workflow configuration change only

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs)
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable (N/A for workflow changes)
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable (N/A)
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Switches the publish-preview workflow to run
`scripts/generate-preview-build-message.ts` with `yarn tsx` instead of
`yarn ts-node`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
41f1e79. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude <[email protected]>
@georgewrmarshall georgewrmarshall mentioned this pull request Dec 9, 2025
7 tasks
brianacnguyen pushed a commit that referenced this pull request Dec 9, 2025
## **Description**

This PR releases version 17.0.0 of the MetaMask Design System, featuring
important fixes for mobile font compatibility, the addition of the
ButtonHero component to React, export fixes for React Native, and
various dependency updates including ESLint configuration upgrades.

## **Included PRs**

#836, #837, #838, #840, #843, #845, #846, #847, #848, #850, #851, #852,
#853, #854, #855, #856, #857, #858, #859, #861, #862, #863, #864

## **Manual testing steps**

1. Check package.json version bumps align with included changes
2. Check changelog accurately reflects the release

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs)
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Release 17.0.0 introducing React `ButtonHero`, RN font naming changes
and TWRNC preset font family rename (both breaking), plus RN export fix
and dependency updates.
> 
> - **Release 17.0.0**
>   - Bump root `package.json` to `17.0.0`.
> - **React (`@metamask/[email protected]`)**
>   - Add `ButtonHero` component for prominent CTAs.
>   - Update `@metamask/utils` peer to `^11.8.1`.
> - **React Native (`@metamask/[email protected]`)**
> - BREAKING: Rename font files to hyphenated PostScript format for iOS
Metro compatibility.
>   - Export missing `TextButtonSize` enum.
> - Peer: require `@metamask/design-system-twrnc-preset@^0.3.0`; update
`@metamask/utils` peer.
> - **TWRNC preset (`@metamask/[email protected]`)**
> - BREAKING: Rename font family names to hyphenated PostScript format
for iOS/expo-font.
> - **Changelogs**
>   - Update `CHANGELOG.md` links and entries for all packages.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9a90311. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants