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
37 changes: 37 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Node CI

on:
push:
pull_request:

jobs:
pack:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest

steps:
- name: ⬇️ Check out code
uses: actions/checkout@v4

- name: 🟢 Enable Corepack
run: corepack enable

- name: 🟢 Set up Node 20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn

- name: 📦 Install deps, build, pack
run: |
yarn install --frozen-lockfile
yarn build
yarn pack --out %s-%v.tgz
env:
CI: true

- name: 📤 Upload package artifact
uses: actions/upload-artifact@v4
with:
name: sanity-plugin-imagekit-package
path: sanity-plugin-imagekit-*.tgz
51 changes: 51 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish Package to npmjs

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: ⬇️ Check out code
uses: actions/checkout@v4

- name: 🟢 Enable Corepack
run: corepack enable

- name: 🟢 Set up Node 20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn
registry-url: 'https://registry.npmjs.org'

- name: Build and Publish
run: |
yarn install --frozen-lockfile

yarn build

# 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 --provenance --access public

env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
CI: true
61 changes: 61 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Dependencies
node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Build outputs
lib/
dist/
build/

# Environment variables
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

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

# OS
.DS_Store
Thumbs.db

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage/

# nyc test coverage
.nyc_output

# Dependency directories
jspm_packages/

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
47 changes: 47 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Contributing to sanity-plugin-imagekit

Thank you for your interest in contributing to the ImageKit Sanity Plugin! Your help is greatly appreciated. Please follow the guidelines below to ensure a smooth contribution process.

## Getting Started

1. **Fork the repository** and clone your fork locally.
2. **Install dependencies**:
```bash
npm install
# or
yarn install
```
3. **Create a new branch** for your feature or bugfix:
```bash
git checkout -b my-feature
```

## Development

- Keep your code clean and readable.
- Follow existing code style and conventions (TypeScript, Prettier, etc.).
- Document new features or changes in the README if needed.

## Pull Requests

- Ensure your branch is up to date with the latest `main` branch.
- Open a pull request with a clear description of your changes.
- Reference any related issues in your PR description.
- Be responsive to code review feedback.

## Commit Messages

- Use clear, descriptive commit messages.
- Follow the [Conventional Commits](https://www.conventionalcommits.org/) style if possible.

## Code of Conduct

Please be respectful and considerate in all interactions.

## Reporting Issues

If you find a bug or have a feature request, please open an issue on GitHub with as much detail as possible.

---

Thank you for helping make this project better!
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) 2025 ImageKit Pvt Ltd

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