Skip to content

Commit

Permalink
Merge branch 'main' into stable
Browse files Browse the repository at this point in the history
* main: (107 commits)
  Version update.  Check npmignore.  Audit CHANGELOG.md.
  4.0.0
  Update dependencies final time before release.
  Fix indentation in one part of examples/javascript.pegjs.  Fixes peggyjs#445.
  Code review issues
  Add developer docs.  Fixes peggyjs#466.
  Add directories when they don't exist, rather than throwing an error.  Fixes peggyjs#440.
  Update changelog.  Include peggyjs#463 as well.
  Fix peggyjs#379.  Move reportInfiniteRecursion to prepare phase, ensure that it doesn't keep going when it finds an error.
  Typo: 'rutimes'
  Mark IE as explicitly unsupported
  Switch to flat eslint config.  Lint minified output for web compat.
  Code review nits
  Add tests, fix up fromMem to not need gross hack.
  Adds support for running tests against es module output.  Fixes peggyjs#399.
  Slight wording tweak.  Double-checked that peggyjs#415 is fixed.
  Fixes peggyjs#434
  Update bundles as well
  Fixes peggyjs#450
  Update dependencies, including new lint rules.  Move to simpler tsconfig so that eslint can easily find the correct file.  Fix small lint issues with new rules.
  ...
  • Loading branch information
hildjj committed Feb 13, 2024
2 parents e25ec1b + 9449913 commit c8e31fb
Show file tree
Hide file tree
Showing 100 changed files with 10,003 additions and 3,996 deletions.
37 changes: 0 additions & 37 deletions .eslintrc.js

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Tests
on:
push:
branches:
- '*'
- main
pull_request:
branches: ['*']

Expand All @@ -12,25 +12,25 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 19.x]
node-version: [18.x, 20.x, 21.x]
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm install
- name: Check coding standards
if: matrix.node-version == '19.x' && matrix.os == 'ubuntu-latest'
if: matrix.node-version == '21.x' && matrix.os == 'ubuntu-latest'
run: npm run lint
- name: Static analysis - check types
if: matrix.node-version == '19.x' && matrix.os == 'ubuntu-latest'
if: matrix.node-version == '21.x' && matrix.os == 'ubuntu-latest'
run: npm run ts
- name: Test
run: npm run test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ yarn.lock
.nyc_output
*.map
docs/_site
.vscode/
8 changes: 8 additions & 0 deletions .ncurc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"use strict";

