Skip to content
Merged
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
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ jobs:
name: Build and test
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
packages: read # the privacy SDK is on GitHub Packages, which needs auth even for public packages
env:
GH_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

Expand All @@ -25,6 +30,8 @@ jobs:
node-version: "22"
cache: npm

- run: npm config set "//npm.pkg.github.com/:_authToken" '${GH_PACKAGES_TOKEN}'

- run: npm ci

- run: npm run build
Expand Down Expand Up @@ -66,6 +73,9 @@ jobs:
permissions:
contents: write # push the release tag
id-token: write # npm provenance via OIDC
packages: read # install the privacy SDK from GitHub Packages
env:
GH_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

Expand All @@ -75,6 +85,8 @@ jobs:
cache: npm
registry-url: "https://registry.npmjs.org"

- run: npm config set "//npm.pkg.github.com/:_authToken" '${GH_PACKAGES_TOKEN}'

- run: npm ci

# A merge without a version bump is normal (docs, refactors). Skip quietly
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@starkware-libs:registry=https://npm.pkg.github.com
4 changes: 3 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ module.exports = {
// is ESM and breaks under ts-jest. Map uuid to its CJS build so it resolves.
moduleNameMapper: {
"^uuid$": "<rootDir>/node_modules/uuid/dist/index.js",
"^@starkware-libs/starknet-privacy-sdk$": "<rootDir>/node_modules/@starkware-libs/starknet-privacy-sdk/dist/index.js",
"^@starkware-libs/starknet-privacy-sdk/testing$": "<rootDir>/jest.privacy-testing.js",
},
// @stellar/stellar-sdk (even its CJS build) transitively imports @noble/hashes
// v2, which ships ESM-only. Transform those packages instead of ignoring them.
transform: {
"^.+\\.[tj]sx?$": ["ts-jest", { isolatedModules: true, tsconfig: { allowJs: true } }],
},
transformIgnorePatterns: [
"node_modules/(?!(@stellar/stellar-sdk|@noble|uint8array-extras)/)",
"node_modules/(?!(@stellar/stellar-sdk|@noble|uint8array-extras|hpke|@starkware-libs/starknet-privacy-sdk)/)",
],
};
8 changes: 8 additions & 0 deletions jest.privacy-testing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const dist = "./node_modules/@starkware-libs/starknet-privacy-sdk/dist";

module.exports = {
...require(`${dist}/testing/mocknet.js`),
...require(`${dist}/testing/mock-proof-provider.js`),
...require(`${dist}/testing/mock-proof-invocation-factory.js`),
...require(`${dist}/internal/contract-discovery.js`),
};
Loading
Loading