Skip to content

Commit ceb54c1

Browse files
committed
fix(ts-sdk): reproducibly publish sdk
1 parent 59d0f63 commit ceb54c1

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

ts-sdk/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"main": "index.js",
55
"scripts": {
66
"build": "tsup",
7-
"test": "vitest run"
7+
"test": "vitest run",
8+
"test-watch": "vitest"
89
},
910
"files": ["./src", "./dist"],
1011
"keywords": [],

ts-sdk/ts-sdk.nix

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ _: {
44
jsPkgs,
55
ensureAtRepositoryRoot,
66
lib,
7+
self',
78
...
89
}:
910
let
@@ -14,18 +15,25 @@ _: {
1415
ts-sdk = jsPkgs.buildNpmPackage {
1516
pname = packageJson.name;
1617
version = packageJson.version;
17-
1818
src = ./.;
19-
2019
npmDepsHash = "sha256-dFrd5jFaLjE3w9gXUdCx94/Nb3fi5RdxVKwGP6RdKAE=";
21-
2220
doCheck = true;
2321
checkPhase = ''
2422
npm run test
2523
'';
2624
};
2725

2826
};
29-
apps = {};
27+
apps.publish-ts-sdk = {
28+
type = "app";
29+
program = jsPkgs.writeShellApplication {
30+
name = "publish-ts-sdk";
31+
text = ''
32+
cd ${self'.packages.ts-sdk}/lib/node_modules/@unionlabs/sdk
33+
${jsPkgs.nodejs}/bin/npm publish --access='public' --no-git-tagsh
34+
'';
35+
};
36+
37+
};
3038
};
3139
}

0 commit comments

Comments
 (0)