Skip to content

Commit bff7dab

Browse files
committed
feat: improve exports and documentation
1 parent 5160e45 commit bff7dab

20 files changed

Lines changed: 768 additions & 393 deletions

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 4
9+
end_of_line = lf
10+
11+
[*.{js,ts,mjs,json}]
12+
indent_style = tab

.gitattributes

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Auto detect text files and perform LF normalization
2-
* text=auto
3-
*.ts linguist-detectable=false
4-
*.mjs linguist-detectable=false
5-
test_data/** linguist-detectable=false
2+
* text=auto eol=lf
3+
4+
justfile -linguist-detectable
5+
extra/** -linguist-detectable
6+
scripts/** -linguist-detectable
7+
test_*/** -linguist-detectable

.github/workflows/publish.yml

Lines changed: 105 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,112 @@
11
name: Publish
22

33
on:
4-
push:
5-
tags:
6-
- "v*"
4+
push:
5+
tags:
6+
- "v*"
77

88
env:
9-
CARGO_INCREMENTAL: 0
10-
CARGO_TERM_COLOR: "always"
11-
RUST_LOG: "off"
9+
CARGO_INCREMENTAL: 0
10+
CARGO_TERM_COLOR: "always"
11+
RUST_LOG: "off"
1212

1313
jobs:
14-
wasm-build:
15-
name: Wasm build
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/checkout@v6
19-
20-
- name: Install wasm-pack
21-
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
22-
23-
- name: Build wasm
24-
run: ./scripts/build.sh
25-
26-
- name: Upload
27-
uses: actions/upload-artifact@v6
28-
with:
29-
name: build
30-
path: pkg
31-
32-
publish-npm:
33-
if: startsWith(github.ref, 'refs/tags/v')
34-
runs-on: ubuntu-latest
35-
needs: wasm-build
36-
permissions:
37-
id-token: write
38-
steps:
39-
- uses: actions/checkout@v6
40-
- uses: actions/download-artifact@v7
41-
with:
42-
name: build
43-
path: pkg
44-
45-
- uses: actions/setup-node@v6
46-
with:
47-
node-version-file: ".node-version"
48-
registry-url: "https://registry.npmjs.org"
49-
50-
- name: Publish
51-
working-directory: pkg
52-
run: npm publish --provenance
53-
54-
publish-github:
55-
if: startsWith(github.ref, 'refs/tags/v')
56-
runs-on: ubuntu-latest
57-
needs: wasm-build
58-
permissions:
59-
packages: write
60-
steps:
61-
- uses: actions/checkout@v6
62-
- uses: actions/download-artifact@v7
63-
with:
64-
name: build
65-
path: pkg
66-
67-
- uses: actions/setup-node@v6
68-
with:
69-
node-version-file: ".node-version"
70-
registry-url: "https://npm.pkg.github.com"
71-
72-
- name: Publish
73-
working-directory: pkg
74-
run: npm publish
75-
env:
76-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77-
78-
publish-jsr:
79-
if: startsWith(github.ref, 'refs/tags/v')
80-
runs-on: ubuntu-latest
81-
needs: wasm-build
82-
permissions:
83-
contents: read
84-
id-token: write
85-
steps:
86-
- uses: actions/checkout@v6
87-
- uses: actions/setup-node@v6
88-
with:
89-
node-version-file: ".node-version"
90-
91-
- uses: actions/download-artifact@v7
92-
with:
93-
name: build
94-
path: pkg
95-
96-
- run: npx jsr publish --allow-dirty
97-
working-directory: pkg/
98-
99-
publish-github-release:
100-
if: startsWith(github.ref, 'refs/tags/v')
101-
runs-on: ubuntu-latest
102-
needs: wasm-build
103-
permissions:
104-
contents: write
105-
steps:
106-
- uses: actions/checkout@v6
107-
- uses: actions/download-artifact@v7
108-
with:
109-
name: build
110-
path: pkg
111-
112-
- name: Package
113-
working-directory: pkg
114-
run: npm pack
115-
116-
- name: Release
117-
uses: softprops/action-gh-release@v2
118-
with:
119-
files: |
120-
pkg/*.tgz
121-
pkg/*.wasm
14+
wasm-build:
15+
name: Wasm build
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v6
19+
- uses: taiki-e/install-action@v2
20+
with:
21+
tool: wasm-pack,just
22+
- name: Build wasm
23+
run: just build
24+
- name: Upload
25+
uses: actions/upload-artifact@v6
26+
with:
27+
name: build
28+
path: pkg
29+
30+
publish-npm:
31+
if: startsWith(github.ref, 'refs/tags/v')
32+
runs-on: ubuntu-latest
33+
needs: wasm-build
34+
permissions:
35+
id-token: write
36+
steps:
37+
- uses: actions/checkout@v6
38+
- uses: actions/setup-node@v6
39+
with:
40+
node-version-file: ".node-version"
41+
registry-url: "https://registry.npmjs.org"
42+
- uses: actions/download-artifact@v7
43+
with:
44+
name: build
45+
path: pkg/
46+
- name: Publish
47+
working-directory: pkg
48+
run: npm publish --provenance
49+
50+
publish-jsr:
51+
if: startsWith(github.ref, 'refs/tags/v')
52+
runs-on: ubuntu-latest
53+
permissions:
54+
contents: read
55+
id-token: write
56+
needs: wasm-build
57+
steps:
58+
- uses: actions/checkout@v6
59+
- uses: actions/setup-node@v6
60+
with:
61+
node-version-file: ".node-version"
62+
- uses: actions/download-artifact@v7
63+
with:
64+
name: build
65+
path: pkg/
66+
- name: Publish
67+
working-directory: pkg
68+
run: npx jsr publish --allow-dirty
69+
70+
publish-github:
71+
if: startsWith(github.ref, 'refs/tags/v')
72+
runs-on: ubuntu-latest
73+
needs: wasm-build
74+
permissions:
75+
packages: write
76+
steps:
77+
- uses: actions/checkout@v6
78+
- uses: actions/setup-node@v6
79+
with:
80+
node-version-file: ".node-version"
81+
registry-url: "https://npm.pkg.github.com"
82+
- uses: actions/download-artifact@v7
83+
with:
84+
name: build
85+
path: pkg/
86+
- name: Publish
87+
working-directory: pkg
88+
run: npm publish
89+
env:
90+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
92+
publish-github-release:
93+
if: startsWith(github.ref, 'refs/tags/v')
94+
runs-on: ubuntu-latest
95+
needs: wasm-build
96+
permissions:
97+
contents: write
98+
steps:
99+
- uses: actions/checkout@v6
100+
- uses: actions/download-artifact@v7
101+
with:
102+
name: build
103+
path: pkg/
104+
- name: Package
105+
working-directory: pkg
106+
run: npm pack
107+
- name: Release
108+
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87
109+
with:
110+
files: |
111+
pkg/*.tgz
112+
pkg/*.wasm

0 commit comments

Comments
 (0)