Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

refactor!: Synchronize dev toolchain with module template and core monorepo#420

Merged
rekmarks merged 18 commits intomainfrom
rekm/sync-module-template
Oct 13, 2025
Merged

refactor!: Synchronize dev toolchain with module template and core monorepo#420
rekmarks merged 18 commits intomainfrom
rekm/sync-module-template

Conversation

@rekmarks
Copy link
Copy Markdown
Member

@rekmarks rekmarks commented Oct 10, 2025

Synchronizes package meta-files with https://github.com/MetaMask/metamask-module-template. Changes exclude source code and other published files with the following exceptions:

  • package.json, most notably its exports field
    • This is due to adding fields expected by our Yarn constraints and migrating to ts-bridge for builds.
    • Migrating to ts-bridge is arguably breaking, although it should only improve the experience of our consumers.
  • Published files are split into .cjs and .mjs trees per ts-bridge

In detail (all changes per module template unless otherwise specified):

  • Use ts-bridge
  • Bump eslint, prettier, and related dependencies
  • Add eslint.config.mjs
  • Add and use @arethetypeswrong/cli
  • Add and use typedoc
  • Update .yarnrc.yml and add yarn.config.cjs
  • Update package.json and README.md
  • Bump typescript from 4.x to ~5.7.3
  • Bump jest and related dependencies from ^27 to ^28
  • Update tsconfig files
  • Add default test timer setup to test/setupAfterEnv.ts
    • Control timers on a per-test basis as necessary
  • Lint all files per updated config
    • Set the following rules to warn:
      • @typescript-eslint/prefer-nullish-coalescing, to avoid behavioral changes
      • @typescript-eslint/explicit-function-return-type, because too many violations to fix right now

Work intentionally avoided in this PR:

  • Update package.json#engines
  • Migrate to vitest

Note

Migrates build to ts-bridge and aligns tooling with the MetaMask module template (ESLint v9 flat config, TypeScript 5.x, TypeDoc, Yarn constraints), with no runtime code changes.

  • Tooling/Config:
    • Adopt MetaMask module template: add yarn.config.cjs, update .yarnrc.yml, and standardize package.json fields/exports.
    • Bump TypeScript to ~5.x and adopt typescript-eslint@^8.
    • Upgrade ESLint to v9 with flat config via eslint.config.mjs and MetaMask configs v14.
  • Build:
    • Migrate to ts-bridge; publish split dist outputs (.cjs/.mjs).
    • Add @arethetypeswrong/cli and related tooling checks.
  • Docs:
    • Add typedoc.json and typedoc for API docs generation.
  • Deps:
    • Refresh yarn.lock and ancillary dev deps (e.g., jest ecosystem kept at 27.x).
  • Tests:
    • Establish default test timer setup in test/setupAfterEnv.ts (per PR notes).

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

@socket-security
Copy link
Copy Markdown

