Skip to content

Commit

Permalink
Merge pull request #528 from peggyjs/main
Browse files Browse the repository at this point in the history
Merge main onto stable
  • Loading branch information
hildjj authored Jun 19, 2024
2 parents 4c765d8 + ff7ec97 commit 6d40d5c
Show file tree
Hide file tree
Showing 48 changed files with 8,632 additions and 2,224 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@ jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Use Node.js 16.x
uses: actions/setup-node@v3
- name: Enable pnpm
run: "corepack enable"
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: npm
node-version: 22.x
cache: pnpm
- name: Install dependencies
run: "cd docs && npm ci"
working-directory: docs
run: "pnpm i --frozen-lockfile"
- name: Build
run: "cd docs && npm run build"
working-directory: docs
run: "npm run build"
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,27 @@ jobs:

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

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

steps:
- uses: actions/checkout@v4
- name: Install pnpm
run: corepack enable
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache: pnpm
- name: Install dependencies
run: npm install
run: pnpm install
- name: Check coding standards
if: matrix.node-version == '21.x' && matrix.os == 'ubuntu-latest'
if: matrix.node-version == '22.x' && matrix.os == 'ubuntu-latest'
run: npm run lint
- name: Static analysis - check types
if: matrix.node-version == '21.x' && matrix.os == 'ubuntu-latest'
if: matrix.node-version == '22.x' && matrix.os == 'ubuntu-latest'
run: npm run ts
- name: Test
run: npm run test
47 changes: 47 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Playwright Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm
- name: Install dependencies
run: pnpm i -r
- name: build
run: npm run build
- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --parseable | tail -1)" >> $GITHUB_ENV
working-directory: web-test
- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- run: npx playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: web-test
- run: npx playwright install-deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
working-directory: web-test
- name: Run Playwright tests
run: npm run test
working-directory: web-test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: web/playwright-report/
retention-days: 30
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
.nyc_output
.vscode/
*.map
browser/
build/
coverage/
docs/_site
examples/*.js
node_modules/
pnpm-lock.yaml
yarn.lock
.nyc_output
*.map
docs/_site
.vscode/
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ 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/)
Steven Spungin <steven@spungin.tv> (https://github.com/flamenco/)
XenoS (https://github.com/XenoS-ITA)
Samuel Bronson (https://github.com/SamB)
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,35 @@ Change Log

This file documents all notable changes to Peggy.

4.0.3
-----

Released: 2024-06-19

### New features

- [#509](https://github.com/peggyjs/peggy/pull/509) Add and implement ES6 export button

### Bug fixes

- [#493](https://github.com/peggyjs/peggy/issues/493) Allow use of an empty
array, null, or undefined as allowedStartRules option
- [#505](https://github.com/peggyjs/peggy/pull/505) Fix vscode-eslint settings
to work with eslint flat config
- [#507](https://github.com/peggyjs/peggy/pull/507) Remove stray semicolon in CSS
- [#508](https://github.com/peggyjs/peggy/pull/508) Fix broken text input in
web version
- [#512](https://github.com/peggyjs/peggy/issues/512) Add "StartRules" to peg.d.ts
- [#513](https://github.com/peggyjs/peggy/issues/513) Allow whitespace between
plucked word and its pattern.
- [#520](https://github.com/peggyjs/peggy/issues/520) Grammar with token "constructor" fails to generate
- [#522](https://github.com/peggyjs/peggy/issues/522) Switched from puppeteer
to playwright for web tests, and added them to CI.

### Documentation

- [#506](https://github.com/peggyjs/peggy/pull/506) Added END OF INPUT (`!.`).

4.0.2
-----

Expand Down
11 changes: 7 additions & 4 deletions docs/css/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}
#content .message.disabled { color: gray; background-color: #f0f0f0; }

#content table.online { table-layout: fixed; };
#content table.online { table-layout: fixed; }

#content table.form { width: 100%; }
#content table.form td, table.form th { padding: .5em 1em; }
Expand Down Expand Up @@ -139,7 +139,7 @@
#content #settings label { padding-right: 1em; }
#content #parser-var { width: 15em; }
#content #options { padding-top: 1em; }
#content #parser-download {
#content .download-button {
float: right;
width: 10em;
margin-top: 2em;
Expand All @@ -151,8 +151,11 @@
text-align: center; text-decoration: none;
color: #e0ffe0; background-color: #499149;
}
#content #parser-download:hover { background-color: #006000; }
#content #parser-download.disabled { color: #e0e0e0; background-color: gray; }
#content .download-button:not(:first-of-type) {
margin-right: .5rem;
}
#content .download-button:hover { background-color: #006000; }
#content .download-button.disabled { color: #e0e0e0; background-color: gray; }


#output {
Expand Down
17 changes: 12 additions & 5 deletions docs/development/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,26 @@
title: 'Test'
permalink: "/development/test.html"
layout: main-layout
stylesheets: ["https://cdnjs.cloudflare.com/ajax/libs/mocha/8.3.2/mocha.css"]
stylesheets: ["https://cdnjs.cloudflare.com/ajax/libs/mocha/10.4.0/mocha.css"]
scripts:
[
"https://cdnjs.cloudflare.com/ajax/libs/mocha/8.3.2/mocha.min.js",
"https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.4/chai.min.js",
"https://cdnjs.cloudflare.com/ajax/libs/mocha/10.4.0/mocha.min.js",
"https://cdnjs.cloudflare.com/ajax/libs/chai/4.4.1/chai.min.js",
]
---

<script>
// Modern browsers don't need whatwgURL.
// source-map looks for it with this name, as configured in rollup.config.mjs
window.whatwgURL = { URL };
mocha.setup('bdd');
mocha.setup({
ui: "bdd",
global: [
"TextEncoder", // Not really a leak, we put it back after deleting
"peggyVersion", // Intentional
],
});
mocha.checkLeaks();
</script>
<script src='../js/test-bundle.min.js'></script>
<style>
Expand All @@ -30,7 +37,7 @@
mocha.run(failures => {
const result = failures === 0 ? 'PASS' : 'FAIL';
// If you change the next line, please modifiy the regexp in web-test/index.js
const status = result + ': ' + failures + ' failures. Peggy Version: ' + browser.peggyVersion()
const status = result + ': ' + failures + ' failures. Peggy Version: ' + globalThis.peggyVersion;
console.log(status);
const div = document.getElementById('results');
div.innerHTML = status;
Expand Down
34 changes: 34 additions & 0 deletions docs/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,40 @@ <h3 id="grammar-syntax-and-semantics-parsing-expression-types">Parsing Expressio
</div>
</dd>

<dt><code>!.</code> (END OF INPUT)</dt>

<dd>
<p>Match END OF INPUT. This <em>Bang Dot</em> sequence
will specify that the end of input should be matched.
<code>"f" !.</code> will test for end of input
after the character "f".</p>
<div class="example">
<div>
<div><em>Example:</em> <code>no_input = !.</code></div>
<div><em>Matches:</em> <code>""</code></div>
<div><em>Does not match:</em> <code>"f"</code></div>
</div>
<div class="try">
<em>Try it:</em>
<input type="text" value="" class="exampleInput" name="no_input">
<div class="result"></div>
</div>
</div>

<div class="example">
<div>
<div><em>Example:</em> <code>end_of_input = "f" !.</code></div>
<div><em>Matches:</em> <code>"f[EOI]"</code></div>
<div><em>Does not match:</em> <code>"f [EOI]"</code>, <code>""</code></div>
</div>
<div class="try">
<em>Try it:</em>
<input type="text" value="f" class="exampleInput" name="end_of_input">
<div class="result"></div>
</div>
</div>
</dd>

<dt><code>[<em>characters</em>]</code></dt>

<dd>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="label">Download browser version</div>
<span id="download">
<a title="Download a minified version of Peggy for the browser"
href="https://unpkg.com/peggy@4.0.2/browser/peggy.min.js">minified</a>
href="https://unpkg.com/peggy@4.0.3/browser/peggy.min.js">minified</a>
</span>
<iframe id="discord"
src="https://discordapp.com/widget?id=985995982909100082&theme=dark"
Expand Down
4 changes: 2 additions & 2 deletions docs/js/benchmark-bundle.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 6d40d5c

Please sign in to comment.