feat: layered monorepo readiness (install → types + unit tests) - #140
Draft
ulissesferreira wants to merge 9 commits into
Draft
feat: layered monorepo readiness (install → types + unit tests)#140ulissesferreira wants to merge 9 commits into
ulissesferreira wants to merge 9 commits into
Conversation
Capture Approach C: post-install library builds, fixed TS paths, snap unit vs integration Jest split, and lint/build DX fixes. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Resolve @metamask/* paths from the monorepo root and share snap TS settings with composite disabled so sibling packages typecheck without built declaration artifacts. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Add build:libs/build:snaps helpers, chain build:libs from allow-scripts, and rebuild libraries after eslint's dist clean. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Run bitcoin/tron/sample unit tests in Node without a Snap bundle. Keep solana on snaps-jest with lazy globalSetup build. Move installSnap coverage into integration configs and add safe local env defaults. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Remove the empty examples workspace glob and the dead migration-guide link, and describe build:libs / unit vs integration testing. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Rename shared snap Jest config to .cjs, make build/globalSetup scripts async-safe for lint rules, and retarget suppressions for renamed integration tests. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Wallet snaps should read configuration from a proper .env file supplied by the developer. Reverts snap.config.ts defaults, jest.setup test defaults, and ConfigProvider ENVIRONMENT fallback added in the layered monorepo readiness work. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
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
After a normal
yarn, TypeScript typechecking and Snap unit Jest suites did not work reliably: workspace imports pointed atdist/, Snap bundles were required for ordinary unit tests, and librarydist/was missing until a full build. This PR aligns local install with what CI already does for libraries, and separates Snap unit tests frominstallSnapintegration tests.@metamask/*path mappings to./packages/*/src; sharedtsconfig.snaps.jsonwithcomposite: falsefor Snap packages.allow-scriptsrunsyarn build:libs(library packages only). Addedbuild:snapsandscripts/build-workspace-kind.mjsto build by workspace kind.lint:eslintrunsbuild:libsafter cleaningdist/, so lint does not leave libraries without build output.installSnapsuites moved to integration configs. Solana keepssnaps-jestfor unit tests with lazy Snap build injest.globalSetup.snap.config.ts(and Tron Jest setup) use local defaults so builds and tests work without a secrets.env.AGENTS.mdfor the install → typecheck → unit-test workflow.References
Checklist