socket-security bot commented Oct 10, 2025

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedts-expose-internals-conditionally@​1.0.0-empty.0991003778100
Added@​unrs/​resolver-binding-android-arm-eabi@​1.11.11001004182100
Added@​unrs/​resolver-binding-android-arm64@​1.11.11001004182100
Added@​unrs/​resolver-binding-darwin-arm64@​1.11.11001004187100
Added@​unrs/​resolver-binding-darwin-x64@​1.11.11001004187100
Added@​unrs/​resolver-binding-freebsd-x64@​1.11.11001004187100
Added@​unrs/​resolver-binding-linux-arm-gnueabihf@​1.11.11001004187100
Added@​unrs/​resolver-binding-linux-arm-musleabihf@​1.11.11001004187100
Added@​unrs/​resolver-binding-linux-arm64-gnu@​1.11.11001004187100
Added@​unrs/​resolver-binding-linux-arm64-musl@​1.11.11001004187100
Added@​unrs/​resolver-binding-linux-ppc64-gnu@​1.11.11001004187100
Added@​unrs/​resolver-binding-linux-riscv64-gnu@​1.11.11001004187100
Added@​unrs/​resolver-binding-linux-riscv64-musl@​1.11.11001004186100
Added@​unrs/​resolver-binding-linux-s390x-gnu@​1.11.11001004187100
Added@​unrs/​resolver-binding-linux-x64-gnu@​1.11.11001004187100
Added@​unrs/​resolver-binding-linux-x64-musl@​1.11.11001004187100
Added@​unrs/​resolver-binding-win32-arm64-msvc@​1.11.11001004187100
Added@​unrs/​resolver-binding-win32-ia32-msvc@​1.11.11001004187100
Added@​unrs/​resolver-binding-win32-x64-msvc@​1.11.11001004187100
Added@​nolyfill/​is-core-module@​1.0.391001004277100
Updatednode-releases@​2.0.14 ⏵ 2.0.23100 +11004487100
Updatedhas-tostringtag@​1.0.0 ⏵ 1.0.26710082 +152100
Addedes-define-property@​1.0.1671008252100
Updatedgopd@​1.0.1 ⏵ 1.2.067 +110078 +253100
Updatedes-set-tostringtag@​2.0.1 ⏵ 2.1.06710084 +552100
Addedobject-assign@​4.1.1671008654100
Added@​types/​parse-json@​4.0.21001005678100
Addedunicode-emoji-modifier-base@​1.0.01001006477100
Added@​pkgr/​core@​0.2.91001006485100
Added@​yarnpkg/​types@​4.0.11001006683100
Updated@​types/​graceful-fs@​4.1.5 ⏵ 4.1.910010066 +578100
Added@​unrs/​resolver-binding-wasm32-wasi@​1.11.11001006987100
Updated@​typescript-eslint/​visitor-keys@​5.62.0 ⏵ 8.46.010010071 +197100
See 204 more rows in the dashboard

View full report

@socket-security
Copy link
Copy Markdown

