@storm-software/workspace-tools 1.42.0 → 1.42.2

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.
@@ -2196,9 +2196,9 @@ var require_chalk = __commonJS({
2196
2196
  }
2197
2197
  });
2198
2198
 
2199
- // node_modules/.pnpm/@babel+highlight@7.22.20/node_modules/@babel/highlight/lib/index.js
2199
+ // node_modules/.pnpm/@babel+highlight@7.23.4/node_modules/@babel/highlight/lib/index.js
2200
2200
  var require_lib2 = __commonJS({
2201
- "node_modules/.pnpm/@babel+highlight@7.22.20/node_modules/@babel/highlight/lib/index.js"(exports) {
2201
+ "node_modules/.pnpm/@babel+highlight@7.23.4/node_modules/@babel/highlight/lib/index.js"(exports) {
2202
2202
  "use strict";
2203
2203
  Object.defineProperty(exports, "__esModule", {
2204
2204
  value: true
@@ -2208,43 +2208,29 @@ var require_lib2 = __commonJS({
2208
2208
  var _jsTokens = require_js_tokens();
2209
2209
  var _helperValidatorIdentifier = require_lib();
2210
2210
  var _chalk = _interopRequireWildcard(require_chalk(), true);
2211
- function _getRequireWildcardCache(nodeInterop) {
2212
- if (typeof WeakMap !== "function")
2211
+ function _getRequireWildcardCache(e) {
2212
+ if ("function" != typeof WeakMap)
2213
2213
  return null;
2214
- var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
2215
- var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
2216
- return (_getRequireWildcardCache = function(nodeInterop2) {
2217
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
2218
- })(nodeInterop);
2219
- }
2220
- function _interopRequireWildcard(obj, nodeInterop) {
2221
- if (!nodeInterop && obj && obj.__esModule) {
2222
- return obj;
2223
- }
2224
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
2225
- return { default: obj };
2226
- }
2227
- var cache = _getRequireWildcardCache(nodeInterop);
2228
- if (cache && cache.has(obj)) {
2229
- return cache.get(obj);
2230
- }
2231
- var newObj = {};
2232
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
2233
- for (var key in obj) {
2234
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
2235
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
2236
- if (desc && (desc.get || desc.set)) {
2237
- Object.defineProperty(newObj, key, desc);
2238
- } else {
2239
- newObj[key] = obj[key];
2240
- }
2241
- }
2242
- }
2243
- newObj.default = obj;
2244
- if (cache) {
2245
- cache.set(obj, newObj);
2246
- }
2247
- return newObj;
2214
+ var r = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
2215
+ return (_getRequireWildcardCache = function(e2) {
2216
+ return e2 ? t : r;
2217
+ })(e);
2218
+ }
2219
+ function _interopRequireWildcard(e, r) {
2220
+ if (!r && e && e.__esModule)
2221
+ return e;
2222
+ if (null === e || "object" != typeof e && "function" != typeof e)
2223
+ return { default: e };
2224
+ var t = _getRequireWildcardCache(r);
2225
+ if (t && t.has(e))
2226
+ return t.get(e);
2227
+ var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor;
2228
+ for (var u in e)
2229
+ if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {
2230
+ var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
2231
+ i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
2232
+ }
2233
+ return n.default = e, t && t.set(e, n), n;
2248
2234
  }
2249
2235
  var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
2250
2236
  function getDefs(chalk2) {
@@ -2340,9 +2326,9 @@ var require_lib2 = __commonJS({
2340
2326
  }
2341
2327
  });
2342
2328
 
2343
- // node_modules/.pnpm/@babel+code-frame@7.22.13/node_modules/@babel/code-frame/lib/index.js
2329
+ // node_modules/.pnpm/@babel+code-frame@7.23.5/node_modules/@babel/code-frame/lib/index.js
2344
2330
  var require_lib3 = __commonJS({
2345
- "node_modules/.pnpm/@babel+code-frame@7.22.13/node_modules/@babel/code-frame/lib/index.js"(exports) {
2331
+ "node_modules/.pnpm/@babel+code-frame@7.23.5/node_modules/@babel/code-frame/lib/index.js"(exports) {
2346
2332
  "use strict";
2347
2333
  Object.defineProperty(exports, "__esModule", {
2348
2334
  value: true
@@ -2351,43 +2337,29 @@ var require_lib3 = __commonJS({
2351
2337
  exports.default = _default;
2352
2338
  var _highlight = require_lib2();
2353
2339
  var _chalk = _interopRequireWildcard(require_chalk(), true);
2354
- function _getRequireWildcardCache(nodeInterop) {
2355
- if (typeof WeakMap !== "function")
2340
+ function _getRequireWildcardCache(e) {
2341
+ if ("function" != typeof WeakMap)
2356
2342
  return null;
2357
- var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
2358
- var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
2359
- return (_getRequireWildcardCache = function(nodeInterop2) {
2360
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
2361
- })(nodeInterop);
2362
- }
2363
- function _interopRequireWildcard(obj, nodeInterop) {
2364
- if (!nodeInterop && obj && obj.__esModule) {
2365
- return obj;
2366
- }
2367
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
2368
- return { default: obj };
2369
- }
2370
- var cache = _getRequireWildcardCache(nodeInterop);
2371
- if (cache && cache.has(obj)) {
2372
- return cache.get(obj);
2373
- }
2374
- var newObj = {};
2375
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
2376
- for (var key in obj) {
2377
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
2378
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
2379
- if (desc && (desc.get || desc.set)) {
2380
- Object.defineProperty(newObj, key, desc);
2381
- } else {
2382
- newObj[key] = obj[key];
2383
- }
2384
- }
2385
- }
2386
- newObj.default = obj;
2387
- if (cache) {
2388
- cache.set(obj, newObj);
2389
- }
2390
- return newObj;
2343
+ var r = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
2344
+ return (_getRequireWildcardCache = function(e2) {
2345
+ return e2 ? t : r;
2346
+ })(e);
2347
+ }
2348
+ function _interopRequireWildcard(e, r) {
2349
+ if (!r && e && e.__esModule)
2350
+ return e;
2351
+ if (null === e || "object" != typeof e && "function" != typeof e)
2352
+ return { default: e };
2353
+ var t = _getRequireWildcardCache(r);
2354
+ if (t && t.has(e))
2355
+ return t.get(e);
2356
+ var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor;
2357
+ for (var u in e)
2358
+ if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {
2359
+ var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
2360
+ i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
2361
+ }
2362
+ return n.default = e, t && t.set(e, n), n;
2391
2363
  }
2392
2364
  var chalkWithForcedColor = void 0;
2393
2365
  function getChalk(forceColor) {
@@ -44259,1928 +44231,443 @@ var require_get_task_options = __commonJS({
44259
44231
  function parseTaskInfo(taskName, context) {
44260
44232
  const target = context.taskGraph.tasks[taskName].target;
44261
44233
  const projectNode = context.projectGraph.nodes[target.project];
44262
- const targetConfig = projectNode.data.targets?.[target.target];
44263
- const { sourceRoot, root } = projectNode.data;
44264
- const taskOptions = {
44265
- ...targetConfig.options,
44266
- ...target.configuration ? targetConfig.configurations?.[target.configuration] : {}
44267
- };
44268
- return { taskOptions, root, sourceRoot, projectNode, target };
44269
- }
44270
- }
44271
- });
44272
-
44273
- // node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/get-tsconfig.js
44274
- var require_get_tsconfig = __commonJS({
44275
- "node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/get-tsconfig.js"(exports) {
44276
- "use strict";
44277
- Object.defineProperty(exports, "__esModule", { value: true });
44278
- exports.getProcessedTaskTsConfigs = void 0;
44279
- var devkit_1 = require_devkit();
44280
- var path_1 = require("path");
44281
- var get_task_options_1 = require_get_task_options();
44282
- function getProcessedTaskTsConfigs(tasks, tasksOptions, context) {
44283
- const taskInMemoryTsConfigMap = {};
44284
- for (const task of tasks) {
44285
- generateTaskProjectTsConfig(task, tasksOptions, context, taskInMemoryTsConfigMap);
44286
- }
44287
- return taskInMemoryTsConfigMap;
44288
- }
44289
- exports.getProcessedTaskTsConfigs = getProcessedTaskTsConfigs;
44290
- var projectTsConfigCache = /* @__PURE__ */ new Map();
44291
- function generateTaskProjectTsConfig(task, tasksOptions, context, taskInMemoryTsConfigMap) {
44292
- const { project } = (0, devkit_1.parseTargetString)(task, context);
44293
- if (projectTsConfigCache.has(project)) {
44294
- const { tsConfig, tsConfigPath: tsConfigPath2 } = projectTsConfigCache.get(project);
44295
- taskInMemoryTsConfigMap[task] = tsConfig;
44296
- return tsConfigPath2;
44297
- }
44298
- const tasksInProject = [
44299
- task,
44300
- ...getDependencyTasksInSameProject(task, context)
44301
- ];
44302
- const taskWithTscExecutor = tasksInProject.find((t) => hasTscExecutor(t, context));
44303
- if (!taskWithTscExecutor) {
44304
- throw new Error((0, devkit_1.stripIndents)`The "@nx/js:tsc" batch executor requires all dependencies to use the "@nx/js:tsc" executor.
44305
- None of the following tasks in the "${project}" project use the "@nx/js:tsc" executor:
44306
- ${tasksInProject.map((t) => `- ${t}`).join("\n")}`);
44307
- }
44308
- const projectReferences = [];
44309
- for (const task2 of tasksInProject) {
44310
- for (const depTask of getDependencyTasksInOtherProjects(task2, project, context)) {
44311
- const tsConfigPath2 = generateTaskProjectTsConfig(depTask, tasksOptions, context, taskInMemoryTsConfigMap);
44312
- projectReferences.push(tsConfigPath2);
44313
- }
44314
- }
44315
- const taskOptions = tasksOptions[taskWithTscExecutor] ?? (0, get_task_options_1.getTaskOptions)(taskWithTscExecutor, context);
44316
- const tsConfigPath = taskOptions.tsConfig;
44317
- taskInMemoryTsConfigMap[taskWithTscExecutor] = getInMemoryTsConfig(tsConfigPath, taskOptions, projectReferences);
44318
- projectTsConfigCache.set(project, {
44319
- tsConfigPath,
44320
- tsConfig: taskInMemoryTsConfigMap[taskWithTscExecutor]
44321
- });
44322
- return tsConfigPath;
44323
- }
44324
- function getDependencyTasksInOtherProjects(task, project, context) {
44325
- return context.taskGraph.dependencies[task].filter((t) => t !== task && (0, devkit_1.parseTargetString)(t, context).project !== project);
44326
- }
44327
- function getDependencyTasksInSameProject(task, context) {
44328
- const { project: taskProject } = (0, devkit_1.parseTargetString)(task, context);
44329
- return Object.keys(context.taskGraph.tasks).filter((t) => t !== task && (0, devkit_1.parseTargetString)(t, context).project === taskProject);
44330
- }
44331
- function getInMemoryTsConfig(tsConfig, taskOptions, projectReferences) {
44332
- const originalTsConfig = (0, devkit_1.readJsonFile)(tsConfig, {
44333
- allowTrailingComma: true,
44334
- disallowComments: false
44335
- });
44336
- const allProjectReferences = Array.from(new Set((originalTsConfig.references ?? []).map((r) => r.path).concat(projectReferences)));
44337
- return {
44338
- content: JSON.stringify({
44339
- ...originalTsConfig,
44340
- compilerOptions: {
44341
- ...originalTsConfig.compilerOptions,
44342
- rootDir: taskOptions.rootDir,
44343
- outDir: taskOptions.outputPath,
44344
- composite: true,
44345
- declaration: true,
44346
- declarationMap: true,
44347
- tsBuildInfoFile: (0, path_1.join)(taskOptions.outputPath, "tsconfig.tsbuildinfo")
44348
- },
44349
- references: allProjectReferences.map((pr) => ({ path: pr }))
44350
- }),
44351
- path: tsConfig.replace(/\\/g, "/")
44352
- };
44353
- }
44354
- function hasTscExecutor(task, context) {
44355
- const { project, target } = (0, devkit_1.parseTargetString)(task, context);
44356
- return context.projectGraph.nodes[project].data.targets[target].executor === "@nx/js:tsc";
44357
- }
44358
- }
44359
- });
44360
-
44361
- // node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/typescript-diagnostic-reporters.js
44362
- var require_typescript_diagnostic_reporters = __commonJS({
44363
- "node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/typescript-diagnostic-reporters.js"(exports) {
44364
- "use strict";
44365
- Object.defineProperty(exports, "__esModule", { value: true });
44366
- exports.formatSolutionBuilderStatusReport = exports.formatDiagnosticReport = void 0;
44367
- var ts2 = require("typescript");
44368
- function formatDiagnosticReport(diagnostic, host) {
44369
- const diagnostics = new Array(1);
44370
- diagnostics[0] = diagnostic;
44371
- const formattedDiagnostic = "\n" + ts2.formatDiagnosticsWithColorAndContext(diagnostics, host) + host.getNewLine();
44372
- diagnostics[0] = void 0;
44373
- return formattedDiagnostic;
44374
- }
44375
- exports.formatDiagnosticReport = formatDiagnosticReport;
44376
- function formatSolutionBuilderStatusReport(diagnostic) {
44377
- let formattedDiagnostic = `[${formatColorAndReset(getLocaleTimeString(), ForegroundColorEscapeSequences.Grey)}] `;
44378
- formattedDiagnostic += `${ts2.flattenDiagnosticMessageText(diagnostic.messageText, ts2.sys.newLine)}${ts2.sys.newLine + ts2.sys.newLine}`;
44379
- return formattedDiagnostic;
44380
- }
44381
- exports.formatSolutionBuilderStatusReport = formatSolutionBuilderStatusReport;
44382
- function formatColorAndReset(text, formatStyle) {
44383
- const resetEscapeSequence = "\x1B[0m";
44384
- return formatStyle + text + resetEscapeSequence;
44385
- }
44386
- function getLocaleTimeString() {
44387
- return (/* @__PURE__ */ new Date()).toLocaleTimeString();
44388
- }
44389
- var ForegroundColorEscapeSequences;
44390
- (function(ForegroundColorEscapeSequences2) {
44391
- ForegroundColorEscapeSequences2["Grey"] = "\x1B[90m";
44392
- ForegroundColorEscapeSequences2["Red"] = "\x1B[91m";
44393
- ForegroundColorEscapeSequences2["Yellow"] = "\x1B[93m";
44394
- ForegroundColorEscapeSequences2["Blue"] = "\x1B[94m";
44395
- ForegroundColorEscapeSequences2["Cyan"] = "\x1B[96m";
44396
- })(ForegroundColorEscapeSequences || (ForegroundColorEscapeSequences = {}));
44397
- }
44398
- });
44399
-
44400
- // node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/typescript-compilation.js
44401
- var require_typescript_compilation = __commonJS({
44402
- "node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/typescript-compilation.js"(exports) {
44403
- "use strict";
44404
- Object.defineProperty(exports, "__esModule", { value: true });
44405
- exports.compileTypescriptSolution = void 0;
44406
- var async_iterable_1 = require_async_iterable();
44407
- var ts2 = require("typescript");
44408
- var get_custom_transformers_factory_1 = require_get_custom_transformers_factory();
44409
- var typescript_diagnostic_reporters_1 = require_typescript_diagnostic_reporters();
44410
- var TYPESCRIPT_CANNOT_READ_FILE = 5083;
44411
- var TYPESCRIPT_FILE_CHANGE_DETECTED_STARTING_INCREMENTAL_COMPILATION = 6032;
44412
- function compileTypescriptSolution(context, watch, logger, hooks, reporters) {
44413
- if (watch) {
44414
- return (0, async_iterable_1.createAsyncIterable)(async ({ next }) => {
44415
- hooks ??= {};
44416
- const callerAfterProjectCompilationCallback = hooks.afterProjectCompilationCallback;
44417
- hooks.afterProjectCompilationCallback = (tsConfig, success) => {
44418
- callerAfterProjectCompilationCallback?.(tsConfig, success);
44419
- next({ tsConfig, success });
44420
- };
44421
- compileTSWithWatch(context, logger, hooks, reporters);
44422
- });
44423
- }
44424
- const compilationGenerator = compileTS(context, logger, hooks, reporters);
44425
- return {
44426
- [Symbol.asyncIterator]() {
44427
- return {
44428
- next() {
44429
- return Promise.resolve(compilationGenerator.next());
44430
- }
44431
- };
44432
- }
44433
- };
44434
- }
44435
- exports.compileTypescriptSolution = compileTypescriptSolution;
44436
- function* compileTS(context, logger, hooks, reporters) {
44437
- let project;
44438
- const formatDiagnosticsHost = {
44439
- getCurrentDirectory: () => ts2.sys.getCurrentDirectory(),
44440
- getNewLine: () => ts2.sys.newLine,
44441
- getCanonicalFileName: (filename) => ts2.sys.useCaseSensitiveFileNames ? filename : filename.toLowerCase()
44442
- };
44443
- const solutionBuilderHost = ts2.createSolutionBuilderHost(
44444
- getSystem(context),
44445
- /*createProgram*/
44446
- void 0,
44447
- (diagnostic) => {
44448
- const formattedDiagnostic = (0, typescript_diagnostic_reporters_1.formatDiagnosticReport)(diagnostic, formatDiagnosticsHost);
44449
- if (diagnostic.code === TYPESCRIPT_CANNOT_READ_FILE) {
44450
- throw new Error(formattedDiagnostic);
44451
- }
44452
- logger.info(formattedDiagnostic, project.project);
44453
- reporters?.diagnosticReporter?.(project.project, diagnostic);
44454
- },
44455
- (diagnostic) => {
44456
- const formattedDiagnostic = (0, typescript_diagnostic_reporters_1.formatSolutionBuilderStatusReport)(diagnostic);
44457
- logger.info(formattedDiagnostic, project.project);
44458
- reporters?.solutionBuilderStatusReporter?.(project.project, diagnostic);
44459
- }
44460
- );
44461
- const rootNames = Object.keys(context);
44462
- const solutionBuilder = ts2.createSolutionBuilder(solutionBuilderHost, rootNames, {});
44463
- while (true) {
44464
- project = solutionBuilder.getNextInvalidatedProject();
44465
- if (!project) {
44466
- break;
44467
- }
44468
- const projectContext = context[project.project];
44469
- const projectName = projectContext?.project;
44470
- if (project.kind === ts2.InvalidatedProjectKind.UpdateBundle) {
44471
- logger.warn(`The project ${projectName} is using the deprecated "prepend" Typescript compiler option. This option is not supported by the batch executor and it's ignored.
44472
- `, project.project);
44473
- continue;
44474
- }
44475
- hooks?.beforeProjectCompilationCallback?.(project.project);
44476
- if (project.kind === ts2.InvalidatedProjectKind.UpdateOutputFileStamps) {
44477
- logger.info(`Updating output timestamps of project "${projectName}"...
44478
- `, project.project);
44479
- const status2 = project.done();
44480
- const success2 = status2 === ts2.ExitStatus.Success;
44481
- if (success2) {
44482
- logger.info(`Done updating output timestamps of project "${projectName}"...
44483
- `, project.project);
44484
- }
44485
- hooks?.afterProjectCompilationCallback?.(project.project, success2);
44486
- yield { success: success2, tsConfig: project.project };
44487
- continue;
44488
- }
44489
- logger.info(`Compiling TypeScript files for project "${projectName}"...
44490
- `, project.project);
44491
- const status = project.done(void 0, void 0, (0, get_custom_transformers_factory_1.getCustomTrasformersFactory)(projectContext.transformers)(project.getProgram()));
44492
- const success = status === ts2.ExitStatus.Success;
44493
- if (success) {
44494
- logger.info(`Done compiling TypeScript files for project "${projectName}".
44495
- `, project.project);
44496
- }
44497
- hooks?.afterProjectCompilationCallback?.(project.project, success);
44498
- yield {
44499
- success: status === ts2.ExitStatus.Success,
44500
- tsConfig: project.project
44501
- };
44502
- }
44503
- }
44504
- function compileTSWithWatch(context, logger, hooks, reporters) {
44505
- let project;
44506
- const solutionHost = ts2.createSolutionBuilderWithWatchHost(
44507
- getSystem(context),
44508
- /*createProgram*/
44509
- void 0
44510
- );
44511
- if (reporters?.diagnosticReporter) {
44512
- const originalDiagnosticReporter = solutionHost.reportDiagnostic;
44513
- solutionHost.reportDiagnostic = (diagnostic) => {
44514
- originalDiagnosticReporter(diagnostic);
44515
- reporters.diagnosticReporter(project.project, diagnostic);
44516
- };
44517
- }
44518
- if (reporters?.solutionBuilderStatusReporter) {
44519
- const originalSolutionBuilderStatusReporter = solutionHost.reportSolutionBuilderStatus;
44520
- solutionHost.reportDiagnostic = (diagnostic) => {
44521
- originalSolutionBuilderStatusReporter(diagnostic);
44522
- reporters.solutionBuilderStatusReporter(project.project, diagnostic);
44523
- };
44524
- }
44525
- const originalWatchStatusReporter = solutionHost.onWatchStatusChange;
44526
- solutionHost.onWatchStatusChange = (diagnostic, newLine, options, errorCount) => {
44527
- originalWatchStatusReporter(diagnostic, newLine, options, errorCount);
44528
- if (diagnostic.code === TYPESCRIPT_FILE_CHANGE_DETECTED_STARTING_INCREMENTAL_COMPILATION) {
44529
- build2();
44530
- }
44531
- reporters?.watchStatusReporter?.(project?.project, diagnostic, newLine, options, errorCount);
44532
- };
44533
- const rootNames = Object.keys(context);
44534
- const solutionBuilder = ts2.createSolutionBuilderWithWatch(solutionHost, rootNames, {});
44535
- const build2 = () => {
44536
- while (true) {
44537
- project = solutionBuilder.getNextInvalidatedProject();
44538
- if (!project) {
44539
- break;
44540
- }
44541
- const projectContext = context[project.project];
44542
- const projectName = projectContext.project;
44543
- if (project.kind === ts2.InvalidatedProjectKind.UpdateBundle) {
44544
- logger.warn(`The project ${projectName} is using the deprecated "prepend" Typescript compiler option. This option is not supported by the batch executor and it's ignored.`);
44545
- continue;
44546
- }
44547
- hooks?.beforeProjectCompilationCallback(project.project);
44548
- if (project.kind === ts2.InvalidatedProjectKind.UpdateOutputFileStamps) {
44549
- if (projectName) {
44550
- logger.info(`Updating output timestamps of project "${projectName}"...
44551
- `, project.project);
44552
- }
44553
- const status2 = project.done();
44554
- const success2 = status2 === ts2.ExitStatus.Success;
44555
- if (projectName && success2) {
44556
- logger.info(`Done updating output timestamps of project "${projectName}"...
44557
- `, project.project);
44558
- }
44559
- hooks?.afterProjectCompilationCallback?.(project.project, success2);
44560
- continue;
44561
- }
44562
- logger.info(`Compiling TypeScript files for project "${projectName}"...
44563
- `, project.project);
44564
- const status = project.done(void 0, void 0, (0, get_custom_transformers_factory_1.getCustomTrasformersFactory)(projectContext.transformers)(project.getProgram()));
44565
- const success = status === ts2.ExitStatus.Success;
44566
- if (success) {
44567
- logger.info(`Done compiling TypeScript files for project "${projectName}".
44568
- `, project.project);
44569
- }
44570
- hooks?.afterProjectCompilationCallback?.(project.project, success);
44571
- }
44572
- };
44573
- build2();
44574
- solutionBuilder.build();
44575
- }
44576
- function getSystem(context) {
44577
- return {
44578
- ...ts2.sys,
44579
- readFile(path2, encoding) {
44580
- if (context[path2]) {
44581
- return context[path2].tsConfig.content;
44582
- }
44583
- return ts2.sys.readFile(path2, encoding);
44584
- }
44585
- };
44586
- }
44587
- }
44588
- });
44589
-
44590
- // node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/index.js
44591
- var require_lib5 = __commonJS({
44592
- "node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/index.js"(exports) {
44593
- "use strict";
44594
- Object.defineProperty(exports, "__esModule", { value: true });
44595
- var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
44596
- tslib_1.__exportStar(require_get_custom_transformers_factory(), exports);
44597
- tslib_1.__exportStar(require_get_tsconfig(), exports);
44598
- tslib_1.__exportStar(require_normalize_options(), exports);
44599
- tslib_1.__exportStar(require_typescript_compilation(), exports);
44600
- }
44601
- });
44602
-
44603
- // node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/tsc.impl.js
44604
- var require_tsc_impl = __commonJS({
44605
- "node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/tsc.impl.js"(exports) {
44606
- "use strict";
44607
- Object.defineProperty(exports, "__esModule", { value: true });
44608
- exports.tscExecutor = exports.createTypeScriptCompilationOptions = exports.determineModuleFormatFromTsConfig = void 0;
44609
- var ts2 = require("typescript");
44610
- var copy_assets_handler_1 = require_copy_assets_handler();
44611
- var check_dependencies_1 = require_check_dependencies();
44612
- var compiler_helper_dependency_1 = require_compiler_helper_dependency();
44613
- var inline_1 = require_inline();
44614
- var update_package_json_1 = require_update_package_json();
44615
- var compile_typescript_files_1 = require_compile_typescript_files();
44616
- var watch_for_single_file_changes_1 = require_watch_for_single_file_changes();
44617
- var lib_1 = require_lib5();
44618
- var ts_config_1 = require_ts_config();
44619
- var create_entry_points_1 = require_create_entry_points();
44620
- function determineModuleFormatFromTsConfig(absolutePathToTsConfig) {
44621
- const tsConfig = (0, ts_config_1.readTsConfig)(absolutePathToTsConfig);
44622
- if (tsConfig.options.module === ts2.ModuleKind.ES2015 || tsConfig.options.module === ts2.ModuleKind.ES2020 || tsConfig.options.module === ts2.ModuleKind.ES2022 || tsConfig.options.module === ts2.ModuleKind.ESNext) {
44623
- return "esm";
44624
- } else {
44625
- return "cjs";
44626
- }
44627
- }
44628
- exports.determineModuleFormatFromTsConfig = determineModuleFormatFromTsConfig;
44629
- function createTypeScriptCompilationOptions2(normalizedOptions, context) {
44630
- return {
44631
- outputPath: normalizedOptions.outputPath,
44632
- projectName: context.projectName,
44633
- projectRoot: normalizedOptions.projectRoot,
44634
- rootDir: normalizedOptions.rootDir,
44635
- tsConfig: normalizedOptions.tsConfig,
44636
- watch: normalizedOptions.watch,
44637
- deleteOutputPath: normalizedOptions.clean,
44638
- getCustomTransformers: (0, lib_1.getCustomTrasformersFactory)(normalizedOptions.transformers)
44639
- };
44640
- }
44641
- exports.createTypeScriptCompilationOptions = createTypeScriptCompilationOptions2;
44642
- async function* tscExecutor(_options, context) {
44643
- const { sourceRoot, root } = context.projectsConfigurations.projects[context.projectName];
44644
- const options = (0, lib_1.normalizeOptions)(_options, context.root, sourceRoot, root);
44645
- const { projectRoot, tmpTsConfig, target, dependencies } = (0, check_dependencies_1.checkDependencies)(context, options.tsConfig);
44646
- if (tmpTsConfig) {
44647
- options.tsConfig = tmpTsConfig;
44648
- }
44649
- const tsLibDependency = (0, compiler_helper_dependency_1.getHelperDependency)(compiler_helper_dependency_1.HelperDependency.tsc, options.tsConfig, dependencies, context.projectGraph);
44650
- if (tsLibDependency) {
44651
- dependencies.push(tsLibDependency);
44652
- }
44653
- const assetHandler = new copy_assets_handler_1.CopyAssetsHandler({
44654
- projectDir: projectRoot,
44655
- rootDir: context.root,
44656
- outputDir: _options.outputPath,
44657
- assets: _options.assets
44658
- });
44659
- const tsCompilationOptions = createTypeScriptCompilationOptions2(options, context);
44660
- const inlineProjectGraph = (0, inline_1.handleInliningBuild)(context, options, tsCompilationOptions.tsConfig);
44661
- if (!(0, inline_1.isInlineGraphEmpty)(inlineProjectGraph)) {
44662
- tsCompilationOptions.rootDir = ".";
44663
- }
44664
- const typescriptCompilation = (0, compile_typescript_files_1.compileTypeScriptFiles)(options, tsCompilationOptions, async () => {
44665
- await assetHandler.processAllAssetsOnce();
44666
- (0, update_package_json_1.updatePackageJson)({
44667
- ...options,
44668
- additionalEntryPoints: (0, create_entry_points_1.createEntryPoints)(options.additionalEntryPoints, context.root),
44669
- format: [determineModuleFormatFromTsConfig(options.tsConfig)],
44670
- // As long as d.ts files match their .js counterparts, we don't need to emit them.
44671
- // TSC can match them correctly based on file names.
44672
- skipTypings: true
44673
- }, context, target, dependencies);
44674
- (0, inline_1.postProcessInlinedDependencies)(tsCompilationOptions.outputPath, tsCompilationOptions.projectRoot, inlineProjectGraph);
44675
- });
44676
- if (options.watch) {
44677
- const disposeWatchAssetChanges = await assetHandler.watchAndProcessOnAssetChange();
44678
- const disposePackageJsonChanges = await (0, watch_for_single_file_changes_1.watchForSingleFileChanges)(context.projectName, options.projectRoot, "package.json", () => (0, update_package_json_1.updatePackageJson)({
44679
- ...options,
44680
- additionalEntryPoints: (0, create_entry_points_1.createEntryPoints)(options.additionalEntryPoints, context.root),
44681
- // As long as d.ts files match their .js counterparts, we don't need to emit them.
44682
- // TSC can match them correctly based on file names.
44683
- skipTypings: true,
44684
- format: [determineModuleFormatFromTsConfig(options.tsConfig)]
44685
- }, context, target, dependencies));
44686
- const handleTermination = async (exitCode) => {
44687
- await typescriptCompilation.close();
44688
- disposeWatchAssetChanges();
44689
- disposePackageJsonChanges();
44690
- process.exit(exitCode);
44691
- };
44692
- process.on("SIGINT", () => handleTermination(128 + 2));
44693
- process.on("SIGTERM", () => handleTermination(128 + 15));
44694
- }
44695
- return yield* typescriptCompilation.iterator;
44696
- }
44697
- exports.tscExecutor = tscExecutor;
44698
- exports.default = tscExecutor;
44699
- }
44700
- });
44701
-
44702
- // node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js
44703
- var require_universalify2 = __commonJS({
44704
- "node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js"(exports) {
44705
- "use strict";
44706
- exports.fromCallback = function(fn) {
44707
- return Object.defineProperty(function(...args) {
44708
- if (typeof args[args.length - 1] === "function")
44709
- fn.apply(this, args);
44710
- else {
44711
- return new Promise((resolve, reject) => {
44712
- fn.call(
44713
- this,
44714
- ...args,
44715
- (err, res) => err != null ? reject(err) : resolve(res)
44716
- );
44717
- });
44718
- }
44719
- }, "name", { value: fn.name });
44720
- };
44721
- exports.fromPromise = function(fn) {
44722
- return Object.defineProperty(function(...args) {
44723
- const cb = args[args.length - 1];
44724
- if (typeof cb !== "function")
44725
- return fn.apply(this, args);
44726
- else
44727
- fn.apply(this, args.slice(0, -1)).then((r) => cb(null, r), cb);
44728
- }, "name", { value: fn.name });
44729
- };
44730
- }
44731
- });
44732
-
44733
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/fs/index.js
44734
- var require_fs7 = __commonJS({
44735
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/fs/index.js"(exports) {
44736
- "use strict";
44737
- var u = require_universalify2().fromCallback;
44738
- var fs = require_graceful_fs();
44739
- var api = [
44740
- "access",
44741
- "appendFile",
44742
- "chmod",
44743
- "chown",
44744
- "close",
44745
- "copyFile",
44746
- "fchmod",
44747
- "fchown",
44748
- "fdatasync",
44749
- "fstat",
44750
- "fsync",
44751
- "ftruncate",
44752
- "futimes",
44753
- "lchmod",
44754
- "lchown",
44755
- "link",
44756
- "lstat",
44757
- "mkdir",
44758
- "mkdtemp",
44759
- "open",
44760
- "opendir",
44761
- "readdir",
44762
- "readFile",
44763
- "readlink",
44764
- "realpath",
44765
- "rename",
44766
- "rm",
44767
- "rmdir",
44768
- "stat",
44769
- "symlink",
44770
- "truncate",
44771
- "unlink",
44772
- "utimes",
44773
- "writeFile"
44774
- ].filter((key) => {
44775
- return typeof fs[key] === "function";
44776
- });
44777
- Object.assign(exports, fs);
44778
- api.forEach((method) => {
44779
- exports[method] = u(fs[method]);
44780
- });
44781
- exports.exists = function(filename, callback) {
44782
- if (typeof callback === "function") {
44783
- return fs.exists(filename, callback);
44784
- }
44785
- return new Promise((resolve) => {
44786
- return fs.exists(filename, resolve);
44787
- });
44788
- };
44789
- exports.read = function(fd, buffer, offset, length, position, callback) {
44790
- if (typeof callback === "function") {
44791
- return fs.read(fd, buffer, offset, length, position, callback);
44792
- }
44793
- return new Promise((resolve, reject) => {
44794
- fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
44795
- if (err)
44796
- return reject(err);
44797
- resolve({ bytesRead, buffer: buffer2 });
44798
- });
44799
- });
44800
- };
44801
- exports.write = function(fd, buffer, ...args) {
44802
- if (typeof args[args.length - 1] === "function") {
44803
- return fs.write(fd, buffer, ...args);
44804
- }
44805
- return new Promise((resolve, reject) => {
44806
- fs.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
44807
- if (err)
44808
- return reject(err);
44809
- resolve({ bytesWritten, buffer: buffer2 });
44810
- });
44811
- });
44812
- };
44813
- exports.readv = function(fd, buffers, ...args) {
44814
- if (typeof args[args.length - 1] === "function") {
44815
- return fs.readv(fd, buffers, ...args);
44816
- }
44817
- return new Promise((resolve, reject) => {
44818
- fs.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
44819
- if (err)
44820
- return reject(err);
44821
- resolve({ bytesRead, buffers: buffers2 });
44822
- });
44823
- });
44824
- };
44825
- exports.writev = function(fd, buffers, ...args) {
44826
- if (typeof args[args.length - 1] === "function") {
44827
- return fs.writev(fd, buffers, ...args);
44828
- }
44829
- return new Promise((resolve, reject) => {
44830
- fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
44831
- if (err)
44832
- return reject(err);
44833
- resolve({ bytesWritten, buffers: buffers2 });
44834
- });
44835
- });
44836
- };
44837
- if (typeof fs.realpath.native === "function") {
44838
- exports.realpath.native = u(fs.realpath.native);
44839
- } else {
44840
- process.emitWarning(
44841
- "fs.realpath.native is not a function. Is fs being monkey-patched?",
44842
- "Warning",
44843
- "fs-extra-WARN0003"
44844
- );
44845
- }
44846
- }
44847
- });
44848
-
44849
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/utils.js
44850
- var require_utils9 = __commonJS({
44851
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module2) {
44852
- "use strict";
44853
- var path2 = require("path");
44854
- module2.exports.checkPath = function checkPath(pth) {
44855
- if (process.platform === "win32") {
44856
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path2.parse(pth).root, ""));
44857
- if (pathHasInvalidWinCharacters) {
44858
- const error = new Error(`Path contains invalid characters: ${pth}`);
44859
- error.code = "EINVAL";
44860
- throw error;
44861
- }
44862
- }
44863
- };
44864
- }
44865
- });
44866
-
44867
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/make-dir.js
44868
- var require_make_dir2 = __commonJS({
44869
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module2) {
44870
- "use strict";
44871
- var fs = require_fs7();
44872
- var { checkPath } = require_utils9();
44873
- var getMode = (options) => {
44874
- const defaults2 = { mode: 511 };
44875
- if (typeof options === "number")
44876
- return options;
44877
- return { ...defaults2, ...options }.mode;
44878
- };
44879
- module2.exports.makeDir = async (dir, options) => {
44880
- checkPath(dir);
44881
- return fs.mkdir(dir, {
44882
- mode: getMode(options),
44883
- recursive: true
44884
- });
44885
- };
44886
- module2.exports.makeDirSync = (dir, options) => {
44887
- checkPath(dir);
44888
- return fs.mkdirSync(dir, {
44889
- mode: getMode(options),
44890
- recursive: true
44891
- });
44892
- };
44893
- }
44894
- });
44895
-
44896
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/index.js
44897
- var require_mkdirs2 = __commonJS({
44898
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module2) {
44899
- "use strict";
44900
- var u = require_universalify2().fromPromise;
44901
- var { makeDir: _makeDir, makeDirSync } = require_make_dir2();
44902
- var makeDir = u(_makeDir);
44903
- module2.exports = {
44904
- mkdirs: makeDir,
44905
- mkdirsSync: makeDirSync,
44906
- // alias
44907
- mkdirp: makeDir,
44908
- mkdirpSync: makeDirSync,
44909
- ensureDir: makeDir,
44910
- ensureDirSync: makeDirSync
44911
- };
44912
- }
44913
- });
44914
-
44915
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/path-exists/index.js
44916
- var require_path_exists2 = __commonJS({
44917
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/path-exists/index.js"(exports, module2) {
44918
- "use strict";
44919
- var u = require_universalify2().fromPromise;
44920
- var fs = require_fs7();
44921
- function pathExists(path2) {
44922
- return fs.access(path2).then(() => true).catch(() => false);
44923
- }
44924
- module2.exports = {
44925
- pathExists: u(pathExists),
44926
- pathExistsSync: fs.existsSync
44927
- };
44928
- }
44929
- });
44930
-
44931
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/utimes.js
44932
- var require_utimes2 = __commonJS({
44933
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/utimes.js"(exports, module2) {
44934
- "use strict";
44935
- var fs = require_graceful_fs();
44936
- function utimesMillis(path2, atime, mtime, callback) {
44937
- fs.open(path2, "r+", (err, fd) => {
44938
- if (err)
44939
- return callback(err);
44940
- fs.futimes(fd, atime, mtime, (futimesErr) => {
44941
- fs.close(fd, (closeErr) => {
44942
- if (callback)
44943
- callback(futimesErr || closeErr);
44944
- });
44945
- });
44946
- });
44947
- }
44948
- function utimesMillisSync(path2, atime, mtime) {
44949
- const fd = fs.openSync(path2, "r+");
44950
- fs.futimesSync(fd, atime, mtime);
44951
- return fs.closeSync(fd);
44952
- }
44953
- module2.exports = {
44954
- utimesMillis,
44955
- utimesMillisSync
44956
- };
44957
- }
44958
- });
44959
-
44960
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/stat.js
44961
- var require_stat2 = __commonJS({
44962
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/stat.js"(exports, module2) {
44963
- "use strict";
44964
- var fs = require_fs7();
44965
- var path2 = require("path");
44966
- var util2 = require("util");
44967
- function getStats(src, dest, opts) {
44968
- const statFunc = opts.dereference ? (file) => fs.stat(file, { bigint: true }) : (file) => fs.lstat(file, { bigint: true });
44969
- return Promise.all([
44970
- statFunc(src),
44971
- statFunc(dest).catch((err) => {
44972
- if (err.code === "ENOENT")
44973
- return null;
44974
- throw err;
44975
- })
44976
- ]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
44977
- }
44978
- function getStatsSync(src, dest, opts) {
44979
- let destStat;
44980
- const statFunc = opts.dereference ? (file) => fs.statSync(file, { bigint: true }) : (file) => fs.lstatSync(file, { bigint: true });
44981
- const srcStat = statFunc(src);
44982
- try {
44983
- destStat = statFunc(dest);
44984
- } catch (err) {
44985
- if (err.code === "ENOENT")
44986
- return { srcStat, destStat: null };
44987
- throw err;
44988
- }
44989
- return { srcStat, destStat };
44990
- }
44991
- function checkPaths(src, dest, funcName, opts, cb) {
44992
- util2.callbackify(getStats)(src, dest, opts, (err, stats) => {
44993
- if (err)
44994
- return cb(err);
44995
- const { srcStat, destStat } = stats;
44996
- if (destStat) {
44997
- if (areIdentical(srcStat, destStat)) {
44998
- const srcBaseName = path2.basename(src);
44999
- const destBaseName = path2.basename(dest);
45000
- if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
45001
- return cb(null, { srcStat, destStat, isChangingCase: true });
45002
- }
45003
- return cb(new Error("Source and destination must not be the same."));
45004
- }
45005
- if (srcStat.isDirectory() && !destStat.isDirectory()) {
45006
- return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`));
45007
- }
45008
- if (!srcStat.isDirectory() && destStat.isDirectory()) {
45009
- return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`));
45010
- }
45011
- }
45012
- if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
45013
- return cb(new Error(errMsg(src, dest, funcName)));
45014
- }
45015
- return cb(null, { srcStat, destStat });
45016
- });
45017
- }
45018
- function checkPathsSync(src, dest, funcName, opts) {
45019
- const { srcStat, destStat } = getStatsSync(src, dest, opts);
45020
- if (destStat) {
45021
- if (areIdentical(srcStat, destStat)) {
45022
- const srcBaseName = path2.basename(src);
45023
- const destBaseName = path2.basename(dest);
45024
- if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
45025
- return { srcStat, destStat, isChangingCase: true };
45026
- }
45027
- throw new Error("Source and destination must not be the same.");
45028
- }
45029
- if (srcStat.isDirectory() && !destStat.isDirectory()) {
45030
- throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
45031
- }
45032
- if (!srcStat.isDirectory() && destStat.isDirectory()) {
45033
- throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
45034
- }
45035
- }
45036
- if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
45037
- throw new Error(errMsg(src, dest, funcName));
45038
- }
45039
- return { srcStat, destStat };
45040
- }
45041
- function checkParentPaths(src, srcStat, dest, funcName, cb) {
45042
- const srcParent = path2.resolve(path2.dirname(src));
45043
- const destParent = path2.resolve(path2.dirname(dest));
45044
- if (destParent === srcParent || destParent === path2.parse(destParent).root)
45045
- return cb();
45046
- fs.stat(destParent, { bigint: true }, (err, destStat) => {
45047
- if (err) {
45048
- if (err.code === "ENOENT")
45049
- return cb();
45050
- return cb(err);
45051
- }
45052
- if (areIdentical(srcStat, destStat)) {
45053
- return cb(new Error(errMsg(src, dest, funcName)));
45054
- }
45055
- return checkParentPaths(src, srcStat, destParent, funcName, cb);
45056
- });
45057
- }
45058
- function checkParentPathsSync(src, srcStat, dest, funcName) {
45059
- const srcParent = path2.resolve(path2.dirname(src));
45060
- const destParent = path2.resolve(path2.dirname(dest));
45061
- if (destParent === srcParent || destParent === path2.parse(destParent).root)
45062
- return;
45063
- let destStat;
45064
- try {
45065
- destStat = fs.statSync(destParent, { bigint: true });
45066
- } catch (err) {
45067
- if (err.code === "ENOENT")
45068
- return;
45069
- throw err;
45070
- }
45071
- if (areIdentical(srcStat, destStat)) {
45072
- throw new Error(errMsg(src, dest, funcName));
45073
- }
45074
- return checkParentPathsSync(src, srcStat, destParent, funcName);
45075
- }
45076
- function areIdentical(srcStat, destStat) {
45077
- return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
45078
- }
45079
- function isSrcSubdir(src, dest) {
45080
- const srcArr = path2.resolve(src).split(path2.sep).filter((i) => i);
45081
- const destArr = path2.resolve(dest).split(path2.sep).filter((i) => i);
45082
- return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true);
45083
- }
45084
- function errMsg(src, dest, funcName) {
45085
- return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
45086
- }
45087
- module2.exports = {
45088
- checkPaths,
45089
- checkPathsSync,
45090
- checkParentPaths,
45091
- checkParentPathsSync,
45092
- isSrcSubdir,
45093
- areIdentical
45094
- };
45095
- }
45096
- });
45097
-
45098
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy.js
45099
- var require_copy3 = __commonJS({
45100
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy.js"(exports, module2) {
45101
- "use strict";
45102
- var fs = require_graceful_fs();
45103
- var path2 = require("path");
45104
- var mkdirs = require_mkdirs2().mkdirs;
45105
- var pathExists = require_path_exists2().pathExists;
45106
- var utimesMillis = require_utimes2().utimesMillis;
45107
- var stat = require_stat2();
45108
- function copy(src, dest, opts, cb) {
45109
- if (typeof opts === "function" && !cb) {
45110
- cb = opts;
45111
- opts = {};
45112
- } else if (typeof opts === "function") {
45113
- opts = { filter: opts };
45114
- }
45115
- cb = cb || function() {
45116
- };
45117
- opts = opts || {};
45118
- opts.clobber = "clobber" in opts ? !!opts.clobber : true;
45119
- opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
45120
- if (opts.preserveTimestamps && process.arch === "ia32") {
45121
- process.emitWarning(
45122
- "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
45123
- "Warning",
45124
- "fs-extra-WARN0001"
45125
- );
45126
- }
45127
- stat.checkPaths(src, dest, "copy", opts, (err, stats) => {
45128
- if (err)
45129
- return cb(err);
45130
- const { srcStat, destStat } = stats;
45131
- stat.checkParentPaths(src, srcStat, dest, "copy", (err2) => {
45132
- if (err2)
45133
- return cb(err2);
45134
- runFilter(src, dest, opts, (err3, include) => {
45135
- if (err3)
45136
- return cb(err3);
45137
- if (!include)
45138
- return cb();
45139
- checkParentDir(destStat, src, dest, opts, cb);
45140
- });
45141
- });
45142
- });
45143
- }
45144
- function checkParentDir(destStat, src, dest, opts, cb) {
45145
- const destParent = path2.dirname(dest);
45146
- pathExists(destParent, (err, dirExists) => {
45147
- if (err)
45148
- return cb(err);
45149
- if (dirExists)
45150
- return getStats(destStat, src, dest, opts, cb);
45151
- mkdirs(destParent, (err2) => {
45152
- if (err2)
45153
- return cb(err2);
45154
- return getStats(destStat, src, dest, opts, cb);
45155
- });
45156
- });
45157
- }
45158
- function runFilter(src, dest, opts, cb) {
45159
- if (!opts.filter)
45160
- return cb(null, true);
45161
- Promise.resolve(opts.filter(src, dest)).then((include) => cb(null, include), (error) => cb(error));
45162
- }
45163
- function getStats(destStat, src, dest, opts, cb) {
45164
- const stat2 = opts.dereference ? fs.stat : fs.lstat;
45165
- stat2(src, (err, srcStat) => {
45166
- if (err)
45167
- return cb(err);
45168
- if (srcStat.isDirectory())
45169
- return onDir(srcStat, destStat, src, dest, opts, cb);
45170
- else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
45171
- return onFile(srcStat, destStat, src, dest, opts, cb);
45172
- else if (srcStat.isSymbolicLink())
45173
- return onLink(destStat, src, dest, opts, cb);
45174
- else if (srcStat.isSocket())
45175
- return cb(new Error(`Cannot copy a socket file: ${src}`));
45176
- else if (srcStat.isFIFO())
45177
- return cb(new Error(`Cannot copy a FIFO pipe: ${src}`));
45178
- return cb(new Error(`Unknown file: ${src}`));
45179
- });
45180
- }
45181
- function onFile(srcStat, destStat, src, dest, opts, cb) {
45182
- if (!destStat)
45183
- return copyFile(srcStat, src, dest, opts, cb);
45184
- return mayCopyFile(srcStat, src, dest, opts, cb);
45185
- }
45186
- function mayCopyFile(srcStat, src, dest, opts, cb) {
45187
- if (opts.overwrite) {
45188
- fs.unlink(dest, (err) => {
45189
- if (err)
45190
- return cb(err);
45191
- return copyFile(srcStat, src, dest, opts, cb);
45192
- });
45193
- } else if (opts.errorOnExist) {
45194
- return cb(new Error(`'${dest}' already exists`));
45195
- } else
45196
- return cb();
45197
- }
45198
- function copyFile(srcStat, src, dest, opts, cb) {
45199
- fs.copyFile(src, dest, (err) => {
45200
- if (err)
45201
- return cb(err);
45202
- if (opts.preserveTimestamps)
45203
- return handleTimestampsAndMode(srcStat.mode, src, dest, cb);
45204
- return setDestMode(dest, srcStat.mode, cb);
45205
- });
45206
- }
45207
- function handleTimestampsAndMode(srcMode, src, dest, cb) {
45208
- if (fileIsNotWritable(srcMode)) {
45209
- return makeFileWritable(dest, srcMode, (err) => {
45210
- if (err)
45211
- return cb(err);
45212
- return setDestTimestampsAndMode(srcMode, src, dest, cb);
45213
- });
45214
- }
45215
- return setDestTimestampsAndMode(srcMode, src, dest, cb);
45216
- }
45217
- function fileIsNotWritable(srcMode) {
45218
- return (srcMode & 128) === 0;
45219
- }
45220
- function makeFileWritable(dest, srcMode, cb) {
45221
- return setDestMode(dest, srcMode | 128, cb);
45222
- }
45223
- function setDestTimestampsAndMode(srcMode, src, dest, cb) {
45224
- setDestTimestamps(src, dest, (err) => {
45225
- if (err)
45226
- return cb(err);
45227
- return setDestMode(dest, srcMode, cb);
45228
- });
45229
- }
45230
- function setDestMode(dest, srcMode, cb) {
45231
- return fs.chmod(dest, srcMode, cb);
45232
- }
45233
- function setDestTimestamps(src, dest, cb) {
45234
- fs.stat(src, (err, updatedSrcStat) => {
45235
- if (err)
45236
- return cb(err);
45237
- return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb);
45238
- });
45239
- }
45240
- function onDir(srcStat, destStat, src, dest, opts, cb) {
45241
- if (!destStat)
45242
- return mkDirAndCopy(srcStat.mode, src, dest, opts, cb);
45243
- return copyDir(src, dest, opts, cb);
45244
- }
45245
- function mkDirAndCopy(srcMode, src, dest, opts, cb) {
45246
- fs.mkdir(dest, (err) => {
45247
- if (err)
45248
- return cb(err);
45249
- copyDir(src, dest, opts, (err2) => {
45250
- if (err2)
45251
- return cb(err2);
45252
- return setDestMode(dest, srcMode, cb);
45253
- });
45254
- });
45255
- }
45256
- function copyDir(src, dest, opts, cb) {
45257
- fs.readdir(src, (err, items) => {
45258
- if (err)
45259
- return cb(err);
45260
- return copyDirItems(items, src, dest, opts, cb);
45261
- });
45262
- }
45263
- function copyDirItems(items, src, dest, opts, cb) {
45264
- const item = items.pop();
45265
- if (!item)
45266
- return cb();
45267
- return copyDirItem(items, item, src, dest, opts, cb);
45268
- }
45269
- function copyDirItem(items, item, src, dest, opts, cb) {
45270
- const srcItem = path2.join(src, item);
45271
- const destItem = path2.join(dest, item);
45272
- runFilter(srcItem, destItem, opts, (err, include) => {
45273
- if (err)
45274
- return cb(err);
45275
- if (!include)
45276
- return copyDirItems(items, src, dest, opts, cb);
45277
- stat.checkPaths(srcItem, destItem, "copy", opts, (err2, stats) => {
45278
- if (err2)
45279
- return cb(err2);
45280
- const { destStat } = stats;
45281
- getStats(destStat, srcItem, destItem, opts, (err3) => {
45282
- if (err3)
45283
- return cb(err3);
45284
- return copyDirItems(items, src, dest, opts, cb);
45285
- });
45286
- });
45287
- });
45288
- }
45289
- function onLink(destStat, src, dest, opts, cb) {
45290
- fs.readlink(src, (err, resolvedSrc) => {
45291
- if (err)
45292
- return cb(err);
45293
- if (opts.dereference) {
45294
- resolvedSrc = path2.resolve(process.cwd(), resolvedSrc);
45295
- }
45296
- if (!destStat) {
45297
- return fs.symlink(resolvedSrc, dest, cb);
45298
- } else {
45299
- fs.readlink(dest, (err2, resolvedDest) => {
45300
- if (err2) {
45301
- if (err2.code === "EINVAL" || err2.code === "UNKNOWN")
45302
- return fs.symlink(resolvedSrc, dest, cb);
45303
- return cb(err2);
45304
- }
45305
- if (opts.dereference) {
45306
- resolvedDest = path2.resolve(process.cwd(), resolvedDest);
45307
- }
45308
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
45309
- return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`));
45310
- }
45311
- if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
45312
- return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`));
45313
- }
45314
- return copyLink(resolvedSrc, dest, cb);
45315
- });
45316
- }
45317
- });
45318
- }
45319
- function copyLink(resolvedSrc, dest, cb) {
45320
- fs.unlink(dest, (err) => {
45321
- if (err)
45322
- return cb(err);
45323
- return fs.symlink(resolvedSrc, dest, cb);
45324
- });
45325
- }
45326
- module2.exports = copy;
45327
- }
45328
- });
45329
-
45330
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy-sync.js
45331
- var require_copy_sync2 = __commonJS({
45332
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module2) {
45333
- "use strict";
45334
- var fs = require_graceful_fs();
45335
- var path2 = require("path");
45336
- var mkdirsSync = require_mkdirs2().mkdirsSync;
45337
- var utimesMillisSync = require_utimes2().utimesMillisSync;
45338
- var stat = require_stat2();
45339
- function copySync(src, dest, opts) {
45340
- if (typeof opts === "function") {
45341
- opts = { filter: opts };
45342
- }
45343
- opts = opts || {};
45344
- opts.clobber = "clobber" in opts ? !!opts.clobber : true;
45345
- opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
45346
- if (opts.preserveTimestamps && process.arch === "ia32") {
45347
- process.emitWarning(
45348
- "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
45349
- "Warning",
45350
- "fs-extra-WARN0002"
45351
- );
45352
- }
45353
- const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
45354
- stat.checkParentPathsSync(src, srcStat, dest, "copy");
45355
- if (opts.filter && !opts.filter(src, dest))
45356
- return;
45357
- const destParent = path2.dirname(dest);
45358
- if (!fs.existsSync(destParent))
45359
- mkdirsSync(destParent);
45360
- return getStats(destStat, src, dest, opts);
45361
- }
45362
- function getStats(destStat, src, dest, opts) {
45363
- const statSync = opts.dereference ? fs.statSync : fs.lstatSync;
45364
- const srcStat = statSync(src);
45365
- if (srcStat.isDirectory())
45366
- return onDir(srcStat, destStat, src, dest, opts);
45367
- else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
45368
- return onFile(srcStat, destStat, src, dest, opts);
45369
- else if (srcStat.isSymbolicLink())
45370
- return onLink(destStat, src, dest, opts);
45371
- else if (srcStat.isSocket())
45372
- throw new Error(`Cannot copy a socket file: ${src}`);
45373
- else if (srcStat.isFIFO())
45374
- throw new Error(`Cannot copy a FIFO pipe: ${src}`);
45375
- throw new Error(`Unknown file: ${src}`);
45376
- }
45377
- function onFile(srcStat, destStat, src, dest, opts) {
45378
- if (!destStat)
45379
- return copyFile(srcStat, src, dest, opts);
45380
- return mayCopyFile(srcStat, src, dest, opts);
45381
- }
45382
- function mayCopyFile(srcStat, src, dest, opts) {
45383
- if (opts.overwrite) {
45384
- fs.unlinkSync(dest);
45385
- return copyFile(srcStat, src, dest, opts);
45386
- } else if (opts.errorOnExist) {
45387
- throw new Error(`'${dest}' already exists`);
45388
- }
45389
- }
45390
- function copyFile(srcStat, src, dest, opts) {
45391
- fs.copyFileSync(src, dest);
45392
- if (opts.preserveTimestamps)
45393
- handleTimestamps(srcStat.mode, src, dest);
45394
- return setDestMode(dest, srcStat.mode);
45395
- }
45396
- function handleTimestamps(srcMode, src, dest) {
45397
- if (fileIsNotWritable(srcMode))
45398
- makeFileWritable(dest, srcMode);
45399
- return setDestTimestamps(src, dest);
45400
- }
45401
- function fileIsNotWritable(srcMode) {
45402
- return (srcMode & 128) === 0;
45403
- }
45404
- function makeFileWritable(dest, srcMode) {
45405
- return setDestMode(dest, srcMode | 128);
45406
- }
45407
- function setDestMode(dest, srcMode) {
45408
- return fs.chmodSync(dest, srcMode);
45409
- }
45410
- function setDestTimestamps(src, dest) {
45411
- const updatedSrcStat = fs.statSync(src);
45412
- return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
45413
- }
45414
- function onDir(srcStat, destStat, src, dest, opts) {
45415
- if (!destStat)
45416
- return mkDirAndCopy(srcStat.mode, src, dest, opts);
45417
- return copyDir(src, dest, opts);
45418
- }
45419
- function mkDirAndCopy(srcMode, src, dest, opts) {
45420
- fs.mkdirSync(dest);
45421
- copyDir(src, dest, opts);
45422
- return setDestMode(dest, srcMode);
45423
- }
45424
- function copyDir(src, dest, opts) {
45425
- fs.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
45426
- }
45427
- function copyDirItem(item, src, dest, opts) {
45428
- const srcItem = path2.join(src, item);
45429
- const destItem = path2.join(dest, item);
45430
- if (opts.filter && !opts.filter(srcItem, destItem))
45431
- return;
45432
- const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
45433
- return getStats(destStat, srcItem, destItem, opts);
45434
- }
45435
- function onLink(destStat, src, dest, opts) {
45436
- let resolvedSrc = fs.readlinkSync(src);
45437
- if (opts.dereference) {
45438
- resolvedSrc = path2.resolve(process.cwd(), resolvedSrc);
45439
- }
45440
- if (!destStat) {
45441
- return fs.symlinkSync(resolvedSrc, dest);
45442
- } else {
45443
- let resolvedDest;
45444
- try {
45445
- resolvedDest = fs.readlinkSync(dest);
45446
- } catch (err) {
45447
- if (err.code === "EINVAL" || err.code === "UNKNOWN")
45448
- return fs.symlinkSync(resolvedSrc, dest);
45449
- throw err;
45450
- }
45451
- if (opts.dereference) {
45452
- resolvedDest = path2.resolve(process.cwd(), resolvedDest);
45453
- }
45454
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
45455
- throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
45456
- }
45457
- if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
45458
- throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
45459
- }
45460
- return copyLink(resolvedSrc, dest);
45461
- }
45462
- }
45463
- function copyLink(resolvedSrc, dest) {
45464
- fs.unlinkSync(dest);
45465
- return fs.symlinkSync(resolvedSrc, dest);
45466
- }
45467
- module2.exports = copySync;
45468
- }
45469
- });
45470
-
45471
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/index.js
45472
- var require_copy4 = __commonJS({
45473
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/index.js"(exports, module2) {
45474
- "use strict";
45475
- var u = require_universalify2().fromCallback;
45476
- module2.exports = {
45477
- copy: u(require_copy3()),
45478
- copySync: require_copy_sync2()
45479
- };
45480
- }
45481
- });
45482
-
45483
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/remove/index.js
45484
- var require_remove2 = __commonJS({
45485
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/remove/index.js"(exports, module2) {
45486
- "use strict";
45487
- var fs = require_graceful_fs();
45488
- var u = require_universalify2().fromCallback;
45489
- function remove(path2, callback) {
45490
- fs.rm(path2, { recursive: true, force: true }, callback);
45491
- }
45492
- function removeSync2(path2) {
45493
- fs.rmSync(path2, { recursive: true, force: true });
45494
- }
45495
- module2.exports = {
45496
- remove: u(remove),
45497
- removeSync: removeSync2
45498
- };
45499
- }
45500
- });
45501
-
45502
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/empty/index.js
45503
- var require_empty3 = __commonJS({
45504
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/empty/index.js"(exports, module2) {
45505
- "use strict";
45506
- var u = require_universalify2().fromPromise;
45507
- var fs = require_fs7();
45508
- var path2 = require("path");
45509
- var mkdir = require_mkdirs2();
45510
- var remove = require_remove2();
45511
- var emptyDir = u(async function emptyDir2(dir) {
45512
- let items;
45513
- try {
45514
- items = await fs.readdir(dir);
45515
- } catch {
45516
- return mkdir.mkdirs(dir);
45517
- }
45518
- return Promise.all(items.map((item) => remove.remove(path2.join(dir, item))));
45519
- });
45520
- function emptyDirSync(dir) {
45521
- let items;
45522
- try {
45523
- items = fs.readdirSync(dir);
45524
- } catch {
45525
- return mkdir.mkdirsSync(dir);
45526
- }
45527
- items.forEach((item) => {
45528
- item = path2.join(dir, item);
45529
- remove.removeSync(item);
45530
- });
45531
- }
45532
- module2.exports = {
45533
- emptyDirSync,
45534
- emptydirSync: emptyDirSync,
45535
- emptyDir,
45536
- emptydir: emptyDir
45537
- };
45538
- }
45539
- });
45540
-
45541
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/file.js
45542
- var require_file2 = __commonJS({
45543
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/file.js"(exports, module2) {
45544
- "use strict";
45545
- var u = require_universalify2().fromCallback;
45546
- var path2 = require("path");
45547
- var fs = require_graceful_fs();
45548
- var mkdir = require_mkdirs2();
45549
- function createFile(file, callback) {
45550
- function makeFile() {
45551
- fs.writeFile(file, "", (err) => {
45552
- if (err)
45553
- return callback(err);
45554
- callback();
45555
- });
45556
- }
45557
- fs.stat(file, (err, stats) => {
45558
- if (!err && stats.isFile())
45559
- return callback();
45560
- const dir = path2.dirname(file);
45561
- fs.stat(dir, (err2, stats2) => {
45562
- if (err2) {
45563
- if (err2.code === "ENOENT") {
45564
- return mkdir.mkdirs(dir, (err3) => {
45565
- if (err3)
45566
- return callback(err3);
45567
- makeFile();
45568
- });
45569
- }
45570
- return callback(err2);
45571
- }
45572
- if (stats2.isDirectory())
45573
- makeFile();
45574
- else {
45575
- fs.readdir(dir, (err3) => {
45576
- if (err3)
45577
- return callback(err3);
45578
- });
45579
- }
45580
- });
45581
- });
45582
- }
45583
- function createFileSync(file) {
45584
- let stats;
45585
- try {
45586
- stats = fs.statSync(file);
45587
- } catch {
45588
- }
45589
- if (stats && stats.isFile())
45590
- return;
45591
- const dir = path2.dirname(file);
45592
- try {
45593
- if (!fs.statSync(dir).isDirectory()) {
45594
- fs.readdirSync(dir);
45595
- }
45596
- } catch (err) {
45597
- if (err && err.code === "ENOENT")
45598
- mkdir.mkdirsSync(dir);
45599
- else
45600
- throw err;
45601
- }
45602
- fs.writeFileSync(file, "");
45603
- }
45604
- module2.exports = {
45605
- createFile: u(createFile),
45606
- createFileSync
45607
- };
45608
- }
45609
- });
45610
-
45611
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/link.js
45612
- var require_link2 = __commonJS({
45613
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/link.js"(exports, module2) {
45614
- "use strict";
45615
- var u = require_universalify2().fromCallback;
45616
- var path2 = require("path");
45617
- var fs = require_graceful_fs();
45618
- var mkdir = require_mkdirs2();
45619
- var pathExists = require_path_exists2().pathExists;
45620
- var { areIdentical } = require_stat2();
45621
- function createLink(srcpath, dstpath, callback) {
45622
- function makeLink(srcpath2, dstpath2) {
45623
- fs.link(srcpath2, dstpath2, (err) => {
45624
- if (err)
45625
- return callback(err);
45626
- callback(null);
45627
- });
45628
- }
45629
- fs.lstat(dstpath, (_, dstStat) => {
45630
- fs.lstat(srcpath, (err, srcStat) => {
45631
- if (err) {
45632
- err.message = err.message.replace("lstat", "ensureLink");
45633
- return callback(err);
45634
- }
45635
- if (dstStat && areIdentical(srcStat, dstStat))
45636
- return callback(null);
45637
- const dir = path2.dirname(dstpath);
45638
- pathExists(dir, (err2, dirExists) => {
45639
- if (err2)
45640
- return callback(err2);
45641
- if (dirExists)
45642
- return makeLink(srcpath, dstpath);
45643
- mkdir.mkdirs(dir, (err3) => {
45644
- if (err3)
45645
- return callback(err3);
45646
- makeLink(srcpath, dstpath);
45647
- });
45648
- });
45649
- });
45650
- });
45651
- }
45652
- function createLinkSync(srcpath, dstpath) {
45653
- let dstStat;
45654
- try {
45655
- dstStat = fs.lstatSync(dstpath);
45656
- } catch {
45657
- }
45658
- try {
45659
- const srcStat = fs.lstatSync(srcpath);
45660
- if (dstStat && areIdentical(srcStat, dstStat))
45661
- return;
45662
- } catch (err) {
45663
- err.message = err.message.replace("lstat", "ensureLink");
45664
- throw err;
45665
- }
45666
- const dir = path2.dirname(dstpath);
45667
- const dirExists = fs.existsSync(dir);
45668
- if (dirExists)
45669
- return fs.linkSync(srcpath, dstpath);
45670
- mkdir.mkdirsSync(dir);
45671
- return fs.linkSync(srcpath, dstpath);
45672
- }
45673
- module2.exports = {
45674
- createLink: u(createLink),
45675
- createLinkSync
45676
- };
45677
- }
45678
- });
45679
-
45680
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-paths.js
45681
- var require_symlink_paths2 = __commonJS({
45682
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module2) {
45683
- "use strict";
45684
- var path2 = require("path");
45685
- var fs = require_graceful_fs();
45686
- var pathExists = require_path_exists2().pathExists;
45687
- function symlinkPaths(srcpath, dstpath, callback) {
45688
- if (path2.isAbsolute(srcpath)) {
45689
- return fs.lstat(srcpath, (err) => {
45690
- if (err) {
45691
- err.message = err.message.replace("lstat", "ensureSymlink");
45692
- return callback(err);
45693
- }
45694
- return callback(null, {
45695
- toCwd: srcpath,
45696
- toDst: srcpath
45697
- });
45698
- });
45699
- } else {
45700
- const dstdir = path2.dirname(dstpath);
45701
- const relativeToDst = path2.join(dstdir, srcpath);
45702
- return pathExists(relativeToDst, (err, exists) => {
45703
- if (err)
45704
- return callback(err);
45705
- if (exists) {
45706
- return callback(null, {
45707
- toCwd: relativeToDst,
45708
- toDst: srcpath
45709
- });
45710
- } else {
45711
- return fs.lstat(srcpath, (err2) => {
45712
- if (err2) {
45713
- err2.message = err2.message.replace("lstat", "ensureSymlink");
45714
- return callback(err2);
45715
- }
45716
- return callback(null, {
45717
- toCwd: srcpath,
45718
- toDst: path2.relative(dstdir, srcpath)
45719
- });
45720
- });
45721
- }
45722
- });
45723
- }
45724
- }
45725
- function symlinkPathsSync(srcpath, dstpath) {
45726
- let exists;
45727
- if (path2.isAbsolute(srcpath)) {
45728
- exists = fs.existsSync(srcpath);
45729
- if (!exists)
45730
- throw new Error("absolute srcpath does not exist");
45731
- return {
45732
- toCwd: srcpath,
45733
- toDst: srcpath
45734
- };
45735
- } else {
45736
- const dstdir = path2.dirname(dstpath);
45737
- const relativeToDst = path2.join(dstdir, srcpath);
45738
- exists = fs.existsSync(relativeToDst);
45739
- if (exists) {
45740
- return {
45741
- toCwd: relativeToDst,
45742
- toDst: srcpath
45743
- };
45744
- } else {
45745
- exists = fs.existsSync(srcpath);
45746
- if (!exists)
45747
- throw new Error("relative srcpath does not exist");
45748
- return {
45749
- toCwd: srcpath,
45750
- toDst: path2.relative(dstdir, srcpath)
45751
- };
45752
- }
45753
- }
45754
- }
45755
- module2.exports = {
45756
- symlinkPaths,
45757
- symlinkPathsSync
45758
- };
45759
- }
45760
- });
45761
-
45762
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-type.js
45763
- var require_symlink_type2 = __commonJS({
45764
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module2) {
45765
- "use strict";
45766
- var fs = require_graceful_fs();
45767
- function symlinkType(srcpath, type, callback) {
45768
- callback = typeof type === "function" ? type : callback;
45769
- type = typeof type === "function" ? false : type;
45770
- if (type)
45771
- return callback(null, type);
45772
- fs.lstat(srcpath, (err, stats) => {
45773
- if (err)
45774
- return callback(null, "file");
45775
- type = stats && stats.isDirectory() ? "dir" : "file";
45776
- callback(null, type);
45777
- });
45778
- }
45779
- function symlinkTypeSync(srcpath, type) {
45780
- let stats;
45781
- if (type)
45782
- return type;
45783
- try {
45784
- stats = fs.lstatSync(srcpath);
45785
- } catch {
45786
- return "file";
45787
- }
45788
- return stats && stats.isDirectory() ? "dir" : "file";
45789
- }
45790
- module2.exports = {
45791
- symlinkType,
45792
- symlinkTypeSync
45793
- };
45794
- }
45795
- });
45796
-
45797
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink.js
45798
- var require_symlink2 = __commonJS({
45799
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module2) {
45800
- "use strict";
45801
- var u = require_universalify2().fromCallback;
45802
- var path2 = require("path");
45803
- var fs = require_fs7();
45804
- var _mkdirs = require_mkdirs2();
45805
- var mkdirs = _mkdirs.mkdirs;
45806
- var mkdirsSync = _mkdirs.mkdirsSync;
45807
- var _symlinkPaths = require_symlink_paths2();
45808
- var symlinkPaths = _symlinkPaths.symlinkPaths;
45809
- var symlinkPathsSync = _symlinkPaths.symlinkPathsSync;
45810
- var _symlinkType = require_symlink_type2();
45811
- var symlinkType = _symlinkType.symlinkType;
45812
- var symlinkTypeSync = _symlinkType.symlinkTypeSync;
45813
- var pathExists = require_path_exists2().pathExists;
45814
- var { areIdentical } = require_stat2();
45815
- function createSymlink(srcpath, dstpath, type, callback) {
45816
- callback = typeof type === "function" ? type : callback;
45817
- type = typeof type === "function" ? false : type;
45818
- fs.lstat(dstpath, (err, stats) => {
45819
- if (!err && stats.isSymbolicLink()) {
45820
- Promise.all([
45821
- fs.stat(srcpath),
45822
- fs.stat(dstpath)
45823
- ]).then(([srcStat, dstStat]) => {
45824
- if (areIdentical(srcStat, dstStat))
45825
- return callback(null);
45826
- _createSymlink(srcpath, dstpath, type, callback);
45827
- });
45828
- } else
45829
- _createSymlink(srcpath, dstpath, type, callback);
45830
- });
45831
- }
45832
- function _createSymlink(srcpath, dstpath, type, callback) {
45833
- symlinkPaths(srcpath, dstpath, (err, relative) => {
45834
- if (err)
45835
- return callback(err);
45836
- srcpath = relative.toDst;
45837
- symlinkType(relative.toCwd, type, (err2, type2) => {
45838
- if (err2)
45839
- return callback(err2);
45840
- const dir = path2.dirname(dstpath);
45841
- pathExists(dir, (err3, dirExists) => {
45842
- if (err3)
45843
- return callback(err3);
45844
- if (dirExists)
45845
- return fs.symlink(srcpath, dstpath, type2, callback);
45846
- mkdirs(dir, (err4) => {
45847
- if (err4)
45848
- return callback(err4);
45849
- fs.symlink(srcpath, dstpath, type2, callback);
45850
- });
45851
- });
45852
- });
45853
- });
45854
- }
45855
- function createSymlinkSync(srcpath, dstpath, type) {
45856
- let stats;
45857
- try {
45858
- stats = fs.lstatSync(dstpath);
45859
- } catch {
45860
- }
45861
- if (stats && stats.isSymbolicLink()) {
45862
- const srcStat = fs.statSync(srcpath);
45863
- const dstStat = fs.statSync(dstpath);
45864
- if (areIdentical(srcStat, dstStat))
45865
- return;
45866
- }
45867
- const relative = symlinkPathsSync(srcpath, dstpath);
45868
- srcpath = relative.toDst;
45869
- type = symlinkTypeSync(relative.toCwd, type);
45870
- const dir = path2.dirname(dstpath);
45871
- const exists = fs.existsSync(dir);
45872
- if (exists)
45873
- return fs.symlinkSync(srcpath, dstpath, type);
45874
- mkdirsSync(dir);
45875
- return fs.symlinkSync(srcpath, dstpath, type);
45876
- }
45877
- module2.exports = {
45878
- createSymlink: u(createSymlink),
45879
- createSymlinkSync
45880
- };
45881
- }
45882
- });
45883
-
45884
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/index.js
45885
- var require_ensure2 = __commonJS({
45886
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/index.js"(exports, module2) {
45887
- "use strict";
45888
- var { createFile, createFileSync } = require_file2();
45889
- var { createLink, createLinkSync } = require_link2();
45890
- var { createSymlink, createSymlinkSync } = require_symlink2();
45891
- module2.exports = {
45892
- // file
45893
- createFile,
45894
- createFileSync,
45895
- ensureFile: createFile,
45896
- ensureFileSync: createFileSync,
45897
- // link
45898
- createLink,
45899
- createLinkSync,
45900
- ensureLink: createLink,
45901
- ensureLinkSync: createLinkSync,
45902
- // symlink
45903
- createSymlink,
45904
- createSymlinkSync,
45905
- ensureSymlink: createSymlink,
45906
- ensureSymlinkSync: createSymlinkSync
45907
- };
45908
- }
45909
- });
45910
-
45911
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/jsonfile.js
45912
- var require_jsonfile3 = __commonJS({
45913
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module2) {
45914
- "use strict";
45915
- var jsonFile = require_jsonfile();
45916
- module2.exports = {
45917
- // jsonfile exports
45918
- readJson: jsonFile.readFile,
45919
- readJsonSync: jsonFile.readFileSync,
45920
- writeJson: jsonFile.writeFile,
45921
- writeJsonSync: jsonFile.writeFileSync
45922
- };
45923
- }
45924
- });
45925
-
45926
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/output-file/index.js
45927
- var require_output_file2 = __commonJS({
45928
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/output-file/index.js"(exports, module2) {
45929
- "use strict";
45930
- var u = require_universalify2().fromCallback;
45931
- var fs = require_graceful_fs();
45932
- var path2 = require("path");
45933
- var mkdir = require_mkdirs2();
45934
- var pathExists = require_path_exists2().pathExists;
45935
- function outputFile(file, data, encoding, callback) {
45936
- if (typeof encoding === "function") {
45937
- callback = encoding;
45938
- encoding = "utf8";
45939
- }
45940
- const dir = path2.dirname(file);
45941
- pathExists(dir, (err, itDoes) => {
45942
- if (err)
45943
- return callback(err);
45944
- if (itDoes)
45945
- return fs.writeFile(file, data, encoding, callback);
45946
- mkdir.mkdirs(dir, (err2) => {
45947
- if (err2)
45948
- return callback(err2);
45949
- fs.writeFile(file, data, encoding, callback);
45950
- });
45951
- });
45952
- }
45953
- function outputFileSync(file, ...args) {
45954
- const dir = path2.dirname(file);
45955
- if (fs.existsSync(dir)) {
45956
- return fs.writeFileSync(file, ...args);
45957
- }
45958
- mkdir.mkdirsSync(dir);
45959
- fs.writeFileSync(file, ...args);
45960
- }
45961
- module2.exports = {
45962
- outputFile: u(outputFile),
45963
- outputFileSync
45964
- };
45965
- }
45966
- });
45967
-
45968
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json.js
45969
- var require_output_json2 = __commonJS({
45970
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json.js"(exports, module2) {
45971
- "use strict";
45972
- var { stringify } = require_utils3();
45973
- var { outputFile } = require_output_file2();
45974
- async function outputJson(file, data, options = {}) {
45975
- const str = stringify(data, options);
45976
- await outputFile(file, str, options);
44234
+ const targetConfig = projectNode.data.targets?.[target.target];
44235
+ const { sourceRoot, root } = projectNode.data;
44236
+ const taskOptions = {
44237
+ ...targetConfig.options,
44238
+ ...target.configuration ? targetConfig.configurations?.[target.configuration] : {}
44239
+ };
44240
+ return { taskOptions, root, sourceRoot, projectNode, target };
45977
44241
  }
45978
- module2.exports = outputJson;
45979
44242
  }
45980
44243
  });
