diff --git a/.github/workflows/publish-js-sdk.yaml b/.github/workflows/publish-js-sdk.yaml index 44ef74aad..174887759 100644 --- a/.github/workflows/publish-js-sdk.yaml +++ b/.github/workflows/publish-js-sdk.yaml @@ -72,13 +72,12 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch all history for changelog generation + - uses: pnpm/action-setup@v4 - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: "20" registry-url: "https://registry.npmjs.org" - - name: Install npm 11.6.2 - run: npm install -g npm@11.6.2 - name: Determine version id: set_version diff --git a/js/Makefile b/js/Makefile index 0e1a9b396..3238eeb0d 100644 --- a/js/Makefile +++ b/js/Makefile @@ -150,9 +150,9 @@ verify-ci: build docs test publish-sdk-js: ./scripts/validate-release.sh - npm install - npm run build - npm publish + pnpm install + pnpm run build + pnpm publish --no-git-checks # This is the only method I could find to install a package without explicitly # adding a dependency or modifying lock files. diff --git a/js/scripts/publish-prerelease.sh b/js/scripts/publish-prerelease.sh index d263adcf6..88b135858 100755 --- a/js/scripts/publish-prerelease.sh +++ b/js/scripts/publish-prerelease.sh @@ -74,8 +74,8 @@ echo "" # Build the SDK echo "Building SDK..." -npm install -npm run build +pnpm install +pnpm run build echo "Build complete." echo "" @@ -87,13 +87,13 @@ echo "" # In CI, just publish. Locally, ask for confirmation if [ -n "${CI:-}" ] || [ -n "${GITHUB_ACTIONS:-}" ]; then # Running in CI - publish without confirmation - npm publish --tag "$DIST_TAG" + pnpm publish --tag "$DIST_TAG" --no-git-checks else # Running locally - ask for confirmation read -p "Ready to publish version $NEW_VERSION to npm with tag @$DIST_TAG? (y/N) " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]]; then - npm publish --tag "$DIST_TAG" + pnpm publish --tag "$DIST_TAG" --no-git-checks else echo "Publish cancelled." echo "" diff --git a/package.json b/package.json index 649e19b07..34ee25e81 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "start": "turbo run start", "clean": "turbo run clean", "test": "turbo run test --filter=\"!@braintrust/otel\"", - "prepare": "husky", + "prepare": "husky || true", "lint:prettier": "prettier --check .", "lint:eslint": "turbo run lint", "fix:prettier": "prettier --write .",