diff --git a/packages/lib-reactive-io/package.json b/packages/lib-reactive-io/package.json index 3f43643e..9b9a882b 100644 --- a/packages/lib-reactive-io/package.json +++ b/packages/lib-reactive-io/package.json @@ -1,10 +1,9 @@ { "name": "@dassie/lib-reactive-io", - "type": "module", - "version": "0.0.0", - "private": true, + "version": "0.0.1", "description": "IO abstraction layer for Dassie", - "main": "./src/index.ts", + "type": "module", + "sideEffects": false, "exports": { ".": { "node": "./src/node/index.ts", @@ -17,11 +16,36 @@ "import": "./src/browser/index.ts" } }, + "publishConfig": { + "exports": { + ".": { + "types": "./dist/browser/index.d.ts", + "node": "./dist/node/index.js", + "import": "./dist/browser/index.js" + }, + "./node": { + "types": "./dist/node/index.d.ts", + "import": "./dist/node/index.js" + }, + "./browser": { + "types": "./dist/browser/index.d.ts", + "import": "./dist/browser/index.js" + } + } + }, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "build": "tsc && rollup -c", "lint": "eslint --color .", "typecheck": "tsc --pretty" }, + "files": [ + "dist/node/index.js", + "dist/node/index.js.map", + "dist/node/index.d.ts", + "dist/browser/index.js", + "dist/browser/index.js.map", + "dist/browser/index.d.ts" + ], "author": { "name": "Stefan Thomas", "email": "justmoon@members.fsf.org", @@ -34,6 +58,7 @@ "uint8array-extras": "^1.4.0" }, "devDependencies": { + "@dassie/meta-rollup-config": "workspace:^", "@dassie/meta-tsconfig": "workspace:^", "@types/node": "^22.5.5" }, diff --git a/packages/lib-reactive-io/rollup.config.js b/packages/lib-reactive-io/rollup.config.js new file mode 100644 index 00000000..af81264a --- /dev/null +++ b/packages/lib-reactive-io/rollup.config.js @@ -0,0 +1,12 @@ +import { entrypoint } from "@dassie/meta-rollup-config" + +const config = [ + ...entrypoint("browser/index", { + external: ["@dassie/lib-type-utils", "@dassie/lib-reactive"], + }), + ...entrypoint("node/index", { + external: ["@dassie/lib-type-utils", "@dassie/lib-reactive"], + }), +] + +export default config diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 05ad27fc..908f96bb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -824,6 +824,9 @@ importers: specifier: ^1.4.0 version: 1.4.0 devDependencies: + '@dassie/meta-rollup-config': + specifier: workspace:^ + version: link:../meta-rollup-config '@dassie/meta-tsconfig': specifier: workspace:^ version: link:../meta-tsconfig