Skip to content

Commit 08991bb

Browse files
committed
wasm: Update build, bump version number
1 parent dbacb88 commit 08991bb

5 files changed

Lines changed: 15 additions & 3 deletions

File tree

packages/wasm/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SRC_JS_FILES := $(wildcard src/*.js)
44
SRC_TS_FILES := $(wildcard src/*.ts)
55

66
.PHONY: all
7-
all: dist/index.js dist/cli.js check
7+
all: dist/index.js dist/index.d.ts dist/cli.js check
88

99
.PHONY: clean
1010
clean:
@@ -26,7 +26,10 @@ build/%.O3.wasm: build/%.wasm
2626
wasm-opt -O3 --enable-bulk-memory-opt -o $@ $<
2727

2828
dist/index.js: build/ohmRuntime.wasm_sections.ts $(SRC_JS_FILES) $(SRC_TS_FILES)
29-
pnpm esbuild index.ts --bundle --loader:.ts=ts --outfile=dist/index.js --format=esm --platform=node --external:ohm-js
29+
pnpm esbuild index.js --bundle --loader:.ts=ts --outfile=dist/index.js --format=esm --platform=node --external:ohm-js
30+
31+
dist/index.d.ts:
32+
cp index.d.ts dist/index.d.ts
3033

3134
dist/cli.js: dist/index.js src/cli.js
3235
pnpm esbuild src/cli.js --bundle --loader:.ts=ts --outfile=dist/cli.js --format=esm --platform=node --external:ohm-js --external:./index.js --banner:js="#!/usr/bin/env node"

packages/wasm/index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type {Grammar} from 'ohm-js';
2+
3+
export class Compiler {
4+
grammar: Grammar;
5+
6+
constructor(grammar: Grammar);
7+
compile(): Uint8Array<ArrayBuffer>;
8+
}

packages/wasm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ohm-js/wasm",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "Compile Ohm.js grammars to WebAsssembly",
55
"main": "dist/index.js",
66
"bin": {

packages/wasm/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "dist",
5+
"noEmit": true,
56

67
// From the totaltypescript "Building for a Library in a Monorepo"
78
// recommendation. See tsconfig.base.json for details.

0 commit comments

Comments
 (0)