module.exports = {
"reject": [
"chai", // Moved to es6
"@types/chai", // Should match chai
],
};
7 changes: 6 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,27 @@
.eslintrc.js
.gitattributes
.github
.ncurc.cjs
.nyc_output
.vscode/
*.map
benchmark
bin/*.mjs
build/
CHANGELOG.md
CONTRIBUTING.md
coverage/
docs
eslint.config.js
examples
jest.config.js
lib/.eslintrc.json
peggy.code-workspace
pnpm-lock.yaml
rollup.config.mjs
src
test
tools
tsconfig.json
tsconfig*.json
web-test/
yarn.lock
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ fatfisz <fatfisz@gmail.com> (https://github.com/fatfisz/)
fpirsch <fpirsch@free.fr> (https://github.com/fpirsch/)
markw65 <mark@replayroutes.com> (https://github.com/markw65/)
Andy (https://github.com/AndrewRayCode)
Kristian Dupont <kristian@kristiandupont.com> (https://github.com/kristiandupont/)
Lumi Pakkanen <lumi.pakkanen@gmail.com> (https://github.com/frostburn/)
75 changes: 73 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,79 @@ Change Log

This file documents all notable changes to Peggy.

4.0.0
-----

Released: 2024-02-13

### Major Changes

- [#379](https://github.com/peggyjs/peggy/issues/379) Fix infinite recursion
issue by moving reportInfiniteRecursion to the new prepare pass, and having
it fail after finding the first issue. This will require plugin authors
to ensure that reportInfiniteRecursion is in the new pass correctly.
- [#417](https://github.com/peggyjs/peggy/pull/417) BREAKING: change to AST to
allow topLevelInitializer and initializer to be arrays, in support of
multi-file inputs. This will require plugin updates. The CLI and API now
take multiple files as input, where the first file is your main library, and
subsequent files consist of a library of other rules. The CLI can take file
names of the form `npm:<package-name>/<filename>` to load library rules from
an NPM package that is installed relative to the previous non-npm file name,
or to the current working directory if this is the first file name.
- [#420](https://github.com/peggyjs/peggy/pull/420) BREAKING: Node v16+ is now
required for running the CLI or using Peggy as a library. Generated code
still targets older runtimes.
- [#456](https://github.com/peggyjs/peggy/pull/456) BREAKING: Allow imports
from external compiled grammars inside a source grammar, using `import
{rule} from "external.js"`. Note that this syntax will generate either
`import` or `require` in the JavaScript output, depending on the value of
the `format` parameter. This will need explicit support from
plugins, with a few new AST node types and a few visitor changes.
- [#463](https://github.com/peggyjs/peggy/issues/463) Drop support for
Internet Explorer. Move to eslint flat configs in order to lint minimized
browser code for compatibility with
`defaults, maintained node versions, not op_mini all`.

### Minor Changes

- [#400](https://github.com/peggyjs/peggy/pull/400) Use `@generated` in generated
code
- [#404](https://github.com/peggyjs/peggy/issues/404) Add support for -w/--watch
to the command line interface.
- [#415](https://github.com/peggyjs/peggy/issues/415) Added `browser` key to package.json, pointing to Webpack output.
- [#420](https://github.com/peggyjs/peggy/pull/420) Updated dependencies to
avoid audit warnings.
- [#425](https://github.com/peggyjs/peggy/pull/425) Add a pass to simplify single-character choices
- [#427](https://github.com/peggyjs/peggy/pull/427) Avoid double extraction of
substrings in various MATCH_ bytecodes
- [#430](https://github.com/peggyjs/peggy/pull/430) Make generate-js.js ts clean
- [#432](https://github.com/peggyjs/peggy/pull/432) Add peggy.code-workspace
- [#435](https://github.com/peggyjs/peggy/pull/435) Setup tsconfig to detect use of library functions from es6 or later
- [#436](https://github.com/peggyjs/peggy/pull/436) Get rid of tsd
- [#437](https://github.com/peggyjs/peggy/pull/437) Better type checking for visitor
- [#438](https://github.com/peggyjs/peggy/pull/438) Make test build deterministic
- [#439](https://github.com/peggyjs/peggy/pull/439) Make peg$computePosDetails a little faster
- [#440](https://github.com/peggyjs/peggy/issues/440) Create directories for
output and source-map if they do not exist, rather than erroring.
- [#446](https://github.com/peggyjs/peggy/pull/446) Add a right-associative `ExponentiationExpression` rule (operator `**`) to `javascript.pegjs` example grammar.
- [#451](https://github.com/peggyjs/peggy/pull/451) Make stack.js ts clean
- [#452](https://github.com/peggyjs/peggy/pull/452) Fixes to prepare generate-bytecode.js for ts-check
- [#453](https://github.com/peggyjs/peggy/pull/453) Make generate-bytecode.js ts-clean
- [#460](https://github.com/peggyjs/peggy/pull/453) Allow `-t` and `-T` testing
from the CLI with `--format es`.

### Bug Fixes

- [#405](https://github.com/peggyjs/peggy/pull/405) Doc example doesn't correspond to code example. From @hildjj
- [#415](https://github.com/peggyjs/peggy/issues/415) Make docs match reality with `import`.
- [#426](https://github.com/peggyjs/peggy/pull/426) Fix typo in XML example.
- [#434](https://github.com/peggyjs/peggy/issues/434) Fixed bad example in docs.
- [#445](https://github.com/peggyjs/peggy/issues/415) Fix indentation in `examples/javascript.pegjs`.
- [#450](https://github.com/peggyjs/peggy/issues/450) Fixed misleading documentation.
- [#466](https://github.com/peggyjs/peggy/issues/466) Add docs for developers.

3.0.2
----------
-----

Released: 2023-03-21

Expand All @@ -25,7 +96,7 @@ Released: 2023-03-21
- [#384](https://github.com/peggyjs/peggy/issues/384) Improve the error.format()
documentation. From @AndrewRayCode.
- [#386](https://github.com/peggyjs/peggy/issues/386) Ensure '*' as
allowed-start-rule is documented for CLI.
allowed-start-rule is documented for CLI. From @hildjj.

3.0.1
-----
Expand Down
22 changes: 14 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,26 @@ In the request, please describe:

## Contributing Code

Contribute code using [GitHub pull requests][pulls]. For non-trivial changes,
first file a corresponding bug report or feature request. This will ensure the
*problem* is separated from a *solution*.
Contribute code using [GitHub pull requests][pulls].

Split your change into atomic commits with descriptive messages adhering to
1. For non-trivial changes, first file a corresponding bug report or feature
request. This will ensure the *problem* is separated from a *solution*.

1. Split your change into atomic commits with descriptive messages adhering to
[these conventions][git-commit-messages]. Have a look in the commit history to
see good examples.

When appropriate, add documentation and tests.
1. When appropriate, add documentation and tests.

1. Before submitting, make sure your change passes the tests and lint checks
by running `npm run build`. If the build script produces output that git sees
as a change, please add that output file to your pull request.

Before submitting, make sure your change passes the tests (`npm test`) and
ESLint checks (`npm run lint`).
1. Ensure that your pull request contains an addition to the
[CHANGELOG.md](CHANGELOG.md) file.

Please add yourself to the AUTHORS file.
1. Please add yourself to the [AUTHORS](AUTHORS) file, or double-check that the
information there is still correct if you have contributed before.

[issues]: https://github.com/peggyjs/peggy/issues
[issues-search-bugs]: https://github.com/peggyjs/peggy/issues?q=is%3Aopen+is%3Aissue+label%3ABug
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,31 @@ Full documentation is available at [peggyjs.org](https://peggyjs.org/documentati

## Development

To get started, check out peggy, install the dependencies, and run build:

```bash
git clone https://github.com/peggyjs/peggy.git
cd peggy
npm install
(cd docs && npm install)
(cd web-test && npm install)
npm run build
npm run test:web
```

Please see the [Contribution Guidelines](CONTRIBUTING.md) for details on how
to contribute code.

## Links

- [Project website](https://peggyjs.org/)
- [Wiki](https://github.com/peggyjs/peggy/wiki)
- [Source code](https://github.com/peggyjs/peggy)
- [Issue tracker](https://github.com/peggyjs/peggy/issues)
- [Discussions](https://github.com/peggyjs/peggy/discussions)
- [Browser Benchmark Suite](https://peggyjs.org/development/benchmark.html)
- [Browser Test Suite](https://peggyjs.org/development/test.html)
- [Contribution Guidelines](CONTRIBUTING.md)
- [Discord Server](https://discord.gg/HU5tbEbwAB)

Peggy was originally developed by [David Majda](https://majda.cz/)
Expand Down
5 changes: 5 additions & 0 deletions benchmark/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "../tsconfig-base.json",
"include": ["**/*.js"],
"exclude": ["./vendor"],
}

0 comments on commit c8e31fb

Please sign in to comment.