@storm-software/workspace-tools 1.13.12 → 1.13.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/index.js +75 -18
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +81 -19
- package/src/executors/tsup/get-config.js +76 -19
- package/src/executors/tsup/schema.json +2 -1
package/package.json
CHANGED
|
@@ -37426,9 +37426,9 @@ var require_brace_expansion2 = __commonJS({
|
|
|
37426
37426
|
}
|
|
37427
37427
|
});
|
|
37428
37428
|
|
|
37429
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
37429
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-EPAEWGCP.js
|
|
37430
37430
|
var require_chunk_EPAEWGCP = __commonJS({
|
|
37431
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
37431
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
|
|
37432
37432
|
"use strict";
|
|
37433
37433
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37434
37434
|
var version = "8.0.0";
|
|
@@ -39075,9 +39075,9 @@ var require_resolve_from = __commonJS({
|
|
|
39075
39075
|
}
|
|
39076
39076
|
});
|
|
39077
39077
|
|
|
39078
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
39078
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-GQ77QZBO.js
|
|
39079
39079
|
var require_chunk_GQ77QZBO = __commonJS({
|
|
39080
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
39080
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-GQ77QZBO.js"(exports) {
|
|
39081
39081
|
"use strict";
|
|
39082
39082
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39083
39083
|
function _interopRequireDefault(obj) {
|
|
@@ -39355,9 +39355,9 @@ var require_chunk_GQ77QZBO = __commonJS({
|
|
|
39355
39355
|
}
|
|
39356
39356
|
});
|
|
39357
39357
|
|
|
39358
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
39358
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-UIX4URMV.js
|
|
39359
39359
|
var require_chunk_UIX4URMV = __commonJS({
|
|
39360
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
39360
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-UIX4URMV.js"(exports) {
|
|
39361
39361
|
"use strict";
|
|
39362
39362
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39363
39363
|
function _interopRequireWildcard(obj) {
|
|
@@ -40291,9 +40291,9 @@ var require_dist2 = __commonJS({
|
|
|
40291
40291
|
}
|
|
40292
40292
|
});
|
|
40293
40293
|
|
|
40294
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
40294
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-7G76EW2R.js
|
|
40295
40295
|
var require_chunk_7G76EW2R = __commonJS({
|
|
40296
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
40296
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-7G76EW2R.js"(exports) {
|
|
40297
40297
|
"use strict";
|
|
40298
40298
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40299
40299
|
function _interopRequireDefault(obj) {
|
|
@@ -95291,9 +95291,9 @@ var require_chokidar = __commonJS({
|
|
|
95291
95291
|
}
|
|
95292
95292
|
});
|
|
95293
95293
|
|
|
95294
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
95294
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/index.js
|
|
95295
95295
|
var require_dist6 = __commonJS({
|
|
95296
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
95296
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/index.js"(exports) {
|
|
95297
95297
|
"use strict";
|
|
95298
95298
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
95299
95299
|
function _interopRequireDefault(obj) {
|
|
@@ -97498,7 +97498,7 @@ var require_dist6 = __commonJS({
|
|
|
97498
97498
|
if (!sourceFile) {
|
|
97499
97499
|
return [];
|
|
97500
97500
|
}
|
|
97501
|
-
const destFileName = fileMapping
|
|
97501
|
+
const destFileName = fileMapping?.get?.(sourceFileName);
|
|
97502
97502
|
if (!destFileName) {
|
|
97503
97503
|
return [];
|
|
97504
97504
|
}
|
|
@@ -97523,14 +97523,70 @@ var require_dist6 = __commonJS({
|
|
|
97523
97523
|
}
|
|
97524
97524
|
return program.getRootFileNames().flatMap(extractExports);
|
|
97525
97525
|
}
|
|
97526
|
+
function emitDtsFiles(program, host, options) {
|
|
97527
|
+
let fileMapping = /* @__PURE__ */ new Map();
|
|
97528
|
+
let writeFile2 = (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
|
97529
|
+
const sourceFile = _optionalChain([sourceFiles, "optionalAccess", (_14) => _14[0]]);
|
|
97530
|
+
let sourceFileName = _optionalChain([sourceFile, "optionalAccess", (_15) => _15.fileName]);
|
|
97531
|
+
if (sourceFileName && !fileName.endsWith(".map")) {
|
|
97532
|
+
const cwd = options.workspaceRoot ? options.workspaceRoot : program.getCurrentDirectory();
|
|
97533
|
+
fileMapping.set(
|
|
97534
|
+
_chunkGQ77QZBOjs.toAbsolutePath.call(void 0, sourceFileName, cwd),
|
|
97535
|
+
_chunkGQ77QZBOjs.toAbsolutePath.call(void 0, fileName, cwd)
|
|
97536
|
+
);
|
|
97537
|
+
}
|
|
97538
|
+
return host.writeFile(
|
|
97539
|
+
fileName,
|
|
97540
|
+
text,
|
|
97541
|
+
writeByteOrderMark,
|
|
97542
|
+
onError,
|
|
97543
|
+
sourceFiles,
|
|
97544
|
+
data
|
|
97545
|
+
);
|
|
97546
|
+
};
|
|
97547
|
+
logger.info("tsc", "Emitting DTS files");
|
|
97548
|
+
let emitResult = program.emit(void 0, writeFile2, void 0, true);
|
|
97549
|
+
let diagnostics = _typescript2.default.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
|
|
97550
|
+
let diagnosticMessages = [];
|
|
97551
|
+
diagnostics.forEach((diagnostic) => {
|
|
97552
|
+
if (diagnostic.file) {
|
|
97553
|
+
let { line, character } = _typescript2.default.getLineAndCharacterOfPosition(
|
|
97554
|
+
diagnostic.file,
|
|
97555
|
+
diagnostic.start
|
|
97556
|
+
);
|
|
97557
|
+
let message = _typescript2.default.flattenDiagnosticMessageText(
|
|
97558
|
+
diagnostic.messageText,
|
|
97559
|
+
"\n"
|
|
97560
|
+
);
|
|
97561
|
+
diagnosticMessages.push(
|
|
97562
|
+
`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`
|
|
97563
|
+
);
|
|
97564
|
+
} else {
|
|
97565
|
+
let message = _typescript2.default.flattenDiagnosticMessageText(
|
|
97566
|
+
diagnostic.messageText,
|
|
97567
|
+
"\n"
|
|
97568
|
+
);
|
|
97569
|
+
diagnosticMessages.push(message);
|
|
97570
|
+
}
|
|
97571
|
+
});
|
|
97572
|
+
let diagnosticMessage = diagnosticMessages.join("\n");
|
|
97573
|
+
if (diagnosticMessage) {
|
|
97574
|
+
logger.error(
|
|
97575
|
+
"TSC",
|
|
97576
|
+
"Failed to emit declaration files.\n\n" + diagnosticMessage
|
|
97577
|
+
);
|
|
97578
|
+
throw new Error("TypeScript compilation failed");
|
|
97579
|
+
}
|
|
97580
|
+
return fileMapping;
|
|
97581
|
+
}
|
|
97526
97582
|
var getFile = (name, logger3) => {
|
|
97527
97583
|
logger3.info("tsc", `Reading file content for: ${name}`);
|
|
97528
97584
|
return _fs2.default.promises.readFile(name, "utf8");
|
|
97529
97585
|
};
|
|
97530
97586
|
var addFile = async (name, map, options, logger3) => {
|
|
97531
97587
|
let relativeName = name.replaceAll("/", "\\").replace(options.workspaceRoot, "").replaceAll("\\", "/");
|
|
97532
|
-
if (
|
|
97533
|
-
relativeName =
|
|
97588
|
+
if (relativeName.startsWith("/")) {
|
|
97589
|
+
relativeName = relativeName.substring(1);
|
|
97534
97590
|
}
|
|
97535
97591
|
if (map && !map.has(relativeName)) {
|
|
97536
97592
|
logger3.info("tsc", `Adding file to FS Map: ${relativeName}`);
|
|
@@ -97626,17 +97682,17 @@ var require_dist6 = __commonJS({
|
|
|
97626
97682
|
logger.info("tsc", "Created program");
|
|
97627
97683
|
logger.info("tsc", "Emitting DTS files with the following options: ");
|
|
97628
97684
|
logger.info("tsc", parsedTsconfig.options);
|
|
97685
|
+
let fileMapping;
|
|
97629
97686
|
try {
|
|
97630
97687
|
logger.info("tsc", "Emitting DTS files");
|
|
97631
|
-
|
|
97632
|
-
program.emit();
|
|
97688
|
+
fileMapping = emitDtsFiles(program, host.compilerHost, options);
|
|
97633
97689
|
logger.info("tsc", "Emit DTS files complete");
|
|
97634
|
-
logger.info("tsc",
|
|
97690
|
+
logger.info("tsc", fileMapping);
|
|
97635
97691
|
} catch (e) {
|
|
97636
97692
|
logger.error("tsc", "An error occured while emitting DTS files");
|
|
97637
97693
|
logger.error("tsc", e);
|
|
97638
97694
|
}
|
|
97639
|
-
return getExports(options, program,
|
|
97695
|
+
return getExports(options, program, fileMapping);
|
|
97640
97696
|
}
|
|
97641
97697
|
async function runTypeScriptCompiler(options) {
|
|
97642
97698
|
try {
|
|
@@ -97797,7 +97853,8 @@ var require_dist6 = __commonJS({
|
|
|
97797
97853
|
enabled: options.tsdocMetadata !== false,
|
|
97798
97854
|
tsdocMetadataFilePath: _path2.default.join(
|
|
97799
97855
|
"<projectFolder>",
|
|
97800
|
-
|
|
97856
|
+
"dist",
|
|
97857
|
+
options.projectRoot,
|
|
97801
97858
|
"tsdoc-metadata.api.json"
|
|
97802
97859
|
)
|
|
97803
97860
|
},
|
|
@@ -104791,7 +104848,7 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
|
104791
104848
|
}) {
|
|
104792
104849
|
const entry = globSync(
|
|
104793
104850
|
[
|
|
104794
|
-
rest.entry ? rest.entry : (0, import_path2.join)(sourceRoot, "
|
|
104851
|
+
rest.entry ? rest.entry : (0, import_path2.join)(sourceRoot, "**/*{.ts,.tsx}"),
|
|
104795
104852
|
...additionalEntryPoints ?? []
|
|
104796
104853
|
],
|
|
104797
104854
|
{
|
|
@@ -104863,6 +104920,7 @@ var outExtension = ({ options, format: format2, pkgType }) => {
|
|
|
104863
104920
|
async function runExecutor(options, context) {
|
|
104864
104921
|
try {
|
|
104865
104922
|
console.log("\u{1F4E6} Running Storm build executor on the workspace");
|
|
104923
|
+
options.entry ??= "{sourceRoot}/**/*.{ts,tsx}";
|
|
104866
104924
|
options.outputPath ??= "dist/{projectRoot}";
|
|
104867
104925
|
options.tsConfig ??= "tsconfig.json";
|
|
104868
104926
|
options.banner ??= process.env.STORM_FILE_BANNER;
|
|
@@ -104900,6 +104958,10 @@ ${Object.keys(options).map(
|
|
|
104900
104958
|
options.outputPath ? options.outputPath : (0, import_path3.join)(workspaceRoot, "dist", projectRoot),
|
|
104901
104959
|
context
|
|
104902
104960
|
);
|
|
104961
|
+
options.entry = applyWorkspaceTokens(
|
|
104962
|
+
options.entry ? options.entry : (0, import_path3.join)(workspaceRoot, sourceRoot, "**/*.{ts,tsx}"),
|
|
104963
|
+
context
|
|
104964
|
+
);
|
|
104903
104965
|
if (options.clean !== false) {
|
|
104904
104966
|
console.log(`\u{1F9F9} Cleaning output path: ${outputPath}`);
|
|
104905
104967
|
(0, import_fs_extra.removeSync)(outputPath);
|
|
@@ -240,9 +240,9 @@ var require_brace_expansion = __commonJS({
|
|
|
240
240
|
}
|
|
241
241
|
});
|
|
242
242
|
|
|
243
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
243
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-EPAEWGCP.js
|
|
244
244
|
var require_chunk_EPAEWGCP = __commonJS({
|
|
245
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
245
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
|
|
246
246
|
"use strict";
|
|
247
247
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
248
248
|
var version = "8.0.0";
|
|
@@ -6549,9 +6549,9 @@ var require_resolve_from = __commonJS({
|
|
|
6549
6549
|
}
|
|
6550
6550
|
});
|
|
6551
6551
|
|
|
6552
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
6552
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-GQ77QZBO.js
|
|
6553
6553
|
var require_chunk_GQ77QZBO = __commonJS({
|
|
6554
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
6554
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-GQ77QZBO.js"(exports) {
|
|
6555
6555
|
"use strict";
|
|
6556
6556
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6557
6557
|
function _interopRequireDefault(obj) {
|
|
@@ -6829,9 +6829,9 @@ var require_chunk_GQ77QZBO = __commonJS({
|
|
|
6829
6829
|
}
|
|
6830
6830
|
});
|
|
6831
6831
|
|
|
6832
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
6832
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-UIX4URMV.js
|
|
6833
6833
|
var require_chunk_UIX4URMV = __commonJS({
|
|
6834
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
6834
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-UIX4URMV.js"(exports) {
|
|
6835
6835
|
"use strict";
|
|
6836
6836
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6837
6837
|
function _interopRequireWildcard(obj) {
|
|
@@ -7765,9 +7765,9 @@ var require_dist2 = __commonJS({
|
|
|
7765
7765
|
}
|
|
7766
7766
|
});
|
|
7767
7767
|
|
|
7768
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
7768
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-7G76EW2R.js
|
|
7769
7769
|
var require_chunk_7G76EW2R = __commonJS({
|
|
7770
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
7770
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/chunk-7G76EW2R.js"(exports) {
|
|
7771
7771
|
"use strict";
|
|
7772
7772
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7773
7773
|
function _interopRequireDefault(obj) {
|
|
@@ -62765,9 +62765,9 @@ var require_chokidar = __commonJS({
|
|
|
62765
62765
|
}
|
|
62766
62766
|
});
|
|
62767
62767
|
|
|
62768
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
62768
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/index.js
|
|
62769
62769
|
var require_dist6 = __commonJS({
|
|
62770
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
62770
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=iceytmfictnzlraikn7xieibti_@microsoft+api-extractor@7.38.3_@swc+core@1._wtvyloka5euswj7fdf5gj7ep7u/node_modules/tsup/dist/index.js"(exports) {
|
|
62771
62771
|
"use strict";
|
|
62772
62772
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62773
62773
|
function _interopRequireDefault(obj) {
|
|
@@ -64972,7 +64972,7 @@ var require_dist6 = __commonJS({
|
|
|
64972
64972
|
if (!sourceFile) {
|
|
64973
64973
|
return [];
|
|
64974
64974
|
}
|
|
64975
|
-
const destFileName = fileMapping
|
|
64975
|
+
const destFileName = fileMapping?.get?.(sourceFileName);
|
|
64976
64976
|
if (!destFileName) {
|
|
64977
64977
|
return [];
|
|
64978
64978
|
}
|
|
@@ -64997,14 +64997,70 @@ var require_dist6 = __commonJS({
|
|
|
64997
64997
|
}
|
|
64998
64998
|
return program.getRootFileNames().flatMap(extractExports);
|
|
64999
64999
|
}
|
|
65000
|
+
function emitDtsFiles(program, host, options) {
|
|
65001
|
+
let fileMapping = /* @__PURE__ */ new Map();
|
|
65002
|
+
let writeFile = (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
|
65003
|
+
const sourceFile = _optionalChain([sourceFiles, "optionalAccess", (_14) => _14[0]]);
|
|
65004
|
+
let sourceFileName = _optionalChain([sourceFile, "optionalAccess", (_15) => _15.fileName]);
|
|
65005
|
+
if (sourceFileName && !fileName.endsWith(".map")) {
|
|
65006
|
+
const cwd = options.workspaceRoot ? options.workspaceRoot : program.getCurrentDirectory();
|
|
65007
|
+
fileMapping.set(
|
|
65008
|
+
_chunkGQ77QZBOjs.toAbsolutePath.call(void 0, sourceFileName, cwd),
|
|
65009
|
+
_chunkGQ77QZBOjs.toAbsolutePath.call(void 0, fileName, cwd)
|
|
65010
|
+
);
|
|
65011
|
+
}
|
|
65012
|
+
return host.writeFile(
|
|
65013
|
+
fileName,
|
|
65014
|
+
text,
|
|
65015
|
+
writeByteOrderMark,
|
|
65016
|
+
onError,
|
|
65017
|
+
sourceFiles,
|
|
65018
|
+
data
|
|
65019
|
+
);
|
|
65020
|
+
};
|
|
65021
|
+
logger.info("tsc", "Emitting DTS files");
|
|
65022
|
+
let emitResult = program.emit(void 0, writeFile, void 0, true);
|
|
65023
|
+
let diagnostics = _typescript2.default.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
|
|
65024
|
+
let diagnosticMessages = [];
|
|
65025
|
+
diagnostics.forEach((diagnostic) => {
|
|
65026
|
+
if (diagnostic.file) {
|
|
65027
|
+
let { line, character } = _typescript2.default.getLineAndCharacterOfPosition(
|
|
65028
|
+
diagnostic.file,
|
|
65029
|
+
diagnostic.start
|
|
65030
|
+
);
|
|
65031
|
+
let message = _typescript2.default.flattenDiagnosticMessageText(
|
|
65032
|
+
diagnostic.messageText,
|
|
65033
|
+
"\n"
|
|
65034
|
+
);
|
|
65035
|
+
diagnosticMessages.push(
|
|
65036
|
+
`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`
|
|
65037
|
+
);
|
|
65038
|
+
} else {
|
|
65039
|
+
let message = _typescript2.default.flattenDiagnosticMessageText(
|
|
65040
|
+
diagnostic.messageText,
|
|
65041
|
+
"\n"
|
|
65042
|
+
);
|
|
65043
|
+
diagnosticMessages.push(message);
|
|
65044
|
+
}
|
|
65045
|
+
});
|
|
65046
|
+
let diagnosticMessage = diagnosticMessages.join("\n");
|
|
65047
|
+
if (diagnosticMessage) {
|
|
65048
|
+
logger.error(
|
|
65049
|
+
"TSC",
|
|
65050
|
+
"Failed to emit declaration files.\n\n" + diagnosticMessage
|
|
65051
|
+
);
|
|
65052
|
+
throw new Error("TypeScript compilation failed");
|
|
65053
|
+
}
|
|
65054
|
+
return fileMapping;
|
|
65055
|
+
}
|
|
65000
65056
|
var getFile = (name, logger3) => {
|
|
65001
65057
|
logger3.info("tsc", `Reading file content for: ${name}`);
|
|
65002
65058
|
return _fs2.default.promises.readFile(name, "utf8");
|
|
65003
65059
|
};
|
|
65004
65060
|
var addFile = async (name, map, options, logger3) => {
|
|
65005
65061
|
let relativeName = name.replaceAll("/", "\\").replace(options.workspaceRoot, "").replaceAll("\\", "/");
|
|
65006
|
-
if (
|
|
65007
|
-
relativeName =
|
|
65062
|
+
if (relativeName.startsWith("/")) {
|
|
65063
|
+
relativeName = relativeName.substring(1);
|
|
65008
65064
|
}
|
|
65009
65065
|
if (map && !map.has(relativeName)) {
|
|
65010
65066
|
logger3.info("tsc", `Adding file to FS Map: ${relativeName}`);
|
|
@@ -65100,17 +65156,17 @@ var require_dist6 = __commonJS({
|
|
|
65100
65156
|
logger.info("tsc", "Created program");
|
|
65101
65157
|
logger.info("tsc", "Emitting DTS files with the following options: ");
|
|
65102
65158
|
logger.info("tsc", parsedTsconfig.options);
|
|
65159
|
+
let fileMapping;
|
|
65103
65160
|
try {
|
|
65104
65161
|
logger.info("tsc", "Emitting DTS files");
|
|
65105
|
-
|
|
65106
|
-
program.emit();
|
|
65162
|
+
fileMapping = emitDtsFiles(program, host.compilerHost, options);
|
|
65107
65163
|
logger.info("tsc", "Emit DTS files complete");
|
|
65108
|
-
logger.info("tsc",
|
|
65164
|
+
logger.info("tsc", fileMapping);
|
|
65109
65165
|
} catch (e) {
|
|
65110
65166
|
logger.error("tsc", "An error occured while emitting DTS files");
|
|
65111
65167
|
logger.error("tsc", e);
|
|
65112
65168
|
}
|
|
65113
|
-
return getExports(options, program,
|
|
65169
|
+
return getExports(options, program, fileMapping);
|
|
65114
65170
|
}
|
|
65115
65171
|
async function runTypeScriptCompiler(options) {
|
|
65116
65172
|
try {
|
|
@@ -65271,7 +65327,8 @@ var require_dist6 = __commonJS({
|
|
|
65271
65327
|
enabled: options.tsdocMetadata !== false,
|
|
65272
65328
|
tsdocMetadataFilePath: _path2.default.join(
|
|
65273
65329
|
"<projectFolder>",
|
|
65274
|
-
|
|
65330
|
+
"dist",
|
|
65331
|
+
options.projectRoot,
|
|
65275
65332
|
"tsdoc-metadata.api.json"
|
|
65276
65333
|
)
|
|
65277
65334
|
},
|
|
@@ -72218,7 +72275,7 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
|
72218
72275
|
}) {
|
|
72219
72276
|
const entry = globSync(
|
|
72220
72277
|
[
|
|
72221
|
-
rest.entry ? rest.entry : (0, import_path2.join)(sourceRoot, "
|
|
72278
|
+
rest.entry ? rest.entry : (0, import_path2.join)(sourceRoot, "**/*{.ts,.tsx}"),
|
|
72222
72279
|
...additionalEntryPoints ?? []
|
|
72223
72280
|
],
|
|
72224
72281
|
{
|