diff --git a/.changeset/thin-beds-battle.md b/.changeset/thin-beds-battle.md new file mode 100644 index 000000000..d4a99e592 --- /dev/null +++ b/.changeset/thin-beds-battle.md @@ -0,0 +1,5 @@ +--- +'@gitbook/icons': minor +--- + +Fix the build to support Node.js v20 diff --git a/bun.lock b/bun.lock index 93ecae3bd..d1a8df7aa 100644 --- a/bun.lock +++ b/bun.lock @@ -198,7 +198,6 @@ "dependencies": { "@gitbook/api": "0.96.1", "@gitbook/icons": "workspace:*", - "assert-never": "^1.2.1", "classnames": "^2.5.1", }, "devDependencies": { diff --git a/packages/icons/package.json b/packages/icons/package.json index 73e4f9f10..81da3d92b 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -41,5 +41,8 @@ "bin": { "gitbook-icons": "./bin/gitbook-icons.js" }, - "files": ["dist", "src", "bin", "data", "README.md", "CHANGELOG.md"] + "files": ["dist", "src", "bin", "data", "README.md", "CHANGELOG.md"], + "engines": { + "node": ">=20.0.0" + } } diff --git a/packages/icons/src/getIconStyle.ts b/packages/icons/src/getIconStyle.ts index 55b1a5a1e..3baceb30c 100644 --- a/packages/icons/src/getIconStyle.ts +++ b/packages/icons/src/getIconStyle.ts @@ -1,4 +1,4 @@ -import stylesMap from './data/styles-map.json'; +import stylesMap from './data/styles-map.json' with { type: 'json' }; import type { IconName, IconStyle } from './types'; const cache = new Map>(); diff --git a/packages/icons/src/icons.ts b/packages/icons/src/icons.ts index 5c9deb9c9..25dd06c0c 100644 --- a/packages/icons/src/icons.ts +++ b/packages/icons/src/icons.ts @@ -1,4 +1,4 @@ -import rawIcons from './data/icons.json'; +import rawIcons from './data/icons.json' with { type: 'json' }; import type { IconName, IconStyle } from './types'; export interface IconStyleDefinition { diff --git a/packages/icons/tsconfig.json b/packages/icons/tsconfig.json index 92db2d902..7c6e25597 100644 --- a/packages/icons/tsconfig.json +++ b/packages/icons/tsconfig.json @@ -1,16 +1,16 @@ { "compilerOptions": { - "target": "esnext", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, + "lib": ["es2023"], + "module": "ESNext", + "target": "es2022", "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowJs": true, "noEmit": false, "declaration": true, "outDir": "dist", - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "react-jsx", diff --git a/packages/react-contentkit/package.json b/packages/react-contentkit/package.json index ec8f48283..894b00ef3 100644 --- a/packages/react-contentkit/package.json +++ b/packages/react-contentkit/package.json @@ -11,7 +11,6 @@ "dependencies": { "classnames": "^2.5.1", "@gitbook/api": "0.96.1", - "assert-never": "^1.2.1", "@gitbook/icons": "workspace:*" }, "peerDependencies": {