Skip to content

Commit

Permalink
Merge pull request #58 from hildjj/update-coverage
Browse files Browse the repository at this point in the history
Add coverage, clean up som old cruft.
  • Loading branch information
hildjj authored May 21, 2024
2 parents 79262c0 + d4a4f14 commit a03e7b1
Show file tree
Hide file tree
Showing 16 changed files with 1,224 additions and 579 deletions.
3 changes: 2 additions & 1 deletion .c8rc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"exclude": [
"**/test/**",
"**/node_modules/**",
"ava.config.cjs"
"ava.config.cjs",
"package.js"
]
}
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
npm run types
git diff --quiet --exit-code --cached
- name: Test ${{ matrix.node-version }}
run: npm run coverage
run: npm run test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 4 additions & 0 deletions .ncurc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"dep": ["prod", "dev", "packageManager"],
"reject": ["eslint", "eslint-plugin-ava"]
}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ CHANGELOG.md
vscode/
eslint.config.js
.c8rc
.ncurc
21 changes: 0 additions & 21 deletions .waiting.html

This file was deleted.

4 changes: 3 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ export default [
{
ignores: [
'lib/grammar.js',
'*.min.js',
'vscode/out/**',
'vscode/dist/**',
'**/*.d.ts',
'**/*.min.js',
'node_modules/**',
'vscode/.vscode-test/**',
],
},
...base,
Expand Down
83 changes: 40 additions & 43 deletions lib/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ function peg$parse(input, options) {
var peg$e42 = peg$literalExpectation("\n", false);

var peg$f0 = function() { diag.compute(); return diag; };
var peg$f1 = function(p) { diag.setTitle(p); };
var peg$f1 = function(p) {
diag.setTitle(p);
};
var peg$f2 = function(q, w) {
diag.parts.add(w, q);
};
Expand Down Expand Up @@ -500,60 +502,61 @@ function peg$parse(input, options) {
}

function peg$parsestart() {
var s0, s1, s2, s3, s4, s5, s6;
var s0, s1, s2, s3, s4, s5;

s0 = peg$currPos;
s1 = peg$parse_();
s2 = [];
s3 = peg$parseact_comment();
while (s3 !== peg$FAILED) {
s2.push(s3);
s1 = [];
s2 = peg$parseact_comment();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$currPos;
s3 = peg$currPos;
s4 = peg$currPos;
s5 = peg$parseeol();
if (s5 !== peg$FAILED) {
s6 = peg$parse_();
s5 = [s5, s6];
s4 = s5;
s4 = peg$parseeol();
if (s4 !== peg$FAILED) {
s5 = peg$parse_();
s4 = [s4, s5];
s3 = s4;
} else {
peg$currPos = s4;
s4 = peg$FAILED;
peg$currPos = s3;
s3 = peg$FAILED;
}
if (s4 !== peg$FAILED) {
s4 = peg$parseact_comment();
if (s4 === peg$FAILED) {
peg$currPos = s3;
s3 = peg$FAILED;
} else {
s3 = s4;
}
if (s3 !== peg$FAILED) {
s3 = peg$parseact_comment();
s2 = s3;
} else {
s3 = s4;
s2 = s3;
}
}
peg$savedPos = s0;
s0 = peg$f0();
s1 = peg$f0();
s0 = s1;

return s0;
}

function peg$parseact_comment() {
var s0, s1, s2, s3;
var s0, s1, s2, s3, s4, s5;

s0 = peg$currPos;
s1 = peg$parseaction();
if (s1 !== peg$FAILED) {
s2 = peg$parse_();
s3 = peg$parsecomment();
if (s3 === peg$FAILED) {
s3 = null;
}
s1 = [s1, s2, s3];
s0 = s1;
s1 = peg$parse_();
s2 = peg$parseaction();
if (s2 === peg$FAILED) {
s2 = null;
}
s3 = peg$currPos;
s4 = peg$parse_();
s5 = peg$parsecomment();
if (s5 !== peg$FAILED) {
s4 = [s4, s5];
s3 = s4;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
peg$currPos = s3;
s3 = peg$FAILED;
}
if (s3 === peg$FAILED) {
s3 = null;
}
s0 = s2;

return s0;
}
Expand All @@ -580,12 +583,6 @@ function peg$parse(input, options) {
s0 = peg$parseend();
if (s0 === peg$FAILED) {
s0 = peg$parsesend();
if (s0 === peg$FAILED) {
s0 = peg$parsecomment();
if (s0 === peg$FAILED) {
s0 = peg$parse_();
}
}
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions lib/grammar.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
}

start
= _ act_comment|.., eol _| { diag.compute(); return diag; }
= act_comment|.., eol _| { diag.compute(); return diag; }

act_comment
= action _ comment?
= _ @action? (_ comment)?

action
= title
Expand All @@ -23,11 +23,11 @@ action
/ simple_block
/ end
/ send
/ comment
/ _

title
= "title" WS p:to_the_end { diag.setTitle(p); }
= "title" WS p:to_the_end {
diag.setTitle(p);
}

participant
= "participant" WS q:qphrase WS "as" WS w:word {
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
"bugs": "https://github.com/hildjj/quence/issues",
"scripts": {
"lint": "eslint .",
"test": "ava",
"test": "c8 ava",
"snaps": "ava --update-snapshots",
"coverage": "c8 npm test",
"build": "peggy --format es lib/grammar.pegjs",
"release": "npm version patch && git push --follow-tags && npm publish",
"types": "tsc",
Expand Down Expand Up @@ -50,26 +49,27 @@
}
],
"dependencies": {
"commander": "12.0.0",
"commander": "12.1.0",
"pdfkit": "^0.15.0",
"xmlbuilder2": "3.1.1"
},
"devDependencies": {
"@cto.af/eslint-config": "^4.0.2",
"@types/node": "20.12.10",
"@peggyjs/coverage": "1.2.0",
"@types/node": "20.12.12",
"@types/pdfkit": "0.13.4",
"ava": "^6.1.3",
"c8": "^9.1.0",
"eslint": "^8.57.0",
"eslint-plugin-ava": "^14.0.0",
"eslint-plugin-node": "^11.1.0",
"execa": "^8.0.1",
"execa": "^9.1.0",
"package-extract": "^1.0.3",
"peggy": "^4.0.2",
"typescript": "^5.4.5",
"typescript-eslint": "7.8.0"
"typescript-eslint": "7.10.0"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=18"
}
Expand Down
Loading

0 comments on commit a03e7b1

Please sign in to comment.