Skip to content

Commit

Permalink
build: use pkg json's exports key and bump vers to 0.1.0-rc.3
Browse files Browse the repository at this point in the history
This also renames package output to index.mjs to communicate clearly its esm.
  • Loading branch information
tim-hm committed Aug 1, 2024
1 parent 0ed1172 commit c08eb02
Show file tree
Hide file tree
Showing 13 changed files with 447 additions and 2,959 deletions.
12 changes: 11 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ check:
npx tsc
echo "done."

watch-and-build:
#!/usr/bin/env bash
set -uxo pipefail
just clean
npx concurrently -c "auto" \
"npm -w packages/client-core run build:watch" \
"npm -w packages/client-payments run build:watch" \
"npm -w packages/client-vms run build:watch" \
"npm -w packages/client-react-hooks run build:watch"
pack:
#!/usr/bin/env bash
set -euxo pipefail
Expand All @@ -33,7 +43,7 @@ pack:
unpublish:
#!/usr/bin/env bash
set -euxo pipefail
echo "warning: only for local development"
echo "warning: only for use with a local registry"
npm unpublish --force @nillion/client-wasm
npm unpublish --force @nillion/client-core
npm unpublish --force @nillion/client-payments
Expand Down
3,319 changes: 390 additions & 2,929 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/client-core/esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config = {
entryPoints: ["src/index.ts"],
bundle: true,
format: "esm",
outfile: "dist/index.js",
outfile: "dist/index.mjs",
packages: "external",
logLevel: "info",
};
Expand Down
12 changes: 8 additions & 4 deletions packages/client-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
"name": "@nillion/client-core",
"license": "MIT",
"author": "[email protected]",
"version": "0.1.0-rc.2",
"version": "0.1.0-rc.3",
"type": "module",
"browser": "dist/index.js",
"types": "src/index.ts",
"exports": {
".": {
"types": "./src/index.ts",
"import": "./dist/index.mjs"
}
},
"scripts": {
"clean": "rm -rf dist",
"build": "node esbuild.config.mjs",
Expand All @@ -16,7 +20,7 @@
"test:serve": "npx jasmine-browser-runner serve --config=jasmine.config.mjs"
},
"dependencies": {
"@nillion/client-wasm": "^0.1.0-rc.2",
"@nillion/client-wasm": "0.1.0-rc.3",
"debug": "^4.3.5",
"effect": "^3.5.5",
"zod": "^3.23.8"
Expand Down
2 changes: 1 addition & 1 deletion packages/client-payments/esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config = {
entryPoints: ["src/index.ts"],
bundle: true,
format: "esm",
outfile: "dist/index.js",
outfile: "dist/index.mjs",
external: ["crypto", "@nillion/client-core"],
logLevel: "info",
};
Expand Down
12 changes: 8 additions & 4 deletions packages/client-payments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
"name": "@nillion/client-payments",
"license": "MIT",
"author": "[email protected]",
"version": "0.1.0-rc.2",
"version": "0.1.0-rc.3",
"type": "module",
"browser": "dist/index.js",
"types": "src/index.ts",
"exports": {
".": {
"types": "./src/index.ts",
"import": "./dist/index.mjs"
}
},
"scripts": {
"clean": "rm -rf dist",
"build": "node esbuild.config.mjs",
Expand All @@ -19,7 +23,7 @@
"dependencies": {
"@cosmjs/proto-signing": "^0.32.4",
"@cosmjs/stargate": "^0.32.4",
"@nillion/client-core": "^0.1.0-rc.2",
"@nillion/client-core": "^0.1.0-rc.3",
"debug": "^4.3.5",
"effect": "^3.5.5",
"protobufjs": "^7.3.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/client-payments/src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TaggedError } from "@nillion/client-core/src/error";
import { TaggedError } from "@nillion/client-core";

export class AccountNotFoundError extends Error implements TaggedError {
readonly _tag = "AccountNotFoundError" as const;
Expand Down
2 changes: 1 addition & 1 deletion packages/client-react-hooks/esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config = {
entryPoints: ["src/index.ts"],
bundle: true,
format: "esm",
outfile: "dist/index.js",
outfile: "dist/index.mjs",
packages: "external",
external: [],
logLevel: "info",
Expand Down
13 changes: 8 additions & 5 deletions packages/client-react-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
"name": "@nillion/client-react-hooks",
"license": "MIT",
"author": "[email protected]",
"version": "0.1.0-rc.2",
"version": "0.1.0-rc.3",
"type": "module",
"module": "dist/index.js",
"browser": "dist/index.js",
"types": "src/index.ts",
"exports": {
".": {
"types": "./src/index.ts",
"import": "./dist/index.mjs"
}
},
"scripts": {
"clean": "rm -rf dist",
"build": "node esbuild.config.mjs",
"build:watch": "node esbuild.config.mjs --watch"
},
"dependencies": {
"@nillion/client-vms": "^0.1.0-rc.2",
"@nillion/client-vms": "^0.1.0-rc.3",
"@tanstack/react-query": "^5.51.9",
"debug": "^4.3.5",
"react": "^18.3.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/client-vms/esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config = {
entryPoints: ["src/index.ts"],
bundle: true,
format: "esm",
outfile: "dist/index.js",
outfile: "dist/index.mjs",
packages: "external",
logLevel: "info",
};
Expand Down
14 changes: 9 additions & 5 deletions packages/client-vms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
"name": "@nillion/client-vms",
"license": "MIT",
"author": "[email protected]",
"version": "0.1.0-rc.2",
"version": "0.1.0-rc.3",
"type": "module",
"browser": "dist/index.js",
"types": "src/index.ts",
"exports": {
".": {
"types": "./src/index.ts",
"import": "./dist/index.mjs"
}
},
"scripts": {
"clean": "rm -rf dist",
"build": "node esbuild.config.mjs",
Expand All @@ -16,8 +20,8 @@
"test:serve": "npx jasmine-browser-runner serve --config=jasmine.config.mjs"
},
"dependencies": {
"@nillion/client-core": "^0.1.0-rc.2",
"@nillion/client-payments": "^0.1.0-rc.2",
"@nillion/client-core": "^0.1.0-rc.3",
"@nillion/client-payments": "^0.1.0-rc.3",
"debug": "^4.3.5",
"zod": "^3.23.8"
},
Expand Down
12 changes: 7 additions & 5 deletions packages/client-wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
"name": "@nillion/client-wasm",
"license": "Apache-2.0",
"author": "[email protected]",
"version": "0.1.0-rc.2",
"version": "0.1.0-rc.3",
"homepage": "https://docs.nillion.com/",
"type": "module",
"module": "dist/index.js",
"main": "dist/index.js",
"browser": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./src/index.d.ts",
"import": "./dist/index.js"
}
},
"sideEffects": [
"dist/snippets/**"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/fixture/helpers/expect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Result } from "packages/client-core";
import { Result } from "@nillion/client-core";

export const expectOk = <S, E>(
result: Result<S, E>,
Expand Down

0 comments on commit c08eb02

Please sign in to comment.