socket-security bot commented Oct 10, 2025

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • which@1.3.1
  • is-windows@1.0.2
  • object-assign@4.1.1
  • @sindresorhus/is@4.6.0
  • json-buffer@3.0.1
  • arrify@2.0.1
  • marked@4.3.0
  • ini@1.3.8
  • readdirp@3.6.0
  • @colors/colors@1.5.0
  • keyv@4.5.4
  • commander@10.0.1
  • any-promise@1.3.0
  • entities@4.5.0
  • cosmiconfig@7.1.0
  • mz@2.7.0
  • thenify@3.3.1
  • thenify-all@1.6.0
  • yaml@1.10.2
  • please-upgrade-node@3.2.0
  • semver-compare@1.0.0
  • estree-walker@2.0.2
  • array-differ@3.0.0
  • multimatch@5.0.0
  • resolve-pkg-maps@1.0.0
  • highlight.js@10.7.3
  • parse5@5.1.1
  • detect-file@1.0.0
  • resolve-dir@1.0.1
  • expand-tilde@2.0.2
  • homedir-polyfill@1.0.3
  • parse-passwd@1.0.0
  • global-modules@1.0.0
  • global-prefix@1.0.2
  • callsite@1.0.0
  • cli-highlight@2.1.11
  • parse5-htmlparser2-tree-adapter@6.0.1
  • are-docs-informative@0.0.2
  • detect-newline@4.0.1
  • vscode-oniguruma@1.7.0
  • vscode-textmate@8.0.0
  • require-package-name@2.0.1
  • typedoc@0.24.8
  • findup-sync@5.0.0
  • lunr@2.3.9
  • globrex@0.1.2
  • emojilib@2.4.0
  • skin-tone@2.0.0
  • unicode-emoji-modifier-base@1.0.0
  • @andrewbranch/untar.js@1.0.3
  • depcheck@1.4.7
  • deps-regex@0.2.0
  • @types/parse-json@4.0.2
  • marked@9.1.6
  • spdx-expression-parse@4.0.0
  • shiki@0.14.7
  • ts-expose-internals-conditionally@1.0.0-empty.0
  • es-errors@1.3.0
  • fflate@0.8.2
  • @arethetypeswrong/core@0.15.1
  • cli-table3@0.6.5
  • environment@1.1.0
  • eslint-compat-utils@0.5.1
  • jsonc-parser@3.3.1
  • eslint-plugin-es-x@7.8.0
  • @nolyfill/is-core-module@1.0.39
  • @arethetypeswrong/cli@0.15.4
  • source-map-js@1.2.1
  • @ts-bridge/resolver@0.2.0
  • @humanfs/core@0.19.1
  • node-emoji@2.2.0
  • es-define-property@1.0.1
  • dunder-proto@1.0.1
  • math-intrinsics@1.1.0
  • get-proto@1.0.1
  • es-object-atoms@1.1.1
  • @ts-bridge/cli@0.6.3
  • async-function@1.0.0
  • marked-terminal@7.3.0
  • @eslint/object-schema@2.1.6
  • supports-hyperlinks@3.2.0
  • ansi-sequence-parser@1.1.3
  • call-bind-apply-helpers@1.0.2
  • async-generator-function@1.0.0
  • parse-statements@1.0.11
  • @yarnpkg/types@4.0.1
  • parse-imports-exports@0.2.4
  • stable-hash@0.0.5
  • nanoid@3.3.11
  • ts-api-utils@2.1.0
  • ts-declaration-location@1.0.7
  • is-bun-module@2.0.0
  • eslint-import-resolver-typescript@3.10.1
  • @humanwhocodes/retry@0.4.3
  • postcss@8.5.6
  • stable-hash-x@0.2.0
  • eslint-import-context@0.1.9
  • @eslint/config-array@0.21.0
  • eslint-plugin-import-x@4.16.1
  • @babel/helper-globals@7.28.0
  • @unrs/resolver-binding-android-arm-eabi@1.11.1
  • @unrs/resolver-binding-android-arm64@1.11.1
  • @unrs/resolver-binding-darwin-arm64@1.11.1
  • @unrs/resolver-binding-darwin-x64@1.11.1
  • @unrs/resolver-binding-freebsd-x64@1.11.1
  • @unrs/resolver-binding-linux-arm-gnueabihf@1.11.1
  • @unrs/resolver-binding-linux-arm-musleabihf@1.11.1
  • @unrs/resolver-binding-linux-arm64-gnu@1.11.1
  • @unrs/resolver-binding-linux-arm64-musl@1.11.1
  • @unrs/resolver-binding-linux-ppc64-gnu@1.11.1
  • @unrs/resolver-binding-linux-riscv64-gnu@1.11.1
  • @unrs/resolver-binding-linux-riscv64-musl@1.11.1
  • @unrs/resolver-binding-linux-s390x-gnu@1.11.1
  • @unrs/resolver-binding-linux-x64-gnu@1.11.1
  • @unrs/resolver-binding-linux-x64-musl@1.11.1
  • @unrs/resolver-binding-wasm32-wasi@1.11.1
  • @unrs/resolver-binding-win32-arm64-msvc@1.11.1
  • @unrs/resolver-binding-win32-ia32-msvc@1.11.1
  • @unrs/resolver-binding-win32-x64-msvc@1.11.1
  • unrs-resolver@1.11.1
  • @napi-rs/wasm-runtime@0.2.12
  • picomatch@4.0.3
  • @pkgr/core@0.2.9
  • synckit@0.11.11
  • enhanced-resolve@5.18.3
  • @jridgewell/remapping@2.3.5
  • fdir@6.5.0
  • @emnapi/wasi-threads@1.1.0
  • @emnapi/runtime@1.5.0
  • @emnapi/core@1.5.0
  • @humanfs/node@0.16.7
  • tinyglobby@0.2.15
  • magic-string@0.30.19
  • @tybys/wasm-util@0.10.1
  • @eslint/plugin-kit@0.4.0
  • @eslint/core@0.16.0
  • @eslint/config-helpers@0.4.0
  • ansi-escapes@7.1.1
  • @vue/compiler-core@3.5.22
  • @vue/compiler-dom@3.5.22
  • @vue/compiler-sfc@3.5.22
  • @vue/compiler-ssr@3.5.22
  • @vue/shared@3.5.22
  • generator-function@2.0.1
  • tapable@2.3.0
  • napi-postinstall@0.3.4
  • @typescript-eslint/project-service@8.46.0
  • @typescript-eslint/tsconfig-utils@8.46.0
  • typescript-eslint@8.46.0
  • get-tsconfig@4.12.0
  • baseline-browser-mapping@2.8.16
  • ms@2.1.3
  • @types/minimatch@3.0.5
  • escodegen@2.1.0
  • is-plain-obj@4.1.0
  • convert-source-map@1.9.0
  • throat@6.0.2
  • comment-parser@1.4.1
  • punycode@2.3.1
  • @types/graceful-fs@4.1.9
  • @types/babel__core@7.20.5
  • @types/yargs@16.0.9
  • typescript@5.3.3
  • ts-node@10.9.2
  • file-entry-cache@8.0.0
  • has-tostringtag@1.0.2
  • flat-cache@4.0.1
  • tough-cookie@4.1.4
  • minimatch@9.0.5
  • minimatch@7.4.6
  • esquery@1.6.0
  • jsdoc-type-pratt-parser@4.1.0
  • escalade@3.2.0
  • @metamask/eslint-config@14.0.0
  • @metamask/eslint-config-nodejs@14.0.0
  • @metamask/eslint-config-typescript@14.0.0
  • @metamask/eslint-config-jest@14.0.0
  • picocolors@1.1.1
  • @eslint-community/regexpp@4.12.1
  • cross-spawn@7.0.6
  • eslint-plugin-promise@7.2.1
  • psl@1.15.0
  • has-symbols@1.1.0
  • gopd@1.2.0
  • jsesc@3.1.0
  • es-set-tostringtag@2.1.0
  • fast-glob@3.3.3
  • cjs-module-lexer@1.4.3
  • globals@15.15.0
  • globals@14.0.0
  • flatted@3.3.3
  • update-browserslist-db@1.1.3
  • git-hooks-list@4.1.1
  • @eslint/eslintrc@3.3.1
  • @babel/helper-string-parser@7.27.1
  • @babel/helper-validator-identifier@7.27.1
  • @babel/code-frame@7.27.1
  • @babel/helper-validator-option@7.27.1
  • @babel/helper-module-imports@7.27.1
  • @babel/helper-compilation-targets@7.27.2
  • @babel/template@7.27.2
  • @es-joy/jsdoccomment@0.50.2
  • ignore@5.3.2
  • ignore@7.0.5
  • @types/estree@1.0.8
  • acorn@8.15.0
  • eslint-visitor-keys@4.2.1
  • eslint-visitor-keys@3.4.3
  • eslint-scope@8.4.0
  • espree@10.4.0
  • eslint-plugin-jsdoc@50.8.0
  • eslint-plugin-jest@28.14.0
  • sort-package-json@3.4.0
  • decimal.js@10.6.0
  • form-data@3.0.4
  • eslint-config-prettier@9.1.2
  • prettier-plugin-packagejson@2.5.19
  • source-map@0.7.6
  • @types/babel__traverse@7.28.0
  • eslint-plugin-prettier@5.5.4
  • @jridgewell/gen-mapping@0.3.13
  • @jridgewell/sourcemap-codec@1.5.5
  • @babel/generator@7.28.3
  • @babel/helper-module-transforms@7.28.3
  • @babel/compat-data@7.28.4
  • @babel/core@7.28.4
  • @babel/traverse@7.28.4
  • @babel/types@7.28.4
  • @babel/parser@7.28.4
  • @babel/helpers@7.28.4
  • nwsapi@2.2.22
  • @eslint-community/eslint-utils@4.9.0
  • chalk@5.6.2
  • ansi-regex@6.2.2
  • @jridgewell/trace-mapping@0.3.31
  • debug@4.4.3
  • detect-indent@7.0.2
  • eslint-plugin-n@17.23.1
  • get-intrinsic@1.3.1
  • browserslist@4.26.3
  • @eslint/js@9.37.0
  • eslint@9.37.0
  • node-releases@2.0.23
  • @typescript-eslint/eslint-plugin@8.46.0
  • @typescript-eslint/scope-manager@8.46.0
  • @typescript-eslint/types@8.46.0
  • @typescript-eslint/visitor-keys@8.46.0
  • @typescript-eslint/parser@8.46.0
  • @typescript-eslint/type-utils@8.46.0
  • @typescript-eslint/typescript-estree@8.46.0
  • @typescript-eslint/utils@8.46.0
  • semver@7.7.3
  • caniuse-lite@1.0.30001749
  • @types/node@18.19.130
  • electron-to-chromium@1.5.234

