diff --git a/.changeset/famous-paws-reply.md b/.changeset/famous-paws-reply.md new file mode 100644 index 00000000000..d1328fa6254 --- /dev/null +++ b/.changeset/famous-paws-reply.md @@ -0,0 +1,5 @@ +--- +"@clerk/fastify": minor +--- + +Disable minification for static import compatibility diff --git a/packages/fastify/package.json b/packages/fastify/package.json index d12c7c9108d..8561af5bb9f 100644 --- a/packages/fastify/package.json +++ b/packages/fastify/package.json @@ -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" @@ -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", diff --git a/packages/fastify/tsconfig.json b/packages/fastify/tsconfig.json index 57b39d50251..ffa09e4e241 100644 --- a/packages/fastify/tsconfig.json +++ b/packages/fastify/tsconfig.json @@ -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"] } diff --git a/packages/fastify/tsup.config.ts b/packages/fastify/tsup.config.ts index 7d462e3bd33..be41714b765 100644 --- a/packages/fastify/tsup.config.ts +++ b/packages/fastify/tsup.config.ts @@ -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}`, }, }; }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d4382b1696f..59a41ed3205 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2752,7 +2752,7 @@ packages: '@expo/bunyan@4.0.1': resolution: {integrity: sha512-+Lla7nYSiHZirgK+U/uYzsLv/X+HaJienbD5AKX1UQZHYfWaP+9uuQluRB4GrEVWF0GZ7vEVp/jzaOT9k/SQlg==} - engines: {node: '>=0.10.0'} + engines: {'0': node >=0.10.0} '@expo/cli@0.22.26': resolution: {integrity: sha512-I689wc8Fn/AX7aUGiwrh3HnssiORMJtR2fpksX+JIe8Cj/EDleblYMSwRPd0025wrwOV9UN1KM/RuEt/QjCS3Q==}