Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8b95cad
Astro SDK for Imagekit.io
SwarnimDoegar Apr 9, 2026
52ce71e
Merge branch 'main' of https://github.com/imagekit-developer/imagekit…
SwarnimDoegar Apr 9, 2026
9e04959
Fix CI issues
SwarnimDoegar Apr 9, 2026
443d20c
Update README
SwarnimDoegar Apr 9, 2026
e2be15f
Resolve Copilot review comments
SwarnimDoegar Apr 12, 2026
b79764d
1. Get rid IKImage Component
SwarnimDoegar Apr 14, 2026
8b19755
Rename components
SwarnimDoegar Apr 15, 2026
df9df62
Add external image service for astro imagekit url building
SwarnimDoegar Apr 16, 2026
9dce131
Update READMEs
SwarnimDoegar Apr 16, 2026
331077f
Add upload support
SwarnimDoegar Apr 17, 2026
6a0001b
Add upload example in test-app
SwarnimDoegar Apr 17, 2026
e359cef
Add function to scale dimensions for images over 25MP
SwarnimDoegar Apr 19, 2026
e0722ab
Remove tgz
SwarnimDoegar Apr 20, 2026
8644fd9
Minor improvements
SwarnimDoegar Apr 20, 2026
ebd15c7
Adds more tests
SwarnimDoegar Apr 21, 2026
cdd07d4
Get rid of getInt from codebase
SwarnimDoegar Apr 22, 2026
866a986
Fix claude comments
SwarnimDoegar Apr 22, 2026
e63ad2f
Add test mastix for astro 3 4 5 6
SwarnimDoegar Apr 22, 2026
e38fd9b
Add output type to test-app astro config
SwarnimDoegar Apr 22, 2026
80132cc
Do not fail because of upload missing keys in CI
SwarnimDoegar Apr 22, 2026
5331616
Split dependency installation command into 2
SwarnimDoegar Apr 22, 2026
10ae05b
use output: 'static' as 'hybrid' output is deprecated
SwarnimDoegar Apr 22, 2026
7640946
Use node 22 for CI
SwarnimDoegar Apr 22, 2026
0a1bac4
Remove debug log
SwarnimDoegar Apr 22, 2026
1d29fd4
Resolve copilot comments
SwarnimDoegar Apr 23, 2026
aaf5367
Fix snapshots
SwarnimDoegar Apr 23, 2026
c9c3d18
Fix bug with reading env vars
SwarnimDoegar Apr 24, 2026
099a8fa
Resolve comments
SwarnimDoegar Apr 29, 2026
01c4c0e
Allow user specific srcset override
SwarnimDoegar Apr 29, 2026
9c11fee
Fix types
SwarnimDoegar Apr 29, 2026
9bed163
Add assets loader
SwarnimDoegar May 4, 2026
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
65 changes: 65 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Node CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [22.x]
astro-version: ["3", "4", "5", "6"]
include:
- astro-version: "3"
node-adapter: "@astrojs/node@^6"
- astro-version: "4"
node-adapter: "@astrojs/node@^8"
- astro-version: "5"
node-adapter: "@astrojs/node@^9"
- astro-version: "6"
node-adapter: "@astrojs/node@^10"

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Pack the package
run: |
cd imagekit-astro
pnpm pack

- name: Setup test-app with packed package and target Astro version
run: |
cd test-app
pnpm remove @imagekit/astro || true
pnpm add ../imagekit-astro/imagekit-astro-*.tgz
pnpm add astro@${{ matrix.astro-version }}
pnpm add ${{ matrix.node-adapter }}

- name: Install Playwright
run: |
cd test-app
pnpm exec playwright install --with-deps

- name: Run E2E tests
run: |
cd test-app
pnpm test:e2e
env:
CI: true
ASTRO_VERSION: ${{ matrix.astro-version }}
94 changes: 94 additions & 0 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Publish

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Pack the package
run: |
cd imagekit-astro
pnpm pack

- name: Setup test-app with packed package
run: |
cd test-app
pnpm remove @imagekit/astro || true
pnpm add ../imagekit-astro/imagekit-astro-*.tgz

- name: Install Playwright
run: |
cd test-app
npx playwright install --with-deps

- name: Run E2E tests
run: |
cd test-app
pnpm test:e2e
env:
CI: true

publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: 'pnpm'

- name: Install and Build
run: |
pnpm install
pnpm build

- name: NPM Publish
run: |
cd imagekit-astro
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
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Dependencies
node_modules/

# Build output
dist/

# IDE
.vscode/
.idea/
*.swp
*.swo

# OS
.DS_Store
Thumbs.db

# Environment
.env
.env.local
.env.*.local

# Astro
.astro/

# Test artifacts
test-results/
playwright-report/
coverage/
imagekit-astro/imagekit-astro-*.tgz
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) ImageKit Private Limited 2025

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading