diff --git a/package-lock.json b/package-lock.json index 8f8defe62..cd6054626 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,8 +7,10 @@ "": { "name": "websql-autocomplete", "version": "2.0.0", - "hasInstallScript": true, "license": "Apache-2.0", + "dependencies": { + "jison": "https://github.com/JohanAhlen/jison/tarball/ad8e41475e" + }, "devDependencies": { "@babel/preset-env": "7.14.4", "@babel/preset-typescript": "^7.21.5", @@ -3280,6 +3282,15 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", + "optional": true, + "engines": { + "node": ">=0.4.2" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -3733,6 +3744,17 @@ "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", "dev": true }, + "node_modules/cjson": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/cjson/-/cjson-0.3.0.tgz", + "integrity": "sha512-bBRQcCIHzI1IVH59fR0bwGrFmi3Btb/JNwM/n401i1DnYgWndpsUBiQRAddLflkZage20A2d25OAWZZk0vBRlA==", + "dependencies": { + "jsonlint": "1.6.0" + }, + "engines": { + "node": ">= 0.3.0" + } + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -3778,6 +3800,14 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "node_modules/colors": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz", + "integrity": "sha512-XjsuUwpDeY98+yz959OlUK6m7mLBM+1MEG5oaenfuQnNnrQk1WvtcvFgN3FNDP3f2NmZ211t0mNEfSEN1h0eIg==", + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/compare-func": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", @@ -4046,6 +4076,11 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, + "node_modules/ebnf-parser": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/ebnf-parser/-/ebnf-parser-0.1.10.tgz", + "integrity": "sha512-urvSxVQ6XJcoTpc+/x2pWhhuOX4aljCNQpwzw+ifZvV1andZkAmiJc3Rq1oGEAQmcjiLceyMXOy1l8ms8qs2fQ==" + }, "node_modules/electron-to-chromium": { "version": "1.4.413", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.413.tgz", @@ -4097,6 +4132,58 @@ "node": ">=0.8.0" } }, + "node_modules/escodegen": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.3.3.tgz", + "integrity": "sha512-z9FWgKc48wjMlpzF5ymKS1AF8OIgnKLp9VyN7KbdtyrP/9lndwUFqCtMm+TAJmJf7KJFFYc4cFJfVTTGkKEwsA==", + "dependencies": { + "esprima": "~1.1.1", + "estraverse": "~1.5.0", + "esutils": "~1.0.0" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=0.10.0" + }, + "optionalDependencies": { + "source-map": "~0.1.33" + } + }, + "node_modules/escodegen/node_modules/esprima": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.1.1.tgz", + "integrity": "sha512-qxxB994/7NtERxgXdFgLHIs9M6bhLXc6qtUmWZ3L8+gTQ9qaoyki2887P2IqAYsoENyr8SUbTutStDniOHSDHg==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/escodegen/node_modules/esutils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz", + "integrity": "sha512-x/iYH53X3quDwfHRz4y8rn4XcEwwCJeWsul9pF1zldMbGtgOtMNBEOuYWwB1EQlK2LRa1fev3YAgym/RElp5Cg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/escodegen/node_modules/source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha512-VtCvB9SIQhk3aF6h+N85EaqIaBFIAfZ9Cu+NJHHVvc8BbEcnvDcFw6sqQ2dQrT6SlOrZq3tIvyD9+EGq/lJryQ==", + "optional": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -4110,6 +4197,14 @@ "node": ">=4" } }, + "node_modules/estraverse": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz", + "integrity": "sha512-FpCjJDfmo3vsc/1zKSeqR5k42tcIhxFIlvq+h9j0fO2q/h2uLKyweq7rYJ+0CoVvrGQOxIS5wyBrW/+vF58BUQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -6352,6 +6447,55 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/jison": { + "version": "0.4.17", + "resolved": "https://github.com/JohanAhlen/jison/tarball/ad8e41475e", + "integrity": "sha512-kKqzzhj1GaVw5vTDQWV3pvKjJS9v5fheDNyN8h3CLj3mHZhbcw2Kb8iT+wPlpCJhbZ3HIxoVJFbmwg7z+ZvGrg==", + "license": "MIT", + "dependencies": { + "cjson": "0.3.0", + "ebnf-parser": "0.1.10", + "escodegen": "1.3.x", + "esprima": "1.1.x", + "jison-lex": "0.3.x", + "JSONSelect": "0.4.0", + "lex-parser": "~0.1.3", + "nomnom": "1.5.2" + }, + "bin": { + "jison": "lib/cli.js" + }, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/jison-lex": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/jison-lex/-/jison-lex-0.3.4.tgz", + "integrity": "sha512-EBh5wrXhls1cUwROd5DcDHR1sG7CdsCFSqY1027+YA1RGxz+BX2TDLAhdsQf40YEtFDGoiO0Qm8PpnBl2EzDJw==", + "dependencies": { + "lex-parser": "0.1.x", + "nomnom": "1.5.2" + }, + "bin": { + "jison-lex": "cli.js" + }, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/jison/node_modules/esprima": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.1.1.tgz", + "integrity": "sha512-qxxB994/7NtERxgXdFgLHIs9M6bhLXc6qtUmWZ3L8+gTQ9qaoyki2887P2IqAYsoENyr8SUbTutStDniOHSDHg==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -6419,6 +6563,21 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonlint": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/jsonlint/-/jsonlint-1.6.0.tgz", + "integrity": "sha512-x6YLBe6NjdpmIeiklwQOxsZuYj/SOWkT33GlTpaG1UdFGjdWjPcxJ1CWZAX3wA7tarz8E2YHF6KiW5HTapPlXw==", + "dependencies": { + "JSV": ">= 4.0.x", + "nomnom": ">= 1.5.x" + }, + "bin": { + "jsonlint": "lib/cli.js" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", @@ -6428,6 +6587,14 @@ "node >= 0.2.0" ] }, + "node_modules/JSONSelect": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/JSONSelect/-/JSONSelect-0.4.0.tgz", + "integrity": "sha512-VRLR3Su35MH+XV2lrvh9O7qWoug/TUyj9tLDjn9rtpUCNnILLrHjgd/tB0KrhugCxUpj3UqoLqfYb3fLJdIQQQ==", + "engines": { + "node": ">=0.4.7" + } + }, "node_modules/JSONStream": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", @@ -6444,6 +6611,14 @@ "node": "*" } }, + "node_modules/JSV": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", + "integrity": "sha512-ZJ6wx9xaKJ3yFUhq5/sk82PJMuUyLk277I8mQeyDgCTjGdjWJIvPfaU5LIXaMuaN2UO1X3kZH4+lgphublZUHw==", + "engines": { + "node": "*" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -6471,6 +6646,11 @@ "node": ">=6" } }, + "node_modules/lex-parser": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/lex-parser/-/lex-parser-0.1.4.tgz", + "integrity": "sha512-DuAEISsr1H4LOpmFLkyMc8YStiRWZCO8hMsoXAXSbgyfvs2WQhSt0+/FBv3ZU/JBFZMGcE+FWzEBSzwUU7U27w==" + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -6778,6 +6958,19 @@ "integrity": "sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==", "dev": true }, + "node_modules/nomnom": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.5.2.tgz", + "integrity": "sha512-fiVbT7BqxiQqjlR9U3FDGOSERFCKoXVCdxV2FwZuNN7/cmJ42iQx35nUFOAFDcyvemu9Adp+IlsCGlKQYLmBKw==", + "deprecated": "Package no longer supported. Contact support@npmjs.com for more info.", + "dependencies": { + "colors": "0.5.x", + "underscore": "1.1.x" + }, + "engines": { + "node": "*" + } + }, "node_modules/normalize-package-data": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", @@ -7935,6 +8128,14 @@ "node": ">=14.17" } }, + "node_modules/underscore": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.1.7.tgz", + "integrity": "sha512-w4QtCHoLBXw1mjofIDoMyexaEdWGMedWNDhlWTtT1V1lCRqi65Pnoygkh6+WRdr+Bm8ldkBNkNeCsXGMlQS9HQ==", + "engines": { + "node": "*" + } + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -10667,6 +10868,12 @@ "uri-js": "^4.2.2" } }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", + "optional": true + }, "ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -10989,6 +11196,14 @@ "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", "dev": true }, + "cjson": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/cjson/-/cjson-0.3.0.tgz", + "integrity": "sha512-bBRQcCIHzI1IVH59fR0bwGrFmi3Btb/JNwM/n401i1DnYgWndpsUBiQRAddLflkZage20A2d25OAWZZk0vBRlA==", + "requires": { + "jsonlint": "1.6.0" + } + }, "cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -11027,6 +11242,11 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "colors": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz", + "integrity": "sha512-XjsuUwpDeY98+yz959OlUK6m7mLBM+1MEG5oaenfuQnNnrQk1WvtcvFgN3FNDP3f2NmZ211t0mNEfSEN1h0eIg==" + }, "compare-func": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", @@ -11227,6 +11447,11 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, + "ebnf-parser": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/ebnf-parser/-/ebnf-parser-0.1.10.tgz", + "integrity": "sha512-urvSxVQ6XJcoTpc+/x2pWhhuOX4aljCNQpwzw+ifZvV1andZkAmiJc3Rq1oGEAQmcjiLceyMXOy1l8ms8qs2fQ==" + }, "electron-to-chromium": { "version": "1.4.413", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.413.tgz", @@ -11266,12 +11491,49 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "escodegen": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.3.3.tgz", + "integrity": "sha512-z9FWgKc48wjMlpzF5ymKS1AF8OIgnKLp9VyN7KbdtyrP/9lndwUFqCtMm+TAJmJf7KJFFYc4cFJfVTTGkKEwsA==", + "requires": { + "esprima": "~1.1.1", + "estraverse": "~1.5.0", + "esutils": "~1.0.0", + "source-map": "~0.1.33" + }, + "dependencies": { + "esprima": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.1.1.tgz", + "integrity": "sha512-qxxB994/7NtERxgXdFgLHIs9M6bhLXc6qtUmWZ3L8+gTQ9qaoyki2887P2IqAYsoENyr8SUbTutStDniOHSDHg==" + }, + "esutils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz", + "integrity": "sha512-x/iYH53X3quDwfHRz4y8rn4XcEwwCJeWsul9pF1zldMbGtgOtMNBEOuYWwB1EQlK2LRa1fev3YAgym/RElp5Cg==" + }, + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha512-VtCvB9SIQhk3aF6h+N85EaqIaBFIAfZ9Cu+NJHHVvc8BbEcnvDcFw6sqQ2dQrT6SlOrZq3tIvyD9+EGq/lJryQ==", + "optional": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, + "estraverse": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz", + "integrity": "sha512-FpCjJDfmo3vsc/1zKSeqR5k42tcIhxFIlvq+h9j0fO2q/h2uLKyweq7rYJ+0CoVvrGQOxIS5wyBrW/+vF58BUQ==" + }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -12926,6 +13188,36 @@ } } }, + "jison": { + "version": "https://github.com/JohanAhlen/jison/tarball/ad8e41475e", + "integrity": "sha512-kKqzzhj1GaVw5vTDQWV3pvKjJS9v5fheDNyN8h3CLj3mHZhbcw2Kb8iT+wPlpCJhbZ3HIxoVJFbmwg7z+ZvGrg==", + "requires": { + "cjson": "0.3.0", + "ebnf-parser": "0.1.10", + "escodegen": "1.3.x", + "esprima": "1.1.x", + "jison-lex": "0.3.x", + "JSONSelect": "0.4.0", + "lex-parser": "~0.1.3", + "nomnom": "1.5.2" + }, + "dependencies": { + "esprima": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.1.1.tgz", + "integrity": "sha512-qxxB994/7NtERxgXdFgLHIs9M6bhLXc6qtUmWZ3L8+gTQ9qaoyki2887P2IqAYsoENyr8SUbTutStDniOHSDHg==" + } + } + }, + "jison-lex": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/jison-lex/-/jison-lex-0.3.4.tgz", + "integrity": "sha512-EBh5wrXhls1cUwROd5DcDHR1sG7CdsCFSqY1027+YA1RGxz+BX2TDLAhdsQf40YEtFDGoiO0Qm8PpnBl2EzDJw==", + "requires": { + "lex-parser": "0.1.x", + "nomnom": "1.5.2" + } + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -12976,12 +13268,26 @@ "universalify": "^2.0.0" } }, + "jsonlint": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/jsonlint/-/jsonlint-1.6.0.tgz", + "integrity": "sha512-x6YLBe6NjdpmIeiklwQOxsZuYj/SOWkT33GlTpaG1UdFGjdWjPcxJ1CWZAX3wA7tarz8E2YHF6KiW5HTapPlXw==", + "requires": { + "JSV": ">= 4.0.x", + "nomnom": ">= 1.5.x" + } + }, "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", "dev": true }, + "JSONSelect": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/JSONSelect/-/JSONSelect-0.4.0.tgz", + "integrity": "sha512-VRLR3Su35MH+XV2lrvh9O7qWoug/TUyj9tLDjn9rtpUCNnILLrHjgd/tB0KrhugCxUpj3UqoLqfYb3fLJdIQQQ==" + }, "JSONStream": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", @@ -12992,6 +13298,11 @@ "through": ">=2.2.7 <3" } }, + "JSV": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", + "integrity": "sha512-ZJ6wx9xaKJ3yFUhq5/sk82PJMuUyLk277I8mQeyDgCTjGdjWJIvPfaU5LIXaMuaN2UO1X3kZH4+lgphublZUHw==" + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -13010,6 +13321,11 @@ "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true }, + "lex-parser": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/lex-parser/-/lex-parser-0.1.4.tgz", + "integrity": "sha512-DuAEISsr1H4LOpmFLkyMc8YStiRWZCO8hMsoXAXSbgyfvs2WQhSt0+/FBv3ZU/JBFZMGcE+FWzEBSzwUU7U27w==" + }, "lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -13262,6 +13578,15 @@ "integrity": "sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==", "dev": true }, + "nomnom": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.5.2.tgz", + "integrity": "sha512-fiVbT7BqxiQqjlR9U3FDGOSERFCKoXVCdxV2FwZuNN7/cmJ42iQx35nUFOAFDcyvemu9Adp+IlsCGlKQYLmBKw==", + "requires": { + "colors": "0.5.x", + "underscore": "1.1.x" + } + }, "normalize-package-data": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", @@ -14101,6 +14426,11 @@ "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true }, + "underscore": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.1.7.tgz", + "integrity": "sha512-w4QtCHoLBXw1mjofIDoMyexaEdWGMedWNDhlWTtT1V1lCRqi65Pnoygkh6+WRdr+Bm8ldkBNkNeCsXGMlQS9HQ==" + }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", diff --git a/package.json b/package.json index be536b61a..ca10ff8ae 100644 --- a/package.json +++ b/package.json @@ -18,16 +18,20 @@ "types": "./dist/index.d.ts", "scripts": { "prepare": "husky install", - "postinstall": "if [ -e src/generator ]; then cd src/generator && npm install; fi", "test": "npm run generate && npm run test_without_generate", "test_without_generate": "jest src/parsing", - "generate": "cd src/generator && node main.js generic postgresql clickhouse", + "build_generator": "cd src/generator && rimraf dist && tsc -p tsconfig.build.json", + "launch_generator": "cd src/generator && node dist/main.js generic postgresql clickhouse", + "generate": "npm run build_generator && npm run launch_generator", "lint": "npm run prettier -- --check", "fix": "npm run prettier -- --write", "prettier": "prettier \"**/*.{md,yaml,yml,json}\"", - "build": "rimraf dist && tsc -p src/parsing", + "build": "rimraf dist && tsc -p tsconfig.build.json", "prepublishOnly": "npm run build" }, + "dependencies": { + "jison": "https://github.com/JohanAhlen/jison/tarball/ad8e41475e" + }, "devDependencies": { "@babel/preset-env": "7.14.4", "@babel/preset-typescript": "^7.21.5", diff --git a/src/generator/@types/jison.d.ts b/src/generator/@types/jison.d.ts new file mode 100644 index 000000000..5a79adfe2 --- /dev/null +++ b/src/generator/@types/jison.d.ts @@ -0,0 +1,20 @@ +declare module 'jison/lib/cli.js' { + export interface JisonOptions { + file: string; + lexfile?: string; + json?: boolean; + outfile?: string; + moduleName?: string; + debug?: boolean; + 'parser-type'?: string; + 'module-type'?: string; + } + + interface JisonCli { + main(options: JisonOptions): void; + } + + const jisonCli: JisonCli; + + export default jisonCli; +} diff --git a/src/generator/lib/files.js b/src/generator/lib/files.ts similarity index 73% rename from src/generator/lib/files.js rename to src/generator/lib/files.ts index 05a6c39b2..4c42a9936 100644 --- a/src/generator/lib/files.js +++ b/src/generator/lib/files.ts @@ -30,15 +30,23 @@ import fs from 'fs'; -export const listDir = async folder => fs.promises.readdir(folder); +export async function listDir(folder: string): Promise { + return fs.promises.readdir(folder); +} -export const fileExists = file => fs.existsSync(file); +export function fileExists(file: string): boolean { + return fs.existsSync(file); +} -export const readFile = async path => { - const buffer = await fs.promises.readFile(path); - return buffer ? buffer.toString() : ""; -}; +export async function readFile(path: string): Promise { + const buffer = await fs.promises.readFile(path); + return buffer ? buffer.toString() : ''; +} -export const writeFile = (path, contents) => fs.promises.writeFile(path, contents); +export async function writeFile(path: string, contents: string): Promise { + return fs.promises.writeFile(path, contents); +} -export const deleteFile = path => fs.unlinkSync(path); +export function deleteFile(path: string): void { + fs.unlinkSync(path); +} diff --git a/src/generator/lib/generator.js b/src/generator/lib/generator.js deleted file mode 100644 index 8e73cf9e8..000000000 --- a/src/generator/lib/generator.js +++ /dev/null @@ -1,238 +0,0 @@ -// Licensed to Cloudera, Inc. under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. Cloudera, Inc. licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Please note that the code below is the modified code distributed on the terms, mentioned below. -// The copyright for the changes belongs to YANDEX LLC. -// -// Copyright 2023 YANDEX LLC -// -// Licensed under the Apache License, Version 2.0 (the "License") -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under -// the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions -// and limitations under the License. - -import {deleteFile, fileExists, listDir, readFile, writeFile} from './files.js'; -import jisonCli from "jison/lib/cli.js"; - -function getLicenseText() { - return `// Licensed to Cloudera, Inc. under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. Cloudera, Inc. licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Please note that the code below is the modified code distributed on the terms, mentioned below. -// The copyright for the changes belongs to YANDEX LLC. -// -// Copyright 2023 YANDEX LLC -// -// Licensed under the Apache License, Version 2.0 (the "License") -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under -// the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions -// and limitations under the License. - -` -} - -export function createFullParserName(shortName) { - return `${shortName}AutocompleteParser`; -} - -async function concatinateJisonFiles(sources) { - const contents = []; - - for (const source of sources) { - contents.push(await readFile(source)); - } - - return contents.join(); -} - -/** - * Searches through the SQL_FOLDER and if a jison/structure.json file exists it considers it a parser - */ -async function getParserStructureFiles() { - const parsersFolder = `../parsing/parsers`; - - const folders = await listDir(parsersFolder); - const structureFiles = []; - - for (const folder of folders) { - const outputFolder = `${parsersFolder}/${folder}`; - const jisonFolder = `${outputFolder}/jison`; - const structureFile = `${jisonFolder}/structure.json`; - - if (fileExists(structureFile)) { - structureFiles.push({ dialect: folder, outputFolder, jisonFolder, structureFile }); - } - } - - return structureFiles; -} - -/** - * Identifies all the SQL parsers based on subfolders in SQL_FOLDER and adds them to parserDefinitions - */ -async function getAvailableParserDefinitions() { - const parserSources = await getParserStructureFiles(); - const foundDefinitions = new Map(); - - for (const parserSource of parserSources) { - const structure = JSON.parse(await readFile(parserSource.structureFile)); - if (!structure.autocomplete) { - console.log("parser definition doesn't have autocomplete"); - continue - } - - const parserDefinition = await createParserDefinition( - structure.autocomplete, - parserSource, - true, - structure - ); - foundDefinitions.set(createFullParserName(parserSource.dialect), parserDefinition); - } - - return foundDefinitions; -} - -async function createParserDefinition( - sources, - { dialect, outputFolder, jisonFolder }, - autocomplete, - { lexer, imports } -) { - const parserName = createFullParserName(dialect); - - const absoluteSources = sources.map(source => `${jisonFolder}/${source}`); - for (const source of absoluteSources) { - if (!fileExists(source)) { - throw new Error( - `Could not find the file '${source}' as defined in structure.json for ${dialect}` - ); - } - } - - return { - sources: sources.map(source => `${jisonFolder}/${source}`), - lexer: `${jisonFolder}/${lexer}`, - concatenatedJisonFileName: `${outputFolder}/${parserName}.jison`, - sqlParser: 'AUTOCOMPLETE', - parserName, - outputFolder, - extendParser: async content => { - let fixedContents = content - .replace( - `var ${parserName} = `, - imports ? `${imports.join(';\n')};\n\n$var ${parserName} = ` : `import { extendParser } from './parser-extension';\n\n/** @type {any} */\nexport let ${parserName} = ` - ) - // Fix a bug in jison (https://github.com/zaach/jison/pull/356) - .replace( - 'loc: yyloc,', - "loc: lexer.yylloc, ruleId: stack.slice(stack.length - 2, stack.length).join('')," - ); - return `${getLicenseText()}${fixedContents}\n`; - } - }; -} - -async function findParserDefinitions(parserNames) { - const availableParsers = await getAvailableParserDefinitions(); - - const foundParsers = []; - - parserNames.forEach(parserName => { - if (availableParsers.get(parserName)) { - foundParsers.push(availableParsers.get(parserName)); - } - }); - - return foundParsers; -} - -function runJisonTool(parserDefinition, parserFileName) { - const options = { - file: parserDefinition.concatenatedJisonFileName, - outfile: parserFileName, - 'module-type': 'js' - }; - if (parserDefinition.lexer) { - options.lexfile = parserDefinition.lexer; - } - - try { - jisonCli.main(options); // Writes the generated parser in the current folder - } catch (err) { - console.error('Failed calling jison cli'); - throw err; - } -} - -async function generateJisonParser(parserDefinition, outputFileName) { - const jisonContents = await concatinateJisonFiles(parserDefinition.sources); - await writeFile(parserDefinition.concatenatedJisonFileName, jisonContents); - - runJisonTool(parserDefinition, outputFileName); - const generatedFileContents = await readFile(outputFileName); - - deleteFile(parserDefinition.concatenatedJisonFileName); - deleteFile(outputFileName); - - return generatedFileContents -} - -async function extendParser(astFileContents, parserDefinition, outputFileName) { - const modifiedContents = await parserDefinition.extendParser(astFileContents); - await writeFile(outputFileName, modifiedContents); -} - -async function generateParser(parserDefinition) { - const parserFileName = `${parserDefinition.parserName}.js`; - let outputFileName = `${parserDefinition.outputFolder}/${parserFileName}`; - - const jisonParserContents = await generateJisonParser(parserDefinition, parserFileName); - await extendParser(jisonParserContents, parserDefinition, outputFileName); -} - -export async function generateParsers(parserNames) { - const parserDefinitions = await findParserDefinitions(parserNames); - if (parserNames.length !== parserDefinitions.length) { - throw new Error(`Could not find all requested parser definitions`); - } - - for (let i = 0; i < parserDefinitions.length; i++) { - console.log(`Generating ${parserDefinitions[i].parserName}`); - await generateParser(parserDefinitions[i]); - } -} diff --git a/src/generator/lib/generator.ts b/src/generator/lib/generator.ts new file mode 100644 index 000000000..013ce1595 --- /dev/null +++ b/src/generator/lib/generator.ts @@ -0,0 +1,269 @@ +// Licensed to Cloudera, Inc. under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. Cloudera, Inc. licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Please note that the code below is the modified code distributed on the terms, mentioned below. +// The copyright for the changes belongs to YANDEX LLC. +// +// Copyright 2023 YANDEX LLC +// +// Licensed under the Apache License, Version 2.0 (the "License") +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under +// the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions +// and limitations under the License. + +import {deleteFile, fileExists, listDir, readFile, writeFile} from './files'; +import jisonCli, {JisonOptions} from 'jison/lib/cli.js'; + +interface StructureFileObject { + dialect: string; + outputFolder: string; + jisonFolder: string; + structureFile: string; +} + +interface ParserDefinition { + sources: string[]; + lexer: string; + concatenatedJisonFileName: string; + sqlParser: 'AUTOCOMPLETE'; + parserName: string; + outputFolder: string; + extendParser: (content: string) => Promise; +} + +interface ParserStructure { + lexer: string; + imports: string[]; +} + +function getLicenseText(): string { + return `// Licensed to Cloudera, Inc. under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. Cloudera, Inc. licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Please note that the code below is the modified code distributed on the terms, mentioned below. +// The copyright for the changes belongs to YANDEX LLC. +// +// Copyright 2023 YANDEX LLC +// +// Licensed under the Apache License, Version 2.0 (the "License") +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under +// the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions +// and limitations under the License. + +`; +} + +export function createFullParserName(shortName: string): string { + return `${shortName}AutocompleteParser`; +} + +async function concatinateJisonFiles(sources: string[]): Promise { + const contents = []; + + for (const source of sources) { + contents.push(await readFile(source)); + } + + return contents.join(); +} + +/** + * Searches through the SQL_FOLDER and if a jison/structure.json file exists it considers it a parser + */ +async function getParserStructureFiles(): Promise { + const parsersFolder = `../parsing/parsers`; + + const folders = await listDir(parsersFolder); + const structureFiles = []; + + for (const folder of folders) { + const outputFolder = `${parsersFolder}/${folder}`; + const jisonFolder = `${outputFolder}/jison`; + const structureFile = `${jisonFolder}/structure.json`; + + if (fileExists(structureFile)) { + structureFiles.push({dialect: folder, outputFolder, jisonFolder, structureFile}); + } + } + + return structureFiles; +} + +/** + * Identifies all the SQL parsers based on subfolders in SQL_FOLDER and adds them to parserDefinitions + */ +async function getAvailableParserDefinitions(): Promise> { + const parserSources = await getParserStructureFiles(); + const foundDefinitions = new Map(); + + for (const parserSource of parserSources) { + const structure = JSON.parse(await readFile(parserSource.structureFile)); + if (!structure.autocomplete) { + console.log("parser definition doesn't have autocomplete"); + continue; + } + + const parserDefinition = await createParserDefinition( + structure.autocomplete, + parserSource, + structure, + ); + foundDefinitions.set(createFullParserName(parserSource.dialect), parserDefinition); + } + + return foundDefinitions; +} + +async function createParserDefinition( + sources: string[], + {dialect, outputFolder, jisonFolder}: StructureFileObject, + {lexer, imports}: ParserStructure, +): Promise { + const parserName = createFullParserName(dialect); + + const absoluteSources = sources.map((source) => `${jisonFolder}/${source}`); + for (const source of absoluteSources) { + if (!fileExists(source)) { + throw new Error( + `Could not find the file '${source}' as defined in structure.json for ${dialect}`, + ); + } + } + + return { + sources: sources.map((source) => `${jisonFolder}/${source}`), + lexer: `${jisonFolder}/${lexer}`, + concatenatedJisonFileName: `${outputFolder}/${parserName}.jison`, + sqlParser: 'AUTOCOMPLETE', + parserName, + outputFolder, + extendParser: async (content) => { + let fixedContents = content + .replace( + `var ${parserName} = `, + imports + ? `${imports.join(';\n')};\n\n$var ${parserName} = ` + : `import { extendParser } from './parser-extension';\n\n/** @type {any} */\nexport let ${parserName} = `, + ) + // Fix a bug in jison (https://github.com/zaach/jison/pull/356) + .replace( + 'loc: yyloc,', + "loc: lexer.yylloc, ruleId: stack.slice(stack.length - 2, stack.length).join(''),", + ); + return `${getLicenseText()}${fixedContents}\n`; + }, + }; +} + +async function findParserDefinitions(parserNames: string[]): Promise { + const availableParsers = await getAvailableParserDefinitions(); + + const foundParsers: ParserDefinition[] = []; + + parserNames.forEach((parserName) => { + const parserDefinition = availableParsers.get(parserName); + + if (parserDefinition) { + foundParsers.push(parserDefinition); + } + }); + + return foundParsers; +} + +function runJisonTool(parserDefinition: ParserDefinition, parserFileName: string): void { + const options: JisonOptions = { + file: parserDefinition.concatenatedJisonFileName, + outfile: parserFileName, + 'module-type': 'js', + }; + if (parserDefinition.lexer) { + options.lexfile = parserDefinition.lexer; + } + + try { + jisonCli.main(options); // Writes the generated parser in the current folder + } catch (err) { + console.error('Failed calling jison cli'); + throw err; + } +} + +async function generateJisonParser( + parserDefinition: ParserDefinition, + outputFileName: string, +): Promise { + const jisonContents = await concatinateJisonFiles(parserDefinition.sources); + await writeFile(parserDefinition.concatenatedJisonFileName, jisonContents); + + runJisonTool(parserDefinition, outputFileName); + const generatedFileContents = await readFile(outputFileName); + + deleteFile(parserDefinition.concatenatedJisonFileName); + deleteFile(outputFileName); + + return generatedFileContents; +} + +async function extendParser( + astFileContents: string, + parserDefinition: ParserDefinition, + outputFileName: string, +): Promise { + const modifiedContents = await parserDefinition.extendParser(astFileContents); + await writeFile(outputFileName, modifiedContents); +} + +async function generateParser(parserDefinition: ParserDefinition): Promise { + const parserFileName = `${parserDefinition.parserName}.js`; + let outputFileName = `${parserDefinition.outputFolder}/${parserFileName}`; + + const jisonParserContents = await generateJisonParser(parserDefinition, parserFileName); + await extendParser(jisonParserContents, parserDefinition, outputFileName); +} + +export async function generateParsers(parserNames: string[]): Promise { + const parserDefinitions = await findParserDefinitions(parserNames); + if (parserNames.length !== parserDefinitions.length) { + throw new Error(`Could not find all requested parser definitions`); + } + + for (let i = 0; i < parserDefinitions.length; i++) { + console.log(`Generating ${parserDefinitions[i].parserName}`); + await generateParser(parserDefinitions[i]); + } +} diff --git a/src/generator/main.js b/src/generator/main.ts similarity index 81% rename from src/generator/main.js rename to src/generator/main.ts index b2cf22686..0f64fc9c1 100644 --- a/src/generator/main.js +++ b/src/generator/main.ts @@ -28,14 +28,16 @@ // either express or implied. See the License for the specific language governing permissions // and limitations under the License. -import {createFullParserName, generateParsers} from './lib/generator.js'; +import {createFullParserName, generateParsers} from './lib/generator'; -try { - process.argv.shift(); // drop "node" - process.argv.shift(); // drop "main.js" - const requestedParserNames = process.argv.map(arg => createFullParserName(arg)) +(async function (): Promise { + try { + process.argv.shift(); // drop "node" + process.argv.shift(); // drop "main.js" + const requestedParserNames = process.argv.map((arg) => createFullParserName(arg)); - await generateParsers(requestedParserNames); -} catch (err) { - console.log(err); -} \ No newline at end of file + await generateParsers(requestedParserNames); + } catch (err) { + console.log(err); + } +})(); diff --git a/src/generator/package-lock.json b/src/generator/package-lock.json deleted file mode 100644 index 0960c2b25..000000000 --- a/src/generator/package-lock.json +++ /dev/null @@ -1,203 +0,0 @@ -{ - "name": "parser-generator", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "parser-generator", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "jison": "https://github.com/JohanAhlen/jison/tarball/ad8e41475e" - } - }, - "node_modules/amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", - "optional": true, - "engines": { - "node": ">=0.4.2" - } - }, - "node_modules/cjson": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/cjson/-/cjson-0.3.0.tgz", - "integrity": "sha512-bBRQcCIHzI1IVH59fR0bwGrFmi3Btb/JNwM/n401i1DnYgWndpsUBiQRAddLflkZage20A2d25OAWZZk0vBRlA==", - "dependencies": { - "jsonlint": "1.6.0" - }, - "engines": { - "node": ">= 0.3.0" - } - }, - "node_modules/colors": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz", - "integrity": "sha512-XjsuUwpDeY98+yz959OlUK6m7mLBM+1MEG5oaenfuQnNnrQk1WvtcvFgN3FNDP3f2NmZ211t0mNEfSEN1h0eIg==", - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/ebnf-parser": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/ebnf-parser/-/ebnf-parser-0.1.10.tgz", - "integrity": "sha512-urvSxVQ6XJcoTpc+/x2pWhhuOX4aljCNQpwzw+ifZvV1andZkAmiJc3Rq1oGEAQmcjiLceyMXOy1l8ms8qs2fQ==" - }, - "node_modules/escodegen": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.3.3.tgz", - "integrity": "sha512-z9FWgKc48wjMlpzF5ymKS1AF8OIgnKLp9VyN7KbdtyrP/9lndwUFqCtMm+TAJmJf7KJFFYc4cFJfVTTGkKEwsA==", - "dependencies": { - "esprima": "~1.1.1", - "estraverse": "~1.5.0", - "esutils": "~1.0.0" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=0.10.0" - }, - "optionalDependencies": { - "source-map": "~0.1.33" - } - }, - "node_modules/esprima": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.1.1.tgz", - "integrity": "sha512-qxxB994/7NtERxgXdFgLHIs9M6bhLXc6qtUmWZ3L8+gTQ9qaoyki2887P2IqAYsoENyr8SUbTutStDniOHSDHg==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/estraverse": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz", - "integrity": "sha512-FpCjJDfmo3vsc/1zKSeqR5k42tcIhxFIlvq+h9j0fO2q/h2uLKyweq7rYJ+0CoVvrGQOxIS5wyBrW/+vF58BUQ==", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/esutils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz", - "integrity": "sha512-x/iYH53X3quDwfHRz4y8rn4XcEwwCJeWsul9pF1zldMbGtgOtMNBEOuYWwB1EQlK2LRa1fev3YAgym/RElp5Cg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/jison": { - "version": "0.4.17", - "resolved": "https://github.com/JohanAhlen/jison/tarball/ad8e41475e", - "integrity": "sha512-kKqzzhj1GaVw5vTDQWV3pvKjJS9v5fheDNyN8h3CLj3mHZhbcw2Kb8iT+wPlpCJhbZ3HIxoVJFbmwg7z+ZvGrg==", - "license": "MIT", - "dependencies": { - "cjson": "0.3.0", - "ebnf-parser": "0.1.10", - "escodegen": "1.3.x", - "esprima": "1.1.x", - "jison-lex": "0.3.x", - "JSONSelect": "0.4.0", - "lex-parser": "~0.1.3", - "nomnom": "1.5.2" - }, - "bin": { - "jison": "lib/cli.js" - }, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/jison-lex": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/jison-lex/-/jison-lex-0.3.4.tgz", - "integrity": "sha512-EBh5wrXhls1cUwROd5DcDHR1sG7CdsCFSqY1027+YA1RGxz+BX2TDLAhdsQf40YEtFDGoiO0Qm8PpnBl2EzDJw==", - "dependencies": { - "lex-parser": "0.1.x", - "nomnom": "1.5.2" - }, - "bin": { - "jison-lex": "cli.js" - }, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/jsonlint": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/jsonlint/-/jsonlint-1.6.0.tgz", - "integrity": "sha512-x6YLBe6NjdpmIeiklwQOxsZuYj/SOWkT33GlTpaG1UdFGjdWjPcxJ1CWZAX3wA7tarz8E2YHF6KiW5HTapPlXw==", - "dependencies": { - "JSV": ">= 4.0.x", - "nomnom": ">= 1.5.x" - }, - "bin": { - "jsonlint": "lib/cli.js" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/JSONSelect": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/JSONSelect/-/JSONSelect-0.4.0.tgz", - "integrity": "sha512-VRLR3Su35MH+XV2lrvh9O7qWoug/TUyj9tLDjn9rtpUCNnILLrHjgd/tB0KrhugCxUpj3UqoLqfYb3fLJdIQQQ==", - "engines": { - "node": ">=0.4.7" - } - }, - "node_modules/JSV": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", - "integrity": "sha512-ZJ6wx9xaKJ3yFUhq5/sk82PJMuUyLk277I8mQeyDgCTjGdjWJIvPfaU5LIXaMuaN2UO1X3kZH4+lgphublZUHw==", - "engines": { - "node": "*" - } - }, - "node_modules/lex-parser": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/lex-parser/-/lex-parser-0.1.4.tgz", - "integrity": "sha512-DuAEISsr1H4LOpmFLkyMc8YStiRWZCO8hMsoXAXSbgyfvs2WQhSt0+/FBv3ZU/JBFZMGcE+FWzEBSzwUU7U27w==" - }, - "node_modules/nomnom": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.5.2.tgz", - "integrity": "sha512-fiVbT7BqxiQqjlR9U3FDGOSERFCKoXVCdxV2FwZuNN7/cmJ42iQx35nUFOAFDcyvemu9Adp+IlsCGlKQYLmBKw==", - "deprecated": "Package no longer supported. Contact support@npmjs.com for more info.", - "dependencies": { - "colors": "0.5.x", - "underscore": "1.1.x" - }, - "engines": { - "node": "*" - } - }, - "node_modules/source-map": { - "version": "0.1.43", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", - "integrity": "sha512-VtCvB9SIQhk3aF6h+N85EaqIaBFIAfZ9Cu+NJHHVvc8BbEcnvDcFw6sqQ2dQrT6SlOrZq3tIvyD9+EGq/lJryQ==", - "optional": true, - "dependencies": { - "amdefine": ">=0.0.4" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/underscore": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.1.7.tgz", - "integrity": "sha512-w4QtCHoLBXw1mjofIDoMyexaEdWGMedWNDhlWTtT1V1lCRqi65Pnoygkh6+WRdr+Bm8ldkBNkNeCsXGMlQS9HQ==", - "engines": { - "node": "*" - } - } - } -} diff --git a/src/generator/package.json b/src/generator/package.json deleted file mode 100644 index 51c6d17a2..000000000 --- a/src/generator/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "parser-generator", - "version": "1.0.0", - "description": "", - "main": "main.js", - "type": "module", - "author": "", - "license": "ISC", - "dependencies": { - "jison": "https://github.com/JohanAhlen/jison/tarball/ad8e41475e" - } -} diff --git a/src/generator/tsconfig.build.json b/src/generator/tsconfig.build.json new file mode 100644 index 000000000..732f217e2 --- /dev/null +++ b/src/generator/tsconfig.build.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.json", + "include": ["**/*"], + "exclude": ["node_modules"], + "compilerOptions": { + "outDir": "dist" + } +} diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 000000000..090719f5e --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,5 @@ +{ + "extends": "./tsconfig.json", + "include": ["src/parsing/*"], + "exclude": ["src/parsing/test/*"] +} diff --git a/src/parsing/tsconfig.json b/tsconfig.json similarity index 64% rename from src/parsing/tsconfig.json rename to tsconfig.json index 61aab6e42..4e5b7d7ba 100644 --- a/src/parsing/tsconfig.json +++ b/tsconfig.json @@ -3,9 +3,8 @@ "compilerOptions": { "target": "ES2020", "declaration": true, - "outDir": "../../dist", + "outDir": "dist", "checkJs": false }, - "include": ["./*"], - "exclude": ["./test/*"] + "include": ["src/**/*"] }