Skip to content

Commit f2f6a44

Browse files
authored
Merge pull request #38 from cooklang/preview-pkg-ts-bindings
enable publishing preview version of ts bindings
2 parents ad78afa + 6cbffb8 commit f2f6a44

File tree

7 files changed

+168
-125
lines changed

7 files changed

+168
-125
lines changed

.github/workflows/preview.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: preview
2+
3+
on: [pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
typescript:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 22
16+
- run: npm ci
17+
- name: Publish Preview Versions
18+
run: npx pkg-pr-new publish './typescript' --template './playground'

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 109 additions & 106 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,32 @@
66
"playground"
77
],
88
"scripts": {
9-
"watch": "npm run -w @cooklang/cooklang-ts watch & npm run -w cooklang-playground watch"
9+
"playground": "wireit"
10+
},
11+
"devDependencies": {
12+
"wireit": "^0.14.12"
13+
},
14+
"wireit": {
15+
"playground": {
16+
"command": "npm run -w cooklang-playground start",
17+
"service": true,
18+
"dependencies": [
19+
{
20+
"script": "watch-wasm",
21+
"cascade": false
22+
}
23+
]
24+
},
25+
"watch-wasm": {
26+
"command": "npm run -w @cooklang/cooklang-ts watch-wasm",
27+
"files": [
28+
"!target",
29+
"src/**/*.rs",
30+
"typescript/**/*.rs"
31+
],
32+
"output": [
33+
"pkg/**"
34+
]
35+
}
1036
}
1137
}

playground/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
"name": "cooklang-playground",
33
"version": "0.0.0",
44
"license": "MIT",
5+
"private": true,
56
"scripts": {
67
"start": "vite",
7-
"watch": "vite",
88
"build": "vite build"
99
},
10+
"dependencies": {
11+
"@cooklang/cooklang-ts": "*"
12+
},
1013
"devDependencies": {
1114
"vite": "^6.3.5"
1215
}

typescript/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "cooklang-playground"
2+
name = "cooklang-wasm"
33
version = "0.1.0"
44
edition = "2021"
55
publish = false

typescript/package.json

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"name": "@cooklang/cooklang-ts",
33
"version": "0.0.0",
4-
"private": "true",
54
"license": "MIT",
6-
"main": "pkg/cooklang_playground.js",
5+
"main": "pkg/cooklang_wasm.js",
76
"files": [
8-
"pkg"
7+
"pkg/cooklang_wasm_bg.wasm",
8+
"pkg/cooklang_wasm_bg.wasm.d.ts",
9+
"pkg/cooklang_wasm.d.ts",
10+
"pkg/cooklang_wasm.js"
911
],
1012
"keywords": [
1113
"cooklang",
@@ -17,20 +19,11 @@
1719
],
1820
"scripts": {
1921
"build": "echo noop",
20-
"build-wasm": "wireit",
21-
"watch": "npm run build-wasm --watch",
22+
"build-wasm": "wasm-pack build --target web",
23+
"watch-wasm": "wasm-pack build --dev --mode no-install --target web",
2224
"prepare": "npm run build-wasm && npm run build"
2325
},
2426
"devDependencies": {
25-
"wasm-pack": "^0.13.1",
26-
"wireit": "^0.14.12"
27-
},
28-
"wireit": {
29-
"build-wasm": {
30-
"command": "wasm-pack build --target web",
31-
"files": [
32-
"../src/**/*"
33-
]
34-
}
27+
"wasm-pack": "^0.13.1"
3528
}
3629
}

0 commit comments

Comments
 (0)