Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ scripts/coverage
# typescript
packages/*/*.tsbuildinfo
*.tsbuildinfo
packages/*/.tsc-lint-cache
.tsc-lint-cache

# AI
.sisyphus/
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions packages/bitcoin-wallet-snap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ 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 ([#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]

### Fixed
Expand Down
1 change: 1 addition & 0 deletions packages/bitcoin-wallet-snap/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"moduleResolution": "bundler",
"types": ["jest"]
},
"references": [{ "path": "../snap-networks-utils" }],
"include": ["**/*.ts", "**/*.tsx", "locales/*.json"]
}
15 changes: 15 additions & 0 deletions packages/bitcoin-wallet-snap/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"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" }],
"include": [
"**/*.ts",
"**/*.tsx",
"locales/*.json",
"snap.manifest.json",
"src/**/*.json"
]
}
7 changes: 7 additions & 0 deletions packages/sample-snap/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["./tsconfig.json", "../../tsconfig.packages.lint.json"],
"compilerOptions": {
"outDir": "./.tsc-lint-cache",
"tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo"
}
}
1 change: 1 addition & 0 deletions packages/snap-networks-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 7 additions & 0 deletions packages/snap-networks-utils/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["./tsconfig.json", "../../tsconfig.packages.lint.json"],
"compilerOptions": {
"outDir": "./.tsc-lint-cache",
"tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo"
}
}
2 changes: 2 additions & 0 deletions packages/solana-wallet-snap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +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 ([#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))

Expand Down
1 change: 1 addition & 0 deletions packages/solana-wallet-snap/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"moduleResolution": "bundler",
"types": ["jest"]
},
"references": [{ "path": "../snap-networks-utils" }],
"include": ["**/*.ts", "**/*.tsx", "locales/*.json"]
}
15 changes: 15 additions & 0 deletions packages/solana-wallet-snap/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"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" }],
"include": [
"**/*.ts",
"**/*.tsx",
"locales/*.json",
"snap.manifest.json",
"src/**/*.json"
]
}
1 change: 1 addition & 0 deletions packages/stellar-wallet-snap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([#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
Expand Down
1 change: 1 addition & 0 deletions packages/stellar-wallet-snap/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
14 changes: 14 additions & 0 deletions packages/stellar-wallet-snap/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": ["./tsconfig.json", "../../tsconfig.packages.lint.json"],
"compilerOptions": {
"outDir": "./.tsc-lint-cache",
"tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo"
},
"include": [
"**/*.ts",
"**/*.tsx",
"locales/*.json",
"snap.manifest.json",
"src/**/*.json"
]
}
2 changes: 2 additions & 0 deletions packages/tron-wallet-snap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +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 ([#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))

Expand Down
2 changes: 2 additions & 0 deletions packages/tron-wallet-snap/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -15,5 +16,6 @@
"moduleResolution": "bundler",
"types": ["jest"]
},
"references": [{ "path": "../snap-networks-utils" }],
"include": ["**/*.ts", "**/*.tsx", "locales/*.json"]
}
15 changes: 15 additions & 0 deletions packages/tron-wallet-snap/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"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" }],
"include": [
"**/*.ts",
"**/*.tsx",
"locales/*.json",
"snap.manifest.json",
"src/**/*.json"
]
}
15 changes: 15 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down
30 changes: 30 additions & 0 deletions tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
1 change: 1 addition & 0 deletions tsconfig.packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* `jest.config.packages.js`.
*/
"paths": {
"@metamask/snap-networks-utils/*": ["../snap-networks-utils/src/*"],
"@metamask/*": ["../*/src"]
}
}
Expand Down
9 changes: 9 additions & 0 deletions tsconfig.packages.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
/**
* This configuration is extended by each package's `tsconfig.lint.json` configuration.
*/
"compilerOptions": {
"emitDeclarationOnly": true,
"skipLibCheck": true
}
}