From 5cfc9fd9e4b34cfa0ecde6e9f7926d21d3aeed79 Mon Sep 17 00:00:00 2001 From: mkrause Date: Fri, 15 Nov 2024 15:12:40 +0100 Subject: [PATCH 1/2] Add 'exports' field to package.json. --- package-lock.json | 4 ++-- package.json | 18 ++++++++++++------ package.json.js | 16 +++++++++++----- vite.config.ts | 6 ++++++ 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index c240885..6ad9e70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,8 +17,8 @@ "fast-check": "^3.13.2", "message-tag": "^0.10.0", "optics-ts": "^2.4.1", - "react": "^19.0.0-rc-0751fac7-20241002", - "react-dom": "^19.0.0-rc-0751fac7-20241002", + "react": "^19.0.0-rc.1", + "react-dom": "^19.0.0-rc.1", "react-error-boundary": "^4.0.13", "react-hook-form": "^7.53.0", "react-toastify": "^10.0.5" diff --git a/package.json b/package.json index 5688ad4..082e1f1 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,6 @@ "type": "git", "url": "git+https://github.com/fortanix/baklava.git" }, - "sideEffects": [ - "*.css" - ], - "type": "module", "files": [ "src", "app", @@ -21,6 +17,16 @@ "CHANGELOG.md", "README.md" ], + "sideEffects": [ + "*.css" + ], + "type": "module", + "exports": { + ".": { + "types": "dist/baklava.d.ts", + "default": "dist/baklava.js" + } + }, "scripts": { "gen-package": "node package.json.js", "install-project": "npm run gen-package && npm install --force", @@ -84,8 +90,8 @@ "date-fns": "^4.1.0", "message-tag": "^0.10.0", "classnames": "^2.5.1", - "react": "^19.0.0-rc-0751fac7-20241002", - "react-dom": "^19.0.0-rc-0751fac7-20241002", + "react": "^19.0.0-rc.1", + "react-dom": "^19.0.0-rc.1", "react-error-boundary": "^4.0.13", "@floating-ui/react": "^0.26.24", "react-toastify": "^10.0.5", diff --git a/package.json.js b/package.json.js index 5db96b2..8cb4c98 100644 --- a/package.json.js +++ b/package.json.js @@ -14,9 +14,6 @@ const packageConfig = { description: 'Fortanix Baklava design system', repository: { type: 'git', url: 'git+https://github.com/fortanix/baklava.git' }, - sideEffects: ['*.css'], - - type: 'module', files: [ 'src', 'app', @@ -25,6 +22,15 @@ const packageConfig = { 'CHANGELOG.md', 'README.md', ], + sideEffects: ['*.css'], + type: 'module', + exports: { + '.': { + 'types': 'dist/baklava.d.ts', + //'require': 'dist/baklava.cjs', + 'default': 'dist/baklava.js', + } + }, scripts: { // Utilities @@ -137,8 +143,8 @@ const packageConfig = { // React 'classnames': '^2.5.1', - 'react': '^19.0.0-rc-0751fac7-20241002', - 'react-dom': '^19.0.0-rc-0751fac7-20241002', + 'react': '^19.0.0-rc.1', + 'react-dom': '^19.0.0-rc.1', 'react-error-boundary': '^4.0.13', '@floating-ui/react': '^0.26.24', diff --git a/vite.config.ts b/vite.config.ts index 4aaf6a5..037ec8e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -37,7 +37,13 @@ export default defineConfig({ // Generate `.d.ts` files dts({ + // https://github.com/qmhc/vite-plugin-dts/issues/275#issuecomment-1963123685 + outDir: 'dist', // dts.root + 'dist' => where we need to rollup. + root: '../', //vite.root + ../ = ./ = (dts.root) + staticImport: true, + insertTypesEntry: true, rollupTypes: true, + //include: [path.resolve(__dirname, 'app')], tsconfigPath: path.resolve(__dirname, 'tsconfig.json'), }), From a2482f4d4f378e5ed33e4533372ecb11b10a5627 Mon Sep 17 00:00:00 2001 From: mkrause Date: Fri, 15 Nov 2024 15:13:27 +0100 Subject: [PATCH 2/2] Release v1.0.0-beta-20241115 --- package-lock.json | 4 ++-- package.json | 2 +- package.json.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6ad9e70..dcc1bb9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@fortanix/baklava", - "version": "1.0.0-beta-20241114", + "version": "1.0.0-beta-20241115", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@fortanix/baklava", - "version": "1.0.0-beta-20241114", + "version": "1.0.0-beta-20241115", "license": "MPL-2.0", "dependencies": { "@effect/schema": "^0.74.1", diff --git a/package.json b/package.json index 082e1f1..b51d423 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "//": "NOTE: This is a generated file. Do not edit this file directly, use package.json.js instead.", "name": "@fortanix/baklava", - "version": "1.0.0-beta-20241114", + "version": "1.0.0-beta-20241115", "license": "MPL-2.0", "author": "Fortanix", "description": "Fortanix Baklava design system", diff --git a/package.json.js b/package.json.js index 8cb4c98..b83f465 100644 --- a/package.json.js +++ b/package.json.js @@ -8,7 +8,7 @@ import * as fs from 'node:fs'; const packageConfig = { name: '@fortanix/baklava', - version: '1.0.0-beta-20241114', + version: '1.0.0-beta-20241115', license: 'MPL-2.0', author: 'Fortanix', description: 'Fortanix Baklava design system',