@alexlit/lint-kit 167.4.0 → 168.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/package.json +1 -1
- package/packages/config-eslint/node_modules/glob/LICENSE +15 -0
- package/packages/config-eslint/node_modules/glob/README.md +1265 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/glob.d.ts +388 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/glob.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/glob.js +247 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/glob.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/has-magic.d.ts +14 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/has-magic.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/has-magic.js +27 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/has-magic.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/ignore.d.ts +24 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/ignore.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/ignore.js +119 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/ignore.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/index.d.ts +97 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/index.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/index.js +68 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/index.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/package.json +3 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/pattern.d.ts +76 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/pattern.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/pattern.js +219 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/pattern.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/processor.d.ts +59 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/processor.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/processor.js +301 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/processor.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/walker.d.ts +97 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/walker.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/walker.js +387 -0
- package/packages/config-eslint/node_modules/glob/dist/commonjs/walker.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/bin.d.mts +3 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/bin.d.mts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/bin.mjs +346 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/bin.mjs.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/glob.d.ts +388 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/glob.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/glob.js +243 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/glob.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/has-magic.d.ts +14 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/has-magic.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/has-magic.js +23 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/has-magic.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/ignore.d.ts +24 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/ignore.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/ignore.js +115 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/ignore.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/index.d.ts +97 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/index.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/index.js +55 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/index.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/package.json +3 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/pattern.d.ts +76 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/pattern.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/pattern.js +215 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/pattern.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/processor.d.ts +59 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/processor.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/processor.js +294 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/processor.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/walker.d.ts +97 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/walker.d.ts.map +1 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/walker.js +381 -0
- package/packages/config-eslint/node_modules/glob/dist/esm/walker.js.map +1 -0
- package/packages/config-eslint/node_modules/glob/package.json +99 -0
- package/packages/config-eslint/node_modules/ignore/LICENSE-MIT +21 -0
- package/packages/config-eslint/node_modules/ignore/README.md +452 -0
- package/packages/config-eslint/node_modules/ignore/index.d.ts +81 -0
- package/packages/config-eslint/node_modules/ignore/index.js +784 -0
- package/packages/config-eslint/node_modules/ignore/legacy.js +681 -0
- package/packages/config-eslint/node_modules/ignore/package.json +87 -0
- package/packages/config-eslint/node_modules/{vue-eslint-parser → synckit}/LICENSE +1 -1
- package/packages/config-eslint/node_modules/synckit/README.md +245 -0
- package/packages/config-eslint/node_modules/synckit/index.d.cts +3 -0
- package/packages/config-eslint/node_modules/synckit/lib/index.cjs +590 -0
- package/packages/config-eslint/node_modules/synckit/lib/index.d.ts +43 -0
- package/packages/config-eslint/node_modules/synckit/lib/index.js +476 -0
- package/packages/config-eslint/node_modules/synckit/lib/index.js.map +1 -0
- package/packages/config-eslint/node_modules/synckit/lib/types.d.ts +40 -0
- package/packages/config-eslint/node_modules/synckit/lib/types.js +2 -0
- package/packages/config-eslint/node_modules/synckit/lib/types.js.map +1 -0
- package/packages/config-eslint/node_modules/synckit/package.json +46 -0
- package/packages/config-eslint/package.json +5 -5
- package/packages/config-eslint/plugins/vue.js +1 -0
- package/packages/config-prettier/package.json +2 -2
- package/packages/config-eslint/node_modules/vue-eslint-parser/README.md +0 -332
- package/packages/config-eslint/node_modules/vue-eslint-parser/index.d.ts +0 -667
- package/packages/config-eslint/node_modules/vue-eslint-parser/index.js +0 -6642
- package/packages/config-eslint/node_modules/vue-eslint-parser/index.js.map +0 -1
- package/packages/config-eslint/node_modules/vue-eslint-parser/package.json +0 -100
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
import { __awaiter, __rest } from "tslib";
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import module from 'node:module';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
7
|
+
import { MessageChannel, Worker, parentPort, receiveMessageOnPort, workerData, } from 'node:worker_threads';
|
|
8
|
+
import { cjsRequire, findUp, isPkgAvailable, tryExtensions } from '@pkgr/core';
|
|
9
|
+
const INT32_BYTES = 4;
|
|
10
|
+
export * from './types.js';
|
|
11
|
+
export const TsRunner = {
|
|
12
|
+
Node: 'node',
|
|
13
|
+
Bun: 'bun',
|
|
14
|
+
TsNode: 'ts-node',
|
|
15
|
+
EsbuildRegister: 'esbuild-register',
|
|
16
|
+
EsbuildRunner: 'esbuild-runner',
|
|
17
|
+
SWC: 'swc',
|
|
18
|
+
TSX: 'tsx',
|
|
19
|
+
};
|
|
20
|
+
const { NODE_OPTIONS: NODE_OPTIONS_ = '', SYNCKIT_EXEC_ARGV = '', SYNCKIT_GLOBAL_SHIMS, SYNCKIT_TIMEOUT, SYNCKIT_TS_RUNNER, } = process.env;
|
|
21
|
+
export const MTS_SUPPORTED_NODE_VERSION = '16';
|
|
22
|
+
export const LOADER_SUPPORTED_NODE_VERSION = '20';
|
|
23
|
+
export const STRIP_TYPES_NODE_VERSION = '22.6';
|
|
24
|
+
export const TRANSFORM_TYPES_NODE_VERSION = '22.7';
|
|
25
|
+
export const FEATURE_TYPESCRIPT_NODE_VERSION = '22.10';
|
|
26
|
+
export const DEFAULT_TYPES_NODE_VERSION = '23.6';
|
|
27
|
+
export const STRIP_TYPES_FLAG = '--experimental-strip-types';
|
|
28
|
+
export const TRANSFORM_TYPES_FLAG = '--experimental-transform-types';
|
|
29
|
+
export const NO_STRIP_TYPES_FLAG = '--no-experimental-strip-types';
|
|
30
|
+
const NODE_OPTIONS = NODE_OPTIONS_.split(/\s+/);
|
|
31
|
+
const hasFlag = (flag) => NODE_OPTIONS.includes(flag) || process.argv.includes(flag);
|
|
32
|
+
const parseVersion = (version) => version.split('.').map(Number.parseFloat);
|
|
33
|
+
export const compareVersion = (version1, version2) => {
|
|
34
|
+
const versions1 = parseVersion(version1);
|
|
35
|
+
const versions2 = parseVersion(version2);
|
|
36
|
+
const length = Math.max(versions1.length, versions2.length);
|
|
37
|
+
for (let i = 0; i < length; i++) {
|
|
38
|
+
const v1 = versions1[i] || 0;
|
|
39
|
+
const v2 = versions2[i] || 0;
|
|
40
|
+
if (v1 > v2) {
|
|
41
|
+
return 1;
|
|
42
|
+
}
|
|
43
|
+
if (v1 < v2) {
|
|
44
|
+
return -1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return 0;
|
|
48
|
+
};
|
|
49
|
+
export const NODE_VERSION = process.versions.node;
|
|
50
|
+
const NO_STRIP_TYPES = compareVersion(NODE_VERSION, FEATURE_TYPESCRIPT_NODE_VERSION) >= 0
|
|
51
|
+
? process.features.typescript === false
|
|
52
|
+
: hasFlag(NO_STRIP_TYPES_FLAG) &&
|
|
53
|
+
!hasFlag(STRIP_TYPES_FLAG) &&
|
|
54
|
+
!hasFlag(TRANSFORM_TYPES_FLAG);
|
|
55
|
+
export const DEFAULT_TIMEOUT = SYNCKIT_TIMEOUT ? +SYNCKIT_TIMEOUT : undefined;
|
|
56
|
+
export const DEFAULT_EXEC_ARGV = SYNCKIT_EXEC_ARGV.split(',');
|
|
57
|
+
export const DEFAULT_TS_RUNNER = SYNCKIT_TS_RUNNER;
|
|
58
|
+
export const DEFAULT_GLOBAL_SHIMS = ['1', 'true'].includes(SYNCKIT_GLOBAL_SHIMS);
|
|
59
|
+
export const DEFAULT_GLOBAL_SHIMS_PRESET = [
|
|
60
|
+
{
|
|
61
|
+
moduleName: 'node-fetch',
|
|
62
|
+
globalName: 'fetch',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
moduleName: 'node:perf_hooks',
|
|
66
|
+
globalName: 'performance',
|
|
67
|
+
named: 'performance',
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
let syncFnCache;
|
|
71
|
+
export function extractProperties(object) {
|
|
72
|
+
if (object && typeof object === 'object') {
|
|
73
|
+
const properties = {};
|
|
74
|
+
for (const key in object) {
|
|
75
|
+
properties[key] = object[key];
|
|
76
|
+
}
|
|
77
|
+
return properties;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export function createSyncFn(workerPath, timeoutOrOptions) {
|
|
81
|
+
syncFnCache !== null && syncFnCache !== void 0 ? syncFnCache : (syncFnCache = new Map());
|
|
82
|
+
if (typeof workerPath !== 'string' || workerPath.startsWith('file://')) {
|
|
83
|
+
workerPath = fileURLToPath(workerPath);
|
|
84
|
+
}
|
|
85
|
+
const cachedSyncFn = syncFnCache.get(workerPath);
|
|
86
|
+
if (cachedSyncFn) {
|
|
87
|
+
return cachedSyncFn;
|
|
88
|
+
}
|
|
89
|
+
if (!path.isAbsolute(workerPath)) {
|
|
90
|
+
throw new Error('`workerPath` must be absolute');
|
|
91
|
+
}
|
|
92
|
+
const syncFn = startWorkerThread(workerPath, typeof timeoutOrOptions === 'number'
|
|
93
|
+
? { timeout: timeoutOrOptions }
|
|
94
|
+
: timeoutOrOptions);
|
|
95
|
+
syncFnCache.set(workerPath, syncFn);
|
|
96
|
+
return syncFn;
|
|
97
|
+
}
|
|
98
|
+
const dataUrl = (code) => new URL(`data:text/javascript,${encodeURIComponent(code)}`);
|
|
99
|
+
export const isFile = (path) => {
|
|
100
|
+
var _a;
|
|
101
|
+
try {
|
|
102
|
+
return !!((_a = fs.statSync(path, { throwIfNoEntry: false })) === null || _a === void 0 ? void 0 : _a.isFile());
|
|
103
|
+
}
|
|
104
|
+
catch (_b) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const setupTsRunner = (workerPath, { execArgv, tsRunner }) => {
|
|
109
|
+
let ext = path.extname(workerPath);
|
|
110
|
+
if (!/([/\\])node_modules\1/.test(workerPath) &&
|
|
111
|
+
(!ext || /^\.[cm]?js$/.test(ext))) {
|
|
112
|
+
const workPathWithoutExt = ext
|
|
113
|
+
? workerPath.slice(0, -ext.length)
|
|
114
|
+
: workerPath;
|
|
115
|
+
let extensions;
|
|
116
|
+
switch (ext) {
|
|
117
|
+
case '.cjs': {
|
|
118
|
+
extensions = ['.cts', '.cjs'];
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
case '.mjs': {
|
|
122
|
+
extensions = ['.mts', '.mjs'];
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
default: {
|
|
126
|
+
extensions = ['.ts', '.js'];
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const found = tryExtensions(workPathWithoutExt, extensions);
|
|
131
|
+
let differentExt;
|
|
132
|
+
if (found && (!ext || (differentExt = found !== workPathWithoutExt))) {
|
|
133
|
+
workerPath = found;
|
|
134
|
+
if (differentExt) {
|
|
135
|
+
ext = path.extname(workerPath);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const isTs = /\.[cm]?ts$/.test(workerPath);
|
|
140
|
+
let jsUseEsm = workerPath.endsWith('.mjs');
|
|
141
|
+
let tsUseEsm = workerPath.endsWith('.mts');
|
|
142
|
+
if (isTs) {
|
|
143
|
+
if (!tsUseEsm) {
|
|
144
|
+
const pkg = findUp(workerPath);
|
|
145
|
+
if (pkg) {
|
|
146
|
+
tsUseEsm = cjsRequire(pkg).type === 'module';
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const stripTypesIndex = execArgv.indexOf(STRIP_TYPES_FLAG);
|
|
150
|
+
const transformTypesIndex = execArgv.indexOf(TRANSFORM_TYPES_FLAG);
|
|
151
|
+
const noStripTypesIndex = execArgv.indexOf(NO_STRIP_TYPES_FLAG);
|
|
152
|
+
const execArgvNoStripTypes = noStripTypesIndex > stripTypesIndex ||
|
|
153
|
+
noStripTypesIndex > transformTypesIndex;
|
|
154
|
+
const noStripTypes = execArgvNoStripTypes ||
|
|
155
|
+
(stripTypesIndex === -1 && transformTypesIndex === -1 && NO_STRIP_TYPES);
|
|
156
|
+
if (tsRunner == null) {
|
|
157
|
+
if (process.versions.bun) {
|
|
158
|
+
tsRunner = TsRunner.Bun;
|
|
159
|
+
}
|
|
160
|
+
else if (!noStripTypes &&
|
|
161
|
+
compareVersion(NODE_VERSION, STRIP_TYPES_NODE_VERSION) >= 0) {
|
|
162
|
+
tsRunner = TsRunner.Node;
|
|
163
|
+
}
|
|
164
|
+
else if (isPkgAvailable(TsRunner.TsNode)) {
|
|
165
|
+
tsRunner = TsRunner.TsNode;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
switch (tsRunner) {
|
|
169
|
+
case TsRunner.Bun: {
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
case TsRunner.Node: {
|
|
173
|
+
if (compareVersion(NODE_VERSION, STRIP_TYPES_NODE_VERSION) < 0) {
|
|
174
|
+
throw new Error('type stripping is not supported in this node version');
|
|
175
|
+
}
|
|
176
|
+
if (noStripTypes) {
|
|
177
|
+
throw new Error('type stripping is disabled explicitly');
|
|
178
|
+
}
|
|
179
|
+
if (compareVersion(NODE_VERSION, DEFAULT_TYPES_NODE_VERSION) >= 0) {
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
if (compareVersion(NODE_VERSION, TRANSFORM_TYPES_NODE_VERSION) >= 0 &&
|
|
183
|
+
!execArgv.includes(TRANSFORM_TYPES_FLAG)) {
|
|
184
|
+
execArgv = [TRANSFORM_TYPES_FLAG, ...execArgv];
|
|
185
|
+
}
|
|
186
|
+
else if (compareVersion(NODE_VERSION, STRIP_TYPES_NODE_VERSION) >= 0 &&
|
|
187
|
+
!execArgv.includes(STRIP_TYPES_FLAG)) {
|
|
188
|
+
execArgv = [STRIP_TYPES_FLAG, ...execArgv];
|
|
189
|
+
}
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
case TsRunner.TsNode: {
|
|
193
|
+
if (tsUseEsm) {
|
|
194
|
+
if (!execArgv.includes('--loader')) {
|
|
195
|
+
execArgv = ['--loader', `${TsRunner.TsNode}/esm`, ...execArgv];
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
else if (!execArgv.includes('-r')) {
|
|
199
|
+
execArgv = ['-r', `${TsRunner.TsNode}/register`, ...execArgv];
|
|
200
|
+
}
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
case TsRunner.EsbuildRegister: {
|
|
204
|
+
if (!execArgv.includes('-r')) {
|
|
205
|
+
execArgv = ['-r', TsRunner.EsbuildRegister, ...execArgv];
|
|
206
|
+
}
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
case TsRunner.EsbuildRunner: {
|
|
210
|
+
if (!execArgv.includes('-r')) {
|
|
211
|
+
execArgv = ['-r', `${TsRunner.EsbuildRunner}/register`, ...execArgv];
|
|
212
|
+
}
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
case TsRunner.SWC: {
|
|
216
|
+
if (!execArgv.includes('-r')) {
|
|
217
|
+
execArgv = ['-r', `@${TsRunner.SWC}-node/register`, ...execArgv];
|
|
218
|
+
}
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
case TsRunner.TSX: {
|
|
222
|
+
if (!execArgv.includes('--loader')) {
|
|
223
|
+
execArgv = ['--loader', TsRunner.TSX, ...execArgv];
|
|
224
|
+
}
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
default: {
|
|
228
|
+
throw new Error(`Unknown ts runner: ${String(tsRunner)}`);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
else if (!jsUseEsm) {
|
|
233
|
+
const pkg = findUp(workerPath);
|
|
234
|
+
if (pkg) {
|
|
235
|
+
jsUseEsm = cjsRequire(pkg).type === 'module';
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
let resolvedPnpLoaderPath;
|
|
239
|
+
if (process.versions.pnp) {
|
|
240
|
+
let pnpApiPath;
|
|
241
|
+
try {
|
|
242
|
+
pnpApiPath = cjsRequire.resolve('pnpapi');
|
|
243
|
+
}
|
|
244
|
+
catch (_a) { }
|
|
245
|
+
if (pnpApiPath &&
|
|
246
|
+
!NODE_OPTIONS.some((option, index) => ['-r', '--require'].includes(option) &&
|
|
247
|
+
pnpApiPath === cjsRequire.resolve(NODE_OPTIONS[index + 1])) &&
|
|
248
|
+
!execArgv.includes(pnpApiPath)) {
|
|
249
|
+
execArgv = ['-r', pnpApiPath, ...execArgv];
|
|
250
|
+
const pnpLoaderPath = path.resolve(pnpApiPath, '../.pnp.loader.mjs');
|
|
251
|
+
if (isFile(pnpLoaderPath)) {
|
|
252
|
+
resolvedPnpLoaderPath = pathToFileURL(pnpLoaderPath).toString();
|
|
253
|
+
if (compareVersion(NODE_VERSION, LOADER_SUPPORTED_NODE_VERSION) < 0) {
|
|
254
|
+
execArgv = [
|
|
255
|
+
'--experimental-loader',
|
|
256
|
+
resolvedPnpLoaderPath,
|
|
257
|
+
...execArgv,
|
|
258
|
+
];
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return {
|
|
264
|
+
ext,
|
|
265
|
+
isTs,
|
|
266
|
+
jsUseEsm,
|
|
267
|
+
tsRunner,
|
|
268
|
+
tsUseEsm,
|
|
269
|
+
workerPath,
|
|
270
|
+
pnpLoaderPath: resolvedPnpLoaderPath,
|
|
271
|
+
execArgv,
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
const md5Hash = (text) => createHash('md5').update(text).digest('hex');
|
|
275
|
+
export const encodeImportModule = (moduleNameOrGlobalShim, type = 'import') => {
|
|
276
|
+
const { moduleName, globalName, named, conditional } = typeof moduleNameOrGlobalShim === 'string'
|
|
277
|
+
? { moduleName: moduleNameOrGlobalShim }
|
|
278
|
+
: moduleNameOrGlobalShim;
|
|
279
|
+
const importStatement = type === 'import'
|
|
280
|
+
? `import${globalName
|
|
281
|
+
? ' ' +
|
|
282
|
+
(named === null
|
|
283
|
+
? '* as ' + globalName
|
|
284
|
+
: (named === null || named === void 0 ? void 0 : named.trim())
|
|
285
|
+
? `{${named}}`
|
|
286
|
+
: globalName) +
|
|
287
|
+
' from'
|
|
288
|
+
: ''} '${path.isAbsolute(moduleName)
|
|
289
|
+
? String(pathToFileURL(moduleName))
|
|
290
|
+
: moduleName}'`
|
|
291
|
+
: `${globalName
|
|
292
|
+
? 'const ' + ((named === null || named === void 0 ? void 0 : named.trim()) ? `{${named}}` : globalName) + '='
|
|
293
|
+
: ''}require('${moduleName
|
|
294
|
+
.replace(/\\/g, '\\\\')}')`;
|
|
295
|
+
if (!globalName) {
|
|
296
|
+
return importStatement;
|
|
297
|
+
}
|
|
298
|
+
const overrideStatement = `globalThis.${globalName}=${(named === null || named === void 0 ? void 0 : named.trim()) ? named : globalName}`;
|
|
299
|
+
return (importStatement +
|
|
300
|
+
(conditional === false
|
|
301
|
+
? `;${overrideStatement}`
|
|
302
|
+
: `;if(!globalThis.${globalName})${overrideStatement}`));
|
|
303
|
+
};
|
|
304
|
+
export const _generateGlobals = (globalShims, type) => globalShims.reduce((acc, shim) => `${acc}${acc ? ';' : ''}${encodeImportModule(shim, type)}`, '');
|
|
305
|
+
let globalsCache;
|
|
306
|
+
let tmpdir;
|
|
307
|
+
const _dirname = typeof __dirname === 'undefined'
|
|
308
|
+
? path.dirname(fileURLToPath(import.meta.url))
|
|
309
|
+
: __dirname;
|
|
310
|
+
let sharedBuffer;
|
|
311
|
+
let sharedBufferView;
|
|
312
|
+
export const generateGlobals = (workerPath, globalShims, type = 'import') => {
|
|
313
|
+
if (globalShims.length === 0) {
|
|
314
|
+
return '';
|
|
315
|
+
}
|
|
316
|
+
globalsCache !== null && globalsCache !== void 0 ? globalsCache : (globalsCache = new Map());
|
|
317
|
+
const cached = globalsCache.get(workerPath);
|
|
318
|
+
if (cached) {
|
|
319
|
+
const [content, filepath] = cached;
|
|
320
|
+
if ((type === 'require' && !filepath) ||
|
|
321
|
+
(type === 'import' && filepath && isFile(filepath))) {
|
|
322
|
+
return content;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const globals = _generateGlobals(globalShims, type);
|
|
326
|
+
let content = globals;
|
|
327
|
+
let filepath;
|
|
328
|
+
if (type === 'import') {
|
|
329
|
+
if (!tmpdir) {
|
|
330
|
+
tmpdir = path.resolve(findUp(_dirname), '../node_modules/.synckit');
|
|
331
|
+
}
|
|
332
|
+
fs.mkdirSync(tmpdir, { recursive: true });
|
|
333
|
+
filepath = path.resolve(tmpdir, md5Hash(workerPath) + '.mjs');
|
|
334
|
+
content = encodeImportModule(filepath);
|
|
335
|
+
fs.writeFileSync(filepath, globals);
|
|
336
|
+
}
|
|
337
|
+
globalsCache.set(workerPath, [content, filepath]);
|
|
338
|
+
return content;
|
|
339
|
+
};
|
|
340
|
+
function startWorkerThread(workerPath, { timeout = DEFAULT_TIMEOUT, execArgv = DEFAULT_EXEC_ARGV, tsRunner = DEFAULT_TS_RUNNER, transferList = [], globalShims = DEFAULT_GLOBAL_SHIMS, } = {}) {
|
|
341
|
+
const { port1: mainPort, port2: workerPort } = new MessageChannel();
|
|
342
|
+
const { isTs, ext, jsUseEsm, tsUseEsm, tsRunner: finalTsRunner, workerPath: finalWorkerPath, pnpLoaderPath, execArgv: finalExecArgv, } = setupTsRunner(workerPath, { execArgv, tsRunner });
|
|
343
|
+
const workerPathUrl = pathToFileURL(finalWorkerPath);
|
|
344
|
+
if (/\.[cm]ts$/.test(finalWorkerPath)) {
|
|
345
|
+
const isTsxSupported = !tsUseEsm ||
|
|
346
|
+
compareVersion(NODE_VERSION, MTS_SUPPORTED_NODE_VERSION) >= 0;
|
|
347
|
+
if (!finalTsRunner) {
|
|
348
|
+
throw new Error('No ts runner specified, ts worker path is not supported');
|
|
349
|
+
}
|
|
350
|
+
else if ([
|
|
351
|
+
TsRunner.EsbuildRegister,
|
|
352
|
+
TsRunner.EsbuildRunner,
|
|
353
|
+
TsRunner.SWC,
|
|
354
|
+
...(isTsxSupported ? [] : [TsRunner.TSX]),
|
|
355
|
+
].includes(finalTsRunner)) {
|
|
356
|
+
throw new Error(`${finalTsRunner} is not supported for ${ext} files yet` +
|
|
357
|
+
(isTsxSupported
|
|
358
|
+
? ', you can try [tsx](https://github.com/esbuild-kit/tsx) instead'
|
|
359
|
+
: ''));
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
const finalGlobalShims = (globalShims === true
|
|
363
|
+
? DEFAULT_GLOBAL_SHIMS_PRESET
|
|
364
|
+
: Array.isArray(globalShims)
|
|
365
|
+
? globalShims
|
|
366
|
+
: []).filter(({ moduleName }) => isPkgAvailable(moduleName));
|
|
367
|
+
sharedBufferView !== null && sharedBufferView !== void 0 ? sharedBufferView : (sharedBufferView = new Int32Array((sharedBuffer !== null && sharedBuffer !== void 0 ? sharedBuffer : (sharedBuffer = new SharedArrayBuffer(INT32_BYTES))), 0, 1));
|
|
368
|
+
const useGlobals = finalGlobalShims.length > 0;
|
|
369
|
+
const useEval = isTs ? !tsUseEsm : !jsUseEsm && useGlobals;
|
|
370
|
+
const worker = new Worker((jsUseEsm && useGlobals) || (tsUseEsm && finalTsRunner === TsRunner.TsNode)
|
|
371
|
+
? dataUrl(`${generateGlobals(finalWorkerPath, finalGlobalShims)};import '${String(workerPathUrl)}'`)
|
|
372
|
+
: useEval
|
|
373
|
+
? `${generateGlobals(finalWorkerPath, finalGlobalShims, 'require')};${encodeImportModule(finalWorkerPath, 'require')}`
|
|
374
|
+
: workerPathUrl, {
|
|
375
|
+
eval: useEval,
|
|
376
|
+
workerData: { sharedBufferView, workerPort, pnpLoaderPath },
|
|
377
|
+
transferList: [workerPort, ...transferList],
|
|
378
|
+
execArgv: finalExecArgv,
|
|
379
|
+
});
|
|
380
|
+
let nextID = 0;
|
|
381
|
+
const receiveMessageWithId = (port, expectedId, waitingTimeout) => {
|
|
382
|
+
const start = Date.now();
|
|
383
|
+
const status = Atomics.wait(sharedBufferView, 0, 0, waitingTimeout);
|
|
384
|
+
Atomics.store(sharedBufferView, 0, 0);
|
|
385
|
+
if (!['ok', 'not-equal'].includes(status)) {
|
|
386
|
+
const abortMsg = {
|
|
387
|
+
id: expectedId,
|
|
388
|
+
cmd: 'abort',
|
|
389
|
+
};
|
|
390
|
+
port.postMessage(abortMsg);
|
|
391
|
+
throw new Error('Internal error: Atomics.wait() failed: ' + status);
|
|
392
|
+
}
|
|
393
|
+
const result = receiveMessageOnPort(mainPort);
|
|
394
|
+
const msg = result === null || result === void 0 ? void 0 : result.message;
|
|
395
|
+
if ((msg === null || msg === void 0 ? void 0 : msg.id) == null || msg.id < expectedId) {
|
|
396
|
+
const waitingTime = Date.now() - start;
|
|
397
|
+
return receiveMessageWithId(port, expectedId, waitingTimeout ? waitingTimeout - waitingTime : undefined);
|
|
398
|
+
}
|
|
399
|
+
const { id } = msg, message = __rest(msg, ["id"]);
|
|
400
|
+
if (expectedId !== id) {
|
|
401
|
+
throw new Error(`Internal error: Expected id ${expectedId} but got id ${id}`);
|
|
402
|
+
}
|
|
403
|
+
return Object.assign({ id }, message);
|
|
404
|
+
};
|
|
405
|
+
const syncFn = (...args) => {
|
|
406
|
+
const id = nextID++;
|
|
407
|
+
const msg = { id, args };
|
|
408
|
+
worker.postMessage(msg);
|
|
409
|
+
const { result, error, properties, stdio } = receiveMessageWithId(mainPort, id, timeout);
|
|
410
|
+
for (const { type, chunk, encoding } of stdio) {
|
|
411
|
+
process[type].write(chunk, encoding);
|
|
412
|
+
}
|
|
413
|
+
if (error) {
|
|
414
|
+
throw Object.assign(error, properties);
|
|
415
|
+
}
|
|
416
|
+
return result;
|
|
417
|
+
};
|
|
418
|
+
worker.unref();
|
|
419
|
+
return syncFn;
|
|
420
|
+
}
|
|
421
|
+
export function runAsWorker(fn) {
|
|
422
|
+
if (!workerData) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
const stdio = [];
|
|
426
|
+
for (const type of ['stdout', 'stderr']) {
|
|
427
|
+
process[type]._writev = (chunks, callback) => {
|
|
428
|
+
for (const { chunk, encoding, } of chunks) {
|
|
429
|
+
stdio.push({
|
|
430
|
+
type,
|
|
431
|
+
chunk,
|
|
432
|
+
encoding,
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
callback();
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
const { workerPort, sharedBufferView, pnpLoaderPath } = workerData;
|
|
439
|
+
if (pnpLoaderPath &&
|
|
440
|
+
compareVersion(NODE_VERSION, LOADER_SUPPORTED_NODE_VERSION) >= 0) {
|
|
441
|
+
module.register(pnpLoaderPath);
|
|
442
|
+
}
|
|
443
|
+
parentPort.on('message', ({ id, args }) => {
|
|
444
|
+
;
|
|
445
|
+
(() => __awaiter(this, void 0, void 0, function* () {
|
|
446
|
+
let isAborted = false;
|
|
447
|
+
const handleAbortMessage = (msg) => {
|
|
448
|
+
if (msg.id === id && msg.cmd === 'abort') {
|
|
449
|
+
isAborted = true;
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
workerPort.on('message', handleAbortMessage);
|
|
453
|
+
let msg;
|
|
454
|
+
try {
|
|
455
|
+
msg = { id, stdio, result: yield fn(...args) };
|
|
456
|
+
}
|
|
457
|
+
catch (error) {
|
|
458
|
+
msg = { id, stdio, error, properties: extractProperties(error) };
|
|
459
|
+
}
|
|
460
|
+
workerPort.off('message', handleAbortMessage);
|
|
461
|
+
if (isAborted) {
|
|
462
|
+
stdio.length = 0;
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
try {
|
|
466
|
+
workerPort.postMessage(msg);
|
|
467
|
+
Atomics.add(sharedBufferView, 0, 1);
|
|
468
|
+
Atomics.notify(sharedBufferView, 0);
|
|
469
|
+
}
|
|
470
|
+
finally {
|
|
471
|
+
stdio.length = 0;
|
|
472
|
+
}
|
|
473
|
+
}))();
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,EAGL,cAAc,EACd,MAAM,EACN,UAAU,EACV,oBAAoB,EAEpB,UAAU,GACX,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAe9E,MAAM,WAAW,GAAG,CAAC,CAAA;AAErB,cAAc,YAAY,CAAA;AAE1B,MAAM,CAAC,MAAM,QAAQ,GAAG;IAEtB,IAAI,EAAE,MAAM;IAEZ,GAAG,EAAE,KAAK;IAEV,MAAM,EAAE,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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { MessagePort } from 'node:worker_threads';
|
|
2
|
+
export type AnyFn<R = any, T extends any[] = any[]> = (...args: T) => R;
|
|
3
|
+
export type Syncify<T extends AnyFn> = (...args: Parameters<T>) => Awaited<ReturnType<T>>;
|
|
4
|
+
export type ValueOf<T> = T[keyof T];
|
|
5
|
+
export interface MainToWorkerMessage<T extends unknown[]> {
|
|
6
|
+
id: number;
|
|
7
|
+
args: T;
|
|
8
|
+
}
|
|
9
|
+
export interface MainToWorkerCommandMessage {
|
|
10
|
+
id: number;
|
|
11
|
+
cmd: string;
|
|
12
|
+
}
|
|
13
|
+
export interface WorkerData {
|
|
14
|
+
sharedBufferView: Int32Array;
|
|
15
|
+
workerPort: MessagePort;
|
|
16
|
+
pnpLoaderPath: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface DataMessage<T> {
|
|
19
|
+
result?: T;
|
|
20
|
+
error?: unknown;
|
|
21
|
+
properties?: unknown;
|
|
22
|
+
}
|
|
23
|
+
export interface StdioChunk {
|
|
24
|
+
type: 'stderr' | 'stdout';
|
|
25
|
+
chunk: Uint8Array | string;
|
|
26
|
+
encoding: BufferEncoding;
|
|
27
|
+
}
|
|
28
|
+
export interface WorkerToMainMessage<T> extends DataMessage<T> {
|
|
29
|
+
id: number;
|
|
30
|
+
stdio: StdioChunk[];
|
|
31
|
+
}
|
|
32
|
+
export interface GlobalShim {
|
|
33
|
+
moduleName: string;
|
|
34
|
+
globalName?: string;
|
|
35
|
+
named?: string | null;
|
|
36
|
+
conditional?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface PackageJson {
|
|
39
|
+
type?: 'commonjs' | 'module';
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "synckit",
|
|
3
|
+
"version": "0.10.4",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Perform async work synchronously in Node.js using `worker_threads` with first-class TypeScript support.",
|
|
6
|
+
"repository": "git+https://github.com/un-ts/synckit.git",
|
|
7
|
+
"author": "JounQin (https://www.1stG.me) <admin@1stg.me>",
|
|
8
|
+
"funding": "https://opencollective.com/unts",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": "^14.18.0 || >=16.0.0"
|
|
12
|
+
},
|
|
13
|
+
"main": "./lib/index.cjs",
|
|
14
|
+
"module": "./lib/index.js",
|
|
15
|
+
"exports": {
|
|
16
|
+
"import": {
|
|
17
|
+
"types": "./lib/index.d.ts",
|
|
18
|
+
"default": "./lib/index.js"
|
|
19
|
+
},
|
|
20
|
+
"require": {
|
|
21
|
+
"types": "./index.d.cts",
|
|
22
|
+
"default": "./lib/index.cjs"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"types": "./lib/index.d.ts",
|
|
26
|
+
"files": [
|
|
27
|
+
"index.d.cts",
|
|
28
|
+
"lib",
|
|
29
|
+
"!**/*.tsbuildinfo"
|
|
30
|
+
],
|
|
31
|
+
"keywords": [
|
|
32
|
+
"deasync",
|
|
33
|
+
"make-synchronized",
|
|
34
|
+
"make-synchronous",
|
|
35
|
+
"sync",
|
|
36
|
+
"sync-exec",
|
|
37
|
+
"sync-rpc",
|
|
38
|
+
"sync-threads",
|
|
39
|
+
"synchronize",
|
|
40
|
+
"synckit"
|
|
41
|
+
],
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@pkgr/core": "^0.2.0",
|
|
44
|
+
"tslib": "^2.8.1"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexlit/config-eslint",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "128.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Sharable ESLint configuration",
|
|
6
6
|
"keywords": [
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"@eslint/json": "^0.14.0",
|
|
44
44
|
"@intlify/eslint-plugin-vue-i18n": "^4.1.1",
|
|
45
45
|
"@stylistic/eslint-plugin": "^5.7.0",
|
|
46
|
-
"@tanstack/eslint-plugin-query": "^5.91.
|
|
46
|
+
"@tanstack/eslint-plugin-query": "^5.91.3",
|
|
47
47
|
"@unocss/eslint-config": "^66.6.0",
|
|
48
48
|
"eslint": "9.39.2",
|
|
49
49
|
"eslint-config-prettier": "^10.1.8",
|
|
50
|
-
"eslint-plugin-jsdoc": "^62.
|
|
50
|
+
"eslint-plugin-jsdoc": "^62.1.0",
|
|
51
51
|
"eslint-plugin-perfectionist": "^5.3.1",
|
|
52
52
|
"eslint-plugin-prettier": "^5.5.5",
|
|
53
53
|
"eslint-plugin-regexp": "^2.10.0",
|
|
@@ -55,13 +55,13 @@
|
|
|
55
55
|
"eslint-plugin-tailwindcss": "^3.18.2",
|
|
56
56
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
57
57
|
"eslint-plugin-vitest": "^0.5.4",
|
|
58
|
-
"eslint-plugin-vue": "^10.
|
|
58
|
+
"eslint-plugin-vue": "^10.7.0",
|
|
59
59
|
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
60
60
|
"globals": "^17.0.0",
|
|
61
61
|
"jsonc-eslint-parser": "^2.4.2",
|
|
62
62
|
"typescript": "^5.9.3",
|
|
63
63
|
"typescript-eslint": "^8.53.0",
|
|
64
|
-
"yaml-eslint-parser": "^
|
|
64
|
+
"yaml-eslint-parser": "^2.0.0"
|
|
65
65
|
},
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public",
|
|
@@ -113,6 +113,7 @@ export const vue = [
|
|
|
113
113
|
'vue/no-static-inline-styles': ['error', { allowBinding: true }],
|
|
114
114
|
'vue/no-this-in-before-route-enter': ['error'],
|
|
115
115
|
'vue/no-undef-components': ['error'],
|
|
116
|
+
'vue/no-undef-directives': ['error'],
|
|
116
117
|
'vue/no-unsupported-features': ['error'],
|
|
117
118
|
'vue/no-unused-components': ['error'],
|
|
118
119
|
'vue/no-unused-emit-declarations': ['error'],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexlit/config-prettier",
|
|
3
|
-
"version": "21.12.
|
|
3
|
+
"version": "21.12.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "prettier config",
|
|
6
6
|
"keywords": [
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"prettier": "^3.8.0",
|
|
43
43
|
"prettier-plugin-eruby": "^0.0.3",
|
|
44
44
|
"prettier-plugin-jsdoc": "^1.8.0",
|
|
45
|
-
"prettier-plugin-packagejson": "^2.5.
|
|
45
|
+
"prettier-plugin-packagejson": "^2.5.22",
|
|
46
46
|
"prettier-plugin-sh": "^0.18.0",
|
|
47
47
|
"prettier-plugin-solidity": "^2.2.1",
|
|
48
48
|
"prettier-plugin-sort-json": "^4.2.0",
|