@kubb/parser-ts 3.0.0-alpha.12 → 3.0.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -6
- package/src/format.ts +6 -0
- package/src/index.ts +1 -0
- package/src/print.ts +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,19 @@
|
|
|
27
27
|
<a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Request Feature</a>
|
|
28
28
|
</h4>
|
|
29
29
|
</div>
|
|
30
|
+
## Supporting Kubb
|
|
31
|
+
|
|
32
|
+
Kubb uses an MIT-licensed open source project with its ongoing development made possible entirely by the support of Sponsors. If you would like to become a sponsor, please consider:
|
|
33
|
+
|
|
34
|
+
- [Become a Sponsor on GitHub](https://github.com/sponsors/stijnvanhulle)
|
|
35
|
+
|
|
36
|
+
<p align="center">
|
|
37
|
+
<a href="https://github.com/sponsors/stijnvanhulle">
|
|
38
|
+
<img src="https://raw.githubusercontent.com/stijnvanhulle/sponsors/main/sponsors.svg" alt="My sponsors" />
|
|
39
|
+
</a>
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
|
|
30
43
|
<!-- Badges -->
|
|
31
44
|
|
|
32
45
|
[npm-version-src]: https://img.shields.io/npm/v/@kubb/parser-ts?flat&colorA=18181B&colorB=f58517
|
package/dist/index.cjs
CHANGED
|
@@ -32,10 +32,16 @@ function print(elements, { source = "", baseName = "print.ts", removeComments, n
|
|
|
32
32
|
return [outputFile, restoreNewLines(outputSource)].filter(Boolean).join("\n");
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
// src/format.ts
|
|
36
|
+
function format(source) {
|
|
37
|
+
return print([], { source, noEmitHelpers: false });
|
|
38
|
+
}
|
|
39
|
+
|
|
35
40
|
Object.defineProperty(exports, "factory", {
|
|
36
41
|
enumerable: true,
|
|
37
42
|
get: function () { return chunkTNIGP6OU_cjs.factory_exports; }
|
|
38
43
|
});
|
|
44
|
+
exports.format = format;
|
|
39
45
|
exports.print = print;
|
|
40
46
|
//# sourceMappingURL=index.cjs.map
|
|
41
47
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/print.ts"],"names":["ts"],"mappings":";;;;;;;;;AAIA,IAAM,EAAE,SAAY,GAAAA,mBAAA,CAAA;AAYpB,IAAM,iBAAiB,CAAC,IAAA,KAAiB,IAAK,CAAA,OAAA,CAAQ,SAAS,mBAAmB,CAAA,CAAA;AAOlF,IAAM,kBAAkB,CAAC,IAAA,KAAiB,IAAK,CAAA,OAAA,CAAQ,wBAAwB,IAAI,CAAA,CAAA;AAE5E,SAAS,KACd,CAAA,QAAA,EACA,EAAE,MAAA,GAAS,IAAI,QAAW,GAAA,UAAA,EAAY,cAAgB,EAAA,aAAA,EAAe,UAAUA,mBAAG,CAAA,WAAA,CAAY,QAAS,EAAA,GAAa,EAC5G,EAAA;AACR,EAAA,MAAM,UAAa,GAAAA,mBAAA,CAAG,gBAAiB,CAAA,QAAA,EAAU,cAAe,CAAA,MAAM,CAAG,EAAAA,mBAAA,CAAG,YAAa,CAAA,MAAA,EAAQ,KAAO,EAAAA,mBAAA,CAAG,WAAW,EAAE,CAAA,CAAA;AACxH,EAAM,MAAA,OAAA,GAAUA,oBAAG,aAAc,CAAA;AAAA,IAC/B,qBAAuB,EAAA,IAAA;AAAA,IACvB,OAAA;AAAA,IACA,cAAA;AAAA,IACA,aAAA;AAAA,GACD,CAAA,CAAA;AAED,EAAA,IAAI,QAAwB,EAAC,CAAA;AAE7B,EAAA,IAAI,CAAC,QAAU,EAAA;AACb,IAAO,OAAA,EAAA,CAAA;AAAA,GACT;AAEA,EAAI,IAAA,KAAA,CAAM,OAAQ,CAAA,QAAQ,CAAG,EAAA;AAC3B,IAAQ,KAAA,GAAA,QAAA,CAAS,OAAO,OAAO,CAAA,CAAA;AAAA,GAC1B,MAAA;AACL,IAAA,KAAA,GAAQ,CAAC,QAAQ,CAAE,CAAA,MAAA,CAAO,OAAO,CAAA,CAAA;AAAA,GACnC;AAEA,EAAM,MAAA,UAAA,GAAa,OAAQ,CAAA,SAAA,CAAUA,mBAAG,CAAA,UAAA,CAAW,WAAW,OAAQ,CAAA,eAAA,CAAgB,KAAK,CAAA,EAAG,UAAU,CAAA,CAAA;AACxG,EAAM,MAAA,YAAA,GAAe,OAAQ,CAAA,SAAA,CAAU,UAAU,CAAA,CAAA;AAEjD,EAAO,OAAA,CAAC,UAAY,EAAA,eAAA,CAAgB,YAAY,CAAC,EAAE,MAAO,CAAA,OAAO,CAAE,CAAA,IAAA,CAAK,IAAI,CAAA,CAAA;AAC9E","file":"index.cjs","sourcesContent":["import ts from 'typescript'\n\nimport type { PrinterOptions } from 'typescript'\n\nconst { factory } = ts\n\ntype Options = {\n source?: string\n baseName?: string\n} & PrinterOptions\n\n/**\n * Escaped new lines in code with block comments so they can be restored by {@link restoreNewLines}\n * @param {string} code The code to escape new lines in\n * @returns The same code but with new lines escaped using block comments\n */\nconst escapeNewLines = (code: string) => code.replace(/\\n\\n/g, '\\n/* :newline: */')\n\n/**\n * Reverses {@link escapeNewLines} and restores new lines\n * @param {string} code The code with escaped new lines\n * @returns The same code with new lines restored\n */\nconst restoreNewLines = (code: string) => code.replace(/\\/\\* :newline: \\*\\//g, '\\n')\n\nexport function print(\n elements:
|
|
1
|
+
{"version":3,"sources":["../src/print.ts","../src/format.ts"],"names":["ts"],"mappings":";;;;;;;;;AAIA,IAAM,EAAE,SAAY,GAAAA,mBAAA,CAAA;AAYpB,IAAM,iBAAiB,CAAC,IAAA,KAAiB,IAAK,CAAA,OAAA,CAAQ,SAAS,mBAAmB,CAAA,CAAA;AAOlF,IAAM,kBAAkB,CAA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AO,CAAA,OAAO,CAAE,CAAA,IAAA,CAAK,IAAI,CAAA,CAAA;AAC9E,CAAA;;;ACnDO,SAAS,OAAO,MAAgB,EAAA;AAErC,EAAA,OAAO,MAAM,EAAC,EAAG,EAAE,MAAQ,EAAA,aAAA,EAAe,OAAO,CAAA,CAAA;AACnD","file":"index.cjs","sourcesContent":["import ts from 'typescript'\n\nimport type { PrinterOptions } from 'typescript'\n\nconst { factory } = ts\n\ntype Options = {\n source?: string\n baseName?: string\n} & PrinterOptions\n\n/**\n * Escaped new lines in code with block comments so they can be restored by {@link restoreNewLines}\n * @param {string} code The code to escape new lines in\n * @returns The same code but with new lines escaped using block comments\n */\nconst escapeNewLines = (code: string) => code.replace(/\\n\\n/g, '\\n/* :newline: */')\n\n/**\n * Reverses {@link escapeNewLines} and restores new lines\n * @param {string} code The code with escaped new lines\n * @returns The same code with new lines restored\n */\nconst restoreNewLines = (code: string) => code.replace(/\\/\\* :newline: \\*\\//g, '\\n')\n\nexport function print(\n elements: Array<ts.Node>,\n { source = '', baseName = 'print.ts', removeComments, noEmitHelpers, newLine = ts.NewLineKind.LineFeed }: Options = {},\n): string {\n const sourceFile = ts.createSourceFile(baseName, escapeNewLines(source), ts.ScriptTarget.ES2022, false, ts.ScriptKind.TS)\n const printer = ts.createPrinter({\n omitTrailingSemicolon: true,\n newLine,\n removeComments,\n noEmitHelpers,\n })\n\n let nodes: Array<ts.Node> = []\n\n if (!elements) {\n return ''\n }\n\n if (Array.isArray(elements)) {\n nodes = elements.filter(Boolean)\n } else {\n nodes = [elements].filter(Boolean)\n }\n\n const outputFile = printer.printList(ts.ListFormat.MultiLine, factory.createNodeArray(nodes), sourceFile)\n const outputSource = printer.printFile(sourceFile)\n\n return [outputFile, restoreNewLines(outputSource)].filter(Boolean).join('\\n')\n}\n","import { print } from './print.ts'\n\nexport function format(source: string) {\n // do some basic linting with the ts compiler\n return print([], { source, noEmitHelpers: false })\n}\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -6,6 +6,8 @@ type Options = {
|
|
|
6
6
|
source?: string;
|
|
7
7
|
baseName?: string;
|
|
8
8
|
} & PrinterOptions;
|
|
9
|
-
declare function print(elements:
|
|
9
|
+
declare function print(elements: Array<ts.Node>, { source, baseName, removeComments, noEmitHelpers, newLine }?: Options): string;
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
declare function format(source: string): string;
|
|
12
|
+
|
|
13
|
+
export { format, print };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ type Options = {
|
|
|
6
6
|
source?: string;
|
|
7
7
|
baseName?: string;
|
|
8
8
|
} & PrinterOptions;
|
|
9
|
-
declare function print(elements:
|
|
9
|
+
declare function print(elements: Array<ts.Node>, { source, baseName, removeComments, noEmitHelpers, newLine }?: Options): string;
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
declare function format(source: string): string;
|
|
12
|
+
|
|
13
|
+
export { format, print };
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,11 @@ function print(elements, { source = "", baseName = "print.ts", removeComments, n
|
|
|
26
26
|
return [outputFile, restoreNewLines(outputSource)].filter(Boolean).join("\n");
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
// src/format.ts
|
|
30
|
+
function format(source) {
|
|
31
|
+
return print([], { source, noEmitHelpers: false });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { format, print };
|
|
30
35
|
//# sourceMappingURL=index.js.map
|
|
31
36
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/print.ts"],"names":[],"mappings":";;;AAIA,IAAM,EAAE,SAAY,GAAA,EAAA,CAAA;AAYpB,IAAM,iBAAiB,CAAC,IAAA,KAAiB,IAAK,CAAA,OAAA,CAAQ,SAAS,mBAAmB,CAAA,CAAA;AAOlF,IAAM,kBAAkB,CAAC,IAAA,KAAiB,IAAK,CAAA,OAAA,CAAQ,wBAAwB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E","file":"index.js","sourcesContent":["import ts from 'typescript'\n\nimport type { PrinterOptions } from 'typescript'\n\nconst { factory } = ts\n\ntype Options = {\n source?: string\n baseName?: string\n} & PrinterOptions\n\n/**\n * Escaped new lines in code with block comments so they can be restored by {@link restoreNewLines}\n * @param {string} code The code to escape new lines in\n * @returns The same code but with new lines escaped using block comments\n */\nconst escapeNewLines = (code: string) => code.replace(/\\n\\n/g, '\\n/* :newline: */')\n\n/**\n * Reverses {@link escapeNewLines} and restores new lines\n * @param {string} code The code with escaped new lines\n * @returns The same code with new lines restored\n */\nconst restoreNewLines = (code: string) => code.replace(/\\/\\* :newline: \\*\\//g, '\\n')\n\nexport function print(\n elements:
|
|
1
|
+
{"version":3,"sources":["../src/print.ts","../src/format.ts"],"names":[],"mappings":";;;AAIA,IAAM,EAAE,SAAY,GAAA,EAAA,CAAA;AAYpB,IAAM,iBAAiB,CAAC,IAAA,KAAiB,IAAK,CAAA,OAAA,CAAQ,SAAS,mBAAmB,CAAA,CAAA;AAOlF,IAAM,kBAAkB,CAAC,IAAA,KAAiB,IAAK,CAAA,OAAA,CAAQ,wBAAwB,IAAI,CAAA,CAAA;AAE5E,SAAS,KACd,CAAA,QAAA,EACA,EAAE,MAAA,GAAS,IAAI,QAAW,GAAA,UAAA,EAAY,cAAgB,EAAA,aAAA,EAAe,UAAU,EAAG,CAAA,WAAA,CAAY,QAAS,EAAA,GAAa,EAC5G,EAAA;AACR,EAAA,MAAM,UAAa,GAAA,EAAA,CAAG,gBAAiB,CAAA,QAAA,EAAU,cAAe,CAAA,MAAM,CAAG,EAAA,EAAA,CAAG,YAAa,CAAA,MAAA,EAAQ,KAAO,EAAA,EAAA,CAAG,WAAW,EAAE,CAAA,CAAA;AACxH,EAAM,MAAA,OAAA,GAAU,GAAG,aAAc,CAAA;AAAA,IAC/B,qBAAuB,EAAA,IAAA;AAAA,IACvB,OAAA;AAAA,IACA,cAAA;AAAA,IACA,aAAA;AAAA,GACD,CAAA,CAAA;AAED,EAAA,IAAI,QAAwB,EAAC,CAAA;AAE7B,EAAA,IAAI,CAAC,QAAU,EAAA;AACb,IAAO,OAAA,EAAA,CAAA;AAAA,GACT;AAEA,EAAI,IAAA,KAAA,CAAM,OAAQ,CAAA,QAAQ,CAAG,EAAA;AAC3B,IAAQ,KAAA,GAAA,QAAA,CAAS,OAAO,OAAO,CAAA,CAAA;AAAA,GAC1B,MAAA;AACL,IAAA,KAAA,GAAQ,CAAC,QAAQ,CAAE,CAAA,MAAA,CAAO,OAAO,CAAA,CAAA;AAAA,GACnC;AAEA,EAAM,MAAA,UAAA,GAAa,OAAQ,CAAA,SAAA,CAAU,EAAG,CAAA,UAAA,CAAW,WAAW,OAAQ,CAAA,eAAA,CAAgB,KAAK,CAAA,EAAG,UAAU,CAAA,CAAA;AACxG,EAAM,MAAA,YAAA,GAAe,OAAQ,CAAA,SAAA,CAAU,UAAU,CAAA,CAAA;AAEjD,EAAO,OAAA,CAAC,UAAY,EAAA,eAAA,CAAgB,YAAY,CAAC,EAAE,MAAO,CAAA,OAAO,CAAE,CAAA,IAAA,CAAK,IAAI,CAAA,CAAA;AAC9E,CAAA;;;ACnDO,SAAS,OAAO,MAAgB,EAAA;AAErC,EAAA,OAAO,MAAM,EAAC,EAAG,EAAE,MAAQ,EAAA,aAAA,EAAe,OAAO,CAAA,CAAA;AACnD","file":"index.js","sourcesContent":["import ts from 'typescript'\n\nimport type { PrinterOptions } from 'typescript'\n\nconst { factory } = ts\n\ntype Options = {\n source?: string\n baseName?: string\n} & PrinterOptions\n\n/**\n * Escaped new lines in code with block comments so they can be restored by {@link restoreNewLines}\n * @param {string} code The code to escape new lines in\n * @returns The same code but with new lines escaped using block comments\n */\nconst escapeNewLines = (code: string) => code.replace(/\\n\\n/g, '\\n/* :newline: */')\n\n/**\n * Reverses {@link escapeNewLines} and restores new lines\n * @param {string} code The code with escaped new lines\n * @returns The same code with new lines restored\n */\nconst restoreNewLines = (code: string) => code.replace(/\\/\\* :newline: \\*\\//g, '\\n')\n\nexport function print(\n elements: Array<ts.Node>,\n { source = '', baseName = 'print.ts', removeComments, noEmitHelpers, newLine = ts.NewLineKind.LineFeed }: Options = {},\n): string {\n const sourceFile = ts.createSourceFile(baseName, escapeNewLines(source), ts.ScriptTarget.ES2022, false, ts.ScriptKind.TS)\n const printer = ts.createPrinter({\n omitTrailingSemicolon: true,\n newLine,\n removeComments,\n noEmitHelpers,\n })\n\n let nodes: Array<ts.Node> = []\n\n if (!elements) {\n return ''\n }\n\n if (Array.isArray(elements)) {\n nodes = elements.filter(Boolean)\n } else {\n nodes = [elements].filter(Boolean)\n }\n\n const outputFile = printer.printList(ts.ListFormat.MultiLine, factory.createNodeArray(nodes), sourceFile)\n const outputSource = printer.printFile(sourceFile)\n\n return [outputFile, restoreNewLines(outputSource)].filter(Boolean).join('\\n')\n}\n","import { print } from './print.ts'\n\nexport function format(source: string) {\n // do some basic linting with the ts compiler\n return print([], { source, noEmitHelpers: false })\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/parser-ts",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.14",
|
|
4
4
|
"description": "TypeScript parser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -48,16 +48,15 @@
|
|
|
48
48
|
"!/**/__tests__/**"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"remeda": "^2.
|
|
51
|
+
"remeda": "^2.12.0",
|
|
52
52
|
"ts-morph": "^23.0.0",
|
|
53
53
|
"typescript": "^5.5.4"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"prettier": "^3.3.3",
|
|
57
56
|
"tsup": "^8.2.4",
|
|
58
|
-
"@kubb/config-biome": "3.0.0-alpha.
|
|
59
|
-
"@kubb/config-ts": "3.0.0-alpha.
|
|
60
|
-
"@kubb/config-tsup": "3.0.0-alpha.
|
|
57
|
+
"@kubb/config-biome": "3.0.0-alpha.14",
|
|
58
|
+
"@kubb/config-ts": "3.0.0-alpha.14",
|
|
59
|
+
"@kubb/config-tsup": "3.0.0-alpha.14"
|
|
61
60
|
},
|
|
62
61
|
"engines": {
|
|
63
62
|
"node": ">=20"
|
package/src/format.ts
ADDED
package/src/index.ts
CHANGED
package/src/print.ts
CHANGED
|
@@ -24,7 +24,7 @@ const escapeNewLines = (code: string) => code.replace(/\n\n/g, '\n/* :newline: *
|
|
|
24
24
|
const restoreNewLines = (code: string) => code.replace(/\/\* :newline: \*\//g, '\n')
|
|
25
25
|
|
|
26
26
|
export function print(
|
|
27
|
-
elements:
|
|
27
|
+
elements: Array<ts.Node>,
|
|
28
28
|
{ source = '', baseName = 'print.ts', removeComments, noEmitHelpers, newLine = ts.NewLineKind.LineFeed }: Options = {},
|
|
29
29
|
): string {
|
|
30
30
|
const sourceFile = ts.createSourceFile(baseName, escapeNewLines(source), ts.ScriptTarget.ES2022, false, ts.ScriptKind.TS)
|