Skip to content

chore(smart-transactions-controller): move into packages/#9139

Open
cryptodev-2s wants to merge 14 commits into
mainfrom
chore/smart-transactions-controller-move-into-packages
Open

chore(smart-transactions-controller): move into packages/#9139
cryptodev-2s wants to merge 14 commits into
mainfrom
chore/smart-transactions-controller-move-into-packages

Conversation

@cryptodev-2s

@cryptodev-2s cryptodev-2s commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Explanation

Phase C PR #12 of the package migration process guide for @metamask/smart-transactions-controller.

Final move from merged-packages/ into packages/ plus the wiring needed for yarn install, yarn workspace ... test, yarn constraints, and the README/CHANGELOG checks to pass.

Changes

  • Moved: git mv merged-packages/smart-transactions-controller packages/ (renames only, no content drift). Removed the now-empty merged-packages/ directory.
  • Root tsconfigs: added ./packages/smart-transactions-controller and ./packages/smart-transactions-controller/tsconfig.build.json references (alphabetical).
  • Root README.md: ran yarn readme-content:update to add the package to the package list + the mermaid dependency graph.
  • yarn.config.cjs: added @metamask/smart-transactions-controller to the license-exception list. It carries a ConsenSys non-commercial LICENSE we did not relicense to MIT.
  • .github/CODEOWNERS + teams.json: registered ownership to @MetaMask/transactions / team-transactions (added a new "Transactions Team" section in CODEOWNERS).
  • packages/smart-transactions-controller/package.json:
    • Aligned nock from ^14.0.0-beta.7^13.3.1 to match the rest of the monorepo. The v14-beta mock incompatibilities we saw in the source-repo context don't surface under the monorepo's jest.config.packages.js setup — 196/196 tests pass on nock 13.
    • Dropped 4 unused deps flagged by knip: @ethereumjs/tx, @ethereumjs/util, fast-json-patch (runtime), @metamask/gas-fee-controller (dev).
    • yarn constraints --fix stripped the trailing period from description.
  • packages/smart-transactions-controller/jest.config.js: dropped the setupFiles: ['./setupJest.js'] override and the testTimeout: 2500 override. Core's root tests/setup.ts already clears Node's native fetch and loads isomorphic-fetch (a superset of what setupJest.js did); Jest's default 5000ms timeout is more generous than the previous 2500ms. Coverage thresholds kept at the source-repo's originals (95% achieved comfortably exceeds them).
  • packages/smart-transactions-controller/setupJest.js: deleted (now redundant).
  • packages/smart-transactions-controller/CHANGELOG.md: documented the migration + dropped deps under [Unreleased] and added the [Unreleased] link reference required by auto-changelog v6.
  • Formatting: applied oxfmt fixes to package.json + SmartTransactionsController.test.ts.

Verification

  • yarn install
  • yarn workspace @metamask/smart-transactions-controller test — 196/196 pass; ~95% coverage
  • yarn workspace @metamask/smart-transactions-controller build
  • yarn constraints
  • yarn lint:teams
  • yarn knip --dependencies (clean for this package)
  • yarn workspace @metamask/smart-transactions-controller changelog:validate
  • yarn lint:misc (oxfmt)
  • yarn readme-content:check

Downstream

No core package currently depends on @metamask/smart-transactions-controller, so this PR contains no downstream version-bump or CHANGELOG updates.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Phase C PR #12 — final move from `merged-packages/` into `packages/`
plus the wiring needed for `yarn install`, `yarn workspace ... test`,
and `yarn constraints` to pass:

- `git mv merged-packages/smart-transactions-controller packages/`,
  removed the now-empty `merged-packages/` directory
- Added the package to root `tsconfig.json` and `tsconfig.build.json`
  references (alphabetical)
- `yarn.config.cjs`:
  - Added `nock: ['^14.0.0-beta.7']` to `ALLOWED_INCONSISTENT_DEPENDENCIES`
    so the package's `nock@14-beta` (kept intentionally — downgrading
    to root's `^13.3.1` breaks 22 tests) doesn't fail the
    cross-package consistency check.
  - Added `@metamask/smart-transactions-controller` to the
    license-exception list (it carries a ConsenSys non-commercial
    license that we did not relicense to MIT)
