From b5e16eb8d3eacc262cef0e7d5a366cf771e5a220 Mon Sep 17 00:00:00 2001 From: Ulisses Ferreira Date: Wed, 19 Aug 2026 11:51:24 +0100 Subject: [PATCH 1/4] fix: add TypeScript project references, mirroring MetaMask/core Adds a `references` entry to bitcoin-wallet-snap, solana-wallet-snap, and tron-wallet-snap's tsconfig.json for their dependency on snap-networks-utils, and lists every snap package in the root tsconfig.json's references, matching the pattern used in MetaMask/core/packages/profile-metrics-controller. Does not touch the existing @metamask/* paths/baseUrl mapping. Project references solve build ordering (tsc --build) and editor go-to-source navigation; they do not change how a plain `tsc --noEmit` resolves `@metamask/*` imports, which still goes through node_modules to each package's built dist/ output. That's a separate problem (see #167, #169). --- packages/bitcoin-wallet-snap/CHANGELOG.md | 4 ++++ packages/bitcoin-wallet-snap/tsconfig.json | 1 + packages/solana-wallet-snap/CHANGELOG.md | 1 + packages/solana-wallet-snap/tsconfig.json | 1 + packages/tron-wallet-snap/CHANGELOG.md | 1 + packages/tron-wallet-snap/tsconfig.json | 1 + tsconfig.json | 15 +++++++++++++++ 7 files changed, 24 insertions(+) diff --git a/packages/bitcoin-wallet-snap/CHANGELOG.md b/packages/bitcoin-wallet-snap/CHANGELOG.md index 570452d8e..2127317f2 100644 --- a/packages/bitcoin-wallet-snap/CHANGELOG.md +++ b/packages/bitcoin-wallet-snap/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Add a TypeScript project reference to `@metamask/snap-networks-utils` in `tsconfig.json`, mirroring the pattern used in `MetaMask/core`, for correct `tsc --build` ordering and editor go-to-source navigation + ## [2.0.1] ### Fixed diff --git a/packages/bitcoin-wallet-snap/tsconfig.json b/packages/bitcoin-wallet-snap/tsconfig.json index a8a6abb0f..34352b8df 100644 --- a/packages/bitcoin-wallet-snap/tsconfig.json +++ b/packages/bitcoin-wallet-snap/tsconfig.json @@ -15,5 +15,6 @@ "moduleResolution": "bundler", "types": ["jest"] }, + "references": [{ "path": "../snap-networks-utils" }], "include": ["**/*.ts", "**/*.tsx", "locales/*.json"] } diff --git a/packages/solana-wallet-snap/CHANGELOG.md b/packages/solana-wallet-snap/CHANGELOG.md index ab6dd1dbf..4ae9d462f 100644 --- a/packages/solana-wallet-snap/CHANGELOG.md +++ b/packages/solana-wallet-snap/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Add a TypeScript project reference to `@metamask/snap-networks-utils` in `tsconfig.json`, mirroring the pattern used in `MetaMask/core`, for correct `tsc --build` ordering and editor go-to-source navigation - Extract Snap-owned assets domain logic into `SnapAssetsAdapter`; `AssetsService` is a thin facade that delegates metadata, market data, fetch, persist, and account asset reads through the adapter (no Core routing yet). ([#121](https://github.com/MetaMask/internal-snaps/pull/121)) - Align `AssetsService` read API with `snap-networks-utils` / AssetsController shapes by adding `getAccountAssetByID`, `getAccountAssetsByIDs`, `getAccountAssetsByScope`, and `getAccountAssets`, and routing Keyring and Send through them (still Snap-owned storage). ([#120](https://github.com/MetaMask/internal-snaps/pull/120)) diff --git a/packages/solana-wallet-snap/tsconfig.json b/packages/solana-wallet-snap/tsconfig.json index 3eb63f359..11f05f5bf 100644 --- a/packages/solana-wallet-snap/tsconfig.json +++ b/packages/solana-wallet-snap/tsconfig.json @@ -16,5 +16,6 @@ "moduleResolution": "bundler", "types": ["jest"] }, + "references": [{ "path": "../snap-networks-utils" }], "include": ["**/*.ts", "**/*.tsx", "locales/*.json"] } diff --git a/packages/tron-wallet-snap/CHANGELOG.md b/packages/tron-wallet-snap/CHANGELOG.md index 733239f5e..31a9d0699 100644 --- a/packages/tron-wallet-snap/CHANGELOG.md +++ b/packages/tron-wallet-snap/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Add a TypeScript project reference to `@metamask/snap-networks-utils` in `tsconfig.json`, mirroring the pattern used in `MetaMask/core`, for correct `tsc --build` ordering and editor go-to-source navigation - Extract shared asset util functions and inject `SnapAssetsAdapter` from `context` into `AssetsService` ([#143](https://github.com/MetaMask/internal-snaps/pull/143)) - Rename `getByKeyringAccountId` to `getAccountAssets` (with essential-asset synthesis) and update keyring callers ([#143](https://github.com/MetaMask/internal-snaps/pull/143)) diff --git a/packages/tron-wallet-snap/tsconfig.json b/packages/tron-wallet-snap/tsconfig.json index df5a8f6b6..c00d4f016 100644 --- a/packages/tron-wallet-snap/tsconfig.json +++ b/packages/tron-wallet-snap/tsconfig.json @@ -15,5 +15,6 @@ "moduleResolution": "bundler", "types": ["jest"] }, + "references": [{ "path": "../snap-networks-utils" }], "include": ["**/*.ts", "**/*.tsx", "locales/*.json"] } diff --git a/tsconfig.json b/tsconfig.json index 8555d5148..23df98f6d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,8 +9,23 @@ "skipLibCheck": true }, "references": [ + { + "path": "./packages/bitcoin-wallet-snap" + }, + { + "path": "./packages/sample-snap" + }, { "path": "./packages/snap-networks-utils" + }, + { + "path": "./packages/solana-wallet-snap" + }, + { + "path": "./packages/stellar-wallet-snap" + }, + { + "path": "./packages/tron-wallet-snap" } ], "files": [], From 5a960003382a752899607a1ceb0da7cd2fa77188 Mon Sep 17 00:00:00 2001 From: Ulisses Ferreira Date: Wed, 19 Aug 2026 12:23:06 +0100 Subject: [PATCH 2/4] docs: add tsc --build lint-graph infra, mirroring MetaMask/core (WIP/demonstrative) Structurally replicates core's incremental repository-wide type-checking setup: tsconfig.packages.lint.json (shared), a tsconfig.lint.json per package (outDir/tsBuildInfoFile -> .tsc-lint-cache, references to workspace deps), a root tsconfig.lint.json referencing all six packages, and a `lint:tsc` script wired into `yarn lint`, exactly matching MetaMask/core/tsconfig.lint.json and MetaMask/core/packages/base-controller/tsconfig.lint.json. This intentionally does NOT touch the existing @metamask/* paths/baseUrl mapping (per #170's original scope). Running `yarn lint:tsc` from a clean state (no packages/*/dist, no .tsbuildinfo/.tsc-lint-cache) currently fails: - ~70 "Cannot find module '@metamask/snap-networks-utils/...'" errors in bitcoin-wallet-snap, solana-wallet-snap, tron-wallet-snap. This is the expected, confirmed result: the reference graph rebuilds each project's OWN .tsc-lint-cache output, but the importing package still resolves the bare specifier via node_modules -> package.json -> the real dist/, which this graph never touches. `references` + `tsc --build` do not remove the need for a paths -> src mapping (#167/#169) -- core's own tsconfig.lint.json files extend each package's regular tsconfig.json specifically to inherit that mapping. - 13 TS6307 "Projects must list all files or use an 'include' pattern" errors, specific to composite/--build mode's stricter accounting of every file entering the program (nested JSON test fixtures, snap.manifest.json) vs plain `tsc --noEmit`. A real migration would need broader `include` patterns per package. - 18 pre-existing, unrelated "Cannot find module '@metamask/superstruct'" errors via a ../snaps-registry path, confirmed byte-for-byte identical on unmodified main with or without any of this branch's changes. Committed as-is, findings documented, to answer "what would full Core parity require" -- not intended to be merged in this state. --- .gitignore | 2 ++ package.json | 3 +- .../bitcoin-wallet-snap/tsconfig.lint.json | 8 +++++ packages/sample-snap/tsconfig.lint.json | 7 +++++ .../snap-networks-utils/tsconfig.lint.json | 7 +++++ .../solana-wallet-snap/tsconfig.lint.json | 8 +++++ .../stellar-wallet-snap/tsconfig.lint.json | 7 +++++ packages/tron-wallet-snap/tsconfig.lint.json | 8 +++++ tsconfig.lint.json | 30 +++++++++++++++++++ tsconfig.packages.lint.json | 9 ++++++ 10 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 packages/bitcoin-wallet-snap/tsconfig.lint.json create mode 100644 packages/sample-snap/tsconfig.lint.json create mode 100644 packages/snap-networks-utils/tsconfig.lint.json create mode 100644 packages/solana-wallet-snap/tsconfig.lint.json create mode 100644 packages/stellar-wallet-snap/tsconfig.lint.json create mode 100644 packages/tron-wallet-snap/tsconfig.lint.json create mode 100644 tsconfig.lint.json create mode 100644 tsconfig.packages.lint.json diff --git a/.gitignore b/.gitignore index ca324d052..31fc8882b 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,8 @@ scripts/coverage # typescript packages/*/*.tsbuildinfo *.tsbuildinfo +packages/*/.tsc-lint-cache +.tsc-lint-cache # AI .sisyphus/ diff --git a/package.json b/package.json index 105c1c46b..fe2aec244 100644 --- a/package.json +++ b/package.json @@ -22,13 +22,14 @@ "changelog:validate": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run changelog:validate", "create-release-branch": "create-release-branch --formatter oxfmt", "create-package": "tsx scripts/create-package", - "lint": "yarn lint:eslint && echo && yarn lint:misc --check && yarn constraints && yarn lint:dependencies && yarn readme-content:check", + "lint": "yarn lint:tsc && yarn lint:eslint && echo && yarn lint:misc --check && yarn constraints && yarn lint:dependencies && yarn readme-content:check", "lint:dependencies": "depcheck && yarn dedupe --check", "lint:dependencies:fix": "depcheck && yarn dedupe", "lint:eslint": "yarn build:only-clean && NODE_OPTIONS='--max-old-space-size=6144' yarn eslint", "lint:fix": "yarn lint:eslint --fix --prune-suppressions && echo && yarn lint:misc --write && yarn constraints --fix && yarn lint:dependencies:fix && yarn readme-content:update", "lint:misc": "oxfmt --ignore-path .gitignore", "lint:misc:check": "yarn lint:misc --check", + "lint:tsc": "tsc --build tsconfig.lint.json", "prepack": "./scripts/prepack.sh", "prepare-preview-builds": "./scripts/prepare-preview-builds.sh", "readme-content:check": "tsx scripts/update-readme-content.ts --check", diff --git a/packages/bitcoin-wallet-snap/tsconfig.lint.json b/packages/bitcoin-wallet-snap/tsconfig.lint.json new file mode 100644 index 000000000..bc1f95a73 --- /dev/null +++ b/packages/bitcoin-wallet-snap/tsconfig.lint.json @@ -0,0 +1,8 @@ +{ + "extends": ["./tsconfig.json", "../../tsconfig.packages.lint.json"], + "compilerOptions": { + "outDir": "./.tsc-lint-cache", + "tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo" + }, + "references": [{ "path": "../snap-networks-utils/tsconfig.lint.json" }] +} diff --git a/packages/sample-snap/tsconfig.lint.json b/packages/sample-snap/tsconfig.lint.json new file mode 100644 index 000000000..378ed1dce --- /dev/null +++ b/packages/sample-snap/tsconfig.lint.json @@ -0,0 +1,7 @@ +{ + "extends": ["./tsconfig.json", "../../tsconfig.packages.lint.json"], + "compilerOptions": { + "outDir": "./.tsc-lint-cache", + "tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo" + } +} diff --git a/packages/snap-networks-utils/tsconfig.lint.json b/packages/snap-networks-utils/tsconfig.lint.json new file mode 100644 index 000000000..378ed1dce --- /dev/null +++ b/packages/snap-networks-utils/tsconfig.lint.json @@ -0,0 +1,7 @@ +{ + "extends": ["./tsconfig.json", "../../tsconfig.packages.lint.json"], + "compilerOptions": { + "outDir": "./.tsc-lint-cache", + "tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo" + } +} diff --git a/packages/solana-wallet-snap/tsconfig.lint.json b/packages/solana-wallet-snap/tsconfig.lint.json new file mode 100644 index 000000000..bc1f95a73 --- /dev/null +++ b/packages/solana-wallet-snap/tsconfig.lint.json @@ -0,0 +1,8 @@ +{ + "extends": ["./tsconfig.json", "../../tsconfig.packages.lint.json"], + "compilerOptions": { + "outDir": "./.tsc-lint-cache", + "tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo" + }, + "references": [{ "path": "../snap-networks-utils/tsconfig.lint.json" }] +} diff --git a/packages/stellar-wallet-snap/tsconfig.lint.json b/packages/stellar-wallet-snap/tsconfig.lint.json new file mode 100644 index 000000000..378ed1dce --- /dev/null +++ b/packages/stellar-wallet-snap/tsconfig.lint.json @@ -0,0 +1,7 @@ +{ + "extends": ["./tsconfig.json", "../../tsconfig.packages.lint.json"], + "compilerOptions": { + "outDir": "./.tsc-lint-cache", + "tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo" + } +} diff --git a/packages/tron-wallet-snap/tsconfig.lint.json b/packages/tron-wallet-snap/tsconfig.lint.json new file mode 100644 index 000000000..bc1f95a73 --- /dev/null +++ b/packages/tron-wallet-snap/tsconfig.lint.json @@ -0,0 +1,8 @@ +{ + "extends": ["./tsconfig.json", "../../tsconfig.packages.lint.json"], + "compilerOptions": { + "outDir": "./.tsc-lint-cache", + "tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo" + }, + "references": [{ "path": "../snap-networks-utils/tsconfig.lint.json" }] +} diff --git a/tsconfig.lint.json b/tsconfig.lint.json new file mode 100644 index 000000000..754f4e7c2 --- /dev/null +++ b/tsconfig.lint.json @@ -0,0 +1,30 @@ +{ + /** + * This configuration incrementally enables repository-wide type checking. + */ + "extends": "./tsconfig.json", + "compilerOptions": { + "skipLibCheck": true, + "tsBuildInfoFile": "./.tsc-lint-cache/lint.tsbuildinfo" + }, + "references": [ + { + "path": "./packages/bitcoin-wallet-snap/tsconfig.lint.json" + }, + { + "path": "./packages/sample-snap/tsconfig.lint.json" + }, + { + "path": "./packages/snap-networks-utils/tsconfig.lint.json" + }, + { + "path": "./packages/solana-wallet-snap/tsconfig.lint.json" + }, + { + "path": "./packages/stellar-wallet-snap/tsconfig.lint.json" + }, + { + "path": "./packages/tron-wallet-snap/tsconfig.lint.json" + } + ] +} diff --git a/tsconfig.packages.lint.json b/tsconfig.packages.lint.json new file mode 100644 index 000000000..9d6e40495 --- /dev/null +++ b/tsconfig.packages.lint.json @@ -0,0 +1,9 @@ +{ + /** + * This configuration is extended by each package's `tsconfig.lint.json` configuration. + */ + "compilerOptions": { + "emitDeclarationOnly": true, + "skipLibCheck": true + } +} From 5bfe80fdda851b7255ef3c6d0ea6bb2e47a55e28 Mon Sep 17 00:00:00 2001 From: Ulisses Ferreira Date: Wed, 19 Aug 2026 13:06:57 +0100 Subject: [PATCH 3/4] fix: add the missing paths mapping so tsc --build actually resolves like Core References alone (the prior commit) don't fix workspace resolution: tsc --noEmit and tsc --build both still went through node_modules -> dist for `@metamask/*` imports. This adds the piece Core actually relies on: - An explicit `@metamask/snap-networks-utils/*` subpath entry in the shared `tsconfig.packages.json` `paths` map (TS path patterns only allow one `*`), mirroring Core's own `@metamask/json-rpc-engine/v2` subpath entry. - `baseUrl: "./"` on `tron-wallet-snap` and `stellar-wallet-snap` (the two packages that didn't have it), so every package now reinterprets the shared `../*/src` mapping against its own directory like the rest of the monorepo already does, matching Core's convention of every package setting `baseUrl`. - Expanded `include` in the four affected packages' `tsconfig.lint.json` to cover `snap.manifest.json` and JSON test fixtures pulled in via `resolveJsonModule`, satisfying `--build` mode's stricter file-listing requirement (TS6307). `yarn lint:tsc` (tsc --build tsconfig.lint.json) now passes with 0 errors from a clean state, matching Core's actual behavior. Caveat: plain per-package `tsc --noEmit` (what `yarn typecheck` runs) still fails with TS6305 for bitcoin-wallet-snap, solana-wallet-snap, and tron-wallet-snap - the packages with a `references` entry. This is because `references` to a composite project always require `--build` mode (which builds referenced projects in order) to resolve cleanly; a bare `tsc --noEmit` invocation never builds dependencies first. This isn't fixable by matching Core's config more closely - it's inherent to combining `references` with plain `--noEmit`, and only `tsc --build` resolves it. --- packages/bitcoin-wallet-snap/CHANGELOG.md | 1 + packages/bitcoin-wallet-snap/tsconfig.lint.json | 9 ++++++++- packages/solana-wallet-snap/CHANGELOG.md | 1 + packages/solana-wallet-snap/tsconfig.lint.json | 9 ++++++++- packages/stellar-wallet-snap/CHANGELOG.md | 1 + packages/stellar-wallet-snap/tsconfig.json | 1 + packages/stellar-wallet-snap/tsconfig.lint.json | 9 ++++++++- packages/tron-wallet-snap/CHANGELOG.md | 1 + packages/tron-wallet-snap/tsconfig.json | 1 + packages/tron-wallet-snap/tsconfig.lint.json | 9 ++++++++- tsconfig.packages.json | 1 + 11 files changed, 39 insertions(+), 4 deletions(-) diff --git a/packages/bitcoin-wallet-snap/CHANGELOG.md b/packages/bitcoin-wallet-snap/CHANGELOG.md index 2127317f2..ed25d48ad 100644 --- a/packages/bitcoin-wallet-snap/CHANGELOG.md +++ b/packages/bitcoin-wallet-snap/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Add a TypeScript project reference to `@metamask/snap-networks-utils` in `tsconfig.json`, mirroring the pattern used in `MetaMask/core`, for correct `tsc --build` ordering and editor go-to-source navigation +- Add an explicit `@metamask/snap-networks-utils/*` subpath entry to the shared `paths` mapping and expand `tsconfig.lint.json`'s `include` pattern, so the `tsc --build` lint graph resolves the workspace source and covers `snap.manifest.json`/JSON test fixtures, matching `MetaMask/core`'s setup ## [2.0.1] diff --git a/packages/bitcoin-wallet-snap/tsconfig.lint.json b/packages/bitcoin-wallet-snap/tsconfig.lint.json index bc1f95a73..31970fe83 100644 --- a/packages/bitcoin-wallet-snap/tsconfig.lint.json +++ b/packages/bitcoin-wallet-snap/tsconfig.lint.json @@ -4,5 +4,12 @@ "outDir": "./.tsc-lint-cache", "tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo" }, - "references": [{ "path": "../snap-networks-utils/tsconfig.lint.json" }] + "references": [{ "path": "../snap-networks-utils/tsconfig.lint.json" }], + "include": [ + "**/*.ts", + "**/*.tsx", + "locales/*.json", + "snap.manifest.json", + "src/**/*.json" + ] } diff --git a/packages/solana-wallet-snap/CHANGELOG.md b/packages/solana-wallet-snap/CHANGELOG.md index 4ae9d462f..4fdd6c399 100644 --- a/packages/solana-wallet-snap/CHANGELOG.md +++ b/packages/solana-wallet-snap/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Add a TypeScript project reference to `@metamask/snap-networks-utils` in `tsconfig.json`, mirroring the pattern used in `MetaMask/core`, for correct `tsc --build` ordering and editor go-to-source navigation +- Add an explicit `@metamask/snap-networks-utils/*` subpath entry to the shared `paths` mapping and expand `tsconfig.lint.json`'s `include` pattern, so the `tsc --build` lint graph resolves the workspace source and covers `snap.manifest.json`/JSON test fixtures, matching `MetaMask/core`'s setup - Extract Snap-owned assets domain logic into `SnapAssetsAdapter`; `AssetsService` is a thin facade that delegates metadata, market data, fetch, persist, and account asset reads through the adapter (no Core routing yet). ([#121](https://github.com/MetaMask/internal-snaps/pull/121)) - Align `AssetsService` read API with `snap-networks-utils` / AssetsController shapes by adding `getAccountAssetByID`, `getAccountAssetsByIDs`, `getAccountAssetsByScope`, and `getAccountAssets`, and routing Keyring and Send through them (still Snap-owned storage). ([#120](https://github.com/MetaMask/internal-snaps/pull/120)) diff --git a/packages/solana-wallet-snap/tsconfig.lint.json b/packages/solana-wallet-snap/tsconfig.lint.json index bc1f95a73..31970fe83 100644 --- a/packages/solana-wallet-snap/tsconfig.lint.json +++ b/packages/solana-wallet-snap/tsconfig.lint.json @@ -4,5 +4,12 @@ "outDir": "./.tsc-lint-cache", "tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo" }, - "references": [{ "path": "../snap-networks-utils/tsconfig.lint.json" }] + "references": [{ "path": "../snap-networks-utils/tsconfig.lint.json" }], + "include": [ + "**/*.ts", + "**/*.tsx", + "locales/*.json", + "snap.manifest.json", + "src/**/*.json" + ] } diff --git a/packages/stellar-wallet-snap/CHANGELOG.md b/packages/stellar-wallet-snap/CHANGELOG.md index e6268ac1d..bebb28510 100644 --- a/packages/stellar-wallet-snap/CHANGELOG.md +++ b/packages/stellar-wallet-snap/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Set `baseUrl` in this package's `tsconfig.json` (matching every other package in the monorepo) and add an explicit `@metamask/snap-networks-utils/*` subpath entry to the shared `paths` mapping and expand `tsconfig.lint.json`'s `include` pattern, so the `tsc --build` lint graph resolves the workspace source and covers `snap.manifest.json`/JSON test fixtures, matching `MetaMask/core`'s setup - This package was migrated from [snap-stellar-wallet](https://github.com/MetaMask/snap-stellar-wallet). See the source repository for the original [changelog](https://github.com/MetaMask/snap-stellar-wallet/blob/main/packages/snap/CHANGELOG.md) ([#161](https://github.com/MetaMask/internal-snaps/pull/161)) ### Fixed diff --git a/packages/stellar-wallet-snap/tsconfig.json b/packages/stellar-wallet-snap/tsconfig.json index df5a8f6b6..226043f20 100644 --- a/packages/stellar-wallet-snap/tsconfig.json +++ b/packages/stellar-wallet-snap/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.packages.json", "compilerOptions": { + "baseUrl": "./", "resolveJsonModule": true /* lets us import JSON modules from within TypeScript modules. */, "jsx": "react-jsx", "jsxImportSource": "@metamask/snaps-sdk", diff --git a/packages/stellar-wallet-snap/tsconfig.lint.json b/packages/stellar-wallet-snap/tsconfig.lint.json index 378ed1dce..577502c34 100644 --- a/packages/stellar-wallet-snap/tsconfig.lint.json +++ b/packages/stellar-wallet-snap/tsconfig.lint.json @@ -3,5 +3,12 @@ "compilerOptions": { "outDir": "./.tsc-lint-cache", "tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo" - } + }, + "include": [ + "**/*.ts", + "**/*.tsx", + "locales/*.json", + "snap.manifest.json", + "src/**/*.json" + ] } diff --git a/packages/tron-wallet-snap/CHANGELOG.md b/packages/tron-wallet-snap/CHANGELOG.md index 31a9d0699..9da34e338 100644 --- a/packages/tron-wallet-snap/CHANGELOG.md +++ b/packages/tron-wallet-snap/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Add a TypeScript project reference to `@metamask/snap-networks-utils` in `tsconfig.json`, mirroring the pattern used in `MetaMask/core`, for correct `tsc --build` ordering and editor go-to-source navigation +- Set `baseUrl` in this package's `tsconfig.json` (matching every other package in the monorepo) and add an explicit `@metamask/snap-networks-utils/*` subpath entry to the shared `paths` mapping and expand `tsconfig.lint.json`'s `include` pattern, so the `tsc --build` lint graph resolves the workspace source and covers `snap.manifest.json`/JSON test fixtures, matching `MetaMask/core`'s setup - Extract shared asset util functions and inject `SnapAssetsAdapter` from `context` into `AssetsService` ([#143](https://github.com/MetaMask/internal-snaps/pull/143)) - Rename `getByKeyringAccountId` to `getAccountAssets` (with essential-asset synthesis) and update keyring callers ([#143](https://github.com/MetaMask/internal-snaps/pull/143)) diff --git a/packages/tron-wallet-snap/tsconfig.json b/packages/tron-wallet-snap/tsconfig.json index c00d4f016..aa6bd53f5 100644 --- a/packages/tron-wallet-snap/tsconfig.json +++ b/packages/tron-wallet-snap/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.packages.json", "compilerOptions": { + "baseUrl": "./", "resolveJsonModule": true /* lets us import JSON modules from within TypeScript modules. */, "jsx": "react-jsx", "jsxImportSource": "@metamask/snaps-sdk", diff --git a/packages/tron-wallet-snap/tsconfig.lint.json b/packages/tron-wallet-snap/tsconfig.lint.json index bc1f95a73..31970fe83 100644 --- a/packages/tron-wallet-snap/tsconfig.lint.json +++ b/packages/tron-wallet-snap/tsconfig.lint.json @@ -4,5 +4,12 @@ "outDir": "./.tsc-lint-cache", "tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo" }, - "references": [{ "path": "../snap-networks-utils/tsconfig.lint.json" }] + "references": [{ "path": "../snap-networks-utils/tsconfig.lint.json" }], + "include": [ + "**/*.ts", + "**/*.tsx", + "locales/*.json", + "snap.manifest.json", + "src/**/*.json" + ] } diff --git a/tsconfig.packages.json b/tsconfig.packages.json index a655abc1f..d17e3697d 100644 --- a/tsconfig.packages.json +++ b/tsconfig.packages.json @@ -12,6 +12,7 @@ * `jest.config.packages.js`. */ "paths": { + "@metamask/snap-networks-utils/*": ["../snap-networks-utils/src/*"], "@metamask/*": ["../*/src"] } } From b84efd52730c35075aeb6bc4677f726c7000a82b Mon Sep 17 00:00:00 2001 From: Ulisses Ferreira Date: Wed, 19 Aug 2026 13:11:39 +0100 Subject: [PATCH 4/4] docs: link changelog entries to #170 and add missing snap-networks-utils entry --- packages/bitcoin-wallet-snap/CHANGELOG.md | 4 ++-- packages/snap-networks-utils/CHANGELOG.md | 1 + packages/solana-wallet-snap/CHANGELOG.md | 4 ++-- packages/stellar-wallet-snap/CHANGELOG.md | 2 +- packages/tron-wallet-snap/CHANGELOG.md | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/bitcoin-wallet-snap/CHANGELOG.md b/packages/bitcoin-wallet-snap/CHANGELOG.md index ed25d48ad..801e1420c 100644 --- a/packages/bitcoin-wallet-snap/CHANGELOG.md +++ b/packages/bitcoin-wallet-snap/CHANGELOG.md @@ -9,8 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Add a TypeScript project reference to `@metamask/snap-networks-utils` in `tsconfig.json`, mirroring the pattern used in `MetaMask/core`, for correct `tsc --build` ordering and editor go-to-source navigation -- Add an explicit `@metamask/snap-networks-utils/*` subpath entry to the shared `paths` mapping and expand `tsconfig.lint.json`'s `include` pattern, so the `tsc --build` lint graph resolves the workspace source and covers `snap.manifest.json`/JSON test fixtures, matching `MetaMask/core`'s setup +- Add a TypeScript project reference to `@metamask/snap-networks-utils` in `tsconfig.json`, mirroring the pattern used in `MetaMask/core`, for correct `tsc --build` ordering and editor go-to-source navigation ([#170](https://github.com/MetaMask/internal-snaps/pull/170)) +- Add an explicit `@metamask/snap-networks-utils/*` subpath entry to the shared `paths` mapping and expand `tsconfig.lint.json`'s `include` pattern, so the `tsc --build` lint graph resolves the workspace source and covers `snap.manifest.json`/JSON test fixtures, matching `MetaMask/core`'s setup ([#170](https://github.com/MetaMask/internal-snaps/pull/170)) ## [2.0.1] diff --git a/packages/snap-networks-utils/CHANGELOG.md b/packages/snap-networks-utils/CHANGELOG.md index dac68b80a..880dce417 100644 --- a/packages/snap-networks-utils/CHANGELOG.md +++ b/packages/snap-networks-utils/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Add a `tsconfig.lint.json` (`outDir`/`tsBuildInfoFile` → `.tsc-lint-cache`) so this package participates in the repo's `tsc --build` lint graph, mirroring `MetaMask/core`'s setup ([#170](https://github.com/MetaMask/internal-snaps/pull/170)) - **BREAKING** Replace the logger utilities with a configurable `Logger` class that requires a log level and supports level filtering, per-instance prefixes, and method decorators. - Bump `@metamask/utils` from `^11.9.0` to `^11.11.9` ([#161](https://github.com/MetaMask/internal-snaps/pull/161)) diff --git a/packages/solana-wallet-snap/CHANGELOG.md b/packages/solana-wallet-snap/CHANGELOG.md index 4fdd6c399..aecf09600 100644 --- a/packages/solana-wallet-snap/CHANGELOG.md +++ b/packages/solana-wallet-snap/CHANGELOG.md @@ -9,8 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Add a TypeScript project reference to `@metamask/snap-networks-utils` in `tsconfig.json`, mirroring the pattern used in `MetaMask/core`, for correct `tsc --build` ordering and editor go-to-source navigation -- Add an explicit `@metamask/snap-networks-utils/*` subpath entry to the shared `paths` mapping and expand `tsconfig.lint.json`'s `include` pattern, so the `tsc --build` lint graph resolves the workspace source and covers `snap.manifest.json`/JSON test fixtures, matching `MetaMask/core`'s setup +- Add a TypeScript project reference to `@metamask/snap-networks-utils` in `tsconfig.json`, mirroring the pattern used in `MetaMask/core`, for correct `tsc --build` ordering and editor go-to-source navigation ([#170](https://github.com/MetaMask/internal-snaps/pull/170)) +- Add an explicit `@metamask/snap-networks-utils/*` subpath entry to the shared `paths` mapping and expand `tsconfig.lint.json`'s `include` pattern, so the `tsc --build` lint graph resolves the workspace source and covers `snap.manifest.json`/JSON test fixtures, matching `MetaMask/core`'s setup ([#170](https://github.com/MetaMask/internal-snaps/pull/170)) - Extract Snap-owned assets domain logic into `SnapAssetsAdapter`; `AssetsService` is a thin facade that delegates metadata, market data, fetch, persist, and account asset reads through the adapter (no Core routing yet). ([#121](https://github.com/MetaMask/internal-snaps/pull/121)) - Align `AssetsService` read API with `snap-networks-utils` / AssetsController shapes by adding `getAccountAssetByID`, `getAccountAssetsByIDs`, `getAccountAssetsByScope`, and `getAccountAssets`, and routing Keyring and Send through them (still Snap-owned storage). ([#120](https://github.com/MetaMask/internal-snaps/pull/120)) diff --git a/packages/stellar-wallet-snap/CHANGELOG.md b/packages/stellar-wallet-snap/CHANGELOG.md index bebb28510..2a3cb8f04 100644 --- a/packages/stellar-wallet-snap/CHANGELOG.md +++ b/packages/stellar-wallet-snap/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Set `baseUrl` in this package's `tsconfig.json` (matching every other package in the monorepo) and add an explicit `@metamask/snap-networks-utils/*` subpath entry to the shared `paths` mapping and expand `tsconfig.lint.json`'s `include` pattern, so the `tsc --build` lint graph resolves the workspace source and covers `snap.manifest.json`/JSON test fixtures, matching `MetaMask/core`'s setup +- Set `baseUrl` in this package's `tsconfig.json` (matching every other package in the monorepo) and add an explicit `@metamask/snap-networks-utils/*` subpath entry to the shared `paths` mapping and expand `tsconfig.lint.json`'s `include` pattern, so the `tsc --build` lint graph resolves the workspace source and covers `snap.manifest.json`/JSON test fixtures, matching `MetaMask/core`'s setup ([#170](https://github.com/MetaMask/internal-snaps/pull/170)) - This package was migrated from [snap-stellar-wallet](https://github.com/MetaMask/snap-stellar-wallet). See the source repository for the original [changelog](https://github.com/MetaMask/snap-stellar-wallet/blob/main/packages/snap/CHANGELOG.md) ([#161](https://github.com/MetaMask/internal-snaps/pull/161)) ### Fixed diff --git a/packages/tron-wallet-snap/CHANGELOG.md b/packages/tron-wallet-snap/CHANGELOG.md index 9da34e338..1f2ffce67 100644 --- a/packages/tron-wallet-snap/CHANGELOG.md +++ b/packages/tron-wallet-snap/CHANGELOG.md @@ -13,8 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Add a TypeScript project reference to `@metamask/snap-networks-utils` in `tsconfig.json`, mirroring the pattern used in `MetaMask/core`, for correct `tsc --build` ordering and editor go-to-source navigation -- Set `baseUrl` in this package's `tsconfig.json` (matching every other package in the monorepo) and add an explicit `@metamask/snap-networks-utils/*` subpath entry to the shared `paths` mapping and expand `tsconfig.lint.json`'s `include` pattern, so the `tsc --build` lint graph resolves the workspace source and covers `snap.manifest.json`/JSON test fixtures, matching `MetaMask/core`'s setup +- Add a TypeScript project reference to `@metamask/snap-networks-utils` in `tsconfig.json`, mirroring the pattern used in `MetaMask/core`, for correct `tsc --build` ordering and editor go-to-source navigation ([#170](https://github.com/MetaMask/internal-snaps/pull/170)) +- Set `baseUrl` in this package's `tsconfig.json` (matching every other package in the monorepo) and add an explicit `@metamask/snap-networks-utils/*` subpath entry to the shared `paths` mapping and expand `tsconfig.lint.json`'s `include` pattern, so the `tsc --build` lint graph resolves the workspace source and covers `snap.manifest.json`/JSON test fixtures, matching `MetaMask/core`'s setup ([#170](https://github.com/MetaMask/internal-snaps/pull/170)) - Extract shared asset util functions and inject `SnapAssetsAdapter` from `context` into `AssetsService` ([#143](https://github.com/MetaMask/internal-snaps/pull/143)) - Rename `getByKeyringAccountId` to `getAccountAssets` (with essential-asset synthesis) and update keyring callers ([#143](https://github.com/MetaMask/internal-snaps/pull/143))