@storm-software/cloudflare-tools 0.71.228 → 0.71.232
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 +52 -0
- package/README.md +1 -1
- package/dist/{chunk-BNDZQ5HW.mjs → chunk-25R2FOVY.mjs} +2 -2
- package/dist/{chunk-WWFVS2ZA.mjs → chunk-3YYDX3BD.mjs} +2 -2
- package/dist/{chunk-HNG7IGJA.js → chunk-CDNW3MSR.js} +1 -1
- package/dist/{chunk-JOAXEOFI.mjs → chunk-FYFU3RR3.mjs} +435 -829
- package/dist/{chunk-MLWWR6XQ.js → chunk-HB4NFY6P.js} +2 -2
- package/dist/{chunk-5H4QGC4P.mjs → chunk-IW423EUR.mjs} +1 -1
- package/dist/{chunk-5ISL3L4A.js → chunk-NONOZEPD.js} +2 -2
- package/dist/{chunk-R2PRPZWR.js → chunk-P7Q2HVL4.js} +1 -1
- package/dist/{chunk-B7UW2BLF.mjs → chunk-T3EHTZK6.mjs} +2 -2
- package/dist/{chunk-4MIUPZ4C.js → chunk-TXSHBEGN.js} +388 -782
- package/dist/{chunk-62VEZ3M7.mjs → chunk-VYO5EAVN.mjs} +1 -1
- package/dist/{chunk-AZGMVNDA.mjs → chunk-YZQ56DII.mjs} +2 -2
- package/dist/executors.js +1 -1
- package/dist/executors.mjs +3 -3
- package/dist/generators.js +3 -3
- package/dist/generators.mjs +3 -3
- package/dist/index.js +4 -4
- package/dist/index.mjs +5 -5
- package/dist/src/executors/cloudflare-publish/executor.js +1 -1
- package/dist/src/executors/cloudflare-publish/executor.mjs +3 -3
- package/dist/src/executors/r2-upload-publish/executor.mjs +1 -1
- package/dist/src/executors/r2-upload-publish/untyped.mjs +1 -1
- package/dist/src/executors/serve/executor.d.mts +1 -1
- package/dist/src/executors/serve/executor.d.ts +1 -1
- package/dist/src/executors/serve/executor.js +2 -2
- package/dist/src/executors/serve/executor.mjs +2 -2
- package/dist/src/executors/serve/schema.d.ts +1 -1
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +2 -2
- package/dist/src/generators/worker/generator.js +3 -3
- package/dist/src/generators/worker/generator.mjs +3 -3
- package/dist/src/plugins/index.mjs +1 -1
- package/dist/src/utils/http-handler.mjs +1 -1
- package/dist/src/utils/index.mjs +1 -1
- package/dist/src/utils/r2-bucket-helpers.mjs +1 -1
- package/package.json +5 -5
|
@@ -470,717 +470,32 @@ var executor_default5 = withRunExecutor(
|
|
|
470
470
|
var _https = require('https'); var _https2 = _interopRequireDefault(_https);
|
|
471
471
|
var LARGE_BUFFER = 1024 * 1e6;
|
|
472
472
|
|
|
473
|
-
// ../build-tools/src/config.ts
|
|
474
|
-
var DEFAULT_JS_BANNER = `
|
|
475
|
-
// ---------------------------------------
|
|
476
|
-
// \u{1F5F2} Built by Storm Software
|
|
477
|
-
// ---------------------------------------
|
|
478
|
-
`;
|
|
479
|
-
var DEFAULT_CSS_BANNER = `
|
|
480
|
-
/* ---------------------------------------
|
|
481
|
-
\u{1F5F2} Built by Storm Software
|
|
482
|
-
--------------------------------------- */
|
|
483
|
-
`;
|
|
484
|
-
var DEFAULT_ENVIRONMENT = "production";
|
|
485
|
-
var DEFAULT_TARGET = "esnext";
|
|
486
|
-
var DEFAULT_ORGANIZATION = "storm-software";
|
|
487
|
-
|
|
488
|
-
// ../build-tools/src/plugins/swc.ts
|
|
489
|
-
var _core = require('@swc/core');
|
|
490
|
-
|
|
491
|
-
// ../build-tools/src/plugins/ts-resolve.ts
|
|
492
|
-
|
|
493
|
-
var _module = require('module');
|
|
494
|
-
|
|
495
|
-
var _resolve2 = require('resolve'); var _resolve3 = _interopRequireDefault(_resolve2);
|
|
496
|
-
|
|
497
|
-
// ../build-tools/src/plugins/type-definitions.ts
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
// ../build-tools/src/utilities/copy-assets.ts
|
|
502
|
-
var _internal = require('@nx/js/internal');
|
|
503
|
-
var _glob = require('glob');
|
|
504
|
-
var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
|
|
505
|
-
var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson3 = true, includeSrc = false, banner, footer) => {
|
|
506
|
-
const pendingAssets = Array.from(_nullishCoalesce(assets, () => ( [])));
|
|
507
|
-
pendingAssets.push({
|
|
508
|
-
input: projectRoot,
|
|
509
|
-
glob: "*.md",
|
|
510
|
-
output: "."
|
|
511
|
-
});
|
|
512
|
-
pendingAssets.push({
|
|
513
|
-
input: ".",
|
|
514
|
-
glob: "LICENSE",
|
|
515
|
-
output: "."
|
|
516
|
-
});
|
|
517
|
-
if (generatePackageJson3 === false) {
|
|
518
|
-
pendingAssets.push({
|
|
519
|
-
input: projectRoot,
|
|
520
|
-
glob: "package.json",
|
|
521
|
-
output: "."
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
if (includeSrc === true) {
|
|
525
|
-
pendingAssets.push({
|
|
526
|
-
input: sourceRoot,
|
|
527
|
-
glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
|
|
528
|
-
output: "src/"
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
_chunkAWKQRM2Hjs.writeTrace.call(void 0,
|
|
532
|
-
`\u{1F4DD} Copying the following assets to the output directory:
|
|
533
|
-
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkAWKQRM2Hjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`,
|
|
534
|
-
config
|
|
535
|
-
);
|
|
536
|
-
const assetHandler = new (0, _internal.CopyAssetsHandler)({
|
|
537
|
-
projectDir: projectRoot,
|
|
538
|
-
rootDir: config.workspaceRoot,
|
|
539
|
-
outputDir: outputPath,
|
|
540
|
-
assets: pendingAssets
|
|
541
|
-
});
|
|
542
|
-
await assetHandler.processAllAssetsOnce();
|
|
543
|
-
_chunkAWKQRM2Hjs.writeTrace.call(void 0, "Completed copying assets to the output directory", config);
|
|
544
|
-
if (includeSrc === true) {
|
|
545
|
-
_chunkAWKQRM2Hjs.writeDebug.call(void 0,
|
|
546
|
-
`\u{1F4DD} Adding banner and writing source files: ${_chunkAWKQRM2Hjs.joinPaths.call(void 0,
|
|
547
|
-
outputPath,
|
|
548
|
-
"src"
|
|
549
|
-
)}`,
|
|
550
|
-
config
|
|
551
|
-
);
|
|
552
|
-
const files = await _glob.glob.call(void 0, [
|
|
553
|
-
_chunkAWKQRM2Hjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
554
|
-
_chunkAWKQRM2Hjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
555
|
-
_chunkAWKQRM2Hjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
556
|
-
_chunkAWKQRM2Hjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
557
|
-
]);
|
|
558
|
-
await Promise.allSettled(
|
|
559
|
-
files.map(
|
|
560
|
-
async (file) => _promises.writeFile.call(void 0,
|
|
561
|
-
file,
|
|
562
|
-
`${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
563
|
-
|
|
564
|
-
${await _promises.readFile.call(void 0, file, "utf8")}
|
|
565
|
-
|
|
566
|
-
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
|
|
567
|
-
)
|
|
568
|
-
)
|
|
569
|
-
);
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
|
|
573
|
-
// ../build-tools/src/utilities/generate-package-json.ts
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
var _projectgraph = require('nx/src/project-graph/project-graph');
|
|
583
|
-
var addPackageDependencies = async (workspaceRoot2, projectRoot, projectName, packageJson) => {
|
|
584
|
-
let projectGraph;
|
|
585
|
-
try {
|
|
586
|
-
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
587
|
-
} catch (e2) {
|
|
588
|
-
await _projectgraph.createProjectGraphAsync.call(void 0, );
|
|
589
|
-
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
590
|
-
}
|
|
591
|
-
if (!projectGraph) {
|
|
592
|
-
throw new Error(
|
|
593
|
-
"The Build process failed because the project graph is not available. Please run the build command again."
|
|
594
|
-
);
|
|
595
|
-
}
|
|
596
|
-
const projectDependencies = _internal.calculateProjectBuildableDependencies.call(void 0,
|
|
597
|
-
void 0,
|
|
598
|
-
projectGraph,
|
|
599
|
-
workspaceRoot2,
|
|
600
|
-
projectName,
|
|
601
|
-
process.env.NX_TASK_TARGET_TARGET || "build",
|
|
602
|
-
process.env.NX_TASK_TARGET_CONFIGURATION || "production",
|
|
603
|
-
true
|
|
604
|
-
);
|
|
605
|
-
const localPackages = [];
|
|
606
|
-
for (const project of projectDependencies.dependencies.filter(
|
|
607
|
-
(dep) => dep.node.type === "lib" && _optionalChain([dep, 'access', _44 => _44.node, 'access', _45 => _45.data, 'optionalAccess', _46 => _46.root]) !== projectRoot && _optionalChain([dep, 'access', _47 => _47.node, 'access', _48 => _48.data, 'optionalAccess', _49 => _49.root]) !== workspaceRoot2
|
|
608
|
-
)) {
|
|
609
|
-
const projectNode = project.node;
|
|
610
|
-
if (projectNode.data.root) {
|
|
611
|
-
const projectPackageJsonPath = _chunkAWKQRM2Hjs.joinPaths.call(void 0,
|
|
612
|
-
workspaceRoot2,
|
|
613
|
-
projectNode.data.root,
|
|
614
|
-
"package.json"
|
|
615
|
-
);
|
|
616
|
-
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
617
|
-
const projectPackageJsonContent = await _promises.readFile.call(void 0,
|
|
618
|
-
projectPackageJsonPath,
|
|
619
|
-
"utf8"
|
|
620
|
-
);
|
|
621
|
-
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
622
|
-
if (projectPackageJson.private !== true) {
|
|
623
|
-
localPackages.push(projectPackageJson);
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
if (localPackages.length > 0) {
|
|
629
|
-
_chunkAWKQRM2Hjs.writeTrace.call(void 0,
|
|
630
|
-
`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`
|
|
631
|
-
);
|
|
632
|
-
const projectJsonFile = await _promises.readFile.call(void 0,
|
|
633
|
-
_chunkAWKQRM2Hjs.joinPaths.call(void 0, projectRoot, "project.json"),
|
|
634
|
-
"utf8"
|
|
635
|
-
);
|
|
636
|
-
const projectJson = JSON.parse(projectJsonFile);
|
|
637
|
-
const projectName2 = projectJson.name;
|
|
638
|
-
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
639
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _50 => _50.projects, 'optionalAccess', _51 => _51[projectName2]])) {
|
|
640
|
-
throw new Error(
|
|
641
|
-
"The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project."
|
|
642
|
-
);
|
|
643
|
-
}
|
|
644
|
-
const implicitDependencies = _optionalChain([projectConfigurations, 'access', _52 => _52.projects, 'optionalAccess', _53 => _53[projectName2], 'access', _54 => _54.implicitDependencies, 'optionalAccess', _55 => _55.reduce, 'call', _56 => _56((ret, dep) => {
|
|
645
|
-
if (_optionalChain([projectConfigurations, 'access', _57 => _57.projects, 'optionalAccess', _58 => _58[dep]])) {
|
|
646
|
-
const depPackageJsonPath = _chunkAWKQRM2Hjs.joinPaths.call(void 0,
|
|
647
|
-
workspaceRoot2,
|
|
648
|
-
projectConfigurations.projects[dep].root,
|
|
649
|
-
"package.json"
|
|
650
|
-
);
|
|
651
|
-
if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
|
|
652
|
-
const depPackageJsonContent = _fs.readFileSync.call(void 0,
|
|
653
|
-
depPackageJsonPath,
|
|
654
|
-
"utf8"
|
|
655
|
-
);
|
|
656
|
-
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
657
|
-
if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
|
|
658
|
-
ret.push(depPackageJson.name);
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
return ret;
|
|
663
|
-
}, [])]);
|
|
664
|
-
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
665
|
-
if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _59 => _59.includes, 'call', _60 => _60(localPackage.name)]) && _optionalChain([packageJson, 'access', _61 => _61.devDependencies, 'optionalAccess', _62 => _62[localPackage.name]]) === void 0) {
|
|
666
|
-
ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
|
|
667
|
-
}
|
|
668
|
-
return ret;
|
|
669
|
-
}, _nullishCoalesce(packageJson.dependencies, () => ( {})));
|
|
670
|
-
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
671
|
-
if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess', _63 => _63.includes, 'call', _64 => _64(localPackage.name)]) && _optionalChain([packageJson, 'access', _65 => _65.dependencies, 'optionalAccess', _66 => _66[localPackage.name]]) === void 0) {
|
|
672
|
-
ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
|
|
673
|
-
}
|
|
674
|
-
return ret;
|
|
675
|
-
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
676
|
-
} else {
|
|
677
|
-
_chunkAWKQRM2Hjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
678
|
-
}
|
|
679
|
-
return packageJson;
|
|
680
|
-
};
|
|
681
|
-
var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
682
|
-
const workspaceRoot2 = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : _chunkPGTHXO6Mjs.findWorkspaceRoot.call(void 0, );
|
|
683
|
-
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
684
|
-
_chunkAWKQRM2Hjs.joinPaths.call(void 0, workspaceRoot2, "package.json"),
|
|
685
|
-
"utf8"
|
|
686
|
-
);
|
|
687
|
-
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
688
|
-
packageJson.type ??= "module";
|
|
689
|
-
packageJson.sideEffects ??= false;
|
|
690
|
-
if (includeSrc === true) {
|
|
691
|
-
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
692
|
-
if (distSrc.startsWith("/")) {
|
|
693
|
-
distSrc = distSrc.substring(1);
|
|
694
|
-
}
|
|
695
|
-
packageJson.source ??= `${_chunkAWKQRM2Hjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
696
|
-
}
|
|
697
|
-
packageJson.files ??= ["dist/**/*"];
|
|
698
|
-
if (includeSrc === true && !packageJson.files.includes("src")) {
|
|
699
|
-
packageJson.files.push("src/**/*");
|
|
700
|
-
}
|
|
701
|
-
packageJson.publishConfig ??= {
|
|
702
|
-
access: "public"
|
|
703
|
-
};
|
|
704
|
-
packageJson.description ??= workspacePackageJson.description;
|
|
705
|
-
packageJson.homepage ??= workspacePackageJson.homepage;
|
|
706
|
-
packageJson.bugs ??= workspacePackageJson.bugs;
|
|
707
|
-
packageJson.license ??= workspacePackageJson.license;
|
|
708
|
-
packageJson.keywords ??= workspacePackageJson.keywords;
|
|
709
|
-
packageJson.funding ??= workspacePackageJson.funding;
|
|
710
|
-
packageJson.author ??= workspacePackageJson.author;
|
|
711
|
-
packageJson.maintainers ??= workspacePackageJson.maintainers;
|
|
712
|
-
if (!packageJson.maintainers && packageJson.author) {
|
|
713
|
-
packageJson.maintainers = [packageJson.author];
|
|
714
|
-
}
|
|
715
|
-
packageJson.contributors ??= workspacePackageJson.contributors;
|
|
716
|
-
if (!packageJson.contributors && packageJson.author) {
|
|
717
|
-
packageJson.contributors = [packageJson.author];
|
|
718
|
-
}
|
|
719
|
-
packageJson.repository ??= workspacePackageJson.repository;
|
|
720
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkAWKQRM2Hjs.joinPaths.call(void 0, "packages", projectName);
|
|
721
|
-
return packageJson;
|
|
722
|
-
};
|
|
723
|
-
var addPackageJsonExport = (file, type = "module", sourceRoot) => {
|
|
724
|
-
let entry = file.replaceAll("\\", "/");
|
|
725
|
-
if (sourceRoot) {
|
|
726
|
-
entry = entry.replace(sourceRoot, "");
|
|
727
|
-
}
|
|
728
|
-
return {
|
|
729
|
-
import: {
|
|
730
|
-
types: `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
|
|
731
|
-
default: `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
|
|
732
|
-
},
|
|
733
|
-
require: {
|
|
734
|
-
types: `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
|
|
735
|
-
default: `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
|
|
736
|
-
},
|
|
737
|
-
default: {
|
|
738
|
-
types: `./dist/${entry}.d.${type !== "fixed" ? "ts" : "mts"}`,
|
|
739
|
-
default: `./dist/${entry}.${type !== "fixed" ? "js" : "mjs"}`
|
|
740
|
-
}
|
|
741
|
-
};
|
|
742
|
-
};
|
|
743
|
-
|
|
744
|
-
// ../build-tools/src/utilities/get-entry-points.ts
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
// ../build-tools/src/utilities/get-env.ts
|
|
748
|
-
var getEnv = (builder, options) => {
|
|
749
|
-
return {
|
|
750
|
-
STORM_BUILD: builder,
|
|
751
|
-
STORM_ORG: options.orgName || DEFAULT_ORGANIZATION,
|
|
752
|
-
STORM_NAME: options.name,
|
|
753
|
-
STORM_MODE: options.mode || DEFAULT_ENVIRONMENT,
|
|
754
|
-
STORM_PLATFORM: options.platform,
|
|
755
|
-
STORM_FORMAT: JSON.stringify(options.format),
|
|
756
|
-
STORM_TARGET: JSON.stringify(options.target),
|
|
757
|
-
...options.env
|
|
758
|
-
};
|
|
759
|
-
};
|
|
760
|
-
|
|
761
|
-
// ../build-tools/src/utilities/read-nx-config.ts
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
// ../build-tools/src/utilities/task-graph.ts
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
|
|
770
|
-
|
|
771
|
-
// ../esbuild/src/assets.ts
|
|
772
|
-
async function copyBuildAssets(context) {
|
|
773
|
-
if (!_optionalChain([context, 'access', _67 => _67.result, 'optionalAccess', _68 => _68.errors, 'access', _69 => _69.length]) && _optionalChain([context, 'access', _70 => _70.options, 'access', _71 => _71.assets, 'optionalAccess', _72 => _72.length])) {
|
|
774
|
-
_chunkAWKQRM2Hjs.writeDebug.call(void 0,
|
|
775
|
-
` \u{1F4CB} Copying ${context.options.assets.length} asset files to output directory: ${context.outputPath}`,
|
|
776
|
-
context.workspaceConfig
|
|
777
|
-
);
|
|
778
|
-
const stopwatch = _chunkAWKQRM2Hjs.getStopwatch.call(void 0, `${context.options.name} asset copy`);
|
|
779
|
-
await copyAssets(
|
|
780
|
-
context.workspaceConfig,
|
|
781
|
-
_nullishCoalesce(context.options.assets, () => ( [])),
|
|
782
|
-
context.outputPath,
|
|
783
|
-
context.options.projectRoot,
|
|
784
|
-
context.sourceRoot,
|
|
785
|
-
true,
|
|
786
|
-
false
|
|
787
|
-
);
|
|
788
|
-
stopwatch();
|
|
789
|
-
}
|
|
790
|
-
return context;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
// ../esbuild/src/clean.ts
|
|
794
|
-
|
|
795
|
-
async function cleanDirectories(directory) {
|
|
796
|
-
await _promises.rm.call(void 0, directory, { recursive: true, force: true });
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
// ../esbuild/src/context.ts
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
|
|
808
|
-
|
|
809
|
-
// ../esbuild/src/config.ts
|
|
810
|
-
var DEFAULT_BUILD_OPTIONS = {
|
|
811
|
-
platform: "node",
|
|
812
|
-
target: "node22",
|
|
813
|
-
format: "esm",
|
|
814
|
-
mode: "production",
|
|
815
|
-
generatePackageJson: true,
|
|
816
|
-
includeSrc: false,
|
|
817
|
-
keepNames: true,
|
|
818
|
-
metafile: false,
|
|
819
|
-
treeshake: true,
|
|
820
|
-
splitting: true,
|
|
821
|
-
shims: false,
|
|
822
|
-
watch: false,
|
|
823
|
-
bundle: true,
|
|
824
|
-
distDir: "dist",
|
|
825
|
-
loader: {
|
|
826
|
-
".aac": "file",
|
|
827
|
-
".css": "file",
|
|
828
|
-
".eot": "file",
|
|
829
|
-
".flac": "file",
|
|
830
|
-
".gif": "file",
|
|
831
|
-
".jpeg": "file",
|
|
832
|
-
".jpg": "file",
|
|
833
|
-
".mp3": "file",
|
|
834
|
-
".mp4": "file",
|
|
835
|
-
".ogg": "file",
|
|
836
|
-
".otf": "file",
|
|
837
|
-
".png": "file",
|
|
838
|
-
".svg": "file",
|
|
839
|
-
".ttf": "file",
|
|
840
|
-
".wav": "file",
|
|
841
|
-
".webm": "file",
|
|
842
|
-
".webp": "file",
|
|
843
|
-
".woff": "file",
|
|
844
|
-
".woff2": "file"
|
|
845
|
-
},
|
|
846
|
-
banner: {
|
|
847
|
-
js: DEFAULT_JS_BANNER,
|
|
848
|
-
css: DEFAULT_CSS_BANNER
|
|
849
|
-
}
|
|
850
|
-
};
|
|
851
|
-
|
|
852
|
-
// ../esbuild/src/context.ts
|
|
853
|
-
async function resolveContext(userOptions) {
|
|
854
|
-
const projectRoot = userOptions.projectRoot;
|
|
855
|
-
const workspaceRoot2 = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
|
|
856
|
-
if (!workspaceRoot2) {
|
|
857
|
-
throw new Error("Cannot find Nx workspace root");
|
|
858
|
-
}
|
|
859
|
-
const workspaceConfig = await _chunkPGTHXO6Mjs.getWorkspaceConfig.call(void 0, true, {
|
|
860
|
-
workspaceRoot: workspaceRoot2.dir
|
|
861
|
-
});
|
|
862
|
-
_chunkAWKQRM2Hjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", workspaceConfig);
|
|
863
|
-
const stopwatch = _chunkAWKQRM2Hjs.getStopwatch.call(void 0, "Build options resolution");
|
|
864
|
-
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
865
|
-
exitOnError: true
|
|
866
|
-
});
|
|
867
|
-
const projectJsonPath = _chunkAWKQRM2Hjs.joinPaths.call(void 0,
|
|
868
|
-
workspaceRoot2.dir,
|
|
869
|
-
projectRoot,
|
|
870
|
-
"project.json"
|
|
871
|
-
);
|
|
872
|
-
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
873
|
-
throw new Error("Cannot find project.json configuration");
|
|
874
|
-
}
|
|
875
|
-
const projectJsonFile = await _promises2.default.readFile(projectJsonPath, "utf8");
|
|
876
|
-
const projectJson = JSON.parse(projectJsonFile);
|
|
877
|
-
const projectName = projectJson.name || userOptions.name;
|
|
878
|
-
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
879
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _73 => _73.projects, 'optionalAccess', _74 => _74[projectName]])) {
|
|
880
|
-
throw new Error(
|
|
881
|
-
"The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project."
|
|
882
|
-
);
|
|
883
|
-
}
|
|
884
|
-
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
885
|
-
options.name ??= projectName;
|
|
886
|
-
const packageJsonPath = _chunkAWKQRM2Hjs.joinPaths.call(void 0,
|
|
887
|
-
workspaceRoot2.dir,
|
|
888
|
-
options.projectRoot,
|
|
889
|
-
"package.json"
|
|
890
|
-
);
|
|
891
|
-
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
892
|
-
throw new Error("Cannot find package.json configuration");
|
|
893
|
-
}
|
|
894
|
-
const env = getEnv("esbuild", options);
|
|
895
|
-
const define = _defu2.default.call(void 0, _nullishCoalesce(options.define, () => ( {})), _nullishCoalesce(env, () => ( {})));
|
|
896
|
-
const resolvedOptions = {
|
|
897
|
-
...options,
|
|
898
|
-
tsconfig: userOptions.tsconfig === null ? void 0 : userOptions.tsconfig ? userOptions.tsconfig : _chunkAWKQRM2Hjs.joinPaths.call(void 0, workspaceRoot2.dir, projectRoot, "tsconfig.json"),
|
|
899
|
-
metafile: userOptions.mode === "development",
|
|
900
|
-
clean: false,
|
|
901
|
-
env,
|
|
902
|
-
define: {
|
|
903
|
-
STORM_FORMAT: JSON.stringify(options.format),
|
|
904
|
-
...Object.keys(define).filter((key) => define[key] !== void 0).reduce((res, key) => {
|
|
905
|
-
const value = JSON.stringify(define[key]);
|
|
906
|
-
const safeKey = key.replaceAll("(", "").replaceAll(")", "");
|
|
907
|
-
return {
|
|
908
|
-
...res,
|
|
909
|
-
[`process.env.${safeKey}`]: value,
|
|
910
|
-
[`import.meta.env.${safeKey}`]: value
|
|
911
|
-
};
|
|
912
|
-
}, {})
|
|
913
|
-
}
|
|
914
|
-
};
|
|
915
|
-
stopwatch();
|
|
916
|
-
const context = {
|
|
917
|
-
options: resolvedOptions,
|
|
918
|
-
clean: userOptions.clean !== false,
|
|
919
|
-
workspaceConfig,
|
|
920
|
-
projectConfigurations,
|
|
921
|
-
projectName,
|
|
922
|
-
projectGraph,
|
|
923
|
-
sourceRoot: resolvedOptions.sourceRoot || projectJson.sourceRoot || _chunkAWKQRM2Hjs.joinPaths.call(void 0, resolvedOptions.projectRoot, "src"),
|
|
924
|
-
outputPath: resolvedOptions.outputPath || _chunkAWKQRM2Hjs.joinPaths.call(void 0,
|
|
925
|
-
workspaceConfig.workspaceRoot,
|
|
926
|
-
"dist",
|
|
927
|
-
resolvedOptions.projectRoot
|
|
928
|
-
),
|
|
929
|
-
minify: resolvedOptions.minify || resolvedOptions.mode === "production"
|
|
930
|
-
};
|
|
931
|
-
context.options.esbuildPlugins = [..._nullishCoalesce(context.options.esbuildPlugins, () => ( []))];
|
|
932
|
-
if (context.options.verbose) {
|
|
933
|
-
_chunkAWKQRM2Hjs.writeDebug.call(void 0,
|
|
934
|
-
` \u2699\uFE0F Build options resolved:
|
|
935
|
-
|
|
936
|
-
${_chunkAWKQRM2Hjs.formatLogMessage.call(void 0, context.options)}`,
|
|
937
|
-
workspaceConfig
|
|
938
|
-
);
|
|
939
|
-
}
|
|
940
|
-
return context;
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
// ../esbuild/src/package-json.ts
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
async function generatePackageJson(context) {
|
|
948
|
-
if (context.options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkAWKQRM2Hjs.joinPaths.call(void 0, context.options.projectRoot, "package.json"))) {
|
|
949
|
-
_chunkAWKQRM2Hjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context.workspaceConfig);
|
|
950
|
-
const stopwatch = _chunkAWKQRM2Hjs.getStopwatch.call(void 0, "Write package.json file");
|
|
951
|
-
const packageJsonPath = _chunkAWKQRM2Hjs.joinPaths.call(void 0,
|
|
952
|
-
context.options.projectRoot,
|
|
953
|
-
"project.json"
|
|
954
|
-
);
|
|
955
|
-
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
956
|
-
throw new Error("Cannot find package.json configuration");
|
|
957
|
-
}
|
|
958
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
959
|
-
_chunkAWKQRM2Hjs.joinPaths.call(void 0,
|
|
960
|
-
context.workspaceConfig.workspaceRoot,
|
|
961
|
-
context.options.projectRoot,
|
|
962
|
-
"package.json"
|
|
963
|
-
),
|
|
964
|
-
"utf8"
|
|
965
|
-
);
|
|
966
|
-
let packageJson = JSON.parse(packageJsonFile);
|
|
967
|
-
if (!packageJson) {
|
|
968
|
-
throw new Error("Cannot find package.json configuration file");
|
|
969
|
-
}
|
|
970
|
-
packageJson = await addPackageDependencies(
|
|
971
|
-
context.workspaceConfig.workspaceRoot,
|
|
972
|
-
context.options.projectRoot,
|
|
973
|
-
context.projectName,
|
|
974
|
-
packageJson
|
|
975
|
-
);
|
|
976
|
-
packageJson = await addWorkspacePackageJsonFields(
|
|
977
|
-
context.workspaceConfig,
|
|
978
|
-
context.options.projectRoot,
|
|
979
|
-
context.sourceRoot,
|
|
980
|
-
context.projectName,
|
|
981
|
-
false,
|
|
982
|
-
packageJson
|
|
983
|
-
);
|
|
984
|
-
if (context.options.entry) {
|
|
985
|
-
packageJson.exports ??= {};
|
|
986
|
-
packageJson.exports["./package.json"] ??= "./package.json";
|
|
987
|
-
const entryPoints = Array.isArray(context.options.entry) ? context.options.entry : Object.keys(context.options.entry);
|
|
988
|
-
if (entryPoints.length > 0) {
|
|
989
|
-
const defaultEntry = entryPoints.includes("index") ? `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index` : `.${context.options.distDir ? `/${context.options.distDir}` : ""}/${entryPoints[0]}`;
|
|
990
|
-
const isEsm = Array.isArray(context.options.format) ? context.options.format.includes("esm") : context.options.format === "esm";
|
|
991
|
-
const isCjs = Array.isArray(context.options.format) ? context.options.format.includes("cjs") : context.options.format === "cjs";
|
|
992
|
-
const isDts = context.options.dts || context.options.experimentalDts;
|
|
993
|
-
packageJson.exports["."] ??= `${defaultEntry}.${isEsm ? "mjs" : isCjs ? "cjs" : "js"}`;
|
|
994
|
-
for (const entryPoint of entryPoints) {
|
|
995
|
-
packageJson.exports[`./${entryPoint}`] ??= {};
|
|
996
|
-
if (isEsm) {
|
|
997
|
-
if (isDts) {
|
|
998
|
-
packageJson.exports[`./${entryPoint}`].import = {
|
|
999
|
-
types: `./dist/${entryPoint}.d.mts`,
|
|
1000
|
-
default: `./dist/${entryPoint}.mjs`
|
|
1001
|
-
};
|
|
1002
|
-
} else {
|
|
1003
|
-
packageJson.exports[`./${entryPoint}`].import = `./dist/${entryPoint}.mjs`;
|
|
1004
|
-
}
|
|
1005
|
-
if (isDts) {
|
|
1006
|
-
packageJson.exports[`./${entryPoint}`].default = {
|
|
1007
|
-
types: `./dist/${entryPoint}.d.mts`,
|
|
1008
|
-
default: `./dist/${entryPoint}.mjs`
|
|
1009
|
-
};
|
|
1010
|
-
} else {
|
|
1011
|
-
packageJson.exports[`./${entryPoint}`].default = `./dist/${entryPoint}.mjs`;
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
if (isCjs) {
|
|
1015
|
-
if (isDts) {
|
|
1016
|
-
packageJson.exports[`./${entryPoint}`].require = {
|
|
1017
|
-
types: `./dist/${entryPoint}.d.cts`,
|
|
1018
|
-
default: `./dist/${entryPoint}.cjs`
|
|
1019
|
-
};
|
|
1020
|
-
} else {
|
|
1021
|
-
packageJson.exports[`./${entryPoint}`].require = `./dist/${entryPoint}.cjs`;
|
|
1022
|
-
}
|
|
1023
|
-
if (!isEsm) {
|
|
1024
|
-
if (isDts) {
|
|
1025
|
-
packageJson.exports[`./${entryPoint}`].default = {
|
|
1026
|
-
types: `./dist/${entryPoint}.d.cts`,
|
|
1027
|
-
default: `./dist/${entryPoint}.cjs`
|
|
1028
|
-
};
|
|
1029
|
-
} else {
|
|
1030
|
-
packageJson.exports[`./${entryPoint}`].default = `./dist/${entryPoint}.cjs`;
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
if (!isEsm && !isCjs) {
|
|
1035
|
-
if (isDts) {
|
|
1036
|
-
packageJson.exports[`./${entryPoint}`].default = {
|
|
1037
|
-
types: `./dist/${entryPoint}.d.ts`,
|
|
1038
|
-
default: `./dist/${entryPoint}.js`
|
|
1039
|
-
};
|
|
1040
|
-
} else {
|
|
1041
|
-
packageJson.exports[`./${entryPoint}`].default = `./dist/${entryPoint}.js`;
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
if (isEsm) {
|
|
1046
|
-
packageJson.module = `${defaultEntry}.mjs`;
|
|
1047
|
-
} else {
|
|
1048
|
-
packageJson.main = `${defaultEntry}.cjs`;
|
|
1049
|
-
}
|
|
1050
|
-
if (isDts) {
|
|
1051
|
-
packageJson.types = `${defaultEntry}.d.${isEsm ? "mts" : isCjs ? "cts" : "ts"}`;
|
|
1052
|
-
}
|
|
1053
|
-
packageJson.exports = Object.keys(packageJson.exports).reduce(
|
|
1054
|
-
(ret, key) => {
|
|
1055
|
-
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
1056
|
-
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
1057
|
-
}
|
|
1058
|
-
return ret;
|
|
1059
|
-
},
|
|
1060
|
-
packageJson.exports
|
|
1061
|
-
);
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1065
|
-
_chunkAWKQRM2Hjs.joinPaths.call(void 0, context.outputPath, "package.json"),
|
|
1066
|
-
packageJson
|
|
1067
|
-
);
|
|
1068
|
-
stopwatch();
|
|
1069
|
-
}
|
|
1070
|
-
return context;
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
// ../tsup/src/index.ts
|
|
1074
|
-
var _tsup = require('tsup');
|
|
1075
|
-
async function build(options) {
|
|
1076
|
-
if (!options.silent) {
|
|
1077
|
-
_chunkAWKQRM2Hjs.writeDebug.call(void 0,
|
|
1078
|
-
` \u{1F680} Running ${options.name || "tsup"} build`,
|
|
1079
|
-
options.workspaceConfig
|
|
1080
|
-
);
|
|
1081
|
-
}
|
|
1082
|
-
const stopwatch = _chunkAWKQRM2Hjs.getStopwatch.call(void 0, `${options.name || "tsup"} build`);
|
|
1083
|
-
await _tsup.build.call(void 0, options);
|
|
1084
|
-
if (!options.silent) {
|
|
1085
|
-
stopwatch();
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
// ../esbuild/src/tsup.ts
|
|
1090
|
-
async function executeTsup(context) {
|
|
1091
|
-
_chunkAWKQRM2Hjs.writeDebug.call(void 0,
|
|
1092
|
-
` \u{1F680} Running ${context.options.name} build`,
|
|
1093
|
-
context.workspaceConfig
|
|
1094
|
-
);
|
|
1095
|
-
const stopwatch = _chunkAWKQRM2Hjs.getStopwatch.call(void 0, `${context.options.name} build`);
|
|
1096
|
-
await build({
|
|
1097
|
-
...context.options,
|
|
1098
|
-
outDir: context.options.distDir ? _chunkAWKQRM2Hjs.joinPaths.call(void 0, context.outputPath, context.options.distDir) : context.outputPath,
|
|
1099
|
-
workspaceConfig: context.workspaceConfig
|
|
1100
|
-
});
|
|
1101
|
-
stopwatch();
|
|
1102
|
-
return context;
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
// ../esbuild/src/build.ts
|
|
1106
|
-
async function reportResults(context) {
|
|
1107
|
-
if (_optionalChain([context, 'access', _75 => _75.result, 'optionalAccess', _76 => _76.errors, 'access', _77 => _77.length]) === 0) {
|
|
1108
|
-
if (context.result.warnings.length > 0) {
|
|
1109
|
-
_chunkAWKQRM2Hjs.writeWarning.call(void 0,
|
|
1110
|
-
` \u{1F6A7} The following warnings occurred during the build: ${context.result.warnings.map((warning) => warning.text).join("\n")}`,
|
|
1111
|
-
context.workspaceConfig
|
|
1112
|
-
);
|
|
1113
|
-
}
|
|
1114
|
-
_chunkAWKQRM2Hjs.writeSuccess.call(void 0,
|
|
1115
|
-
` \u{1F4E6} The ${context.options.name} build completed successfully`,
|
|
1116
|
-
context.workspaceConfig
|
|
1117
|
-
);
|
|
1118
|
-
} else if (_optionalChain([context, 'access', _78 => _78.result, 'optionalAccess', _79 => _79.errors]) && _optionalChain([context, 'access', _80 => _80.result, 'optionalAccess', _81 => _81.errors, 'access', _82 => _82.length]) > 0) {
|
|
1119
|
-
_chunkAWKQRM2Hjs.writeError.call(void 0,
|
|
1120
|
-
` \u274C The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`,
|
|
1121
|
-
context.workspaceConfig
|
|
1122
|
-
);
|
|
1123
|
-
throw new Error(
|
|
1124
|
-
`The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`
|
|
1125
|
-
);
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
async function cleanOutputPath(context) {
|
|
1129
|
-
if (context.clean !== false && context.outputPath) {
|
|
1130
|
-
_chunkAWKQRM2Hjs.writeDebug.call(void 0,
|
|
1131
|
-
` \u{1F9F9} Cleaning ${context.options.name} output path: ${context.outputPath}`,
|
|
1132
|
-
context.workspaceConfig
|
|
1133
|
-
);
|
|
1134
|
-
const stopwatch = _chunkAWKQRM2Hjs.getStopwatch.call(void 0, `${context.options.name} output clean`);
|
|
1135
|
-
await cleanDirectories(context.outputPath);
|
|
1136
|
-
stopwatch();
|
|
1137
|
-
}
|
|
1138
|
-
return context;
|
|
1139
|
-
}
|
|
1140
|
-
async function build2(options) {
|
|
1141
|
-
_chunkAWKQRM2Hjs.writeDebug.call(void 0, ` ${_chunkAWKQRM2Hjs.brandIcon.call(void 0, )} Executing Storm ESBuild pipeline`);
|
|
1142
|
-
const stopwatch = _chunkAWKQRM2Hjs.getStopwatch.call(void 0, "ESBuild pipeline");
|
|
1143
|
-
try {
|
|
1144
|
-
const opts = Array.isArray(options) ? options : [options];
|
|
1145
|
-
if (opts.length === 0) {
|
|
1146
|
-
throw new Error("No build options were provided");
|
|
1147
|
-
}
|
|
1148
|
-
const context = await resolveContext(options);
|
|
1149
|
-
await cleanOutputPath(context);
|
|
1150
|
-
await Promise.all([
|
|
1151
|
-
// dependencyCheck(context.options),
|
|
1152
|
-
generatePackageJson(context),
|
|
1153
|
-
copyBuildAssets(context),
|
|
1154
|
-
executeTsup(context)
|
|
1155
|
-
]);
|
|
1156
|
-
await reportResults(context);
|
|
1157
|
-
_chunkAWKQRM2Hjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
1158
|
-
} catch (error) {
|
|
1159
|
-
_chunkAWKQRM2Hjs.writeFatal.call(void 0,
|
|
1160
|
-
"Fatal errors that the build process could not recover from have occured. The build process has been terminated."
|
|
1161
|
-
);
|
|
1162
|
-
throw error;
|
|
1163
|
-
} finally {
|
|
1164
|
-
stopwatch();
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
473
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
474
|
+
var _jiti = require('jiti');
|
|
1169
475
|
async function esbuildExecutorFn(options, context, config) {
|
|
1170
476
|
_chunkAWKQRM2Hjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
1171
|
-
if (!_optionalChain([context, 'access',
|
|
477
|
+
if (!_optionalChain([context, 'access', _44 => _44.projectsConfigurations, 'optionalAccess', _45 => _45.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _46 => _46.projectsConfigurations, 'access', _47 => _47.projects, 'access', _48 => _48[context.projectName], 'optionalAccess', _49 => _49.root])) {
|
|
1172
478
|
throw new Error(
|
|
1173
479
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
1174
480
|
);
|
|
1175
481
|
}
|
|
482
|
+
const jiti = _jiti.createJiti.call(void 0, _optionalChain([config, 'optionalAccess', _50 => _50.workspaceRoot]) || process.cwd(), {
|
|
483
|
+
fsCache: _optionalChain([config, 'optionalAccess', _51 => _51.skipCache]) ? false : _chunkAWKQRM2Hjs.joinPaths.call(void 0,
|
|
484
|
+
_optionalChain([config, 'optionalAccess', _52 => _52.workspaceRoot]) || process.cwd(),
|
|
485
|
+
_optionalChain([config, 'optionalAccess', _53 => _53.directories, 'optionalAccess', _54 => _54.cache]) || "node_modules/.cache/storm",
|
|
486
|
+
"jiti"
|
|
487
|
+
),
|
|
488
|
+
interopDefault: true
|
|
489
|
+
});
|
|
490
|
+
const { build: build2 } = await jiti.import(jiti.esmResolve("@storm-software/esbuild"));
|
|
1176
491
|
await build2({
|
|
1177
492
|
...options,
|
|
1178
493
|
projectRoot: (
|
|
1179
494
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1180
|
-
_optionalChain([context, 'access',
|
|
495
|
+
_optionalChain([context, 'access', _55 => _55.projectsConfigurations, 'access', _56 => _56.projects, 'optionalAccess', _57 => _57[context.projectName], 'access', _58 => _58.root])
|
|
1181
496
|
),
|
|
1182
497
|
name: context.projectName,
|
|
1183
|
-
sourceRoot: _optionalChain([context, 'access',
|
|
498
|
+
sourceRoot: _optionalChain([context, 'access', _59 => _59.projectsConfigurations, 'access', _60 => _60.projects, 'optionalAccess', _61 => _61[context.projectName], 'optionalAccess', _62 => _62.sourceRoot]),
|
|
1184
499
|
format: options.format,
|
|
1185
500
|
platform: options.platform
|
|
1186
501
|
});
|
|
@@ -1205,7 +520,7 @@ var executor_default6 = withRunExecutor(
|
|
|
1205
520
|
);
|
|
1206
521
|
|
|
1207
522
|
// ../workspace-tools/src/executors/napi/executor.ts
|
|
1208
|
-
|
|
523
|
+
|
|
1209
524
|
var _fileutils = require('nx/src/utils/fileutils');
|
|
1210
525
|
async function napiExecutor(options, context, config) {
|
|
1211
526
|
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
@@ -1219,12 +534,12 @@ async function napiExecutor(options, context, config) {
|
|
|
1219
534
|
const { NapiCli } = await jiti.import(
|
|
1220
535
|
jiti.esmResolve("@napi-rs/cli")
|
|
1221
536
|
);
|
|
1222
|
-
if (!_optionalChain([context, 'access',
|
|
537
|
+
if (!_optionalChain([context, 'access', _63 => _63.projectGraph, 'optionalAccess', _64 => _64.nodes, 'access', _65 => _65[_nullishCoalesce(context.projectName, () => ( ""))]])) {
|
|
1223
538
|
throw new Error(
|
|
1224
539
|
"The Napi Build process failed because the project could not be found in the project graph. Please run this command from a workspace root directory."
|
|
1225
540
|
);
|
|
1226
541
|
}
|
|
1227
|
-
const projectRoot = _optionalChain([context, 'access',
|
|
542
|
+
const projectRoot = _optionalChain([context, 'access', _66 => _66.projectGraph, 'optionalAccess', _67 => _67.nodes, 'access', _68 => _68[_nullishCoalesce(context.projectName, () => ( ""))], 'optionalAccess', _69 => _69.data, 'access', _70 => _70.root]);
|
|
1228
543
|
const packageJson = _chunkAWKQRM2Hjs.joinPaths.call(void 0, _nullishCoalesce(projectRoot, () => ( ".")), "package.json");
|
|
1229
544
|
if (!_fileutils.fileExists.call(void 0, packageJson)) {
|
|
1230
545
|
throw new Error(`Could not find package.json at ${packageJson}`);
|
|
@@ -1232,7 +547,7 @@ async function napiExecutor(options, context, config) {
|
|
|
1232
547
|
const napi = new NapiCli();
|
|
1233
548
|
const normalizedOptions = { ...options };
|
|
1234
549
|
const metadata = cargoMetadata();
|
|
1235
|
-
normalizedOptions.targetDir = options.targetDir || _optionalChain([metadata, 'optionalAccess',
|
|
550
|
+
normalizedOptions.targetDir = options.targetDir || _optionalChain([metadata, 'optionalAccess', _71 => _71.target_directory]) || _chunkAWKQRM2Hjs.joinPaths.call(void 0, config.workspaceRoot, "dist", "target");
|
|
1236
551
|
normalizedOptions.outputDir = options.outputPath;
|
|
1237
552
|
normalizedOptions.packageJsonPath ??= packageJson;
|
|
1238
553
|
if (options.cwd) {
|
|
@@ -1312,9 +627,22 @@ var executor_default7 = withRunExecutor(
|
|
|
1312
627
|
}
|
|
1313
628
|
);
|
|
1314
629
|
|
|
630
|
+
// ../npm-tools/src/helpers/get-version.ts
|
|
631
|
+
|
|
632
|
+
var _semver = require('semver');
|
|
633
|
+
var _stripansi = require('strip-ansi'); var _stripansi2 = _interopRequireDefault(_stripansi);
|
|
634
|
+
|
|
1315
635
|
// ../npm-tools/src/helpers/get-registry.ts
|
|
1316
636
|
|
|
1317
637
|
|
|
638
|
+
// ../pnpm-tools/src/helpers/catalog.ts
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
// ../pnpm-tools/src/helpers/pnpm-workspace.ts
|
|
642
|
+
|
|
643
|
+
var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
|
|
644
|
+
var _yaml = require('yaml');
|
|
645
|
+
|
|
1318
646
|
// ../pnpm-tools/src/helpers/replace-deps-aliases.ts
|
|
1319
647
|
|
|
1320
648
|
|
|
@@ -1324,77 +652,355 @@ var executor_default7 = withRunExecutor(
|
|
|
1324
652
|
|
|
1325
653
|
var _prettier = require('prettier');
|
|
1326
654
|
|
|
1327
|
-
// ../
|
|
655
|
+
// ../workspace-tools/src/executors/npm-publish/executor.ts
|
|
1328
656
|
|
|
1329
|
-
var _semver = require('semver');
|
|
1330
|
-
var _stripansi = require('strip-ansi'); var _stripansi2 = _interopRequireDefault(_stripansi);
|
|
1331
657
|
|
|
1332
|
-
// ../pnpm-tools/src/helpers/catalog.ts
|
|
1333
658
|
|
|
1334
659
|
|
|
1335
|
-
// ../pnpm-tools/src/helpers/pnpm-workspace.ts
|
|
1336
660
|
|
|
661
|
+
// ../workspace-tools/src/utils/github.ts
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
// ../workspace-tools/src/executors/npm-publish/executor.ts
|
|
665
|
+
var LARGE_BUFFER2 = 1024 * 1e6;
|
|
666
|
+
|
|
667
|
+
// ../workspace-tools/src/executors/size-limit/executor.ts
|
|
668
|
+
|
|
669
|
+
var _esbuild = require('@size-limit/esbuild'); var _esbuild2 = _interopRequireDefault(_esbuild);
|
|
670
|
+
var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _interopRequireDefault(_esbuildwhy);
|
|
671
|
+
var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
|
|
672
|
+
var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
|
|
673
|
+
async function sizeLimitExecutorFn(options, context, config) {
|
|
674
|
+
if (!_optionalChain([context, 'optionalAccess', _72 => _72.projectName]) || !_optionalChain([context, 'access', _73 => _73.projectsConfigurations, 'optionalAccess', _74 => _74.projects]) || !context.projectsConfigurations.projects[context.projectName]) {
|
|
675
|
+
throw new Error(
|
|
676
|
+
"The Size-Limit process failed because the context is not valid. Please run this command from a workspace."
|
|
677
|
+
);
|
|
678
|
+
}
|
|
679
|
+
_chunkAWKQRM2Hjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context.projectName}`, config);
|
|
680
|
+
_sizelimit2.default.call(void 0, [_file2.default, _esbuild2.default, _esbuildwhy2.default], {
|
|
681
|
+
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context, 'access', _75 => _75.projectsConfigurations, 'access', _76 => _76.projects, 'access', _77 => _77[context.projectName], 'optionalAccess', _78 => _78.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0,
|
|
682
|
+
_nullishCoalesce(_optionalChain([context, 'access', _79 => _79.projectsConfigurations, 'access', _80 => _80.projects, 'access', _81 => _81[context.projectName], 'optionalAccess', _82 => _82.root]), () => ( "./")),
|
|
683
|
+
"src"
|
|
684
|
+
)))
|
|
685
|
+
}).then((result) => {
|
|
686
|
+
_chunkAWKQRM2Hjs.writeInfo.call(void 0,
|
|
687
|
+
`\u{1F4CF} ${context.projectName} Size-Limit result: ${JSON.stringify(result)}`,
|
|
688
|
+
config
|
|
689
|
+
);
|
|
690
|
+
});
|
|
691
|
+
return {
|
|
692
|
+
success: true
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
var executor_default8 = withRunExecutor(
|
|
696
|
+
"Size-Limit Performance Test Executor",
|
|
697
|
+
sizeLimitExecutorFn,
|
|
698
|
+
{
|
|
699
|
+
skipReadingConfig: false,
|
|
700
|
+
hooks: {
|
|
701
|
+
applyDefaultOptions: (options) => {
|
|
702
|
+
return options;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
);
|
|
707
|
+
|
|
708
|
+
// ../tsdown/src/build.ts
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
// ../build-tools/src/config.ts
|
|
716
|
+
var DEFAULT_ENVIRONMENT = "production";
|
|
717
|
+
var DEFAULT_TARGET = "esnext";
|
|
718
|
+
var DEFAULT_ORGANIZATION = "storm-software";
|
|
719
|
+
|
|
720
|
+
// ../build-tools/src/plugins/swc.ts
|
|
721
|
+
var _core = require('@swc/core');
|
|
722
|
+
|
|
723
|
+
// ../build-tools/src/plugins/ts-resolve.ts
|
|
724
|
+
|
|
725
|
+
var _module = require('module');
|
|
726
|
+
|
|
727
|
+
var _resolve2 = require('resolve'); var _resolve3 = _interopRequireDefault(_resolve2);
|
|
728
|
+
|
|
729
|
+
// ../build-tools/src/plugins/type-definitions.ts
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
// ../build-tools/src/utilities/copy-assets.ts
|
|
734
|
+
var _internal = require('@nx/js/internal');
|
|
735
|
+
var _glob = require('glob');
|
|
736
|
+
|
|
737
|
+
var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
|
|
738
|
+
const pendingAssets = Array.from(_nullishCoalesce(assets, () => ( [])));
|
|
739
|
+
pendingAssets.push({
|
|
740
|
+
input: projectRoot,
|
|
741
|
+
glob: "*.md",
|
|
742
|
+
output: "."
|
|
743
|
+
});
|
|
744
|
+
pendingAssets.push({
|
|
745
|
+
input: ".",
|
|
746
|
+
glob: "LICENSE",
|
|
747
|
+
output: "."
|
|
748
|
+
});
|
|
749
|
+
if (generatePackageJson2 === false) {
|
|
750
|
+
pendingAssets.push({
|
|
751
|
+
input: projectRoot,
|
|
752
|
+
glob: "package.json",
|
|
753
|
+
output: "."
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
if (includeSrc === true) {
|
|
757
|
+
pendingAssets.push({
|
|
758
|
+
input: sourceRoot,
|
|
759
|
+
glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
|
|
760
|
+
output: "src/"
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
_chunkAWKQRM2Hjs.writeTrace.call(void 0,
|
|
764
|
+
`\u{1F4DD} Copying the following assets to the output directory:
|
|
765
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkAWKQRM2Hjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`,
|
|
766
|
+
config
|
|
767
|
+
);
|
|
768
|
+
const assetHandler = new (0, _internal.CopyAssetsHandler)({
|
|
769
|
+
projectDir: projectRoot,
|
|
770
|
+
rootDir: config.workspaceRoot,
|
|
771
|
+
outputDir: outputPath,
|
|
772
|
+
assets: pendingAssets
|
|
773
|
+
});
|
|
774
|
+
await assetHandler.processAllAssetsOnce();
|
|
775
|
+
_chunkAWKQRM2Hjs.writeTrace.call(void 0, "Completed copying assets to the output directory", config);
|
|
776
|
+
if (includeSrc === true) {
|
|
777
|
+
_chunkAWKQRM2Hjs.writeDebug.call(void 0,
|
|
778
|
+
`\u{1F4DD} Adding banner and writing source files: ${_chunkAWKQRM2Hjs.joinPaths.call(void 0,
|
|
779
|
+
outputPath,
|
|
780
|
+
"src"
|
|
781
|
+
)}`,
|
|
782
|
+
config
|
|
783
|
+
);
|
|
784
|
+
const files = await _glob.glob.call(void 0, [
|
|
785
|
+
_chunkAWKQRM2Hjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
786
|
+
_chunkAWKQRM2Hjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
787
|
+
_chunkAWKQRM2Hjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
788
|
+
_chunkAWKQRM2Hjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
789
|
+
]);
|
|
790
|
+
await Promise.allSettled(
|
|
791
|
+
files.map(
|
|
792
|
+
async (file) => _promises.writeFile.call(void 0,
|
|
793
|
+
file,
|
|
794
|
+
`${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
795
|
+
|
|
796
|
+
${await _promises.readFile.call(void 0, file, "utf8")}
|
|
1337
797
|
|
|
1338
|
-
|
|
798
|
+
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
|
|
799
|
+
)
|
|
800
|
+
)
|
|
801
|
+
);
|
|
802
|
+
}
|
|
803
|
+
};
|
|
1339
804
|
|
|
1340
|
-
// ../
|
|
805
|
+
// ../build-tools/src/utilities/generate-package-json.ts
|
|
1341
806
|
|
|
1342
807
|
|
|
1343
808
|
|
|
1344
809
|
|
|
1345
|
-
// ../workspace-tools/src/utils/github.ts
|
|
1346
810
|
|
|
1347
811
|
|
|
1348
|
-
// ../workspace-tools/src/executors/npm-publish/executor.ts
|
|
1349
|
-
var LARGE_BUFFER2 = 1024 * 1e6;
|
|
1350
812
|
|
|
1351
|
-
// ../workspace-tools/src/executors/size-limit/executor.ts
|
|
1352
813
|
|
|
1353
|
-
var
|
|
1354
|
-
var
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
814
|
+
var _projectgraph = require('nx/src/project-graph/project-graph');
|
|
815
|
+
var addPackageDependencies = async (workspaceRoot2, projectRoot, projectName, packageJson) => {
|
|
816
|
+
let projectGraph;
|
|
817
|
+
try {
|
|
818
|
+
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
819
|
+
} catch (e2) {
|
|
820
|
+
await _projectgraph.createProjectGraphAsync.call(void 0, );
|
|
821
|
+
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
822
|
+
}
|
|
823
|
+
if (!projectGraph) {
|
|
1359
824
|
throw new Error(
|
|
1360
|
-
"The
|
|
825
|
+
"The Build process failed because the project graph is not available. Please run the build command again."
|
|
1361
826
|
);
|
|
1362
827
|
}
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
828
|
+
const projectDependencies = _internal.calculateProjectBuildableDependencies.call(void 0,
|
|
829
|
+
void 0,
|
|
830
|
+
projectGraph,
|
|
831
|
+
workspaceRoot2,
|
|
832
|
+
projectName,
|
|
833
|
+
process.env.NX_TASK_TARGET_TARGET || "build",
|
|
834
|
+
process.env.NX_TASK_TARGET_CONFIGURATION || "production",
|
|
835
|
+
true
|
|
836
|
+
);
|
|
837
|
+
const localPackages = [];
|
|
838
|
+
for (const project of projectDependencies.dependencies.filter(
|
|
839
|
+
(dep) => dep.node.type === "lib" && _optionalChain([dep, 'access', _83 => _83.node, 'access', _84 => _84.data, 'optionalAccess', _85 => _85.root]) !== projectRoot && _optionalChain([dep, 'access', _86 => _86.node, 'access', _87 => _87.data, 'optionalAccess', _88 => _88.root]) !== workspaceRoot2
|
|
840
|
+
)) {
|
|
841
|
+
const projectNode = project.node;
|
|
842
|
+
if (projectNode.data.root) {
|
|
843
|
+
const projectPackageJsonPath = _chunkAWKQRM2Hjs.joinPaths.call(void 0,
|
|
844
|
+
workspaceRoot2,
|
|
845
|
+
projectNode.data.root,
|
|
846
|
+
"package.json"
|
|
847
|
+
);
|
|
848
|
+
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
849
|
+
const projectPackageJsonContent = await _promises.readFile.call(void 0,
|
|
850
|
+
projectPackageJsonPath,
|
|
851
|
+
"utf8"
|
|
852
|
+
);
|
|
853
|
+
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
854
|
+
if (projectPackageJson.private !== true) {
|
|
855
|
+
localPackages.push(projectPackageJson);
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
if (localPackages.length > 0) {
|
|
861
|
+
_chunkAWKQRM2Hjs.writeTrace.call(void 0,
|
|
862
|
+
`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`
|
|
1373
863
|
);
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
864
|
+
const projectJsonFile = await _promises.readFile.call(void 0,
|
|
865
|
+
_chunkAWKQRM2Hjs.joinPaths.call(void 0, projectRoot, "project.json"),
|
|
866
|
+
"utf8"
|
|
867
|
+
);
|
|
868
|
+
const projectJson = JSON.parse(projectJsonFile);
|
|
869
|
+
const projectName2 = projectJson.name;
|
|
870
|
+
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
871
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _89 => _89.projects, 'optionalAccess', _90 => _90[projectName2]])) {
|
|
872
|
+
throw new Error(
|
|
873
|
+
"The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project."
|
|
874
|
+
);
|
|
875
|
+
}
|
|
876
|
+
const implicitDependencies = _optionalChain([projectConfigurations, 'access', _91 => _91.projects, 'optionalAccess', _92 => _92[projectName2], 'access', _93 => _93.implicitDependencies, 'optionalAccess', _94 => _94.reduce, 'call', _95 => _95((ret, dep) => {
|
|
877
|
+
if (_optionalChain([projectConfigurations, 'access', _96 => _96.projects, 'optionalAccess', _97 => _97[dep]])) {
|
|
878
|
+
const depPackageJsonPath = _chunkAWKQRM2Hjs.joinPaths.call(void 0,
|
|
879
|
+
workspaceRoot2,
|
|
880
|
+
projectConfigurations.projects[dep].root,
|
|
881
|
+
"package.json"
|
|
882
|
+
);
|
|
883
|
+
if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
|
|
884
|
+
const depPackageJsonContent = _fs.readFileSync.call(void 0,
|
|
885
|
+
depPackageJsonPath,
|
|
886
|
+
"utf8"
|
|
887
|
+
);
|
|
888
|
+
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
889
|
+
if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
|
|
890
|
+
ret.push(depPackageJson.name);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
return ret;
|
|
895
|
+
}, [])]);
|
|
896
|
+
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
897
|
+
if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _98 => _98.includes, 'call', _99 => _99(localPackage.name)]) && _optionalChain([packageJson, 'access', _100 => _100.devDependencies, 'optionalAccess', _101 => _101[localPackage.name]]) === void 0) {
|
|
898
|
+
ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
|
|
899
|
+
}
|
|
900
|
+
return ret;
|
|
901
|
+
}, _nullishCoalesce(packageJson.dependencies, () => ( {})));
|
|
902
|
+
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
903
|
+
if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess', _102 => _102.includes, 'call', _103 => _103(localPackage.name)]) && _optionalChain([packageJson, 'access', _104 => _104.dependencies, 'optionalAccess', _105 => _105[localPackage.name]]) === void 0) {
|
|
904
|
+
ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
|
|
1387
905
|
}
|
|
906
|
+
return ret;
|
|
907
|
+
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
908
|
+
} else {
|
|
909
|
+
_chunkAWKQRM2Hjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
910
|
+
}
|
|
911
|
+
return packageJson;
|
|
912
|
+
};
|
|
913
|
+
var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
914
|
+
const workspaceRoot2 = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : _chunkPGTHXO6Mjs.findWorkspaceRoot.call(void 0, );
|
|
915
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
916
|
+
_chunkAWKQRM2Hjs.joinPaths.call(void 0, workspaceRoot2, "package.json"),
|
|
917
|
+
"utf8"
|
|
918
|
+
);
|
|
919
|
+
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
920
|
+
packageJson.type ??= "module";
|
|
921
|
+
packageJson.sideEffects ??= false;
|
|
922
|
+
if (includeSrc === true) {
|
|
923
|
+
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
924
|
+
if (distSrc.startsWith("/")) {
|
|
925
|
+
distSrc = distSrc.substring(1);
|
|
1388
926
|
}
|
|
927
|
+
packageJson.source ??= `${_chunkAWKQRM2Hjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
1389
928
|
}
|
|
1390
|
-
|
|
929
|
+
packageJson.files ??= ["dist/**/*"];
|
|
930
|
+
if (includeSrc === true && !packageJson.files.includes("src")) {
|
|
931
|
+
packageJson.files.push("src/**/*");
|
|
932
|
+
}
|
|
933
|
+
packageJson.publishConfig ??= {
|
|
934
|
+
access: "public"
|
|
935
|
+
};
|
|
936
|
+
packageJson.description ??= workspacePackageJson.description;
|
|
937
|
+
packageJson.homepage ??= workspacePackageJson.homepage;
|
|
938
|
+
packageJson.bugs ??= workspacePackageJson.bugs;
|
|
939
|
+
packageJson.license ??= workspacePackageJson.license;
|
|
940
|
+
packageJson.keywords ??= workspacePackageJson.keywords;
|
|
941
|
+
packageJson.funding ??= workspacePackageJson.funding;
|
|
942
|
+
packageJson.author ??= workspacePackageJson.author;
|
|
943
|
+
packageJson.maintainers ??= workspacePackageJson.maintainers;
|
|
944
|
+
if (!packageJson.maintainers && packageJson.author) {
|
|
945
|
+
packageJson.maintainers = [packageJson.author];
|
|
946
|
+
}
|
|
947
|
+
packageJson.contributors ??= workspacePackageJson.contributors;
|
|
948
|
+
if (!packageJson.contributors && packageJson.author) {
|
|
949
|
+
packageJson.contributors = [packageJson.author];
|
|
950
|
+
}
|
|
951
|
+
packageJson.repository ??= workspacePackageJson.repository;
|
|
952
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkAWKQRM2Hjs.joinPaths.call(void 0, "packages", projectName);
|
|
953
|
+
return packageJson;
|
|
954
|
+
};
|
|
955
|
+
var addPackageJsonExport = (file, type = "module", sourceRoot) => {
|
|
956
|
+
let entry = file.replaceAll("\\", "/");
|
|
957
|
+
if (sourceRoot) {
|
|
958
|
+
entry = entry.replace(sourceRoot, "");
|
|
959
|
+
}
|
|
960
|
+
return {
|
|
961
|
+
import: {
|
|
962
|
+
types: `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
|
|
963
|
+
default: `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
|
|
964
|
+
},
|
|
965
|
+
require: {
|
|
966
|
+
types: `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
|
|
967
|
+
default: `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
|
|
968
|
+
},
|
|
969
|
+
default: {
|
|
970
|
+
types: `./dist/${entry}.d.${type !== "fixed" ? "ts" : "mts"}`,
|
|
971
|
+
default: `./dist/${entry}.${type !== "fixed" ? "js" : "mjs"}`
|
|
972
|
+
}
|
|
973
|
+
};
|
|
974
|
+
};
|
|
975
|
+
|
|
976
|
+
// ../build-tools/src/utilities/get-entry-points.ts
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
// ../build-tools/src/utilities/get-env.ts
|
|
980
|
+
var getEnv = (builder, options) => {
|
|
981
|
+
return {
|
|
982
|
+
STORM_BUILD: builder,
|
|
983
|
+
STORM_ORG: options.orgName || DEFAULT_ORGANIZATION,
|
|
984
|
+
STORM_NAME: options.name,
|
|
985
|
+
STORM_MODE: options.mode || DEFAULT_ENVIRONMENT,
|
|
986
|
+
STORM_PLATFORM: options.platform,
|
|
987
|
+
STORM_FORMAT: JSON.stringify(options.format),
|
|
988
|
+
STORM_TARGET: JSON.stringify(options.target),
|
|
989
|
+
...options.env
|
|
990
|
+
};
|
|
991
|
+
};
|
|
992
|
+
|
|
993
|
+
// ../build-tools/src/utilities/read-nx-config.ts
|
|
1391
994
|
|
|
1392
|
-
// ../tsdown/src/build.ts
|
|
1393
995
|
|
|
1394
996
|
|
|
997
|
+
// ../build-tools/src/utilities/task-graph.ts
|
|
998
|
+
|
|
1395
999
|
|
|
1396
1000
|
|
|
1001
|
+
var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
|
|
1397
1002
|
|
|
1003
|
+
// ../tsdown/src/build.ts
|
|
1398
1004
|
|
|
1399
1005
|
|
|
1400
1006
|
|
|
@@ -1402,7 +1008,7 @@ var _tsdown = require('tsdown');
|
|
|
1402
1008
|
|
|
1403
1009
|
// ../tsdown/src/clean.ts
|
|
1404
1010
|
|
|
1405
|
-
async function
|
|
1011
|
+
async function cleanDirectories(name = "TSDown", directory, config) {
|
|
1406
1012
|
await _promises.rm.call(void 0, directory, { recursive: true, force: true });
|
|
1407
1013
|
}
|
|
1408
1014
|
|
|
@@ -1461,7 +1067,7 @@ var resolveOptions = async (userOptions) => {
|
|
|
1461
1067
|
const projectJson = JSON.parse(projectJsonFile);
|
|
1462
1068
|
const projectName = projectJson.name;
|
|
1463
1069
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1464
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
1070
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _106 => _106.projects, 'optionalAccess', _107 => _107[projectName]])) {
|
|
1465
1071
|
throw new Error(
|
|
1466
1072
|
"The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project."
|
|
1467
1073
|
);
|
|
@@ -1515,7 +1121,7 @@ var resolveOptions = async (userOptions) => {
|
|
|
1515
1121
|
stopwatch();
|
|
1516
1122
|
return result;
|
|
1517
1123
|
};
|
|
1518
|
-
async function
|
|
1124
|
+
async function generatePackageJson(options) {
|
|
1519
1125
|
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkAWKQRM2Hjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
1520
1126
|
_chunkAWKQRM2Hjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.workspaceConfig);
|
|
1521
1127
|
const stopwatch = _chunkAWKQRM2Hjs.getStopwatch.call(void 0, "Write package.json file");
|
|
@@ -1602,7 +1208,7 @@ async function executeTSDown(options) {
|
|
|
1602
1208
|
stopwatch();
|
|
1603
1209
|
return options;
|
|
1604
1210
|
}
|
|
1605
|
-
async function
|
|
1211
|
+
async function copyBuildAssets(options) {
|
|
1606
1212
|
_chunkAWKQRM2Hjs.writeDebug.call(void 0,
|
|
1607
1213
|
` \u{1F4CB} Copying asset files to output directory: ${options.outDir}`,
|
|
1608
1214
|
options.workspaceConfig
|
|
@@ -1620,20 +1226,20 @@ async function copyBuildAssets2(options) {
|
|
|
1620
1226
|
stopwatch();
|
|
1621
1227
|
return options;
|
|
1622
1228
|
}
|
|
1623
|
-
async function
|
|
1229
|
+
async function reportResults(options) {
|
|
1624
1230
|
_chunkAWKQRM2Hjs.writeSuccess.call(void 0,
|
|
1625
1231
|
` \u{1F4E6} The ${options.name} build completed successfully`,
|
|
1626
1232
|
options.workspaceConfig
|
|
1627
1233
|
);
|
|
1628
1234
|
}
|
|
1629
|
-
async function
|
|
1235
|
+
async function cleanOutputPath(options) {
|
|
1630
1236
|
if (options.clean !== false && options.workspaceConfig) {
|
|
1631
1237
|
_chunkAWKQRM2Hjs.writeDebug.call(void 0,
|
|
1632
1238
|
` \u{1F9F9} Cleaning ${options.name} output path: ${options.workspaceConfig}`,
|
|
1633
1239
|
options.workspaceConfig
|
|
1634
1240
|
);
|
|
1635
1241
|
const stopwatch = _chunkAWKQRM2Hjs.getStopwatch.call(void 0, `${options.name} output clean`);
|
|
1636
|
-
await
|
|
1242
|
+
await cleanDirectories(
|
|
1637
1243
|
options.name,
|
|
1638
1244
|
options.outDir,
|
|
1639
1245
|
options.workspaceConfig
|
|
@@ -1642,7 +1248,7 @@ async function cleanOutputPath2(options) {
|
|
|
1642
1248
|
}
|
|
1643
1249
|
return options;
|
|
1644
1250
|
}
|
|
1645
|
-
async function
|
|
1251
|
+
async function build(options) {
|
|
1646
1252
|
_chunkAWKQRM2Hjs.writeDebug.call(void 0, ` ${_chunkAWKQRM2Hjs.brandIcon.call(void 0, )} Executing Storm TSDown pipeline`);
|
|
1647
1253
|
const stopwatch = _chunkAWKQRM2Hjs.getStopwatch.call(void 0, "TSDown pipeline");
|
|
1648
1254
|
try {
|
|
@@ -1654,13 +1260,13 @@ async function build3(options) {
|
|
|
1654
1260
|
opts.map(async (opt) => await resolveOptions(opt))
|
|
1655
1261
|
);
|
|
1656
1262
|
if (resolved.length > 0) {
|
|
1657
|
-
await
|
|
1658
|
-
await
|
|
1263
|
+
await cleanOutputPath(resolved[0]);
|
|
1264
|
+
await generatePackageJson(resolved[0]);
|
|
1659
1265
|
await Promise.all(
|
|
1660
1266
|
resolved.map(async (opt) => {
|
|
1661
1267
|
await executeTSDown(opt);
|
|
1662
|
-
await
|
|
1663
|
-
await
|
|
1268
|
+
await copyBuildAssets(opt);
|
|
1269
|
+
await reportResults(opt);
|
|
1664
1270
|
})
|
|
1665
1271
|
);
|
|
1666
1272
|
} else {
|
|
@@ -1682,19 +1288,19 @@ async function build3(options) {
|
|
|
1682
1288
|
// ../workspace-tools/src/executors/tsdown/executor.ts
|
|
1683
1289
|
async function tsdownExecutorFn(options, context, config) {
|
|
1684
1290
|
_chunkAWKQRM2Hjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm TSDown executor on the workspace", config);
|
|
1685
|
-
if (!_optionalChain([context, 'access',
|
|
1291
|
+
if (!_optionalChain([context, 'access', _108 => _108.projectsConfigurations, 'optionalAccess', _109 => _109.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _110 => _110.projectsConfigurations, 'access', _111 => _111.projects, 'access', _112 => _112[context.projectName], 'optionalAccess', _113 => _113.root])) {
|
|
1686
1292
|
throw new Error(
|
|
1687
1293
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
1688
1294
|
);
|
|
1689
1295
|
}
|
|
1690
|
-
await
|
|
1296
|
+
await build({
|
|
1691
1297
|
...options,
|
|
1692
1298
|
projectRoot: (
|
|
1693
1299
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1694
|
-
_optionalChain([context, 'access',
|
|
1300
|
+
_optionalChain([context, 'access', _114 => _114.projectsConfigurations, 'access', _115 => _115.projects, 'optionalAccess', _116 => _116[context.projectName], 'access', _117 => _117.root])
|
|
1695
1301
|
),
|
|
1696
1302
|
name: context.projectName,
|
|
1697
|
-
sourceRoot: _optionalChain([context, 'access',
|
|
1303
|
+
sourceRoot: _optionalChain([context, 'access', _118 => _118.projectsConfigurations, 'access', _119 => _119.projects, 'optionalAccess', _120 => _120[context.projectName], 'optionalAccess', _121 => _121.sourceRoot]),
|
|
1698
1304
|
format: options.format,
|
|
1699
1305
|
platform: options.platform
|
|
1700
1306
|
});
|
|
@@ -1762,7 +1368,7 @@ var executor_default10 = withRunExecutor(
|
|
|
1762
1368
|
|
|
1763
1369
|
async function unbuildExecutorFn(options, context, config) {
|
|
1764
1370
|
_chunkAWKQRM2Hjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
1765
|
-
if (!_optionalChain([context, 'access',
|
|
1371
|
+
if (!_optionalChain([context, 'access', _122 => _122.projectsConfigurations, 'optionalAccess', _123 => _123.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
1766
1372
|
throw new Error(
|
|
1767
1373
|
"The Build process failed because the context is not valid. Please run this command from a workspace root directory."
|
|
1768
1374
|
);
|
|
@@ -1879,7 +1485,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
1879
1485
|
);
|
|
1880
1486
|
config = await _chunkPGTHXO6Mjs.getConfig.call(void 0, workspaceRoot2);
|
|
1881
1487
|
}
|
|
1882
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1488
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _124 => _124.hooks, 'optionalAccess', _125 => _125.applyDefaultOptions])) {
|
|
1883
1489
|
_chunkAWKQRM2Hjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
1884
1490
|
options = await Promise.resolve(
|
|
1885
1491
|
generatorOptions.hooks.applyDefaultOptions(options, config)
|
|
@@ -1896,7 +1502,7 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
|
|
|
1896
1502
|
{ workspaceRoot: tree.root, config },
|
|
1897
1503
|
applyWorkspaceBaseTokens
|
|
1898
1504
|
);
|
|
1899
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1505
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _126 => _126.hooks, 'optionalAccess', _127 => _127.preProcess])) {
|
|
1900
1506
|
_chunkAWKQRM2Hjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
1901
1507
|
await Promise.resolve(
|
|
1902
1508
|
generatorOptions.hooks.preProcess(tokenized, config)
|
|
@@ -1907,15 +1513,15 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
|
|
|
1907
1513
|
generatorFn(tree, tokenized, config)
|
|
1908
1514
|
);
|
|
1909
1515
|
if (result) {
|
|
1910
|
-
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess',
|
|
1516
|
+
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _128 => _128.error, 'optionalAccess', _129 => _129.message]) && typeof _optionalChain([result, 'optionalAccess', _130 => _130.error, 'optionalAccess', _131 => _131.message]) === "string" && _optionalChain([result, 'optionalAccess', _132 => _132.error, 'optionalAccess', _133 => _133.name]) && typeof _optionalChain([result, 'optionalAccess', _134 => _134.error, 'optionalAccess', _135 => _135.name]) === "string") {
|
|
1911
1517
|
throw new Error(`The ${name} generator failed to run`, {
|
|
1912
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
1518
|
+
cause: _optionalChain([result, 'optionalAccess', _136 => _136.error])
|
|
1913
1519
|
});
|
|
1914
1520
|
} else if (result.success && result.data) {
|
|
1915
1521
|
return result;
|
|
1916
1522
|
}
|
|
1917
1523
|
}
|
|
1918
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1524
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _137 => _137.hooks, 'optionalAccess', _138 => _138.postProcess])) {
|
|
1919
1525
|
_chunkAWKQRM2Hjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
1920
1526
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
1921
1527
|
_chunkAWKQRM2Hjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
@@ -2036,15 +1642,15 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2036
1642
|
_devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
|
|
2037
1643
|
let repository = {
|
|
2038
1644
|
type: "github",
|
|
2039
|
-
url: _optionalChain([config, 'optionalAccess',
|
|
1645
|
+
url: _optionalChain([config, 'optionalAccess', _139 => _139.repository]) || `https://github.com/${(typeof _optionalChain([config, 'optionalAccess', _140 => _140.organization]) === "string" ? _optionalChain([config, 'optionalAccess', _141 => _141.organization]) : _optionalChain([config, 'optionalAccess', _142 => _142.organization, 'optionalAccess', _143 => _143.name])) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _144 => _144.namespace]) || _optionalChain([config, 'optionalAccess', _145 => _145.name]) || "repository"}.git`
|
|
2040
1646
|
};
|
|
2041
1647
|
let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
2042
1648
|
if (tree.exists("package.json")) {
|
|
2043
1649
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2044
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1650
|
+
if (_optionalChain([packageJson, 'optionalAccess', _146 => _146.repository])) {
|
|
2045
1651
|
repository = packageJson.repository;
|
|
2046
1652
|
}
|
|
2047
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1653
|
+
if (_optionalChain([packageJson, 'optionalAccess', _147 => _147.description])) {
|
|
2048
1654
|
description = packageJson.description;
|
|
2049
1655
|
}
|
|
2050
1656
|
}
|
|
@@ -2099,9 +1705,9 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2099
1705
|
_devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
|
|
2100
1706
|
...json,
|
|
2101
1707
|
pnpm: {
|
|
2102
|
-
..._optionalChain([json, 'optionalAccess',
|
|
1708
|
+
..._optionalChain([json, 'optionalAccess', _148 => _148.pnpm]),
|
|
2103
1709
|
overrides: {
|
|
2104
|
-
..._optionalChain([json, 'optionalAccess',
|
|
1710
|
+
..._optionalChain([json, 'optionalAccess', _149 => _149.pnpm, 'optionalAccess', _150 => _150.overrides]),
|
|
2105
1711
|
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
2106
1712
|
}
|
|
2107
1713
|
}
|
|
@@ -2119,10 +1725,10 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2119
1725
|
]);
|
|
2120
1726
|
if (tree.exists("package.json")) {
|
|
2121
1727
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2122
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1728
|
+
if (_optionalChain([packageJson, 'optionalAccess', _151 => _151.repository])) {
|
|
2123
1729
|
repository = packageJson.repository;
|
|
2124
1730
|
}
|
|
2125
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1731
|
+
if (_optionalChain([packageJson, 'optionalAccess', _152 => _152.description])) {
|
|
2126
1732
|
description = packageJson.description;
|
|
2127
1733
|
}
|
|
2128
1734
|
}
|
|
@@ -2159,22 +1765,22 @@ function getOutputPath(options) {
|
|
|
2159
1765
|
function createProjectTsConfigJson(tree, options) {
|
|
2160
1766
|
const tsconfig = {
|
|
2161
1767
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
2162
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1768
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _153 => _153.tsconfigOptions]), () => ( {})),
|
|
2163
1769
|
compilerOptions: {
|
|
2164
1770
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
2165
1771
|
outDir: _chunkAWKQRM2Hjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
2166
1772
|
noEmit: true,
|
|
2167
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1773
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _154 => _154.tsconfigOptions, 'optionalAccess', _155 => _155.compilerOptions]), () => ( {}))
|
|
2168
1774
|
},
|
|
2169
|
-
files: [..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1775
|
+
files: [..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _156 => _156.tsconfigOptions, 'optionalAccess', _157 => _157.files]), () => ( []))],
|
|
2170
1776
|
include: [
|
|
2171
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1777
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _158 => _158.tsconfigOptions, 'optionalAccess', _159 => _159.include]), () => ( [])),
|
|
2172
1778
|
"src/**/*.ts",
|
|
2173
1779
|
"src/**/*.js",
|
|
2174
1780
|
"bin/**/*"
|
|
2175
1781
|
],
|
|
2176
1782
|
exclude: [
|
|
2177
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1783
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _160 => _160.tsconfigOptions, 'optionalAccess', _161 => _161.exclude]), () => ( [])),
|
|
2178
1784
|
"jest.config.ts",
|
|
2179
1785
|
"src/**/*.spec.ts",
|
|
2180
1786
|
"src/**/*.test.ts"
|
|
@@ -2184,8 +1790,8 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
2184
1790
|
}
|
|
2185
1791
|
async function normalizeOptions(tree, options, config) {
|
|
2186
1792
|
let importPath = options.importPath;
|
|
2187
|
-
if (!importPath && _optionalChain([config, 'optionalAccess',
|
|
2188
|
-
importPath = `@${_optionalChain([config, 'optionalAccess',
|
|
1793
|
+
if (!importPath && _optionalChain([config, 'optionalAccess', _162 => _162.namespace])) {
|
|
1794
|
+
importPath = `@${_optionalChain([config, 'optionalAccess', _163 => _163.namespace])}/${options.name}`;
|
|
2189
1795
|
}
|
|
2190
1796
|
if (options.publishable) {
|
|
2191
1797
|
if (!importPath) {
|
|
@@ -2350,7 +1956,7 @@ async function configSchemaGeneratorFn(tree, options, config) {
|
|
|
2350
1956
|
);
|
|
2351
1957
|
}
|
|
2352
1958
|
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(
|
|
2353
|
-
_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
1959
|
+
_nullishCoalesce(_optionalChain([config, 'optionalAccess', _164 => _164.workspaceRoot]), () => ( _chunkPGTHXO6Mjs.findWorkspaceRoot.call(void 0, ))),
|
|
2354
1960
|
options.outputFile.startsWith("./") ? "" : "./"
|
|
2355
1961
|
);
|
|
2356
1962
|
_chunkAWKQRM2Hjs.writeTrace.call(void 0,
|