- `.github/CODEOWNERS` + `teams.json`: registered ownership to
  `@MetaMask/transactions` / `team-transactions`
- `jest.config.js`: lowered coverage thresholds to reflect the
  monorepo Jest config's wider `collectCoverageFrom` glob
  (`./src/**/*.ts` recursive, vs the standalone repo's top-level-only
  pattern). Actual achieved coverage is the same; the threshold
  rescales because subdirectory files now count.
- `yarn constraints --fix` ran clean (just stripped the trailing
  period from `description`).

Verified:
- `yarn install` ✓
- `yarn workspace @metamask/smart-transactions-controller test` ✓
  196/196 pass
- `yarn workspace @metamask/smart-transactions-controller build` ✓
- `yarn constraints` ✓
- `yarn lint:teams` ✓

No core package currently depends on `@metamask/smart-transactions-controller`,
so no downstream version-bump or CHANGELOG updates are needed.

Per Phase C of the package-migration-process-guide.
@cryptodev-2s cryptodev-2s requested a review from a team as a code owner June 16, 2026 08:49
@socket-security

socket-security Bot commented Jun 16, 2026

Copy link
Copy Markdown

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.

View full report

@cryptodev-2s cryptodev-2s self-assigned this Jun 16, 2026
…o monorepo

- Removed 4 unused deps flagged by knip:
  - dependencies: @ethereumjs/tx, @ethereumjs/util, fast-json-patch
  - devDependencies: @metamask/gas-fee-controller
- Aligned nock from ^14.0.0-beta.7 to ^13.3.1 to match the rest of the
  monorepo. In the monorepo's jest.config.packages.js setup the
  v14-beta mock incompatibilities we saw in the source-repo context
  no longer surface — all 196 tests pass on nock 13.
- Removed the now-unneeded `nock` entry from
  `ALLOWED_INCONSISTENT_DEPENDENCIES` in yarn.config.cjs.
- Restored the source-repo's original Jest coverage thresholds
  (branches 74.65, functions 88.18, lines 92.33, statements 91.89)
  since actual coverage on nock 13 (95.3% statements, 95.3% lines) is
  comfortably above them.
Core's root `tests/setup.ts` already clears Node's native
fetch/Headers/Request/Response and loads `isomorphic-fetch` — a
superset of what the package's `setupJest.js` did. Dropping the
local setup file and the `setupFiles` override in `jest.config.js`
so the package just inherits the root setup.

Tests still pass (196/196, ~95% coverage).
Falls back to Jest's default (5000ms), which is more generous than
the previous 2500ms. No test relies on the tighter limit; 196/196
still pass.
…g v6 validation

- Wrap the migration entry in a `### Changed` section (the migration
  entry was bare under `## [Unreleased]`; auto-changelog v6 requires
  every change to live under a category).
- Add `[Unreleased]: https://github.com/MetaMask/core/` link
  reference (auto-changelog v6 requires every referenced version,
  including Unreleased, to have a link definition).
…ps in CHANGELOG

- Link the migration entry to this PR.
- Add a `Removed` entry for the three runtime deps dropped as unused
  (`@ethereumjs/tx`, `@ethereumjs/util`, `fast-json-patch`) so the
  consumer-facing dependency-surface change is recorded.
Source-repo's eslint.config.mjs had broad TODO overrides disabling
strict TS/jsdoc rules; those went away when the file was deleted in
PR #9132. With the package now linted by the root flat config, the
suppressed rules surface again.

- `eslint --fix` auto-resolved what it could (JSDoc tag-lines spacing
  in `utils.ts` and `tests/helpers.ts`; removed the now-redundant
  `@typescript-eslint/no-shadow` disable directive in `constants.ts`).
- `eslint --suppress-all` recorded the remaining 112 known issues
  (mostly `explicit-function-return-type`, `no-explicit-any`,
  `prefer-nullish-coalescing`, deprecated `:stateChange` event
  references, and `no-floating-promises`) in
  `eslint-suppressions.json` so the package matches core's standard
  technical-debt convention. Each entry is per-file/per-rule with a
  count so the suppression decays as issues are fixed.

