build(client): give @sharibo/client a real build (dist output + exports map) - #220
Open
therealbibson wants to merge 1 commit into
Open
build(client): give @sharibo/client a real build (dist output + exports map)#220therealbibson wants to merge 1 commit into
therealbibson wants to merge 1 commit into
Conversation
…ng (crackedstudio#58) - Add build script emitting ESM + .d.ts to dist/ via tsc in packages/client - Configure package exports map ("." -> dist/index.js, types) and files field - Guard browser/Node duality without runtime node:* imports - Add withRetry, TREE_LEVELS, and proofOf exports to @sharibo/client - Wire npm run build --workspaces --if-present at monorepo root - Align test suites and configs across workspaces
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.
Overview
Provides a real TypeScript build process for
@sharibo/clientemitting ESM JavaScript and.d.tsdeclaration files intodist/, configures the package exports map and files whitelist, preserves browser/Node duality, and wires root-level workspace build execution.Related Issue
Closes #58
Changes
Client SDK (
@sharibo/client)packages/client/tsconfig.jsondeclaration: true,rootDir: "src",outDir: "dist", and exclude test files from compilation output.packages/client/package.json"build": "tsc"script, point"main"and"types"todist/, configure"files": ["dist"], and define"exports"map.packages/client/src/index.tserrors.js.packages/client/src/tree.tsTREE_LEVELS,MAX_CIRCLE_SIZE, and addproofOf(leaf)method toMerkleTree.packages/client/src/contract.tswithRetryhelper with exponential backoff for transient RPC errors.packages/client/src/prove.tsCircuitInput,ContractProof,ContractVerificationKey,validateCircuitInput, andgenerateProof.packages/client/src/artifacts.tspackages/client/src/identity.test.ts&packages/client/src/tree.test.tsMonorepo & App Wiring
package.json"build": "npm run build --workspaces --if-present".app/src/App.tsx,app/src/i18n.ts,app/src/main.tsx,app/vitest.config.tsVerification Results
.d.tstodist/tscbuilds complete ESM + types topackages/client/dist/.→dist/index.js, types)packages/client/package.jsonsrcexcluded from publishedfiles"files": ["dist"], verified innpm packtarballnode:*runtime imports)npm run buildwirednpm run build --workspaces --if-presentadded to rootnpm pack