@dcf-micro/eslint-config 5.0.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/dist/chunks/eslint-plugin-prettier.mjs +1716 -0
- package/dist/chunks/index.mjs +1341 -0
- package/dist/chunks/index10.mjs +39595 -0
- package/dist/chunks/index11.mjs +24 -0
- package/dist/chunks/index12.mjs +75273 -0
- package/dist/chunks/index13.mjs +55129 -0
- package/dist/chunks/index14.mjs +24 -0
- package/dist/chunks/index15.mjs +1441 -0
- package/dist/chunks/index2.mjs +31864 -0
- package/dist/chunks/index3.mjs +8154 -0
- package/dist/chunks/index4.mjs +24 -0
- package/dist/chunks/index5.mjs +44093 -0
- package/dist/chunks/index6.mjs +10371 -0
- package/dist/chunks/index7.mjs +21890 -0
- package/dist/chunks/index8.mjs +14424 -0
- package/dist/chunks/index9.mjs +194 -0
- package/dist/chunks/jiti.mjs +320 -0
- package/dist/index.d.mts +3897 -0
- package/dist/index.d.ts +3897 -0
- package/dist/index.mjs +4 -0
- package/dist/shared/eslint-config.BDBLGvXj.mjs +5282 -0
- package/dist/shared/eslint-config.BEdqg1el.mjs +12256 -0
- package/dist/shared/eslint-config.BKmXKm8B.mjs +5533 -0
- package/dist/shared/eslint-config.BjUMgISS.mjs +9012 -0
- package/dist/shared/eslint-config.Bk-3rH6Y.mjs +1355 -0
- package/dist/shared/eslint-config.BytuZ0Ec.mjs +20 -0
- package/dist/shared/eslint-config.C1V0I4Np.mjs +16900 -0
- package/dist/shared/eslint-config.CGxZQKHV.mjs +2091 -0
- package/dist/shared/eslint-config.COweQ1RR.mjs +5 -0
- package/dist/shared/eslint-config.CSnk9Q4w.mjs +9339 -0
- package/dist/shared/eslint-config.CWvTq0mr.mjs +2914 -0
- package/dist/shared/eslint-config.Ca4PTK8E.mjs +646 -0
- package/dist/shared/eslint-config.CmPTszkJ.mjs +3583 -0
- package/dist/shared/eslint-config.CqEANaNA.mjs +139622 -0
- package/dist/shared/eslint-config.CsePEcYJ.mjs +71 -0
- package/dist/shared/eslint-config.Cw6mETSZ.mjs +2580 -0
- package/dist/shared/eslint-config.DTVnsecK.mjs +1751 -0
- package/dist/shared/eslint-config.DWoU09EE.mjs +6958 -0
- package/dist/shared/eslint-config.DZvqTQUU.mjs +3818 -0
- package/dist/shared/eslint-config.Dhg7lT0g.mjs +1807 -0
- package/dist/shared/eslint-config.Du5y5qmf.mjs +200673 -0
- package/dist/shared/eslint-config.FKVuBSa4.mjs +394 -0
- package/dist/shared/eslint-config.I8d-HnmI.mjs +2654 -0
- package/dist/shared/eslint-config.YntqsQY1.mjs +40 -0
- package/dist/shared/eslint-config.uGTBNMD0.mjs +687 -0
- package/package.json +56 -0
|
@@ -0,0 +1,687 @@
|
|
|
1
|
+
import require$$0 from 'node:module';
|
|
2
|
+
import path__default from 'node:path';
|
|
3
|
+
import require$$3 from 'node:url';
|
|
4
|
+
import require$$3$1 from 'node:worker_threads';
|
|
5
|
+
import require$$4 from 'node:crypto';
|
|
6
|
+
import require$$1 from 'node:fs';
|
|
7
|
+
import { c as commonjsRequire } from './eslint-config.COweQ1RR.mjs';
|
|
8
|
+
import require$$7 from 'url';
|
|
9
|
+
|
|
10
|
+
var lib$1 = {};
|
|
11
|
+
|
|
12
|
+
var lib = {};
|
|
13
|
+
|
|
14
|
+
var hasRequiredLib$1;
|
|
15
|
+
|
|
16
|
+
function requireLib$1 () {
|
|
17
|
+
if (hasRequiredLib$1) return lib;
|
|
18
|
+
hasRequiredLib$1 = 1;
|
|
19
|
+
|
|
20
|
+
var node_module = require$$0;
|
|
21
|
+
var fs = require$$1;
|
|
22
|
+
var path = path__default;
|
|
23
|
+
|
|
24
|
+
const import_meta = {};
|
|
25
|
+
const CWD = process.cwd();
|
|
26
|
+
const cjsRequire = typeof commonjsRequire === "undefined" ? node_module.createRequire(import_meta.url) : commonjsRequire;
|
|
27
|
+
const EVAL_FILENAMES = /* @__PURE__ */ new Set(["[eval]", "[worker eval]"]);
|
|
28
|
+
const EXTENSIONS = [".ts", ".tsx", ...Object.keys(cjsRequire.extensions)];
|
|
29
|
+
|
|
30
|
+
const tryPkg = (pkg) => {
|
|
31
|
+
try {
|
|
32
|
+
return cjsRequire.resolve(pkg);
|
|
33
|
+
} catch (e) {
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const isPkgAvailable = (pkg) => !!tryPkg(pkg);
|
|
37
|
+
const tryFile = (filename, includeDir = false, base = CWD) => {
|
|
38
|
+
if (typeof filename === "string") {
|
|
39
|
+
const filepath = path.resolve(base, filename);
|
|
40
|
+
return fs.existsSync(filepath) && (includeDir || fs.statSync(filepath).isFile()) ? filepath : "";
|
|
41
|
+
}
|
|
42
|
+
for (const file of filename != null ? filename : []) {
|
|
43
|
+
const filepath = tryFile(file, includeDir, base);
|
|
44
|
+
if (filepath) {
|
|
45
|
+
return filepath;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return "";
|
|
49
|
+
};
|
|
50
|
+
const tryExtensions = (filepath, extensions = EXTENSIONS) => {
|
|
51
|
+
const ext = [...extensions, ""].find((ext2) => tryFile(filepath + ext2));
|
|
52
|
+
return ext == null ? "" : filepath + ext;
|
|
53
|
+
};
|
|
54
|
+
const findUp = (searchEntry, searchFileOrIncludeDir, includeDir) => {
|
|
55
|
+
console.assert(path.isAbsolute(searchEntry));
|
|
56
|
+
if (!tryFile(searchEntry, true) || searchEntry !== CWD && !searchEntry.startsWith(CWD + path.sep)) {
|
|
57
|
+
return "";
|
|
58
|
+
}
|
|
59
|
+
searchEntry = path.resolve(
|
|
60
|
+
fs.statSync(searchEntry).isDirectory() ? searchEntry : path.resolve(searchEntry, "..")
|
|
61
|
+
);
|
|
62
|
+
const isSearchFile = typeof searchFileOrIncludeDir === "string";
|
|
63
|
+
const searchFile = isSearchFile ? searchFileOrIncludeDir : "package.json";
|
|
64
|
+
do {
|
|
65
|
+
const searched = tryFile(
|
|
66
|
+
path.resolve(searchEntry, searchFile),
|
|
67
|
+
isSearchFile && includeDir
|
|
68
|
+
);
|
|
69
|
+
if (searched) {
|
|
70
|
+
return searched;
|
|
71
|
+
}
|
|
72
|
+
searchEntry = path.resolve(searchEntry, "..");
|
|
73
|
+
} while (searchEntry === CWD || searchEntry.startsWith(CWD + path.sep));
|
|
74
|
+
return "";
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
lib.CWD = CWD;
|
|
78
|
+
lib.EVAL_FILENAMES = EVAL_FILENAMES;
|
|
79
|
+
lib.EXTENSIONS = EXTENSIONS;
|
|
80
|
+
lib.cjsRequire = cjsRequire;
|
|
81
|
+
lib.findUp = findUp;
|
|
82
|
+
lib.isPkgAvailable = isPkgAvailable;
|
|
83
|
+
lib.tryExtensions = tryExtensions;
|
|
84
|
+
lib.tryFile = tryFile;
|
|
85
|
+
lib.tryPkg = tryPkg;
|
|
86
|
+
return lib;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
var hasRequiredLib;
|
|
90
|
+
|
|
91
|
+
function requireLib () {
|
|
92
|
+
if (hasRequiredLib) return lib$1;
|
|
93
|
+
hasRequiredLib = 1;
|
|
94
|
+
//#region rolldown:runtime
|
|
95
|
+
var __create = Object.create;
|
|
96
|
+
var __defProp = Object.defineProperty;
|
|
97
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
98
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
99
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
100
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
101
|
+
var __copyProps = (to, from, except, desc) => {
|
|
102
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
103
|
+
key = keys[i];
|
|
104
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
105
|
+
get: ((k) => from[k]).bind(null, key),
|
|
106
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return to;
|
|
110
|
+
};
|
|
111
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(!mod || !mod.__esModule ? __defProp(target, "default", {
|
|
112
|
+
value: mod,
|
|
113
|
+
enumerable: true
|
|
114
|
+
}) : target, mod));
|
|
115
|
+
|
|
116
|
+
//#endregion
|
|
117
|
+
const node_module = __toESM(require$$0);
|
|
118
|
+
const node_path = __toESM(path__default);
|
|
119
|
+
const node_url = __toESM(require$$3);
|
|
120
|
+
const node_worker_threads = __toESM(require$$3$1);
|
|
121
|
+
const node_crypto = __toESM(require$$4);
|
|
122
|
+
const node_fs = __toESM(require$$1);
|
|
123
|
+
const __pkgr_core = __toESM(/*@__PURE__*/ requireLib$1());
|
|
124
|
+
|
|
125
|
+
//#region src/common.ts
|
|
126
|
+
var _process$env$NODE_OPT;
|
|
127
|
+
const NODE_OPTIONS$1 = (_process$env$NODE_OPT = process.env.NODE_OPTIONS) === null || _process$env$NODE_OPT === void 0 ? void 0 : _process$env$NODE_OPT.split(/\s+/);
|
|
128
|
+
const hasFlag = (flag) => (NODE_OPTIONS$1 === null || NODE_OPTIONS$1 === void 0 ? void 0 : NODE_OPTIONS$1.includes(flag)) || process.argv.includes(flag);
|
|
129
|
+
const parseVersion = (version) => version.split(".").map(Number.parseFloat);
|
|
130
|
+
const compareVersion = (version1, version2) => {
|
|
131
|
+
const versions1 = parseVersion(version1);
|
|
132
|
+
const versions2 = parseVersion(version2);
|
|
133
|
+
const length = Math.max(versions1.length, versions2.length);
|
|
134
|
+
for (let i = 0; i < length; i++) {
|
|
135
|
+
const v1 = versions1[i] || 0;
|
|
136
|
+
const v2 = versions2[i] || 0;
|
|
137
|
+
if (v1 > v2) return 1;
|
|
138
|
+
if (v1 < v2) return -1;
|
|
139
|
+
}
|
|
140
|
+
return 0;
|
|
141
|
+
};
|
|
142
|
+
const NODE_VERSION = process.versions.node;
|
|
143
|
+
const compareNodeVersion = (version) => compareVersion(NODE_VERSION, version);
|
|
144
|
+
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/constants.ts
|
|
147
|
+
const TsRunner = {
|
|
148
|
+
Node: "node",
|
|
149
|
+
Bun: "bun",
|
|
150
|
+
TsNode: "ts-node",
|
|
151
|
+
EsbuildRegister: "esbuild-register",
|
|
152
|
+
EsbuildRunner: "esbuild-runner",
|
|
153
|
+
OXC: "oxc",
|
|
154
|
+
SWC: "swc",
|
|
155
|
+
TSX: "tsx"
|
|
156
|
+
};
|
|
157
|
+
const { NODE_OPTIONS: NODE_OPTIONS_ = "", SYNCKIT_EXEC_ARGV = "", SYNCKIT_GLOBAL_SHIMS, SYNCKIT_TIMEOUT, SYNCKIT_TS_RUNNER } = process.env;
|
|
158
|
+
const TS_ESM_PARTIAL_SUPPORTED = compareNodeVersion("16") >= 0 && compareNodeVersion("18.19") < 0;
|
|
159
|
+
const MTS_SUPPORTED = compareNodeVersion("20.8") >= 0;
|
|
160
|
+
const MODULE_REGISTER_SUPPORTED = MTS_SUPPORTED || compareNodeVersion("18.19") >= 0;
|
|
161
|
+
const STRIP_TYPES_NODE_VERSION = "22.6";
|
|
162
|
+
const TRANSFORM_TYPES_NODE_VERSION = "22.7";
|
|
163
|
+
const FEATURE_TYPESCRIPT_NODE_VERSION = "22.10";
|
|
164
|
+
const DEFAULT_TYPES_NODE_VERSION = "23.6";
|
|
165
|
+
const STRIP_TYPES_FLAG = "--experimental-strip-types";
|
|
166
|
+
const TRANSFORM_TYPES_FLAG = "--experimental-transform-types";
|
|
167
|
+
const NO_STRIP_TYPES_FLAG = "--no-experimental-strip-types";
|
|
168
|
+
const NODE_OPTIONS = NODE_OPTIONS_.split(/\s+/);
|
|
169
|
+
const NO_STRIP_TYPES = hasFlag(NO_STRIP_TYPES_FLAG) && (compareNodeVersion(FEATURE_TYPESCRIPT_NODE_VERSION) >= 0 ? process.features.typescript === false : !hasFlag(STRIP_TYPES_FLAG) && !hasFlag(TRANSFORM_TYPES_FLAG));
|
|
170
|
+
const DEFAULT_TIMEOUT = SYNCKIT_TIMEOUT ? +SYNCKIT_TIMEOUT : void 0;
|
|
171
|
+
const DEFAULT_EXEC_ARGV = SYNCKIT_EXEC_ARGV.split(",");
|
|
172
|
+
const DEFAULT_TS_RUNNER = SYNCKIT_TS_RUNNER;
|
|
173
|
+
const DEFAULT_GLOBAL_SHIMS = ["1", "true"].includes(SYNCKIT_GLOBAL_SHIMS);
|
|
174
|
+
const DEFAULT_GLOBAL_SHIMS_PRESET = [{
|
|
175
|
+
moduleName: "node-fetch",
|
|
176
|
+
globalName: "fetch"
|
|
177
|
+
}, {
|
|
178
|
+
moduleName: "node:perf_hooks",
|
|
179
|
+
globalName: "performance",
|
|
180
|
+
named: "performance"
|
|
181
|
+
}];
|
|
182
|
+
const IMPORT_FLAG = "--import";
|
|
183
|
+
const REQUIRE_FLAG = "--require";
|
|
184
|
+
const REQUIRE_ABBR_FLAG = "-r";
|
|
185
|
+
const REQUIRE_FLAGS = new Set([REQUIRE_FLAG, REQUIRE_ABBR_FLAG]);
|
|
186
|
+
const LOADER_FLAG = "--loader";
|
|
187
|
+
const EXPERIMENTAL_LOADER_FLAG = "--experimental-loader";
|
|
188
|
+
const LOADER_FLAGS = new Set([LOADER_FLAG, EXPERIMENTAL_LOADER_FLAG]);
|
|
189
|
+
const IMPORT_FLAG_SUPPORTED = compareNodeVersion("20.6") >= 0;
|
|
190
|
+
const INT32_BYTES = 4;
|
|
191
|
+
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/helpers.ts
|
|
194
|
+
const isFile = (path$2) => {
|
|
195
|
+
try {
|
|
196
|
+
var _fs$statSync;
|
|
197
|
+
return !!((_fs$statSync = node_fs.default.statSync(path$2, { throwIfNoEntry: false })) === null || _fs$statSync === void 0 ? void 0 : _fs$statSync.isFile());
|
|
198
|
+
} catch {
|
|
199
|
+
/* istanbul ignore next */
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
const dataUrl = (code) => new URL(`data:text/javascript,${encodeURIComponent(code)}`);
|
|
204
|
+
const hasRequireFlag = (execArgv) => execArgv.some((execArg) => REQUIRE_FLAGS.has(execArg));
|
|
205
|
+
const hasImportFlag = (execArgv) => execArgv.includes(IMPORT_FLAG);
|
|
206
|
+
const hasLoaderFlag = (execArgv) => execArgv.some((execArg) => LOADER_FLAGS.has(execArg));
|
|
207
|
+
const setupTsRunner = (workerPath, { execArgv = DEFAULT_EXEC_ARGV, tsRunner } = {}) => {
|
|
208
|
+
let ext = node_path.default.extname(workerPath);
|
|
209
|
+
if (!/([/\\])node_modules\1/.test(workerPath) && (!ext || /^\.[cm]?js$/.test(ext))) {
|
|
210
|
+
const workPathWithoutExt = ext ? workerPath.slice(0, -ext.length) : workerPath;
|
|
211
|
+
let extensions;
|
|
212
|
+
switch (ext) {
|
|
213
|
+
case ".cjs": {
|
|
214
|
+
extensions = [".cts", ".cjs"];
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
case ".mjs": {
|
|
218
|
+
extensions = [".mts", ".mjs"];
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
default: {
|
|
222
|
+
extensions = [".ts", ".js"];
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
const found = (0, __pkgr_core.tryExtensions)(workPathWithoutExt, extensions);
|
|
227
|
+
let differentExt;
|
|
228
|
+
if (found && (!ext || (differentExt = found !== workPathWithoutExt))) {
|
|
229
|
+
workerPath = found;
|
|
230
|
+
if (differentExt) ext = node_path.default.extname(workerPath);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
const isTs = /\.[cm]?ts$/.test(workerPath);
|
|
234
|
+
let jsUseEsm = ext === ".mjs";
|
|
235
|
+
let tsUseEsm = ext === ".mts";
|
|
236
|
+
if (isTs) {
|
|
237
|
+
if (!tsUseEsm && ext !== ".cts") {
|
|
238
|
+
const pkg = (0, __pkgr_core.findUp)(workerPath);
|
|
239
|
+
if (pkg) tsUseEsm = (0, __pkgr_core.cjsRequire)(pkg).type === "module";
|
|
240
|
+
}
|
|
241
|
+
const stripTypesIndex = execArgv.indexOf(STRIP_TYPES_FLAG);
|
|
242
|
+
const transformTypesIndex = execArgv.indexOf(TRANSFORM_TYPES_FLAG);
|
|
243
|
+
const noStripTypesIndex = execArgv.indexOf(NO_STRIP_TYPES_FLAG);
|
|
244
|
+
const execArgvNoStripTypes = noStripTypesIndex > stripTypesIndex || noStripTypesIndex > transformTypesIndex;
|
|
245
|
+
const noStripTypes = execArgvNoStripTypes || stripTypesIndex === -1 && transformTypesIndex === -1 && NO_STRIP_TYPES;
|
|
246
|
+
if (tsRunner == null) {
|
|
247
|
+
if (process.versions.bun) tsRunner = TsRunner.Bun;
|
|
248
|
+
else if (!noStripTypes && compareNodeVersion(STRIP_TYPES_NODE_VERSION) >= 0) tsRunner = TsRunner.Node;
|
|
249
|
+
else if ((0, __pkgr_core.isPkgAvailable)(TsRunner.TsNode)) tsRunner = TsRunner.TsNode;
|
|
250
|
+
}
|
|
251
|
+
switch (tsRunner) {
|
|
252
|
+
case TsRunner.Bun: break;
|
|
253
|
+
case TsRunner.Node: {
|
|
254
|
+
if (compareNodeVersion(STRIP_TYPES_NODE_VERSION) < 0) throw new Error("type stripping is not supported in this node version");
|
|
255
|
+
if (noStripTypes) throw new Error("type stripping is disabled explicitly");
|
|
256
|
+
if (compareNodeVersion(DEFAULT_TYPES_NODE_VERSION) >= 0) break;
|
|
257
|
+
if (compareNodeVersion(TRANSFORM_TYPES_NODE_VERSION) >= 0 && !execArgv.includes(TRANSFORM_TYPES_FLAG)) execArgv = [TRANSFORM_TYPES_FLAG, ...execArgv];
|
|
258
|
+
else if (compareNodeVersion(STRIP_TYPES_NODE_VERSION) >= 0 && !execArgv.includes(STRIP_TYPES_FLAG)) execArgv = [STRIP_TYPES_FLAG, ...execArgv];
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
case TsRunner.TsNode: {
|
|
262
|
+
if (tsUseEsm) {
|
|
263
|
+
if (!execArgv.includes(LOADER_FLAG)) execArgv = [
|
|
264
|
+
LOADER_FLAG,
|
|
265
|
+
`${TsRunner.TsNode}/esm`,
|
|
266
|
+
...execArgv
|
|
267
|
+
];
|
|
268
|
+
} else if (!hasRequireFlag(execArgv)) execArgv = [
|
|
269
|
+
REQUIRE_ABBR_FLAG,
|
|
270
|
+
`${TsRunner.TsNode}/register`,
|
|
271
|
+
...execArgv
|
|
272
|
+
];
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
case TsRunner.EsbuildRegister: {
|
|
276
|
+
if (tsUseEsm) {
|
|
277
|
+
if (!hasLoaderFlag(execArgv)) execArgv = [
|
|
278
|
+
LOADER_FLAG,
|
|
279
|
+
`${TsRunner.EsbuildRegister}/loader`,
|
|
280
|
+
...execArgv
|
|
281
|
+
];
|
|
282
|
+
} else if (!hasRequireFlag(execArgv)) execArgv = [
|
|
283
|
+
REQUIRE_ABBR_FLAG,
|
|
284
|
+
TsRunner.EsbuildRegister,
|
|
285
|
+
...execArgv
|
|
286
|
+
];
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
case TsRunner.EsbuildRunner: {
|
|
290
|
+
if (!hasRequireFlag(execArgv)) execArgv = [
|
|
291
|
+
REQUIRE_ABBR_FLAG,
|
|
292
|
+
`${TsRunner.EsbuildRunner}/register`,
|
|
293
|
+
...execArgv
|
|
294
|
+
];
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
case TsRunner.OXC: {
|
|
298
|
+
if (!execArgv.includes(IMPORT_FLAG)) execArgv = [
|
|
299
|
+
IMPORT_FLAG,
|
|
300
|
+
`@${TsRunner.OXC}-node/core/register`,
|
|
301
|
+
...execArgv
|
|
302
|
+
];
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
case TsRunner.SWC: {
|
|
306
|
+
if (tsUseEsm) {
|
|
307
|
+
if (IMPORT_FLAG_SUPPORTED) {
|
|
308
|
+
if (!hasImportFlag(execArgv)) execArgv = [
|
|
309
|
+
IMPORT_FLAG,
|
|
310
|
+
`@${TsRunner.SWC}-node/register/esm-register`,
|
|
311
|
+
...execArgv
|
|
312
|
+
];
|
|
313
|
+
} else if (!hasLoaderFlag(execArgv)) execArgv = [
|
|
314
|
+
LOADER_FLAG,
|
|
315
|
+
`@${TsRunner.SWC}-node/register/esm`,
|
|
316
|
+
...execArgv
|
|
317
|
+
];
|
|
318
|
+
} else if (!hasRequireFlag(execArgv)) execArgv = [
|
|
319
|
+
REQUIRE_ABBR_FLAG,
|
|
320
|
+
`@${TsRunner.SWC}-node/register`,
|
|
321
|
+
...execArgv
|
|
322
|
+
];
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
case TsRunner.TSX: {
|
|
326
|
+
if (IMPORT_FLAG_SUPPORTED) {
|
|
327
|
+
if (!execArgv.includes(IMPORT_FLAG)) execArgv = [
|
|
328
|
+
IMPORT_FLAG,
|
|
329
|
+
TsRunner.TSX,
|
|
330
|
+
...execArgv
|
|
331
|
+
];
|
|
332
|
+
} else if (!execArgv.includes(LOADER_FLAG)) execArgv = [
|
|
333
|
+
LOADER_FLAG,
|
|
334
|
+
TsRunner.TSX,
|
|
335
|
+
...execArgv
|
|
336
|
+
];
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
default: throw new Error(`Unknown ts runner: ${String(tsRunner)}`);
|
|
340
|
+
}
|
|
341
|
+
} else if (!jsUseEsm && ext !== ".cjs") {
|
|
342
|
+
const pkg = (0, __pkgr_core.findUp)(workerPath);
|
|
343
|
+
if (pkg) jsUseEsm = (0, __pkgr_core.cjsRequire)(pkg).type === "module";
|
|
344
|
+
}
|
|
345
|
+
let resolvedPnpLoaderPath;
|
|
346
|
+
/* istanbul ignore if -- https://github.com/facebook/jest/issues/5274 */
|
|
347
|
+
if (process.versions.pnp) {
|
|
348
|
+
let pnpApiPath;
|
|
349
|
+
try {
|
|
350
|
+
/** @see https://github.com/facebook/jest/issues/9543 */
|
|
351
|
+
pnpApiPath = __pkgr_core.cjsRequire.resolve("pnpapi");
|
|
352
|
+
} catch {}
|
|
353
|
+
if (pnpApiPath && !NODE_OPTIONS.some((option, index) => REQUIRE_FLAGS.has(option) && pnpApiPath === __pkgr_core.cjsRequire.resolve(NODE_OPTIONS[index + 1])) && !execArgv.includes(pnpApiPath)) {
|
|
354
|
+
execArgv = [
|
|
355
|
+
REQUIRE_ABBR_FLAG,
|
|
356
|
+
pnpApiPath,
|
|
357
|
+
...execArgv
|
|
358
|
+
];
|
|
359
|
+
const pnpLoaderPath = node_path.default.resolve(pnpApiPath, "../.pnp.loader.mjs");
|
|
360
|
+
if (isFile(pnpLoaderPath)) {
|
|
361
|
+
resolvedPnpLoaderPath = (0, node_url.pathToFileURL)(pnpLoaderPath).href;
|
|
362
|
+
if (!MODULE_REGISTER_SUPPORTED) execArgv = [
|
|
363
|
+
LOADER_FLAG,
|
|
364
|
+
resolvedPnpLoaderPath,
|
|
365
|
+
...execArgv
|
|
366
|
+
];
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return {
|
|
371
|
+
ext,
|
|
372
|
+
isTs,
|
|
373
|
+
jsUseEsm,
|
|
374
|
+
tsRunner,
|
|
375
|
+
tsUseEsm,
|
|
376
|
+
workerPath,
|
|
377
|
+
pnpLoaderPath: resolvedPnpLoaderPath,
|
|
378
|
+
execArgv
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
const md5Hash = (text) => (0, node_crypto.createHash)("md5").update(text).digest("hex");
|
|
382
|
+
const encodeImportModule = (moduleNameOrGlobalShim, type = "import") => {
|
|
383
|
+
const { moduleName, globalName, named, conditional } = typeof moduleNameOrGlobalShim === "string" ? { moduleName: moduleNameOrGlobalShim } : moduleNameOrGlobalShim;
|
|
384
|
+
const importStatement = type === "import" ? `import${globalName ? " " + (named === null ? "* as " + globalName : (named === null || named === void 0 ? void 0 : named.trim()) ? `{${named}}` : globalName) + " from" : ""} '${node_path.default.isAbsolute(moduleName) ? String((0, node_url.pathToFileURL)(moduleName)) : moduleName}'` : `${globalName ? "const " + ((named === null || named === void 0 ? void 0 : named.trim()) ? `{${named}}` : globalName) + "=" : ""}require('${moduleName.replace(/\\/g, "\\\\")}')`;
|
|
385
|
+
if (!globalName) return importStatement;
|
|
386
|
+
const overrideStatement = `globalThis.${globalName}=${(named === null || named === void 0 ? void 0 : named.trim()) ? named : globalName}`;
|
|
387
|
+
return importStatement + (conditional === false ? `;${overrideStatement}` : `;if(!globalThis.${globalName})${overrideStatement}`);
|
|
388
|
+
};
|
|
389
|
+
/** @internal */
|
|
390
|
+
const _generateGlobals = (globalShims, type) => globalShims.reduce((acc, shim) => `${acc}${acc ? ";" : ""}${encodeImportModule(shim, type)}`, "");
|
|
391
|
+
let globalsCache;
|
|
392
|
+
let tmpdir;
|
|
393
|
+
const _dirname = typeof __dirname === "undefined" ? node_path.default.dirname((0, node_url.fileURLToPath)(require$$7.pathToFileURL(__filename).href)) : __dirname;
|
|
394
|
+
const generateGlobals = (workerPath, globalShims, type = "import") => {
|
|
395
|
+
if (globalShims.length === 0) return "";
|
|
396
|
+
globalsCache ?? (globalsCache = new Map());
|
|
397
|
+
const cached = globalsCache.get(workerPath);
|
|
398
|
+
if (cached) {
|
|
399
|
+
const [content$1, filepath$1] = cached;
|
|
400
|
+
if (type === "require" && !filepath$1 || type === "import" && filepath$1 && isFile(filepath$1)) return content$1;
|
|
401
|
+
}
|
|
402
|
+
const globals = _generateGlobals(globalShims, type);
|
|
403
|
+
let content = globals;
|
|
404
|
+
let filepath;
|
|
405
|
+
if (type === "import") {
|
|
406
|
+
if (!tmpdir) tmpdir = node_path.default.resolve((0, __pkgr_core.findUp)(_dirname), "../node_modules/.synckit");
|
|
407
|
+
node_fs.default.mkdirSync(tmpdir, { recursive: true });
|
|
408
|
+
filepath = node_path.default.resolve(tmpdir, md5Hash(workerPath) + ".mjs");
|
|
409
|
+
content = encodeImportModule(filepath);
|
|
410
|
+
node_fs.default.writeFileSync(filepath, globals);
|
|
411
|
+
}
|
|
412
|
+
globalsCache.set(workerPath, [content, filepath]);
|
|
413
|
+
return content;
|
|
414
|
+
};
|
|
415
|
+
/**
|
|
416
|
+
* Creates a shallow copy of the enumerable properties from the provided object.
|
|
417
|
+
*
|
|
418
|
+
* @param object - An optional object whose properties are to be extracted.
|
|
419
|
+
* @returns A new object containing the enumerable properties of the input, or
|
|
420
|
+
* undefined if no valid object is provided.
|
|
421
|
+
*/
|
|
422
|
+
function extractProperties(object) {
|
|
423
|
+
if (object && typeof object === "object") {
|
|
424
|
+
const properties = {};
|
|
425
|
+
for (const key in object) properties[key] = object[key];
|
|
426
|
+
return properties;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
let sharedBuffer;
|
|
430
|
+
let sharedBufferView;
|
|
431
|
+
/**
|
|
432
|
+
* Spawns a worker thread and returns a synchronous function to dispatch tasks.
|
|
433
|
+
*
|
|
434
|
+
* The function initializes a worker thread with the specified script and
|
|
435
|
+
* configuration, setting up a dedicated message channel for bidirectional
|
|
436
|
+
* communication. It applies TypeScript runner settings, execution arguments,
|
|
437
|
+
* and global shims as needed. The returned function sends tasks to the worker,
|
|
438
|
+
* waits synchronously for a response using shared memory synchronization, and
|
|
439
|
+
* then returns the computed result.
|
|
440
|
+
*
|
|
441
|
+
* @param workerPath - The file path of the worker script to execute.
|
|
442
|
+
* @param options - An object containing configuration parameters:
|
|
443
|
+
*
|
|
444
|
+
* - Timeout: Maximum time in milliseconds to wait for the worker's response.
|
|
445
|
+
* - ExecArgv: Array of Node.js execution arguments for the worker.
|
|
446
|
+
* - TsRunner: Specifies the TypeScript runner to use if the worker script is
|
|
447
|
+
* TypeScript.
|
|
448
|
+
* - TransferList: List of additional transferable objects to pass to the worker.
|
|
449
|
+
* - GlobalShims: Modules to import as global shims; if true, a default preset is
|
|
450
|
+
* used.
|
|
451
|
+
*
|
|
452
|
+
* @returns A synchronous function that accepts task arguments intended for the
|
|
453
|
+
* worker thread and returns its result.
|
|
454
|
+
* @throws {Error} If a TypeScript runner is required but not specified, or if
|
|
455
|
+
* an unsupported TypeScript runner is used for the file type.
|
|
456
|
+
* @throws {Error} If internal synchronization fails or if the message
|
|
457
|
+
* identifier does not match the expected value.
|
|
458
|
+
*/
|
|
459
|
+
function startWorkerThread(workerPath, { timeout = DEFAULT_TIMEOUT, execArgv = DEFAULT_EXEC_ARGV, tsRunner = DEFAULT_TS_RUNNER, transferList = [], globalShims = DEFAULT_GLOBAL_SHIMS } = {}) {
|
|
460
|
+
const { port1: mainPort, port2: workerPort } = new node_worker_threads.MessageChannel();
|
|
461
|
+
const { isTs, ext, jsUseEsm, tsUseEsm, tsRunner: finalTsRunner, workerPath: finalWorkerPath, pnpLoaderPath, execArgv: finalExecArgv } = setupTsRunner(workerPath, {
|
|
462
|
+
execArgv,
|
|
463
|
+
tsRunner
|
|
464
|
+
});
|
|
465
|
+
const workerPathUrl = (0, node_url.pathToFileURL)(finalWorkerPath);
|
|
466
|
+
if (/\.[cm]ts$/.test(finalWorkerPath)) {
|
|
467
|
+
const isTsxSupported = !tsUseEsm || TS_ESM_PARTIAL_SUPPORTED;
|
|
468
|
+
/* istanbul ignore if */
|
|
469
|
+
if (!finalTsRunner) throw new Error("No ts runner specified, ts worker path is not supported");
|
|
470
|
+
else if ([
|
|
471
|
+
TsRunner.EsbuildRegister,
|
|
472
|
+
TsRunner.EsbuildRunner,
|
|
473
|
+
...TS_ESM_PARTIAL_SUPPORTED ? [TsRunner.OXC, TsRunner.SWC] : [],
|
|
474
|
+
...isTsxSupported ? [] : [TsRunner.TSX]
|
|
475
|
+
].includes(finalTsRunner)) throw new Error(`${finalTsRunner} is not supported for ${ext} files yet` + (isTsxSupported ? ", you can try [tsx](https://github.com/esbuild-kit/tsx) instead" : MTS_SUPPORTED ? ", you can try [oxc](https://github.com/oxc-project/oxc-node) or [swc](https://github.com/swc-project/swc-node/tree/master/packages/register) instead" : ""));
|
|
476
|
+
}
|
|
477
|
+
const finalGlobalShims = (globalShims === true ? DEFAULT_GLOBAL_SHIMS_PRESET : Array.isArray(globalShims) ? globalShims : []).filter(({ moduleName }) => (0, __pkgr_core.isPkgAvailable)(moduleName));
|
|
478
|
+
sharedBufferView ?? (sharedBufferView = new Int32Array(sharedBuffer ?? (sharedBuffer = new SharedArrayBuffer(INT32_BYTES)), 0, 1));
|
|
479
|
+
const useGlobals = finalGlobalShims.length > 0;
|
|
480
|
+
const useEval = isTs ? !tsUseEsm : !jsUseEsm && useGlobals;
|
|
481
|
+
const worker = new node_worker_threads.Worker(jsUseEsm && useGlobals || tsUseEsm && finalTsRunner === TsRunner.TsNode ? dataUrl(`${generateGlobals(finalWorkerPath, finalGlobalShims)};import '${String(workerPathUrl)}'`) : useEval ? `${generateGlobals(finalWorkerPath, finalGlobalShims, "require")};${encodeImportModule(finalWorkerPath, "require")}` : workerPathUrl, {
|
|
482
|
+
eval: useEval,
|
|
483
|
+
workerData: {
|
|
484
|
+
sharedBufferView,
|
|
485
|
+
workerPort,
|
|
486
|
+
pnpLoaderPath
|
|
487
|
+
},
|
|
488
|
+
transferList: [workerPort, ...transferList],
|
|
489
|
+
execArgv: finalExecArgv
|
|
490
|
+
});
|
|
491
|
+
let nextID = 0;
|
|
492
|
+
const receiveMessageWithId = (port, expectedId, waitingTimeout) => {
|
|
493
|
+
const start = Date.now();
|
|
494
|
+
const status = Atomics.wait(sharedBufferView, 0, 0, waitingTimeout);
|
|
495
|
+
Atomics.store(sharedBufferView, 0, 0);
|
|
496
|
+
if (!["ok", "not-equal"].includes(status)) {
|
|
497
|
+
const abortMsg = {
|
|
498
|
+
id: expectedId,
|
|
499
|
+
cmd: "abort"
|
|
500
|
+
};
|
|
501
|
+
port.postMessage(abortMsg);
|
|
502
|
+
throw new Error("Internal error: Atomics.wait() failed: " + status);
|
|
503
|
+
}
|
|
504
|
+
const result = (0, node_worker_threads.receiveMessageOnPort)(mainPort);
|
|
505
|
+
const msg = result === null || result === void 0 ? void 0 : result.message;
|
|
506
|
+
if ((msg === null || msg === void 0 ? void 0 : msg.id) == null || msg.id < expectedId) {
|
|
507
|
+
const waitingTime = Date.now() - start;
|
|
508
|
+
return receiveMessageWithId(port, expectedId, waitingTimeout ? waitingTimeout - waitingTime : void 0);
|
|
509
|
+
}
|
|
510
|
+
const { id,...message } = msg;
|
|
511
|
+
if (expectedId !== id) throw new Error(`Internal error: Expected id ${expectedId} but got id ${id}`);
|
|
512
|
+
return {
|
|
513
|
+
id,
|
|
514
|
+
...message
|
|
515
|
+
};
|
|
516
|
+
};
|
|
517
|
+
const syncFn = (...args) => {
|
|
518
|
+
const id = nextID++;
|
|
519
|
+
const msg = {
|
|
520
|
+
id,
|
|
521
|
+
args
|
|
522
|
+
};
|
|
523
|
+
worker.postMessage(msg);
|
|
524
|
+
const { result, error, properties, stdio } = receiveMessageWithId(mainPort, id, timeout);
|
|
525
|
+
for (const { type, chunk, encoding } of stdio) process[type].write(chunk, encoding);
|
|
526
|
+
if (error) throw Object.assign(error, properties);
|
|
527
|
+
return result;
|
|
528
|
+
};
|
|
529
|
+
worker.unref();
|
|
530
|
+
return syncFn;
|
|
531
|
+
}
|
|
532
|
+
const overrideStdio = (stdio) => {
|
|
533
|
+
for (const type of ["stdout", "stderr"]) process[type]._writev = (chunks, callback) => {
|
|
534
|
+
for (const { chunk, encoding } of chunks) stdio.push({
|
|
535
|
+
type,
|
|
536
|
+
chunk,
|
|
537
|
+
encoding
|
|
538
|
+
});
|
|
539
|
+
callback();
|
|
540
|
+
};
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
//#endregion
|
|
544
|
+
//#region src/index.ts
|
|
545
|
+
let syncFnCache;
|
|
546
|
+
/**
|
|
547
|
+
* Creates a synchronous worker function.
|
|
548
|
+
*
|
|
549
|
+
* Converts the provided worker path (URL or string) to an absolute file path,
|
|
550
|
+
* retrieves a cached synchronous function if one exists, or starts a new worker
|
|
551
|
+
* thread to handle task execution. The resulting function is cached to avoid
|
|
552
|
+
* redundant initialization.
|
|
553
|
+
*
|
|
554
|
+
* @param workerPath - The absolute file path or URL of the worker script. If
|
|
555
|
+
* given as a URL, it is converted to a file path.
|
|
556
|
+
* @param timeoutOrOptions - Optional timeout in milliseconds or an options
|
|
557
|
+
* object to configure the worker thread.
|
|
558
|
+
* @returns A synchronous function that executes tasks on the specified worker
|
|
559
|
+
* thread.
|
|
560
|
+
* @throws {Error} If the resulting worker path is not absolute.
|
|
561
|
+
*/
|
|
562
|
+
function createSyncFn(workerPath, timeoutOrOptions) {
|
|
563
|
+
syncFnCache ?? (syncFnCache = new Map());
|
|
564
|
+
if (typeof workerPath !== "string" || workerPath.startsWith("file://")) workerPath = (0, node_url.fileURLToPath)(workerPath);
|
|
565
|
+
const cachedSyncFn = syncFnCache.get(workerPath);
|
|
566
|
+
if (cachedSyncFn) return cachedSyncFn;
|
|
567
|
+
if (!node_path.default.isAbsolute(workerPath)) throw new Error("`workerPath` must be absolute");
|
|
568
|
+
const syncFn = startWorkerThread(
|
|
569
|
+
workerPath,
|
|
570
|
+
/* istanbul ignore next */
|
|
571
|
+
typeof timeoutOrOptions === "number" ? { timeout: timeoutOrOptions } : timeoutOrOptions
|
|
572
|
+
);
|
|
573
|
+
syncFnCache.set(workerPath, syncFn);
|
|
574
|
+
return syncFn;
|
|
575
|
+
}
|
|
576
|
+
/* istanbul ignore next */
|
|
577
|
+
/**
|
|
578
|
+
* Configures the worker thread to listen for messages from the parent process
|
|
579
|
+
* and execute a provided function.
|
|
580
|
+
*
|
|
581
|
+
* If the worker is not initialized with the required data, the function exits
|
|
582
|
+
* without further action. Otherwise, it optionally registers a custom module
|
|
583
|
+
* loader when a valid loader path is provided and captures output generated
|
|
584
|
+
* during execution. It listens for messages containing an identifier and
|
|
585
|
+
* arguments, then invokes the supplied function asynchronously with those
|
|
586
|
+
* arguments. If an abort command is received for the same message, the response
|
|
587
|
+
* is suppressed. Upon completing execution, it posts a message back with either
|
|
588
|
+
* the result or error details, including extracted error properties.
|
|
589
|
+
*
|
|
590
|
+
* @param fn - The function to execute when a message is received.
|
|
591
|
+
*/
|
|
592
|
+
function runAsWorker(fn) {
|
|
593
|
+
if (!node_worker_threads.workerData) return;
|
|
594
|
+
const stdio = [];
|
|
595
|
+
overrideStdio(stdio);
|
|
596
|
+
const { workerPort, sharedBufferView: sharedBufferView$1, pnpLoaderPath } = node_worker_threads.workerData;
|
|
597
|
+
if (pnpLoaderPath && MODULE_REGISTER_SUPPORTED) node_module.default.register(pnpLoaderPath);
|
|
598
|
+
node_worker_threads.parentPort.on("message", ({ id, args }) => {
|
|
599
|
+
(async () => {
|
|
600
|
+
let isAborted = false;
|
|
601
|
+
const handleAbortMessage = (msg$1) => {
|
|
602
|
+
if (msg$1.id === id && msg$1.cmd === "abort") isAborted = true;
|
|
603
|
+
};
|
|
604
|
+
workerPort.on("message", handleAbortMessage);
|
|
605
|
+
let msg;
|
|
606
|
+
try {
|
|
607
|
+
msg = {
|
|
608
|
+
id,
|
|
609
|
+
stdio,
|
|
610
|
+
result: await fn(...args)
|
|
611
|
+
};
|
|
612
|
+
} catch (error) {
|
|
613
|
+
msg = {
|
|
614
|
+
id,
|
|
615
|
+
stdio,
|
|
616
|
+
error,
|
|
617
|
+
properties: extractProperties(error)
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
workerPort.off("message", handleAbortMessage);
|
|
621
|
+
if (isAborted) {
|
|
622
|
+
stdio.length = 0;
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
try {
|
|
626
|
+
workerPort.postMessage(msg);
|
|
627
|
+
Atomics.add(sharedBufferView$1, 0, 1);
|
|
628
|
+
Atomics.notify(sharedBufferView$1, 0);
|
|
629
|
+
} finally {
|
|
630
|
+
stdio.length = 0;
|
|
631
|
+
}
|
|
632
|
+
})();
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
//#endregion
|
|
637
|
+
lib$1.DEFAULT_EXEC_ARGV = DEFAULT_EXEC_ARGV;
|
|
638
|
+
lib$1.DEFAULT_GLOBAL_SHIMS = DEFAULT_GLOBAL_SHIMS;
|
|
639
|
+
lib$1.DEFAULT_GLOBAL_SHIMS_PRESET = DEFAULT_GLOBAL_SHIMS_PRESET;
|
|
640
|
+
lib$1.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;
|
|
641
|
+
lib$1.DEFAULT_TS_RUNNER = DEFAULT_TS_RUNNER;
|
|
642
|
+
lib$1.DEFAULT_TYPES_NODE_VERSION = DEFAULT_TYPES_NODE_VERSION;
|
|
643
|
+
lib$1.EXPERIMENTAL_LOADER_FLAG = EXPERIMENTAL_LOADER_FLAG;
|
|
644
|
+
lib$1.FEATURE_TYPESCRIPT_NODE_VERSION = FEATURE_TYPESCRIPT_NODE_VERSION;
|
|
645
|
+
lib$1.IMPORT_FLAG = IMPORT_FLAG;
|
|
646
|
+
lib$1.IMPORT_FLAG_SUPPORTED = IMPORT_FLAG_SUPPORTED;
|
|
647
|
+
lib$1.INT32_BYTES = INT32_BYTES;
|
|
648
|
+
lib$1.LOADER_FLAG = LOADER_FLAG;
|
|
649
|
+
lib$1.LOADER_FLAGS = LOADER_FLAGS;
|
|
650
|
+
lib$1.MODULE_REGISTER_SUPPORTED = MODULE_REGISTER_SUPPORTED;
|
|
651
|
+
lib$1.MTS_SUPPORTED = MTS_SUPPORTED;
|
|
652
|
+
lib$1.NODE_OPTIONS = NODE_OPTIONS;
|
|
653
|
+
lib$1.NODE_VERSION = NODE_VERSION;
|
|
654
|
+
lib$1.NO_STRIP_TYPES = NO_STRIP_TYPES;
|
|
655
|
+
lib$1.NO_STRIP_TYPES_FLAG = NO_STRIP_TYPES_FLAG;
|
|
656
|
+
lib$1.REQUIRE_ABBR_FLAG = REQUIRE_ABBR_FLAG;
|
|
657
|
+
lib$1.REQUIRE_FLAG = REQUIRE_FLAG;
|
|
658
|
+
lib$1.REQUIRE_FLAGS = REQUIRE_FLAGS;
|
|
659
|
+
lib$1.STRIP_TYPES_FLAG = STRIP_TYPES_FLAG;
|
|
660
|
+
lib$1.STRIP_TYPES_NODE_VERSION = STRIP_TYPES_NODE_VERSION;
|
|
661
|
+
lib$1.TRANSFORM_TYPES_FLAG = TRANSFORM_TYPES_FLAG;
|
|
662
|
+
lib$1.TRANSFORM_TYPES_NODE_VERSION = TRANSFORM_TYPES_NODE_VERSION;
|
|
663
|
+
lib$1.TS_ESM_PARTIAL_SUPPORTED = TS_ESM_PARTIAL_SUPPORTED;
|
|
664
|
+
lib$1.TsRunner = TsRunner;
|
|
665
|
+
lib$1._generateGlobals = _generateGlobals;
|
|
666
|
+
lib$1.compareNodeVersion = compareNodeVersion;
|
|
667
|
+
lib$1.compareVersion = compareVersion;
|
|
668
|
+
lib$1.createSyncFn = createSyncFn;
|
|
669
|
+
lib$1.dataUrl = dataUrl;
|
|
670
|
+
lib$1.encodeImportModule = encodeImportModule;
|
|
671
|
+
lib$1.extractProperties = extractProperties;
|
|
672
|
+
lib$1.generateGlobals = generateGlobals;
|
|
673
|
+
lib$1.hasFlag = hasFlag;
|
|
674
|
+
lib$1.hasImportFlag = hasImportFlag;
|
|
675
|
+
lib$1.hasLoaderFlag = hasLoaderFlag;
|
|
676
|
+
lib$1.hasRequireFlag = hasRequireFlag;
|
|
677
|
+
lib$1.isFile = isFile;
|
|
678
|
+
lib$1.md5Hash = md5Hash;
|
|
679
|
+
lib$1.overrideStdio = overrideStdio;
|
|
680
|
+
lib$1.parseVersion = parseVersion;
|
|
681
|
+
lib$1.runAsWorker = runAsWorker;
|
|
682
|
+
lib$1.setupTsRunner = setupTsRunner;
|
|
683
|
+
lib$1.startWorkerThread = startWorkerThread;
|
|
684
|
+
return lib$1;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
export { requireLib as r };
|