Tests + build remain green; lint now passes.
The earlier suppress-all pass missed the rules that only surface when
the monorepo's `lint:eslint` flow (which runs `build:only-clean` first)
clears package `dist/` directories before linting. With everything
cleared, several `@metamask/transaction-controller` / `@metamask/profile-sync-controller`
action types fall back to `{}`, which triggers `no-base-to-string` and
`restrict-template-expressions` on a Bearer-token template literal, plus
a handful of other rule hits across the package and a few other
packages (mostly `@types/jest` related signatures).

Captured them with `yarn eslint --suppress-all` after `yarn build:only-clean`
so the suppressions match what CI sees, then applied `oxfmt`.
`.skills-cache/` is a postinstall artifact (it's already in .gitignore),
but it wasn't in eslint's ignores list, so it was being linted. My
earlier `eslint --suppress-all` pass picked up errors from
`.skills-cache/metamask-skills/...` files and put them into
eslint-suppressions.json, which doesn't belong there.

Adds `.skills-cache/**` to the root eslint ignores list and drops the
3 stale entries from eslint-suppressions.json.
…-dep removal

The dropped deps (@ethereumjs/tx, @ethereumjs/util, fast-json-patch)
weren't actually consumed by source code, so removing them has no
observable effect on consumers. Per project convention, only
consumer-facing changes belong in the CHANGELOG.
@cryptodev-2s

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.5.2-preview-742bf0b2a
@metamask-previews/accounts-controller@39.0.1-preview-742bf0b2a
@metamask-previews/address-book-controller@7.1.2-preview-742bf0b2a
@metamask-previews/ai-controllers@0.7.0-preview-742bf0b2a
@metamask-previews/analytics-controller@1.1.1-preview-742bf0b2a
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-742bf0b2a
@metamask-previews/announcement-controller@8.1.0-preview-742bf0b2a
@metamask-previews/app-metadata-controller@2.0.1-preview-742bf0b2a
@metamask-previews/approval-controller@9.0.2-preview-742bf0b2a
@metamask-previews/assets-controller@9.0.1-preview-742bf0b2a
@metamask-previews/assets-controllers@109.1.0-preview-742bf0b2a
@metamask-previews/authenticated-user-storage@2.0.0-preview-742bf0b2a
@metamask-previews/base-controller@9.1.0-preview-742bf0b2a
@metamask-previews/base-data-service@0.1.3-preview-742bf0b2a
@metamask-previews/bridge-controller@75.1.1-preview-742bf0b2a
@metamask-previews/bridge-status-controller@72.1.0-preview-742bf0b2a
@metamask-previews/build-utils@3.0.4-preview-742bf0b2a
@metamask-previews/chain-agnostic-permission@1.6.2-preview-742bf0b2a
@metamask-previews/chomp-api-service@3.1.0-preview-742bf0b2a
@metamask-previews/claims-controller@0.5.3-preview-742bf0b2a
@metamask-previews/client-controller@1.0.1-preview-742bf0b2a
@metamask-previews/compliance-controller@2.1.0-preview-742bf0b2a
@metamask-previews/composable-controller@12.0.1-preview-742bf0b2a
@metamask-previews/config-registry-controller@0.4.1-preview-742bf0b2a
@metamask-previews/connectivity-controller@0.2.0-preview-742bf0b2a
@metamask-previews/controller-utils@12.2.0-preview-742bf0b2a
@metamask-previews/core-backend@6.3.3-preview-742bf0b2a
@metamask-previews/delegation-controller@3.0.2-preview-742bf0b2a
@metamask-previews/earn-controller@12.2.0-preview-742bf0b2a
@metamask-previews/eip-5792-middleware@3.0.4-preview-742bf0b2a
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.1-preview-742bf0b2a
@metamask-previews/eip1193-permission-middleware@2.0.1-preview-742bf0b2a
@metamask-previews/ens-controller@19.1.3-preview-742bf0b2a
@metamask-previews/eth-block-tracker@15.0.1-preview-742bf0b2a
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-742bf0b2a
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-742bf0b2a
@metamask-previews/foundryup@1.0.1-preview-742bf0b2a
@metamask-previews/gas-fee-controller@26.2.2-preview-742bf0b2a
@metamask-previews/gator-permissions-controller@4.2.0-preview-742bf0b2a
@metamask-previews/geolocation-controller@0.1.3-preview-742bf0b2a
@metamask-previews/json-rpc-engine@10.5.0-preview-742bf0b2a
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-742bf0b2a
@metamask-previews/keyring-controller@27.1.0-preview-742bf0b2a
@metamask-previews/logging-controller@8.0.2-preview-742bf0b2a
@metamask-previews/message-manager@14.1.2-preview-742bf0b2a
@metamask-previews/messenger@1.2.0-preview-742bf0b2a
@metamask-previews/messenger-cli@0.2.0-preview-742bf0b2a
@metamask-previews/money-account-balance-service@2.0.0-preview-742bf0b2a
@metamask-previews/money-account-controller@0.3.3-preview-742bf0b2a
@metamask-previews/money-account-upgrade-controller@2.0.5-preview-742bf0b2a
@metamask-previews/multichain-account-service@10.0.3-preview-742bf0b2a
@metamask-previews/multichain-api-middleware@3.1.4-preview-742bf0b2a
@metamask-previews/multichain-network-controller@3.1.3-preview-742bf0b2a
@metamask-previews/multichain-transactions-controller@7.1.1-preview-742bf0b2a
@metamask-previews/name-controller@9.1.2-preview-742bf0b2a
@metamask-previews/network-controller@32.0.0-preview-742bf0b2a
@metamask-previews/network-enablement-controller@5.3.0-preview-742bf0b2a
@metamask-previews/notification-services-controller@24.1.3-preview-742bf0b2a
@metamask-previews/passkey-controller@2.0.1-preview-742bf0b2a
@metamask-previews/permission-controller@13.1.1-preview-742bf0b2a
@metamask-previews/permission-log-controller@5.1.0-preview-742bf0b2a
@metamask-previews/perps-controller@8.1.0-preview-742bf0b2a
@metamask-previews/phishing-controller@17.2.0-preview-742bf0b2a
@metamask-previews/polling-controller@16.0.6-preview-742bf0b2a
@metamask-previews/preferences-controller@23.1.0-preview-742bf0b2a
@metamask-previews/profile-metrics-controller@3.2.0-preview-742bf0b2a
@metamask-previews/profile-sync-controller@28.2.0-preview-742bf0b2a
@metamask-previews/ramps-controller@14.2.0-preview-742bf0b2a
@metamask-previews/rate-limit-controller@7.0.1-preview-742bf0b2a
@metamask-previews/react-data-query@0.2.1-preview-742bf0b2a
@metamask-previews/remote-feature-flag-controller@4.2.2-preview-742bf0b2a
@metamask-previews/sample-controllers@5.0.1-preview-742bf0b2a
@metamask-previews/seedless-onboarding-controller@10.0.2-preview-742bf0b2a
@metamask-previews/selected-network-controller@26.1.3-preview-742bf0b2a
@metamask-previews/shield-controller@5.1.2-preview-742bf0b2a
@metamask-previews/signature-controller@39.2.5-preview-742bf0b2a
@metamask-previews/smart-transactions-controller@24.2.1-preview-742bf0b2a
@metamask-previews/snap-account-service@0.3.1-preview-742bf0b2a
@metamask-previews/social-controllers@2.2.1-preview-742bf0b2a
@metamask-previews/storage-service@1.0.2-preview-742bf0b2a
@metamask-previews/subscription-controller@6.2.0-preview-742bf0b2a
@metamask-previews/transaction-controller@68.0.0-preview-742bf0b2a
@metamask-previews/transaction-pay-controller@23.7.0-preview-742bf0b2a
@metamask-previews/user-operation-controller@41.2.4-preview-742bf0b2a
@metamask-previews/wallet@3.0.0-preview-742bf0b2a
@metamask-previews/wallet-cli@0.0.0-preview-742bf0b2a

@cryptodev-2s cryptodev-2s requested a review from Mrtenz June 16, 2026 11:59
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.

1 participant