Skip to content

Commit

Permalink
feat(*): add basic WASM support (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickersoft authored Jan 12, 2024
1 parent 82538a0 commit 8df4e85
Show file tree
Hide file tree
Showing 51 changed files with 17,700 additions and 3,746 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,16 @@ jobs:
HOMEBREW_GH_TOKEN: ${{ secrets.HOMEBREW_GH_TOKEN }}
with:
args: release --clean
- name: Publish to NPM
- name: Publish Node library to NPM
if: steps.release.outputs.js--release_created
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: just js publish
- name: Publish WASM library to NPM
if: steps.release.outputs.wasm--release_created
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: just wasm publish
- name: Publish to Pypi
if: steps.release.outputs.python--release_created
env:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ jobs:
- name: Run tests
env:
POETRY_VIRTUALENVS_IN_PROJECT: true
<<<<<<< HEAD
run: just test
=======
run: just test
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: code
path: /home/runner/work/odict
path: /home/runner/work/odict
>>>>>>> main
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -750,3 +750,9 @@ TSWLatexianTemp*

# glossaries
*.glstex

# WASM files
*.wasm

# WASM preview
.preview
1 change: 0 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ java adoptopenjdk-17.0.9+9
nodejs 20.11.0
just 1.22.1
flatc 23.3.3
pnpm 8.14.1
goreleaser 1.21.1
make 4.4.1
2 changes: 1 addition & 1 deletion cli/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func merge(c *cli.Context) error {
return err
}

core.WriteDictionaryFromExisting(outputFile, result)
core.WriteDictionaryToDisk(outputFile, result)

return nil
})
Expand Down
1 change: 1 addition & 0 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ use (
./lib/test
./lib/types
./lib/utils
./wasm
./xsd
)
230 changes: 9 additions & 221 deletions go.work.sum

Large diffs are not rendered by default.

27 changes: 11 additions & 16 deletions js/justfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
@install:
pnpm install
npm install

@add +args:
pnpm add {{args}}
npm install {{args}}

@clean:
rm -rf coverage dist
rm -rf coverage dist ../**/*.odict ../**/*.log

[private]
@dlx +args:
./node_modules/.bin/{{args}}

@schema:
flatc --ts -o ./src/__generated__ ../flatbuffers/service.fbs ../flatbuffers/enums.fbs

@check +args="":
just dlx rome check {{args}} .
npx biome check {{args}} .

@format +args="":
just dlx rome format {{args}} .
npx biome format {{args}} .

@build: install
just dlx swc -d dist ./src/*.ts ./src/**/*.ts & \
just dlx tsc
npx swc -d dist ./src/*.ts ./src/**/*.ts & \
npx tsc

@test +args="": install
rm -rf *.log
@test +args="": install && clean
just ../build
just dlx tsc
RUNTIME_ENV=test just dlx jest {{args}}
npx tsc
RUNTIME_ENV=test npx jest {{args}}

@publish: build
pnpm publish
npm publish
Loading

0 comments on commit 8df4e85

Please sign in to comment.