View full report

@rekmarks rekmarks force-pushed the rekm/sync-module-template branch from 6b465ea to 2c6c21e Compare October 10, 2025 23:32
@rekmarks
Copy link
Copy Markdown
Member Author

@SocketSecurity ignore-all

These are all direct or transitive dependencies of dev deps that we use in the module template. They either have powerful capabilities that they need, or have "new" authors that all appear to be known quantities.

@rekmarks rekmarks marked this pull request as ready for review October 10, 2025 23:55
@rekmarks rekmarks requested review from a team as code owners October 10, 2025 23:55
@rekmarks rekmarks requested a review from Mrtenz October 10, 2025 23:55
@rekmarks rekmarks changed the title refactor!: Synchronize with module template refactor!: Synchronize dev toolchain with module template Oct 10, 2025
@rekmarks rekmarks changed the title refactor!: Synchronize dev toolchain with module template refactor!: Synchronize dev toolchain with module template and core monorepo Oct 11, 2025
Mrtenz
Mrtenz previously approved these changes Oct 13, 2025
Mrtenz
Mrtenz previously approved these changes Oct 13, 2025
cursor[bot]

This comment was marked as outdated.

res.result = 'default result';
}
res.jsonrpc ??= '2.0';
res.result ??= 'default result';
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.

