File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish npm
2+
3+ on :
4+ push :
5+ tags :
6+ - " v*"
7+
8+ jobs :
9+ publish :
10+ runs-on : ubuntu-latest
11+ permissions :
12+ contents : read
13+ steps :
14+ - uses : actions/checkout@v4
15+
16+ - uses : actions/setup-node@v4
17+ with :
18+ node-version : " 20"
19+ registry-url : " https://registry.npmjs.org"
20+ cache : npm
21+
22+ - name : Align tag with package.json version
23+ run : |
24+ TAG="${GITHUB_REF#refs/tags/v}"
25+ PKG="$(node -p "require('./package.json').version")"
26+ if [ "$TAG" != "$PKG" ]; then
27+ echo "::error::Tag v$TAG does not match package.json version $PKG"
28+ exit 1
29+ fi
30+
31+ - run : npm ci
32+
33+ - run : npm run typecheck
34+
35+ - run : npm test
36+
37+ - run : npm publish
38+ env :
39+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ A TypeScript/JavaScript SDK for the Polyscope API.
55## Installation
66
77``` bash
8- npm install polyscope
8+ npm install @ polyscope/sdk
99```
1010
1111## Quick Start
1212
1313``` typescript
14- import { Polyscope } from " polyscope" ;
14+ import { Polyscope } from " @ polyscope/sdk " ;
1515
1616const polyscope = new Polyscope ({ apiToken: " your-api-token" });
1717
@@ -75,7 +75,7 @@ The SDK maps common HTTP/API failures to typed errors:
7575Example:
7676
7777``` typescript
78- import { Polyscope , ValidationError } from " polyscope" ;
78+ import { Polyscope , ValidationError } from " @ polyscope/sdk " ;
7979
8080try {
8181 await polyscope .createWorkspace ({ repositoryId: " " });
Original file line number Diff line number Diff line change 11{
2- "name" : " polyscope" ,
2+ "name" : " @ polyscope/sdk " ,
33 "version" : " 0.1.0" ,
44 "description" : " Official Polyscope SDK for JavaScript and TypeScript" ,
55 "type" : " module" ,
3737 ],
3838 "author" : " Beyond Code" ,
3939 "license" : " MIT" ,
40+ "repository" : {
41+ "type" : " git" ,
42+ "url" : " git+https://github.com/beyondcode/polyscope-js.git"
43+ },
44+ "publishConfig" : {
45+ "access" : " public"
46+ },
4047 "devDependencies" : {
4148 "@types/node" : " ^25.3.2" ,
4249 "tsup" : " ^8.4.0" ,
You can’t perform that action at this time.
0 commit comments