@sapphire/docusaurus-plugin-ts2esm2cjs 1.0.2-next.dfbe36e.0 → 1.0.4-next.fa91103.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 +3 -1
- package/dist/index.js +138 -139
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +119 -4
- package/dist/index.mjs.map +1 -0
- package/package.json +8 -13
package/README.md
CHANGED
|
@@ -167,7 +167,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
167
167
|
<!-- markdownlint-disable -->
|
|
168
168
|
<table>
|
|
169
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=
|
|
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>
|
|
171
173
|
</tr>
|
|
172
174
|
</table>
|
|
173
175
|
|
package/dist/index.js
CHANGED
|
@@ -1,154 +1,153 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
tabWidth: 2,
|
|
12
|
-
useTabs: false,
|
|
13
|
-
printWidth: 120,
|
|
14
|
-
parser: 'babel'
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
11
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
|
|
29
|
+
// src/index.ts
|
|
30
|
+
var src_exports = {};
|
|
31
|
+
__export(src_exports, {
|
|
32
|
+
ts2esm2cjs: () => ts2esm2cjs
|
|
25
33
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*/
|
|
63
|
-
const transformNode = (node, options) => {
|
|
64
|
-
const groupIdProp = options.sync ? 'groupId="ts2esm2cjs" ' : '';
|
|
65
|
-
const tsCode = escapeNewLines(node.value);
|
|
66
|
-
const esmCode = tsToEsm(tsCode, { typescriptCompilerOptions: options.typescriptCompilerOptions }).outputText;
|
|
67
|
-
const cjsCode = esmToCjs(esmCode);
|
|
68
|
-
const [, jsHighlight, tsHighlight] = node.meta.split('|');
|
|
69
|
-
return [
|
|
70
|
-
{
|
|
71
|
-
type: 'jsx',
|
|
72
|
-
value: `<Tabs defaultValue="typescript" ${groupIdProp}` +
|
|
73
|
-
`values={[
|
|
34
|
+
var import_prettier_config = __toESM(require("@sapphire/prettier-config"));
|
|
35
|
+
var import_esm_to_cjs = require("esm-to-cjs");
|
|
36
|
+
var import_prettier = __toESM(require("prettier"));
|
|
37
|
+
var import_typescript = __toESM(require("typescript"));
|
|
38
|
+
var documentationPrettierConfig = {
|
|
39
|
+
...import_prettier_config.default,
|
|
40
|
+
tabWidth: 2,
|
|
41
|
+
useTabs: false,
|
|
42
|
+
printWidth: 120,
|
|
43
|
+
parser: "babel"
|
|
44
|
+
};
|
|
45
|
+
var makeTsCompilerOptions = (overrideOptions) => ({
|
|
46
|
+
newLine: import_typescript.default.NewLineKind.LineFeed,
|
|
47
|
+
removeComments: false,
|
|
48
|
+
esModuleInterop: true,
|
|
49
|
+
pretty: true,
|
|
50
|
+
...overrideOptions,
|
|
51
|
+
module: import_typescript.default.ModuleKind.ESNext,
|
|
52
|
+
moduleResolution: import_typescript.default.ModuleResolutionKind.NodeJs,
|
|
53
|
+
target: import_typescript.default.ScriptTarget.ESNext
|
|
54
|
+
});
|
|
55
|
+
var tsToEsm = (code, options) => import_typescript.default.transpileModule(code, { reportDiagnostics: false, compilerOptions: makeTsCompilerOptions(options.typescriptCompilerOptions) });
|
|
56
|
+
var esmToCjs = (code) => (0, import_esm_to_cjs.runTransform)(code, { quote: "single", lenDestructure: 128, lenModuleName: 128, lenIdentifier: 128 });
|
|
57
|
+
var escapeNewLines = (code) => code.replace(/\n\n/g, "\n/* :newline: */");
|
|
58
|
+
var restoreNewLines = (code) => code.replace(/\/\* :newline: \*\//g, "\n");
|
|
59
|
+
var prettierFormatCode = (code, prettierConfig) => import_prettier.default.format(code, { ...documentationPrettierConfig, ...prettierConfig }).slice(0, -1);
|
|
60
|
+
var transformNode = (node, options) => {
|
|
61
|
+
const groupIdProp = options.sync ? 'groupId="ts2esm2cjs" ' : "";
|
|
62
|
+
const tsCode = escapeNewLines(node.value);
|
|
63
|
+
const esmCode = tsToEsm(tsCode, { typescriptCompilerOptions: options.typescriptCompilerOptions }).outputText;
|
|
64
|
+
const cjsCode = esmToCjs(esmCode);
|
|
65
|
+
const [, jsHighlight, tsHighlight] = node.meta.split("|");
|
|
66
|
+
return [
|
|
67
|
+
{
|
|
68
|
+
type: "jsx",
|
|
69
|
+
value: `<Tabs defaultValue="typescript" ${groupIdProp}values={[
|
|
74
70
|
{ label: 'JavaScript', value: 'javascript', },
|
|
75
71
|
{ label: 'ESM', value: 'esm', },
|
|
76
72
|
{ label: 'TypeScript', value: 'typescript', },
|
|
77
73
|
]}
|
|
78
74
|
>
|
|
79
75
|
<TabItem value="javascript">`
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: node.type,
|
|
79
|
+
lang: node.lang,
|
|
80
|
+
meta: jsHighlight,
|
|
81
|
+
value: prettierFormatCode(restoreNewLines(cjsCode), options.prettierOptions)
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type: "jsx",
|
|
85
|
+
value: '</TabItem>\n<TabItem value="esm">'
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: node.type,
|
|
89
|
+
lang: node.lang,
|
|
90
|
+
meta: jsHighlight,
|
|
91
|
+
value: prettierFormatCode(restoreNewLines(esmCode), options.prettierOptions)
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: "jsx",
|
|
95
|
+
value: '</TabItem>\n<TabItem value="typescript">'
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
type: node.type,
|
|
99
|
+
lang: node.lang,
|
|
100
|
+
meta: tsHighlight,
|
|
101
|
+
value: node.value
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
type: "jsx",
|
|
105
|
+
value: "</TabItem>\n</Tabs>"
|
|
106
|
+
}
|
|
107
|
+
];
|
|
112
108
|
};
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
109
|
+
var matchNode = (node) => node.type === "code" && typeof node.meta === "string" && node.meta.startsWith("ts2esm2cjs");
|
|
110
|
+
var nodeForImport = {
|
|
111
|
+
type: "import",
|
|
112
|
+
value: "import Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';"
|
|
117
113
|
};
|
|
118
114
|
function ts2esm2cjs({ sync = true, prettierOptions = {}, typescriptCompilerOptions = {} } = {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
sync: true,
|
|
116
|
+
prettierOptions: {},
|
|
117
|
+
typescriptCompilerOptions: {}
|
|
122
118
|
}) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
119
|
+
let transformed = false;
|
|
120
|
+
let alreadyImported = false;
|
|
121
|
+
const transformer = (node) => {
|
|
122
|
+
if (node.type === "import" && node.value.includes("@theme/Tabs")) {
|
|
123
|
+
alreadyImported = true;
|
|
124
|
+
}
|
|
125
|
+
if (matchNode(node)) {
|
|
126
|
+
transformed = true;
|
|
127
|
+
return transformNode(node, { sync, prettierOptions, typescriptCompilerOptions });
|
|
128
|
+
}
|
|
129
|
+
if (Array.isArray(node.children)) {
|
|
130
|
+
let index = 0;
|
|
131
|
+
while (index < node.children.length) {
|
|
132
|
+
const result = transformer(node.children[index]);
|
|
133
|
+
if (result) {
|
|
134
|
+
node.children.splice(index, 1, ...result);
|
|
135
|
+
index += result.length;
|
|
136
|
+
} else {
|
|
137
|
+
index += 1;
|
|
128
138
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (result) {
|
|
138
|
-
node.children.splice(index, 1, ...result);
|
|
139
|
-
index += result.length;
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
index += 1;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
if (node.type === 'root' && transformed && !alreadyImported) {
|
|
147
|
-
node.children.unshift(nodeForImport);
|
|
148
|
-
}
|
|
149
|
-
return null;
|
|
150
|
-
};
|
|
151
|
-
return transformer;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (node.type === "root" && transformed && !alreadyImported) {
|
|
142
|
+
node.children.unshift(nodeForImport);
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
};
|
|
146
|
+
return transformer;
|
|
152
147
|
}
|
|
153
|
-
exports
|
|
148
|
+
module.exports = __toCommonJS(src_exports);
|
|
149
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
150
|
+
0 && (module.exports = {
|
|
151
|
+
ts2esm2cjs
|
|
152
|
+
});
|
|
154
153
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import sapphirePrettierConfig from '@sapphire/prettier-config';\nimport { runTransform } from 'esm-to-cjs';\nimport prettier, { Options } from 'prettier';\nimport ts, { CompilerOptions } from 'typescript';\n\nconst documentationPrettierConfig: Options = {\n\t...sapphirePrettierConfig,\n\ttabWidth: 2,\n\tuseTabs: false,\n\tprintWidth: 120,\n\tparser: 'babel'\n};\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\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 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 * Transforms a Docusaurus node from TypeScript to ESM and CJS\n * @param node The Docusaurus node to transform\n * @param isSync Whether the transform should synchronize between all entries of this type\n * @returns The transformed node in the form of Tabs.\n */\nconst transformNode = (node: any, options: PluginOptions) => {\n\tconst groupIdProp = options.sync ? 'groupId=\"ts2esm2cjs\" ' : '';\n\n\tconst tsCode = escapeNewLines(node.value);\n\tconst esmCode = tsToEsm(tsCode, { typescriptCompilerOptions: options.typescriptCompilerOptions }).outputText;\n\tconst cjsCode = esmToCjs(esmCode);\n\n\tconst [, jsHighlight, tsHighlight] = node.meta.split('|');\n\n\treturn [\n\t\t{\n\t\t\ttype: 'jsx',\n\t\t\tvalue:\n\t\t\t\t`<Tabs defaultValue=\"typescript\" ${groupIdProp}` +\n\t\t\t\t`values={[\n { label: 'JavaScript', value: 'javascript', },\n { label: 'ESM', value: 'esm', },\n { label: 'TypeScript', value: 'typescript', },\n ]}\n>\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,\n\t\t\tvalue: prettierFormatCode(restoreNewLines(cjsCode), options.prettierOptions)\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,\n\t\t\tvalue: prettierFormatCode(restoreNewLines(esmCode), options.prettierOptions)\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,\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];\n};\n\nconst matchNode = (node: any) => node.type === 'code' && typeof node.meta === 'string' && node.meta.startsWith('ts2esm2cjs');\nconst nodeForImport = {\n\ttype: 'import',\n\tvalue: \"import Tabs from '@theme/Tabs';\\nimport TabItem from '@theme/TabItem';\"\n};\n\nexport interface PluginOptions {\n\tsync?: boolean;\n\tprettierOptions?: Options;\n\ttypescriptCompilerOptions?: CompilerOptions;\n}\n\nexport function ts2esm2cjs(\n\t{ sync = true, prettierOptions = {}, typescriptCompilerOptions = {} }: PluginOptions = {\n\t\tsync: true,\n\t\tprettierOptions: {},\n\t\ttypescriptCompilerOptions: {}\n\t}\n) {\n\tlet transformed = false;\n\tlet alreadyImported = false;\n\n\tconst transformer = (node: any) => {\n\t\tif (node.type === 'import' && node.value.includes('@theme/Tabs')) {\n\t\t\talreadyImported = true;\n\t\t}\n\n\t\tif (matchNode(node)) {\n\t\t\ttransformed = true;\n\t\t\treturn transformNode(node, { sync, prettierOptions, typescriptCompilerOptions });\n\t\t}\n\n\t\tif (Array.isArray(node.children)) {\n\t\t\tlet index = 0;\n\t\t\twhile (index < node.children.length) {\n\t\t\t\tconst result = transformer(node.children[index]);\n\t\t\t\tif (result) {\n\t\t\t\t\tnode.children.splice(index, 1, ...result);\n\t\t\t\t\tindex += result.length;\n\t\t\t\t} else {\n\t\t\t\t\tindex += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (node.type === 'root' && transformed && !alreadyImported) {\n\t\t\tnode.children.unshift(nodeForImport);\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn transformer;\n}\n"],"mappings":"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","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,119 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import sapphirePrettierConfig from "@sapphire/prettier-config";
|
|
3
|
+
import { runTransform } from "esm-to-cjs";
|
|
4
|
+
import prettier from "prettier";
|
|
5
|
+
import ts from "typescript";
|
|
6
|
+
var documentationPrettierConfig = {
|
|
7
|
+
...sapphirePrettierConfig,
|
|
8
|
+
tabWidth: 2,
|
|
9
|
+
useTabs: false,
|
|
10
|
+
printWidth: 120,
|
|
11
|
+
parser: "babel"
|
|
12
|
+
};
|
|
13
|
+
var makeTsCompilerOptions = (overrideOptions) => ({
|
|
14
|
+
newLine: ts.NewLineKind.LineFeed,
|
|
15
|
+
removeComments: false,
|
|
16
|
+
esModuleInterop: true,
|
|
17
|
+
pretty: true,
|
|
18
|
+
...overrideOptions,
|
|
19
|
+
module: ts.ModuleKind.ESNext,
|
|
20
|
+
moduleResolution: ts.ModuleResolutionKind.NodeJs,
|
|
21
|
+
target: ts.ScriptTarget.ESNext
|
|
22
|
+
});
|
|
23
|
+
var tsToEsm = (code, options) => ts.transpileModule(code, { reportDiagnostics: false, compilerOptions: makeTsCompilerOptions(options.typescriptCompilerOptions) });
|
|
24
|
+
var esmToCjs = (code) => runTransform(code, { quote: "single", lenDestructure: 128, lenModuleName: 128, lenIdentifier: 128 });
|
|
25
|
+
var escapeNewLines = (code) => code.replace(/\n\n/g, "\n/* :newline: */");
|
|
26
|
+
var restoreNewLines = (code) => code.replace(/\/\* :newline: \*\//g, "\n");
|
|
27
|
+
var prettierFormatCode = (code, prettierConfig) => prettier.format(code, { ...documentationPrettierConfig, ...prettierConfig }).slice(0, -1);
|
|
28
|
+
var transformNode = (node, options) => {
|
|
29
|
+
const groupIdProp = options.sync ? 'groupId="ts2esm2cjs" ' : "";
|
|
30
|
+
const tsCode = escapeNewLines(node.value);
|
|
31
|
+
const esmCode = tsToEsm(tsCode, { typescriptCompilerOptions: options.typescriptCompilerOptions }).outputText;
|
|
32
|
+
const cjsCode = esmToCjs(esmCode);
|
|
33
|
+
const [, jsHighlight, tsHighlight] = node.meta.split("|");
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
type: "jsx",
|
|
37
|
+
value: `<Tabs defaultValue="typescript" ${groupIdProp}values={[
|
|
38
|
+
{ label: 'JavaScript', value: 'javascript', },
|
|
39
|
+
{ label: 'ESM', value: 'esm', },
|
|
40
|
+
{ label: 'TypeScript', value: 'typescript', },
|
|
41
|
+
]}
|
|
42
|
+
>
|
|
43
|
+
<TabItem value="javascript">`
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: node.type,
|
|
47
|
+
lang: node.lang,
|
|
48
|
+
meta: jsHighlight,
|
|
49
|
+
value: prettierFormatCode(restoreNewLines(cjsCode), options.prettierOptions)
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: "jsx",
|
|
53
|
+
value: '</TabItem>\n<TabItem value="esm">'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: node.type,
|
|
57
|
+
lang: node.lang,
|
|
58
|
+
meta: jsHighlight,
|
|
59
|
+
value: prettierFormatCode(restoreNewLines(esmCode), options.prettierOptions)
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: "jsx",
|
|
63
|
+
value: '</TabItem>\n<TabItem value="typescript">'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: node.type,
|
|
67
|
+
lang: node.lang,
|
|
68
|
+
meta: tsHighlight,
|
|
69
|
+
value: node.value
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
type: "jsx",
|
|
73
|
+
value: "</TabItem>\n</Tabs>"
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
};
|
|
77
|
+
var matchNode = (node) => node.type === "code" && typeof node.meta === "string" && node.meta.startsWith("ts2esm2cjs");
|
|
78
|
+
var nodeForImport = {
|
|
79
|
+
type: "import",
|
|
80
|
+
value: "import Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';"
|
|
81
|
+
};
|
|
82
|
+
function ts2esm2cjs({ sync = true, prettierOptions = {}, typescriptCompilerOptions = {} } = {
|
|
83
|
+
sync: true,
|
|
84
|
+
prettierOptions: {},
|
|
85
|
+
typescriptCompilerOptions: {}
|
|
86
|
+
}) {
|
|
87
|
+
let transformed = false;
|
|
88
|
+
let alreadyImported = false;
|
|
89
|
+
const transformer = (node) => {
|
|
90
|
+
if (node.type === "import" && node.value.includes("@theme/Tabs")) {
|
|
91
|
+
alreadyImported = true;
|
|
92
|
+
}
|
|
93
|
+
if (matchNode(node)) {
|
|
94
|
+
transformed = true;
|
|
95
|
+
return transformNode(node, { sync, prettierOptions, typescriptCompilerOptions });
|
|
96
|
+
}
|
|
97
|
+
if (Array.isArray(node.children)) {
|
|
98
|
+
let index = 0;
|
|
99
|
+
while (index < node.children.length) {
|
|
100
|
+
const result = transformer(node.children[index]);
|
|
101
|
+
if (result) {
|
|
102
|
+
node.children.splice(index, 1, ...result);
|
|
103
|
+
index += result.length;
|
|
104
|
+
} else {
|
|
105
|
+
index += 1;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (node.type === "root" && transformed && !alreadyImported) {
|
|
110
|
+
node.children.unshift(nodeForImport);
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
};
|
|
114
|
+
return transformer;
|
|
115
|
+
}
|
|
116
|
+
export {
|
|
117
|
+
ts2esm2cjs
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import sapphirePrettierConfig from '@sapphire/prettier-config';\nimport { runTransform } from 'esm-to-cjs';\nimport prettier, { Options } from 'prettier';\nimport ts, { CompilerOptions } from 'typescript';\n\nconst documentationPrettierConfig: Options = {\n\t...sapphirePrettierConfig,\n\ttabWidth: 2,\n\tuseTabs: false,\n\tprintWidth: 120,\n\tparser: 'babel'\n};\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\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 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 * Transforms a Docusaurus node from TypeScript to ESM and CJS\n * @param node The Docusaurus node to transform\n * @param isSync Whether the transform should synchronize between all entries of this type\n * @returns The transformed node in the form of Tabs.\n */\nconst transformNode = (node: any, options: PluginOptions) => {\n\tconst groupIdProp = options.sync ? 'groupId=\"ts2esm2cjs\" ' : '';\n\n\tconst tsCode = escapeNewLines(node.value);\n\tconst esmCode = tsToEsm(tsCode, { typescriptCompilerOptions: options.typescriptCompilerOptions }).outputText;\n\tconst cjsCode = esmToCjs(esmCode);\n\n\tconst [, jsHighlight, tsHighlight] = node.meta.split('|');\n\n\treturn [\n\t\t{\n\t\t\ttype: 'jsx',\n\t\t\tvalue:\n\t\t\t\t`<Tabs defaultValue=\"typescript\" ${groupIdProp}` +\n\t\t\t\t`values={[\n { label: 'JavaScript', value: 'javascript', },\n { label: 'ESM', value: 'esm', },\n { label: 'TypeScript', value: 'typescript', },\n ]}\n>\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,\n\t\t\tvalue: prettierFormatCode(restoreNewLines(cjsCode), options.prettierOptions)\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,\n\t\t\tvalue: prettierFormatCode(restoreNewLines(esmCode), options.prettierOptions)\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,\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];\n};\n\nconst matchNode = (node: any) => node.type === 'code' && typeof node.meta === 'string' && node.meta.startsWith('ts2esm2cjs');\nconst nodeForImport = {\n\ttype: 'import',\n\tvalue: \"import Tabs from '@theme/Tabs';\\nimport TabItem from '@theme/TabItem';\"\n};\n\nexport interface PluginOptions {\n\tsync?: boolean;\n\tprettierOptions?: Options;\n\ttypescriptCompilerOptions?: CompilerOptions;\n}\n\nexport function ts2esm2cjs(\n\t{ sync = true, prettierOptions = {}, typescriptCompilerOptions = {} }: PluginOptions = {\n\t\tsync: true,\n\t\tprettierOptions: {},\n\t\ttypescriptCompilerOptions: {}\n\t}\n) {\n\tlet transformed = false;\n\tlet alreadyImported = false;\n\n\tconst transformer = (node: any) => {\n\t\tif (node.type === 'import' && node.value.includes('@theme/Tabs')) {\n\t\t\talreadyImported = true;\n\t\t}\n\n\t\tif (matchNode(node)) {\n\t\t\ttransformed = true;\n\t\t\treturn transformNode(node, { sync, prettierOptions, typescriptCompilerOptions });\n\t\t}\n\n\t\tif (Array.isArray(node.children)) {\n\t\t\tlet index = 0;\n\t\t\twhile (index < node.children.length) {\n\t\t\t\tconst result = transformer(node.children[index]);\n\t\t\t\tif (result) {\n\t\t\t\t\tnode.children.splice(index, 1, ...result);\n\t\t\t\t\tindex += result.length;\n\t\t\t\t} else {\n\t\t\t\t\tindex += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (node.type === 'root' && transformed && !alreadyImported) {\n\t\t\tnode.children.unshift(nodeForImport);\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn transformer;\n}\n"],"mappings":"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","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapphire/docusaurus-plugin-ts2esm2cjs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4-next.fa91103.0",
|
|
4
4
|
"description": "Docusaurus Remark plugin for converting TypeScript code to ESM and CJS code",
|
|
5
5
|
"author": "@sapphire",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,17 +13,15 @@
|
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"lint": "eslint src --ext ts --fix",
|
|
16
|
-
"build": "tsc -b src
|
|
17
|
-
"
|
|
18
|
-
"watch": "tsc -b src -w",
|
|
16
|
+
"build": "tsup && tsc -b src",
|
|
17
|
+
"typecheck": "tsc -p tsconfig.eslint.json",
|
|
19
18
|
"prepublishOnly": "yarn build"
|
|
20
19
|
},
|
|
21
20
|
"dependencies": {
|
|
22
|
-
"@sapphire/prettier-config": "^1.2.
|
|
23
|
-
"esm-to-cjs": "^1.2.
|
|
24
|
-
"prettier": "^2.5.
|
|
25
|
-
"
|
|
26
|
-
"typescript": "^4.5.2"
|
|
21
|
+
"@sapphire/prettier-config": "^1.2.9",
|
|
22
|
+
"esm-to-cjs": "^1.2.1",
|
|
23
|
+
"prettier": "^2.5.1",
|
|
24
|
+
"typescript": "^4.5.4"
|
|
27
25
|
},
|
|
28
26
|
"repository": {
|
|
29
27
|
"type": "git",
|
|
@@ -57,8 +55,5 @@
|
|
|
57
55
|
"publishConfig": {
|
|
58
56
|
"access": "public"
|
|
59
57
|
},
|
|
60
|
-
"
|
|
61
|
-
"@types/prettier": "^2"
|
|
62
|
-
},
|
|
63
|
-
"gitHead": "dfbe36e2fefeada74c36665626f090f4224aa024"
|
|
58
|
+
"gitHead": "fa9110399dd5489fa40d0cde5b7be1717eb5d557"
|
|
64
59
|
}
|