Skip to content

Commit

Permalink
Merge pull request #17 from ShaderFrog/esm-2
Browse files Browse the repository at this point in the history
Generating esm version of parser
  • Loading branch information
AndrewRayCode authored Apr 4, 2024
2 parents bcddd7d + 32c2726 commit 225de02
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 225de02

Please sign in to comment.