Skip to content

Commit 9d83b94

Browse files
committed
feat: make package esm only
1 parent 0e8a8a8 commit 9d83b94

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

packages/headless/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# [0.2.0](https://github.com/steven-tey/novel/compare/v0.1.0...v0.2.0) (2025-01-17)
22

3+
## 1.0.1
4+
5+
### Patch Changes
6+
7+
- remote tiptap markdown
8+
39
## 1.0.0
410

511
### Major Changes

packages/headless/esm-only.cjs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// ESM only manifesto: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
2+
3+
// This stub file was added to let some old ESLint plugins resolve
4+
// the import paths correctly, as setting exports.*.require: null in package.json didn't work.
5+
6+
throw new Error(
7+
`This package is ESM only.
8+
See https://err.47ng.com/NUQS-101 for more details.`,
9+
);

packages/headless/package.json

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
{
22
"name": "novel",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Notion-style WYSIWYG editor with AI-powered autocompletions",
55
"license": "Apache-2.0",
66
"type": "module",
7-
"main": "dist/index.cjs",
7+
"sideEffects": false,
88
"module": "dist/index.js",
99
"types": "dist/index.d.ts",
10+
"exports": {
11+
".": {
12+
"types": "./dist/index.d.ts",
13+
"import": "./dist/index.js",
14+
"require": "./esm-only.cjs"
15+
}
16+
},
1017
"files": [
1118
"dist"
1219
],
20+
"publishConfig": {
21+
"access": "public"
22+
},
1323
"scripts": {
1424
"dev": "tsup --watch",
1525
"typecheck": "tsc --noEmit",
1626
"build": "tsup",
1727
"lint": "biome lint ./src",
1828
"format": "biome format ./src "
1929
},
20-
"sideEffects": false,
2130
"peerDependencies": {
2231
"react": ">=18"
2332
},

packages/headless/tsup.config.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ export default defineConfig((options: Options) => ({
66
js: "'use client'",
77
},
88
minify: true,
9-
format: ["cjs", "esm"],
9+
format: ["esm"],
1010
dts: true,
1111
clean: true,
1212
external: ["react", "react-dom"],
13+
splitting: true,
14+
treeshake: true,
1315
...options,
1416
}));

0 commit comments

Comments
 (0)