@storm-software/tsdown 0.24.14 → 0.24.16
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/README.md +1 -1
- package/dist/build.cjs +2 -2
- package/dist/build.js +1 -1
- package/dist/{chunk-CRCK2NCN.js → chunk-PJF37ZAU.js} +30 -17
- package/dist/{chunk-QOJUBCJR.cjs → chunk-TFFKZFJG.cjs} +35 -22
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
package/dist/build.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkTFFKZFJGcjs = require('./chunk-TFFKZFJG.cjs');
|
|
5
5
|
require('./chunk-JXYBDFPK.cjs');
|
|
6
6
|
require('./chunk-5KRF6IVW.cjs');
|
|
7
7
|
require('./chunk-USNT2KNT.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.build =
|
|
11
|
+
exports.build = _chunkTFFKZFJGcjs.build; exports.cleanOutputPath = _chunkTFFKZFJGcjs.cleanOutputPath;
|
package/dist/build.js
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-SHUYVCID.js";
|
|
30
30
|
|
|
31
31
|
// src/build.ts
|
|
32
|
-
import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph, writeJsonFile } from "@nx/devkit";
|
|
32
|
+
import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph2, writeJsonFile } from "@nx/devkit";
|
|
33
33
|
|
|
34
34
|
// ../build-tools/src/config.ts
|
|
35
35
|
var DEFAULT_ENVIRONMENT = "production";
|
|
@@ -107,11 +107,12 @@ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `//
|
|
|
107
107
|
// ../build-tools/src/utilities/generate-package-json.ts
|
|
108
108
|
import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
|
|
109
109
|
import { Glob } from "glob";
|
|
110
|
-
import { existsSync } from "node:fs";
|
|
110
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
111
111
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
112
|
-
import { readCachedProjectGraph } from "nx/src/project-graph/project-graph";
|
|
112
|
+
import { readCachedProjectGraph, readProjectsConfigurationFromProjectGraph } from "nx/src/project-graph/project-graph";
|
|
113
113
|
var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
|
|
114
|
-
const
|
|
114
|
+
const projectGraph = readCachedProjectGraph();
|
|
115
|
+
const projectDependencies = calculateProjectBuildableDependencies(void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
115
116
|
const localPackages = [];
|
|
116
117
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
|
|
117
118
|
const projectNode = project.node;
|
|
@@ -128,26 +129,38 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
128
129
|
}
|
|
129
130
|
if (localPackages.length > 0) {
|
|
130
131
|
writeTrace(`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
const projectJsonFile = await readFile2(joinPaths(projectRoot, "project.json"), "utf8");
|
|
133
|
+
const projectJson = JSON.parse(projectJsonFile);
|
|
134
|
+
const projectName2 = projectJson.name;
|
|
135
|
+
const projectConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
|
|
136
|
+
if (!projectConfigurations?.projects?.[projectName2]) {
|
|
137
|
+
throw new Error("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.");
|
|
138
|
+
}
|
|
139
|
+
const implicitDependencies = projectConfigurations.projects?.[projectName2].implicitDependencies?.reduce((ret, dep) => {
|
|
140
|
+
if (projectConfigurations.projects?.[dep]) {
|
|
141
|
+
const depPackageJsonPath = joinPaths(workspaceRoot, projectConfigurations.projects[dep].root, "package.json");
|
|
142
|
+
if (existsSync(depPackageJsonPath)) {
|
|
143
|
+
const depPackageJsonContent = readFileSync(depPackageJsonPath, "utf8");
|
|
144
|
+
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
145
|
+
if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
|
|
146
|
+
ret.push(depPackageJson.name);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
134
149
|
}
|
|
135
150
|
return ret;
|
|
136
|
-
},
|
|
137
|
-
packageJson.
|
|
138
|
-
if (!ret[localPackage.name]) {
|
|
139
|
-
ret[localPackage.name] = {
|
|
140
|
-
optional: false
|
|
141
|
-
};
|
|
151
|
+
}, []);
|
|
152
|
+
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
153
|
+
if (!ret[localPackage.name] && !implicitDependencies?.includes(localPackage.name)) {
|
|
154
|
+
ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
|
|
142
155
|
}
|
|
143
156
|
return ret;
|
|
144
|
-
}, packageJson.
|
|
157
|
+
}, packageJson.dependencies ?? {});
|
|
145
158
|
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
146
|
-
if (!ret[localPackage.name]) {
|
|
159
|
+
if (!ret[localPackage.name] && implicitDependencies?.includes(localPackage.name)) {
|
|
147
160
|
ret[localPackage.name] = localPackage.version || "0.0.1";
|
|
148
161
|
}
|
|
149
162
|
return ret;
|
|
150
|
-
}, packageJson.
|
|
163
|
+
}, packageJson.devDependencies ?? {});
|
|
151
164
|
} else {
|
|
152
165
|
writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
|
|
153
166
|
}
|
|
@@ -837,7 +850,7 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
837
850
|
const projectJsonFile = await hf.readFile(projectJsonPath, "utf8");
|
|
838
851
|
const projectJson = JSON.parse(projectJsonFile);
|
|
839
852
|
const projectName = projectJson.name;
|
|
840
|
-
const projectConfigurations =
|
|
853
|
+
const projectConfigurations = readProjectsConfigurationFromProjectGraph2(projectGraph);
|
|
841
854
|
if (!projectConfigurations?.projects?.[projectName]) {
|
|
842
855
|
throw new Error("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.");
|
|
843
856
|
}
|
|
@@ -111,7 +111,8 @@ var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
|
|
|
111
111
|
|
|
112
112
|
var _projectgraph = require('nx/src/project-graph/project-graph');
|
|
113
113
|
var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (workspaceRoot, projectRoot, projectName, packageJson) => {
|
|
114
|
-
const
|
|
114
|
+
const projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
115
|
+
const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
115
116
|
const localPackages = [];
|
|
116
117
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
|
|
117
118
|
const projectNode = project.node;
|
|
@@ -128,26 +129,38 @@ var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void
|
|
|
128
129
|
}
|
|
129
130
|
if (localPackages.length > 0) {
|
|
130
131
|
_chunkJXYBDFPKcjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
const projectJsonFile = await _promises.readFile.call(void 0, _chunkJXYBDFPKcjs.joinPaths.call(void 0, projectRoot, "project.json"), "utf8");
|
|
133
|
+
const projectJson = JSON.parse(projectJsonFile);
|
|
134
|
+
const projectName2 = projectJson.name;
|
|
135
|
+
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
136
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _ => _.projects, 'optionalAccess', _2 => _2[projectName2]])) {
|
|
137
|
+
throw new Error("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.");
|
|
138
|
+
}
|
|
139
|
+
const implicitDependencies = _optionalChain([projectConfigurations, 'access', _3 => _3.projects, 'optionalAccess', _4 => _4[projectName2], 'access', _5 => _5.implicitDependencies, 'optionalAccess', _6 => _6.reduce, 'call', _7 => _7((ret, dep) => {
|
|
140
|
+
if (_optionalChain([projectConfigurations, 'access', _8 => _8.projects, 'optionalAccess', _9 => _9[dep]])) {
|
|
141
|
+
const depPackageJsonPath = _chunkJXYBDFPKcjs.joinPaths.call(void 0, workspaceRoot, projectConfigurations.projects[dep].root, "package.json");
|
|
142
|
+
if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
|
|
143
|
+
const depPackageJsonContent = _fs.readFileSync.call(void 0, depPackageJsonPath, "utf8");
|
|
144
|
+
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
145
|
+
if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
|
|
146
|
+
ret.push(depPackageJson.name);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
134
149
|
}
|
|
135
150
|
return ret;
|
|
136
|
-
},
|
|
137
|
-
packageJson.
|
|
138
|
-
if (!ret[localPackage.name]) {
|
|
139
|
-
ret[localPackage.name] = {
|
|
140
|
-
optional: false
|
|
141
|
-
};
|
|
151
|
+
}, [])]);
|
|
152
|
+
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
153
|
+
if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _10 => _10.includes, 'call', _11 => _11(localPackage.name)])) {
|
|
154
|
+
ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
|
|
142
155
|
}
|
|
143
156
|
return ret;
|
|
144
|
-
}, _nullishCoalesce(packageJson.
|
|
157
|
+
}, _nullishCoalesce(packageJson.dependencies, () => ( {})));
|
|
145
158
|
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
146
|
-
if (!ret[localPackage.name]) {
|
|
159
|
+
if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess', _12 => _12.includes, 'call', _13 => _13(localPackage.name)])) {
|
|
147
160
|
ret[localPackage.name] = localPackage.version || "0.0.1";
|
|
148
161
|
}
|
|
149
162
|
return ret;
|
|
150
|
-
}, _nullishCoalesce(packageJson.
|
|
163
|
+
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
151
164
|
} else {
|
|
152
165
|
_chunkJXYBDFPKcjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
153
166
|
}
|
|
@@ -229,7 +242,7 @@ var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
229
242
|
cwd: workspacePath,
|
|
230
243
|
packageJson: true,
|
|
231
244
|
name: fileName,
|
|
232
|
-
envName: _optionalChain([fileName, 'optionalAccess',
|
|
245
|
+
envName: _optionalChain([fileName, 'optionalAccess', _14 => _14.toUpperCase, 'call', _15 => _15()]),
|
|
233
246
|
jitiOptions: {
|
|
234
247
|
debug: false,
|
|
235
248
|
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkJXYBDFPKcjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
@@ -240,7 +253,7 @@ var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
240
253
|
cwd: workspacePath,
|
|
241
254
|
packageJson: true,
|
|
242
255
|
name: fileName,
|
|
243
|
-
envName: _optionalChain([fileName, 'optionalAccess',
|
|
256
|
+
envName: _optionalChain([fileName, 'optionalAccess', _16 => _16.toUpperCase, 'call', _17 => _17()]),
|
|
244
257
|
jitiOptions: {
|
|
245
258
|
debug: false,
|
|
246
259
|
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkJXYBDFPKcjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
@@ -264,7 +277,7 @@ var getConfigFile = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
264
277
|
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
265
278
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
266
279
|
for (const result2 of results) {
|
|
267
|
-
if (_optionalChain([result2, 'optionalAccess',
|
|
280
|
+
if (_optionalChain([result2, 'optionalAccess', _18 => _18.config]) && _optionalChain([result2, 'optionalAccess', _19 => _19.configFile]) && Object.keys(result2.config).length > 0) {
|
|
268
281
|
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
269
282
|
_chunkJXYBDFPKcjs.writeTrace.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
270
283
|
logLevel: "all"
|
|
@@ -436,13 +449,13 @@ var getBaseThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(v
|
|
|
436
449
|
var setExtensionEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (extensionName, extension) => {
|
|
437
450
|
for (const key of Object.keys(_nullishCoalesce(extension, () => ( {})))) {
|
|
438
451
|
if (extension[key]) {
|
|
439
|
-
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess',
|
|
452
|
+
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess', _20 => _20.replace, 'call', _21 => _21(/([A-Z])+/g, (input) => input ? _optionalChain([input, 'access', _22 => _22[0], 'optionalAccess', _23 => _23.toUpperCase, 'call', _24 => _24()]) + input.slice(1) : ""), 'access', _25 => _25.split, 'call', _26 => _26(/(?=[A-Z])|[.\-\s_]/), 'access', _27 => _27.map, 'call', _28 => _28((x) => x.toLowerCase())]), () => ( []));
|
|
440
453
|
let extensionKey;
|
|
441
454
|
if (result.length === 0) {
|
|
442
455
|
return;
|
|
443
456
|
}
|
|
444
457
|
if (result.length === 1) {
|
|
445
|
-
extensionKey = _nullishCoalesce(_optionalChain([result, 'access',
|
|
458
|
+
extensionKey = _nullishCoalesce(_optionalChain([result, 'access', _29 => _29[0], 'optionalAccess', _30 => _30.toUpperCase, 'call', _31 => _31()]), () => ( ""));
|
|
446
459
|
} else {
|
|
447
460
|
extensionKey = result.reduce((ret, part) => {
|
|
448
461
|
return `${ret}_${part.toLowerCase()}`;
|
|
@@ -539,7 +552,7 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
539
552
|
process.env.NODE_ENV = config.env;
|
|
540
553
|
process.env.ENVIRONMENT = config.env;
|
|
541
554
|
}
|
|
542
|
-
if (_optionalChain([config, 'access',
|
|
555
|
+
if (_optionalChain([config, 'access', _32 => _32.colors, 'optionalAccess', _33 => _33.base, 'optionalAccess', _34 => _34.light]) || _optionalChain([config, 'access', _35 => _35.colors, 'optionalAccess', _36 => _36.base, 'optionalAccess', _37 => _37.dark])) {
|
|
543
556
|
for (const key of Object.keys(config.colors)) {
|
|
544
557
|
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
545
558
|
}
|
|
@@ -590,7 +603,7 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
590
603
|
}
|
|
591
604
|
}, "setConfigEnv");
|
|
592
605
|
var setThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix, config) => {
|
|
593
|
-
return _optionalChain([config, 'optionalAccess',
|
|
606
|
+
return _optionalChain([config, 'optionalAccess', _38 => _38.light, 'optionalAccess', _39 => _39.brand]) || _optionalChain([config, 'optionalAccess', _40 => _40.dark, 'optionalAccess', _41 => _41.brand]) ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
594
607
|
}, "setThemeColorConfigEnv");
|
|
595
608
|
var setSingleThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix, config) => {
|
|
596
609
|
if (config.dark) {
|
|
@@ -692,7 +705,7 @@ var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
|
692
705
|
var _static_cache = void 0;
|
|
693
706
|
var createStormConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (extensionName, schema, workspaceRoot, skipLogs = false) => {
|
|
694
707
|
let result;
|
|
695
|
-
if (!_optionalChain([_static_cache, 'optionalAccess',
|
|
708
|
+
if (!_optionalChain([_static_cache, 'optionalAccess', _42 => _42.data]) || !_optionalChain([_static_cache, 'optionalAccess', _43 => _43.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
|
|
696
709
|
let _workspaceRoot = workspaceRoot;
|
|
697
710
|
if (!_workspaceRoot) {
|
|
698
711
|
_workspaceRoot = _chunkJXYBDFPKcjs.findWorkspaceRoot.call(void 0, );
|
|
@@ -838,7 +851,7 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
838
851
|
const projectJson = JSON.parse(projectJsonFile);
|
|
839
852
|
const projectName = projectJson.name;
|
|
840
853
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
841
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
854
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _44 => _44.projects, 'optionalAccess', _45 => _45[projectName]])) {
|
|
842
855
|
throw new Error("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.");
|
|
843
856
|
}
|
|
844
857
|
const options = _defu2.default.call(void 0, userOptions, _chunk5KRF6IVWcjs.DEFAULT_BUILD_OPTIONS);
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkTFFKZFJGcjs = require('./chunk-TFFKZFJG.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -17,4 +17,4 @@ require('./chunk-SFZRYJZ2.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
exports.DEFAULT_BUILD_OPTIONS = _chunk5KRF6IVWcjs.DEFAULT_BUILD_OPTIONS; exports.build =
|
|
20
|
+
exports.DEFAULT_BUILD_OPTIONS = _chunk5KRF6IVWcjs.DEFAULT_BUILD_OPTIONS; exports.build = _chunkTFFKZFJGcjs.build; exports.clean = _chunkJXYBDFPKcjs.clean; exports.cleanDirectories = _chunkJXYBDFPKcjs.cleanDirectories; exports.cleanOutputPath = _chunkTFFKZFJGcjs.cleanOutputPath;
|
package/dist/index.js
CHANGED