|
82 | 82 | "pretty": "prettier --write .",
|
83 | 83 | "pretty:check": "prettier --check .",
|
84 | 84 | "fix": "yarn pretty && eslint --fix .",
|
85 |
| - "test": "jest", |
| 85 | + "test": "yarn grammar && jest", |
86 | 86 | "test:watch": "yarn test -- --watch",
|
87 | 87 | "check": "yarn ts:check && yarn pretty:check && yarn lint && yarn test",
|
88 |
| - "prepare": "yarn clean && yarn fix && yarn check && yarn build", |
| 88 | + "prepare": "yarn clean && yarn grammar && yarn fix && yarn check && yarn build", |
89 | 89 | "pre-commit": "npm-run-all --parallel ts:changes lint:changes",
|
| 90 | + "grammar": "nearleyc src/parser/grammar.ne -o src/parser/grammar.ts", |
90 | 91 | "build:babel": "babel src --out-dir lib --extensions .ts --source-maps",
|
91 | 92 | "build:types": "ttsc --module commonjs --emitDeclarationOnly --isolatedModules",
|
92 | 93 | "build:minified": "webpack --config webpack.prod.js",
|
93 |
| - "build": "npm-run-all --parallel build:babel build:types build:minified", |
| 94 | + "build": "yarn grammar && npm-run-all --parallel build:babel build:types build:minified", |
94 | 95 | "release": "release-it"
|
95 | 96 | },
|
96 | 97 | "repository": {
|
|
101 | 102 | "url": "https://github.com/sql-formatter-org/sql-formatter/issues"
|
102 | 103 | },
|
103 | 104 | "dependencies": {
|
104 |
| - "argparse": "^2.0.1" |
| 105 | + "argparse": "^2.0.1", |
| 106 | + "nearley": "^2.20.1" |
105 | 107 | },
|
106 | 108 | "devDependencies": {
|
107 | 109 | "@babel/cli": "^7.10.4",
|
|
112 | 114 | "@jest/globals": "^28.1.2",
|
113 | 115 | "@types/babel__core": "^7.1.15",
|
114 | 116 | "@types/jest": "^28.1.4",
|
| 117 | + "@types/nearley": "^2.11.2", |
115 | 118 | "@typescript-eslint/eslint-plugin": "^5.21.0",
|
116 | 119 | "@typescript-eslint/parser": "^5.21.0",
|
117 | 120 | "@zerollup/ts-transform-paths": "^1.7.18",
|
|
0 commit comments