Set up comprehensive frontend testing infrastructure
- Install Jest for unit testing with React Testing Library - Install Playwright for end-to-end testing - Configure Jest with proper TypeScript support and module mapping - Create test setup files and utilities for both unit and e2e tests Components: * Jest configuration with coverage thresholds * Playwright configuration with browser automation * Unit tests for LoginForm, AuthContext, and useSocketIO hook * E2E tests for authentication, dashboard, and agents workflows * GitHub Actions workflow for automated testing * Mock data and API utilities for consistent testing * Test documentation with best practices Testing features: - Unit tests with 70% coverage threshold - E2E tests with API mocking and user journey testing - CI/CD integration for automated test runs - Cross-browser testing support with Playwright - Authentication system testing end-to-end 🚀 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
5
frontend/node_modules/synckit/lib/common.d.ts
generated
vendored
Normal file
5
frontend/node_modules/synckit/lib/common.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export declare const hasFlag: (flag: string) => boolean;
|
||||
export declare const parseVersion: (version: string) => number[];
|
||||
export declare const compareVersion: (version1: string, version2: string) => 1 | -1 | 0;
|
||||
export declare const NODE_VERSION: string;
|
||||
export declare const compareNodeVersion: (version: string) => 1 | -1 | 0;
|
||||
22
frontend/node_modules/synckit/lib/common.js
generated
vendored
Normal file
22
frontend/node_modules/synckit/lib/common.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
const NODE_OPTIONS = process.env.NODE_OPTIONS?.split(/\s+/);
|
||||
export const hasFlag = (flag) => NODE_OPTIONS?.includes(flag) || process.argv.includes(flag);
|
||||
export const parseVersion = (version) => version.split('.').map(Number.parseFloat);
|
||||
export const compareVersion = (version1, version2) => {
|
||||
const versions1 = parseVersion(version1);
|
||||
const versions2 = parseVersion(version2);
|
||||
const length = Math.max(versions1.length, versions2.length);
|
||||
for (let i = 0; i < length; i++) {
|
||||
const v1 = versions1[i] || 0;
|
||||
const v2 = versions2[i] || 0;
|
||||
if (v1 > v2) {
|
||||
return 1;
|
||||
}
|
||||
if (v1 < v2) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
export const NODE_VERSION = process.versions.node;
|
||||
export const compareNodeVersion = (version) => compareVersion(NODE_VERSION, version);
|
||||
//# sourceMappingURL=common.js.map
|
||||
1
frontend/node_modules/synckit/lib/common.js.map
generated
vendored
Normal file
1
frontend/node_modules/synckit/lib/common.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;AAE3D,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAE,CACtC,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;AAE7D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE,CAC9C,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;AAG3C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,QAAgB,EAAE,EAAE;IACnE,MAAM,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;IACxC,MAAM,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;IACxC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;IAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QAC5B,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QAC5B,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC;YACZ,OAAO,CAAC,CAAA;QACV,CAAC;QACD,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC;YACZ,OAAO,CAAC,CAAC,CAAA;QACX,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAA;AAEjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAe,EAAE,EAAE,CACpD,cAAc,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA"}
|
||||
38
frontend/node_modules/synckit/lib/constants.d.ts
generated
vendored
Normal file
38
frontend/node_modules/synckit/lib/constants.d.ts
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { GlobalShim, ValueOf } from './types.js';
|
||||
export declare const TsRunner: {
|
||||
readonly Node: "node";
|
||||
readonly Bun: "bun";
|
||||
readonly TsNode: "ts-node";
|
||||
readonly EsbuildRegister: "esbuild-register";
|
||||
readonly EsbuildRunner: "esbuild-runner";
|
||||
readonly OXC: "oxc";
|
||||
readonly SWC: "swc";
|
||||
readonly TSX: "tsx";
|
||||
};
|
||||
export type TsRunner = ValueOf<typeof TsRunner>;
|
||||
export declare const TS_ESM_PARTIAL_SUPPORTED: boolean;
|
||||
export declare const MTS_SUPPORTED: boolean;
|
||||
export declare const MODULE_REGISTER_SUPPORTED: boolean;
|
||||
export declare const STRIP_TYPES_NODE_VERSION = "22.6";
|
||||
export declare const TRANSFORM_TYPES_NODE_VERSION = "22.7";
|
||||
export declare const FEATURE_TYPESCRIPT_NODE_VERSION = "22.10";
|
||||
export declare const DEFAULT_TYPES_NODE_VERSION = "23.6";
|
||||
export declare const STRIP_TYPES_FLAG = "--experimental-strip-types";
|
||||
export declare const TRANSFORM_TYPES_FLAG = "--experimental-transform-types";
|
||||
export declare const NO_STRIP_TYPES_FLAG = "--no-experimental-strip-types";
|
||||
export declare const NODE_OPTIONS: string[];
|
||||
export declare const NO_STRIP_TYPES: boolean;
|
||||
export declare const DEFAULT_TIMEOUT: number | undefined;
|
||||
export declare const DEFAULT_EXEC_ARGV: string[];
|
||||
export declare const DEFAULT_TS_RUNNER: TsRunner | undefined;
|
||||
export declare const DEFAULT_GLOBAL_SHIMS: boolean;
|
||||
export declare const DEFAULT_GLOBAL_SHIMS_PRESET: GlobalShim[];
|
||||
export declare const IMPORT_FLAG = "--import";
|
||||
export declare const REQUIRE_FLAG = "--require";
|
||||
export declare const REQUIRE_ABBR_FLAG = "-r";
|
||||
export declare const REQUIRE_FLAGS: Set<string>;
|
||||
export declare const LOADER_FLAG = "--loader";
|
||||
export declare const EXPERIMENTAL_LOADER_FLAG = "--experimental-loader";
|
||||
export declare const LOADER_FLAGS: Set<string>;
|
||||
export declare const IMPORT_FLAG_SUPPORTED: boolean;
|
||||
export declare const INT32_BYTES = 4;
|
||||
54
frontend/node_modules/synckit/lib/constants.js
generated
vendored
Normal file
54
frontend/node_modules/synckit/lib/constants.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import { compareNodeVersion, hasFlag } from './common.js';
|
||||
export const TsRunner = {
|
||||
Node: 'node',
|
||||
Bun: 'bun',
|
||||
TsNode: 'ts-node',
|
||||
EsbuildRegister: 'esbuild-register',
|
||||
EsbuildRunner: 'esbuild-runner',
|
||||
OXC: 'oxc',
|
||||
SWC: 'swc',
|
||||
TSX: 'tsx',
|
||||
};
|
||||
const { NODE_OPTIONS: NODE_OPTIONS_ = '', SYNCKIT_EXEC_ARGV = '', SYNCKIT_GLOBAL_SHIMS, SYNCKIT_TIMEOUT, SYNCKIT_TS_RUNNER, } = process.env;
|
||||
export const TS_ESM_PARTIAL_SUPPORTED = compareNodeVersion('16') >= 0 &&
|
||||
compareNodeVersion('18.19') < 0;
|
||||
export const MTS_SUPPORTED = compareNodeVersion('20.8') >= 0;
|
||||
export const MODULE_REGISTER_SUPPORTED = MTS_SUPPORTED ||
|
||||
compareNodeVersion('18.19') >= 0;
|
||||
export const STRIP_TYPES_NODE_VERSION = '22.6';
|
||||
export const TRANSFORM_TYPES_NODE_VERSION = '22.7';
|
||||
export const FEATURE_TYPESCRIPT_NODE_VERSION = '22.10';
|
||||
export const DEFAULT_TYPES_NODE_VERSION = '23.6';
|
||||
export const STRIP_TYPES_FLAG = '--experimental-strip-types';
|
||||
export const TRANSFORM_TYPES_FLAG = '--experimental-transform-types';
|
||||
export const NO_STRIP_TYPES_FLAG = '--no-experimental-strip-types';
|
||||
export const NODE_OPTIONS = NODE_OPTIONS_.split(/\s+/);
|
||||
export 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));
|
||||
export const DEFAULT_TIMEOUT = SYNCKIT_TIMEOUT ? +SYNCKIT_TIMEOUT : undefined;
|
||||
export const DEFAULT_EXEC_ARGV = SYNCKIT_EXEC_ARGV.split(',');
|
||||
export const DEFAULT_TS_RUNNER = SYNCKIT_TS_RUNNER;
|
||||
export const DEFAULT_GLOBAL_SHIMS = ['1', 'true'].includes(SYNCKIT_GLOBAL_SHIMS);
|
||||
export const DEFAULT_GLOBAL_SHIMS_PRESET = [
|
||||
{
|
||||
moduleName: 'node-fetch',
|
||||
globalName: 'fetch',
|
||||
},
|
||||
{
|
||||
moduleName: 'node:perf_hooks',
|
||||
globalName: 'performance',
|
||||
named: 'performance',
|
||||
},
|
||||
];
|
||||
export const IMPORT_FLAG = '--import';
|
||||
export const REQUIRE_FLAG = '--require';
|
||||
export const REQUIRE_ABBR_FLAG = '-r';
|
||||
export const REQUIRE_FLAGS = new Set([REQUIRE_FLAG, REQUIRE_ABBR_FLAG]);
|
||||
export const LOADER_FLAG = '--loader';
|
||||
export const EXPERIMENTAL_LOADER_FLAG = '--experimental-loader';
|
||||
export const LOADER_FLAGS = new Set([LOADER_FLAG, EXPERIMENTAL_LOADER_FLAG]);
|
||||
export const IMPORT_FLAG_SUPPORTED = compareNodeVersion('20.6') >= 0;
|
||||
export const INT32_BYTES = 4;
|
||||
//# sourceMappingURL=constants.js.map
|
||||
1
frontend/node_modules/synckit/lib/constants.js.map
generated
vendored
Normal file
1
frontend/node_modules/synckit/lib/constants.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"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"}
|
||||
27
frontend/node_modules/synckit/lib/helpers.d.ts
generated
vendored
Normal file
27
frontend/node_modules/synckit/lib/helpers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { TsRunner } from './constants.js';
|
||||
import type { AnyFn, GlobalShim, StdioChunk, SynckitOptions } from './types.js';
|
||||
export declare const isFile: (path: string) => boolean;
|
||||
export declare const dataUrl: (code: string) => import("url").URL;
|
||||
export declare const hasRequireFlag: (execArgv: string[]) => boolean;
|
||||
export declare const hasImportFlag: (execArgv: string[]) => boolean;
|
||||
export declare const hasLoaderFlag: (execArgv: string[]) => boolean;
|
||||
export declare const setupTsRunner: (workerPath: string, { execArgv, tsRunner, }?: {
|
||||
execArgv?: string[];
|
||||
tsRunner?: TsRunner;
|
||||
}) => {
|
||||
ext: string;
|
||||
isTs: boolean;
|
||||
jsUseEsm: boolean;
|
||||
tsRunner: TsRunner | undefined;
|
||||
tsUseEsm: boolean;
|
||||
workerPath: string;
|
||||
pnpLoaderPath: string | undefined;
|
||||
execArgv: string[];
|
||||
};
|
||||
export declare const md5Hash: (text: string) => string;
|
||||
export declare const encodeImportModule: (moduleNameOrGlobalShim: GlobalShim | string, type?: "import" | "require") => string;
|
||||
export declare const generateGlobals: (workerPath: string, globalShims: GlobalShim[], type?: "import" | "require") => string;
|
||||
export declare function extractProperties<T extends object>(object: T): T;
|
||||
export declare function extractProperties<T>(object?: T): T | undefined;
|
||||
export declare function startWorkerThread<T extends AnyFn, R = Awaited<ReturnType<T>>>(workerPath: string, { timeout, execArgv, tsRunner, transferList, globalShims, }?: SynckitOptions): (...args: Parameters<T>) => R;
|
||||
export declare const overrideStdio: (stdio: StdioChunk[]) => void;
|
||||
413
frontend/node_modules/synckit/lib/helpers.js
generated
vendored
Normal file
413
frontend/node_modules/synckit/lib/helpers.js
generated
vendored
Normal file
@@ -0,0 +1,413 @@
|
||||
import { createHash } from 'node:crypto';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
import { MessageChannel, Worker, receiveMessageOnPort, } from 'node:worker_threads';
|
||||
import { tryExtensions, findUp, cjsRequire, isPkgAvailable } from '@pkgr/core';
|
||||
import { compareNodeVersion } from './common.js';
|
||||
import { DEFAULT_EXEC_ARGV, DEFAULT_GLOBAL_SHIMS, DEFAULT_GLOBAL_SHIMS_PRESET, DEFAULT_TIMEOUT, DEFAULT_TS_RUNNER, DEFAULT_TYPES_NODE_VERSION, IMPORT_FLAG, IMPORT_FLAG_SUPPORTED, INT32_BYTES, LOADER_FLAG, LOADER_FLAGS, MODULE_REGISTER_SUPPORTED, MTS_SUPPORTED, NO_STRIP_TYPES, NO_STRIP_TYPES_FLAG, NODE_OPTIONS, REQUIRE_ABBR_FLAG, REQUIRE_FLAGS, STRIP_TYPES_FLAG, STRIP_TYPES_NODE_VERSION, TRANSFORM_TYPES_FLAG, TRANSFORM_TYPES_NODE_VERSION, TS_ESM_PARTIAL_SUPPORTED, TsRunner, } from './constants.js';
|
||||
export const isFile = (path) => {
|
||||
try {
|
||||
return !!fs.statSync(path, { throwIfNoEntry: false })?.isFile();
|
||||
}
|
||||
catch {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
export const dataUrl = (code) => new URL(`data:text/javascript,${encodeURIComponent(code)}`);
|
||||
export const hasRequireFlag = (execArgv) => execArgv.some(execArg => REQUIRE_FLAGS.has(execArg));
|
||||
export const hasImportFlag = (execArgv) => execArgv.includes(IMPORT_FLAG);
|
||||
export const hasLoaderFlag = (execArgv) => execArgv.some(execArg => LOADER_FLAGS.has(execArg));
|
||||
export const setupTsRunner = (workerPath, { execArgv = DEFAULT_EXEC_ARGV, tsRunner, } = {}) => {
|
||||
let ext = path.extname(workerPath);
|
||||
if (!/([/\\])node_modules\1/.test(workerPath) &&
|
||||
(!ext || /^\.[cm]?js$/.test(ext))) {
|
||||
const workPathWithoutExt = ext
|
||||
? workerPath.slice(0, -ext.length)
|
||||
: workerPath;
|
||||
let extensions;
|
||||
switch (ext) {
|
||||
case '.cjs': {
|
||||
extensions = ['.cts', '.cjs'];
|
||||
break;
|
||||
}
|
||||
case '.mjs': {
|
||||
extensions = ['.mts', '.mjs'];
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
extensions = ['.ts', '.js'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
const found = tryExtensions(workPathWithoutExt, extensions);
|
||||
let differentExt;
|
||||
if (found && (!ext || (differentExt = found !== workPathWithoutExt))) {
|
||||
workerPath = found;
|
||||
if (differentExt) {
|
||||
ext = path.extname(workerPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
const isTs = /\.[cm]?ts$/.test(workerPath);
|
||||
let jsUseEsm = ext === '.mjs';
|
||||
let tsUseEsm = ext === '.mts';
|
||||
if (isTs) {
|
||||
if (!tsUseEsm && ext !== '.cts') {
|
||||
const pkg = findUp(workerPath);
|
||||
if (pkg) {
|
||||
tsUseEsm = cjsRequire(pkg).type === 'module';
|
||||
}
|
||||
}
|
||||
const stripTypesIndex = execArgv.indexOf(STRIP_TYPES_FLAG);
|
||||
const transformTypesIndex = execArgv.indexOf(TRANSFORM_TYPES_FLAG);
|
||||
const noStripTypesIndex = execArgv.indexOf(NO_STRIP_TYPES_FLAG);
|
||||
const execArgvNoStripTypes = noStripTypesIndex > stripTypesIndex ||
|
||||
noStripTypesIndex > transformTypesIndex;
|
||||
const noStripTypes = execArgvNoStripTypes ||
|
||||
(stripTypesIndex === -1 && transformTypesIndex === -1 && NO_STRIP_TYPES);
|
||||
if (tsRunner == null) {
|
||||
if (process.versions.bun) {
|
||||
tsRunner = TsRunner.Bun;
|
||||
}
|
||||
else if (!noStripTypes &&
|
||||
compareNodeVersion(STRIP_TYPES_NODE_VERSION) >= 0) {
|
||||
tsRunner = TsRunner.Node;
|
||||
}
|
||||
else if (isPkgAvailable(TsRunner.TsNode)) {
|
||||
tsRunner = TsRunner.TsNode;
|
||||
}
|
||||
}
|
||||
switch (tsRunner) {
|
||||
case TsRunner.Bun: {
|
||||
break;
|
||||
}
|
||||
case TsRunner.Node: {
|
||||
if (compareNodeVersion(STRIP_TYPES_NODE_VERSION) < 0) {
|
||||
throw new Error('type stripping is not supported in this node version');
|
||||
}
|
||||
if (noStripTypes) {
|
||||
throw new Error('type stripping is disabled explicitly');
|
||||
}
|
||||
if (compareNodeVersion(DEFAULT_TYPES_NODE_VERSION) >= 0) {
|
||||
break;
|
||||
}
|
||||
if (compareNodeVersion(TRANSFORM_TYPES_NODE_VERSION) >= 0 &&
|
||||
!execArgv.includes(TRANSFORM_TYPES_FLAG)) {
|
||||
execArgv = [TRANSFORM_TYPES_FLAG, ...execArgv];
|
||||
}
|
||||
else if (compareNodeVersion(STRIP_TYPES_NODE_VERSION) >= 0 &&
|
||||
!execArgv.includes(STRIP_TYPES_FLAG)) {
|
||||
execArgv = [STRIP_TYPES_FLAG, ...execArgv];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TsRunner.TsNode: {
|
||||
if (tsUseEsm) {
|
||||
if (!execArgv.includes(LOADER_FLAG)) {
|
||||
execArgv = [LOADER_FLAG, `${TsRunner.TsNode}/esm`, ...execArgv];
|
||||
}
|
||||
}
|
||||
else if (!hasRequireFlag(execArgv)) {
|
||||
execArgv = [
|
||||
REQUIRE_ABBR_FLAG,
|
||||
`${TsRunner.TsNode}/register`,
|
||||
...execArgv,
|
||||
];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TsRunner.EsbuildRegister: {
|
||||
if (tsUseEsm) {
|
||||
if (!hasLoaderFlag(execArgv)) {
|
||||
execArgv = [
|
||||
LOADER_FLAG,
|
||||
`${TsRunner.EsbuildRegister}/loader`,
|
||||
...execArgv,
|
||||
];
|
||||
}
|
||||
}
|
||||
else if (!hasRequireFlag(execArgv)) {
|
||||
execArgv = [REQUIRE_ABBR_FLAG, TsRunner.EsbuildRegister, ...execArgv];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TsRunner.EsbuildRunner: {
|
||||
if (!hasRequireFlag(execArgv)) {
|
||||
execArgv = [
|
||||
REQUIRE_ABBR_FLAG,
|
||||
`${TsRunner.EsbuildRunner}/register`,
|
||||
...execArgv,
|
||||
];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TsRunner.OXC: {
|
||||
if (!execArgv.includes(IMPORT_FLAG)) {
|
||||
execArgv = [
|
||||
IMPORT_FLAG,
|
||||
`@${TsRunner.OXC}-node/core/register`,
|
||||
...execArgv,
|
||||
];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TsRunner.SWC: {
|
||||
if (tsUseEsm) {
|
||||
if (IMPORT_FLAG_SUPPORTED) {
|
||||
if (!hasImportFlag(execArgv)) {
|
||||
execArgv = [
|
||||
IMPORT_FLAG,
|
||||
`@${TsRunner.SWC}-node/register/esm-register`,
|
||||
...execArgv,
|
||||
];
|
||||
}
|
||||
}
|
||||
else if (!hasLoaderFlag(execArgv)) {
|
||||
execArgv = [
|
||||
LOADER_FLAG,
|
||||
`@${TsRunner.SWC}-node/register/esm`,
|
||||
...execArgv,
|
||||
];
|
||||
}
|
||||
}
|
||||
else if (!hasRequireFlag(execArgv)) {
|
||||
execArgv = [
|
||||
REQUIRE_ABBR_FLAG,
|
||||
`@${TsRunner.SWC}-node/register`,
|
||||
...execArgv,
|
||||
];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TsRunner.TSX: {
|
||||
if (IMPORT_FLAG_SUPPORTED) {
|
||||
if (!execArgv.includes(IMPORT_FLAG)) {
|
||||
execArgv = [IMPORT_FLAG, TsRunner.TSX, ...execArgv];
|
||||
}
|
||||
}
|
||||
else if (!execArgv.includes(LOADER_FLAG)) {
|
||||
execArgv = [LOADER_FLAG, TsRunner.TSX, ...execArgv];
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unknown ts runner: ${String(tsRunner)}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!jsUseEsm && ext !== '.cjs') {
|
||||
const pkg = findUp(workerPath);
|
||||
if (pkg) {
|
||||
jsUseEsm = cjsRequire(pkg).type === 'module';
|
||||
}
|
||||
}
|
||||
let resolvedPnpLoaderPath;
|
||||
if (process.versions.pnp) {
|
||||
let pnpApiPath;
|
||||
try {
|
||||
pnpApiPath = cjsRequire.resolve('pnpapi');
|
||||
}
|
||||
catch { }
|
||||
if (pnpApiPath &&
|
||||
!NODE_OPTIONS.some((option, index) => REQUIRE_FLAGS.has(option) &&
|
||||
pnpApiPath === cjsRequire.resolve(NODE_OPTIONS[index + 1])) &&
|
||||
!execArgv.includes(pnpApiPath)) {
|
||||
execArgv = [REQUIRE_ABBR_FLAG, pnpApiPath, ...execArgv];
|
||||
const pnpLoaderPath = path.resolve(pnpApiPath, '../.pnp.loader.mjs');
|
||||
if (isFile(pnpLoaderPath)) {
|
||||
resolvedPnpLoaderPath = pathToFileURL(pnpLoaderPath).href;
|
||||
if (!MODULE_REGISTER_SUPPORTED) {
|
||||
execArgv = [LOADER_FLAG, resolvedPnpLoaderPath, ...execArgv];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
ext,
|
||||
isTs,
|
||||
jsUseEsm,
|
||||
tsRunner,
|
||||
tsUseEsm,
|
||||
workerPath,
|
||||
pnpLoaderPath: resolvedPnpLoaderPath,
|
||||
execArgv,
|
||||
};
|
||||
};
|
||||
export const md5Hash = (text) => createHash('md5').update(text).digest('hex');
|
||||
export const encodeImportModule = (moduleNameOrGlobalShim, type = 'import') => {
|
||||
const { moduleName, globalName, named, conditional } = typeof moduleNameOrGlobalShim === 'string'
|
||||
? { moduleName: moduleNameOrGlobalShim }
|
||||
: moduleNameOrGlobalShim;
|
||||
const importStatement = type === 'import'
|
||||
? `import${globalName
|
||||
? ' ' +
|
||||
(named === null
|
||||
? '* as ' + globalName
|
||||
: named?.trim()
|
||||
? `{${named}}`
|
||||
: globalName) +
|
||||
' from'
|
||||
: ''} '${path.isAbsolute(moduleName)
|
||||
? String(pathToFileURL(moduleName))
|
||||
: moduleName}'`
|
||||
: `${globalName
|
||||
? 'const ' + (named?.trim() ? `{${named}}` : globalName) + '='
|
||||
: ''}require('${moduleName
|
||||
.replace(/\\/g, '\\\\')}')`;
|
||||
if (!globalName) {
|
||||
return importStatement;
|
||||
}
|
||||
const overrideStatement = `globalThis.${globalName}=${named?.trim() ? named : globalName}`;
|
||||
return (importStatement +
|
||||
(conditional === false
|
||||
? `;${overrideStatement}`
|
||||
: `;if(!globalThis.${globalName})${overrideStatement}`));
|
||||
};
|
||||
export const _generateGlobals = (globalShims, type) => globalShims.reduce((acc, shim) => `${acc}${acc ? ';' : ''}${encodeImportModule(shim, type)}`, '');
|
||||
let globalsCache;
|
||||
let tmpdir;
|
||||
const _dirname = typeof __dirname === 'undefined'
|
||||
? path.dirname(fileURLToPath(import.meta.url))
|
||||
: __dirname;
|
||||
export const generateGlobals = (workerPath, globalShims, type = 'import') => {
|
||||
if (globalShims.length === 0) {
|
||||
return '';
|
||||
}
|
||||
globalsCache ?? (globalsCache = new Map());
|
||||
const cached = globalsCache.get(workerPath);
|
||||
if (cached) {
|
||||
const [content, filepath] = cached;
|
||||
if ((type === 'require' && !filepath) ||
|
||||
(type === 'import' && filepath && isFile(filepath))) {
|
||||
return content;
|
||||
}
|
||||
}
|
||||
const globals = _generateGlobals(globalShims, type);
|
||||
let content = globals;
|
||||
let filepath;
|
||||
if (type === 'import') {
|
||||
if (!tmpdir) {
|
||||
tmpdir = path.resolve(findUp(_dirname), '../node_modules/.synckit');
|
||||
}
|
||||
fs.mkdirSync(tmpdir, { recursive: true });
|
||||
filepath = path.resolve(tmpdir, md5Hash(workerPath) + '.mjs');
|
||||
content = encodeImportModule(filepath);
|
||||
fs.writeFileSync(filepath, globals);
|
||||
}
|
||||
globalsCache.set(workerPath, [content, filepath]);
|
||||
return content;
|
||||
};
|
||||
export function extractProperties(object) {
|
||||
if (object && typeof object === 'object') {
|
||||
const properties = {};
|
||||
for (const key in object) {
|
||||
properties[key] = object[key];
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
}
|
||||
let sharedBuffer;
|
||||
let sharedBufferView;
|
||||
export function startWorkerThread(workerPath, { timeout = DEFAULT_TIMEOUT, execArgv = DEFAULT_EXEC_ARGV, tsRunner = DEFAULT_TS_RUNNER, transferList = [], globalShims = DEFAULT_GLOBAL_SHIMS, } = {}) {
|
||||
const { port1: mainPort, port2: workerPort } = new MessageChannel();
|
||||
const { isTs, ext, jsUseEsm, tsUseEsm, tsRunner: finalTsRunner, workerPath: finalWorkerPath, pnpLoaderPath, execArgv: finalExecArgv, } = setupTsRunner(workerPath, { execArgv, tsRunner });
|
||||
const workerPathUrl = pathToFileURL(finalWorkerPath);
|
||||
if (/\.[cm]ts$/.test(finalWorkerPath)) {
|
||||
const isTsxSupported = !tsUseEsm || TS_ESM_PARTIAL_SUPPORTED;
|
||||
if (!finalTsRunner) {
|
||||
throw new Error('No ts runner specified, ts worker path is not supported');
|
||||
}
|
||||
else if ([
|
||||
TsRunner.EsbuildRegister,
|
||||
TsRunner.EsbuildRunner,
|
||||
...(TS_ESM_PARTIAL_SUPPORTED
|
||||
? [
|
||||
TsRunner.OXC,
|
||||
TsRunner.SWC,
|
||||
]
|
||||
: []),
|
||||
...(isTsxSupported ? [] : [TsRunner.TSX]),
|
||||
].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'
|
||||
: ''));
|
||||
}
|
||||
}
|
||||
const finalGlobalShims = (globalShims === true
|
||||
? DEFAULT_GLOBAL_SHIMS_PRESET
|
||||
: Array.isArray(globalShims)
|
||||
? globalShims
|
||||
: []).filter(({ moduleName }) => isPkgAvailable(moduleName));
|
||||
sharedBufferView ?? (sharedBufferView = new Int32Array((sharedBuffer ?? (sharedBuffer = new SharedArrayBuffer(INT32_BYTES))), 0, 1));
|
||||
const useGlobals = finalGlobalShims.length > 0;
|
||||
const useEval = isTs ? !tsUseEsm : !jsUseEsm && useGlobals;
|
||||
const worker = new Worker((jsUseEsm && useGlobals) || (tsUseEsm && finalTsRunner === TsRunner.TsNode)
|
||||
? dataUrl(`${generateGlobals(finalWorkerPath, finalGlobalShims)};import '${String(workerPathUrl)}'`)
|
||||
: useEval
|
||||
? `${generateGlobals(finalWorkerPath, finalGlobalShims, 'require')};${encodeImportModule(finalWorkerPath, 'require')}`
|
||||
: workerPathUrl, {
|
||||
eval: useEval,
|
||||
workerData: { sharedBufferView, workerPort, pnpLoaderPath },
|
||||
transferList: [workerPort, ...transferList],
|
||||
execArgv: finalExecArgv,
|
||||
});
|
||||
let nextID = 0;
|
||||
const receiveMessageWithId = (port, expectedId, waitingTimeout) => {
|
||||
const start = Date.now();
|
||||
const status = Atomics.wait(sharedBufferView, 0, 0, waitingTimeout);
|
||||
Atomics.store(sharedBufferView, 0, 0);
|
||||
if (!['ok', 'not-equal'].includes(status)) {
|
||||
const abortMsg = {
|
||||
id: expectedId,
|
||||
cmd: 'abort',
|
||||
};
|
||||
port.postMessage(abortMsg);
|
||||
throw new Error('Internal error: Atomics.wait() failed: ' + status);
|
||||
}
|
||||
const result = receiveMessageOnPort(mainPort);
|
||||
const msg = result?.message;
|
||||
if (msg?.id == null || msg.id < expectedId) {
|
||||
const waitingTime = Date.now() - start;
|
||||
return receiveMessageWithId(port, expectedId, waitingTimeout ? waitingTimeout - waitingTime : undefined);
|
||||
}
|
||||
const { id, ...message } = msg;
|
||||
if (expectedId !== id) {
|
||||
throw new Error(`Internal error: Expected id ${expectedId} but got id ${id}`);
|
||||
}
|
||||
return { id, ...message };
|
||||
};
|
||||
const syncFn = (...args) => {
|
||||
const id = nextID++;
|
||||
const msg = { id, args };
|
||||
worker.postMessage(msg);
|
||||
const { result, error, properties, stdio } = receiveMessageWithId(mainPort, id, timeout);
|
||||
for (const { type, chunk, encoding } of stdio) {
|
||||
process[type].write(chunk, encoding);
|
||||
}
|
||||
if (error) {
|
||||
throw Object.assign(error, properties);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
worker.unref();
|
||||
return syncFn;
|
||||
}
|
||||
export const overrideStdio = (stdio) => {
|
||||
for (const type of ['stdout', 'stderr']) {
|
||||
process[type]._writev = (chunks, callback) => {
|
||||
for (const { chunk, encoding, } of chunks) {
|
||||
stdio.push({
|
||||
type,
|
||||
chunk,
|
||||
encoding,
|
||||
});
|
||||
}
|
||||
callback();
|
||||
};
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=helpers.js.map
|
||||
1
frontend/node_modules/synckit/lib/helpers.js.map
generated
vendored
Normal file
1
frontend/node_modules/synckit/lib/helpers.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
590
frontend/node_modules/synckit/lib/index.cjs
generated
vendored
Normal file
590
frontend/node_modules/synckit/lib/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,590 @@
|
||||
//#region rolldown:runtime
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
||||
key = keys[i];
|
||||
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
||||
get: ((k) => from[k]).bind(null, key),
|
||||
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
||||
});
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
||||
value: mod,
|
||||
enumerable: true
|
||||
}) : target, mod));
|
||||
|
||||
//#endregion
|
||||
const node_module = __toESM(require("node:module"));
|
||||
const node_path = __toESM(require("node:path"));
|
||||
const node_url = __toESM(require("node:url"));
|
||||
const node_worker_threads = __toESM(require("node:worker_threads"));
|
||||
const node_crypto = __toESM(require("node:crypto"));
|
||||
const node_fs = __toESM(require("node:fs"));
|
||||
const __pkgr_core = __toESM(require("@pkgr/core"));
|
||||
|
||||
//#region src/common.ts
|
||||
var _process$env$NODE_OPT;
|
||||
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+/);
|
||||
const hasFlag = (flag) => (NODE_OPTIONS$1 === null || NODE_OPTIONS$1 === void 0 ? void 0 : NODE_OPTIONS$1.includes(flag)) || process.argv.includes(flag);
|
||||
const parseVersion = (version) => version.split(".").map(Number.parseFloat);
|
||||
const compareVersion = (version1, version2) => {
|
||||
const versions1 = parseVersion(version1);
|
||||
const versions2 = parseVersion(version2);
|
||||
const length = Math.max(versions1.length, versions2.length);
|
||||
for (let i = 0; i < length; i++) {
|
||||
const v1 = versions1[i] || 0;
|
||||
const v2 = versions2[i] || 0;
|
||||
if (v1 > v2) return 1;
|
||||
if (v1 < v2) return -1;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
const NODE_VERSION = process.versions.node;
|
||||
const compareNodeVersion = (version) => compareVersion(NODE_VERSION, version);
|
||||
|
||||
//#endregion
|
||||
//#region src/constants.ts
|
||||
const TsRunner = {
|
||||
Node: "node",
|
||||
Bun: "bun",
|
||||
TsNode: "ts-node",
|
||||
EsbuildRegister: "esbuild-register",
|
||||
EsbuildRunner: "esbuild-runner",
|
||||
OXC: "oxc",
|
||||
SWC: "swc",
|
||||
TSX: "tsx"
|
||||
};
|
||||
const { NODE_OPTIONS: NODE_OPTIONS_ = "", SYNCKIT_EXEC_ARGV = "", SYNCKIT_GLOBAL_SHIMS, SYNCKIT_TIMEOUT, SYNCKIT_TS_RUNNER } = process.env;
|
||||
const TS_ESM_PARTIAL_SUPPORTED = compareNodeVersion("16") >= 0 && compareNodeVersion("18.19") < 0;
|
||||
const MTS_SUPPORTED = compareNodeVersion("20.8") >= 0;
|
||||
const MODULE_REGISTER_SUPPORTED = MTS_SUPPORTED || compareNodeVersion("18.19") >= 0;
|
||||
const STRIP_TYPES_NODE_VERSION = "22.6";
|
||||
const TRANSFORM_TYPES_NODE_VERSION = "22.7";
|
||||
const FEATURE_TYPESCRIPT_NODE_VERSION = "22.10";
|
||||
const DEFAULT_TYPES_NODE_VERSION = "23.6";
|
||||
const STRIP_TYPES_FLAG = "--experimental-strip-types";
|
||||
const TRANSFORM_TYPES_FLAG = "--experimental-transform-types";
|
||||
const NO_STRIP_TYPES_FLAG = "--no-experimental-strip-types";
|
||||
const NODE_OPTIONS = NODE_OPTIONS_.split(/\s+/);
|
||||
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));
|
||||
const DEFAULT_TIMEOUT = SYNCKIT_TIMEOUT ? +SYNCKIT_TIMEOUT : void 0;
|
||||
const DEFAULT_EXEC_ARGV = SYNCKIT_EXEC_ARGV.split(",");
|
||||
const DEFAULT_TS_RUNNER = SYNCKIT_TS_RUNNER;
|
||||
const DEFAULT_GLOBAL_SHIMS = ["1", "true"].includes(SYNCKIT_GLOBAL_SHIMS);
|
||||
const DEFAULT_GLOBAL_SHIMS_PRESET = [{
|
||||
moduleName: "node-fetch",
|
||||
globalName: "fetch"
|
||||
}, {
|
||||
moduleName: "node:perf_hooks",
|
||||
globalName: "performance",
|
||||
named: "performance"
|
||||
}];
|
||||
const IMPORT_FLAG = "--import";
|
||||
const REQUIRE_FLAG = "--require";
|
||||
const REQUIRE_ABBR_FLAG = "-r";
|
||||
const REQUIRE_FLAGS = new Set([REQUIRE_FLAG, REQUIRE_ABBR_FLAG]);
|
||||
const LOADER_FLAG = "--loader";
|
||||
const EXPERIMENTAL_LOADER_FLAG = "--experimental-loader";
|
||||
const LOADER_FLAGS = new Set([LOADER_FLAG, EXPERIMENTAL_LOADER_FLAG]);
|
||||
const IMPORT_FLAG_SUPPORTED = compareNodeVersion("20.6") >= 0;
|
||||
const INT32_BYTES = 4;
|
||||
|
||||
//#endregion
|
||||
//#region src/helpers.ts
|
||||
const isFile = (path$2) => {
|
||||
try {
|
||||
var _fs$statSync;
|
||||
return !!((_fs$statSync = node_fs.default.statSync(path$2, { throwIfNoEntry: false })) === null || _fs$statSync === void 0 ? void 0 : _fs$statSync.isFile());
|
||||
} catch {
|
||||
/* istanbul ignore next */
|
||||
return false;
|
||||
}
|
||||
};
|
||||
const dataUrl = (code) => new URL(`data:text/javascript,${encodeURIComponent(code)}`);
|
||||
const hasRequireFlag = (execArgv) => execArgv.some((execArg) => REQUIRE_FLAGS.has(execArg));
|
||||
const hasImportFlag = (execArgv) => execArgv.includes(IMPORT_FLAG);
|
||||
const hasLoaderFlag = (execArgv) => execArgv.some((execArg) => LOADER_FLAGS.has(execArg));
|
||||
const setupTsRunner = (workerPath, { execArgv = DEFAULT_EXEC_ARGV, tsRunner } = {}) => {
|
||||
let ext = node_path.default.extname(workerPath);
|
||||
if (!/([/\\])node_modules\1/.test(workerPath) && (!ext || /^\.[cm]?js$/.test(ext))) {
|
||||
const workPathWithoutExt = ext ? workerPath.slice(0, -ext.length) : workerPath;
|
||||
let extensions;
|
||||
switch (ext) {
|
||||
case ".cjs": {
|
||||
extensions = [".cts", ".cjs"];
|
||||
break;
|
||||
}
|
||||
case ".mjs": {
|
||||
extensions = [".mts", ".mjs"];
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
extensions = [".ts", ".js"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
const found = (0, __pkgr_core.tryExtensions)(workPathWithoutExt, extensions);
|
||||
let differentExt;
|
||||
if (found && (!ext || (differentExt = found !== workPathWithoutExt))) {
|
||||
workerPath = found;
|
||||
if (differentExt) ext = node_path.default.extname(workerPath);
|
||||
}
|
||||
}
|
||||
const isTs = /\.[cm]?ts$/.test(workerPath);
|
||||
let jsUseEsm = ext === ".mjs";
|
||||
let tsUseEsm = ext === ".mts";
|
||||
if (isTs) {
|
||||
if (!tsUseEsm && ext !== ".cts") {
|
||||
const pkg = (0, __pkgr_core.findUp)(workerPath);
|
||||
if (pkg) tsUseEsm = (0, __pkgr_core.cjsRequire)(pkg).type === "module";
|
||||
}
|
||||
const stripTypesIndex = execArgv.indexOf(STRIP_TYPES_FLAG);
|
||||
const transformTypesIndex = execArgv.indexOf(TRANSFORM_TYPES_FLAG);
|
||||
const noStripTypesIndex = execArgv.indexOf(NO_STRIP_TYPES_FLAG);
|
||||
const execArgvNoStripTypes = noStripTypesIndex > stripTypesIndex || noStripTypesIndex > transformTypesIndex;
|
||||
const noStripTypes = execArgvNoStripTypes || stripTypesIndex === -1 && transformTypesIndex === -1 && NO_STRIP_TYPES;
|
||||
if (tsRunner == null) {
|
||||
if (process.versions.bun) tsRunner = TsRunner.Bun;
|
||||
else if (!noStripTypes && compareNodeVersion(STRIP_TYPES_NODE_VERSION) >= 0) tsRunner = TsRunner.Node;
|
||||
else if ((0, __pkgr_core.isPkgAvailable)(TsRunner.TsNode)) tsRunner = TsRunner.TsNode;
|
||||
}
|
||||
switch (tsRunner) {
|
||||
case TsRunner.Bun: break;
|
||||
case TsRunner.Node: {
|
||||
if (compareNodeVersion(STRIP_TYPES_NODE_VERSION) < 0) throw new Error("type stripping is not supported in this node version");
|
||||
if (noStripTypes) throw new Error("type stripping is disabled explicitly");
|
||||
if (compareNodeVersion(DEFAULT_TYPES_NODE_VERSION) >= 0) break;
|
||||
if (compareNodeVersion(TRANSFORM_TYPES_NODE_VERSION) >= 0 && !execArgv.includes(TRANSFORM_TYPES_FLAG)) execArgv = [TRANSFORM_TYPES_FLAG, ...execArgv];
|
||||
else if (compareNodeVersion(STRIP_TYPES_NODE_VERSION) >= 0 && !execArgv.includes(STRIP_TYPES_FLAG)) execArgv = [STRIP_TYPES_FLAG, ...execArgv];
|
||||
break;
|
||||
}
|
||||
case TsRunner.TsNode: {
|
||||
if (tsUseEsm) {
|
||||
if (!execArgv.includes(LOADER_FLAG)) execArgv = [
|
||||
LOADER_FLAG,
|
||||
`${TsRunner.TsNode}/esm`,
|
||||
...execArgv
|
||||
];
|
||||
} else if (!hasRequireFlag(execArgv)) execArgv = [
|
||||
REQUIRE_ABBR_FLAG,
|
||||
`${TsRunner.TsNode}/register`,
|
||||
...execArgv
|
||||
];
|
||||
break;
|
||||
}
|
||||
case TsRunner.EsbuildRegister: {
|
||||
if (tsUseEsm) {
|
||||
if (!hasLoaderFlag(execArgv)) execArgv = [
|
||||
LOADER_FLAG,
|
||||
`${TsRunner.EsbuildRegister}/loader`,
|
||||
...execArgv
|
||||
];
|
||||
} else if (!hasRequireFlag(execArgv)) execArgv = [
|
||||
REQUIRE_ABBR_FLAG,
|
||||
TsRunner.EsbuildRegister,
|
||||
...execArgv
|
||||
];
|
||||
break;
|
||||
}
|
||||
case TsRunner.EsbuildRunner: {
|
||||
if (!hasRequireFlag(execArgv)) execArgv = [
|
||||
REQUIRE_ABBR_FLAG,
|
||||
`${TsRunner.EsbuildRunner}/register`,
|
||||
...execArgv
|
||||
];
|
||||
break;
|
||||
}
|
||||
case TsRunner.OXC: {
|
||||
if (!execArgv.includes(IMPORT_FLAG)) execArgv = [
|
||||
IMPORT_FLAG,
|
||||
`@${TsRunner.OXC}-node/core/register`,
|
||||
...execArgv
|
||||
];
|
||||
break;
|
||||
}
|
||||
case TsRunner.SWC: {
|
||||
if (tsUseEsm) {
|
||||
if (IMPORT_FLAG_SUPPORTED) {
|
||||
if (!hasImportFlag(execArgv)) execArgv = [
|
||||
IMPORT_FLAG,
|
||||
`@${TsRunner.SWC}-node/register/esm-register`,
|
||||
...execArgv
|
||||
];
|
||||
} else if (!hasLoaderFlag(execArgv)) execArgv = [
|
||||
LOADER_FLAG,
|
||||
`@${TsRunner.SWC}-node/register/esm`,
|
||||
...execArgv
|
||||
];
|
||||
} else if (!hasRequireFlag(execArgv)) execArgv = [
|
||||
REQUIRE_ABBR_FLAG,
|
||||
`@${TsRunner.SWC}-node/register`,
|
||||
...execArgv
|
||||
];
|
||||
break;
|
||||
}
|
||||
case TsRunner.TSX: {
|
||||
if (IMPORT_FLAG_SUPPORTED) {
|
||||
if (!execArgv.includes(IMPORT_FLAG)) execArgv = [
|
||||
IMPORT_FLAG,
|
||||
TsRunner.TSX,
|
||||
...execArgv
|
||||
];
|
||||
} else if (!execArgv.includes(LOADER_FLAG)) execArgv = [
|
||||
LOADER_FLAG,
|
||||
TsRunner.TSX,
|
||||
...execArgv
|
||||
];
|
||||
break;
|
||||
}
|
||||
default: throw new Error(`Unknown ts runner: ${String(tsRunner)}`);
|
||||
}
|
||||
} else if (!jsUseEsm && ext !== ".cjs") {
|
||||
const pkg = (0, __pkgr_core.findUp)(workerPath);
|
||||
if (pkg) jsUseEsm = (0, __pkgr_core.cjsRequire)(pkg).type === "module";
|
||||
}
|
||||
let resolvedPnpLoaderPath;
|
||||
/* istanbul ignore if -- https://github.com/facebook/jest/issues/5274 */
|
||||
if (process.versions.pnp) {
|
||||
let pnpApiPath;
|
||||
try {
|
||||
/** @see https://github.com/facebook/jest/issues/9543 */
|
||||
pnpApiPath = __pkgr_core.cjsRequire.resolve("pnpapi");
|
||||
} catch {}
|
||||
if (pnpApiPath && !NODE_OPTIONS.some((option, index) => REQUIRE_FLAGS.has(option) && pnpApiPath === __pkgr_core.cjsRequire.resolve(NODE_OPTIONS[index + 1])) && !execArgv.includes(pnpApiPath)) {
|
||||
execArgv = [
|
||||
REQUIRE_ABBR_FLAG,
|
||||
pnpApiPath,
|
||||
...execArgv
|
||||
];
|
||||
const pnpLoaderPath = node_path.default.resolve(pnpApiPath, "../.pnp.loader.mjs");
|
||||
if (isFile(pnpLoaderPath)) {
|
||||
resolvedPnpLoaderPath = (0, node_url.pathToFileURL)(pnpLoaderPath).href;
|
||||
if (!MODULE_REGISTER_SUPPORTED) execArgv = [
|
||||
LOADER_FLAG,
|
||||
resolvedPnpLoaderPath,
|
||||
...execArgv
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
ext,
|
||||
isTs,
|
||||
jsUseEsm,
|
||||
tsRunner,
|
||||
tsUseEsm,
|
||||
workerPath,
|
||||
pnpLoaderPath: resolvedPnpLoaderPath,
|
||||
execArgv
|
||||
};
|
||||
};
|
||||
const md5Hash = (text) => (0, node_crypto.createHash)("md5").update(text).digest("hex");
|
||||
const encodeImportModule = (moduleNameOrGlobalShim, type = "import") => {
|
||||
const { moduleName, globalName, named, conditional } = typeof moduleNameOrGlobalShim === "string" ? { moduleName: moduleNameOrGlobalShim } : moduleNameOrGlobalShim;
|
||||
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, "\\\\")}')`;
|
||||
if (!globalName) return importStatement;
|
||||
const overrideStatement = `globalThis.${globalName}=${(named === null || named === void 0 ? void 0 : named.trim()) ? named : globalName}`;
|
||||
return importStatement + (conditional === false ? `;${overrideStatement}` : `;if(!globalThis.${globalName})${overrideStatement}`);
|
||||
};
|
||||
/** @internal */
|
||||
const _generateGlobals = (globalShims, type) => globalShims.reduce((acc, shim) => `${acc}${acc ? ";" : ""}${encodeImportModule(shim, type)}`, "");
|
||||
let globalsCache;
|
||||
let tmpdir;
|
||||
const _dirname = typeof __dirname === "undefined" ? node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href)) : __dirname;
|
||||
const generateGlobals = (workerPath, globalShims, type = "import") => {
|
||||
if (globalShims.length === 0) return "";
|
||||
globalsCache ?? (globalsCache = new Map());
|
||||
const cached = globalsCache.get(workerPath);
|
||||
if (cached) {
|
||||
const [content$1, filepath$1] = cached;
|
||||
if (type === "require" && !filepath$1 || type === "import" && filepath$1 && isFile(filepath$1)) return content$1;
|
||||
}
|
||||
const globals = _generateGlobals(globalShims, type);
|
||||
let content = globals;
|
||||
let filepath;
|
||||
if (type === "import") {
|
||||
if (!tmpdir) tmpdir = node_path.default.resolve((0, __pkgr_core.findUp)(_dirname), "../node_modules/.synckit");
|
||||
node_fs.default.mkdirSync(tmpdir, { recursive: true });
|
||||
filepath = node_path.default.resolve(tmpdir, md5Hash(workerPath) + ".mjs");
|
||||
content = encodeImportModule(filepath);
|
||||
node_fs.default.writeFileSync(filepath, globals);
|
||||
}
|
||||
globalsCache.set(workerPath, [content, filepath]);
|
||||
return content;
|
||||
};
|
||||
/**
|
||||
* Creates a shallow copy of the enumerable properties from the provided object.
|
||||
*
|
||||
* @param object - An optional object whose properties are to be extracted.
|
||||
* @returns A new object containing the enumerable properties of the input, or
|
||||
* undefined if no valid object is provided.
|
||||
*/
|
||||
function extractProperties(object) {
|
||||
if (object && typeof object === "object") {
|
||||
const properties = {};
|
||||
for (const key in object) properties[key] = object[key];
|
||||
return properties;
|
||||
}
|
||||
}
|
||||
let sharedBuffer;
|
||||
let sharedBufferView;
|
||||
/**
|
||||
* Spawns a worker thread and returns a synchronous function to dispatch tasks.
|
||||
*
|
||||
* The function initializes a worker thread with the specified script and
|
||||
* configuration, setting up a dedicated message channel for bidirectional
|
||||
* communication. It applies TypeScript runner settings, execution arguments,
|
||||
* and global shims as needed. The returned function sends tasks to the worker,
|
||||
* waits synchronously for a response using shared memory synchronization, and
|
||||
* then returns the computed result.
|
||||
*
|
||||
* @param workerPath - The file path of the worker script to execute.
|
||||
* @param options - An object containing configuration parameters:
|
||||
*
|
||||
* - Timeout: Maximum time in milliseconds to wait for the worker's response.
|
||||
* - ExecArgv: Array of Node.js execution arguments for the worker.
|
||||
* - TsRunner: Specifies the TypeScript runner to use if the worker script is
|
||||
* TypeScript.
|
||||
* - TransferList: List of additional transferable objects to pass to the worker.
|
||||
* - GlobalShims: Modules to import as global shims; if true, a default preset is
|
||||
* used.
|
||||
*
|
||||
* @returns A synchronous function that accepts task arguments intended for the
|
||||
* worker thread and returns its result.
|
||||
* @throws {Error} If a TypeScript runner is required but not specified, or if
|
||||
* an unsupported TypeScript runner is used for the file type.
|
||||
* @throws {Error} If internal synchronization fails or if the message
|
||||
* identifier does not match the expected value.
|
||||
*/
|
||||
function startWorkerThread(workerPath, { timeout = DEFAULT_TIMEOUT, execArgv = DEFAULT_EXEC_ARGV, tsRunner = DEFAULT_TS_RUNNER, transferList = [], globalShims = DEFAULT_GLOBAL_SHIMS } = {}) {
|
||||
const { port1: mainPort, port2: workerPort } = new node_worker_threads.MessageChannel();
|
||||
const { isTs, ext, jsUseEsm, tsUseEsm, tsRunner: finalTsRunner, workerPath: finalWorkerPath, pnpLoaderPath, execArgv: finalExecArgv } = setupTsRunner(workerPath, {
|
||||
execArgv,
|
||||
tsRunner
|
||||
});
|
||||
const workerPathUrl = (0, node_url.pathToFileURL)(finalWorkerPath);
|
||||
if (/\.[cm]ts$/.test(finalWorkerPath)) {
|
||||
const isTsxSupported = !tsUseEsm || TS_ESM_PARTIAL_SUPPORTED;
|
||||
/* istanbul ignore if */
|
||||
if (!finalTsRunner) throw new Error("No ts runner specified, ts worker path is not supported");
|
||||
else if ([
|
||||
TsRunner.EsbuildRegister,
|
||||
TsRunner.EsbuildRunner,
|
||||
...TS_ESM_PARTIAL_SUPPORTED ? [TsRunner.OXC, TsRunner.SWC] : [],
|
||||
...isTsxSupported ? [] : [TsRunner.TSX]
|
||||
].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" : ""));
|
||||
}
|
||||
const finalGlobalShims = (globalShims === true ? DEFAULT_GLOBAL_SHIMS_PRESET : Array.isArray(globalShims) ? globalShims : []).filter(({ moduleName }) => (0, __pkgr_core.isPkgAvailable)(moduleName));
|
||||
sharedBufferView ?? (sharedBufferView = new Int32Array(sharedBuffer ?? (sharedBuffer = new SharedArrayBuffer(INT32_BYTES)), 0, 1));
|
||||
const useGlobals = finalGlobalShims.length > 0;
|
||||
const useEval = isTs ? !tsUseEsm : !jsUseEsm && useGlobals;
|
||||
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, {
|
||||
eval: useEval,
|
||||
workerData: {
|
||||
sharedBufferView,
|
||||
workerPort,
|
||||
pnpLoaderPath
|
||||
},
|
||||
transferList: [workerPort, ...transferList],
|
||||
execArgv: finalExecArgv
|
||||
});
|
||||
let nextID = 0;
|
||||
const receiveMessageWithId = (port, expectedId, waitingTimeout) => {
|
||||
const start = Date.now();
|
||||
const status = Atomics.wait(sharedBufferView, 0, 0, waitingTimeout);
|
||||
Atomics.store(sharedBufferView, 0, 0);
|
||||
if (!["ok", "not-equal"].includes(status)) {
|
||||
const abortMsg = {
|
||||
id: expectedId,
|
||||
cmd: "abort"
|
||||
};
|
||||
port.postMessage(abortMsg);
|
||||
throw new Error("Internal error: Atomics.wait() failed: " + status);
|
||||
}
|
||||
const result = (0, node_worker_threads.receiveMessageOnPort)(mainPort);
|
||||
const msg = result === null || result === void 0 ? void 0 : result.message;
|
||||
if ((msg === null || msg === void 0 ? void 0 : msg.id) == null || msg.id < expectedId) {
|
||||
const waitingTime = Date.now() - start;
|
||||
return receiveMessageWithId(port, expectedId, waitingTimeout ? waitingTimeout - waitingTime : void 0);
|
||||
}
|
||||
const { id,...message } = msg;
|
||||
if (expectedId !== id) throw new Error(`Internal error: Expected id ${expectedId} but got id ${id}`);
|
||||
return {
|
||||
id,
|
||||
...message
|
||||
};
|
||||
};
|
||||
const syncFn = (...args) => {
|
||||
const id = nextID++;
|
||||
const msg = {
|
||||
id,
|
||||
args
|
||||
};
|
||||
worker.postMessage(msg);
|
||||
const { result, error, properties, stdio } = receiveMessageWithId(mainPort, id, timeout);
|
||||
for (const { type, chunk, encoding } of stdio) process[type].write(chunk, encoding);
|
||||
if (error) throw Object.assign(error, properties);
|
||||
return result;
|
||||
};
|
||||
worker.unref();
|
||||
return syncFn;
|
||||
}
|
||||
const overrideStdio = (stdio) => {
|
||||
for (const type of ["stdout", "stderr"]) process[type]._writev = (chunks, callback) => {
|
||||
for (const { chunk, encoding } of chunks) stdio.push({
|
||||
type,
|
||||
chunk,
|
||||
encoding
|
||||
});
|
||||
callback();
|
||||
};
|
||||
};
|
||||
|
||||
//#endregion
|
||||
//#region src/index.ts
|
||||
let syncFnCache;
|
||||
/**
|
||||
* Creates a synchronous worker function.
|
||||
*
|
||||
* Converts the provided worker path (URL or string) to an absolute file path,
|
||||
* retrieves a cached synchronous function if one exists, or starts a new worker
|
||||
* thread to handle task execution. The resulting function is cached to avoid
|
||||
* redundant initialization.
|
||||
*
|
||||
* @param workerPath - The absolute file path or URL of the worker script. If
|
||||
* given as a URL, it is converted to a file path.
|
||||
* @param timeoutOrOptions - Optional timeout in milliseconds or an options
|
||||
* object to configure the worker thread.
|
||||
* @returns A synchronous function that executes tasks on the specified worker
|
||||
* thread.
|
||||
* @throws {Error} If the resulting worker path is not absolute.
|
||||
*/
|
||||
function createSyncFn(workerPath, timeoutOrOptions) {
|
||||
syncFnCache ?? (syncFnCache = new Map());
|
||||
if (typeof workerPath !== "string" || workerPath.startsWith("file://")) workerPath = (0, node_url.fileURLToPath)(workerPath);
|
||||
const cachedSyncFn = syncFnCache.get(workerPath);
|
||||
if (cachedSyncFn) return cachedSyncFn;
|
||||
if (!node_path.default.isAbsolute(workerPath)) throw new Error("`workerPath` must be absolute");
|
||||
const syncFn = startWorkerThread(
|
||||
workerPath,
|
||||
/* istanbul ignore next */
|
||||
typeof timeoutOrOptions === "number" ? { timeout: timeoutOrOptions } : timeoutOrOptions
|
||||
);
|
||||
syncFnCache.set(workerPath, syncFn);
|
||||
return syncFn;
|
||||
}
|
||||
/* istanbul ignore next */
|
||||
/**
|
||||
* Configures the worker thread to listen for messages from the parent process
|
||||
* and execute a provided function.
|
||||
*
|
||||
* If the worker is not initialized with the required data, the function exits
|
||||
* without further action. Otherwise, it optionally registers a custom module
|
||||
* loader when a valid loader path is provided and captures output generated
|
||||
* during execution. It listens for messages containing an identifier and
|
||||
* arguments, then invokes the supplied function asynchronously with those
|
||||
* arguments. If an abort command is received for the same message, the response
|
||||
* is suppressed. Upon completing execution, it posts a message back with either
|
||||
* the result or error details, including extracted error properties.
|
||||
*
|
||||
* @param fn - The function to execute when a message is received.
|
||||
*/
|
||||
function runAsWorker(fn) {
|
||||
if (!node_worker_threads.workerData) return;
|
||||
const stdio = [];
|
||||
overrideStdio(stdio);
|
||||
const { workerPort, sharedBufferView: sharedBufferView$1, pnpLoaderPath } = node_worker_threads.workerData;
|
||||
if (pnpLoaderPath && MODULE_REGISTER_SUPPORTED) node_module.default.register(pnpLoaderPath);
|
||||
node_worker_threads.parentPort.on("message", ({ id, args }) => {
|
||||
(async () => {
|
||||
let isAborted = false;
|
||||
const handleAbortMessage = (msg$1) => {
|
||||
if (msg$1.id === id && msg$1.cmd === "abort") isAborted = true;
|
||||
};
|
||||
workerPort.on("message", handleAbortMessage);
|
||||
let msg;
|
||||
try {
|
||||
msg = {
|
||||
id,
|
||||
stdio,
|
||||
result: await fn(...args)
|
||||
};
|
||||
} catch (error) {
|
||||
msg = {
|
||||
id,
|
||||
stdio,
|
||||
error,
|
||||
properties: extractProperties(error)
|
||||
};
|
||||
}
|
||||
workerPort.off("message", handleAbortMessage);
|
||||
if (isAborted) {
|
||||
stdio.length = 0;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
workerPort.postMessage(msg);
|
||||
Atomics.add(sharedBufferView$1, 0, 1);
|
||||
Atomics.notify(sharedBufferView$1, 0);
|
||||
} finally {
|
||||
stdio.length = 0;
|
||||
}
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
//#endregion
|
||||
exports.DEFAULT_EXEC_ARGV = DEFAULT_EXEC_ARGV;
|
||||
exports.DEFAULT_GLOBAL_SHIMS = DEFAULT_GLOBAL_SHIMS;
|
||||
exports.DEFAULT_GLOBAL_SHIMS_PRESET = DEFAULT_GLOBAL_SHIMS_PRESET;
|
||||
exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;
|
||||
exports.DEFAULT_TS_RUNNER = DEFAULT_TS_RUNNER;
|
||||
exports.DEFAULT_TYPES_NODE_VERSION = DEFAULT_TYPES_NODE_VERSION;
|
||||
exports.EXPERIMENTAL_LOADER_FLAG = EXPERIMENTAL_LOADER_FLAG;
|
||||
exports.FEATURE_TYPESCRIPT_NODE_VERSION = FEATURE_TYPESCRIPT_NODE_VERSION;
|
||||
exports.IMPORT_FLAG = IMPORT_FLAG;
|
||||
exports.IMPORT_FLAG_SUPPORTED = IMPORT_FLAG_SUPPORTED;
|
||||
exports.INT32_BYTES = INT32_BYTES;
|
||||
exports.LOADER_FLAG = LOADER_FLAG;
|
||||
exports.LOADER_FLAGS = LOADER_FLAGS;
|
||||
exports.MODULE_REGISTER_SUPPORTED = MODULE_REGISTER_SUPPORTED;
|
||||
exports.MTS_SUPPORTED = MTS_SUPPORTED;
|
||||
exports.NODE_OPTIONS = NODE_OPTIONS;
|
||||
exports.NODE_VERSION = NODE_VERSION;
|
||||
exports.NO_STRIP_TYPES = NO_STRIP_TYPES;
|
||||
exports.NO_STRIP_TYPES_FLAG = NO_STRIP_TYPES_FLAG;
|
||||
exports.REQUIRE_ABBR_FLAG = REQUIRE_ABBR_FLAG;
|
||||
exports.REQUIRE_FLAG = REQUIRE_FLAG;
|
||||
exports.REQUIRE_FLAGS = REQUIRE_FLAGS;
|
||||
exports.STRIP_TYPES_FLAG = STRIP_TYPES_FLAG;
|
||||
exports.STRIP_TYPES_NODE_VERSION = STRIP_TYPES_NODE_VERSION;
|
||||
exports.TRANSFORM_TYPES_FLAG = TRANSFORM_TYPES_FLAG;
|
||||
exports.TRANSFORM_TYPES_NODE_VERSION = TRANSFORM_TYPES_NODE_VERSION;
|
||||
exports.TS_ESM_PARTIAL_SUPPORTED = TS_ESM_PARTIAL_SUPPORTED;
|
||||
exports.TsRunner = TsRunner;
|
||||
exports._generateGlobals = _generateGlobals;
|
||||
exports.compareNodeVersion = compareNodeVersion;
|
||||
exports.compareVersion = compareVersion;
|
||||
exports.createSyncFn = createSyncFn;
|
||||
exports.dataUrl = dataUrl;
|
||||
exports.encodeImportModule = encodeImportModule;
|
||||
exports.extractProperties = extractProperties;
|
||||
exports.generateGlobals = generateGlobals;
|
||||
exports.hasFlag = hasFlag;
|
||||
exports.hasImportFlag = hasImportFlag;
|
||||
exports.hasLoaderFlag = hasLoaderFlag;
|
||||
exports.hasRequireFlag = hasRequireFlag;
|
||||
exports.isFile = isFile;
|
||||
exports.md5Hash = md5Hash;
|
||||
exports.overrideStdio = overrideStdio;
|
||||
exports.parseVersion = parseVersion;
|
||||
exports.runAsWorker = runAsWorker;
|
||||
exports.setupTsRunner = setupTsRunner;
|
||||
exports.startWorkerThread = startWorkerThread;
|
||||
138
frontend/node_modules/synckit/lib/index.d.cts
generated
vendored
Normal file
138
frontend/node_modules/synckit/lib/index.d.cts
generated
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
import { MessagePort, TransferListItem } from "node:worker_threads";
|
||||
import * as url0 from "url";
|
||||
|
||||
//#region src/constants.d.ts
|
||||
declare const TsRunner: {
|
||||
readonly Node: "node";
|
||||
readonly Bun: "bun";
|
||||
readonly TsNode: "ts-node";
|
||||
readonly EsbuildRegister: "esbuild-register";
|
||||
readonly EsbuildRunner: "esbuild-runner";
|
||||
readonly OXC: "oxc";
|
||||
readonly SWC: "swc";
|
||||
readonly TSX: "tsx";
|
||||
};
|
||||
type TsRunner = ValueOf<typeof TsRunner>;
|
||||
declare const TS_ESM_PARTIAL_SUPPORTED: boolean;
|
||||
declare const MTS_SUPPORTED: boolean;
|
||||
declare const MODULE_REGISTER_SUPPORTED: boolean;
|
||||
declare const STRIP_TYPES_NODE_VERSION = "22.6";
|
||||
declare const TRANSFORM_TYPES_NODE_VERSION = "22.7";
|
||||
declare const FEATURE_TYPESCRIPT_NODE_VERSION = "22.10";
|
||||
declare const DEFAULT_TYPES_NODE_VERSION = "23.6";
|
||||
declare const STRIP_TYPES_FLAG = "--experimental-strip-types";
|
||||
declare const TRANSFORM_TYPES_FLAG = "--experimental-transform-types";
|
||||
declare const NO_STRIP_TYPES_FLAG = "--no-experimental-strip-types";
|
||||
declare const NODE_OPTIONS: string[];
|
||||
declare const NO_STRIP_TYPES: boolean;
|
||||
declare const DEFAULT_TIMEOUT: number | undefined;
|
||||
declare const DEFAULT_EXEC_ARGV: string[];
|
||||
declare const DEFAULT_TS_RUNNER: TsRunner | undefined;
|
||||
declare const DEFAULT_GLOBAL_SHIMS: boolean;
|
||||
declare const DEFAULT_GLOBAL_SHIMS_PRESET: GlobalShim[];
|
||||
declare const IMPORT_FLAG = "--import";
|
||||
declare const REQUIRE_FLAG = "--require";
|
||||
declare const REQUIRE_ABBR_FLAG = "-r";
|
||||
declare const REQUIRE_FLAGS: Set<string>;
|
||||
declare const LOADER_FLAG = "--loader";
|
||||
declare const EXPERIMENTAL_LOADER_FLAG = "--experimental-loader";
|
||||
declare const LOADER_FLAGS: Set<string>;
|
||||
declare const IMPORT_FLAG_SUPPORTED: boolean;
|
||||
declare const INT32_BYTES = 4;
|
||||
//#endregion
|
||||
//#region src/types.d.ts
|
||||
type AnyFn<R = any, T extends any[] = any[]> = (...args: T) => R;
|
||||
type Syncify<T extends AnyFn> = (...args: Parameters<T>) => Awaited<ReturnType<T>>;
|
||||
type ValueOf<T> = T[keyof T];
|
||||
interface MainToWorkerMessage<T extends unknown[]> {
|
||||
id: number;
|
||||
args: T;
|
||||
}
|
||||
interface MainToWorkerCommandMessage {
|
||||
id: number;
|
||||
cmd: string;
|
||||
}
|
||||
interface WorkerData {
|
||||
sharedBufferView: Int32Array;
|
||||
workerPort: MessagePort;
|
||||
pnpLoaderPath: string | undefined;
|
||||
}
|
||||
interface DataMessage<T> {
|
||||
result?: T;
|
||||
error?: unknown;
|
||||
properties?: unknown;
|
||||
}
|
||||
interface StdioChunk {
|
||||
type: 'stderr' | 'stdout';
|
||||
chunk: Uint8Array | string;
|
||||
encoding: BufferEncoding;
|
||||
}
|
||||
interface WorkerToMainMessage<T> extends DataMessage<T> {
|
||||
id: number;
|
||||
stdio: StdioChunk[];
|
||||
}
|
||||
interface GlobalShim {
|
||||
moduleName: string;
|
||||
globalName?: string;
|
||||
named?: string | null;
|
||||
conditional?: boolean;
|
||||
}
|
||||
interface PackageJson {
|
||||
type?: 'commonjs' | 'module';
|
||||
}
|
||||
interface SynckitOptions {
|
||||
execArgv?: string[];
|
||||
globalShims?: GlobalShim[] | boolean;
|
||||
timeout?: number;
|
||||
transferList?: TransferListItem[];
|
||||
tsRunner?: TsRunner;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/common.d.ts
|
||||
declare const hasFlag: (flag: string) => boolean;
|
||||
declare const parseVersion: (version: string) => number[];
|
||||
declare const compareVersion: (version1: string, version2: string) => 1 | -1 | 0;
|
||||
declare const NODE_VERSION: string;
|
||||
declare const compareNodeVersion: (version: string) => 1 | -1 | 0;
|
||||
//#endregion
|
||||
//#region src/helpers.d.ts
|
||||
declare const isFile: (path: string) => boolean;
|
||||
declare const dataUrl: (code: string) => url0.URL;
|
||||
declare const hasRequireFlag: (execArgv: string[]) => boolean;
|
||||
declare const hasImportFlag: (execArgv: string[]) => boolean;
|
||||
declare const hasLoaderFlag: (execArgv: string[]) => boolean;
|
||||
declare const setupTsRunner: (workerPath: string, {
|
||||
execArgv,
|
||||
tsRunner
|
||||
}?: {
|
||||
execArgv?: string[];
|
||||
tsRunner?: TsRunner;
|
||||
}) => {
|
||||
ext: string;
|
||||
isTs: boolean;
|
||||
jsUseEsm: boolean;
|
||||
tsRunner: TsRunner | undefined;
|
||||
tsUseEsm: boolean;
|
||||
workerPath: string;
|
||||
pnpLoaderPath: string | undefined;
|
||||
execArgv: string[];
|
||||
};
|
||||
declare const md5Hash: (text: string) => string;
|
||||
declare const encodeImportModule: (moduleNameOrGlobalShim: GlobalShim | string, type?: "import" | "require") => string;
|
||||
declare const generateGlobals: (workerPath: string, globalShims: GlobalShim[], type?: "import" | "require") => string;
|
||||
declare function extractProperties<T extends object>(object: T): T;
|
||||
declare function extractProperties<T>(object?: T): T | undefined;
|
||||
declare function startWorkerThread<T extends AnyFn, R = Awaited<ReturnType<T>>>(workerPath: string, {
|
||||
timeout,
|
||||
execArgv,
|
||||
tsRunner,
|
||||
transferList,
|
||||
globalShims
|
||||
}?: SynckitOptions): (...args: Parameters<T>) => R;
|
||||
declare const overrideStdio: (stdio: StdioChunk[]) => void;
|
||||
//#endregion
|
||||
//#region src/index.d.ts
|
||||
declare function createSyncFn<T extends AnyFn>(workerPath: URL | string, timeoutOrOptions?: SynckitOptions | number): Syncify<T>;
|
||||
declare function runAsWorker<T extends AnyFn<Promise<R> | R>, R = ReturnType<T>>(fn: T): void;
|
||||
//#endregion
|
||||
export { AnyFn, DEFAULT_EXEC_ARGV, DEFAULT_GLOBAL_SHIMS, DEFAULT_GLOBAL_SHIMS_PRESET, DEFAULT_TIMEOUT, DEFAULT_TS_RUNNER, DEFAULT_TYPES_NODE_VERSION, DataMessage, EXPERIMENTAL_LOADER_FLAG, FEATURE_TYPESCRIPT_NODE_VERSION, GlobalShim, IMPORT_FLAG, IMPORT_FLAG_SUPPORTED, INT32_BYTES, LOADER_FLAG, LOADER_FLAGS, MODULE_REGISTER_SUPPORTED, MTS_SUPPORTED, MainToWorkerCommandMessage, MainToWorkerMessage, NODE_OPTIONS, NODE_VERSION, NO_STRIP_TYPES, NO_STRIP_TYPES_FLAG, PackageJson, REQUIRE_ABBR_FLAG, REQUIRE_FLAG, REQUIRE_FLAGS, STRIP_TYPES_FLAG, STRIP_TYPES_NODE_VERSION, StdioChunk, Syncify, SynckitOptions, TRANSFORM_TYPES_FLAG, TRANSFORM_TYPES_NODE_VERSION, TS_ESM_PARTIAL_SUPPORTED, TsRunner, ValueOf, WorkerData, WorkerToMainMessage, compareNodeVersion, compareVersion, createSyncFn, dataUrl, encodeImportModule, extractProperties, generateGlobals, hasFlag, hasImportFlag, hasLoaderFlag, hasRequireFlag, isFile, md5Hash, overrideStdio, parseVersion, runAsWorker, setupTsRunner, startWorkerThread };
|
||||
7
frontend/node_modules/synckit/lib/index.d.ts
generated
vendored
Normal file
7
frontend/node_modules/synckit/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { AnyFn, Syncify, SynckitOptions } from './types.js';
|
||||
export * from './common.js';
|
||||
export * from './constants.js';
|
||||
export * from './helpers.js';
|
||||
export * from './types.js';
|
||||
export declare function createSyncFn<T extends AnyFn>(workerPath: URL | string, timeoutOrOptions?: SynckitOptions | number): Syncify<T>;
|
||||
export declare function runAsWorker<T extends AnyFn<Promise<R> | R>, R = ReturnType<T>>(fn: T): void;
|
||||
73
frontend/node_modules/synckit/lib/index.js
generated
vendored
Normal file
73
frontend/node_modules/synckit/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
import module from 'node:module';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { parentPort, workerData, } from 'node:worker_threads';
|
||||
import { MODULE_REGISTER_SUPPORTED } from './constants.js';
|
||||
import { extractProperties, overrideStdio, startWorkerThread, } from './helpers.js';
|
||||
export * from './common.js';
|
||||
export * from './constants.js';
|
||||
export * from './helpers.js';
|
||||
export * from './types.js';
|
||||
let syncFnCache;
|
||||
export function createSyncFn(workerPath, timeoutOrOptions) {
|
||||
syncFnCache ?? (syncFnCache = new Map());
|
||||
if (typeof workerPath !== 'string' || workerPath.startsWith('file://')) {
|
||||
workerPath = fileURLToPath(workerPath);
|
||||
}
|
||||
const cachedSyncFn = syncFnCache.get(workerPath);
|
||||
if (cachedSyncFn) {
|
||||
return cachedSyncFn;
|
||||
}
|
||||
if (!path.isAbsolute(workerPath)) {
|
||||
throw new Error('`workerPath` must be absolute');
|
||||
}
|
||||
const syncFn = startWorkerThread(workerPath, typeof timeoutOrOptions === 'number'
|
||||
? { timeout: timeoutOrOptions }
|
||||
: timeoutOrOptions);
|
||||
syncFnCache.set(workerPath, syncFn);
|
||||
return syncFn;
|
||||
}
|
||||
export function runAsWorker(fn) {
|
||||
if (!workerData) {
|
||||
return;
|
||||
}
|
||||
const stdio = [];
|
||||
overrideStdio(stdio);
|
||||
const { workerPort, sharedBufferView, pnpLoaderPath } = workerData;
|
||||
if (pnpLoaderPath && MODULE_REGISTER_SUPPORTED) {
|
||||
module.register(pnpLoaderPath);
|
||||
}
|
||||
parentPort.on('message', ({ id, args }) => {
|
||||
;
|
||||
(async () => {
|
||||
let isAborted = false;
|
||||
const handleAbortMessage = (msg) => {
|
||||
if (msg.id === id && msg.cmd === 'abort') {
|
||||
isAborted = true;
|
||||
}
|
||||
};
|
||||
workerPort.on('message', handleAbortMessage);
|
||||
let msg;
|
||||
try {
|
||||
msg = { id, stdio, result: await fn(...args) };
|
||||
}
|
||||
catch (error) {
|
||||
msg = { id, stdio, error, properties: extractProperties(error) };
|
||||
}
|
||||
workerPort.off('message', handleAbortMessage);
|
||||
if (isAborted) {
|
||||
stdio.length = 0;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
workerPort.postMessage(msg);
|
||||
Atomics.add(sharedBufferView, 0, 1);
|
||||
Atomics.notify(sharedBufferView, 0);
|
||||
}
|
||||
finally {
|
||||
stdio.length = 0;
|
||||
}
|
||||
})();
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
frontend/node_modules/synckit/lib/index.js.map
generated
vendored
Normal file
1
frontend/node_modules/synckit/lib/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
||||
48
frontend/node_modules/synckit/lib/types.d.ts
generated
vendored
Normal file
48
frontend/node_modules/synckit/lib/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
import type { MessagePort, TransferListItem } from 'node:worker_threads';
|
||||
import type { TsRunner } from './constants.ts';
|
||||
export type AnyFn<R = any, T extends any[] = any[]> = (...args: T) => R;
|
||||
export type Syncify<T extends AnyFn> = (...args: Parameters<T>) => Awaited<ReturnType<T>>;
|
||||
export type ValueOf<T> = T[keyof T];
|
||||
export interface MainToWorkerMessage<T extends unknown[]> {
|
||||
id: number;
|
||||
args: T;
|
||||
}
|
||||
export interface MainToWorkerCommandMessage {
|
||||
id: number;
|
||||
cmd: string;
|
||||
}
|
||||
export interface WorkerData {
|
||||
sharedBufferView: Int32Array;
|
||||
workerPort: MessagePort;
|
||||
pnpLoaderPath: string | undefined;
|
||||
}
|
||||
export interface DataMessage<T> {
|
||||
result?: T;
|
||||
error?: unknown;
|
||||
properties?: unknown;
|
||||
}
|
||||
export interface StdioChunk {
|
||||
type: 'stderr' | 'stdout';
|
||||
chunk: Uint8Array | string;
|
||||
encoding: BufferEncoding;
|
||||
}
|
||||
export interface WorkerToMainMessage<T> extends DataMessage<T> {
|
||||
id: number;
|
||||
stdio: StdioChunk[];
|
||||
}
|
||||
export interface GlobalShim {
|
||||
moduleName: string;
|
||||
globalName?: string;
|
||||
named?: string | null;
|
||||
conditional?: boolean;
|
||||
}
|
||||
export interface PackageJson {
|
||||
type?: 'commonjs' | 'module';
|
||||
}
|
||||
export interface SynckitOptions {
|
||||
execArgv?: string[];
|
||||
globalShims?: GlobalShim[] | boolean;
|
||||
timeout?: number;
|
||||
transferList?: TransferListItem[];
|
||||
tsRunner?: TsRunner;
|
||||
}
|
||||
2
frontend/node_modules/synckit/lib/types.js
generated
vendored
Normal file
2
frontend/node_modules/synckit/lib/types.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=types.js.map
|
||||
1
frontend/node_modules/synckit/lib/types.js.map
generated
vendored
Normal file
1
frontend/node_modules/synckit/lib/types.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
||||
Reference in New Issue
Block a user