Skip to content

Commit

Permalink
reference grammare source in package
Browse files Browse the repository at this point in the history
  • Loading branch information
collin committed Apr 29, 2020
1 parent a6eb821 commit 0b1e5a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": ["dist/**/*"],
"files": ["./time-ranges.pegjs", "./dist/**/*"],
"scripts": {
"test": "npm run build && node dist/test.js",
"test:watch": "nodemon --watch tsconfig.json --watch index.ts --watch parser.ts --watch time-ranges.pegjs --exec \"npm run test\"",
Expand Down
4 changes: 3 additions & 1 deletion parser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import fs from "fs";
import path from "path";
import peg from "pegjs";

const grammar = fs.readFileSync("./time-ranges.pegjs", "utf-8");
const grammarPath = path.resolve(__dirname, "..", "time-ranges.pegjs");
const grammar = fs.readFileSync(grammarPath, "utf-8");
export const parser = peg.generate(grammar);

0 comments on commit 0b1e5a9

Please sign in to comment.