chore(smart-transactions-controller): move into packages/#9139
Open
cryptodev-2s wants to merge 14 commits into
Open
chore(smart-transactions-controller): move into packages/#9139cryptodev-2s wants to merge 14 commits into
cryptodev-2s wants to merge 14 commits into
Conversation
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.
|
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. |
…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.
…r in README dep graph
…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.
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Phase C PR #12 of the package migration process guide for
@metamask/smart-transactions-controller.Final move from
merged-packages/intopackages/plus the wiring needed foryarn install,yarn workspace ... test,yarn constraints, and the README/CHANGELOG checks to pass.Changes
git mv merged-packages/smart-transactions-controller packages/(renames only, no content drift). Removed the now-emptymerged-packages/directory../packages/smart-transactions-controllerand./packages/smart-transactions-controller/tsconfig.build.jsonreferences (alphabetical).README.md: ranyarn readme-content:updateto add the package to the package list + the mermaid dependency graph.yarn.config.cjs: added@metamask/smart-transactions-controllerto the license-exception list. It carries a ConsenSys non-commercialLICENSEwe did not relicense to MIT..github/CODEOWNERS+teams.json: registered ownership to@MetaMask/transactions/team-transactions(added a new "Transactions Team" section inCODEOWNERS).packages/smart-transactions-controller/package.json:nockfrom^14.0.0-beta.7→^13.3.1to match the rest of the monorepo. The v14-beta mock incompatibilities we saw in the source-repo context don't surface under the monorepo'sjest.config.packages.jssetup — 196/196 tests pass on nock 13.@ethereumjs/tx,@ethereumjs/util,fast-json-patch(runtime),@metamask/gas-fee-controller(dev).yarn constraints --fixstripped the trailing period fromdescription.packages/smart-transactions-controller/jest.config.js: dropped thesetupFiles: ['./setupJest.js']override and thetestTimeout: 2500override. Core's roottests/setup.tsalready clears Node's native fetch and loadsisomorphic-fetch(a superset of whatsetupJest.jsdid); 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 byauto-changelogv6.package.json+SmartTransactionsController.test.ts.Verification
yarn installyarn workspace @metamask/smart-transactions-controller test— 196/196 pass; ~95% coverageyarn workspace @metamask/smart-transactions-controller buildyarn constraintsyarn lint:teamsyarn knip --dependencies(clean for this package)yarn workspace @metamask/smart-transactions-controller changelog:validateyarn lint:misc(oxfmt)yarn readme-content:checkDownstream
No core package currently depends on
@metamask/smart-transactions-controller, so this PR contains no downstream version-bump or CHANGELOG updates.References
@metamask/smart-transactions-controllerhistory intomerged-packages/#9130), CHANGELOG reset (chore(smart-transactions-controller): reset CHANGELOG after migration #9131), strip files (chore(smart-transactions-controller): strip source-repo-only files #9132), replace configs (chore(smart-transactions-controller): replace configs to extend monorepo roots #9134), align deps + scripts (chore(smart-transactions-controller): align deps and build scripts with monorepo #9136), README update (chore(smart-transactions-controller): update README for monorepo context #9138)docs/processes/package-migration-process-guide.mdChecklist