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
32 changes: 16 additions & 16 deletions .github/workflows/deploy-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ jobs:
- name: Build the package
run: pnpm nx build sdk

- name: Build the connector-export package
run: pnpm nx build connector-export
# - name: Build the connector-export package
# run: pnpm nx build connector-export

- name: Prepare package.json
working-directory: packages/sdk
run: node prepare-package.mjs
env:
INPUT_VERSION: ${{ github.event.inputs.version }}

- name: Prepare connector-export package.json
working-directory: packages/connector-export
run: node prepare-package.mjs
env:
INPUT_VERSION: ${{ github.event.inputs.version }}
# - name: Prepare connector-export package.json
# working-directory: packages/connector-export
# run: node prepare-package.mjs
# env:
# INPUT_VERSION: ${{ github.event.inputs.version }}

- name: Create .npmrc for NPM
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMJS_NPM_MATTERLABS_AUTOMATION_TOKEN }}" > ~/.npmrc
Expand All @@ -73,9 +73,9 @@ jobs:
working-directory: packages/sdk
run: npm publish --access public

- name: Publish connector-export to NPM
working-directory: packages/connector-export
run: npm publish --access public
# - name: Publish connector-export to NPM
# working-directory: packages/connector-export
# run: npm publish --access public

- name: Create .npmrc for GitHub Packages
run: |
Expand All @@ -90,9 +90,9 @@ jobs:
npm pkg set name="@matter-labs/zksync-sso"
npm publish --registry=https://npm.pkg.github.com

- name: Publish connector-export to GitHub Packages
working-directory: packages/connector-export
run: |
# Update package name for GitHub Packages to be scoped to the organization
npm pkg set name="@matter-labs/zksync-sso-connector-export"
npm publish --registry=https://npm.pkg.github.com
# - name: Publish connector-export to GitHub Packages
# working-directory: packages/connector-export
# run: |
# # Update package name for GitHub Packages to be scoped to the organization
# npm pkg set name="@matter-labs/zksync-sso-connector-export"
# npm publish --registry=https://npm.pkg.github.com
25 changes: 25 additions & 0 deletions packages/connector-export/prepare-package.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,31 @@ async function preparePackageJson() {
// Set the new version
packageJson.version = version;

// Transform workspace dependencies to proper version ranges
if (packageJson.peerDependencies) {
for (const [dep, depVersion] of Object.entries(packageJson.peerDependencies)) {
if (depVersion === "workspace:*") {
// Replace workspace protocol with proper version range
if (dep === "zksync-sso") {
packageJson.peerDependencies[dep] = `^${version}`;
console.log(`Replaced workspace dependency for ${dep} with ^${version}`);
}
}
}
}

// Also check regular dependencies if they exist
if (packageJson.dependencies) {
for (const [dep, depVersion] of Object.entries(packageJson.dependencies)) {
if (depVersion === "workspace:*") {
if (dep === "zksync-sso") {
packageJson.dependencies[dep] = `^${version}`;
console.log(`Replaced workspace dependency for ${dep} with ^${version}`);
}
}
}
}

// Write the updated package.json back to the file
await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));

Expand Down
3 changes: 1 addition & 2 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@
"abitype": "^1.0.6",
"bigint-conversion": "^2.4.3",
"buffer": "^6.0.3",
"ms": "^2.1.3",
"zksync-sso-circuits": "workspace:*"
"ms": "^2.1.3"
}
}
11 changes: 2 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading