Skip to content
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.1.4

- Fixed build process that was incorrectly generating client-side types in server export paths. Server types (`@imagekit/next/server`) now correctly export only server-side functions (`getUploadAuthParams`) instead of client components.
- Improved build configuration by separating client and server TypeScript configurations for better type isolation.
- Cleaned up package.json scripts by removing unused `build:types` script.

## 2.1.3

- Fixed missing `ref` prop support in the **Image** component. The component now properly accepts and forwards all Next.js Image props, including `ref`, by using `React.ComponentPropsWithRef<typeof NextImage>` instead of the exported `ImageProps` type.
Expand Down
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "@imagekit/next",
"version": "2.1.3",
"version": "2.1.4",
"description": "Next.js SDK for ImageKit.io which implements client-side upload and URL generation for use inside a next application.",
"scripts": {
"build:js": "rollup -c",
"build-dev:js": "rollup -c --watch",
"build:types": "tsc --emitDeclarationOnly",
"type-check": "tsc --noEmit",
"type-check:watch": "npm run type-check -- --watch",
"build": "rm -rf dist*; npm run build:types && npm run build:js"
"build": "rm -rf dist*; npm run build:js"
},
"repository": {
"type": "git",
Expand All @@ -21,7 +20,7 @@
"module": "./dist/client/index-esm.js"
},
"./server": {
"types": "./dist/server/types/server/index.d.ts",
"types": "./dist/server/types/index.d.ts",
"main": "./dist/server/index.js",
"module": "./dist/server/index-esm.js"
}
Expand Down Expand Up @@ -57,6 +56,7 @@
"@imagekit/javascript": "^5.1.0"
},
"peerDependencies": {
"next": ">= 13"
"next": ">= 13",
"typescript": ">=4.7.0"
}
}
8 changes: 4 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import pkg from "./package.json";

const extensions = [".js", ".jsx", ".ts", ".tsx"];

const PLUGINS = [
const createPlugins = (tsconfigPath) => [
peerDepsExternal(),
resolve({ extensions }),
typescript({ tsconfig: "./tsconfig.json" }),
typescript({ tsconfig: tsconfigPath }),
babel({
extensions,
babelHelpers: "bundled",
Expand All @@ -30,7 +30,7 @@ export default [
{ file: pkg.exports["."].main, format: "cjs", sourcemap: true, banner: "'use client'" },
{ file: pkg.exports["."].module, format: "es", sourcemap: true, banner: "'use client'" },
],
plugins: PLUGINS,
plugins: createPlugins("./tsconfig.client.json"),
},
// Server entry build (server-only code)
{
Expand All @@ -39,6 +39,6 @@ export default [
{ file: pkg.exports["./server"].main, format: "cjs", sourcemap: true },
{ file: pkg.exports["./server"].module, format: "es", sourcemap: true },
],
plugins: PLUGINS,
plugins: createPlugins("./tsconfig.server.json"),
},
];
15 changes: 15 additions & 0 deletions tsconfig.client.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": false,
"declarationDir": "dist/client/types",
"outDir": "./dist/client"
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": [
"src/server/**/*",
"node_modules",
"dist"
]
}
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"declaration": true,
"declarationDir": "dist/types",
"declaration": false,
"esModuleInterop": true,
"outDir": "./dist",
"jsx": "react",
Expand Down
16 changes: 16 additions & 0 deletions tsconfig.server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": false,
"declarationDir": "dist/server/types",
"outDir": "./dist/server"
},
"include": [
"src/server/**/*.ts"
],
"exclude": [
"node_modules",
"dist"
]
}