45981
44244
 
45982
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json-sync.js
45983
- var require_output_json_sync2 = __commonJS({
45984
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module2) {
44245
+ // node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/get-tsconfig.js
44246
+ var require_get_tsconfig = __commonJS({
44247
+ "node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/get-tsconfig.js"(exports) {
45985
44248
  "use strict";
45986
- var { stringify } = require_utils3();
45987
- var { outputFileSync } = require_output_file2();
45988
- function outputJsonSync(file, data, options) {
45989
- const str = stringify(data, options);
45990
- outputFileSync(file, str, options);
44249
+ Object.defineProperty(exports, "__esModule", { value: true });
44250
+ exports.getProcessedTaskTsConfigs = void 0;
44251
+ var devkit_1 = require_devkit();
44252
+ var path_1 = require("path");
44253
+ var get_task_options_1 = require_get_task_options();
44254
+ function getProcessedTaskTsConfigs(tasks, tasksOptions, context) {
44255
+ const taskInMemoryTsConfigMap = {};
44256
+ for (const task of tasks) {
44257
+ generateTaskProjectTsConfig(task, tasksOptions, context, taskInMemoryTsConfigMap);
44258
+ }
44259
+ return taskInMemoryTsConfigMap;
45991
44260
  }
45992
- module2.exports = outputJsonSync;
45993
- }
45994
- });
45995
-
45996
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/index.js
45997
- var require_json3 = __commonJS({
45998
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/index.js"(exports, module2) {
45999
- "use strict";
46000
- var u = require_universalify2().fromPromise;
46001
- var jsonFile = require_jsonfile3();
46002
- jsonFile.outputJson = u(require_output_json2());
46003
- jsonFile.outputJsonSync = require_output_json_sync2();
46004
- jsonFile.outputJSON = jsonFile.outputJson;
46005
- jsonFile.outputJSONSync = jsonFile.outputJsonSync;
46006
- jsonFile.writeJSON = jsonFile.writeJson;
46007
- jsonFile.writeJSONSync = jsonFile.writeJsonSync;
46008
- jsonFile.readJSON = jsonFile.readJson;
46009
- jsonFile.readJSONSync = jsonFile.readJsonSync;
46010
- module2.exports = jsonFile;
46011
- }
46012
- });
46013
-
46014
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move.js
46015
- var require_move3 = __commonJS({
46016
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move.js"(exports, module2) {
46017
- "use strict";
46018
- var fs = require_graceful_fs();
46019
- var path2 = require("path");
46020
- var copy = require_copy4().copy;
46021
- var remove = require_remove2().remove;
46022
- var mkdirp = require_mkdirs2().mkdirp;
46023
- var pathExists = require_path_exists2().pathExists;
46024
- var stat = require_stat2();
46025
- function move(src, dest, opts, cb) {
46026
- if (typeof opts === "function") {
46027
- cb = opts;
46028
- opts = {};
44261
+ exports.getProcessedTaskTsConfigs = getProcessedTaskTsConfigs;
44262
+ var projectTsConfigCache = /* @__PURE__ */ new Map();
44263
+ function generateTaskProjectTsConfig(task, tasksOptions, context, taskInMemoryTsConfigMap) {
44264
+ const { project } = (0, devkit_1.parseTargetString)(task, context);
44265
+ if (projectTsConfigCache.has(project)) {
44266
+ const { tsConfig, tsConfigPath: tsConfigPath2 } = projectTsConfigCache.get(project);
44267
+ taskInMemoryTsConfigMap[task] = tsConfig;
44268
+ return tsConfigPath2;
46029
44269
  }
46030
- opts = opts || {};
46031
- const overwrite = opts.overwrite || opts.clobber || false;
46032
- stat.checkPaths(src, dest, "move", opts, (err, stats) => {
46033
- if (err)
46034
- return cb(err);
46035
- const { srcStat, isChangingCase = false } = stats;
46036
- stat.checkParentPaths(src, srcStat, dest, "move", (err2) => {
46037
- if (err2)
46038
- return cb(err2);
46039
- if (isParentRoot(dest))
46040
- return doRename(src, dest, overwrite, isChangingCase, cb);
46041
- mkdirp(path2.dirname(dest), (err3) => {
46042
- if (err3)
46043
- return cb(err3);
46044
- return doRename(src, dest, overwrite, isChangingCase, cb);
46045
- });
46046
- });
44270
+ const tasksInProject = [
44271
+ task,
44272
+ ...getDependencyTasksInSameProject(task, context)
44273
+ ];
44274
+ const taskWithTscExecutor = tasksInProject.find((t) => hasTscExecutor(t, context));
44275
+ if (!taskWithTscExecutor) {
44276
+ throw new Error((0, devkit_1.stripIndents)`The "@nx/js:tsc" batch executor requires all dependencies to use the "@nx/js:tsc" executor.
44277
+ None of the following tasks in the "${project}" project use the "@nx/js:tsc" executor:
44278
+ ${tasksInProject.map((t) => `- ${t}`).join("\n")}`);
44279
+ }
44280
+ const projectReferences = [];
44281
+ for (const task2 of tasksInProject) {
44282
+ for (const depTask of getDependencyTasksInOtherProjects(task2, project, context)) {
44283
+ const tsConfigPath2 = generateTaskProjectTsConfig(depTask, tasksOptions, context, taskInMemoryTsConfigMap);
44284
+ projectReferences.push(tsConfigPath2);
44285
+ }
44286
+ }
44287
+ const taskOptions = tasksOptions[taskWithTscExecutor] ?? (0, get_task_options_1.getTaskOptions)(taskWithTscExecutor, context);
44288
+ const tsConfigPath = taskOptions.tsConfig;
44289
+ taskInMemoryTsConfigMap[taskWithTscExecutor] = getInMemoryTsConfig(tsConfigPath, taskOptions, projectReferences);
44290
+ projectTsConfigCache.set(project, {
44291
+ tsConfigPath,
44292
+ tsConfig: taskInMemoryTsConfigMap[taskWithTscExecutor]
46047
44293
  });
44294
+ return tsConfigPath;
46048
44295
  }
46049
- function isParentRoot(dest) {
46050
- const parent = path2.dirname(dest);
46051
- const parsedPath = path2.parse(parent);
46052
- return parsedPath.root === parent;
44296
+ function getDependencyTasksInOtherProjects(task, project, context) {
44297
+ return context.taskGraph.dependencies[task].filter((t) => t !== task && (0, devkit_1.parseTargetString)(t, context).project !== project);
46053
44298
  }
46054
- function doRename(src, dest, overwrite, isChangingCase, cb) {
46055
- if (isChangingCase)
46056
- return rename(src, dest, overwrite, cb);
46057
- if (overwrite) {
46058
- return remove(dest, (err) => {
46059
- if (err)
46060
- return cb(err);
46061
- return rename(src, dest, overwrite, cb);
46062
- });
46063
- }
46064
- pathExists(dest, (err, destExists) => {
46065
- if (err)
46066
- return cb(err);
46067
- if (destExists)
46068
- return cb(new Error("dest already exists."));
46069
- return rename(src, dest, overwrite, cb);
46070
- });
44299
+ function getDependencyTasksInSameProject(task, context) {
44300
+ const { project: taskProject } = (0, devkit_1.parseTargetString)(task, context);
44301
+ return Object.keys(context.taskGraph.tasks).filter((t) => t !== task && (0, devkit_1.parseTargetString)(t, context).project === taskProject);
46071
44302
  }
46072
- function rename(src, dest, overwrite, cb) {
46073
- fs.rename(src, dest, (err) => {
46074
- if (!err)
46075
- return cb();
46076
- if (err.code !== "EXDEV")
46077
- return cb(err);
46078
- return moveAcrossDevice(src, dest, overwrite, cb);
44303
+ function getInMemoryTsConfig(tsConfig, taskOptions, projectReferences) {
44304
+ const originalTsConfig = (0, devkit_1.readJsonFile)(tsConfig, {
44305
+ allowTrailingComma: true,
44306
+ disallowComments: false
46079
44307
  });
46080
- }
46081
- function moveAcrossDevice(src, dest, overwrite, cb) {
46082
- const opts = {
46083
- overwrite,
46084
- errorOnExist: true,
46085
- preserveTimestamps: true
44308
+ const allProjectReferences = Array.from(new Set((originalTsConfig.references ?? []).map((r) => r.path).concat(projectReferences)));
44309
+ return {
44310
+ content: JSON.stringify({
44311
+ ...originalTsConfig,
44312
+ compilerOptions: {
44313
+ ...originalTsConfig.compilerOptions,
44314
+ rootDir: taskOptions.rootDir,
44315
+ outDir: taskOptions.outputPath,
44316
+ composite: true,
44317
+ declaration: true,
44318
+ declarationMap: true,
44319
+ tsBuildInfoFile: (0, path_1.join)(taskOptions.outputPath, "tsconfig.tsbuildinfo")
44320
+ },
44321
+ references: allProjectReferences.map((pr) => ({ path: pr }))
44322
+ }),
44323
+ path: tsConfig.replace(/\\/g, "/")
46086
44324
  };
46087
- copy(src, dest, opts, (err) => {
46088
- if (err)
46089
- return cb(err);
46090
- return remove(src, cb);
46091
- });
46092
44325
  }
46093
- module2.exports = move;
44326
+ function hasTscExecutor(task, context) {
44327
+ const { project, target } = (0, devkit_1.parseTargetString)(task, context);
44328
+ return context.projectGraph.nodes[project].data.targets[target].executor === "@nx/js:tsc";
44329
+ }
46094
44330
  }
46095
44331
  });
46096
44332
 
46097
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move-sync.js
46098
- var require_move_sync2 = __commonJS({
46099
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move-sync.js"(exports, module2) {
44333
+ // node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/typescript-diagnostic-reporters.js
44334
+ var require_typescript_diagnostic_reporters = __commonJS({
44335
+ "node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/typescript-diagnostic-reporters.js"(exports) {
46100
44336
  "use strict";
46101
- var fs = require_graceful_fs();
46102
- var path2 = require("path");
46103
- var copySync = require_copy4().copySync;
46104
- var removeSync2 = require_remove2().removeSync;
46105
- var mkdirpSync = require_mkdirs2().mkdirpSync;
46106
- var stat = require_stat2();
46107
- function moveSync(src, dest, opts) {
46108
- opts = opts || {};
46109
- const overwrite = opts.overwrite || opts.clobber || false;
46110
- const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
46111
- stat.checkParentPathsSync(src, srcStat, dest, "move");
46112
- if (!isParentRoot(dest))
46113
- mkdirpSync(path2.dirname(dest));
46114
- return doRename(src, dest, overwrite, isChangingCase);
44337
+ Object.defineProperty(exports, "__esModule", { value: true });
44338
+ exports.formatSolutionBuilderStatusReport = exports.formatDiagnosticReport = void 0;
44339
+ var ts2 = require("typescript");
44340
+ function formatDiagnosticReport(diagnostic, host) {
44341
+ const diagnostics = new Array(1);
44342
+ diagnostics[0] = diagnostic;
44343
+ const formattedDiagnostic = "\n" + ts2.formatDiagnosticsWithColorAndContext(diagnostics, host) + host.getNewLine();
44344
+ diagnostics[0] = void 0;
44345
+ return formattedDiagnostic;
46115
44346
  }
46116
- function isParentRoot(dest) {
46117
- const parent = path2.dirname(dest);
46118
- const parsedPath = path2.parse(parent);
46119
- return parsedPath.root === parent;
44347
+ exports.formatDiagnosticReport = formatDiagnosticReport;
44348
+ function formatSolutionBuilderStatusReport(diagnostic) {
44349
+ let formattedDiagnostic = `[${formatColorAndReset(getLocaleTimeString(), ForegroundColorEscapeSequences.Grey)}] `;
44350
+ formattedDiagnostic += `${ts2.flattenDiagnosticMessageText(diagnostic.messageText, ts2.sys.newLine)}${ts2.sys.newLine + ts2.sys.newLine}`;
44351
+ return formattedDiagnostic;
46120
44352
  }
46121
- function doRename(src, dest, overwrite, isChangingCase) {
46122
- if (isChangingCase)
46123
- return rename(src, dest, overwrite);
46124
- if (overwrite) {
46125
- removeSync2(dest);
46126
- return rename(src, dest, overwrite);
44353
+ exports.formatSolutionBuilderStatusReport = formatSolutionBuilderStatusReport;
44354
+ function formatColorAndReset(text, formatStyle) {
44355
+ const resetEscapeSequence = "\x1B[0m";
44356
+ return formatStyle + text + resetEscapeSequence;
44357
+ }
44358
+ function getLocaleTimeString() {
44359
+ return (/* @__PURE__ */ new Date()).toLocaleTimeString();
44360
+ }
44361
+ var ForegroundColorEscapeSequences;
44362
+ (function(ForegroundColorEscapeSequences2) {
44363
+ ForegroundColorEscapeSequences2["Grey"] = "\x1B[90m";
44364
+ ForegroundColorEscapeSequences2["Red"] = "\x1B[91m";
44365
+ ForegroundColorEscapeSequences2["Yellow"] = "\x1B[93m";
44366
+ ForegroundColorEscapeSequences2["Blue"] = "\x1B[94m";
44367
+ ForegroundColorEscapeSequences2["Cyan"] = "\x1B[96m";
44368
+ })(ForegroundColorEscapeSequences || (ForegroundColorEscapeSequences = {}));
44369
+ }
44370
+ });
44371
+
44372
+ // node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/typescript-compilation.js
44373
+ var require_typescript_compilation = __commonJS({
44374
+ "node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/typescript-compilation.js"(exports) {
44375
+ "use strict";
44376
+ Object.defineProperty(exports, "__esModule", { value: true });
44377
+ exports.compileTypescriptSolution = void 0;
44378
+ var async_iterable_1 = require_async_iterable();
44379
+ var ts2 = require("typescript");
44380
+ var get_custom_transformers_factory_1 = require_get_custom_transformers_factory();
44381
+ var typescript_diagnostic_reporters_1 = require_typescript_diagnostic_reporters();
44382
+ var TYPESCRIPT_CANNOT_READ_FILE = 5083;
44383
+ var TYPESCRIPT_FILE_CHANGE_DETECTED_STARTING_INCREMENTAL_COMPILATION = 6032;
44384
+ function compileTypescriptSolution(context, watch, logger, hooks, reporters) {
44385
+ if (watch) {
44386
+ return (0, async_iterable_1.createAsyncIterable)(async ({ next }) => {
44387
+ hooks ??= {};
44388
+ const callerAfterProjectCompilationCallback = hooks.afterProjectCompilationCallback;
44389
+ hooks.afterProjectCompilationCallback = (tsConfig, success) => {
44390
+ callerAfterProjectCompilationCallback?.(tsConfig, success);
44391
+ next({ tsConfig, success });
44392
+ };
44393
+ compileTSWithWatch(context, logger, hooks, reporters);
44394
+ });
46127
44395
  }
46128
- if (fs.existsSync(dest))
46129
- throw new Error("dest already exists.");
46130
- return rename(src, dest, overwrite);
44396
+ const compilationGenerator = compileTS(context, logger, hooks, reporters);
44397
+ return {
44398
+ [Symbol.asyncIterator]() {
44399
+ return {
44400
+ next() {
44401
+ return Promise.resolve(compilationGenerator.next());
44402
+ }
44403
+ };
44404
+ }
44405
+ };
46131
44406
  }
46132
- function rename(src, dest, overwrite) {
46133
- try {
46134
- fs.renameSync(src, dest);
46135
- } catch (err) {
46136
- if (err.code !== "EXDEV")
46137
- throw err;
46138
- return moveAcrossDevice(src, dest, overwrite);
44407
+ exports.compileTypescriptSolution = compileTypescriptSolution;
44408
+ function* compileTS(context, logger, hooks, reporters) {
44409
+ let project;
44410
+ const formatDiagnosticsHost = {
44411
+ getCurrentDirectory: () => ts2.sys.getCurrentDirectory(),
44412
+ getNewLine: () => ts2.sys.newLine,
44413
+ getCanonicalFileName: (filename) => ts2.sys.useCaseSensitiveFileNames ? filename : filename.toLowerCase()
44414
+ };
44415
+ const solutionBuilderHost = ts2.createSolutionBuilderHost(
44416
+ getSystem(context),
44417
+ /*createProgram*/
44418
+ void 0,
44419
+ (diagnostic) => {
44420
+ const formattedDiagnostic = (0, typescript_diagnostic_reporters_1.formatDiagnosticReport)(diagnostic, formatDiagnosticsHost);
44421
+ if (diagnostic.code === TYPESCRIPT_CANNOT_READ_FILE) {
44422
+ throw new Error(formattedDiagnostic);
44423
+ }
44424
+ logger.info(formattedDiagnostic, project.project);
44425
+ reporters?.diagnosticReporter?.(project.project, diagnostic);
44426
+ },
44427
+ (diagnostic) => {
44428
+ const formattedDiagnostic = (0, typescript_diagnostic_reporters_1.formatSolutionBuilderStatusReport)(diagnostic);
44429
+ logger.info(formattedDiagnostic, project.project);
44430
+ reporters?.solutionBuilderStatusReporter?.(project.project, diagnostic);
44431
+ }
44432
+ );
44433
+ const rootNames = Object.keys(context);
44434
+ const solutionBuilder = ts2.createSolutionBuilder(solutionBuilderHost, rootNames, {});
44435
+ while (true) {
44436
+ project = solutionBuilder.getNextInvalidatedProject();
44437
+ if (!project) {
44438
+ break;
44439
+ }
44440
+ const projectContext = context[project.project];
44441
+ const projectName = projectContext?.project;
44442
+ if (project.kind === ts2.InvalidatedProjectKind.UpdateBundle) {
44443
+ logger.warn(`The project ${projectName} is using the deprecated "prepend" Typescript compiler option. This option is not supported by the batch executor and it's ignored.
44444
+ `, project.project);
44445
+ continue;
44446
+ }
44447
+ hooks?.beforeProjectCompilationCallback?.(project.project);
44448
+ if (project.kind === ts2.InvalidatedProjectKind.UpdateOutputFileStamps) {
44449
+ logger.info(`Updating output timestamps of project "${projectName}"...
44450
+ `, project.project);
44451
+ const status2 = project.done();
44452
+ const success2 = status2 === ts2.ExitStatus.Success;
44453
+ if (success2) {
44454
+ logger.info(`Done updating output timestamps of project "${projectName}"...
44455
+ `, project.project);
44456
+ }
44457
+ hooks?.afterProjectCompilationCallback?.(project.project, success2);
44458
+ yield { success: success2, tsConfig: project.project };
44459
+ continue;
44460
+ }
44461
+ logger.info(`Compiling TypeScript files for project "${projectName}"...
44462
+ `, project.project);
44463
+ const status = project.done(void 0, void 0, (0, get_custom_transformers_factory_1.getCustomTrasformersFactory)(projectContext.transformers)(project.getProgram()));
44464
+ const success = status === ts2.ExitStatus.Success;
44465
+ if (success) {
44466
+ logger.info(`Done compiling TypeScript files for project "${projectName}".
44467
+ `, project.project);
44468
+ }
44469
+ hooks?.afterProjectCompilationCallback?.(project.project, success);
44470
+ yield {
44471
+ success: status === ts2.ExitStatus.Success,
44472
+ tsConfig: project.project
44473
+ };
46139
44474
  }
46140
44475
  }
46141
- function moveAcrossDevice(src, dest, overwrite) {
46142
- const opts = {
46143
- overwrite,
46144
- errorOnExist: true,
46145
- preserveTimestamps: true
44476
+ function compileTSWithWatch(context, logger, hooks, reporters) {
44477
+ let project;
44478
+ const solutionHost = ts2.createSolutionBuilderWithWatchHost(
44479
+ getSystem(context),
44480
+ /*createProgram*/
44481
+ void 0
44482
+ );
44483
+ if (reporters?.diagnosticReporter) {
44484
+ const originalDiagnosticReporter = solutionHost.reportDiagnostic;
44485
+ solutionHost.reportDiagnostic = (diagnostic) => {
44486
+ originalDiagnosticReporter(diagnostic);
44487
+ reporters.diagnosticReporter(project.project, diagnostic);
44488
+ };
44489
+ }
44490
+ if (reporters?.solutionBuilderStatusReporter) {
44491
+ const originalSolutionBuilderStatusReporter = solutionHost.reportSolutionBuilderStatus;
44492
+ solutionHost.reportDiagnostic = (diagnostic) => {
44493
+ originalSolutionBuilderStatusReporter(diagnostic);
44494
+ reporters.solutionBuilderStatusReporter(project.project, diagnostic);
44495
+ };
44496
+ }
44497
+ const originalWatchStatusReporter = solutionHost.onWatchStatusChange;
44498
+ solutionHost.onWatchStatusChange = (diagnostic, newLine, options, errorCount) => {
44499
+ originalWatchStatusReporter(diagnostic, newLine, options, errorCount);
44500
+ if (diagnostic.code === TYPESCRIPT_FILE_CHANGE_DETECTED_STARTING_INCREMENTAL_COMPILATION) {
44501
+ build2();
44502
+ }
44503
+ reporters?.watchStatusReporter?.(project?.project, diagnostic, newLine, options, errorCount);
44504
+ };
44505
+ const rootNames = Object.keys(context);
44506
+ const solutionBuilder = ts2.createSolutionBuilderWithWatch(solutionHost, rootNames, {});
44507
+ const build2 = () => {
44508
+ while (true) {
44509
+ project = solutionBuilder.getNextInvalidatedProject();
44510
+ if (!project) {
44511
+ break;
44512
+ }
44513
+ const projectContext = context[project.project];
44514
+ const projectName = projectContext.project;
44515
+ if (project.kind === ts2.InvalidatedProjectKind.UpdateBundle) {
44516
+ logger.warn(`The project ${projectName} is using the deprecated "prepend" Typescript compiler option. This option is not supported by the batch executor and it's ignored.`);
44517
+ continue;
44518
+ }
44519
+ hooks?.beforeProjectCompilationCallback(project.project);
44520
+ if (project.kind === ts2.InvalidatedProjectKind.UpdateOutputFileStamps) {
44521
+ if (projectName) {
44522
+ logger.info(`Updating output timestamps of project "${projectName}"...
44523
+ `, project.project);
44524
+ }
44525
+ const status2 = project.done();
44526
+ const success2 = status2 === ts2.ExitStatus.Success;
44527
+ if (projectName && success2) {
44528
+ logger.info(`Done updating output timestamps of project "${projectName}"...
44529
+ `, project.project);
44530
+ }
44531
+ hooks?.afterProjectCompilationCallback?.(project.project, success2);
44532
+ continue;
44533
+ }
44534
+ logger.info(`Compiling TypeScript files for project "${projectName}"...
44535
+ `, project.project);
44536
+ const status = project.done(void 0, void 0, (0, get_custom_transformers_factory_1.getCustomTrasformersFactory)(projectContext.transformers)(project.getProgram()));
44537
+ const success = status === ts2.ExitStatus.Success;
44538
+ if (success) {
44539
+ logger.info(`Done compiling TypeScript files for project "${projectName}".
44540
+ `, project.project);
44541
+ }
44542
+ hooks?.afterProjectCompilationCallback?.(project.project, success);
44543
+ }
44544
+ };
44545
+ build2();
44546
+ solutionBuilder.build();
44547
+ }
44548
+ function getSystem(context) {
44549
+ return {
44550
+ ...ts2.sys,
44551
+ readFile(path2, encoding) {
44552
+ if (context[path2]) {
44553
+ return context[path2].tsConfig.content;
44554
+ }
44555
+ return ts2.sys.readFile(path2, encoding);
44556
+ }
46146
44557
  };
46147
- copySync(src, dest, opts);
46148
- return removeSync2(src);
46149
44558
  }
46150
- module2.exports = moveSync;
46151
44559
  }
46152
44560
  });
46153
44561
 
46154
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/index.js
46155
- var require_move4 = __commonJS({
46156
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/index.js"(exports, module2) {
44562
+ // node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/index.js
44563
+ var require_lib5 = __commonJS({
44564
+ "node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/index.js"(exports) {
46157
44565
  "use strict";
46158
- var u = require_universalify2().fromCallback;
46159
- module2.exports = {
46160
- move: u(require_move3()),
46161
- moveSync: require_move_sync2()
46162
- };
44566
+ Object.defineProperty(exports, "__esModule", { value: true });
44567
+ var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
44568
+ tslib_1.__exportStar(require_get_custom_transformers_factory(), exports);
44569
+ tslib_1.__exportStar(require_get_tsconfig(), exports);
44570
+ tslib_1.__exportStar(require_normalize_options(), exports);
44571
+ tslib_1.__exportStar(require_typescript_compilation(), exports);
46163
44572
  }
46164
44573
  });
46165
44574
 
46166
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/index.js
46167
- var require_lib6 = __commonJS({
46168
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/index.js"(exports, module2) {
44575
+ // node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/tsc.impl.js
44576
+ var require_tsc_impl = __commonJS({
44577
+ "node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/tsc.impl.js"(exports) {
46169
44578
  "use strict";
46170
- module2.exports = {
46171
- // Export promiseified graceful-fs:
46172
- ...require_fs7(),
46173
- // Export extra methods:
46174
- ...require_copy4(),
46175
- ...require_empty3(),
46176
- ...require_ensure2(),
46177
- ...require_json3(),
46178
- ...require_mkdirs2(),
46179
- ...require_move4(),
46180
- ...require_output_file2(),
46181
- ...require_path_exists2(),
46182
- ...require_remove2()
46183
- };
44579
+ Object.defineProperty(exports, "__esModule", { value: true });
44580
+ exports.tscExecutor = exports.createTypeScriptCompilationOptions = exports.determineModuleFormatFromTsConfig = void 0;
44581
+ var ts2 = require("typescript");
44582
+ var copy_assets_handler_1 = require_copy_assets_handler();
44583
+ var check_dependencies_1 = require_check_dependencies();
44584
+ var compiler_helper_dependency_1 = require_compiler_helper_dependency();
44585
+ var inline_1 = require_inline();
44586
+ var update_package_json_1 = require_update_package_json();
44587
+ var compile_typescript_files_1 = require_compile_typescript_files();
44588
+ var watch_for_single_file_changes_1 = require_watch_for_single_file_changes();
44589
+ var lib_1 = require_lib5();
44590
+ var ts_config_1 = require_ts_config();
44591
+ var create_entry_points_1 = require_create_entry_points();
44592
+ function determineModuleFormatFromTsConfig(absolutePathToTsConfig) {
44593
+ const tsConfig = (0, ts_config_1.readTsConfig)(absolutePathToTsConfig);
44594
+ if (tsConfig.options.module === ts2.ModuleKind.ES2015 || tsConfig.options.module === ts2.ModuleKind.ES2020 || tsConfig.options.module === ts2.ModuleKind.ES2022 || tsConfig.options.module === ts2.ModuleKind.ESNext) {
44595
+ return "esm";
44596
+ } else {
44597
+ return "cjs";
44598
+ }
44599
+ }
44600
+ exports.determineModuleFormatFromTsConfig = determineModuleFormatFromTsConfig;
44601
+ function createTypeScriptCompilationOptions2(normalizedOptions, context) {
44602
+ return {
44603
+ outputPath: normalizedOptions.outputPath,
44604
+ projectName: context.projectName,
44605
+ projectRoot: normalizedOptions.projectRoot,
44606
+ rootDir: normalizedOptions.rootDir,
44607
+ tsConfig: normalizedOptions.tsConfig,
44608
+ watch: normalizedOptions.watch,
44609
+ deleteOutputPath: normalizedOptions.clean,
44610
+ getCustomTransformers: (0, lib_1.getCustomTrasformersFactory)(normalizedOptions.transformers)
44611
+ };
44612
+ }
44613
+ exports.createTypeScriptCompilationOptions = createTypeScriptCompilationOptions2;
44614
+ async function* tscExecutor(_options, context) {
44615
+ const { sourceRoot, root } = context.projectsConfigurations.projects[context.projectName];
44616
+ const options = (0, lib_1.normalizeOptions)(_options, context.root, sourceRoot, root);
44617
+ const { projectRoot, tmpTsConfig, target, dependencies } = (0, check_dependencies_1.checkDependencies)(context, options.tsConfig);
44618
+ if (tmpTsConfig) {
44619
+ options.tsConfig = tmpTsConfig;
44620
+ }
44621
+ const tsLibDependency = (0, compiler_helper_dependency_1.getHelperDependency)(compiler_helper_dependency_1.HelperDependency.tsc, options.tsConfig, dependencies, context.projectGraph);
44622
+ if (tsLibDependency) {
44623
+ dependencies.push(tsLibDependency);
44624
+ }
44625
+ const assetHandler = new copy_assets_handler_1.CopyAssetsHandler({
44626
+ projectDir: projectRoot,
44627
+ rootDir: context.root,
44628
+ outputDir: _options.outputPath,
44629
+ assets: _options.assets
44630
+ });
44631
+ const tsCompilationOptions = createTypeScriptCompilationOptions2(options, context);
44632
+ const inlineProjectGraph = (0, inline_1.handleInliningBuild)(context, options, tsCompilationOptions.tsConfig);
44633
+ if (!(0, inline_1.isInlineGraphEmpty)(inlineProjectGraph)) {
44634
+ tsCompilationOptions.rootDir = ".";
44635
+ }
44636
+ const typescriptCompilation = (0, compile_typescript_files_1.compileTypeScriptFiles)(options, tsCompilationOptions, async () => {
44637
+ await assetHandler.processAllAssetsOnce();
44638
+ (0, update_package_json_1.updatePackageJson)({
44639
+ ...options,
44640
+ additionalEntryPoints: (0, create_entry_points_1.createEntryPoints)(options.additionalEntryPoints, context.root),
44641
+ format: [determineModuleFormatFromTsConfig(options.tsConfig)],
44642
+ // As long as d.ts files match their .js counterparts, we don't need to emit them.
44643
+ // TSC can match them correctly based on file names.
44644
+ skipTypings: true
44645
+ }, context, target, dependencies);
44646
+ (0, inline_1.postProcessInlinedDependencies)(tsCompilationOptions.outputPath, tsCompilationOptions.projectRoot, inlineProjectGraph);
44647
+ });
44648
+ if (options.watch) {
44649
+ const disposeWatchAssetChanges = await assetHandler.watchAndProcessOnAssetChange();
44650
+ const disposePackageJsonChanges = await (0, watch_for_single_file_changes_1.watchForSingleFileChanges)(context.projectName, options.projectRoot, "package.json", () => (0, update_package_json_1.updatePackageJson)({
44651
+ ...options,
44652
+ additionalEntryPoints: (0, create_entry_points_1.createEntryPoints)(options.additionalEntryPoints, context.root),
44653
+ // As long as d.ts files match their .js counterparts, we don't need to emit them.
44654
+ // TSC can match them correctly based on file names.
44655
+ skipTypings: true,
44656
+ format: [determineModuleFormatFromTsConfig(options.tsConfig)]
44657
+ }, context, target, dependencies));
44658
+ const handleTermination = async (exitCode) => {
44659
+ await typescriptCompilation.close();
44660
+ disposeWatchAssetChanges();
44661
+ disposePackageJsonChanges();
44662
+ process.exit(exitCode);
44663
+ };
44664
+ process.on("SIGINT", () => handleTermination(128 + 2));
44665
+ process.on("SIGTERM", () => handleTermination(128 + 15));
44666
+ }
44667
+ return yield* typescriptCompilation.iterator;
44668
+ }
44669
+ exports.tscExecutor = tscExecutor;
44670
+ exports.default = tscExecutor;
46184
44671
  }
46185
44672
  });
46186
44673
 
@@ -46396,7 +44883,7 @@ var require_errno2 = __commonJS({
46396
44883
  });
46397
44884
 
46398
44885
  // node_modules/.pnpm/fast-glob@3.3.2/node_modules/fast-glob/out/utils/fs.js
46399
- var require_fs8 = __commonJS({
44886
+ var require_fs7 = __commonJS({
46400
44887
  "node_modules/.pnpm/fast-glob@3.3.2/node_modules/fast-glob/out/utils/fs.js"(exports) {
46401
44888
  "use strict";
46402
44889
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -46662,7 +45149,7 @@ var require_string3 = __commonJS({
46662
45149
  });
46663
45150
 
46664
45151
  // node_modules/.pnpm/fast-glob@3.3.2/node_modules/fast-glob/out/utils/index.js
46665
- var require_utils10 = __commonJS({
45152
+ var require_utils9 = __commonJS({
46666
45153
  "node_modules/.pnpm/fast-glob@3.3.2/node_modules/fast-glob/out/utils/index.js"(exports) {
46667
45154
  "use strict";
46668
45155
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -46671,7 +45158,7 @@ var require_utils10 = __commonJS({
46671
45158
  exports.array = array;
46672
45159
  var errno = require_errno2();
46673
45160
  exports.errno = errno;
46674
- var fs = require_fs8();
45161
+ var fs = require_fs7();
46675
45162
  exports.fs = fs;
46676
45163
  var path2 = require_path2();
46677
45164
  exports.path = path2;
@@ -46690,7 +45177,7 @@ var require_tasks2 = __commonJS({
46690
45177
  "use strict";
46691
45178
  Object.defineProperty(exports, "__esModule", { value: true });
46692
45179
  exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
46693
- var utils = require_utils10();
45180
+ var utils = require_utils9();
46694
45181
  function generate(input, settings) {
46695
45182
  const patterns = processPatterns(input, settings);
46696
45183
  const ignore = processPatterns(settings.ignore, settings);
@@ -46787,7 +45274,7 @@ var require_reader3 = __commonJS({
46787
45274
  Object.defineProperty(exports, "__esModule", { value: true });
46788
45275
  var path2 = require("path");
46789
45276
  var fsStat = require_out();
46790
- var utils = require_utils10();
45277
+ var utils = require_utils9();
46791
45278
  var Reader = class {
46792
45279
  constructor(_settings) {
46793
45280
  this._settings = _settings;
@@ -46920,7 +45407,7 @@ var require_matcher2 = __commonJS({
46920
45407
  "node_modules/.pnpm/fast-glob@3.3.2/node_modules/fast-glob/out/providers/matchers/matcher.js"(exports) {
46921
45408
  "use strict";
46922
45409
  Object.defineProperty(exports, "__esModule", { value: true });
46923
- var utils = require_utils10();
45410
+ var utils = require_utils9();
46924
45411
  var Matcher = class {
46925
45412
  constructor(_patterns, _settings, _micromatchOptions) {
46926
45413
  this._patterns = _patterns;
@@ -47008,7 +45495,7 @@ var require_deep2 = __commonJS({
47008
45495
  "node_modules/.pnpm/fast-glob@3.3.2/node_modules/fast-glob/out/providers/filters/deep.js"(exports) {
47009
45496
  "use strict";
47010
45497
  Object.defineProperty(exports, "__esModule", { value: true });
47011
- var utils = require_utils10();
45498
+ var utils = require_utils9();
47012
45499
  var partial_1 = require_partial2();
47013
45500
  var DeepFilter = class {
47014
45501
  constructor(_settings, _micromatchOptions) {
@@ -47073,7 +45560,7 @@ var require_entry3 = __commonJS({
47073
45560
  "node_modules/.pnpm/fast-glob@3.3.2/node_modules/fast-glob/out/providers/filters/entry.js"(exports) {
47074
45561
  "use strict";
47075
45562
  Object.defineProperty(exports, "__esModule", { value: true });
47076
- var utils = require_utils10();
45563
+ var utils = require_utils9();
47077
45564
  var EntryFilter = class {
47078
45565
  constructor(_settings, _micromatchOptions) {
47079
45566
  this._settings = _settings;
@@ -47139,7 +45626,7 @@ var require_error2 = __commonJS({
47139
45626
  "node_modules/.pnpm/fast-glob@3.3.2/node_modules/fast-glob/out/providers/filters/error.js"(exports) {
47140
45627
  "use strict";
47141
45628
  Object.defineProperty(exports, "__esModule", { value: true });
47142
- var utils = require_utils10();
45629
+ var utils = require_utils9();
47143
45630
  var ErrorFilter = class {
47144
45631
  constructor(_settings) {
47145
45632
  this._settings = _settings;
@@ -47160,7 +45647,7 @@ var require_entry4 = __commonJS({
47160
45647
  "node_modules/.pnpm/fast-glob@3.3.2/node_modules/fast-glob/out/providers/transformers/entry.js"(exports) {
47161
45648
  "use strict";
47162
45649
  Object.defineProperty(exports, "__esModule", { value: true });
47163
- var utils = require_utils10();
45650
+ var utils = require_utils9();
47164
45651
  var EntryTransformer = class {
47165
45652
  constructor(_settings) {
47166
45653
  this._settings = _settings;
@@ -47450,7 +45937,7 @@ var require_out5 = __commonJS({
47450
45937
  var stream_1 = require_stream7();
47451
45938
  var sync_1 = require_sync9();
47452
45939
  var settings_1 = require_settings5();
47453
- var utils = require_utils10();
45940
+ var utils = require_utils9();
47454
45941
  async function FastGlob(source, options) {
47455
45942
  assertPatternsInput(source);
47456
45943
  const works = getWorks(source, async_1.default, options);
@@ -48490,7 +46977,7 @@ var require_chunk_UIX4URMV = __commonJS({
48490
46977
  });
48491
46978
 
48492
46979
  // node_modules/.pnpm/joycon@3.1.1/node_modules/joycon/lib/index.js
48493
- var require_lib7 = __commonJS({
46980
+ var require_lib6 = __commonJS({
48494
46981
  "node_modules/.pnpm/joycon@3.1.1/node_modules/joycon/lib/index.js"(exports, module2) {
48495
46982
  "use strict";
48496
46983
  Object.defineProperty(exports, "__esModule", {
@@ -49233,7 +47720,7 @@ var require_chunk_7G76EW2R = __commonJS({
49233
47720
  var _chunkGQ77QZBOjs = require_chunk_GQ77QZBO();
49234
47721
  var _fs = require("fs");
49235
47722
  var _fs2 = _interopRequireDefault(_fs);
49236
- var _joycon = require_lib7();
47723
+ var _joycon = require_lib6();
49237
47724
  var _joycon2 = _interopRequireDefault(_joycon);
49238
47725
  var _path = require("path");
49239
47726
  var _path2 = _interopRequireDefault(_path);
@@ -106332,7 +104819,7 @@ var require_positions = __commonJS({
106332
104819
  });
106333
104820
 
106334
104821
  // node_modules/.pnpm/ret@0.2.2/node_modules/ret/lib/index.js
106335
- var require_lib8 = __commonJS({
104822
+ var require_lib7 = __commonJS({
106336
104823
  "node_modules/.pnpm/ret@0.2.2/node_modules/ret/lib/index.js"(exports, module2) {
106337
104824
  var util2 = require_util6();
106338
104825
  var types2 = require_types6();
@@ -106523,7 +105010,7 @@ var require_lib8 = __commonJS({
106523
105010
  });
106524
105011
 
106525
105012
  // node_modules/.pnpm/drange@1.1.1/node_modules/drange/lib/index.js
106526
- var require_lib9 = __commonJS({
105013
+ var require_lib8 = __commonJS({
106527
105014
  "node_modules/.pnpm/drange@1.1.1/node_modules/drange/lib/index.js"(exports, module2) {
106528
105015
  "use strict";
106529
105016
  var SubRange = class _SubRange {
@@ -106688,8 +105175,8 @@ var require_lib9 = __commonJS({
106688
105175
  // node_modules/.pnpm/randexp@0.5.3/node_modules/randexp/lib/randexp.js
106689
105176
  var require_randexp = __commonJS({
106690
105177
  "node_modules/.pnpm/randexp@0.5.3/node_modules/randexp/lib/randexp.js"(exports, module2) {
106691
- var ret = require_lib8();
106692
- var DRange = require_lib9();
105178
+ var ret = require_lib7();
105179
+ var DRange = require_lib8();
106693
105180
  var types2 = ret.types;
106694
105181
  module2.exports = class RandExp {
106695
105182
  /**
@@ -132097,7 +130584,7 @@ var environmentPlugin = (data) => ({
132097
130584
  });
132098
130585
 
132099
130586
  // packages/workspace-tools/src/executors/tsup/executor.ts
132100
- var import_fs_extra = __toESM(require_lib6());
130587
+ var import_fs_extra = __toESM(require_lib4());
132101
130588
  var import_promises2 = require("fs/promises");
132102
130589
 
132103
130590
  // node_modules/.pnpm/minimatch@9.0.3/node_modules/minimatch/dist/mjs/index.js