This would replace null now. Is that okay?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, but only because it's a test utility and the tests still pass. On review, it's still seems inappropriate for this function, so I reverted it.

jiexi
jiexi previously approved these changes Oct 13, 2025
@rekmarks rekmarks merged commit 5391380 into main Oct 13, 2025
20 checks passed
@rekmarks rekmarks deleted the rekm/sync-module-template branch October 13, 2025 17:09
jiexi added a commit that referenced this pull request Oct 15, 2025
Gudahtt pushed a commit that referenced this pull request Oct 15, 2025
… core monorepo (#420)" (#423)

This reverts commit 5391380.

This breaking change is blocking a release fix that will include:
1. #421
2. #422

Will readd this commit after those two PRs are merged and a patch
release is cut

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?

Are there any issues or other links reviewers should consult to
understand this pull request better? For instance:

* Fixes #12345
* See: #67890
-->
jiexi added a commit that referenced this pull request Oct 15, 2025
Gudahtt pushed a commit that referenced this pull request Oct 15, 2025
…d core monorepo (#420)" (#423) (#426)

This reverts commit c591a5f (Reapplies
5391380)

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?

Are there any issues or other links reviewers should consult to
understand this pull request better? For instance:

* Fixes #12345
* See: #67890
-->


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Overhauls the dev toolchain: upgrades ESLint to v9 with new
configs/plugins, moves to TypeScript 5.x, adds
TypeDoc/depcheck/ts-bridge/ATTW tooling, updates Prettier to v3, and
refreshes dependencies.
> 
> - **Dev toolchain sync/upgrade**
> - **ESLint 9**: Bump core and configs (MetaMask v14), migrate
plugins/resolvers (e.g., `eslint-plugin-import-x`,
`eslint-import-resolver-typescript`), and update related utilities.
> - **TypeScript 5.x**: Update TypeScript, `typescript-eslint` (v8),
`ts-node`, and supporting packages.
> - **Formatting & docs**: Upgrade **Prettier** to v3 and
`prettier-plugin-packagejson`; add **TypeDoc**.
> - **New tooling**: Add `@arethetypeswrong/cli`, `@ts-bridge/cli`, and
**depcheck** for dependency hygiene.
> - **Dependencies**: Broad dependency updates and lockfile refresh to
align with core template.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5ef56a4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

4 participants