diff --git a/.changeset/tame-comics-tickle.md b/.changeset/tame-comics-tickle.md new file mode 100644 index 00000000..3c08a743 --- /dev/null +++ b/.changeset/tame-comics-tickle.md @@ -0,0 +1,5 @@ +--- +"arancini": minor +--- + +feat: move bundles to dist, add note to readme regarding using entrypoints with typescript diff --git a/packages/arancini/README.md b/packages/arancini/README.md index 63aa9d4f..1c4bfea9 100644 --- a/packages/arancini/README.md +++ b/packages/arancini/README.md @@ -282,6 +282,8 @@ class ExampleSystem extends System { You can install all of arancini with the umbrella `arancini` package, or you can install particular packages. +Note that in order to use entrypoints with typescript, you must use a `moduleResolution` option that supports entrypoints, for example `bundler` or `NodeNext`. + > **Note:** arancini ships as ECMAScript modules. ### [**`arancini`**](https://github.com/isaac-mason/arancini/tree/main/packages/arancini) diff --git a/packages/arancini/package.json b/packages/arancini/package.json index 470b6355..ebf5d7df 100644 --- a/packages/arancini/package.json +++ b/packages/arancini/package.json @@ -16,7 +16,7 @@ }, "scripts": { "build": "yarn build:before && rollup --config rollup.config.js --bundleConfigAsCjs", - "build:before": "(rm index.js index.d.ts react.js react.d.ts || true)", + "build:before": "rm -rf dist", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook" }, @@ -58,21 +58,20 @@ "vite-plugin-dts": "^3.6.3" }, "type": "module", - "main": "./index.js", - "types": "./index.d.ts", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "exports": { ".": { - "import": "./index.js" + "types": "./dist/index.d.ts", + "import": "./dist/index.js" }, "./react": { - "import": "./react.js" + "types": "./dist/react.d.ts", + "import": "./dist/react.js" } }, "files": [ - "index.js", - "index.d.ts", - "react.js", - "react.d.ts", + "dist", "LICENSE", "README.md" ] diff --git a/packages/arancini/rollup.config.js b/packages/arancini/rollup.config.js index ca62920d..5e449cab 100644 --- a/packages/arancini/rollup.config.js +++ b/packages/arancini/rollup.config.js @@ -27,7 +27,7 @@ export default [ external: ['@arancini/core'], output: [ { - file: `./index.js`, + file: `./dist/index.js`, ...commonOutput, }, ], @@ -38,7 +38,7 @@ export default [ external: ['@arancini/core', '@arancini/react', 'react', 'react-dom'], output: [ { - file: `./react.js`, + file: `./dist/react.js`, ...commonOutput, }, ], diff --git a/packages/arancini/tsconfig.json b/packages/arancini/tsconfig.json index a8165b0b..a7111e55 100644 --- a/packages/arancini/tsconfig.json +++ b/packages/arancini/tsconfig.json @@ -23,5 +23,5 @@ }, "include": ["./src"], "files": ["./src/index.ts", "./src/react.ts"], - "exclude": ["./index.d.ts", "./react.d.ts"] + "exclude": ["./dist"] }