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
5 changes: 5 additions & 0 deletions .changeset/famous-paws-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/fastify": minor
---

Disable minification for static import compatibility
18 changes: 9 additions & 9 deletions packages/fastify/package.json
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted the exports since we removed the legacyOutput in tsup config. It should not be breaking since it only affects the internal build process, not the final output structure

Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@
"exports": {
".": {
"import": {
"types": "./dist/types/index.d.ts",
"default": "./dist/esm/index.js"
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/types/index.d.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./webhooks": {
"import": {
"types": "./dist/types/webhooks.d.ts",
"default": "./dist/esm/webhooks.js"
"types": "./dist/webhooks.d.mts",
"default": "./dist/webhooks.mjs"
},
"require": {
"types": "./dist/types/webhooks.d.ts",
"types": "./dist/webhooks.d.ts",
"default": "./dist/webhooks.js"
}
}
},
"main": "./dist/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist",
"webhooks"
Expand All @@ -58,7 +58,7 @@
"format": "node ../../scripts/format-package.mjs",
"format:check": "node ../../scripts/format-package.mjs --check",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16 --ignore-rules unexpected-module-syntax",
"lint:attw": "attw --pack . --profile node16",
"lint:publint": "publint",
"publish:local": "pnpm yalc push --replace --sig",
"test": "vitest run",
Expand Down
4 changes: 1 addition & 3 deletions packages/fastify/tsconfig.json
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are using the dts option in tsup config now

Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
"skipLibCheck": true,
"allowJs": true,
"target": "ES2020",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true,
"outDir": "dist",
"resolveJsonModule": true,
"declarationDir": "dist/types"
"resolveJsonModule": true
},
"include": ["src"]
}
14 changes: 7 additions & 7 deletions packages/fastify/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import { defineConfig } from 'tsup';
import { name, version } from './package.json';

export default defineConfig(overrideOptions => {
const isProd = overrideOptions.env?.NODE_ENV === 'production';
const isWatch = !!overrideOptions.watch;

return {
entry: ['src/index.ts', 'src/webhooks.ts'],
onSuccess: 'tsc',
minify: isProd,
entry: ['./src/index.ts', './src/webhooks.ts'],
format: ['cjs', 'esm'],
bundle: true,
clean: true,
minify: false,
sourcemap: true,
format: ['cjs', 'esm'],
legacyOutput: true,
dts: true,
define: {
PACKAGE_NAME: `"${name}"`,
PACKAGE_VERSION: `"${version}"`,
__DEV__: `${!isProd}`,
__DEV__: `${isWatch}`,
},
};
});
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

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

Loading