From 32c27264846431b1aa2be76575b66a3eb168f2de Mon Sep 17 00:00:00 2001 From: Andrew Ray Date: Wed, 3 Apr 2024 19:57:37 -0700 Subject: [PATCH] Generating esm version of parser --- build.sh | 4 ++-- package.json | 2 +- src/parser/test-helpers.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index a8c68fa..80ddea8 100755 --- a/build.sh +++ b/build.sh @@ -8,10 +8,10 @@ mkdir -p dist # Compile the typescript project npx tsc -npx peggy --cache -o dist/parser/parser.js src/parser/glsl-grammar.pegjs +npx peggy --cache --format es -o dist/parser/parser.js src/parser/glsl-grammar.pegjs # Manualy copy in the type definitions cp src/parser/parser.d.ts dist/parser/ cp src/error.d.ts dist/ -npx peggy --cache -o dist/preprocessor/preprocessor-parser.js src/preprocessor/preprocessor-grammar.pegjs +npx peggy --cache --format es -o dist/preprocessor/preprocessor-parser.js src/preprocessor/preprocessor-grammar.pegjs cp src/preprocessor/preprocessor-parser.d.ts dist/preprocessor/preprocessor-parser.d.ts diff --git a/package.json b/package.json index 3f3f06c..c879067 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "engines": { "node": ">=16" }, - "version": "3.0.2", + "version": "3.0.3", "type": "module", "description": "A GLSL ES 1.0 and 3.0 parser and preprocessor that can preserve whitespace and comments", "scripts": { diff --git a/src/parser/test-helpers.ts b/src/parser/test-helpers.ts index 90cb8d3..a3e2309 100644 --- a/src/parser/test-helpers.ts +++ b/src/parser/test-helpers.ts @@ -24,7 +24,7 @@ type Context = { export const buildParser = () => { execSync( - 'npx peggy --cache -o src/parser/parser.js src/parser/glsl-grammar.pegjs' + 'npx peggy --cache --format es -o src/parser/parser.js src/parser/glsl-grammar.pegjs' ); const parser = require('./parser'); const parse = parser.parse as Parse;