Skip to content

Commit dc53b90

Browse files
committed
chore: publish libpkgx to JSR as @pkgx/libpkgx
deno.land/x is read-only; new versions go to JSR. - deno.json: name, version 0.23.0, exports (mod + deep paths brewkit needs) - deps: npm:is-what@4.1.15, npm:outdent@0.8.0 (no deno.land/x deps) - CI: publish-jsr.yml on release (OIDC) - README: JSR import example
1 parent bf926ec commit dc53b90

4 files changed

Lines changed: 70 additions & 8 deletions

File tree

.github/workflows/publish-jsr.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: publish·jsr
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: publish/jsr/${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
id-token: write # OIDC for tokenless JSR publish
15+
16+
jobs:
17+
publish:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: denoland/setup-deno@v2
22+
with:
23+
deno-version: v2.x
24+
- name: dry-run
25+
run: deno publish --dry-run --allow-slow-types --no-check --unstable-fs --unstable-ffi
26+
- name: publish
27+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
28+
run: deno publish --allow-slow-types --no-check --unstable-fs --unstable-ffi

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ $ npm install libpkgx
1616
# ^^ https://npmjs.com/libpkgx
1717
```
1818

19-
Or with [Deno]:
19+
Or with [Deno] via [JSR](https://jsr.io):
2020

2121
```ts
22-
import * as pkgx from "https://deno.land/x/libpkgx/mod.ts"
22+
import * as pkgx from "jsr:@pkgx/libpkgx"
2323
```
2424

25+
> `deno.land/x/libpkgx` is frozen (registry is read-only). Use JSR for new versions.
26+
2527
## Usage
2628

2729
```ts

deno.json

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,44 @@
11
{
2+
"name": "@pkgx/libpkgx",
3+
"version": "0.23.0",
4+
"license": "Apache-2.0",
5+
"exports": {
6+
".": "./mod.ts",
7+
"./hooks/useConfig.ts": "./src/hooks/useConfig.ts",
8+
"./hooks/usePantry.ts": "./src/hooks/usePantry.ts",
9+
"./utils/error.ts": "./src/utils/error.ts",
10+
"./utils/host.ts": "./src/utils/host.ts",
11+
"./utils/read-lines.ts": "./src/utils/read-lines.ts",
12+
"./utils/semver.ts": "./src/utils/semver.ts",
13+
"./plumbing/hydrate.ts": "./src/plumbing/hydrate.ts"
14+
},
15+
"publish": {
16+
"include": [
17+
"LICENSE.txt",
18+
"README.md",
19+
"mod.ts",
20+
"src/**/*.ts",
21+
"vendor/**"
22+
],
23+
"exclude": [
24+
"src/**/*.test.ts",
25+
"src/hooks/useTestConfig.ts",
26+
"fixtures",
27+
"examples",
28+
"scripts",
29+
"dist",
30+
".github"
31+
]
32+
},
233
"compilerOptions": {
334
"allowJs": false,
435
"strict": true
536
},
637
"pkgx": "deno~2.0",
738
"tasks": {
839
"test": "deno test --parallel --unstable-fs --unstable-ffi --allow-all",
9-
"typecheck": "deno check ./mod.ts"
40+
"typecheck": "deno check ./mod.ts",
41+
"publish:dry": "deno publish --dry-run --allow-slow-types --no-check --allow-dirty --unstable-fs --unstable-ffi"
1042
},
1143
"lint": {
1244
"include": ["src/"],
@@ -19,7 +51,7 @@
1951
"imports": {
2052
"@std/assert": "jsr:@std/assert@^1.0.6",
2153
"@std/testing": "jsr:@std/testing@^1.0.3",
22-
"is-what": "https://deno.land/x/is_what@v4.1.15/src/index.ts",
23-
"outdent": "https://deno.land/x/outdent@v0.8.0/mod.ts"
54+
"is-what": "npm:is-what@4.1.15",
55+
"outdent": "npm:outdent@0.8.0"
2456
}
2557
}

src/deps.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import * as is_what from "https://deno.land/x/is_what@v4.1.15/src/index.ts"
1+
import * as is_what from "is-what"
22
export { is_what }
33

4-
import { type PlainObject } from "https://deno.land/x/is_what@v4.1.15/src/index.ts"
4+
import { type PlainObject } from "is-what"
55
export type { PlainObject }
66

7-
import * as outdent from "https://deno.land/x/outdent@v0.8.0/mod.ts"
7+
import * as outdent from "outdent"
88
export { outdent }
99

1010
// importing super specifically to reduce final npm bundle size

0 commit comments

Comments
 (0)