diff --git a/packages/ariakit/package.json b/packages/ariakit/package.json index 344f6cbfb1..475e749b71 100644 --- a/packages/ariakit/package.json +++ b/packages/ariakit/package.json @@ -15,7 +15,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "react", @@ -34,18 +50,18 @@ "type": "module", "source": "src/index.tsx", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-ariakit.cjs", + "main": "./dist/blocknote-ariakit.js", "module": "./dist/blocknote-ariakit.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-ariakit.js", - "require": "./dist/blocknote-ariakit.cjs" + "default": "./dist/blocknote-ariakit.js" }, "./style.css": { "import": "./dist/style.css", - "require": "./dist/style.css", - "style": "./dist/style.css" + "style": "./dist/style.css", + "default": "./dist/style.css" } }, "scripts": { diff --git a/packages/ariakit/tsconfig.json b/packages/ariakit/tsconfig.json index 1e4b4e3f65..afade32699 100644 --- a/packages/ariakit/tsconfig.json +++ b/packages/ariakit/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "Bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/ariakit/vite.config.ts b/packages/ariakit/vite.config.ts index f0bc929a68..3073d00262 100644 --- a/packages/ariakit/vite.config.ts +++ b/packages/ariakit/vite.config.ts @@ -52,16 +52,15 @@ export default defineConfig( } as Record), }, build: { - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-ariakit": path.resolve(__dirname, "src/index.tsx"), }, name: "blocknote-ariakit", cssFileName: "style", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -86,14 +85,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: { - react: "React", - "react-dom": "ReactDOM", - }, - }, }, }, }) as UserConfig, diff --git a/packages/code-block/package.json b/packages/code-block/package.json index 1bafb8128f..b58142b50f 100644 --- a/packages/code-block/package.json +++ b/packages/code-block/package.json @@ -13,7 +13,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "react", @@ -32,13 +48,13 @@ "type": "module", "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-code-block.cjs", + "main": "./dist/blocknote-code-block.js", "module": "./dist/blocknote-code-block.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-code-block.js", - "require": "./dist/blocknote-code-block.cjs" + "default": "./dist/blocknote-code-block.js" } }, "scripts": { diff --git a/packages/code-block/tsconfig.json b/packages/code-block/tsconfig.json index 30ab55f7ca..490084381b 100644 --- a/packages/code-block/tsconfig.json +++ b/packages/code-block/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/code-block/vite.config.ts b/packages/code-block/vite.config.ts index 03b27aa91b..bc4c8e418d 100644 --- a/packages/code-block/vite.config.ts +++ b/packages/code-block/vite.config.ts @@ -44,15 +44,14 @@ export default defineConfig( } as Record), }, build: { - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-code-block": path.resolve(__dirname, "src/index.ts"), }, name: "blocknote-code-block", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -77,11 +76,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: {}, - }, }, }, }) as UserConfig, diff --git a/packages/core/package.json b/packages/core/package.json index 1d99da7610..b273877e83 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -13,9 +13,26 @@ "license": "MPL-2.0", "version": "0.56.0", "files": [ - "dist", - "types", - "src" + "dist/*.js", + "dist/*.css", + "types/**/*.d.ts", + "src/fonts", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "react", @@ -32,55 +49,54 @@ ], "description": "A \"Notion-style\" block-based extensible text editor built on top of Prosemirror and Tiptap.", "type": "module", - "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote.cjs", + "main": "./dist/blocknote.js", "module": "./dist/blocknote.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote.js", - "require": "./dist/blocknote.cjs" + "default": "./dist/blocknote.js" }, "./style.css": { "import": "./dist/style.css", - "require": "./dist/style.css", - "style": "./dist/style.css" + "style": "./dist/style.css", + "default": "./dist/style.css" }, "./fonts/inter.css": { "import": "./src/fonts/inter.css", - "require": "./src/fonts/inter.css", - "style": "./src/fonts/inter.css" + "style": "./src/fonts/inter.css", + "default": "./src/fonts/inter.css" }, "./comments": { "types": "./types/src/comments/index.d.ts", "import": "./dist/comments.js", - "require": "./dist/comments.cjs" + "default": "./dist/comments.js" }, "./blocks": { "types": "./types/src/blocks/index.d.ts", "import": "./dist/blocks.js", - "require": "./dist/blocks.cjs" + "default": "./dist/blocks.js" }, "./locales": { "types": "./types/src/i18n/index.d.ts", "import": "./dist/locales.js", - "require": "./dist/locales.cjs" + "default": "./dist/locales.js" }, "./extensions": { "types": "./types/src/extensions/index.d.ts", "import": "./dist/extensions.js", - "require": "./dist/extensions.cjs" + "default": "./dist/extensions.js" }, "./yjs": { "types": "./types/src/yjs/index.d.ts", "import": "./dist/yjs.js", - "require": "./dist/yjs.cjs" + "default": "./dist/yjs.js" }, "./y": { "types": "./types/src/y/index.d.ts", "import": "./dist/y.js", - "require": "./dist/y.cjs" + "default": "./dist/y.js" } }, "scripts": { diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 9f067133c8..a7f9fb44ba 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/core/vite.config.bundled.ts b/packages/core/vite.config.bundled.ts index 01d0471081..3a29c020d7 100644 --- a/packages/core/vite.config.bundled.ts +++ b/packages/core/vite.config.bundled.ts @@ -9,22 +9,15 @@ export default defineConfig({ build: { outDir: "../../release-tmp", minify: false, - sourcemap: true, + sourcemap: false, lib: { + formats: ["es"], entry: path.resolve(__dirname, "src/index.ts"), name: "blocknote", fileName: "blocknote.bundled", }, rollupOptions: { // external: Object.keys(pkg.dependencies), - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: { - // react: "React", - // "react-dom": "ReactDOM", - }, - }, }, }, }); diff --git a/packages/core/vite.config.ts b/packages/core/vite.config.ts index 2461aa329b..890de8a05f 100644 --- a/packages/core/vite.config.ts +++ b/packages/core/vite.config.ts @@ -3,7 +3,6 @@ import { webpackStats } from "rollup-plugin-webpack-stats"; import { configDefaults, defineConfig } from "vite-plus"; import pkg from "./package.json"; import { buildCacheInputs } from "../../scripts/build-cache-inputs.js"; -// import eslintPlugin from "vite-plugin-eslint"; // https://vitejs.dev/config/ export default defineConfig({ @@ -35,7 +34,7 @@ export default defineConfig({ }, plugins: [webpackStats()], build: { - sourcemap: true, + sourcemap: false, lib: { entry: { blocknote: path.resolve(__dirname, "src/index.ts"), @@ -48,9 +47,8 @@ export default defineConfig({ }, name: "blocknote", cssFileName: "style", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -75,11 +73,6 @@ export default defineConfig({ source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: {}, - }, }, }, }); diff --git a/packages/dev-scripts/tsconfig.json b/packages/dev-scripts/tsconfig.json index 3b39919672..9ba801e99c 100644 --- a/packages/dev-scripts/tsconfig.json +++ b/packages/dev-scripts/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "Bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/diagram-block/package.json b/packages/diagram-block/package.json index db30935c00..5596bd620c 100644 --- a/packages/diagram-block/package.json +++ b/packages/diagram-block/package.json @@ -15,7 +15,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "react", @@ -37,33 +53,33 @@ "type": "module", "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-diagram-block.cjs", + "main": "./dist/blocknote-diagram-block.js", "module": "./dist/blocknote-diagram-block.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-diagram-block.js", - "require": "./dist/blocknote-diagram-block.cjs" + "default": "./dist/blocknote-diagram-block.js" }, "./docx-exporter": { "types": "./types/src/docx-exporter/index.d.ts", "import": "./dist/docx-exporter.js", - "require": "./dist/docx-exporter.cjs" + "default": "./dist/docx-exporter.js" }, "./odt-exporter": { "types": "./types/src/odt-exporter/index.d.ts", "import": "./dist/odt-exporter.js", - "require": "./dist/odt-exporter.cjs" + "default": "./dist/odt-exporter.js" }, "./email-exporter": { "types": "./types/src/email-exporter/index.d.ts", "import": "./dist/email-exporter.js", - "require": "./dist/email-exporter.cjs" + "default": "./dist/email-exporter.js" }, "./typst-exporter": { "types": "./types/src/typst-exporter/index.d.ts", "import": "./dist/typst-exporter.js", - "require": "./dist/typst-exporter.cjs" + "default": "./dist/typst-exporter.js" } }, "scripts": { diff --git a/packages/diagram-block/tsconfig.json b/packages/diagram-block/tsconfig.json index 2d8bcd4a25..4ce57b0d26 100644 --- a/packages/diagram-block/tsconfig.json +++ b/packages/diagram-block/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/diagram-block/vite.config.ts b/packages/diagram-block/vite.config.ts index 7bae754c10..f64d00cfbe 100644 --- a/packages/diagram-block/vite.config.ts +++ b/packages/diagram-block/vite.config.ts @@ -74,7 +74,7 @@ export default defineConfig( } as Record), }, build: { - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-diagram-block": path.resolve(__dirname, "src/index.ts"), @@ -96,9 +96,8 @@ export default defineConfig( ), }, name: "blocknote-diagram-block", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -132,11 +131,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: {}, - }, }, }, }) as UserConfig, diff --git a/packages/mantine/package.json b/packages/mantine/package.json index 17984c502a..ca74ad795f 100644 --- a/packages/mantine/package.json +++ b/packages/mantine/package.json @@ -15,7 +15,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "react", @@ -34,23 +50,23 @@ "type": "module", "source": "src/index.tsx", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-mantine.cjs", + "main": "./dist/blocknote-mantine.js", "module": "./dist/blocknote-mantine.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-mantine.js", - "require": "./dist/blocknote-mantine.cjs" + "default": "./dist/blocknote-mantine.js" }, "./style.css": { "import": "./src/style.css", - "require": "./src/style.css", - "style": "./src/style.css" + "style": "./src/style.css", + "default": "./src/style.css" }, "./blocknoteStyles.css": { "import": "./src/blocknoteStyles.css", - "require": "./src/blocknoteStyles.css", - "style": "./src/blocknoteStyles.css" + "style": "./src/blocknoteStyles.css", + "default": "./src/blocknoteStyles.css" } }, "scripts": { diff --git a/packages/mantine/tsconfig.json b/packages/mantine/tsconfig.json index 1e4b4e3f65..afade32699 100644 --- a/packages/mantine/tsconfig.json +++ b/packages/mantine/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "Bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/mantine/vite.config.ts b/packages/mantine/vite.config.ts index c3cfaa3f75..7825bcaaca 100644 --- a/packages/mantine/vite.config.ts +++ b/packages/mantine/vite.config.ts @@ -52,16 +52,15 @@ export default defineConfig( } as Record), }, build: { - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-mantine": path.resolve(__dirname, "src/index.tsx"), }, name: "blocknote-mantine", cssFileName: "style", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -96,14 +95,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: { - react: "React", - "react-dom": "ReactDOM", - }, - }, }, }, }) as UserConfig, diff --git a/packages/math-block/package.json b/packages/math-block/package.json index e66f34955f..2c4b43963f 100644 --- a/packages/math-block/package.json +++ b/packages/math-block/package.json @@ -15,7 +15,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "react", @@ -37,37 +53,38 @@ "type": "module", "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-math-block.cjs", + "main": "./dist/blocknote-math-block.js", "module": "./dist/blocknote-math-block.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-math-block.js", - "require": "./dist/blocknote-math-block.cjs" + "default": "./dist/blocknote-math-block.js" }, "./style.css": { "import": "./src/style.css", - "style": "./src/style.css" + "style": "./src/style.css", + "default": "./src/style.css" }, "./docx-exporter": { "types": "./types/src/docx-exporter/index.d.ts", "import": "./dist/docx-exporter.js", - "require": "./dist/docx-exporter.cjs" + "default": "./dist/docx-exporter.js" }, "./odt-exporter": { "types": "./types/src/odt-exporter/index.d.ts", "import": "./dist/odt-exporter.js", - "require": "./dist/odt-exporter.cjs" + "default": "./dist/odt-exporter.js" }, "./email-exporter": { "types": "./types/src/email-exporter/index.d.ts", "import": "./dist/email-exporter.js", - "require": "./dist/email-exporter.cjs" + "default": "./dist/email-exporter.js" }, "./typst-exporter": { "types": "./types/src/typst-exporter/index.d.ts", "import": "./dist/typst-exporter.js", - "require": "./dist/typst-exporter.cjs" + "default": "./dist/typst-exporter.js" } }, "scripts": { diff --git a/packages/math-block/tsconfig.json b/packages/math-block/tsconfig.json index 2d8bcd4a25..4ce57b0d26 100644 --- a/packages/math-block/tsconfig.json +++ b/packages/math-block/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/math-block/vite.config.ts b/packages/math-block/vite.config.ts index cd2e29a1ff..9ec9a9c1a9 100644 --- a/packages/math-block/vite.config.ts +++ b/packages/math-block/vite.config.ts @@ -74,7 +74,7 @@ export default defineConfig( } as Record), }, build: { - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-math-block": path.resolve(__dirname, "src/index.ts"), @@ -96,9 +96,8 @@ export default defineConfig( ), }, name: "blocknote-math-block", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -132,11 +131,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: {}, - }, }, }, }) as UserConfig, diff --git a/packages/react/package.json b/packages/react/package.json index 245d6547df..7e11ea2d10 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -15,7 +15,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "react", @@ -34,23 +50,23 @@ "type": "module", "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-react.cjs", + "main": "./dist/blocknote-react.js", "module": "./dist/blocknote-react.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-react.js", - "require": "./dist/blocknote-react.cjs" + "default": "./dist/blocknote-react.js" }, "./versioning": { "types": "./types/src/versioning.d.ts", "import": "./dist/versioning.js", - "require": "./dist/versioning.cjs" + "default": "./dist/versioning.js" }, "./style.css": { "import": "./dist/style.css", - "require": "./dist/style.css", - "style": "./dist/style.css" + "style": "./dist/style.css", + "default": "./dist/style.css" } }, "scripts": { diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json index 34ea71f87f..795b193d05 100644 --- a/packages/react/tsconfig.json +++ b/packages/react/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/react/vite.config.ts b/packages/react/vite.config.ts index 589ef20075..337545305b 100644 --- a/packages/react/vite.config.ts +++ b/packages/react/vite.config.ts @@ -54,7 +54,7 @@ export default defineConfig( } as Record), }, build: { - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-react": path.resolve(__dirname, "src/index.ts"), @@ -62,9 +62,8 @@ export default defineConfig( }, name: "blocknote-react", cssFileName: "style", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -99,14 +98,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: { - react: "React", - "react-dom": "ReactDOM", - }, - }, }, }, }) as UserConfig, diff --git a/packages/server-util/package.json b/packages/server-util/package.json index c03ff811d5..dc32d684f7 100644 --- a/packages/server-util/package.json +++ b/packages/server-util/package.json @@ -15,7 +15,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "react", @@ -34,18 +50,13 @@ "type": "module", "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-server-util.cjs", + "main": "./dist/blocknote-server-util.js", "module": "./dist/blocknote-server-util.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-server-util.js", - "require": "./dist/blocknote-server-util.cjs" - }, - "./style.css": { - "import": "./dist/style.css", - "require": "./dist/style.css", - "style": "./dist/style.css" + "default": "./dist/blocknote-server-util.js" } }, "scripts": { diff --git a/packages/server-util/tsconfig.json b/packages/server-util/tsconfig.json index 1e4b4e3f65..afade32699 100644 --- a/packages/server-util/tsconfig.json +++ b/packages/server-util/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "Bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/server-util/vite.config.ts b/packages/server-util/vite.config.ts index d6f26da7ca..1b34e360d4 100644 --- a/packages/server-util/vite.config.ts +++ b/packages/server-util/vite.config.ts @@ -44,15 +44,14 @@ export default defineConfig( } as Record), }, build: { - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-server-util": path.resolve(__dirname, "src/index.ts"), }, name: "blocknote-server-util", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -77,14 +76,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: { - react: "React", - "react-dom": "ReactDOM", - }, - }, }, }, }) as UserConfig, diff --git a/packages/shadcn/package.json b/packages/shadcn/package.json index 958e89d592..2d72294a63 100644 --- a/packages/shadcn/package.json +++ b/packages/shadcn/package.json @@ -15,7 +15,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "react", @@ -34,18 +50,18 @@ "type": "module", "source": "src/index.tsx", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-shadcn.cjs", + "main": "./dist/blocknote-shadcn.js", "module": "./dist/blocknote-shadcn.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-shadcn.js", - "require": "./dist/blocknote-shadcn.cjs" + "default": "./dist/blocknote-shadcn.js" }, "./style.css": { "import": "./dist/style.css", - "require": "./dist/style.css", - "style": "./dist/style.css" + "style": "./dist/style.css", + "default": "./dist/style.css" } }, "scripts": { diff --git a/packages/shadcn/tsconfig.json b/packages/shadcn/tsconfig.json index f4ab4bb858..9f5729de4c 100644 --- a/packages/shadcn/tsconfig.json +++ b/packages/shadcn/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "Bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/shadcn/vite.config.ts b/packages/shadcn/vite.config.ts index 1fff85e215..73e54a66f8 100644 --- a/packages/shadcn/vite.config.ts +++ b/packages/shadcn/vite.config.ts @@ -54,16 +54,15 @@ export default defineConfig( } as Record), }, build: { - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-shadcn": path.resolve(__dirname, "src/index.tsx"), }, name: "blocknote-shadcn", cssFileName: "style", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -88,14 +87,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: { - react: "React", - "react-dom": "ReactDOM", - }, - }, }, }, }) as UserConfig, diff --git a/packages/xl-ai-server/package.json b/packages/xl-ai-server/package.json index 23437782fa..7b79005fa5 100644 --- a/packages/xl-ai-server/package.json +++ b/packages/xl-ai-server/package.json @@ -2,12 +2,32 @@ "name": "@blocknote/xl-ai-server", "homepage": "https://github.com/TypeCellOS/BlockNote", "private": true, + "sideEffects": [ + "./src/index.ts", + "./dist/blocknote-xl-ai-server.js" + ], "license": "GPL-3.0 OR PROPRIETARY", "version": "0.56.0", "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "react", @@ -26,13 +46,13 @@ "type": "module", "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-xl-ai-server.umd.cjs", + "main": "./dist/blocknote-xl-ai-server.js", "module": "./dist/blocknote-xl-ai-server.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-xl-ai-server.js", - "require": "./dist/blocknote-xl-ai-server.umd.cjs" + "default": "./dist/blocknote-xl-ai-server.js" } }, "scripts": { diff --git a/packages/xl-ai-server/tsconfig.json b/packages/xl-ai-server/tsconfig.json index 0d4bdd2759..bb0a0520b1 100644 --- a/packages/xl-ai-server/tsconfig.json +++ b/packages/xl-ai-server/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/xl-ai-server/vite.config.ts b/packages/xl-ai-server/vite.config.ts index f57ebac013..0cfe18edcd 100644 --- a/packages/xl-ai-server/vite.config.ts +++ b/packages/xl-ai-server/vite.config.ts @@ -45,8 +45,9 @@ export default defineConfig( } as Record), }, build: { - sourcemap: true, + sourcemap: false, lib: { + formats: ["es"], entry: path.resolve(__dirname, "src/index.ts"), name: "blocknote-xl-ai-server", fileName: "blocknote-xl-ai-server", @@ -74,14 +75,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: { - react: "React", - "react-dom": "ReactDOM", - }, - }, }, }, }) as UserConfig, diff --git a/packages/xl-ai/package.json b/packages/xl-ai/package.json index 5c500d9793..572ef01075 100644 --- a/packages/xl-ai/package.json +++ b/packages/xl-ai/package.json @@ -15,7 +15,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "ai", @@ -41,22 +57,22 @@ ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-xl-ai.js", - "require": "./dist/blocknote-xl-ai.cjs" + "default": "./dist/blocknote-xl-ai.js" }, "./style.css": { "import": "./dist/style.css", - "require": "./dist/style.css", - "style": "./dist/style.css" + "style": "./dist/style.css", + "default": "./dist/style.css" }, "./locales": { "types": "./types/src/i18n/locales/index.d.ts", "import": "./dist/locales.js", - "require": "./dist/locales.cjs" + "default": "./dist/locales.js" }, "./server": { "types": "./types/src/server.d.ts", "import": "./dist/server.js", - "require": "./dist/server.cjs" + "default": "./dist/server.js" } }, "scripts": { diff --git a/packages/xl-ai/tsconfig.json b/packages/xl-ai/tsconfig.json index d11b68ae43..461bda9242 100644 --- a/packages/xl-ai/tsconfig.json +++ b/packages/xl-ai/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/xl-ai/vite.config.ts b/packages/xl-ai/vite.config.ts index cffb1f7722..6945529772 100644 --- a/packages/xl-ai/vite.config.ts +++ b/packages/xl-ai/vite.config.ts @@ -76,7 +76,7 @@ export default defineConfig( } as Record), }, build: { - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-xl-ai": path.resolve(__dirname, "src/index.ts"), @@ -85,9 +85,8 @@ export default defineConfig( }, name: "blocknote-xl-ai", cssFileName: "style", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -122,14 +121,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: { - react: "React", - "react-dom": "ReactDOM", - }, - }, }, }, }) as UserConfig, diff --git a/packages/xl-docx-exporter/package.json b/packages/xl-docx-exporter/package.json index ca6f3c5821..a225c3eac2 100644 --- a/packages/xl-docx-exporter/package.json +++ b/packages/xl-docx-exporter/package.json @@ -13,7 +13,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "docx", @@ -34,18 +50,13 @@ "type": "module", "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-xl-docx-exporter.cjs", + "main": "./dist/blocknote-xl-docx-exporter.js", "module": "./dist/blocknote-xl-docx-exporter.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-xl-docx-exporter.js", - "require": "./dist/blocknote-xl-docx-exporter.cjs" - }, - "./style.css": { - "import": "./dist/style.css", - "require": "./dist/style.css", - "style": "./dist/style.css" + "default": "./dist/blocknote-xl-docx-exporter.js" } }, "scripts": { diff --git a/packages/xl-docx-exporter/tsconfig.json b/packages/xl-docx-exporter/tsconfig.json index 577fb5ffe7..fc76d3c948 100644 --- a/packages/xl-docx-exporter/tsconfig.json +++ b/packages/xl-docx-exporter/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "Bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/xl-docx-exporter/vite.config.ts b/packages/xl-docx-exporter/vite.config.ts index a6d3cb8ab6..8f3cc78f61 100644 --- a/packages/xl-docx-exporter/vite.config.ts +++ b/packages/xl-docx-exporter/vite.config.ts @@ -57,7 +57,7 @@ export default defineConfig( }, build: { // assetsInclude: ["**/*.woff", "**/*.woff2", "**/*.ttf", "**/*.otf"], // Add other font extensions if needed - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-xl-docx-exporter": path.resolve( @@ -66,9 +66,8 @@ export default defineConfig( ), }, name: "blocknote-xl-docx-exporter", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -93,11 +92,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: {}, - }, }, }, }) as UserConfig, diff --git a/packages/xl-email-exporter/package.json b/packages/xl-email-exporter/package.json index d04f77cc70..a90135174e 100644 --- a/packages/xl-email-exporter/package.json +++ b/packages/xl-email-exporter/package.json @@ -13,7 +13,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "react", @@ -32,17 +48,13 @@ "type": "module", "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-xl-email-exporter.umd.cjs", + "main": "./dist/blocknote-xl-email-exporter.js", "module": "./dist/blocknote-xl-email-exporter.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-xl-email-exporter.js", - "require": "./dist/blocknote-xl-email-exporter.umd.cjs" - }, - "./style.css": { - "import": "./dist/style.css", - "require": "./dist/style.css" + "default": "./dist/blocknote-xl-email-exporter.js" } }, "scripts": { diff --git a/packages/xl-email-exporter/tsconfig.json b/packages/xl-email-exporter/tsconfig.json index d43ec5b03e..82d390d93b 100644 --- a/packages/xl-email-exporter/tsconfig.json +++ b/packages/xl-email-exporter/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "Bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/xl-email-exporter/vite.config.ts b/packages/xl-email-exporter/vite.config.ts index 547cd16656..9174ae2bcf 100644 --- a/packages/xl-email-exporter/vite.config.ts +++ b/packages/xl-email-exporter/vite.config.ts @@ -59,8 +59,9 @@ export default defineConfig( }, build: { // assetsInclude: ["**/*.woff", "**/*.woff2", "**/*.ttf", "**/*.otf"], // Add other font extensions if needed - sourcemap: true, + sourcemap: false, lib: { + formats: ["es"], entry: path.resolve(__dirname, "src/index.ts"), name: "blocknote-xl-email-exporter", fileName: "blocknote-xl-email-exporter", @@ -88,11 +89,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: {}, - }, }, }, }) as UserConfig, diff --git a/packages/xl-multi-column/package.json b/packages/xl-multi-column/package.json index ad2ab42f50..764b2d7ec2 100644 --- a/packages/xl-multi-column/package.json +++ b/packages/xl-multi-column/package.json @@ -13,7 +13,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "react", @@ -32,13 +48,13 @@ "type": "module", "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-xl-multi-column.cjs", + "main": "./dist/blocknote-xl-multi-column.js", "module": "./dist/blocknote-xl-multi-column.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-xl-multi-column.js", - "require": "./dist/blocknote-xl-multi-column.cjs" + "default": "./dist/blocknote-xl-multi-column.js" } }, "scripts": { diff --git a/packages/xl-multi-column/tsconfig.json b/packages/xl-multi-column/tsconfig.json index a75fe88fa2..7cfebd971c 100644 --- a/packages/xl-multi-column/tsconfig.json +++ b/packages/xl-multi-column/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/xl-multi-column/vite.config.ts b/packages/xl-multi-column/vite.config.ts index fcb7cba19d..3b86b72c6d 100644 --- a/packages/xl-multi-column/vite.config.ts +++ b/packages/xl-multi-column/vite.config.ts @@ -49,7 +49,7 @@ export default defineConfig( } as Record), }, build: { - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-xl-multi-column": path.resolve( @@ -58,9 +58,8 @@ export default defineConfig( ), }, name: "blocknote-xl-multi-column", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -95,11 +94,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: {}, - }, }, }, }) as UserConfig, diff --git a/packages/xl-odt-exporter/package.json b/packages/xl-odt-exporter/package.json index c422441b35..3b4597e07c 100644 --- a/packages/xl-odt-exporter/package.json +++ b/packages/xl-odt-exporter/package.json @@ -13,7 +13,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "odt", @@ -34,18 +50,13 @@ "type": "module", "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-xl-odt-exporter.umd.cjs", + "main": "./dist/blocknote-xl-odt-exporter.js", "module": "./dist/blocknote-xl-odt-exporter.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-xl-odt-exporter.js", - "require": "./dist/blocknote-xl-odt-exporter.umd.cjs" - }, - "./style.css": { - "import": "./dist/style.css", - "require": "./dist/style.css", - "style": "./dist/style.css" + "default": "./dist/blocknote-xl-odt-exporter.js" } }, "scripts": { diff --git a/packages/xl-odt-exporter/tsconfig.json b/packages/xl-odt-exporter/tsconfig.json index b9e8f3537b..ed47b01dab 100644 --- a/packages/xl-odt-exporter/tsconfig.json +++ b/packages/xl-odt-exporter/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "Bundler", "jsx": "react-jsx", "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/xl-odt-exporter/vite.config.ts b/packages/xl-odt-exporter/vite.config.ts index 05a48834fa..f885c5ba64 100644 --- a/packages/xl-odt-exporter/vite.config.ts +++ b/packages/xl-odt-exporter/vite.config.ts @@ -56,7 +56,7 @@ export default defineConfig( } as Record), }, build: { - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-xl-odt-exporter": path.resolve( @@ -65,9 +65,8 @@ export default defineConfig( ), }, name: "blocknote-xl-odt-exporter", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -92,11 +91,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: {}, - }, }, }, }) as UserConfig, diff --git a/packages/xl-pdf-exporter/package.json b/packages/xl-pdf-exporter/package.json index c01a12a37e..363c2f1c92 100644 --- a/packages/xl-pdf-exporter/package.json +++ b/packages/xl-pdf-exporter/package.json @@ -13,7 +13,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "pdf", @@ -31,18 +47,18 @@ "type": "module", "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-xl-pdf-exporter.cjs", + "main": "./dist/blocknote-xl-pdf-exporter.js", "module": "./dist/blocknote-xl-pdf-exporter.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-xl-pdf-exporter.js", - "require": "./dist/blocknote-xl-pdf-exporter.cjs" + "default": "./dist/blocknote-xl-pdf-exporter.js" }, "./react-pdf": { "types": "./types/src/react-pdf/index.d.ts", "import": "./dist/react-pdf.js", - "require": "./dist/react-pdf.cjs" + "default": "./dist/react-pdf.js" } }, "scripts": { diff --git a/packages/xl-pdf-exporter/tsconfig.json b/packages/xl-pdf-exporter/tsconfig.json index 841eae0f81..a161360880 100644 --- a/packages/xl-pdf-exporter/tsconfig.json +++ b/packages/xl-pdf-exporter/tsconfig.json @@ -8,7 +8,7 @@ "jsx": "react-jsx", "types": ["node"], "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/xl-pdf-exporter/vite.config.ts b/packages/xl-pdf-exporter/vite.config.ts index 17c8572f78..0e3f311f86 100644 --- a/packages/xl-pdf-exporter/vite.config.ts +++ b/packages/xl-pdf-exporter/vite.config.ts @@ -77,7 +77,7 @@ export default defineConfig( }, build: { // assetsInclude: ["**/*.woff", "**/*.woff2", "**/*.ttf", "**/*.otf"], // Add other font extensions if needed - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-xl-pdf-exporter": path.resolve( @@ -87,9 +87,8 @@ export default defineConfig( "react-pdf": path.resolve(__dirname, "src/react-pdf/index.ts"), }, name: "blocknote-xl-pdf-exporter", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -114,11 +113,6 @@ export default defineConfig( source.startsWith("node:") ); }, - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: {}, - }, }, }, }) as UserConfig, diff --git a/packages/xl-typst-compiler/package.json b/packages/xl-typst-compiler/package.json index b569e54727..b774f8af34 100644 --- a/packages/xl-typst-compiler/package.json +++ b/packages/xl-typst-compiler/package.json @@ -23,7 +23,23 @@ "rust/Cargo.lock", "rust/rust-toolchain.toml", "README.md", - "scripts" + "scripts", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "typst", @@ -37,13 +53,13 @@ "type": "module", "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-xl-typst-compiler.cjs", + "main": "./dist/blocknote-xl-typst-compiler.js", "module": "./dist/blocknote-xl-typst-compiler.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-xl-typst-compiler.js", - "require": "./dist/blocknote-xl-typst-compiler.cjs" + "default": "./dist/blocknote-xl-typst-compiler.js" }, "./pkg": { "types": "./pkg/blocknote_typst_wasm.d.ts", diff --git a/packages/xl-typst-compiler/tsconfig.json b/packages/xl-typst-compiler/tsconfig.json index cee556c3db..2537882ebf 100644 --- a/packages/xl-typst-compiler/tsconfig.json +++ b/packages/xl-typst-compiler/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "Bundler", "types": ["node"], "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/xl-typst-compiler/vite.config.ts b/packages/xl-typst-compiler/vite.config.ts index fd26ba7b50..3fd9d50266 100644 --- a/packages/xl-typst-compiler/vite.config.ts +++ b/packages/xl-typst-compiler/vite.config.ts @@ -43,7 +43,7 @@ export default defineConfig( }, plugins: [webpackStats() as any], build: { - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-xl-typst-compiler": path.resolve( @@ -52,9 +52,8 @@ export default defineConfig( ), }, name: "blocknote-xl-typst-compiler", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { // The wasm-bindgen glue (self-referenced as .../pkg) ships as diff --git a/packages/xl-typst-exporter/package.json b/packages/xl-typst-exporter/package.json index c44481a3fd..d3d859e533 100644 --- a/packages/xl-typst-exporter/package.json +++ b/packages/xl-typst-exporter/package.json @@ -13,7 +13,23 @@ "files": [ "dist", "types", - "src" + "src", + "!**/*.cjs", + "!**/*.map", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.snap", + "!**/__test__/**", + "!**/__tests__/**", + "!**/tests/**", + "!**/__snapshots__/**", + "!**/__msw_snapshots__/**", + "!**/fixtures/**", + "!**/testUtil/**", + "!**/testUtils/**", + "!**/test-utils/**", + "!**/*.tsbuildinfo", + "!dist/webpack-stats.json" ], "keywords": [ "typst", @@ -28,13 +44,13 @@ "type": "module", "source": "src/index.ts", "types": "./types/src/index.d.ts", - "main": "./dist/blocknote-xl-typst-exporter.cjs", + "main": "./dist/blocknote-xl-typst-exporter.js", "module": "./dist/blocknote-xl-typst-exporter.js", "exports": { ".": { "types": "./types/src/index.d.ts", "import": "./dist/blocknote-xl-typst-exporter.js", - "require": "./dist/blocknote-xl-typst-exporter.cjs" + "default": "./dist/blocknote-xl-typst-exporter.js" } }, "scripts": { diff --git a/packages/xl-typst-exporter/tsconfig.json b/packages/xl-typst-exporter/tsconfig.json index ddc9071214..7008047628 100644 --- a/packages/xl-typst-exporter/tsconfig.json +++ b/packages/xl-typst-exporter/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "Bundler", "types": ["node"], "strict": true, - "sourceMap": true, + "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "noEmit": false, diff --git a/packages/xl-typst-exporter/vite.config.ts b/packages/xl-typst-exporter/vite.config.ts index 3a75bf2b91..0b62cd7cfd 100644 --- a/packages/xl-typst-exporter/vite.config.ts +++ b/packages/xl-typst-exporter/vite.config.ts @@ -58,7 +58,7 @@ export default defineConfig( }, }, build: { - sourcemap: true, + sourcemap: false, lib: { entry: { "blocknote-xl-typst-exporter": path.resolve( @@ -67,9 +67,8 @@ export default defineConfig( ), }, name: "blocknote-xl-typst-exporter", - formats: ["es", "cjs"], - fileName: (format, entryName) => - format === "es" ? `${entryName}.js` : `${entryName}.cjs`, + formats: ["es"], + fileName: (_format, entryName) => `${entryName}.js`, }, rollupOptions: { external: (source) =>