Skip to content

Upgrade to peggy 4.x - #151

Merged
nene merged 14 commits into
masterfrom
peggy-4
Nov 27, 2026
Merged

nene merged 14 commits into
masterfrom
peggy-4

Conversation

@nene

@nene nene commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Bunch of changes to make things work with Peggy 4.x.

Two major changes:

  • ts-pegjs no more works with Peggy, so this has been dropped. Instead Peggy now outputs its own .d.ts file.
  • Generation now happens using command line and peggy config file, not with a special script. For this to work, I also needed to setup compilation of Peggy plugins from .ts to .js.

nene added 14 commits November 27, 2026 11:30
We'll toggle this plugin by either including it or not.
Not by passing a flag to it.
tsc will compile src/parser.js into CommonJS in lib/,
the same way it handles the .ts files.

Both build and ts-jest will use this config.
Otherwise tsc writes its own lib/parser.d.ts
The code is now all JavaScript and the types no more make sense.
Also tweak expandFound() function to adopt to the change in the SyntaxError.found field type.
Also ignore the peggy-config[.fast].mjs files
The plain ts-jest preset doesn't transform .js files.
@nene
nene merged commit f9d5095 into master Nov 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant