@sapphire/docusaurus-plugin-ts2esm2cjs 1.1.4-next.d66cfae.0 → 1.1.4-next.de970bf.0
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 +7 -19
- package/dist/index.d.ts +12 -2
- package/dist/index.js +42 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -8
package/README.md
CHANGED
|
@@ -158,28 +158,16 @@ below to donate through your method of choice.
|
|
|
158
158
|
| Patreon | [Click Here](https://sapphirejs.dev/patreon) |
|
|
159
159
|
| PayPal | [Click Here](https://sapphirejs.dev/paypal) |
|
|
160
160
|
|
|
161
|
-
## Contributors
|
|
161
|
+
## Contributors
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
Please make sure to read the [Contributing Guide][contributing] before making a pull request.
|
|
164
164
|
|
|
165
|
-
|
|
166
|
-
<!-- prettier-ignore-start -->
|
|
167
|
-
<!-- markdownlint-disable -->
|
|
168
|
-
<table>
|
|
169
|
-
<tr>
|
|
170
|
-
<td align="center"><a href="https://favware.tech/"><img src="https://avatars3.githubusercontent.com/u/4019718?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jeroen Claassens</b></sub></a><br /><a href="https://github.com/sapphiredev/documentation-plugins/commits?author=favna" title="Code">💻</a> <a href="#infra-favna" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#projectManagement-favna" title="Project Management">📆</a></td>
|
|
171
|
-
<td align="center"><a href="https://github.com/apps/renovate"><img src="https://avatars.githubusercontent.com/in/2740?v=4?s=100" width="100px;" alt=""/><br /><sub><b>renovate[bot]</b></sub></a><br /><a href="#maintenance-renovate[bot]" title="Maintenance">🚧</a></td>
|
|
172
|
-
<td align="center"><a href="https://renovate.whitesourcesoftware.com/"><img src="https://avatars.githubusercontent.com/u/25180681?v=4?s=100" width="100px;" alt=""/><br /><sub><b>WhiteSource Renovate</b></sub></a><br /><a href="#maintenance-renovate-bot" title="Maintenance">🚧</a></td>
|
|
173
|
-
</tr>
|
|
174
|
-
</table>
|
|
165
|
+
Thank you to all the people who already contributed to Sapphire!
|
|
175
166
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
180
|
-
|
|
181
|
-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification.
|
|
182
|
-
Contributions of any kind welcome!
|
|
167
|
+
<a href="https://github.com/sapphiredev/documentation-plugins/graphs/contributors">
|
|
168
|
+
<img src="https://contrib.rocks/image?repo=sapphiredev/documentation-plugins" />
|
|
169
|
+
</a>
|
|
183
170
|
|
|
171
|
+
[contributing]: https://github.com/sapphiredev/.github/blob/main/.github/CONTRIBUTING.md
|
|
184
172
|
[docconf]: https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#ex-config
|
|
185
173
|
[line-highlighting]: https://docusaurus.io/docs/markdown-features/code-blocks#line-highlighting
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
|
+
import { Plugin } from 'unified';
|
|
1
2
|
import { Options } from 'prettier';
|
|
2
3
|
import { CompilerOptions } from 'typescript';
|
|
3
|
-
import { Plugin } from 'unified';
|
|
4
4
|
|
|
5
5
|
interface PluginOptions {
|
|
6
6
|
sync?: boolean;
|
|
7
7
|
prettierOptions?: Options;
|
|
8
8
|
typescriptCompilerOptions?: CompilerOptions;
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Transforms input TypeScript code to ESM code.
|
|
13
|
+
* @param input The TypeScript code to transform
|
|
14
|
+
* @param options The plugin options
|
|
15
|
+
* @returns The transformed code (ESM)
|
|
16
|
+
*/
|
|
17
|
+
declare function ts2esm(input: string, options: PluginOptions): string;
|
|
18
|
+
declare function esm2cjs(input: string, options: PluginOptions): string;
|
|
19
|
+
|
|
10
20
|
declare const ts2esm2cjs: Plugin<[PluginOptions?]>;
|
|
11
21
|
|
|
12
|
-
export { PluginOptions, ts2esm2cjs };
|
|
22
|
+
export { PluginOptions, esm2cjs, ts2esm, ts2esm2cjs };
|
package/dist/index.js
CHANGED
|
@@ -17,27 +17,31 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
21
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
29
|
|
|
23
30
|
// src/index.ts
|
|
24
31
|
var src_exports = {};
|
|
25
32
|
__export(src_exports, {
|
|
33
|
+
esm2cjs: () => esm2cjs,
|
|
34
|
+
ts2esm: () => ts2esm,
|
|
26
35
|
ts2esm2cjs: () => ts2esm2cjs
|
|
27
36
|
});
|
|
28
37
|
module.exports = __toCommonJS(src_exports);
|
|
38
|
+
var import_unist_util_visit = __toESM(require("unist-util-visit"));
|
|
39
|
+
|
|
40
|
+
// src/ts2esm2cjs.ts
|
|
29
41
|
var import_prettier_config = __toESM(require("@sapphire/prettier-config"));
|
|
30
42
|
var import_esm_to_cjs = require("esm-to-cjs");
|
|
31
43
|
var import_prettier = __toESM(require("prettier"));
|
|
32
44
|
var import_typescript = __toESM(require("typescript"));
|
|
33
|
-
var import_unist_util_visit = __toESM(require("unist-util-visit"));
|
|
34
|
-
var documentationPrettierConfig = {
|
|
35
|
-
...import_prettier_config.default,
|
|
36
|
-
tabWidth: 2,
|
|
37
|
-
useTabs: false,
|
|
38
|
-
printWidth: 120,
|
|
39
|
-
parser: "babel"
|
|
40
|
-
};
|
|
41
45
|
var makeTsCompilerOptions = (overrideOptions) => ({
|
|
42
46
|
newLine: import_typescript.default.NewLineKind.LineFeed,
|
|
43
47
|
removeComments: false,
|
|
@@ -48,17 +52,37 @@ var makeTsCompilerOptions = (overrideOptions) => ({
|
|
|
48
52
|
moduleResolution: import_typescript.default.ModuleResolutionKind.NodeJs,
|
|
49
53
|
target: import_typescript.default.ScriptTarget.ESNext
|
|
50
54
|
});
|
|
51
|
-
var
|
|
55
|
+
var documentationPrettierConfig = {
|
|
56
|
+
...import_prettier_config.default,
|
|
57
|
+
tabWidth: 2,
|
|
58
|
+
useTabs: false,
|
|
59
|
+
printWidth: 120,
|
|
60
|
+
parser: "babel"
|
|
61
|
+
};
|
|
52
62
|
var esmToCjs = (code) => (0, import_esm_to_cjs.runTransform)(code, { quote: "single", lenDestructure: 128, lenModuleName: 128, lenIdentifier: 128 });
|
|
53
63
|
var escapeNewLines = (code) => code.replace(/\n\n/g, "\n/* :newline: */");
|
|
54
64
|
var restoreNewLines = (code) => code.replace(/\/\* :newline: \*\//g, "\n");
|
|
55
65
|
var prettierFormatCode = (code, prettierConfig) => import_prettier.default.format(code, { ...documentationPrettierConfig, ...prettierConfig }).slice(0, -1);
|
|
66
|
+
var tsToEsm = (code, options) => import_typescript.default.transpileModule(code, { reportDiagnostics: false, compilerOptions: makeTsCompilerOptions(options.typescriptCompilerOptions) });
|
|
67
|
+
function ts2esm(input, options) {
|
|
68
|
+
const tsCode = escapeNewLines(input);
|
|
69
|
+
const esmCode = tsToEsm(tsCode, { typescriptCompilerOptions: options.typescriptCompilerOptions }).outputText;
|
|
70
|
+
return prettierFormatCode(restoreNewLines(esmCode), options.prettierOptions);
|
|
71
|
+
}
|
|
72
|
+
function esm2cjs(input, options) {
|
|
73
|
+
const cjsCode = esmToCjs(input);
|
|
74
|
+
return prettierFormatCode(restoreNewLines(cjsCode), options.prettierOptions);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// src/index.ts
|
|
56
78
|
var transformNode = (node, options) => {
|
|
57
79
|
const groupIdProp = options.sync ? ' groupId="ts2esm2cjs"' : "";
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
80
|
+
const esmCode = ts2esm(node.value, options);
|
|
81
|
+
const cjsCode = esm2cjs(esmCode, options);
|
|
82
|
+
let [, jsHighlight, tsHighlight] = (node.meta ?? "").split("|");
|
|
83
|
+
if (!tsHighlight && jsHighlight) {
|
|
84
|
+
tsHighlight = jsHighlight;
|
|
85
|
+
}
|
|
62
86
|
return [
|
|
63
87
|
{
|
|
64
88
|
type: "jsx",
|
|
@@ -76,7 +100,7 @@ var transformNode = (node, options) => {
|
|
|
76
100
|
type: node.type,
|
|
77
101
|
lang: node.lang,
|
|
78
102
|
meta: `${jsHighlight} showLineNumbers`,
|
|
79
|
-
value:
|
|
103
|
+
value: cjsCode
|
|
80
104
|
},
|
|
81
105
|
{
|
|
82
106
|
type: "jsx",
|
|
@@ -86,7 +110,7 @@ var transformNode = (node, options) => {
|
|
|
86
110
|
type: node.type,
|
|
87
111
|
lang: node.lang,
|
|
88
112
|
meta: `${jsHighlight} showLineNumbers`,
|
|
89
|
-
value:
|
|
113
|
+
value: esmCode
|
|
90
114
|
},
|
|
91
115
|
{
|
|
92
116
|
type: "jsx",
|
|
@@ -141,6 +165,8 @@ var ts2esm2cjs = ({ sync = true, prettierOptions = {}, typescriptCompilerOptions
|
|
|
141
165
|
};
|
|
142
166
|
// Annotate the CommonJS export names for ESM import in node:
|
|
143
167
|
0 && (module.exports = {
|
|
168
|
+
esm2cjs,
|
|
169
|
+
ts2esm,
|
|
144
170
|
ts2esm2cjs
|
|
145
171
|
});
|
|
146
172
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/ts2esm2cjs.ts"],"sourcesContent":["import type { Code, Content, Literal } from 'mdast';\nimport type { Plugin } from 'unified';\nimport type { Node, Parent } from 'unist';\nimport visit from 'unist-util-visit';\nimport { esm2cjs, ts2esm } from './ts2esm2cjs';\nimport type { PluginOptions } from './types';\n\nexport { esm2cjs, ts2esm } from './ts2esm2cjs';\nexport type { PluginOptions } from './types';\n\n/**\n * Transforms a Docusaurus node from TypeScript to ESM and CJS\n * @param node The Docusaurus node to transform\n * @param options The plugin options to pass to the transformer\n * @returns The transformed node in the form of Tabs.\n */\nconst transformNode = (node: Code, options: PluginOptions) => {\n\tconst groupIdProp = options.sync ? ' groupId=\"ts2esm2cjs\"' : '';\n\n\tconst esmCode = ts2esm(node.value, options);\n\tconst cjsCode = esm2cjs(esmCode, options);\n\n\tlet [, jsHighlight, tsHighlight] = (node.meta ?? '').split('|');\n\n\tif (!tsHighlight && jsHighlight) {\n\t\ttsHighlight = jsHighlight;\n\t}\n\n\treturn [\n\t\t{\n\t\t\ttype: 'jsx',\n\t\t\tvalue: `<Tabs${groupIdProp}\n\t\t\t\t\t\tdefaultValue=\"typescript\"\n\t\t\t\t\t\tvalues={[\n\t\t\t\t\t\t\t{ label: \"JavaScript\", value: \"javascript\" },\n\t\t\t\t\t\t\t{ label: \"ESM\", value: \"esm\" },\n\t\t\t\t\t\t\t{ label: \"TypeScript\", value: \"typescript\" },\n\t\t\t\t\t\t]}\n\t\t\t>\\n<TabItem value=\"javascript\">`\n\t\t},\n\t\t{\n\t\t\ttype: node.type,\n\t\t\tlang: node.lang,\n\t\t\tmeta: `${jsHighlight} showLineNumbers`,\n\t\t\tvalue: cjsCode\n\t\t},\n\t\t{\n\t\t\ttype: 'jsx',\n\t\t\tvalue: '</TabItem>\\n<TabItem value=\"esm\">'\n\t\t},\n\t\t{\n\t\t\ttype: node.type,\n\t\t\tlang: node.lang,\n\t\t\tmeta: `${jsHighlight} showLineNumbers`,\n\t\t\tvalue: esmCode\n\t\t},\n\t\t{\n\t\t\ttype: 'jsx',\n\t\t\tvalue: '</TabItem>\\n<TabItem value=\"typescript\">'\n\t\t},\n\t\t{\n\t\t\ttype: node.type,\n\t\t\tlang: node.lang,\n\t\t\tmeta: `${tsHighlight} showLineNumbers`,\n\t\t\tvalue: node.value\n\t\t},\n\t\t{\n\t\t\ttype: 'jsx',\n\t\t\tvalue: '</TabItem>\\n</Tabs>'\n\t\t}\n\t] as Content[];\n};\n\nconst isImport = (node: Node): node is Literal => node.type === 'import';\nconst isParent = (node: Node): node is Parent => Array.isArray((node as Parent).children);\nconst matchNode = (node: Node): node is Code =>\n\tnode.type === 'code' && typeof (node as Code).meta === 'string' && ((node as Code).meta ?? '').startsWith('ts2esm2cjs');\nconst nodeForImport: Literal = {\n\ttype: 'import',\n\tvalue: \"import Tabs from '@theme/Tabs';\\nimport TabItem from '@theme/TabItem';\"\n};\n\nexport const ts2esm2cjs: Plugin<[PluginOptions?]> = (\n\t{ sync = true, prettierOptions = {}, typescriptCompilerOptions = {} } = { sync: true, prettierOptions: {}, typescriptCompilerOptions: {} }\n) => {\n\treturn (root) => {\n\t\tlet transformed = false;\n\t\tlet alreadyImported = false;\n\t\tvisit(root, (node: Node) => {\n\t\t\tif (isImport(node) && node.value.includes('@theme/Tabs')) {\n\t\t\t\talreadyImported = true;\n\t\t\t}\n\t\t\tif (isParent(node)) {\n\t\t\t\tlet index = 0;\n\t\t\t\twhile (index < node.children.length) {\n\t\t\t\t\tconst child = node.children[index]!;\n\t\t\t\t\tif (matchNode(child)) {\n\t\t\t\t\t\tconst result = transformNode(child, { sync, prettierOptions, typescriptCompilerOptions });\n\t\t\t\t\t\tnode.children.splice(index, 1, ...result);\n\t\t\t\t\t\tindex += result.length;\n\t\t\t\t\t\ttransformed = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tindex += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tif (transformed && !alreadyImported) {\n\t\t\t(root as Parent).children.unshift(nodeForImport);\n\t\t}\n\t};\n};\n","import sapphirePrettierConfig from '@sapphire/prettier-config';\nimport { runTransform } from 'esm-to-cjs';\nimport prettier, { type Options } from 'prettier';\nimport ts, { type CompilerOptions } from 'typescript';\nimport type { PluginOptions } from './types';\n\nconst makeTsCompilerOptions = (overrideOptions?: CompilerOptions): CompilerOptions => ({\n\tnewLine: ts.NewLineKind.LineFeed,\n\tremoveComments: false,\n\tesModuleInterop: true,\n\tpretty: true,\n\t...overrideOptions,\n\tmodule: ts.ModuleKind.ESNext,\n\tmoduleResolution: ts.ModuleResolutionKind.NodeJs,\n\ttarget: ts.ScriptTarget.ESNext\n});\n\nconst documentationPrettierConfig: Options = {\n\t...sapphirePrettierConfig,\n\ttabWidth: 2,\n\tuseTabs: false,\n\tprintWidth: 120,\n\tparser: 'babel'\n};\n\n/**\n * Transforms input ESM code to CJS code.\n * @param code The code to transform\n * @returns Input code transformed to CommonJS\n */\nconst esmToCjs = (code: string): string => runTransform(code, { quote: 'single', lenDestructure: 128, lenModuleName: 128, lenIdentifier: 128 });\n\n/**\n * Escaped new lines in code with block comments so they can be restored by {@link restoreNewLines}\n * @param 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 code The code with escaped new lines\n * @returns The same code with new lines restored\n */\nconst restoreNewLines = (code: string): string => code.replace(/\\/\\* :newline: \\*\\//g, '\\n');\n\n/**\n * Formats the code using Prettier\n * @param code The code to prettier format\n * @param prettierConfig Additional prettier options to use for formatting\n * @returns Prettier formatted code\n */\nconst prettierFormatCode = (code: string, prettierConfig?: Options) =>\n\tprettier.format(code, { ...documentationPrettierConfig, ...prettierConfig }).slice(0, -1);\n\n/**\n * Transpiles input TypeScript code to ESM code.\n * @param code The code to transpile\n * @returns Input code transpiled to ESM\n */\nconst tsToEsm = (code: string, options: Pick<PluginOptions, 'typescriptCompilerOptions'>): ts.TranspileOutput =>\n\tts.transpileModule(code, { reportDiagnostics: false, compilerOptions: makeTsCompilerOptions(options.typescriptCompilerOptions) });\n\n/**\n * Transforms input TypeScript code to ESM code.\n * @param input The TypeScript code to transform\n * @param options The plugin options\n * @returns The transformed code (ESM)\n */\nexport function ts2esm(input: string, options: PluginOptions) {\n\tconst tsCode = escapeNewLines(input);\n\tconst esmCode = tsToEsm(tsCode, { typescriptCompilerOptions: options.typescriptCompilerOptions }).outputText;\n\n\treturn prettierFormatCode(restoreNewLines(esmCode), options.prettierOptions);\n}\n\nexport function esm2cjs(input: string, options: PluginOptions) {\n\tconst cjsCode = esmToCjs(input);\n\n\treturn prettierFormatCode(restoreNewLines(cjsCode), options.prettierOptions);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,8BAAkB;;;ACHlB,6BAAmC;AACnC,wBAA6B;AAC7B,sBAAuC;AACvC,wBAAyC;AAGzC,IAAM,wBAAwB,CAAC,qBAAwD;AAAA,EACtF,SAAS,kBAAAA,QAAG,YAAY;AAAA,EACxB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,QAAQ;AAAA,EACR,GAAG;AAAA,EACH,QAAQ,kBAAAA,QAAG,WAAW;AAAA,EACtB,kBAAkB,kBAAAA,QAAG,qBAAqB;AAAA,EAC1C,QAAQ,kBAAAA,QAAG,aAAa;AACzB;AAEA,IAAM,8BAAuC;AAAA,EAC5C,GAAG,uBAAAC;AAAA,EACH,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AACT;AAOA,IAAM,WAAW,CAAC,aAAyB,gCAAa,MAAM,EAAE,OAAO,UAAU,gBAAgB,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S,cAAc,OAAO,EAAE,MAAM,iBAAiB,0BAA0B,CAAC;AACxF,iBAAK,SAAS,OAAO,OAAO,GAAG,GAAG,MAAM;AACxC,qBAAS,OAAO;AAChB,0BAAc;AAAA,UACf,OAAO;AACN,qBAAS;AAAA,UACV;AAAA,QACD;AAAA,MACD;AAAA,IACD,CAAC;AACD,QAAI,eAAe,CAAC,iBAAiB;AACpC,MAAC,KAAgB,SAAS,QAAQ,aAAa;AAAA,IAChD;AAAA,EACD;AACD;","names":["ts","sapphirePrettierConfig","prettier","visit"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
+
import visit from "unist-util-visit";
|
|
3
|
+
|
|
4
|
+
// src/ts2esm2cjs.ts
|
|
2
5
|
import sapphirePrettierConfig from "@sapphire/prettier-config";
|
|
3
6
|
import { runTransform } from "esm-to-cjs";
|
|
4
7
|
import prettier from "prettier";
|
|
5
8
|
import ts from "typescript";
|
|
6
|
-
import visit from "unist-util-visit";
|
|
7
|
-
var documentationPrettierConfig = {
|
|
8
|
-
...sapphirePrettierConfig,
|
|
9
|
-
tabWidth: 2,
|
|
10
|
-
useTabs: false,
|
|
11
|
-
printWidth: 120,
|
|
12
|
-
parser: "babel"
|
|
13
|
-
};
|
|
14
9
|
var makeTsCompilerOptions = (overrideOptions) => ({
|
|
15
10
|
newLine: ts.NewLineKind.LineFeed,
|
|
16
11
|
removeComments: false,
|
|
@@ -21,17 +16,37 @@ var makeTsCompilerOptions = (overrideOptions) => ({
|
|
|
21
16
|
moduleResolution: ts.ModuleResolutionKind.NodeJs,
|
|
22
17
|
target: ts.ScriptTarget.ESNext
|
|
23
18
|
});
|
|
24
|
-
var
|
|
19
|
+
var documentationPrettierConfig = {
|
|
20
|
+
...sapphirePrettierConfig,
|
|
21
|
+
tabWidth: 2,
|
|
22
|
+
useTabs: false,
|
|
23
|
+
printWidth: 120,
|
|
24
|
+
parser: "babel"
|
|
25
|
+
};
|
|
25
26
|
var esmToCjs = (code) => runTransform(code, { quote: "single", lenDestructure: 128, lenModuleName: 128, lenIdentifier: 128 });
|
|
26
27
|
var escapeNewLines = (code) => code.replace(/\n\n/g, "\n/* :newline: */");
|
|
27
28
|
var restoreNewLines = (code) => code.replace(/\/\* :newline: \*\//g, "\n");
|
|
28
29
|
var prettierFormatCode = (code, prettierConfig) => prettier.format(code, { ...documentationPrettierConfig, ...prettierConfig }).slice(0, -1);
|
|
30
|
+
var tsToEsm = (code, options) => ts.transpileModule(code, { reportDiagnostics: false, compilerOptions: makeTsCompilerOptions(options.typescriptCompilerOptions) });
|
|
31
|
+
function ts2esm(input, options) {
|
|
32
|
+
const tsCode = escapeNewLines(input);
|
|
33
|
+
const esmCode = tsToEsm(tsCode, { typescriptCompilerOptions: options.typescriptCompilerOptions }).outputText;
|
|
34
|
+
return prettierFormatCode(restoreNewLines(esmCode), options.prettierOptions);
|
|
35
|
+
}
|
|
36
|
+
function esm2cjs(input, options) {
|
|
37
|
+
const cjsCode = esmToCjs(input);
|
|
38
|
+
return prettierFormatCode(restoreNewLines(cjsCode), options.prettierOptions);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// src/index.ts
|
|
29
42
|
var transformNode = (node, options) => {
|
|
30
43
|
const groupIdProp = options.sync ? ' groupId="ts2esm2cjs"' : "";
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
44
|
+
const esmCode = ts2esm(node.value, options);
|
|
45
|
+
const cjsCode = esm2cjs(esmCode, options);
|
|
46
|
+
let [, jsHighlight, tsHighlight] = (node.meta ?? "").split("|");
|
|
47
|
+
if (!tsHighlight && jsHighlight) {
|
|
48
|
+
tsHighlight = jsHighlight;
|
|
49
|
+
}
|
|
35
50
|
return [
|
|
36
51
|
{
|
|
37
52
|
type: "jsx",
|
|
@@ -49,7 +64,7 @@ var transformNode = (node, options) => {
|
|
|
49
64
|
type: node.type,
|
|
50
65
|
lang: node.lang,
|
|
51
66
|
meta: `${jsHighlight} showLineNumbers`,
|
|
52
|
-
value:
|
|
67
|
+
value: cjsCode
|
|
53
68
|
},
|
|
54
69
|
{
|
|
55
70
|
type: "jsx",
|
|
@@ -59,7 +74,7 @@ var transformNode = (node, options) => {
|
|
|
59
74
|
type: node.type,
|
|
60
75
|
lang: node.lang,
|
|
61
76
|
meta: `${jsHighlight} showLineNumbers`,
|
|
62
|
-
value:
|
|
77
|
+
value: esmCode
|
|
63
78
|
},
|
|
64
79
|
{
|
|
65
80
|
type: "jsx",
|
|
@@ -113,6 +128,8 @@ var ts2esm2cjs = ({ sync = true, prettierOptions = {}, typescriptCompilerOptions
|
|
|
113
128
|
};
|
|
114
129
|
};
|
|
115
130
|
export {
|
|
131
|
+
esm2cjs,
|
|
132
|
+
ts2esm,
|
|
116
133
|
ts2esm2cjs
|
|
117
134
|
};
|
|
118
135
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/ts2esm2cjs.ts"],"sourcesContent":["import type { Code, Content, Literal } from 'mdast';\nimport type { Plugin } from 'unified';\nimport type { Node, Parent } from 'unist';\nimport visit from 'unist-util-visit';\nimport { esm2cjs, ts2esm } from './ts2esm2cjs';\nimport type { PluginOptions } from './types';\n\nexport { esm2cjs, ts2esm } from './ts2esm2cjs';\nexport type { PluginOptions } from './types';\n\n/**\n * Transforms a Docusaurus node from TypeScript to ESM and CJS\n * @param node The Docusaurus node to transform\n * @param options The plugin options to pass to the transformer\n * @returns The transformed node in the form of Tabs.\n */\nconst transformNode = (node: Code, options: PluginOptions) => {\n\tconst groupIdProp = options.sync ? ' groupId=\"ts2esm2cjs\"' : '';\n\n\tconst esmCode = ts2esm(node.value, options);\n\tconst cjsCode = esm2cjs(esmCode, options);\n\n\tlet [, jsHighlight, tsHighlight] = (node.meta ?? '').split('|');\n\n\tif (!tsHighlight && jsHighlight) {\n\t\ttsHighlight = jsHighlight;\n\t}\n\n\treturn [\n\t\t{\n\t\t\ttype: 'jsx',\n\t\t\tvalue: `<Tabs${groupIdProp}\n\t\t\t\t\t\tdefaultValue=\"typescript\"\n\t\t\t\t\t\tvalues={[\n\t\t\t\t\t\t\t{ label: \"JavaScript\", value: \"javascript\" },\n\t\t\t\t\t\t\t{ label: \"ESM\", value: \"esm\" },\n\t\t\t\t\t\t\t{ label: \"TypeScript\", value: \"typescript\" },\n\t\t\t\t\t\t]}\n\t\t\t>\\n<TabItem value=\"javascript\">`\n\t\t},\n\t\t{\n\t\t\ttype: node.type,\n\t\t\tlang: node.lang,\n\t\t\tmeta: `${jsHighlight} showLineNumbers`,\n\t\t\tvalue: cjsCode\n\t\t},\n\t\t{\n\t\t\ttype: 'jsx',\n\t\t\tvalue: '</TabItem>\\n<TabItem value=\"esm\">'\n\t\t},\n\t\t{\n\t\t\ttype: node.type,\n\t\t\tlang: node.lang,\n\t\t\tmeta: `${jsHighlight} showLineNumbers`,\n\t\t\tvalue: esmCode\n\t\t},\n\t\t{\n\t\t\ttype: 'jsx',\n\t\t\tvalue: '</TabItem>\\n<TabItem value=\"typescript\">'\n\t\t},\n\t\t{\n\t\t\ttype: node.type,\n\t\t\tlang: node.lang,\n\t\t\tmeta: `${tsHighlight} showLineNumbers`,\n\t\t\tvalue: node.value\n\t\t},\n\t\t{\n\t\t\ttype: 'jsx',\n\t\t\tvalue: '</TabItem>\\n</Tabs>'\n\t\t}\n\t] as Content[];\n};\n\nconst isImport = (node: Node): node is Literal => node.type === 'import';\nconst isParent = (node: Node): node is Parent => Array.isArray((node as Parent).children);\nconst matchNode = (node: Node): node is Code =>\n\tnode.type === 'code' && typeof (node as Code).meta === 'string' && ((node as Code).meta ?? '').startsWith('ts2esm2cjs');\nconst nodeForImport: Literal = {\n\ttype: 'import',\n\tvalue: \"import Tabs from '@theme/Tabs';\\nimport TabItem from '@theme/TabItem';\"\n};\n\nexport const ts2esm2cjs: Plugin<[PluginOptions?]> = (\n\t{ sync = true, prettierOptions = {}, typescriptCompilerOptions = {} } = { sync: true, prettierOptions: {}, typescriptCompilerOptions: {} }\n) => {\n\treturn (root) => {\n\t\tlet transformed = false;\n\t\tlet alreadyImported = false;\n\t\tvisit(root, (node: Node) => {\n\t\t\tif (isImport(node) && node.value.includes('@theme/Tabs')) {\n\t\t\t\talreadyImported = true;\n\t\t\t}\n\t\t\tif (isParent(node)) {\n\t\t\t\tlet index = 0;\n\t\t\t\twhile (index < node.children.length) {\n\t\t\t\t\tconst child = node.children[index]!;\n\t\t\t\t\tif (matchNode(child)) {\n\t\t\t\t\t\tconst result = transformNode(child, { sync, prettierOptions, typescriptCompilerOptions });\n\t\t\t\t\t\tnode.children.splice(index, 1, ...result);\n\t\t\t\t\t\tindex += result.length;\n\t\t\t\t\t\ttransformed = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tindex += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tif (transformed && !alreadyImported) {\n\t\t\t(root as Parent).children.unshift(nodeForImport);\n\t\t}\n\t};\n};\n","import sapphirePrettierConfig from '@sapphire/prettier-config';\nimport { runTransform } from 'esm-to-cjs';\nimport prettier, { type Options } from 'prettier';\nimport ts, { type CompilerOptions } from 'typescript';\nimport type { PluginOptions } from './types';\n\nconst makeTsCompilerOptions = (overrideOptions?: CompilerOptions): CompilerOptions => ({\n\tnewLine: ts.NewLineKind.LineFeed,\n\tremoveComments: false,\n\tesModuleInterop: true,\n\tpretty: true,\n\t...overrideOptions,\n\tmodule: ts.ModuleKind.ESNext,\n\tmoduleResolution: ts.ModuleResolutionKind.NodeJs,\n\ttarget: ts.ScriptTarget.ESNext\n});\n\nconst documentationPrettierConfig: Options = {\n\t...sapphirePrettierConfig,\n\ttabWidth: 2,\n\tuseTabs: false,\n\tprintWidth: 120,\n\tparser: 'babel'\n};\n\n/**\n * Transforms input ESM code to CJS code.\n * @param code The code to transform\n * @returns Input code transformed to CommonJS\n */\nconst esmToCjs = (code: string): string => runTransform(code, { quote: 'single', lenDestructure: 128, lenModuleName: 128, lenIdentifier: 128 });\n\n/**\n * Escaped new lines in code with block comments so they can be restored by {@link restoreNewLines}\n * @param 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 code The code with escaped new lines\n * @returns The same code with new lines restored\n */\nconst restoreNewLines = (code: string): string => code.replace(/\\/\\* :newline: \\*\\//g, '\\n');\n\n/**\n * Formats the code using Prettier\n * @param code The code to prettier format\n * @param prettierConfig Additional prettier options to use for formatting\n * @returns Prettier formatted code\n */\nconst prettierFormatCode = (code: string, prettierConfig?: Options) =>\n\tprettier.format(code, { ...documentationPrettierConfig, ...prettierConfig }).slice(0, -1);\n\n/**\n * Transpiles input TypeScript code to ESM code.\n * @param code The code to transpile\n * @returns Input code transpiled to ESM\n */\nconst tsToEsm = (code: string, options: Pick<PluginOptions, 'typescriptCompilerOptions'>): ts.TranspileOutput =>\n\tts.transpileModule(code, { reportDiagnostics: false, compilerOptions: makeTsCompilerOptions(options.typescriptCompilerOptions) });\n\n/**\n * Transforms input TypeScript code to ESM code.\n * @param input The TypeScript code to transform\n * @param options The plugin options\n * @returns The transformed code (ESM)\n */\nexport function ts2esm(input: string, options: PluginOptions) {\n\tconst tsCode = escapeNewLines(input);\n\tconst esmCode = tsToEsm(tsCode, { typescriptCompilerOptions: options.typescriptCompilerOptions }).outputText;\n\n\treturn prettierFormatCode(restoreNewLines(esmCode), options.prettierOptions);\n}\n\nexport function esm2cjs(input: string, options: PluginOptions) {\n\tconst cjsCode = esmToCjs(input);\n\n\treturn prettierFormatCode(restoreNewLines(cjsCode), options.prettierOptions);\n}\n"],"mappings":";AAGA,OAAO,WAAW;;;ACHlB,OAAO,4BAA4B;AACnC,SAAS,oBAAoB;AA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BAA4B,CAAC,EAAE,IAAI,EAAE,MAAM,MAAM,iBAAiB,CAAC,GAAG,2BAA2B,CAAC,EAAE,MACrI;AACJ,SAAO,CAAC,SAAS;AAChB,QAAI,cAAc;AAClB,QAAI,kBAAkB;AACtB,UAAM,MAAM,CAAC,SAAe;AAC3B,UAAI,SAAS,IAAI,KAAK,KAAK,MAAM,SAAS,aAAa,GAAG;AACzD,0BAAkB;AAAA,MACnB;AACA,UAAI,SAAS,IAAI,GAAG;AACnB,YAAI,QAAQ;AACZ,eAAO,QAAQ,KAAK,SAAS,QAAQ;AACpC,gBAAM,QAAQ,KAAK,SAAS,KAAK;AACjC,cAAI,UAAU,KAAK,GAAG;AACrB,kBAAM,SAAS,cAAc,OAAO,EAAE,MAAM,iBAAiB,0BAA0B,CAAC;AACxF,iBAAK,SAAS,OAAO,OAAO,GAAG,GAAG,MAAM;AACxC,qBAAS,OAAO;AAChB,0BAAc;AAAA,UACf,OAAO;AACN,qBAAS;AAAA,UACV;AAAA,QACD;AAAA,MACD;AAAA,IACD,CAAC;AACD,QAAI,eAAe,CAAC,iBAAiB;AACpC,MAAC,KAAgB,SAAS,QAAQ,aAAa;AAAA,IAChD;AAAA,EACD;AACD;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapphire/docusaurus-plugin-ts2esm2cjs",
|
|
3
|
-
"version": "1.1.4-next.
|
|
3
|
+
"version": "1.1.4-next.de970bf.0",
|
|
4
4
|
"description": "Docusaurus Remark plugin for converting TypeScript code to ESM and CJS code",
|
|
5
5
|
"author": "@sapphire",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,13 +19,14 @@
|
|
|
19
19
|
"typecheck": "tsc -p tsconfig.eslint.json",
|
|
20
20
|
"prepack": "yarn build",
|
|
21
21
|
"bump": "cliff-jumper",
|
|
22
|
-
"check-update": "cliff-jumper --dry-run"
|
|
22
|
+
"check-update": "cliff-jumper --dry-run",
|
|
23
|
+
"test": "vitest run"
|
|
23
24
|
},
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"@sapphire/prettier-config": "^1.4.
|
|
26
|
+
"@sapphire/prettier-config": "^1.4.5",
|
|
26
27
|
"esm-to-cjs": "^1.2.1",
|
|
27
|
-
"prettier": "^2.7
|
|
28
|
-
"typescript": "^
|
|
28
|
+
"prettier": "^2.8.7",
|
|
29
|
+
"typescript": "^5.0.4",
|
|
29
30
|
"unist-util-visit": "^2.0.3"
|
|
30
31
|
},
|
|
31
32
|
"repository": {
|
|
@@ -62,8 +63,9 @@
|
|
|
62
63
|
"access": "public"
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
65
|
-
"@favware/cliff-jumper": "^
|
|
66
|
-
"
|
|
67
|
-
"
|
|
66
|
+
"@favware/cliff-jumper": "^2.0.0",
|
|
67
|
+
"@sapphire/framework": "^4.3.1",
|
|
68
|
+
"tsup": "^6.7.0",
|
|
69
|
+
"vitest": "^0.29.8"
|
|
68
70
|
}
|
|
69
71
|
}
|