@storm-software/pulumi-tools 0.22.269 → 0.22.273
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-FBP3JATY.mjs → chunk-255Z42XX.mjs} +1 -1
- package/dist/{chunk-H6I2VF55.mjs → chunk-33SB5C6L.mjs} +1 -1
- package/dist/{chunk-7GR34ULJ.mjs → chunk-34VTLVPL.mjs} +1 -1
- package/dist/{chunk-NO345UZJ.js → chunk-47LB7ZYL.js} +5 -5
- package/dist/{chunk-TXAB4NHC.mjs → chunk-BHEQUE7B.mjs} +1 -1
- package/dist/{chunk-IYHI4LBK.js → chunk-EUXATBEX.js} +2 -2
- package/dist/{chunk-3VWSQ2SS.js → chunk-GURJDFFL.js} +394 -788
- package/dist/{chunk-ZAWTV5HE.mjs → chunk-IDG2GJOG.mjs} +406 -800
- package/dist/{chunk-NAYZFAPA.mjs → chunk-LFHX3RED.mjs} +1 -1
- package/dist/{chunk-AWP77CXN.js → chunk-OQI5VWCB.js} +2 -2
- package/dist/{chunk-OZCLSR3Y.js → chunk-PNLQ6LFX.js} +2 -2
- package/dist/{chunk-Z4QP62US.mjs → chunk-QQSKJWFR.mjs} +1 -1
- package/dist/{chunk-L3E6R4RK.js → chunk-T2TZMQMM.js} +2 -2
- package/dist/{chunk-2SVNRUZR.mjs → chunk-U4AZGNY5.mjs} +1 -1
- package/dist/{chunk-GTZLRIOL.js → chunk-X4SSMSFG.js} +3 -3
- package/dist/{chunk-U2C77EC7.mjs → chunk-XNP7RVHU.mjs} +1 -1
- package/dist/{chunk-WTRYK6OF.js → chunk-Z4KKWVEO.js} +2 -2
- package/dist/executors.d.mts +1 -1
- package/dist/executors.d.ts +1 -1
- package/dist/executors.js +7 -7
- package/dist/executors.mjs +8 -8
- package/dist/generators.js +3 -3
- package/dist/generators.mjs +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -9
- package/dist/index.mjs +9 -9
- package/dist/src/base/base-executor.d.mts +1 -1
- package/dist/src/base/base-executor.d.ts +1 -1
- package/dist/src/base/base-executor.js +3 -3
- package/dist/src/base/base-executor.mjs +3 -3
- package/dist/src/base/index.d.mts +1 -1
- package/dist/src/base/index.d.ts +1 -1
- package/dist/src/base/index.js +3 -3
- package/dist/src/base/index.mjs +3 -3
- package/dist/src/base/providers.mjs +1 -1
- package/dist/src/executors/config/executor.d.mts +1 -1
- package/dist/src/executors/config/executor.d.ts +1 -1
- package/dist/src/executors/config/executor.js +4 -4
- package/dist/src/executors/config/executor.mjs +4 -4
- package/dist/src/executors/import/executor.d.mts +1 -1
- package/dist/src/executors/import/executor.d.ts +1 -1
- package/dist/src/executors/import/executor.js +4 -4
- package/dist/src/executors/import/executor.mjs +4 -4
- package/dist/src/executors/preview/executor.d.mts +1 -1
- package/dist/src/executors/preview/executor.d.ts +1 -1
- package/dist/src/executors/preview/executor.js +4 -4
- package/dist/src/executors/preview/executor.mjs +4 -4
- package/dist/src/executors/refresh/executor.d.mts +1 -1
- package/dist/src/executors/refresh/executor.d.ts +1 -1
- package/dist/src/executors/refresh/executor.js +4 -4
- package/dist/src/executors/refresh/executor.mjs +4 -4
- package/dist/src/executors/up/executor.d.mts +1 -1
- package/dist/src/executors/up/executor.d.ts +1 -1
- package/dist/src/executors/up/executor.js +4 -4
- package/dist/src/executors/up/executor.mjs +4 -4
- package/dist/src/generators/init/generator.js +3 -3
- package/dist/src/generators/init/generator.mjs +3 -3
- package/dist/src/lib/aws/index.mjs +1 -1
- package/dist/src/lib/aws/providers.mjs +1 -1
- package/dist/tsup.config.mjs +1 -1
- package/package.json +7 -7
|
@@ -2715,717 +2715,32 @@ var executor_default5 = withRunExecutor(
|
|
|
2715
2715
|
var _https = require('https'); var _https2 = _interopRequireDefault(_https);
|
|
2716
2716
|
var LARGE_BUFFER2 = 1024 * 1e6;
|
|
2717
2717
|
|
|
2718
|
-
// ../build-tools/src/config.ts
|
|
2719
|
-
var DEFAULT_JS_BANNER = `
|
|
2720
|
-
// ---------------------------------------
|
|
2721
|
-
// \u{1F5F2} Built by Storm Software
|
|
2722
|
-
// ---------------------------------------
|
|
2723
|
-
`;
|
|
2724
|
-
var DEFAULT_CSS_BANNER = `
|
|
2725
|
-
/* ---------------------------------------
|
|
2726
|
-
\u{1F5F2} Built by Storm Software
|
|
2727
|
-
--------------------------------------- */
|
|
2728
|
-
`;
|
|
2729
|
-
var DEFAULT_ENVIRONMENT = "production";
|
|
2730
|
-
var DEFAULT_TARGET = "esnext";
|
|
2731
|
-
var DEFAULT_ORGANIZATION = "storm-software";
|
|
2732
|
-
|
|
2733
|
-
// ../build-tools/src/plugins/swc.ts
|
|
2734
|
-
var _core = require('@swc/core');
|
|
2735
|
-
|
|
2736
|
-
// ../build-tools/src/plugins/ts-resolve.ts
|
|
2737
|
-
|
|
2738
|
-
var _module = require('module');
|
|
2739
|
-
|
|
2740
|
-
var _resolve2 = require('resolve'); var _resolve3 = _interopRequireDefault(_resolve2);
|
|
2741
|
-
|
|
2742
|
-
// ../build-tools/src/plugins/type-definitions.ts
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
// ../build-tools/src/utilities/copy-assets.ts
|
|
2747
|
-
var _internal = require('@nx/js/internal');
|
|
2748
|
-
var _glob = require('glob');
|
|
2749
|
-
|
|
2750
|
-
var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson3 = true, includeSrc = false, banner, footer) => {
|
|
2751
|
-
const pendingAssets = Array.from(_nullishCoalesce(assets, () => ( [])));
|
|
2752
|
-
pendingAssets.push({
|
|
2753
|
-
input: projectRoot,
|
|
2754
|
-
glob: "*.md",
|
|
2755
|
-
output: "."
|
|
2756
|
-
});
|
|
2757
|
-
pendingAssets.push({
|
|
2758
|
-
input: ".",
|
|
2759
|
-
glob: "LICENSE",
|
|
2760
|
-
output: "."
|
|
2761
|
-
});
|
|
2762
|
-
if (generatePackageJson3 === false) {
|
|
2763
|
-
pendingAssets.push({
|
|
2764
|
-
input: projectRoot,
|
|
2765
|
-
glob: "package.json",
|
|
2766
|
-
output: "."
|
|
2767
|
-
});
|
|
2768
|
-
}
|
|
2769
|
-
if (includeSrc === true) {
|
|
2770
|
-
pendingAssets.push({
|
|
2771
|
-
input: sourceRoot,
|
|
2772
|
-
glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
|
|
2773
|
-
output: "src/"
|
|
2774
|
-
});
|
|
2775
|
-
}
|
|
2776
|
-
writeTrace(
|
|
2777
|
-
`\u{1F4DD} Copying the following assets to the output directory:
|
|
2778
|
-
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`,
|
|
2779
|
-
config
|
|
2780
|
-
);
|
|
2781
|
-
const assetHandler = new (0, _internal.CopyAssetsHandler)({
|
|
2782
|
-
projectDir: projectRoot,
|
|
2783
|
-
rootDir: config.workspaceRoot,
|
|
2784
|
-
outputDir: outputPath,
|
|
2785
|
-
assets: pendingAssets
|
|
2786
|
-
});
|
|
2787
|
-
await assetHandler.processAllAssetsOnce();
|
|
2788
|
-
writeTrace("Completed copying assets to the output directory", config);
|
|
2789
|
-
if (includeSrc === true) {
|
|
2790
|
-
writeDebug(
|
|
2791
|
-
`\u{1F4DD} Adding banner and writing source files: ${joinPaths(
|
|
2792
|
-
outputPath,
|
|
2793
|
-
"src"
|
|
2794
|
-
)}`,
|
|
2795
|
-
config
|
|
2796
|
-
);
|
|
2797
|
-
const files = await _glob.glob.call(void 0, [
|
|
2798
|
-
joinPaths(config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
2799
|
-
joinPaths(config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
2800
|
-
joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
2801
|
-
joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
2802
|
-
]);
|
|
2803
|
-
await Promise.allSettled(
|
|
2804
|
-
files.map(
|
|
2805
|
-
async (file) => _promises.writeFile.call(void 0,
|
|
2806
|
-
file,
|
|
2807
|
-
`${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
2808
|
-
|
|
2809
|
-
${await _promises.readFile.call(void 0, file, "utf8")}
|
|
2810
|
-
|
|
2811
|
-
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
|
|
2812
|
-
)
|
|
2813
|
-
)
|
|
2814
|
-
);
|
|
2815
|
-
}
|
|
2816
|
-
};
|
|
2817
|
-
|
|
2818
|
-
// ../build-tools/src/utilities/generate-package-json.ts
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
var _projectgraph = require('nx/src/project-graph/project-graph');
|
|
2828
|
-
var addPackageDependencies = async (workspaceRoot2, projectRoot, projectName, packageJson) => {
|
|
2829
|
-
let projectGraph;
|
|
2830
|
-
try {
|
|
2831
|
-
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
2832
|
-
} catch (e3) {
|
|
2833
|
-
await _projectgraph.createProjectGraphAsync.call(void 0, );
|
|
2834
|
-
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
2835
|
-
}
|
|
2836
|
-
if (!projectGraph) {
|
|
2837
|
-
throw new Error(
|
|
2838
|
-
"The Build process failed because the project graph is not available. Please run the build command again."
|
|
2839
|
-
);
|
|
2840
|
-
}
|
|
2841
|
-
const projectDependencies = _internal.calculateProjectBuildableDependencies.call(void 0,
|
|
2842
|
-
void 0,
|
|
2843
|
-
projectGraph,
|
|
2844
|
-
workspaceRoot2,
|
|
2845
|
-
projectName,
|
|
2846
|
-
process.env.NX_TASK_TARGET_TARGET || "build",
|
|
2847
|
-
process.env.NX_TASK_TARGET_CONFIGURATION || "production",
|
|
2848
|
-
true
|
|
2849
|
-
);
|
|
2850
|
-
const localPackages = [];
|
|
2851
|
-
for (const project of projectDependencies.dependencies.filter(
|
|
2852
|
-
(dep) => dep.node.type === "lib" && _optionalChain([dep, 'access', _125 => _125.node, 'access', _126 => _126.data, 'optionalAccess', _127 => _127.root]) !== projectRoot && _optionalChain([dep, 'access', _128 => _128.node, 'access', _129 => _129.data, 'optionalAccess', _130 => _130.root]) !== workspaceRoot2
|
|
2853
|
-
)) {
|
|
2854
|
-
const projectNode = project.node;
|
|
2855
|
-
if (projectNode.data.root) {
|
|
2856
|
-
const projectPackageJsonPath = joinPaths(
|
|
2857
|
-
workspaceRoot2,
|
|
2858
|
-
projectNode.data.root,
|
|
2859
|
-
"package.json"
|
|
2860
|
-
);
|
|
2861
|
-
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
2862
|
-
const projectPackageJsonContent = await _promises.readFile.call(void 0,
|
|
2863
|
-
projectPackageJsonPath,
|
|
2864
|
-
"utf8"
|
|
2865
|
-
);
|
|
2866
|
-
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
2867
|
-
if (projectPackageJson.private !== true) {
|
|
2868
|
-
localPackages.push(projectPackageJson);
|
|
2869
|
-
}
|
|
2870
|
-
}
|
|
2871
|
-
}
|
|
2872
|
-
}
|
|
2873
|
-
if (localPackages.length > 0) {
|
|
2874
|
-
writeTrace(
|
|
2875
|
-
`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`
|
|
2876
|
-
);
|
|
2877
|
-
const projectJsonFile = await _promises.readFile.call(void 0,
|
|
2878
|
-
joinPaths(projectRoot, "project.json"),
|
|
2879
|
-
"utf8"
|
|
2880
|
-
);
|
|
2881
|
-
const projectJson = JSON.parse(projectJsonFile);
|
|
2882
|
-
const projectName2 = projectJson.name;
|
|
2883
|
-
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
2884
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _131 => _131.projects, 'optionalAccess', _132 => _132[projectName2]])) {
|
|
2885
|
-
throw new Error(
|
|
2886
|
-
"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."
|
|
2887
|
-
);
|
|
2888
|
-
}
|
|
2889
|
-
const implicitDependencies = _optionalChain([projectConfigurations, 'access', _133 => _133.projects, 'optionalAccess', _134 => _134[projectName2], 'access', _135 => _135.implicitDependencies, 'optionalAccess', _136 => _136.reduce, 'call', _137 => _137((ret, dep) => {
|
|
2890
|
-
if (_optionalChain([projectConfigurations, 'access', _138 => _138.projects, 'optionalAccess', _139 => _139[dep]])) {
|
|
2891
|
-
const depPackageJsonPath = joinPaths(
|
|
2892
|
-
workspaceRoot2,
|
|
2893
|
-
projectConfigurations.projects[dep].root,
|
|
2894
|
-
"package.json"
|
|
2895
|
-
);
|
|
2896
|
-
if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
|
|
2897
|
-
const depPackageJsonContent = _fs.readFileSync.call(void 0,
|
|
2898
|
-
depPackageJsonPath,
|
|
2899
|
-
"utf8"
|
|
2900
|
-
);
|
|
2901
|
-
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
2902
|
-
if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
|
|
2903
|
-
ret.push(depPackageJson.name);
|
|
2904
|
-
}
|
|
2905
|
-
}
|
|
2906
|
-
}
|
|
2907
|
-
return ret;
|
|
2908
|
-
}, [])]);
|
|
2909
|
-
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
2910
|
-
if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _140 => _140.includes, 'call', _141 => _141(localPackage.name)]) && _optionalChain([packageJson, 'access', _142 => _142.devDependencies, 'optionalAccess', _143 => _143[localPackage.name]]) === void 0) {
|
|
2911
|
-
ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
|
|
2912
|
-
}
|
|
2913
|
-
return ret;
|
|
2914
|
-
}, _nullishCoalesce(packageJson.dependencies, () => ( {})));
|
|
2915
|
-
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
2916
|
-
if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess', _144 => _144.includes, 'call', _145 => _145(localPackage.name)]) && _optionalChain([packageJson, 'access', _146 => _146.dependencies, 'optionalAccess', _147 => _147[localPackage.name]]) === void 0) {
|
|
2917
|
-
ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
|
|
2918
|
-
}
|
|
2919
|
-
return ret;
|
|
2920
|
-
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
2921
|
-
} else {
|
|
2922
|
-
writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
|
|
2923
|
-
}
|
|
2924
|
-
return packageJson;
|
|
2925
|
-
};
|
|
2926
|
-
var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
2927
|
-
const workspaceRoot2 = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : findWorkspaceRoot();
|
|
2928
|
-
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
2929
|
-
joinPaths(workspaceRoot2, "package.json"),
|
|
2930
|
-
"utf8"
|
|
2931
|
-
);
|
|
2932
|
-
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
2933
|
-
packageJson.type ??= "module";
|
|
2934
|
-
packageJson.sideEffects ??= false;
|
|
2935
|
-
if (includeSrc === true) {
|
|
2936
|
-
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
2937
|
-
if (distSrc.startsWith("/")) {
|
|
2938
|
-
distSrc = distSrc.substring(1);
|
|
2939
|
-
}
|
|
2940
|
-
packageJson.source ??= `${joinPaths(distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
2941
|
-
}
|
|
2942
|
-
packageJson.files ??= ["dist/**/*"];
|
|
2943
|
-
if (includeSrc === true && !packageJson.files.includes("src")) {
|
|
2944
|
-
packageJson.files.push("src/**/*");
|
|
2945
|
-
}
|
|
2946
|
-
packageJson.publishConfig ??= {
|
|
2947
|
-
access: "public"
|
|
2948
|
-
};
|
|
2949
|
-
packageJson.description ??= workspacePackageJson.description;
|
|
2950
|
-
packageJson.homepage ??= workspacePackageJson.homepage;
|
|
2951
|
-
packageJson.bugs ??= workspacePackageJson.bugs;
|
|
2952
|
-
packageJson.license ??= workspacePackageJson.license;
|
|
2953
|
-
packageJson.keywords ??= workspacePackageJson.keywords;
|
|
2954
|
-
packageJson.funding ??= workspacePackageJson.funding;
|
|
2955
|
-
packageJson.author ??= workspacePackageJson.author;
|
|
2956
|
-
packageJson.maintainers ??= workspacePackageJson.maintainers;
|
|
2957
|
-
if (!packageJson.maintainers && packageJson.author) {
|
|
2958
|
-
packageJson.maintainers = [packageJson.author];
|
|
2959
|
-
}
|
|
2960
|
-
packageJson.contributors ??= workspacePackageJson.contributors;
|
|
2961
|
-
if (!packageJson.contributors && packageJson.author) {
|
|
2962
|
-
packageJson.contributors = [packageJson.author];
|
|
2963
|
-
}
|
|
2964
|
-
packageJson.repository ??= workspacePackageJson.repository;
|
|
2965
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
|
|
2966
|
-
return packageJson;
|
|
2967
|
-
};
|
|
2968
|
-
var addPackageJsonExport = (file, type = "module", sourceRoot) => {
|
|
2969
|
-
let entry = file.replaceAll("\\", "/");
|
|
2970
|
-
if (sourceRoot) {
|
|
2971
|
-
entry = entry.replace(sourceRoot, "");
|
|
2972
|
-
}
|
|
2973
|
-
return {
|
|
2974
|
-
import: {
|
|
2975
|
-
types: `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
|
|
2976
|
-
default: `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
|
|
2977
|
-
},
|
|
2978
|
-
require: {
|
|
2979
|
-
types: `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
|
|
2980
|
-
default: `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
|
|
2981
|
-
},
|
|
2982
|
-
default: {
|
|
2983
|
-
types: `./dist/${entry}.d.${type !== "fixed" ? "ts" : "mts"}`,
|
|
2984
|
-
default: `./dist/${entry}.${type !== "fixed" ? "js" : "mjs"}`
|
|
2985
|
-
}
|
|
2986
|
-
};
|
|
2987
|
-
};
|
|
2988
|
-
|
|
2989
|
-
// ../build-tools/src/utilities/get-entry-points.ts
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
// ../build-tools/src/utilities/get-env.ts
|
|
2993
|
-
var getEnv = (builder, options) => {
|
|
2994
|
-
return {
|
|
2995
|
-
STORM_BUILD: builder,
|
|
2996
|
-
STORM_ORG: options.orgName || DEFAULT_ORGANIZATION,
|
|
2997
|
-
STORM_NAME: options.name,
|
|
2998
|
-
STORM_MODE: options.mode || DEFAULT_ENVIRONMENT,
|
|
2999
|
-
STORM_PLATFORM: options.platform,
|
|
3000
|
-
STORM_FORMAT: JSON.stringify(options.format),
|
|
3001
|
-
STORM_TARGET: JSON.stringify(options.target),
|
|
3002
|
-
...options.env
|
|
3003
|
-
};
|
|
3004
|
-
};
|
|
3005
|
-
|
|
3006
|
-
// ../build-tools/src/utilities/read-nx-config.ts
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
// ../build-tools/src/utilities/task-graph.ts
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
|
|
3015
|
-
|
|
3016
|
-
// ../esbuild/src/assets.ts
|
|
3017
|
-
async function copyBuildAssets(context) {
|
|
3018
|
-
if (!_optionalChain([context, 'access', _148 => _148.result, 'optionalAccess', _149 => _149.errors, 'access', _150 => _150.length]) && _optionalChain([context, 'access', _151 => _151.options, 'access', _152 => _152.assets, 'optionalAccess', _153 => _153.length])) {
|
|
3019
|
-
writeDebug(
|
|
3020
|
-
` \u{1F4CB} Copying ${context.options.assets.length} asset files to output directory: ${context.outputPath}`,
|
|
3021
|
-
context.workspaceConfig
|
|
3022
|
-
);
|
|
3023
|
-
const stopwatch = getStopwatch(`${context.options.name} asset copy`);
|
|
3024
|
-
await copyAssets(
|
|
3025
|
-
context.workspaceConfig,
|
|
3026
|
-
_nullishCoalesce(context.options.assets, () => ( [])),
|
|
3027
|
-
context.outputPath,
|
|
3028
|
-
context.options.projectRoot,
|
|
3029
|
-
context.sourceRoot,
|
|
3030
|
-
true,
|
|
3031
|
-
false
|
|
3032
|
-
);
|
|
3033
|
-
stopwatch();
|
|
3034
|
-
}
|
|
3035
|
-
return context;
|
|
3036
|
-
}
|
|
3037
|
-
|
|
3038
|
-
// ../esbuild/src/clean.ts
|
|
3039
|
-
|
|
3040
|
-
async function cleanDirectories(directory) {
|
|
3041
|
-
await _promises.rm.call(void 0, directory, { recursive: true, force: true });
|
|
3042
|
-
}
|
|
3043
|
-
|
|
3044
|
-
// ../esbuild/src/context.ts
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
|
|
3053
|
-
|
|
3054
|
-
// ../esbuild/src/config.ts
|
|
3055
|
-
var DEFAULT_BUILD_OPTIONS = {
|
|
3056
|
-
platform: "node",
|
|
3057
|
-
target: "node22",
|
|
3058
|
-
format: "esm",
|
|
3059
|
-
mode: "production",
|
|
3060
|
-
generatePackageJson: true,
|
|
3061
|
-
includeSrc: false,
|
|
3062
|
-
keepNames: true,
|
|
3063
|
-
metafile: false,
|
|
3064
|
-
treeshake: true,
|
|
3065
|
-
splitting: true,
|
|
3066
|
-
shims: false,
|
|
3067
|
-
watch: false,
|
|
3068
|
-
bundle: true,
|
|
3069
|
-
distDir: "dist",
|
|
3070
|
-
loader: {
|
|
3071
|
-
".aac": "file",
|
|
3072
|
-
".css": "file",
|
|
3073
|
-
".eot": "file",
|
|
3074
|
-
".flac": "file",
|
|
3075
|
-
".gif": "file",
|
|
3076
|
-
".jpeg": "file",
|
|
3077
|
-
".jpg": "file",
|
|
3078
|
-
".mp3": "file",
|
|
3079
|
-
".mp4": "file",
|
|
3080
|
-
".ogg": "file",
|
|
3081
|
-
".otf": "file",
|
|
3082
|
-
".png": "file",
|
|
3083
|
-
".svg": "file",
|
|
3084
|
-
".ttf": "file",
|
|
3085
|
-
".wav": "file",
|
|
3086
|
-
".webm": "file",
|
|
3087
|
-
".webp": "file",
|
|
3088
|
-
".woff": "file",
|
|
3089
|
-
".woff2": "file"
|
|
3090
|
-
},
|
|
3091
|
-
banner: {
|
|
3092
|
-
js: DEFAULT_JS_BANNER,
|
|
3093
|
-
css: DEFAULT_CSS_BANNER
|
|
3094
|
-
}
|
|
3095
|
-
};
|
|
3096
|
-
|
|
3097
|
-
// ../esbuild/src/context.ts
|
|
3098
|
-
async function resolveContext(userOptions) {
|
|
3099
|
-
const projectRoot = userOptions.projectRoot;
|
|
3100
|
-
const workspaceRoot2 = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
|
|
3101
|
-
if (!workspaceRoot2) {
|
|
3102
|
-
throw new Error("Cannot find Nx workspace root");
|
|
3103
|
-
}
|
|
3104
|
-
const workspaceConfig = await getWorkspaceConfig(true, {
|
|
3105
|
-
workspaceRoot: workspaceRoot2.dir
|
|
3106
|
-
});
|
|
3107
|
-
writeDebug(" \u2699\uFE0F Resolving build options", workspaceConfig);
|
|
3108
|
-
const stopwatch = getStopwatch("Build options resolution");
|
|
3109
|
-
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
3110
|
-
exitOnError: true
|
|
3111
|
-
});
|
|
3112
|
-
const projectJsonPath = joinPaths(
|
|
3113
|
-
workspaceRoot2.dir,
|
|
3114
|
-
projectRoot,
|
|
3115
|
-
"project.json"
|
|
3116
|
-
);
|
|
3117
|
-
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
3118
|
-
throw new Error("Cannot find project.json configuration");
|
|
3119
|
-
}
|
|
3120
|
-
const projectJsonFile = await _promises2.default.readFile(projectJsonPath, "utf8");
|
|
3121
|
-
const projectJson = JSON.parse(projectJsonFile);
|
|
3122
|
-
const projectName = projectJson.name || userOptions.name;
|
|
3123
|
-
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
3124
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _154 => _154.projects, 'optionalAccess', _155 => _155[projectName]])) {
|
|
3125
|
-
throw new Error(
|
|
3126
|
-
"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."
|
|
3127
|
-
);
|
|
3128
|
-
}
|
|
3129
|
-
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
3130
|
-
options.name ??= projectName;
|
|
3131
|
-
const packageJsonPath = joinPaths(
|
|
3132
|
-
workspaceRoot2.dir,
|
|
3133
|
-
options.projectRoot,
|
|
3134
|
-
"package.json"
|
|
3135
|
-
);
|
|
3136
|
-
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
3137
|
-
throw new Error("Cannot find package.json configuration");
|
|
3138
|
-
}
|
|
3139
|
-
const env = getEnv("esbuild", options);
|
|
3140
|
-
const define = _defu2.default.call(void 0, _nullishCoalesce(options.define, () => ( {})), _nullishCoalesce(env, () => ( {})));
|
|
3141
|
-
const resolvedOptions = {
|
|
3142
|
-
...options,
|
|
3143
|
-
tsconfig: userOptions.tsconfig === null ? void 0 : userOptions.tsconfig ? userOptions.tsconfig : joinPaths(workspaceRoot2.dir, projectRoot, "tsconfig.json"),
|
|
3144
|
-
metafile: userOptions.mode === "development",
|
|
3145
|
-
clean: false,
|
|
3146
|
-
env,
|
|
3147
|
-
define: {
|
|
3148
|
-
STORM_FORMAT: JSON.stringify(options.format),
|
|
3149
|
-
...Object.keys(define).filter((key) => define[key] !== void 0).reduce((res, key) => {
|
|
3150
|
-
const value = JSON.stringify(define[key]);
|
|
3151
|
-
const safeKey = key.replaceAll("(", "").replaceAll(")", "");
|
|
3152
|
-
return {
|
|
3153
|
-
...res,
|
|
3154
|
-
[`process.env.${safeKey}`]: value,
|
|
3155
|
-
[`import.meta.env.${safeKey}`]: value
|
|
3156
|
-
};
|
|
3157
|
-
}, {})
|
|
3158
|
-
}
|
|
3159
|
-
};
|
|
3160
|
-
stopwatch();
|
|
3161
|
-
const context = {
|
|
3162
|
-
options: resolvedOptions,
|
|
3163
|
-
clean: userOptions.clean !== false,
|
|
3164
|
-
workspaceConfig,
|
|
3165
|
-
projectConfigurations,
|
|
3166
|
-
projectName,
|
|
3167
|
-
projectGraph,
|
|
3168
|
-
sourceRoot: resolvedOptions.sourceRoot || projectJson.sourceRoot || joinPaths(resolvedOptions.projectRoot, "src"),
|
|
3169
|
-
outputPath: resolvedOptions.outputPath || joinPaths(
|
|
3170
|
-
workspaceConfig.workspaceRoot,
|
|
3171
|
-
"dist",
|
|
3172
|
-
resolvedOptions.projectRoot
|
|
3173
|
-
),
|
|
3174
|
-
minify: resolvedOptions.minify || resolvedOptions.mode === "production"
|
|
3175
|
-
};
|
|
3176
|
-
context.options.esbuildPlugins = [..._nullishCoalesce(context.options.esbuildPlugins, () => ( []))];
|
|
3177
|
-
if (context.options.verbose) {
|
|
3178
|
-
writeDebug(
|
|
3179
|
-
` \u2699\uFE0F Build options resolved:
|
|
3180
|
-
|
|
3181
|
-
${formatLogMessage(context.options)}`,
|
|
3182
|
-
workspaceConfig
|
|
3183
|
-
);
|
|
3184
|
-
}
|
|
3185
|
-
return context;
|
|
3186
|
-
}
|
|
3187
|
-
|
|
3188
|
-
// ../esbuild/src/package-json.ts
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
async function generatePackageJson(context) {
|
|
3193
|
-
if (context.options.generatePackageJson !== false && _fs.existsSync.call(void 0, joinPaths(context.options.projectRoot, "package.json"))) {
|
|
3194
|
-
writeDebug(" \u270D\uFE0F Writing package.json file", context.workspaceConfig);
|
|
3195
|
-
const stopwatch = getStopwatch("Write package.json file");
|
|
3196
|
-
const packageJsonPath = joinPaths(
|
|
3197
|
-
context.options.projectRoot,
|
|
3198
|
-
"project.json"
|
|
3199
|
-
);
|
|
3200
|
-
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
3201
|
-
throw new Error("Cannot find package.json configuration");
|
|
3202
|
-
}
|
|
3203
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
3204
|
-
joinPaths(
|
|
3205
|
-
context.workspaceConfig.workspaceRoot,
|
|
3206
|
-
context.options.projectRoot,
|
|
3207
|
-
"package.json"
|
|
3208
|
-
),
|
|
3209
|
-
"utf8"
|
|
3210
|
-
);
|
|
3211
|
-
let packageJson = JSON.parse(packageJsonFile);
|
|
3212
|
-
if (!packageJson) {
|
|
3213
|
-
throw new Error("Cannot find package.json configuration file");
|
|
3214
|
-
}
|
|
3215
|
-
packageJson = await addPackageDependencies(
|
|
3216
|
-
context.workspaceConfig.workspaceRoot,
|
|
3217
|
-
context.options.projectRoot,
|
|
3218
|
-
context.projectName,
|
|
3219
|
-
packageJson
|
|
3220
|
-
);
|
|
3221
|
-
packageJson = await addWorkspacePackageJsonFields(
|
|
3222
|
-
context.workspaceConfig,
|
|
3223
|
-
context.options.projectRoot,
|
|
3224
|
-
context.sourceRoot,
|
|
3225
|
-
context.projectName,
|
|
3226
|
-
false,
|
|
3227
|
-
packageJson
|
|
3228
|
-
);
|
|
3229
|
-
if (context.options.entry) {
|
|
3230
|
-
packageJson.exports ??= {};
|
|
3231
|
-
packageJson.exports["./package.json"] ??= "./package.json";
|
|
3232
|
-
const entryPoints = Array.isArray(context.options.entry) ? context.options.entry : Object.keys(context.options.entry);
|
|
3233
|
-
if (entryPoints.length > 0) {
|
|
3234
|
-
const defaultEntry = entryPoints.includes("index") ? `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index` : `.${context.options.distDir ? `/${context.options.distDir}` : ""}/${entryPoints[0]}`;
|
|
3235
|
-
const isEsm = Array.isArray(context.options.format) ? context.options.format.includes("esm") : context.options.format === "esm";
|
|
3236
|
-
const isCjs = Array.isArray(context.options.format) ? context.options.format.includes("cjs") : context.options.format === "cjs";
|
|
3237
|
-
const isDts = context.options.dts || context.options.experimentalDts;
|
|
3238
|
-
packageJson.exports["."] ??= `${defaultEntry}.${isEsm ? "mjs" : isCjs ? "cjs" : "js"}`;
|
|
3239
|
-
for (const entryPoint of entryPoints) {
|
|
3240
|
-
packageJson.exports[`./${entryPoint}`] ??= {};
|
|
3241
|
-
if (isEsm) {
|
|
3242
|
-
if (isDts) {
|
|
3243
|
-
packageJson.exports[`./${entryPoint}`].import = {
|
|
3244
|
-
types: `./dist/${entryPoint}.d.mts`,
|
|
3245
|
-
default: `./dist/${entryPoint}.mjs`
|
|
3246
|
-
};
|
|
3247
|
-
} else {
|
|
3248
|
-
packageJson.exports[`./${entryPoint}`].import = `./dist/${entryPoint}.mjs`;
|
|
3249
|
-
}
|
|
3250
|
-
if (isDts) {
|
|
3251
|
-
packageJson.exports[`./${entryPoint}`].default = {
|
|
3252
|
-
types: `./dist/${entryPoint}.d.mts`,
|
|
3253
|
-
default: `./dist/${entryPoint}.mjs`
|
|
3254
|
-
};
|
|
3255
|
-
} else {
|
|
3256
|
-
packageJson.exports[`./${entryPoint}`].default = `./dist/${entryPoint}.mjs`;
|
|
3257
|
-
}
|
|
3258
|
-
}
|
|
3259
|
-
if (isCjs) {
|
|
3260
|
-
if (isDts) {
|
|
3261
|
-
packageJson.exports[`./${entryPoint}`].require = {
|
|
3262
|
-
types: `./dist/${entryPoint}.d.cts`,
|
|
3263
|
-
default: `./dist/${entryPoint}.cjs`
|
|
3264
|
-
};
|
|
3265
|
-
} else {
|
|
3266
|
-
packageJson.exports[`./${entryPoint}`].require = `./dist/${entryPoint}.cjs`;
|
|
3267
|
-
}
|
|
3268
|
-
if (!isEsm) {
|
|
3269
|
-
if (isDts) {
|
|
3270
|
-
packageJson.exports[`./${entryPoint}`].default = {
|
|
3271
|
-
types: `./dist/${entryPoint}.d.cts`,
|
|
3272
|
-
default: `./dist/${entryPoint}.cjs`
|
|
3273
|
-
};
|
|
3274
|
-
} else {
|
|
3275
|
-
packageJson.exports[`./${entryPoint}`].default = `./dist/${entryPoint}.cjs`;
|
|
3276
|
-
}
|
|
3277
|
-
}
|
|
3278
|
-
}
|
|
3279
|
-
if (!isEsm && !isCjs) {
|
|
3280
|
-
if (isDts) {
|
|
3281
|
-
packageJson.exports[`./${entryPoint}`].default = {
|
|
3282
|
-
types: `./dist/${entryPoint}.d.ts`,
|
|
3283
|
-
default: `./dist/${entryPoint}.js`
|
|
3284
|
-
};
|
|
3285
|
-
} else {
|
|
3286
|
-
packageJson.exports[`./${entryPoint}`].default = `./dist/${entryPoint}.js`;
|
|
3287
|
-
}
|
|
3288
|
-
}
|
|
3289
|
-
}
|
|
3290
|
-
if (isEsm) {
|
|
3291
|
-
packageJson.module = `${defaultEntry}.mjs`;
|
|
3292
|
-
} else {
|
|
3293
|
-
packageJson.main = `${defaultEntry}.cjs`;
|
|
3294
|
-
}
|
|
3295
|
-
if (isDts) {
|
|
3296
|
-
packageJson.types = `${defaultEntry}.d.${isEsm ? "mts" : isCjs ? "cts" : "ts"}`;
|
|
3297
|
-
}
|
|
3298
|
-
packageJson.exports = Object.keys(packageJson.exports).reduce(
|
|
3299
|
-
(ret, key) => {
|
|
3300
|
-
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
3301
|
-
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
3302
|
-
}
|
|
3303
|
-
return ret;
|
|
3304
|
-
},
|
|
3305
|
-
packageJson.exports
|
|
3306
|
-
);
|
|
3307
|
-
}
|
|
3308
|
-
}
|
|
3309
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
3310
|
-
joinPaths(context.outputPath, "package.json"),
|
|
3311
|
-
packageJson
|
|
3312
|
-
);
|
|
3313
|
-
stopwatch();
|
|
3314
|
-
}
|
|
3315
|
-
return context;
|
|
3316
|
-
}
|
|
3317
|
-
|
|
3318
|
-
// ../tsup/src/index.ts
|
|
3319
|
-
var _tsup = require('tsup');
|
|
3320
|
-
async function build(options) {
|
|
3321
|
-
if (!options.silent) {
|
|
3322
|
-
writeDebug(
|
|
3323
|
-
` \u{1F680} Running ${options.name || "tsup"} build`,
|
|
3324
|
-
options.workspaceConfig
|
|
3325
|
-
);
|
|
3326
|
-
}
|
|
3327
|
-
const stopwatch = getStopwatch(`${options.name || "tsup"} build`);
|
|
3328
|
-
await _tsup.build.call(void 0, options);
|
|
3329
|
-
if (!options.silent) {
|
|
3330
|
-
stopwatch();
|
|
3331
|
-
}
|
|
3332
|
-
}
|
|
3333
|
-
|
|
3334
|
-
// ../esbuild/src/tsup.ts
|
|
3335
|
-
async function executeTsup(context) {
|
|
3336
|
-
writeDebug(
|
|
3337
|
-
` \u{1F680} Running ${context.options.name} build`,
|
|
3338
|
-
context.workspaceConfig
|
|
3339
|
-
);
|
|
3340
|
-
const stopwatch = getStopwatch(`${context.options.name} build`);
|
|
3341
|
-
await build({
|
|
3342
|
-
...context.options,
|
|
3343
|
-
outDir: context.options.distDir ? joinPaths(context.outputPath, context.options.distDir) : context.outputPath,
|
|
3344
|
-
workspaceConfig: context.workspaceConfig
|
|
3345
|
-
});
|
|
3346
|
-
stopwatch();
|
|
3347
|
-
return context;
|
|
3348
|
-
}
|
|
3349
|
-
|
|
3350
|
-
// ../esbuild/src/build.ts
|
|
3351
|
-
async function reportResults(context) {
|
|
3352
|
-
if (_optionalChain([context, 'access', _156 => _156.result, 'optionalAccess', _157 => _157.errors, 'access', _158 => _158.length]) === 0) {
|
|
3353
|
-
if (context.result.warnings.length > 0) {
|
|
3354
|
-
writeWarning(
|
|
3355
|
-
` \u{1F6A7} The following warnings occurred during the build: ${context.result.warnings.map((warning) => warning.text).join("\n")}`,
|
|
3356
|
-
context.workspaceConfig
|
|
3357
|
-
);
|
|
3358
|
-
}
|
|
3359
|
-
writeSuccess(
|
|
3360
|
-
` \u{1F4E6} The ${context.options.name} build completed successfully`,
|
|
3361
|
-
context.workspaceConfig
|
|
3362
|
-
);
|
|
3363
|
-
} else if (_optionalChain([context, 'access', _159 => _159.result, 'optionalAccess', _160 => _160.errors]) && _optionalChain([context, 'access', _161 => _161.result, 'optionalAccess', _162 => _162.errors, 'access', _163 => _163.length]) > 0) {
|
|
3364
|
-
writeError(
|
|
3365
|
-
` \u274C The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`,
|
|
3366
|
-
context.workspaceConfig
|
|
3367
|
-
);
|
|
3368
|
-
throw new Error(
|
|
3369
|
-
`The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`
|
|
3370
|
-
);
|
|
3371
|
-
}
|
|
3372
|
-
}
|
|
3373
|
-
async function cleanOutputPath(context) {
|
|
3374
|
-
if (context.clean !== false && context.outputPath) {
|
|
3375
|
-
writeDebug(
|
|
3376
|
-
` \u{1F9F9} Cleaning ${context.options.name} output path: ${context.outputPath}`,
|
|
3377
|
-
context.workspaceConfig
|
|
3378
|
-
);
|
|
3379
|
-
const stopwatch = getStopwatch(`${context.options.name} output clean`);
|
|
3380
|
-
await cleanDirectories(context.outputPath);
|
|
3381
|
-
stopwatch();
|
|
3382
|
-
}
|
|
3383
|
-
return context;
|
|
3384
|
-
}
|
|
3385
|
-
async function build2(options) {
|
|
3386
|
-
writeDebug(` ${brandIcon()} Executing Storm ESBuild pipeline`);
|
|
3387
|
-
const stopwatch = getStopwatch("ESBuild pipeline");
|
|
3388
|
-
try {
|
|
3389
|
-
const opts = Array.isArray(options) ? options : [options];
|
|
3390
|
-
if (opts.length === 0) {
|
|
3391
|
-
throw new Error("No build options were provided");
|
|
3392
|
-
}
|
|
3393
|
-
const context = await resolveContext(options);
|
|
3394
|
-
await cleanOutputPath(context);
|
|
3395
|
-
await Promise.all([
|
|
3396
|
-
// dependencyCheck(context.options),
|
|
3397
|
-
generatePackageJson(context),
|
|
3398
|
-
copyBuildAssets(context),
|
|
3399
|
-
executeTsup(context)
|
|
3400
|
-
]);
|
|
3401
|
-
await reportResults(context);
|
|
3402
|
-
writeSuccess(" \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
3403
|
-
} catch (error) {
|
|
3404
|
-
writeFatal(
|
|
3405
|
-
"Fatal errors that the build process could not recover from have occured. The build process has been terminated."
|
|
3406
|
-
);
|
|
3407
|
-
throw error;
|
|
3408
|
-
} finally {
|
|
3409
|
-
stopwatch();
|
|
3410
|
-
}
|
|
3411
|
-
}
|
|
3412
|
-
|
|
3413
2718
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
2719
|
+
var _jiti = require('jiti');
|
|
3414
2720
|
async function esbuildExecutorFn(options, context, config) {
|
|
3415
2721
|
writeInfo("\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
3416
|
-
if (!_optionalChain([context, 'access',
|
|
2722
|
+
if (!_optionalChain([context, 'access', _125 => _125.projectsConfigurations, 'optionalAccess', _126 => _126.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _127 => _127.projectsConfigurations, 'access', _128 => _128.projects, 'access', _129 => _129[context.projectName], 'optionalAccess', _130 => _130.root])) {
|
|
3417
2723
|
throw new Error(
|
|
3418
2724
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
3419
2725
|
);
|
|
3420
2726
|
}
|
|
2727
|
+
const jiti = _jiti.createJiti.call(void 0, _optionalChain([config, 'optionalAccess', _131 => _131.workspaceRoot]) || process.cwd(), {
|
|
2728
|
+
fsCache: _optionalChain([config, 'optionalAccess', _132 => _132.skipCache]) ? false : joinPaths(
|
|
2729
|
+
_optionalChain([config, 'optionalAccess', _133 => _133.workspaceRoot]) || process.cwd(),
|
|
2730
|
+
_optionalChain([config, 'optionalAccess', _134 => _134.directories, 'optionalAccess', _135 => _135.cache]) || "node_modules/.cache/storm",
|
|
2731
|
+
"jiti"
|
|
2732
|
+
),
|
|
2733
|
+
interopDefault: true
|
|
2734
|
+
});
|
|
2735
|
+
const { build: build2 } = await jiti.import(jiti.esmResolve("@storm-software/esbuild"));
|
|
3421
2736
|
await build2({
|
|
3422
2737
|
...options,
|
|
3423
2738
|
projectRoot: (
|
|
3424
2739
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3425
|
-
_optionalChain([context, 'access',
|
|
2740
|
+
_optionalChain([context, 'access', _136 => _136.projectsConfigurations, 'access', _137 => _137.projects, 'optionalAccess', _138 => _138[context.projectName], 'access', _139 => _139.root])
|
|
3426
2741
|
),
|
|
3427
2742
|
name: context.projectName,
|
|
3428
|
-
sourceRoot: _optionalChain([context, 'access',
|
|
2743
|
+
sourceRoot: _optionalChain([context, 'access', _140 => _140.projectsConfigurations, 'access', _141 => _141.projects, 'optionalAccess', _142 => _142[context.projectName], 'optionalAccess', _143 => _143.sourceRoot]),
|
|
3429
2744
|
format: options.format,
|
|
3430
2745
|
platform: options.platform
|
|
3431
2746
|
});
|
|
@@ -3450,7 +2765,7 @@ var executor_default6 = withRunExecutor(
|
|
|
3450
2765
|
);
|
|
3451
2766
|
|
|
3452
2767
|
// ../workspace-tools/src/executors/napi/executor.ts
|
|
3453
|
-
|
|
2768
|
+
|
|
3454
2769
|
var _fileutils = require('nx/src/utils/fileutils');
|
|
3455
2770
|
async function napiExecutor(options, context, config) {
|
|
3456
2771
|
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
@@ -3464,12 +2779,12 @@ async function napiExecutor(options, context, config) {
|
|
|
3464
2779
|
const { NapiCli } = await jiti.import(
|
|
3465
2780
|
jiti.esmResolve("@napi-rs/cli")
|
|
3466
2781
|
);
|
|
3467
|
-
if (!_optionalChain([context, 'access',
|
|
2782
|
+
if (!_optionalChain([context, 'access', _144 => _144.projectGraph, 'optionalAccess', _145 => _145.nodes, 'access', _146 => _146[_nullishCoalesce(context.projectName, () => ( ""))]])) {
|
|
3468
2783
|
throw new Error(
|
|
3469
2784
|
"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."
|
|
3470
2785
|
);
|
|
3471
2786
|
}
|
|
3472
|
-
const projectRoot = _optionalChain([context, 'access',
|
|
2787
|
+
const projectRoot = _optionalChain([context, 'access', _147 => _147.projectGraph, 'optionalAccess', _148 => _148.nodes, 'access', _149 => _149[_nullishCoalesce(context.projectName, () => ( ""))], 'optionalAccess', _150 => _150.data, 'access', _151 => _151.root]);
|
|
3473
2788
|
const packageJson = joinPaths(_nullishCoalesce(projectRoot, () => ( ".")), "package.json");
|
|
3474
2789
|
if (!_fileutils.fileExists.call(void 0, packageJson)) {
|
|
3475
2790
|
throw new Error(`Could not find package.json at ${packageJson}`);
|
|
@@ -3477,7 +2792,7 @@ async function napiExecutor(options, context, config) {
|
|
|
3477
2792
|
const napi = new NapiCli();
|
|
3478
2793
|
const normalizedOptions = { ...options };
|
|
3479
2794
|
const metadata = cargoMetadata();
|
|
3480
|
-
normalizedOptions.targetDir = options.targetDir || _optionalChain([metadata, 'optionalAccess',
|
|
2795
|
+
normalizedOptions.targetDir = options.targetDir || _optionalChain([metadata, 'optionalAccess', _152 => _152.target_directory]) || joinPaths(config.workspaceRoot, "dist", "target");
|
|
3481
2796
|
normalizedOptions.outputDir = options.outputPath;
|
|
3482
2797
|
normalizedOptions.packageJsonPath ??= packageJson;
|
|
3483
2798
|
if (options.cwd) {
|
|
@@ -3557,36 +2872,37 @@ var executor_default7 = withRunExecutor(
|
|
|
3557
2872
|
}
|
|
3558
2873
|
);
|
|
3559
2874
|
|
|
3560
|
-
// ../npm-tools/src/helpers/get-
|
|
2875
|
+
// ../npm-tools/src/helpers/get-version.ts
|
|
3561
2876
|
|
|
2877
|
+
var _semver = require('semver');
|
|
2878
|
+
var _stripansi = require('strip-ansi'); var _stripansi2 = _interopRequireDefault(_stripansi);
|
|
3562
2879
|
|
|
3563
|
-
// ../
|
|
2880
|
+
// ../npm-tools/src/helpers/get-registry.ts
|
|
3564
2881
|
|
|
3565
2882
|
|
|
2883
|
+
// ../pnpm-tools/src/helpers/catalog.ts
|
|
3566
2884
|
|
|
3567
2885
|
|
|
2886
|
+
// ../pnpm-tools/src/helpers/pnpm-workspace.ts
|
|
3568
2887
|
|
|
3569
2888
|
|
|
3570
|
-
var
|
|
2889
|
+
var _yaml = require('yaml');
|
|
3571
2890
|
|
|
3572
|
-
// ../
|
|
2891
|
+
// ../pnpm-tools/src/helpers/replace-deps-aliases.ts
|
|
3573
2892
|
|
|
3574
|
-
var _semver = require('semver');
|
|
3575
|
-
var _stripansi = require('strip-ansi'); var _stripansi2 = _interopRequireDefault(_stripansi);
|
|
3576
2893
|
|
|
3577
|
-
// ../pnpm-tools/src/helpers/catalog.ts
|
|
3578
2894
|
|
|
3579
2895
|
|
|
3580
|
-
// ../pnpm-tools/src/helpers/pnpm-workspace.ts
|
|
3581
2896
|
|
|
3582
2897
|
|
|
3583
|
-
var
|
|
2898
|
+
var _prettier = require('prettier');
|
|
3584
2899
|
|
|
3585
2900
|
// ../workspace-tools/src/executors/npm-publish/executor.ts
|
|
3586
2901
|
|
|
3587
2902
|
|
|
3588
2903
|
|
|
3589
2904
|
|
|
2905
|
+
|
|
3590
2906
|
// ../workspace-tools/src/utils/github.ts
|
|
3591
2907
|
|
|
3592
2908
|
|
|
@@ -3661,71 +2977,361 @@ var hasProjectTag = (project, variant) => {
|
|
|
3661
2977
|
return project.tags.some(
|
|
3662
2978
|
(tag) => tag.startsWith(prefix) && tag.length > prefix.length
|
|
3663
2979
|
);
|
|
3664
|
-
};
|
|
2980
|
+
};
|
|
2981
|
+
|
|
2982
|
+
// ../workspace-tools/src/utils/project-tags.ts
|
|
2983
|
+
var addProjectTag = (project, variant, value, options = {
|
|
2984
|
+
overwrite: false
|
|
2985
|
+
}) => {
|
|
2986
|
+
project.tags = _nullishCoalesce(project.tags, () => ( []));
|
|
2987
|
+
if (options.overwrite || !hasProjectTag(project, variant)) {
|
|
2988
|
+
project.tags = project.tags.filter(
|
|
2989
|
+
(tag) => !tag.startsWith(formatProjectTag(variant, ""))
|
|
2990
|
+
);
|
|
2991
|
+
project.tags.push(formatProjectTag(variant, value));
|
|
2992
|
+
}
|
|
2993
|
+
};
|
|
2994
|
+
|
|
2995
|
+
// ../workspace-tools/src/executors/npm-publish/executor.ts
|
|
2996
|
+
var LARGE_BUFFER3 = 1024 * 1e6;
|
|
2997
|
+
|
|
2998
|
+
// ../workspace-tools/src/executors/size-limit/executor.ts
|
|
2999
|
+
|
|
3000
|
+
var _esbuild = require('@size-limit/esbuild'); var _esbuild2 = _interopRequireDefault(_esbuild);
|
|
3001
|
+
var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _interopRequireDefault(_esbuildwhy);
|
|
3002
|
+
var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
|
|
3003
|
+
var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
|
|
3004
|
+
async function sizeLimitExecutorFn(options, context, config) {
|
|
3005
|
+
if (!_optionalChain([context, 'optionalAccess', _153 => _153.projectName]) || !_optionalChain([context, 'access', _154 => _154.projectsConfigurations, 'optionalAccess', _155 => _155.projects]) || !context.projectsConfigurations.projects[context.projectName]) {
|
|
3006
|
+
throw new Error(
|
|
3007
|
+
"The Size-Limit process failed because the context is not valid. Please run this command from a workspace."
|
|
3008
|
+
);
|
|
3009
|
+
}
|
|
3010
|
+
writeInfo(`\u{1F4CF} Running Size-Limit on ${context.projectName}`, config);
|
|
3011
|
+
_sizelimit2.default.call(void 0, [_file2.default, _esbuild2.default, _esbuildwhy2.default], {
|
|
3012
|
+
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context, 'access', _156 => _156.projectsConfigurations, 'access', _157 => _157.projects, 'access', _158 => _158[context.projectName], 'optionalAccess', _159 => _159.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0,
|
|
3013
|
+
_nullishCoalesce(_optionalChain([context, 'access', _160 => _160.projectsConfigurations, 'access', _161 => _161.projects, 'access', _162 => _162[context.projectName], 'optionalAccess', _163 => _163.root]), () => ( "./")),
|
|
3014
|
+
"src"
|
|
3015
|
+
)))
|
|
3016
|
+
}).then((result) => {
|
|
3017
|
+
writeInfo(
|
|
3018
|
+
`\u{1F4CF} ${context.projectName} Size-Limit result: ${JSON.stringify(result)}`,
|
|
3019
|
+
config
|
|
3020
|
+
);
|
|
3021
|
+
});
|
|
3022
|
+
return {
|
|
3023
|
+
success: true
|
|
3024
|
+
};
|
|
3025
|
+
}
|
|
3026
|
+
var executor_default8 = withRunExecutor(
|
|
3027
|
+
"Size-Limit Performance Test Executor",
|
|
3028
|
+
sizeLimitExecutorFn,
|
|
3029
|
+
{
|
|
3030
|
+
skipReadingConfig: false,
|
|
3031
|
+
hooks: {
|
|
3032
|
+
applyDefaultOptions: (options) => {
|
|
3033
|
+
return options;
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
3036
|
+
}
|
|
3037
|
+
);
|
|
3038
|
+
|
|
3039
|
+
// ../tsdown/src/build.ts
|
|
3040
|
+
|
|
3041
|
+
|
|
3042
|
+
|
|
3043
|
+
|
|
3044
|
+
|
|
3045
|
+
|
|
3046
|
+
// ../build-tools/src/config.ts
|
|
3047
|
+
var DEFAULT_ENVIRONMENT = "production";
|
|
3048
|
+
var DEFAULT_TARGET = "esnext";
|
|
3049
|
+
var DEFAULT_ORGANIZATION = "storm-software";
|
|
3050
|
+
|
|
3051
|
+
// ../build-tools/src/plugins/swc.ts
|
|
3052
|
+
var _core = require('@swc/core');
|
|
3053
|
+
|
|
3054
|
+
// ../build-tools/src/plugins/ts-resolve.ts
|
|
3055
|
+
|
|
3056
|
+
var _module = require('module');
|
|
3057
|
+
|
|
3058
|
+
var _resolve2 = require('resolve'); var _resolve3 = _interopRequireDefault(_resolve2);
|
|
3059
|
+
|
|
3060
|
+
// ../build-tools/src/plugins/type-definitions.ts
|
|
3061
|
+
|
|
3062
|
+
|
|
3063
|
+
|
|
3064
|
+
// ../build-tools/src/utilities/copy-assets.ts
|
|
3065
|
+
var _internal = require('@nx/js/internal');
|
|
3066
|
+
var _glob = require('glob');
|
|
3067
|
+
|
|
3068
|
+
var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
|
|
3069
|
+
const pendingAssets = Array.from(_nullishCoalesce(assets, () => ( [])));
|
|
3070
|
+
pendingAssets.push({
|
|
3071
|
+
input: projectRoot,
|
|
3072
|
+
glob: "*.md",
|
|
3073
|
+
output: "."
|
|
3074
|
+
});
|
|
3075
|
+
pendingAssets.push({
|
|
3076
|
+
input: ".",
|
|
3077
|
+
glob: "LICENSE",
|
|
3078
|
+
output: "."
|
|
3079
|
+
});
|
|
3080
|
+
if (generatePackageJson2 === false) {
|
|
3081
|
+
pendingAssets.push({
|
|
3082
|
+
input: projectRoot,
|
|
3083
|
+
glob: "package.json",
|
|
3084
|
+
output: "."
|
|
3085
|
+
});
|
|
3086
|
+
}
|
|
3087
|
+
if (includeSrc === true) {
|
|
3088
|
+
pendingAssets.push({
|
|
3089
|
+
input: sourceRoot,
|
|
3090
|
+
glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
|
|
3091
|
+
output: "src/"
|
|
3092
|
+
});
|
|
3093
|
+
}
|
|
3094
|
+
writeTrace(
|
|
3095
|
+
`\u{1F4DD} Copying the following assets to the output directory:
|
|
3096
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`,
|
|
3097
|
+
config
|
|
3098
|
+
);
|
|
3099
|
+
const assetHandler = new (0, _internal.CopyAssetsHandler)({
|
|
3100
|
+
projectDir: projectRoot,
|
|
3101
|
+
rootDir: config.workspaceRoot,
|
|
3102
|
+
outputDir: outputPath,
|
|
3103
|
+
assets: pendingAssets
|
|
3104
|
+
});
|
|
3105
|
+
await assetHandler.processAllAssetsOnce();
|
|
3106
|
+
writeTrace("Completed copying assets to the output directory", config);
|
|
3107
|
+
if (includeSrc === true) {
|
|
3108
|
+
writeDebug(
|
|
3109
|
+
`\u{1F4DD} Adding banner and writing source files: ${joinPaths(
|
|
3110
|
+
outputPath,
|
|
3111
|
+
"src"
|
|
3112
|
+
)}`,
|
|
3113
|
+
config
|
|
3114
|
+
);
|
|
3115
|
+
const files = await _glob.glob.call(void 0, [
|
|
3116
|
+
joinPaths(config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
3117
|
+
joinPaths(config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
3118
|
+
joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
3119
|
+
joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
3120
|
+
]);
|
|
3121
|
+
await Promise.allSettled(
|
|
3122
|
+
files.map(
|
|
3123
|
+
async (file) => _promises.writeFile.call(void 0,
|
|
3124
|
+
file,
|
|
3125
|
+
`${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
3665
3126
|
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
if (options.overwrite || !hasProjectTag(project, variant)) {
|
|
3672
|
-
project.tags = project.tags.filter(
|
|
3673
|
-
(tag) => !tag.startsWith(formatProjectTag(variant, ""))
|
|
3127
|
+
${await _promises.readFile.call(void 0, file, "utf8")}
|
|
3128
|
+
|
|
3129
|
+
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
|
|
3130
|
+
)
|
|
3131
|
+
)
|
|
3674
3132
|
);
|
|
3675
|
-
project.tags.push(formatProjectTag(variant, value));
|
|
3676
3133
|
}
|
|
3677
3134
|
};
|
|
3678
3135
|
|
|
3679
|
-
// ../
|
|
3680
|
-
var LARGE_BUFFER3 = 1024 * 1e6;
|
|
3136
|
+
// ../build-tools/src/utilities/generate-package-json.ts
|
|
3681
3137
|
|
|
3682
|
-
// ../workspace-tools/src/executors/size-limit/executor.ts
|
|
3683
3138
|
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3139
|
+
|
|
3140
|
+
|
|
3141
|
+
|
|
3142
|
+
|
|
3143
|
+
|
|
3144
|
+
|
|
3145
|
+
var _projectgraph = require('nx/src/project-graph/project-graph');
|
|
3146
|
+
var addPackageDependencies = async (workspaceRoot2, projectRoot, projectName, packageJson) => {
|
|
3147
|
+
let projectGraph;
|
|
3148
|
+
try {
|
|
3149
|
+
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
3150
|
+
} catch (e3) {
|
|
3151
|
+
await _projectgraph.createProjectGraphAsync.call(void 0, );
|
|
3152
|
+
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
3153
|
+
}
|
|
3154
|
+
if (!projectGraph) {
|
|
3690
3155
|
throw new Error(
|
|
3691
|
-
"The
|
|
3156
|
+
"The Build process failed because the project graph is not available. Please run the build command again."
|
|
3692
3157
|
);
|
|
3693
3158
|
}
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3159
|
+
const projectDependencies = _internal.calculateProjectBuildableDependencies.call(void 0,
|
|
3160
|
+
void 0,
|
|
3161
|
+
projectGraph,
|
|
3162
|
+
workspaceRoot2,
|
|
3163
|
+
projectName,
|
|
3164
|
+
process.env.NX_TASK_TARGET_TARGET || "build",
|
|
3165
|
+
process.env.NX_TASK_TARGET_CONFIGURATION || "production",
|
|
3166
|
+
true
|
|
3167
|
+
);
|
|
3168
|
+
const localPackages = [];
|
|
3169
|
+
for (const project of projectDependencies.dependencies.filter(
|
|
3170
|
+
(dep) => dep.node.type === "lib" && _optionalChain([dep, 'access', _164 => _164.node, 'access', _165 => _165.data, 'optionalAccess', _166 => _166.root]) !== projectRoot && _optionalChain([dep, 'access', _167 => _167.node, 'access', _168 => _168.data, 'optionalAccess', _169 => _169.root]) !== workspaceRoot2
|
|
3171
|
+
)) {
|
|
3172
|
+
const projectNode = project.node;
|
|
3173
|
+
if (projectNode.data.root) {
|
|
3174
|
+
const projectPackageJsonPath = joinPaths(
|
|
3175
|
+
workspaceRoot2,
|
|
3176
|
+
projectNode.data.root,
|
|
3177
|
+
"package.json"
|
|
3178
|
+
);
|
|
3179
|
+
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
3180
|
+
const projectPackageJsonContent = await _promises.readFile.call(void 0,
|
|
3181
|
+
projectPackageJsonPath,
|
|
3182
|
+
"utf8"
|
|
3183
|
+
);
|
|
3184
|
+
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
3185
|
+
if (projectPackageJson.private !== true) {
|
|
3186
|
+
localPackages.push(projectPackageJson);
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3191
|
+
if (localPackages.length > 0) {
|
|
3192
|
+
writeTrace(
|
|
3193
|
+
`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`
|
|
3704
3194
|
);
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3195
|
+
const projectJsonFile = await _promises.readFile.call(void 0,
|
|
3196
|
+
joinPaths(projectRoot, "project.json"),
|
|
3197
|
+
"utf8"
|
|
3198
|
+
);
|
|
3199
|
+
const projectJson = JSON.parse(projectJsonFile);
|
|
3200
|
+
const projectName2 = projectJson.name;
|
|
3201
|
+
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
3202
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _170 => _170.projects, 'optionalAccess', _171 => _171[projectName2]])) {
|
|
3203
|
+
throw new Error(
|
|
3204
|
+
"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."
|
|
3205
|
+
);
|
|
3206
|
+
}
|
|
3207
|
+
const implicitDependencies = _optionalChain([projectConfigurations, 'access', _172 => _172.projects, 'optionalAccess', _173 => _173[projectName2], 'access', _174 => _174.implicitDependencies, 'optionalAccess', _175 => _175.reduce, 'call', _176 => _176((ret, dep) => {
|
|
3208
|
+
if (_optionalChain([projectConfigurations, 'access', _177 => _177.projects, 'optionalAccess', _178 => _178[dep]])) {
|
|
3209
|
+
const depPackageJsonPath = joinPaths(
|
|
3210
|
+
workspaceRoot2,
|
|
3211
|
+
projectConfigurations.projects[dep].root,
|
|
3212
|
+
"package.json"
|
|
3213
|
+
);
|
|
3214
|
+
if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
|
|
3215
|
+
const depPackageJsonContent = _fs.readFileSync.call(void 0,
|
|
3216
|
+
depPackageJsonPath,
|
|
3217
|
+
"utf8"
|
|
3218
|
+
);
|
|
3219
|
+
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
3220
|
+
if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
|
|
3221
|
+
ret.push(depPackageJson.name);
|
|
3222
|
+
}
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
3225
|
+
return ret;
|
|
3226
|
+
}, [])]);
|
|
3227
|
+
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
3228
|
+
if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _179 => _179.includes, 'call', _180 => _180(localPackage.name)]) && _optionalChain([packageJson, 'access', _181 => _181.devDependencies, 'optionalAccess', _182 => _182[localPackage.name]]) === void 0) {
|
|
3229
|
+
ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
|
|
3230
|
+
}
|
|
3231
|
+
return ret;
|
|
3232
|
+
}, _nullishCoalesce(packageJson.dependencies, () => ( {})));
|
|
3233
|
+
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
3234
|
+
if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess', _183 => _183.includes, 'call', _184 => _184(localPackage.name)]) && _optionalChain([packageJson, 'access', _185 => _185.dependencies, 'optionalAccess', _186 => _186[localPackage.name]]) === void 0) {
|
|
3235
|
+
ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
|
|
3718
3236
|
}
|
|
3237
|
+
return ret;
|
|
3238
|
+
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
3239
|
+
} else {
|
|
3240
|
+
writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
|
|
3241
|
+
}
|
|
3242
|
+
return packageJson;
|
|
3243
|
+
};
|
|
3244
|
+
var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
3245
|
+
const workspaceRoot2 = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : findWorkspaceRoot();
|
|
3246
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
3247
|
+
joinPaths(workspaceRoot2, "package.json"),
|
|
3248
|
+
"utf8"
|
|
3249
|
+
);
|
|
3250
|
+
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
3251
|
+
packageJson.type ??= "module";
|
|
3252
|
+
packageJson.sideEffects ??= false;
|
|
3253
|
+
if (includeSrc === true) {
|
|
3254
|
+
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
3255
|
+
if (distSrc.startsWith("/")) {
|
|
3256
|
+
distSrc = distSrc.substring(1);
|
|
3719
3257
|
}
|
|
3258
|
+
packageJson.source ??= `${joinPaths(distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
3720
3259
|
}
|
|
3721
|
-
|
|
3260
|
+
packageJson.files ??= ["dist/**/*"];
|
|
3261
|
+
if (includeSrc === true && !packageJson.files.includes("src")) {
|
|
3262
|
+
packageJson.files.push("src/**/*");
|
|
3263
|
+
}
|
|
3264
|
+
packageJson.publishConfig ??= {
|
|
3265
|
+
access: "public"
|
|
3266
|
+
};
|
|
3267
|
+
packageJson.description ??= workspacePackageJson.description;
|
|
3268
|
+
packageJson.homepage ??= workspacePackageJson.homepage;
|
|
3269
|
+
packageJson.bugs ??= workspacePackageJson.bugs;
|
|
3270
|
+
packageJson.license ??= workspacePackageJson.license;
|
|
3271
|
+
packageJson.keywords ??= workspacePackageJson.keywords;
|
|
3272
|
+
packageJson.funding ??= workspacePackageJson.funding;
|
|
3273
|
+
packageJson.author ??= workspacePackageJson.author;
|
|
3274
|
+
packageJson.maintainers ??= workspacePackageJson.maintainers;
|
|
3275
|
+
if (!packageJson.maintainers && packageJson.author) {
|
|
3276
|
+
packageJson.maintainers = [packageJson.author];
|
|
3277
|
+
}
|
|
3278
|
+
packageJson.contributors ??= workspacePackageJson.contributors;
|
|
3279
|
+
if (!packageJson.contributors && packageJson.author) {
|
|
3280
|
+
packageJson.contributors = [packageJson.author];
|
|
3281
|
+
}
|
|
3282
|
+
packageJson.repository ??= workspacePackageJson.repository;
|
|
3283
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
|
|
3284
|
+
return packageJson;
|
|
3285
|
+
};
|
|
3286
|
+
var addPackageJsonExport = (file, type = "module", sourceRoot) => {
|
|
3287
|
+
let entry = file.replaceAll("\\", "/");
|
|
3288
|
+
if (sourceRoot) {
|
|
3289
|
+
entry = entry.replace(sourceRoot, "");
|
|
3290
|
+
}
|
|
3291
|
+
return {
|
|
3292
|
+
import: {
|
|
3293
|
+
types: `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
|
|
3294
|
+
default: `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
|
|
3295
|
+
},
|
|
3296
|
+
require: {
|
|
3297
|
+
types: `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
|
|
3298
|
+
default: `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
|
|
3299
|
+
},
|
|
3300
|
+
default: {
|
|
3301
|
+
types: `./dist/${entry}.d.${type !== "fixed" ? "ts" : "mts"}`,
|
|
3302
|
+
default: `./dist/${entry}.${type !== "fixed" ? "js" : "mjs"}`
|
|
3303
|
+
}
|
|
3304
|
+
};
|
|
3305
|
+
};
|
|
3306
|
+
|
|
3307
|
+
// ../build-tools/src/utilities/get-entry-points.ts
|
|
3308
|
+
|
|
3309
|
+
|
|
3310
|
+
// ../build-tools/src/utilities/get-env.ts
|
|
3311
|
+
var getEnv = (builder, options) => {
|
|
3312
|
+
return {
|
|
3313
|
+
STORM_BUILD: builder,
|
|
3314
|
+
STORM_ORG: options.orgName || DEFAULT_ORGANIZATION,
|
|
3315
|
+
STORM_NAME: options.name,
|
|
3316
|
+
STORM_MODE: options.mode || DEFAULT_ENVIRONMENT,
|
|
3317
|
+
STORM_PLATFORM: options.platform,
|
|
3318
|
+
STORM_FORMAT: JSON.stringify(options.format),
|
|
3319
|
+
STORM_TARGET: JSON.stringify(options.target),
|
|
3320
|
+
...options.env
|
|
3321
|
+
};
|
|
3322
|
+
};
|
|
3323
|
+
|
|
3324
|
+
// ../build-tools/src/utilities/read-nx-config.ts
|
|
3722
3325
|
|
|
3723
|
-
// ../tsdown/src/build.ts
|
|
3724
3326
|
|
|
3725
3327
|
|
|
3328
|
+
// ../build-tools/src/utilities/task-graph.ts
|
|
3329
|
+
|
|
3726
3330
|
|
|
3727
3331
|
|
|
3332
|
+
var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
|
|
3728
3333
|
|
|
3334
|
+
// ../tsdown/src/build.ts
|
|
3729
3335
|
|
|
3730
3336
|
|
|
3731
3337
|
|
|
@@ -3733,7 +3339,7 @@ var _tsdown = require('tsdown');
|
|
|
3733
3339
|
|
|
3734
3340
|
// ../tsdown/src/clean.ts
|
|
3735
3341
|
|
|
3736
|
-
async function
|
|
3342
|
+
async function cleanDirectories(name = "TSDown", directory, config) {
|
|
3737
3343
|
await _promises.rm.call(void 0, directory, { recursive: true, force: true });
|
|
3738
3344
|
}
|
|
3739
3345
|
|
|
@@ -3792,7 +3398,7 @@ var resolveOptions = async (userOptions) => {
|
|
|
3792
3398
|
const projectJson = JSON.parse(projectJsonFile);
|
|
3793
3399
|
const projectName = projectJson.name;
|
|
3794
3400
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
3795
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
3401
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _187 => _187.projects, 'optionalAccess', _188 => _188[projectName]])) {
|
|
3796
3402
|
throw new Error(
|
|
3797
3403
|
"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."
|
|
3798
3404
|
);
|
|
@@ -3846,7 +3452,7 @@ var resolveOptions = async (userOptions) => {
|
|
|
3846
3452
|
stopwatch();
|
|
3847
3453
|
return result;
|
|
3848
3454
|
};
|
|
3849
|
-
async function
|
|
3455
|
+
async function generatePackageJson(options) {
|
|
3850
3456
|
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, joinPaths(options.projectRoot, "package.json"))) {
|
|
3851
3457
|
writeDebug(" \u270D\uFE0F Writing package.json file", options.workspaceConfig);
|
|
3852
3458
|
const stopwatch = getStopwatch("Write package.json file");
|
|
@@ -3933,7 +3539,7 @@ async function executeTSDown(options) {
|
|
|
3933
3539
|
stopwatch();
|
|
3934
3540
|
return options;
|
|
3935
3541
|
}
|
|
3936
|
-
async function
|
|
3542
|
+
async function copyBuildAssets(options) {
|
|
3937
3543
|
writeDebug(
|
|
3938
3544
|
` \u{1F4CB} Copying asset files to output directory: ${options.outDir}`,
|
|
3939
3545
|
options.workspaceConfig
|
|
@@ -3951,20 +3557,20 @@ async function copyBuildAssets2(options) {
|
|
|
3951
3557
|
stopwatch();
|
|
3952
3558
|
return options;
|
|
3953
3559
|
}
|
|
3954
|
-
async function
|
|
3560
|
+
async function reportResults(options) {
|
|
3955
3561
|
writeSuccess(
|
|
3956
3562
|
` \u{1F4E6} The ${options.name} build completed successfully`,
|
|
3957
3563
|
options.workspaceConfig
|
|
3958
3564
|
);
|
|
3959
3565
|
}
|
|
3960
|
-
async function
|
|
3566
|
+
async function cleanOutputPath(options) {
|
|
3961
3567
|
if (options.clean !== false && options.workspaceConfig) {
|
|
3962
3568
|
writeDebug(
|
|
3963
3569
|
` \u{1F9F9} Cleaning ${options.name} output path: ${options.workspaceConfig}`,
|
|
3964
3570
|
options.workspaceConfig
|
|
3965
3571
|
);
|
|
3966
3572
|
const stopwatch = getStopwatch(`${options.name} output clean`);
|
|
3967
|
-
await
|
|
3573
|
+
await cleanDirectories(
|
|
3968
3574
|
options.name,
|
|
3969
3575
|
options.outDir,
|
|
3970
3576
|
options.workspaceConfig
|
|
@@ -3973,7 +3579,7 @@ async function cleanOutputPath2(options) {
|
|
|
3973
3579
|
}
|
|
3974
3580
|
return options;
|
|
3975
3581
|
}
|
|
3976
|
-
async function
|
|
3582
|
+
async function build(options) {
|
|
3977
3583
|
writeDebug(` ${brandIcon()} Executing Storm TSDown pipeline`);
|
|
3978
3584
|
const stopwatch = getStopwatch("TSDown pipeline");
|
|
3979
3585
|
try {
|
|
@@ -3985,13 +3591,13 @@ async function build3(options) {
|
|
|
3985
3591
|
opts.map(async (opt) => await resolveOptions(opt))
|
|
3986
3592
|
);
|
|
3987
3593
|
if (resolved.length > 0) {
|
|
3988
|
-
await
|
|
3989
|
-
await
|
|
3594
|
+
await cleanOutputPath(resolved[0]);
|
|
3595
|
+
await generatePackageJson(resolved[0]);
|
|
3990
3596
|
await Promise.all(
|
|
3991
3597
|
resolved.map(async (opt) => {
|
|
3992
3598
|
await executeTSDown(opt);
|
|
3993
|
-
await
|
|
3994
|
-
await
|
|
3599
|
+
await copyBuildAssets(opt);
|
|
3600
|
+
await reportResults(opt);
|
|
3995
3601
|
})
|
|
3996
3602
|
);
|
|
3997
3603
|
} else {
|
|
@@ -4013,19 +3619,19 @@ async function build3(options) {
|
|
|
4013
3619
|
// ../workspace-tools/src/executors/tsdown/executor.ts
|
|
4014
3620
|
async function tsdownExecutorFn(options, context, config) {
|
|
4015
3621
|
writeInfo("\u{1F4E6} Running Storm TSDown executor on the workspace", config);
|
|
4016
|
-
if (!_optionalChain([context, 'access',
|
|
3622
|
+
if (!_optionalChain([context, 'access', _189 => _189.projectsConfigurations, 'optionalAccess', _190 => _190.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _191 => _191.projectsConfigurations, 'access', _192 => _192.projects, 'access', _193 => _193[context.projectName], 'optionalAccess', _194 => _194.root])) {
|
|
4017
3623
|
throw new Error(
|
|
4018
3624
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
4019
3625
|
);
|
|
4020
3626
|
}
|
|
4021
|
-
await
|
|
3627
|
+
await build({
|
|
4022
3628
|
...options,
|
|
4023
3629
|
projectRoot: (
|
|
4024
3630
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
4025
|
-
_optionalChain([context, 'access',
|
|
3631
|
+
_optionalChain([context, 'access', _195 => _195.projectsConfigurations, 'access', _196 => _196.projects, 'optionalAccess', _197 => _197[context.projectName], 'access', _198 => _198.root])
|
|
4026
3632
|
),
|
|
4027
3633
|
name: context.projectName,
|
|
4028
|
-
sourceRoot: _optionalChain([context, 'access',
|
|
3634
|
+
sourceRoot: _optionalChain([context, 'access', _199 => _199.projectsConfigurations, 'access', _200 => _200.projects, 'optionalAccess', _201 => _201[context.projectName], 'optionalAccess', _202 => _202.sourceRoot]),
|
|
4029
3635
|
format: options.format,
|
|
4030
3636
|
platform: options.platform
|
|
4031
3637
|
});
|
|
@@ -4093,7 +3699,7 @@ var executor_default10 = withRunExecutor(
|
|
|
4093
3699
|
|
|
4094
3700
|
async function unbuildExecutorFn(options, context, config) {
|
|
4095
3701
|
writeInfo("\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
4096
|
-
if (!_optionalChain([context, 'access',
|
|
3702
|
+
if (!_optionalChain([context, 'access', _203 => _203.projectsConfigurations, 'optionalAccess', _204 => _204.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
4097
3703
|
throw new Error(
|
|
4098
3704
|
"The Build process failed because the context is not valid. Please run this command from a workspace root directory."
|
|
4099
3705
|
);
|
|
@@ -4281,15 +3887,15 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
4281
3887
|
_devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
|
|
4282
3888
|
let repository = {
|
|
4283
3889
|
type: "github",
|
|
4284
|
-
url: _optionalChain([config, 'optionalAccess',
|
|
3890
|
+
url: _optionalChain([config, 'optionalAccess', _205 => _205.repository]) || `https://github.com/${(typeof _optionalChain([config, 'optionalAccess', _206 => _206.organization]) === "string" ? _optionalChain([config, 'optionalAccess', _207 => _207.organization]) : _optionalChain([config, 'optionalAccess', _208 => _208.organization, 'optionalAccess', _209 => _209.name])) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _210 => _210.namespace]) || _optionalChain([config, 'optionalAccess', _211 => _211.name]) || "repository"}.git`
|
|
4285
3891
|
};
|
|
4286
3892
|
let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
4287
3893
|
if (tree.exists("package.json")) {
|
|
4288
3894
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
4289
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
3895
|
+
if (_optionalChain([packageJson, 'optionalAccess', _212 => _212.repository])) {
|
|
4290
3896
|
repository = packageJson.repository;
|
|
4291
3897
|
}
|
|
4292
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
3898
|
+
if (_optionalChain([packageJson, 'optionalAccess', _213 => _213.description])) {
|
|
4293
3899
|
description = packageJson.description;
|
|
4294
3900
|
}
|
|
4295
3901
|
}
|
|
@@ -4344,9 +3950,9 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
4344
3950
|
_devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
|
|
4345
3951
|
...json,
|
|
4346
3952
|
pnpm: {
|
|
4347
|
-
..._optionalChain([json, 'optionalAccess',
|
|
3953
|
+
..._optionalChain([json, 'optionalAccess', _214 => _214.pnpm]),
|
|
4348
3954
|
overrides: {
|
|
4349
|
-
..._optionalChain([json, 'optionalAccess',
|
|
3955
|
+
..._optionalChain([json, 'optionalAccess', _215 => _215.pnpm, 'optionalAccess', _216 => _216.overrides]),
|
|
4350
3956
|
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
4351
3957
|
}
|
|
4352
3958
|
}
|
|
@@ -4364,10 +3970,10 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
4364
3970
|
]);
|
|
4365
3971
|
if (tree.exists("package.json")) {
|
|
4366
3972
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
4367
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
3973
|
+
if (_optionalChain([packageJson, 'optionalAccess', _217 => _217.repository])) {
|
|
4368
3974
|
repository = packageJson.repository;
|
|
4369
3975
|
}
|
|
4370
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
3976
|
+
if (_optionalChain([packageJson, 'optionalAccess', _218 => _218.description])) {
|
|
4371
3977
|
description = packageJson.description;
|
|
4372
3978
|
}
|
|
4373
3979
|
}
|
|
@@ -4404,22 +4010,22 @@ function getOutputPath(options) {
|
|
|
4404
4010
|
function createProjectTsConfigJson(tree, options) {
|
|
4405
4011
|
const tsconfig = {
|
|
4406
4012
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
4407
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4013
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _219 => _219.tsconfigOptions]), () => ( {})),
|
|
4408
4014
|
compilerOptions: {
|
|
4409
4015
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
4410
4016
|
outDir: joinPaths(_devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
4411
4017
|
noEmit: true,
|
|
4412
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4018
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _220 => _220.tsconfigOptions, 'optionalAccess', _221 => _221.compilerOptions]), () => ( {}))
|
|
4413
4019
|
},
|
|
4414
|
-
files: [..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4020
|
+
files: [..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _222 => _222.tsconfigOptions, 'optionalAccess', _223 => _223.files]), () => ( []))],
|
|
4415
4021
|
include: [
|
|
4416
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4022
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _224 => _224.tsconfigOptions, 'optionalAccess', _225 => _225.include]), () => ( [])),
|
|
4417
4023
|
"src/**/*.ts",
|
|
4418
4024
|
"src/**/*.js",
|
|
4419
4025
|
"bin/**/*"
|
|
4420
4026
|
],
|
|
4421
4027
|
exclude: [
|
|
4422
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4028
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _226 => _226.tsconfigOptions, 'optionalAccess', _227 => _227.exclude]), () => ( [])),
|
|
4423
4029
|
"jest.config.ts",
|
|
4424
4030
|
"src/**/*.spec.ts",
|
|
4425
4031
|
"src/**/*.test.ts"
|
|
@@ -4429,8 +4035,8 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
4429
4035
|
}
|
|
4430
4036
|
async function normalizeOptions(tree, options, config) {
|
|
4431
4037
|
let importPath = options.importPath;
|
|
4432
|
-
if (!importPath && _optionalChain([config, 'optionalAccess',
|
|
4433
|
-
importPath = `@${_optionalChain([config, 'optionalAccess',
|
|
4038
|
+
if (!importPath && _optionalChain([config, 'optionalAccess', _228 => _228.namespace])) {
|
|
4039
|
+
importPath = `@${_optionalChain([config, 'optionalAccess', _229 => _229.namespace])}/${options.name}`;
|
|
4434
4040
|
}
|
|
4435
4041
|
if (options.publishable) {
|
|
4436
4042
|
if (!importPath) {
|
|
@@ -4595,7 +4201,7 @@ async function configSchemaGeneratorFn(tree, options, config) {
|
|
|
4595
4201
|
);
|
|
4596
4202
|
}
|
|
4597
4203
|
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(
|
|
4598
|
-
_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
4204
|
+
_nullishCoalesce(_optionalChain([config, 'optionalAccess', _230 => _230.workspaceRoot]), () => ( findWorkspaceRoot())),
|
|
4599
4205
|
options.outputFile.startsWith("./") ? "" : "./"
|
|
4600
4206
|
);
|
|
4601
4207
|
writeTrace(
|