Skip to content

Commit 3cd2251

Browse files
authored
Merge pull request #1 from imagekit-developer/dev
2 parents 2f4cad6 + d410ac0 commit 3cd2251

27 files changed

+43647
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Node CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
pack:
9+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: ⬇️ Check out code
14+
uses: actions/checkout@v4
15+
16+
- name: 🟢 Enable Corepack
17+
run: corepack enable
18+
19+
- name: 🟢 Set up Node 20
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20.x
23+
cache: yarn
24+
25+
- name: 📦 Install deps, build, pack
26+
run: |
27+
yarn install --frozen-lockfile
28+
yarn build
29+
yarn pack --out %s-%v.tgz
30+
env:
31+
CI: true
32+
33+
- name: 📤 Upload package artifact
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: sanity-plugin-imagekit-package
37+
path: sanity-plugin-imagekit-*.tgz

.github/workflows/publish.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish Package to npmjs
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
steps:
14+
- name: ⬇️ Check out code
15+
uses: actions/checkout@v4
16+
17+
- name: 🟢 Enable Corepack
18+
run: corepack enable
19+
20+
- name: 🟢 Set up Node 20
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20.x
24+
cache: yarn
25+
registry-url: 'https://registry.npmjs.org'
26+
27+
- name: Build and Publish
28+
run: |
29+
yarn install --frozen-lockfile
30+
31+
yarn build
32+
33+
# print the NPM user name for validation
34+
npm whoami
35+
36+
VERSION=$(node -p "require('./package.json').version" )
37+
38+
# Only publish stable versions to the latest tag
39+
if [[ "$VERSION" =~ ^[^-]+$ ]]; then
40+
NPM_TAG="latest"
41+
else
42+
NPM_TAG="beta"
43+
fi
44+
45+
echo "Publishing $VERSION with $NPM_TAG tag."
46+
47+
npm publish --tag $NPM_TAG --provenance --access public
48+
49+
env:
50+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
51+
CI: true

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Dependencies
2+
node_modules
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Build outputs
8+
lib/
9+
dist/
10+
build/
11+
12+
# Environment variables
13+
.env
14+
.env.local
15+
.env.development.local
16+
.env.test.local
17+
.env.production.local
18+
19+
# IDE
20+
.vscode/
21+
.idea/
22+
*.swp
23+
*.swo
24+
25+
# OS
26+
.DS_Store
27+
Thumbs.db
28+
29+
# Logs
30+
logs
31+
*.log
32+
33+
# Runtime data
34+
pids
35+
*.pid
36+
*.seed
37+
*.pid.lock
38+
39+
# Coverage directory used by tools like istanbul
40+
coverage/
41+
42+
# nyc test coverage
43+
.nyc_output
44+
45+
# Dependency directories
46+
jspm_packages/
47+
48+
# Optional npm cache directory
49+
.npm
50+
51+
# Optional REPL history
52+
.node_repl_history
53+
54+
# Output of 'npm pack'
55+
*.tgz
56+
57+
# Yarn Integrity file
58+
.yarn-integrity
59+
60+
# dotenv environment variables file
61+
.env

CONTRIBUTING.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Contributing to sanity-plugin-imagekit
2+
3+
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.
4+
5+
## Getting Started
6+
7+
1. **Fork the repository** and clone your fork locally.
8+
2. **Install dependencies**:
9+
```bash
10+
npm install
11+
# or
12+
yarn install
13+
```
14+
3. **Create a new branch** for your feature or bugfix:
15+
```bash
16+
git checkout -b my-feature
17+
```
18+
19+
## Development
20+
21+
- Keep your code clean and readable.
22+
- Follow existing code style and conventions (TypeScript, Prettier, etc.).
23+
- Document new features or changes in the README if needed.
24+
25+
## Pull Requests
26+
27+
- Ensure your branch is up to date with the latest `main` branch.
28+
- Open a pull request with a clear description of your changes.
29+
- Reference any related issues in your PR description.
30+
- Be responsive to code review feedback.
31+
32+
## Commit Messages
33+
34+
- Use clear, descriptive commit messages.
35+
- Follow the [Conventional Commits](https://www.conventionalcommits.org/) style if possible.
36+
37+
## Code of Conduct
38+
39+
Please be respectful and considerate in all interactions.
40+
41+
## Reporting Issues
42+
43+
If you find a bug or have a feature request, please open an issue on GitHub with as much detail as possible.
44+
45+
---
46+
47+
Thank you for helping make this project better!

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 ImageKit Pvt Ltd
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)