From aa4bfa7a3b1e7bbbae3574a1a793008e882441a9 Mon Sep 17 00:00:00 2001 From: Manu Chaudhary Date: Wed, 16 Sep 2026 15:11:19 +0530 Subject: [PATCH 1/6] ci: set up Release Please Adds release-please-config.json, .release-please-manifest.json (seeded at 5.0.2), the Release Please workflow, and the Release-As sync workflow used by the other ImageKit SDK repos. Co-Authored-By: Claude Fable 5.1 --- .github/workflows/release-please.yml | 20 +++++++++ .github/workflows/sync-release-as.yml | 63 +++++++++++++++++++++++++++ .release-please-manifest.json | 3 ++ release-please-config.json | 63 +++++++++++++++++++++++++++ 4 files changed, 149 insertions(+) create mode 100644 .github/workflows/release-please.yml create mode 100644 .github/workflows/sync-release-as.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..3cf4d9b --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,20 @@ +name: Release Please +on: + push: + branches: + - master + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + if: github.repository == 'imagekit-developer/imagekit-react' + runs-on: ubuntu-latest + + steps: + - uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1 + id: release + with: + token: ${{ secrets.RELEASE_PLEASE_TOKEN }} diff --git a/.github/workflows/sync-release-as.yml b/.github/workflows/sync-release-as.yml new file mode 100644 index 0000000..31620ed --- /dev/null +++ b/.github/workflows/sync-release-as.yml @@ -0,0 +1,63 @@ +name: Sync Release-As from release PR title + +on: + pull_request: + types: [edited] + +permissions: + contents: write + +jobs: + sync: + if: >- + github.event.pull_request.base.ref == 'master' && + startsWith(github.event.pull_request.head.ref, 'release-please--') && + github.event.changes.title != null + runs-on: ubuntu-latest + steps: + - name: Extract versions from old and new title + id: parse + env: + NEW_TITLE: ${{ github.event.pull_request.title }} + OLD_TITLE: ${{ github.event.changes.title.from }} + run: | + # Anchored on pull-request-title-pattern "release: ${version}" from release-please-config.json. + extract() { + echo "$1" | grep -oE '^release:[[:space:]]+v?[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?' \ + | sed -E 's/^release:[[:space:]]+v?//' + } + NEW_VERSION=$(extract "$NEW_TITLE") + OLD_VERSION=$(extract "$OLD_TITLE") + echo "old=$OLD_VERSION" + echo "new=$NEW_VERSION" + if [ -z "$NEW_VERSION" ]; then + echo "::notice::No semver in new title; nothing to do." + echo "skip=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + if [ "$NEW_VERSION" = "$OLD_VERSION" ]; then + echo "::notice::Version unchanged ($NEW_VERSION); not pushing." + echo "skip=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT" + + - name: Check out main + if: steps.parse.outputs.skip != 'true' + uses: actions/checkout@v6 + with: + ref: master + token: ${{ secrets.RELEASE_PLEASE_TOKEN }} + fetch-depth: 1 + + - name: Push empty Release-As commit + if: steps.parse.outputs.skip != 'true' + env: + VERSION: ${{ steps.parse.outputs.version }} + run: | + git config user.name "release-as-bot" + git config user.email "release-as-bot@users.noreply.github.com" + git commit --allow-empty -m "chore: pin next release + + Release-As: ${VERSION}" + git push origin master diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..162da85 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "5.0.2" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..cf0e146 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,63 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "packages": { + ".": { + "release-type": "node", + "package-name": "@imagekit/react" + } + }, + "include-v-in-tag": false, + "include-component-in-tag": false, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ] +} From f38533cde5fd992dc333082f1f1c04794d53f978 Mon Sep 17 00:00:00 2001 From: Manu Chaudhary Date: Wed, 16 Sep 2026 15:11:19 +0530 Subject: [PATCH 2/6] fix(deps): require @imagekit/javascript ^5.5.0 for density transformation support Raises the minimum @imagekit/javascript to 5.5.0, which adds the `density` transformation (serialized as `dn`). Consumers with an older lockfile pin would otherwise keep 5.4.x and silently drop the parameter. Co-Authored-By: Claude Fable 5.1 --- package-lock.json | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index fc31030..bd9c129 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "5.0.2", "license": "MIT", "dependencies": { - "@imagekit/javascript": "^5.1.0" + "@imagekit/javascript": "^5.5.0" }, "devDependencies": { "@rollup/plugin-babel": "^5.2.1", @@ -268,9 +268,10 @@ } }, "node_modules/@imagekit/javascript": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@imagekit/javascript/-/javascript-5.1.0.tgz", - "integrity": "sha512-P12NaxlO6Qu4GROFagX9qgP5kKde236mCu5jJB1cWJ6mPaVdjyk0Mw3ciGIWdKXST/jP1cFqS2ZoBVRSq1SWow==" + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@imagekit/javascript/-/javascript-5.5.0.tgz", + "integrity": "sha512-eu2lLzSwTj4awP6CeB8NUHnKz+GZk4og3ztZsb7MDjoy1NcfCVqB1gBxH8Q9xzCkBrP50SvGuSrK/ZGNzrXXDA==", + "license": "Apache-2.0" }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.8", diff --git a/package.json b/package.json index 58478a4..dbadf60 100755 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "typescript": "^5.4.5" }, "dependencies": { - "@imagekit/javascript": "^5.1.0" + "@imagekit/javascript": "^5.5.0" }, "peerDependencies": { "react": "^16.13.1 || ^17.0.0 || ^18.0.0 || ^19.0.0", From 9b684468766d67293ce7ec9e53873017d8370c81 Mon Sep 17 00:00:00 2001 From: Manu Chaudhary Date: Thu, 17 Sep 2026 12:54:54 +0530 Subject: [PATCH 3/6] ci: add Changelog heading for Release Please Release Please inserts new entries before the first version heading that is preceded by a newline. With the file starting directly at '## x.y.z', the first match was the second heading and new releases would land out of order. A top-level heading fixes the insertion point. Co-Authored-By: Claude Fable 5.1 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6578c04..ff7edb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +# Changelog + ## 5.0.2 Include `@imagekit/javascript` in external in Rollup config to prevent bundling it with the package, allowing users to be able to fetch the latest version of the SDK without needing to update the package. This also reduces the bundle size of the package and allows users to manage the SDK version separately. From cae8175dc2d72ce6378e86273525003ef0e51ef0 Mon Sep 17 00:00:00 2001 From: Manu Chaudhary Date: Thu, 17 Sep 2026 13:08:37 +0530 Subject: [PATCH 4/6] ci: publish without re-running the e2e suite The e2e tests already run on every PR, including the Release Please release PR, so the gate belongs there. Running them again inside the publish workflow fails after the tag and GitHub release already exist, leaving a version with no npm package. Matches the Vue and Astro repos and the Stainless-generated SDKs. Co-Authored-By: Claude Fable 5.1 --- .github/workflows/npmpublish.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 0d5144a..2b0fbee 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -5,35 +5,7 @@ on: types: [published] jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [20.x] - - steps: - - uses: actions/checkout@v1 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Build and Test - run: | - npm install - npm run build - npm pack - cd test-app - npm install - npm install ../imagekit-react-*.tgz --no-save - npx playwright install --with-deps - npm run test:e2e - env: - CI: true - - publish: - needs: build runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 From df33ee9f7e0050a324c686aa0f37bf9e25bdcfeb Mon Sep 17 00:00:00 2001 From: Manu Chaudhary Date: Thu, 17 Sep 2026 13:29:37 +0530 Subject: [PATCH 5/6] ci: publish to npm with OIDC trusted publishing Same shape as imagekit-javascript's publish workflow: - id-token: write, no NODE_AUTH_TOKEN, no `npm whoami` - Node 24 with npm pinned to the 11 line (>= 11.5.1 needed; npm@latest is 12 and refuses older Node) - `npm publish --provenance` - workflow_dispatch so a failed publish can be re-run from the default branch without re-tagging The trusted publisher on npmjs.com must reference this file's name, `publish.yml`. Co-Authored-By: Claude Fable 5.1 --- .github/workflows/npmpublish.yml | 34 -------------------------- .github/workflows/publish.yml | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/npmpublish.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml deleted file mode 100644 index 2b0fbee..0000000 --- a/.github/workflows/npmpublish.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Publish - -on: - release: - types: [published] - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: 20 - registry-url: https://registry.npmjs.org/ - - name: NPM Publish - run: | - npm install - npm run build - npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN - # print the NPM user name for validation - npm whoami - VERSION=$(node -p "require('./package.json').version" ) - # Only publish stable versions to the latest tag - if [[ "$VERSION" =~ ^[^-]+$ ]]; then - NPM_TAG="latest" - else - NPM_TAG="beta" - fi - echo "Publishing $VERSION with $NPM_TAG tag." - npm publish --tag $NPM_TAG --access public - env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} - CI: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..515213b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,42 @@ +name: Publish + +on: + release: + types: [published] + # Manual re-run from the default branch, e.g. when a release publish failed. + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 24.x + uses: actions/setup-node@v4 + with: + node-version: 24.x + registry-url: https://registry.npmjs.org/ + - name: Upgrade npm for OIDC trusted publishing + # Trusted publishing needs npm >= 11.5.1. Pin the 11 line: npm@latest + # is now 12.x, which refuses to install on older Node runners. + run: | + npm install -g npm@11 + npm --version + - name: NPM Publish + run: | + npm install + npm run build + VERSION=$(node -p "require('./package.json').version") + # Only publish stable versions to the latest tag + if [[ "$VERSION" =~ ^[^-]+$ ]]; then + NPM_TAG="latest" + else + NPM_TAG="beta" + fi + echo "Publishing $VERSION with $NPM_TAG tag." + npm publish --tag $NPM_TAG --provenance --access public + env: + CI: true From 754258db90ad970b8c2d2792f45d44d63f895b56 Mon Sep 17 00:00:00 2001 From: Manu Chaudhary Date: Thu, 17 Sep 2026 13:45:15 +0530 Subject: [PATCH 6/6] ci: allow manual Release Please runs Add workflow_dispatch so Release Please can be triggered by hand, e.g. when GitHub drops the push event for a merge. Co-Authored-By: Claude Fable 5.1 --- .github/workflows/release-please.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 3cf4d9b..24c9d42 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -3,6 +3,8 @@ on: push: branches: - master + # Manual trigger, e.g. when GitHub drops the push event for a merge. + workflow_dispatch: permissions: contents: write