@storm-software/tsdown 0.36.58 → 0.36.65
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 -2
- package/dist/build.cjs +3 -3
- package/dist/build.js +2 -2
- package/dist/{chunk-Q73DUWY5.cjs → chunk-7L7BKTGQ.cjs} +756 -121
- package/dist/{chunk-NNRBLLQT.js → chunk-AQ4RJKTQ.js} +659 -24
- package/dist/chunk-IAKUT4HI.js +326 -0
- package/dist/chunk-IO7MJMVE.cjs +326 -0
- package/dist/clean.cjs +2 -2
- package/dist/clean.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-3YG5MAXY.cjs +0 -896
- package/dist/chunk-JICWC2DK.js +0 -896
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -11,17 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var _chunk3YG5MAXYcjs = require('./chunk-3YG5MAXY.cjs');
|
|
14
|
+
var _chunkIO7MJMVEcjs = require('./chunk-IO7MJMVE.cjs');
|
|
25
15
|
|
|
26
16
|
|
|
27
17
|
var _chunk65E5RX7Icjs = require('./chunk-65E5RX7I.cjs');
|
|
@@ -53,6 +43,133 @@ var _resolve2 = require('resolve'); var _resolve3 = _interopRequireDefault(_reso
|
|
|
53
43
|
|
|
54
44
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
55
45
|
var _copyassetshandler = require('@nx/js/src/utils/assets/copy-assets-handler');
|
|
46
|
+
|
|
47
|
+
// ../config-tools/src/utilities/correct-paths.ts
|
|
48
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
49
|
+
function normalizeWindowsPath(input = "") {
|
|
50
|
+
if (!input) {
|
|
51
|
+
return input;
|
|
52
|
+
}
|
|
53
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
54
|
+
}
|
|
55
|
+
var _UNC_REGEX = /^[/\\]{2}/;
|
|
56
|
+
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
57
|
+
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
58
|
+
var correctPaths = function(path2) {
|
|
59
|
+
if (!path2 || path2.length === 0) {
|
|
60
|
+
return ".";
|
|
61
|
+
}
|
|
62
|
+
path2 = normalizeWindowsPath(path2);
|
|
63
|
+
const isUNCPath = path2.match(_UNC_REGEX);
|
|
64
|
+
const isPathAbsolute = isAbsolute(path2);
|
|
65
|
+
const trailingSeparator = path2[path2.length - 1] === "/";
|
|
66
|
+
path2 = normalizeString(path2, !isPathAbsolute);
|
|
67
|
+
if (path2.length === 0) {
|
|
68
|
+
if (isPathAbsolute) {
|
|
69
|
+
return "/";
|
|
70
|
+
}
|
|
71
|
+
return trailingSeparator ? "./" : ".";
|
|
72
|
+
}
|
|
73
|
+
if (trailingSeparator) {
|
|
74
|
+
path2 += "/";
|
|
75
|
+
}
|
|
76
|
+
if (_DRIVE_LETTER_RE.test(path2)) {
|
|
77
|
+
path2 += "/";
|
|
78
|
+
}
|
|
79
|
+
if (isUNCPath) {
|
|
80
|
+
if (!isPathAbsolute) {
|
|
81
|
+
return `//./${path2}`;
|
|
82
|
+
}
|
|
83
|
+
return `//${path2}`;
|
|
84
|
+
}
|
|
85
|
+
return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
|
|
86
|
+
};
|
|
87
|
+
var joinPaths = function(...segments) {
|
|
88
|
+
let path2 = "";
|
|
89
|
+
for (const seg of segments) {
|
|
90
|
+
if (!seg) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (path2.length > 0) {
|
|
94
|
+
const pathTrailing = path2[path2.length - 1] === "/";
|
|
95
|
+
const segLeading = seg[0] === "/";
|
|
96
|
+
const both = pathTrailing && segLeading;
|
|
97
|
+
if (both) {
|
|
98
|
+
path2 += seg.slice(1);
|
|
99
|
+
} else {
|
|
100
|
+
path2 += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
path2 += seg;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return correctPaths(path2);
|
|
107
|
+
};
|
|
108
|
+
function normalizeString(path2, allowAboveRoot) {
|
|
109
|
+
let res = "";
|
|
110
|
+
let lastSegmentLength = 0;
|
|
111
|
+
let lastSlash = -1;
|
|
112
|
+
let dots = 0;
|
|
113
|
+
let char = null;
|
|
114
|
+
for (let index = 0; index <= path2.length; ++index) {
|
|
115
|
+
if (index < path2.length) {
|
|
116
|
+
char = path2[index];
|
|
117
|
+
} else if (char === "/") {
|
|
118
|
+
break;
|
|
119
|
+
} else {
|
|
120
|
+
char = "/";
|
|
121
|
+
}
|
|
122
|
+
if (char === "/") {
|
|
123
|
+
if (lastSlash === index - 1 || dots === 1) {
|
|
124
|
+
} else if (dots === 2) {
|
|
125
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
126
|
+
if (res.length > 2) {
|
|
127
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
128
|
+
if (lastSlashIndex === -1) {
|
|
129
|
+
res = "";
|
|
130
|
+
lastSegmentLength = 0;
|
|
131
|
+
} else {
|
|
132
|
+
res = res.slice(0, lastSlashIndex);
|
|
133
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
134
|
+
}
|
|
135
|
+
lastSlash = index;
|
|
136
|
+
dots = 0;
|
|
137
|
+
continue;
|
|
138
|
+
} else if (res.length > 0) {
|
|
139
|
+
res = "";
|
|
140
|
+
lastSegmentLength = 0;
|
|
141
|
+
lastSlash = index;
|
|
142
|
+
dots = 0;
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (allowAboveRoot) {
|
|
147
|
+
res += res.length > 0 ? "/.." : "..";
|
|
148
|
+
lastSegmentLength = 2;
|
|
149
|
+
}
|
|
150
|
+
} else {
|
|
151
|
+
if (res.length > 0) {
|
|
152
|
+
res += `/${path2.slice(lastSlash + 1, index)}`;
|
|
153
|
+
} else {
|
|
154
|
+
res = path2.slice(lastSlash + 1, index);
|
|
155
|
+
}
|
|
156
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
157
|
+
}
|
|
158
|
+
lastSlash = index;
|
|
159
|
+
dots = 0;
|
|
160
|
+
} else if (char === "." && dots !== -1) {
|
|
161
|
+
++dots;
|
|
162
|
+
} else {
|
|
163
|
+
dots = -1;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return res;
|
|
167
|
+
}
|
|
168
|
+
var isAbsolute = function(p) {
|
|
169
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// ../build-tools/src/utilities/copy-assets.ts
|
|
56
173
|
var _glob = require('glob');
|
|
57
174
|
var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
|
|
58
175
|
var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
|
|
@@ -81,9 +198,9 @@ var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, gen
|
|
|
81
198
|
output: "src/"
|
|
82
199
|
});
|
|
83
200
|
}
|
|
84
|
-
|
|
201
|
+
_chunkIO7MJMVEcjs.writeTrace.call(void 0,
|
|
85
202
|
`\u{1F4DD} Copying the following assets to the output directory:
|
|
86
|
-
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${
|
|
203
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`,
|
|
87
204
|
config
|
|
88
205
|
);
|
|
89
206
|
const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
|
|
@@ -93,20 +210,20 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
93
210
|
assets: pendingAssets
|
|
94
211
|
});
|
|
95
212
|
await assetHandler.processAllAssetsOnce();
|
|
96
|
-
|
|
213
|
+
_chunkIO7MJMVEcjs.writeTrace.call(void 0, "Completed copying assets to the output directory", config);
|
|
97
214
|
if (includeSrc === true) {
|
|
98
|
-
|
|
99
|
-
`\u{1F4DD} Adding banner and writing source files: ${
|
|
215
|
+
_chunkIO7MJMVEcjs.writeDebug.call(void 0,
|
|
216
|
+
`\u{1F4DD} Adding banner and writing source files: ${joinPaths(
|
|
100
217
|
outputPath,
|
|
101
218
|
"src"
|
|
102
219
|
)}`,
|
|
103
220
|
config
|
|
104
221
|
);
|
|
105
222
|
const files = await _glob.glob.call(void 0, [
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
223
|
+
joinPaths(config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
224
|
+
joinPaths(config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
225
|
+
joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
226
|
+
joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
110
227
|
]);
|
|
111
228
|
await Promise.allSettled(
|
|
112
229
|
files.map(
|
|
@@ -126,6 +243,102 @@ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `//
|
|
|
126
243
|
// ../build-tools/src/utilities/generate-package-json.ts
|
|
127
244
|
var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
|
|
128
245
|
|
|
246
|
+
// ../config-tools/src/utilities/find-up.ts
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
250
|
+
var depth = 0;
|
|
251
|
+
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
252
|
+
const _startPath = _nullishCoalesce(startPath, () => ( process.cwd()));
|
|
253
|
+
if (endDirectoryNames.some(
|
|
254
|
+
(endDirName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endDirName))
|
|
255
|
+
)) {
|
|
256
|
+
return _startPath;
|
|
257
|
+
}
|
|
258
|
+
if (endFileNames.some(
|
|
259
|
+
(endFileName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endFileName))
|
|
260
|
+
)) {
|
|
261
|
+
return _startPath;
|
|
262
|
+
}
|
|
263
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
264
|
+
const parent = _path.join.call(void 0, _startPath, "..");
|
|
265
|
+
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
266
|
+
}
|
|
267
|
+
return void 0;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
271
|
+
var rootFiles = [
|
|
272
|
+
"storm-workspace.json",
|
|
273
|
+
"storm-workspace.yaml",
|
|
274
|
+
"storm-workspace.yml",
|
|
275
|
+
"storm-workspace.js",
|
|
276
|
+
"storm-workspace.ts",
|
|
277
|
+
".storm-workspace.json",
|
|
278
|
+
".storm-workspace.yaml",
|
|
279
|
+
".storm-workspace.yml",
|
|
280
|
+
".storm-workspace.js",
|
|
281
|
+
".storm-workspace.ts",
|
|
282
|
+
"lerna.json",
|
|
283
|
+
"nx.json",
|
|
284
|
+
"turbo.json",
|
|
285
|
+
"npm-workspace.json",
|
|
286
|
+
"yarn-workspace.json",
|
|
287
|
+
"pnpm-workspace.json",
|
|
288
|
+
"npm-workspace.yaml",
|
|
289
|
+
"yarn-workspace.yaml",
|
|
290
|
+
"pnpm-workspace.yaml",
|
|
291
|
+
"npm-workspace.yml",
|
|
292
|
+
"yarn-workspace.yml",
|
|
293
|
+
"pnpm-workspace.yml",
|
|
294
|
+
"npm-lock.json",
|
|
295
|
+
"yarn-lock.json",
|
|
296
|
+
"pnpm-lock.json",
|
|
297
|
+
"npm-lock.yaml",
|
|
298
|
+
"yarn-lock.yaml",
|
|
299
|
+
"pnpm-lock.yaml",
|
|
300
|
+
"npm-lock.yml",
|
|
301
|
+
"yarn-lock.yml",
|
|
302
|
+
"pnpm-lock.yml",
|
|
303
|
+
"bun.lockb"
|
|
304
|
+
];
|
|
305
|
+
var rootDirectories = [
|
|
306
|
+
".storm-workspace",
|
|
307
|
+
".nx",
|
|
308
|
+
".github",
|
|
309
|
+
".vscode",
|
|
310
|
+
".verdaccio"
|
|
311
|
+
];
|
|
312
|
+
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
313
|
+
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
314
|
+
return correctPaths(
|
|
315
|
+
_nullishCoalesce(process.env.STORM_WORKSPACE_ROOT, () => ( process.env.NX_WORKSPACE_ROOT_PATH))
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
return correctPaths(
|
|
319
|
+
findFolderUp(
|
|
320
|
+
_nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())),
|
|
321
|
+
rootFiles,
|
|
322
|
+
rootDirectories
|
|
323
|
+
)
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
327
|
+
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
328
|
+
if (!result) {
|
|
329
|
+
throw new Error(
|
|
330
|
+
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
331
|
+
${rootFiles.join(
|
|
332
|
+
"\n"
|
|
333
|
+
)}
|
|
334
|
+
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
return result;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// ../build-tools/src/utilities/generate-package-json.ts
|
|
341
|
+
|
|
129
342
|
|
|
130
343
|
|
|
131
344
|
|
|
@@ -161,7 +374,7 @@ var addPackageDependencies = async (workspaceRoot, projectRoot, projectName, pac
|
|
|
161
374
|
)) {
|
|
162
375
|
const projectNode = project.node;
|
|
163
376
|
if (projectNode.data.root) {
|
|
164
|
-
const projectPackageJsonPath =
|
|
377
|
+
const projectPackageJsonPath = joinPaths(
|
|
165
378
|
workspaceRoot,
|
|
166
379
|
projectNode.data.root,
|
|
167
380
|
"package.json"
|
|
@@ -179,11 +392,11 @@ var addPackageDependencies = async (workspaceRoot, projectRoot, projectName, pac
|
|
|
179
392
|
}
|
|
180
393
|
}
|
|
181
394
|
if (localPackages.length > 0) {
|
|
182
|
-
|
|
395
|
+
_chunkIO7MJMVEcjs.writeTrace.call(void 0,
|
|
183
396
|
`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`
|
|
184
397
|
);
|
|
185
398
|
const projectJsonFile = await _promises.readFile.call(void 0,
|
|
186
|
-
|
|
399
|
+
joinPaths(projectRoot, "project.json"),
|
|
187
400
|
"utf8"
|
|
188
401
|
);
|
|
189
402
|
const projectJson = JSON.parse(projectJsonFile);
|
|
@@ -196,7 +409,7 @@ var addPackageDependencies = async (workspaceRoot, projectRoot, projectName, pac
|
|
|
196
409
|
}
|
|
197
410
|
const implicitDependencies = _optionalChain([projectConfigurations, 'access', _9 => _9.projects, 'optionalAccess', _10 => _10[projectName2], 'access', _11 => _11.implicitDependencies, 'optionalAccess', _12 => _12.reduce, 'call', _13 => _13((ret, dep) => {
|
|
198
411
|
if (_optionalChain([projectConfigurations, 'access', _14 => _14.projects, 'optionalAccess', _15 => _15[dep]])) {
|
|
199
|
-
const depPackageJsonPath =
|
|
412
|
+
const depPackageJsonPath = joinPaths(
|
|
200
413
|
workspaceRoot,
|
|
201
414
|
projectConfigurations.projects[dep].root,
|
|
202
415
|
"package.json"
|
|
@@ -227,14 +440,14 @@ var addPackageDependencies = async (workspaceRoot, projectRoot, projectName, pac
|
|
|
227
440
|
return ret;
|
|
228
441
|
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
229
442
|
} else {
|
|
230
|
-
|
|
443
|
+
_chunkIO7MJMVEcjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
231
444
|
}
|
|
232
445
|
return packageJson;
|
|
233
446
|
};
|
|
234
447
|
var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
235
|
-
const workspaceRoot = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot :
|
|
448
|
+
const workspaceRoot = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : findWorkspaceRoot();
|
|
236
449
|
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
237
|
-
|
|
450
|
+
joinPaths(workspaceRoot, "package.json"),
|
|
238
451
|
"utf8"
|
|
239
452
|
);
|
|
240
453
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
@@ -245,7 +458,7 @@ var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceR
|
|
|
245
458
|
if (distSrc.startsWith("/")) {
|
|
246
459
|
distSrc = distSrc.substring(1);
|
|
247
460
|
}
|
|
248
|
-
packageJson.source ??= `${
|
|
461
|
+
packageJson.source ??= `${joinPaths(distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
249
462
|
}
|
|
250
463
|
packageJson.files ??= ["dist/**/*"];
|
|
251
464
|
if (includeSrc === true && !packageJson.files.includes("src")) {
|
|
@@ -270,7 +483,7 @@ var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceR
|
|
|
270
483
|
packageJson.contributors = [packageJson.author];
|
|
271
484
|
}
|
|
272
485
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
273
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
486
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
|
|
274
487
|
return packageJson;
|
|
275
488
|
};
|
|
276
489
|
var addPackageJsonExport = (file, type = "module", sourceRoot) => {
|
|
@@ -297,17 +510,400 @@ var addPackageJsonExport = (file, type = "module", sourceRoot) => {
|
|
|
297
510
|
// ../config-tools/src/config-file/get-config-file.ts
|
|
298
511
|
var _c12 = require('c12');
|
|
299
512
|
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
513
|
+
|
|
514
|
+
// ../config/src/constants.ts
|
|
515
|
+
var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
|
|
516
|
+
var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
|
|
517
|
+
var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
|
|
518
|
+
var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
|
|
519
|
+
var STORM_DEFAULT_LICENSE = "Apache-2.0";
|
|
520
|
+
var STORM_DEFAULT_SOCIAL_TWITTER = "StormSoftwareHQ";
|
|
521
|
+
var STORM_DEFAULT_SOCIAL_DISCORD = "https://discord.gg/MQ6YVzakM5";
|
|
522
|
+
var STORM_DEFAULT_SOCIAL_TELEGRAM = "https://t.me/storm_software";
|
|
523
|
+
var STORM_DEFAULT_SOCIAL_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
|
|
524
|
+
var STORM_DEFAULT_SOCIAL_MEDIUM = "https://medium.com/storm-software";
|
|
525
|
+
var STORM_DEFAULT_SOCIAL_GITHUB = "https://github.com/storm-software";
|
|
526
|
+
var STORM_DEFAULT_RELEASE_FOOTER = `
|
|
527
|
+
Storm Software is an open source software development organization with the mission is to make software development more accessible. Our ideal future is one where anyone can create software without years of prior development experience serving as a barrier to entry. We hope to achieve this via LLMs, Generative AI, and intuitive, high-level data modeling/programming languages.
|
|
528
|
+
|
|
529
|
+
Join us on [Discord](${STORM_DEFAULT_SOCIAL_DISCORD}) to chat with the team, receive release notifications, ask questions, and get involved.
|
|
530
|
+
|
|
531
|
+
If this sounds interesting, and you would like to help us in creating the next generation of development tools, please reach out on our [website](${STORM_DEFAULT_CONTACT}) or join our [Slack](${STORM_DEFAULT_SOCIAL_SLACK}) channel!
|
|
532
|
+
`;
|
|
533
|
+
var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
|
|
534
|
+
|
|
535
|
+
// ../config/src/schema.ts
|
|
536
|
+
var _zod = require('zod'); var z = _interopRequireWildcard(_zod);
|
|
537
|
+
var ColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7);
|
|
538
|
+
var DarkColorSchema = ColorSchema.default("#151718").describe(
|
|
539
|
+
"The dark background color of the workspace"
|
|
540
|
+
);
|
|
541
|
+
var LightColorSchema = ColorSchema.default("#cbd5e1").describe(
|
|
542
|
+
"The light background color of the workspace"
|
|
543
|
+
);
|
|
544
|
+
var BrandColorSchema = ColorSchema.default("#1fb2a6").describe(
|
|
545
|
+
"The primary brand specific color of the workspace"
|
|
546
|
+
);
|
|
547
|
+
var AlternateColorSchema = ColorSchema.optional().describe(
|
|
548
|
+
"The alternate brand specific color of the workspace"
|
|
549
|
+
);
|
|
550
|
+
var AccentColorSchema = ColorSchema.optional().describe(
|
|
551
|
+
"The secondary brand specific color of the workspace"
|
|
552
|
+
);
|
|
553
|
+
var LinkColorSchema = ColorSchema.default("#3fa6ff").describe(
|
|
554
|
+
"The color used to display hyperlink text"
|
|
555
|
+
);
|
|
556
|
+
var HelpColorSchema = ColorSchema.default("#818cf8").describe(
|
|
557
|
+
"The second brand specific color of the workspace"
|
|
558
|
+
);
|
|
559
|
+
var SuccessColorSchema = ColorSchema.default("#45b27e").describe(
|
|
560
|
+
"The success color of the workspace"
|
|
561
|
+
);
|
|
562
|
+
var InfoColorSchema = ColorSchema.default("#38bdf8").describe(
|
|
563
|
+
"The informational color of the workspace"
|
|
564
|
+
);
|
|
565
|
+
var WarningColorSchema = ColorSchema.default("#f3d371").describe(
|
|
566
|
+
"The warning color of the workspace"
|
|
567
|
+
);
|
|
568
|
+
var DangerColorSchema = ColorSchema.default("#d8314a").describe(
|
|
569
|
+
"The danger color of the workspace"
|
|
570
|
+
);
|
|
571
|
+
var FatalColorSchema = ColorSchema.optional().describe(
|
|
572
|
+
"The fatal color of the workspace"
|
|
573
|
+
);
|
|
574
|
+
var PositiveColorSchema = ColorSchema.default("#4ade80").describe(
|
|
575
|
+
"The positive number color of the workspace"
|
|
576
|
+
);
|
|
577
|
+
var NegativeColorSchema = ColorSchema.default("#ef4444").describe(
|
|
578
|
+
"The negative number color of the workspace"
|
|
579
|
+
);
|
|
580
|
+
var GradientStopsSchema = z.array(ColorSchema).optional().describe(
|
|
581
|
+
"The color stops for the base gradient color pattern used in the workspace"
|
|
582
|
+
);
|
|
583
|
+
var DarkThemeColorConfigSchema = z.object({
|
|
584
|
+
foreground: LightColorSchema,
|
|
585
|
+
background: DarkColorSchema,
|
|
586
|
+
brand: BrandColorSchema,
|
|
587
|
+
alternate: AlternateColorSchema,
|
|
588
|
+
accent: AccentColorSchema,
|
|
589
|
+
link: LinkColorSchema,
|
|
590
|
+
help: HelpColorSchema,
|
|
591
|
+
success: SuccessColorSchema,
|
|
592
|
+
info: InfoColorSchema,
|
|
593
|
+
warning: WarningColorSchema,
|
|
594
|
+
danger: DangerColorSchema,
|
|
595
|
+
fatal: FatalColorSchema,
|
|
596
|
+
positive: PositiveColorSchema,
|
|
597
|
+
negative: NegativeColorSchema,
|
|
598
|
+
gradient: GradientStopsSchema
|
|
599
|
+
});
|
|
600
|
+
var LightThemeColorConfigSchema = z.object({
|
|
601
|
+
foreground: DarkColorSchema,
|
|
602
|
+
background: LightColorSchema,
|
|
603
|
+
brand: BrandColorSchema,
|
|
604
|
+
alternate: AlternateColorSchema,
|
|
605
|
+
accent: AccentColorSchema,
|
|
606
|
+
link: LinkColorSchema,
|
|
607
|
+
help: HelpColorSchema,
|
|
608
|
+
success: SuccessColorSchema,
|
|
609
|
+
info: InfoColorSchema,
|
|
610
|
+
warning: WarningColorSchema,
|
|
611
|
+
danger: DangerColorSchema,
|
|
612
|
+
fatal: FatalColorSchema,
|
|
613
|
+
positive: PositiveColorSchema,
|
|
614
|
+
negative: NegativeColorSchema,
|
|
615
|
+
gradient: GradientStopsSchema
|
|
616
|
+
});
|
|
617
|
+
var MultiThemeColorConfigSchema = z.object({
|
|
618
|
+
dark: DarkThemeColorConfigSchema,
|
|
619
|
+
light: LightThemeColorConfigSchema
|
|
620
|
+
});
|
|
621
|
+
var SingleThemeColorConfigSchema = z.object({
|
|
622
|
+
dark: DarkColorSchema,
|
|
623
|
+
light: LightColorSchema,
|
|
624
|
+
brand: BrandColorSchema,
|
|
625
|
+
alternate: AlternateColorSchema,
|
|
626
|
+
accent: AccentColorSchema,
|
|
627
|
+
link: LinkColorSchema,
|
|
628
|
+
help: HelpColorSchema,
|
|
629
|
+
success: SuccessColorSchema,
|
|
630
|
+
info: InfoColorSchema,
|
|
631
|
+
warning: WarningColorSchema,
|
|
632
|
+
danger: DangerColorSchema,
|
|
633
|
+
fatal: FatalColorSchema,
|
|
634
|
+
positive: PositiveColorSchema,
|
|
635
|
+
negative: NegativeColorSchema,
|
|
636
|
+
gradient: GradientStopsSchema
|
|
637
|
+
});
|
|
638
|
+
var RegistryUrlConfigSchema = z.url().optional().describe("A remote registry URL used to publish distributable packages");
|
|
639
|
+
var RegistryConfigSchema = z.object({
|
|
640
|
+
github: RegistryUrlConfigSchema,
|
|
641
|
+
npm: RegistryUrlConfigSchema,
|
|
642
|
+
cargo: RegistryUrlConfigSchema,
|
|
643
|
+
cyclone: RegistryUrlConfigSchema,
|
|
644
|
+
container: RegistryUrlConfigSchema
|
|
645
|
+
}).default({}).describe("A list of remote registry URLs used by Storm Software");
|
|
646
|
+
var ColorConfigSchema = SingleThemeColorConfigSchema.or(
|
|
647
|
+
MultiThemeColorConfigSchema
|
|
648
|
+
).describe("Colors used for various workspace elements");
|
|
649
|
+
var ColorConfigMapSchema = z.record(
|
|
650
|
+
z.union([z.literal("base"), z.string()]),
|
|
651
|
+
ColorConfigSchema
|
|
652
|
+
);
|
|
653
|
+
var ExtendsItemSchema = z.string().trim().describe(
|
|
654
|
+
"The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration."
|
|
655
|
+
);
|
|
656
|
+
var ExtendsSchema = ExtendsItemSchema.or(
|
|
657
|
+
z.array(ExtendsItemSchema)
|
|
658
|
+
).describe(
|
|
659
|
+
"The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration."
|
|
660
|
+
);
|
|
661
|
+
var WorkspaceBotConfigSchema = z.object({
|
|
662
|
+
name: z.string().trim().default("stormie-bot").describe(
|
|
663
|
+
"The workspace bot user's name (this is the bot that will be used to perform various tasks)"
|
|
664
|
+
),
|
|
665
|
+
email: z.email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
|
|
666
|
+
}).describe(
|
|
667
|
+
"The workspace's bot user's config used to automated various operations tasks"
|
|
668
|
+
);
|
|
669
|
+
var WorkspaceReleaseConfigSchema = z.object({
|
|
670
|
+
banner: z.string().trim().optional().describe(
|
|
671
|
+
"A URL to a banner image used to display the workspace's release"
|
|
672
|
+
),
|
|
673
|
+
header: z.string().trim().optional().describe(
|
|
674
|
+
"A header message appended to the start of the workspace's release notes"
|
|
675
|
+
),
|
|
676
|
+
footer: z.string().trim().optional().describe(
|
|
677
|
+
"A footer message appended to the end of the workspace's release notes"
|
|
678
|
+
)
|
|
679
|
+
}).describe("The workspace's release config used during the release process");
|
|
680
|
+
var WorkspaceSocialsConfigSchema = z.object({
|
|
681
|
+
twitter: z.string().trim().default(STORM_DEFAULT_SOCIAL_TWITTER).describe("A Twitter/X account associated with the organization/project"),
|
|
682
|
+
discord: z.string().trim().default(STORM_DEFAULT_SOCIAL_DISCORD).describe("A Discord account associated with the organization/project"),
|
|
683
|
+
telegram: z.string().trim().default(STORM_DEFAULT_SOCIAL_TELEGRAM).describe("A Telegram account associated with the organization/project"),
|
|
684
|
+
slack: z.string().trim().default(STORM_DEFAULT_SOCIAL_SLACK).describe("A Slack account associated with the organization/project"),
|
|
685
|
+
medium: z.string().trim().default(STORM_DEFAULT_SOCIAL_MEDIUM).describe("A Medium account associated with the organization/project"),
|
|
686
|
+
github: z.string().trim().default(STORM_DEFAULT_SOCIAL_GITHUB).describe("A GitHub account associated with the organization/project")
|
|
687
|
+
}).describe(
|
|
688
|
+
"The workspace's account config used to store various social media links"
|
|
689
|
+
);
|
|
690
|
+
var WorkspaceDirectoryConfigSchema = z.object({
|
|
691
|
+
cache: z.string().trim().optional().describe(
|
|
692
|
+
"The directory used to store the environment's cached file data"
|
|
693
|
+
),
|
|
694
|
+
data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
|
|
695
|
+
config: z.string().trim().optional().describe(
|
|
696
|
+
"The directory used to store the environment's configuration files"
|
|
697
|
+
),
|
|
698
|
+
temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
699
|
+
log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
700
|
+
build: z.string().trim().default("dist").describe(
|
|
701
|
+
"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
|
|
702
|
+
)
|
|
703
|
+
}).describe(
|
|
704
|
+
"Various directories used by the workspace to store data, cache, and configuration files"
|
|
705
|
+
);
|
|
706
|
+
var errorConfigSchema = z.object({
|
|
707
|
+
codesFile: z.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
|
|
708
|
+
url: z.url().optional().describe(
|
|
709
|
+
"A URL to a page that looks up the workspace's error messages given a specific error code"
|
|
710
|
+
)
|
|
711
|
+
}).describe("The workspace's error config used during the error process");
|
|
712
|
+
var organizationConfigSchema = z.object({
|
|
713
|
+
name: z.string().trim().describe("The name of the organization"),
|
|
714
|
+
description: z.string().trim().optional().describe("A description of the organization"),
|
|
715
|
+
logo: z.url().optional().describe("A URL to the organization's logo image"),
|
|
716
|
+
icon: z.url().optional().describe("A URL to the organization's icon image"),
|
|
717
|
+
url: z.url().optional().describe(
|
|
718
|
+
"A URL to a page that provides more information about the organization"
|
|
719
|
+
)
|
|
720
|
+
}).describe("The workspace's organization details");
|
|
721
|
+
var stormWorkspaceConfigSchema = z.object({
|
|
722
|
+
$schema: z.string().trim().default(
|
|
723
|
+
"https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
|
|
724
|
+
).describe(
|
|
725
|
+
"The URL or file path to the JSON schema file that describes the Storm configuration file"
|
|
726
|
+
),
|
|
727
|
+
extends: ExtendsSchema.optional(),
|
|
728
|
+
name: z.string().trim().toLowerCase().optional().describe(
|
|
729
|
+
"The name of the service/package/scope using this configuration"
|
|
730
|
+
),
|
|
731
|
+
namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
732
|
+
organization: organizationConfigSchema.or(z.string().trim().describe("The organization of the workspace")).optional().describe(
|
|
733
|
+
"The organization of the workspace. This can be a string or an object containing the organization's details"
|
|
734
|
+
),
|
|
735
|
+
repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
736
|
+
license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
|
|
737
|
+
homepage: z.url().optional().describe("The homepage of the workspace"),
|
|
738
|
+
docs: z.url().optional().describe("The documentation site for the workspace"),
|
|
739
|
+
portal: z.url().optional().describe("The development portal site for the workspace"),
|
|
740
|
+
licensing: z.url().optional().describe("The licensing site for the workspace"),
|
|
741
|
+
contact: z.url().optional().describe("The contact site for the workspace"),
|
|
742
|
+
support: z.url().optional().describe(
|
|
743
|
+
"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
|
|
744
|
+
),
|
|
745
|
+
branch: z.string().trim().default("main").describe("The branch of the workspace"),
|
|
746
|
+
preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
|
|
747
|
+
owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
|
|
748
|
+
bot: WorkspaceBotConfigSchema,
|
|
749
|
+
release: WorkspaceReleaseConfigSchema,
|
|
750
|
+
socials: WorkspaceSocialsConfigSchema,
|
|
751
|
+
error: errorConfigSchema,
|
|
752
|
+
mode: z.string().trim().default("production").describe("The current runtime environment mode for the package"),
|
|
753
|
+
workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
|
|
754
|
+
skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
|
|
755
|
+
directories: WorkspaceDirectoryConfigSchema,
|
|
756
|
+
packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
|
|
757
|
+
"The JavaScript/TypeScript package manager used by the repository"
|
|
758
|
+
),
|
|
759
|
+
timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
760
|
+
locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
|
|
761
|
+
logLevel: z.enum([
|
|
762
|
+
"silent",
|
|
763
|
+
"fatal",
|
|
764
|
+
"error",
|
|
765
|
+
"warn",
|
|
766
|
+
"success",
|
|
767
|
+
"info",
|
|
768
|
+
"debug",
|
|
769
|
+
"trace",
|
|
770
|
+
"all"
|
|
771
|
+
]).default("info").describe(
|
|
772
|
+
"The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."
|
|
773
|
+
),
|
|
774
|
+
skipConfigLogging: z.boolean().optional().describe(
|
|
775
|
+
"Should the logging of the current Storm Workspace configuration be skipped?"
|
|
776
|
+
),
|
|
777
|
+
registry: RegistryConfigSchema,
|
|
778
|
+
configFile: z.string().trim().nullable().default(null).describe(
|
|
779
|
+
"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
780
|
+
),
|
|
781
|
+
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
|
|
782
|
+
"Storm theme config values used for styling various package elements"
|
|
783
|
+
),
|
|
784
|
+
extensions: z.record(z.string(), z.any()).optional().default({}).describe("Configuration of each used extension")
|
|
785
|
+
}).describe(
|
|
786
|
+
"Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo."
|
|
787
|
+
);
|
|
788
|
+
|
|
789
|
+
// ../config/src/types.ts
|
|
790
|
+
var COLOR_KEYS = [
|
|
791
|
+
"dark",
|
|
792
|
+
"light",
|
|
793
|
+
"base",
|
|
794
|
+
"brand",
|
|
795
|
+
"alternate",
|
|
796
|
+
"accent",
|
|
797
|
+
"link",
|
|
798
|
+
"success",
|
|
799
|
+
"help",
|
|
800
|
+
"info",
|
|
801
|
+
"warning",
|
|
802
|
+
"danger",
|
|
803
|
+
"fatal",
|
|
804
|
+
"positive",
|
|
805
|
+
"negative"
|
|
806
|
+
];
|
|
807
|
+
|
|
808
|
+
// ../config-tools/src/utilities/get-default-config.ts
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
async function getPackageJsonConfig(root) {
|
|
813
|
+
let license = STORM_DEFAULT_LICENSE;
|
|
814
|
+
let homepage = void 0;
|
|
815
|
+
let support = void 0;
|
|
816
|
+
let name = void 0;
|
|
817
|
+
let namespace = void 0;
|
|
818
|
+
let repository = void 0;
|
|
819
|
+
const workspaceRoot = findWorkspaceRoot(root);
|
|
820
|
+
if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"))) {
|
|
821
|
+
const file = await _promises.readFile.call(void 0,
|
|
822
|
+
joinPaths(workspaceRoot, "package.json"),
|
|
823
|
+
"utf8"
|
|
824
|
+
);
|
|
825
|
+
if (file) {
|
|
826
|
+
const packageJson = JSON.parse(file);
|
|
827
|
+
if (packageJson.name) {
|
|
828
|
+
name = packageJson.name;
|
|
829
|
+
}
|
|
830
|
+
if (packageJson.namespace) {
|
|
831
|
+
namespace = packageJson.namespace;
|
|
832
|
+
}
|
|
833
|
+
if (packageJson.repository) {
|
|
834
|
+
if (typeof packageJson.repository === "string") {
|
|
835
|
+
repository = packageJson.repository;
|
|
836
|
+
} else if (packageJson.repository.url) {
|
|
837
|
+
repository = packageJson.repository.url;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
if (packageJson.license) {
|
|
841
|
+
license = packageJson.license;
|
|
842
|
+
}
|
|
843
|
+
if (packageJson.homepage) {
|
|
844
|
+
homepage = packageJson.homepage;
|
|
845
|
+
}
|
|
846
|
+
if (packageJson.bugs) {
|
|
847
|
+
if (typeof packageJson.bugs === "string") {
|
|
848
|
+
support = packageJson.bugs;
|
|
849
|
+
} else if (packageJson.bugs.url) {
|
|
850
|
+
support = packageJson.bugs.url;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
return {
|
|
856
|
+
workspaceRoot,
|
|
857
|
+
name,
|
|
858
|
+
namespace,
|
|
859
|
+
repository,
|
|
860
|
+
license,
|
|
861
|
+
homepage,
|
|
862
|
+
support
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
function applyDefaultConfig(config) {
|
|
866
|
+
if (!config.support && config.contact) {
|
|
867
|
+
config.support = config.contact;
|
|
868
|
+
}
|
|
869
|
+
if (!config.contact && config.support) {
|
|
870
|
+
config.contact = config.support;
|
|
871
|
+
}
|
|
872
|
+
if (config.homepage) {
|
|
873
|
+
if (!config.docs) {
|
|
874
|
+
config.docs = `${config.homepage}/docs`;
|
|
875
|
+
}
|
|
876
|
+
if (!config.license) {
|
|
877
|
+
config.license = `${config.homepage}/license`;
|
|
878
|
+
}
|
|
879
|
+
if (!config.support) {
|
|
880
|
+
config.support = `${config.homepage}/support`;
|
|
881
|
+
}
|
|
882
|
+
if (!config.contact) {
|
|
883
|
+
config.contact = `${config.homepage}/contact`;
|
|
884
|
+
}
|
|
885
|
+
if (!_optionalChain([config, 'access', _24 => _24.error, 'optionalAccess', _25 => _25.codesFile]) || !_optionalChain([config, 'optionalAccess', _26 => _26.error, 'optionalAccess', _27 => _27.url])) {
|
|
886
|
+
config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
|
|
887
|
+
if (config.homepage) {
|
|
888
|
+
config.error.url ??= `${config.homepage}/errors`;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
return config;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
// ../config-tools/src/config-file/get-config-file.ts
|
|
300
896
|
var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
301
|
-
const workspacePath = filePath ||
|
|
897
|
+
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
302
898
|
const configs = await Promise.all([
|
|
303
899
|
_c12.loadConfig.call(void 0, {
|
|
304
900
|
cwd: workspacePath,
|
|
305
901
|
packageJson: true,
|
|
306
902
|
name: fileName,
|
|
307
|
-
envName: _optionalChain([fileName, 'optionalAccess',
|
|
903
|
+
envName: _optionalChain([fileName, 'optionalAccess', _28 => _28.toUpperCase, 'call', _29 => _29()]),
|
|
308
904
|
jitiOptions: {
|
|
309
905
|
debug: false,
|
|
310
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false :
|
|
906
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
311
907
|
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
312
908
|
"jiti"
|
|
313
909
|
)
|
|
@@ -318,10 +914,10 @@ var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
|
318
914
|
cwd: workspacePath,
|
|
319
915
|
packageJson: true,
|
|
320
916
|
name: fileName,
|
|
321
|
-
envName: _optionalChain([fileName, 'optionalAccess',
|
|
917
|
+
envName: _optionalChain([fileName, 'optionalAccess', _30 => _30.toUpperCase, 'call', _31 => _31()]),
|
|
322
918
|
jitiOptions: {
|
|
323
919
|
debug: false,
|
|
324
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false :
|
|
920
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
325
921
|
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
326
922
|
"jiti"
|
|
327
923
|
)
|
|
@@ -333,12 +929,12 @@ var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
|
333
929
|
return _defu2.default.call(void 0, _nullishCoalesce(configs[0], () => ( {})), _nullishCoalesce(configs[1], () => ( {})));
|
|
334
930
|
};
|
|
335
931
|
var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
336
|
-
const workspacePath = filePath ? filePath :
|
|
932
|
+
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
337
933
|
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
338
934
|
let config = result.config;
|
|
339
935
|
const configFile = result.configFile;
|
|
340
936
|
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
341
|
-
|
|
937
|
+
_chunkIO7MJMVEcjs.writeTrace.call(void 0,
|
|
342
938
|
`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
|
|
343
939
|
{
|
|
344
940
|
logLevel: "all"
|
|
@@ -352,9 +948,9 @@ var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
|
352
948
|
)
|
|
353
949
|
);
|
|
354
950
|
for (const result2 of results) {
|
|
355
|
-
if (_optionalChain([result2, 'optionalAccess',
|
|
951
|
+
if (_optionalChain([result2, 'optionalAccess', _32 => _32.config]) && _optionalChain([result2, 'optionalAccess', _33 => _33.configFile]) && Object.keys(result2.config).length > 0) {
|
|
356
952
|
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
357
|
-
|
|
953
|
+
_chunkIO7MJMVEcjs.writeTrace.call(void 0,
|
|
358
954
|
`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
|
|
359
955
|
{
|
|
360
956
|
logLevel: "all"
|
|
@@ -433,15 +1029,15 @@ var getConfigEnv = () => {
|
|
|
433
1029
|
support: process.env[`${prefix}SUPPORT`] || void 0,
|
|
434
1030
|
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
435
1031
|
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
436
|
-
configFile: process.env[`${prefix}CONFIG_FILE`] ?
|
|
437
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ?
|
|
1032
|
+
configFile: process.env[`${prefix}CONFIG_FILE`] ? correctPaths(process.env[`${prefix}CONFIG_FILE`]) : void 0,
|
|
1033
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
438
1034
|
directories: {
|
|
439
|
-
cache: process.env[`${prefix}CACHE_DIR`] ?
|
|
440
|
-
data: process.env[`${prefix}DATA_DIR`] ?
|
|
441
|
-
config: process.env[`${prefix}CONFIG_DIR`] ?
|
|
442
|
-
temp: process.env[`${prefix}TEMP_DIR`] ?
|
|
443
|
-
log: process.env[`${prefix}LOG_DIR`] ?
|
|
444
|
-
build: process.env[`${prefix}BUILD_DIR`] ?
|
|
1035
|
+
cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
|
|
1036
|
+
data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? correctPaths(process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
|
|
1037
|
+
config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? correctPaths(process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
|
|
1038
|
+
temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? correctPaths(process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
|
|
1039
|
+
log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? correctPaths(process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
|
|
1040
|
+
build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? correctPaths(process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
|
|
445
1041
|
},
|
|
446
1042
|
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
447
1043
|
mode: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}MODE`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
|
|
@@ -465,13 +1061,13 @@ var getConfigEnv = () => {
|
|
|
465
1061
|
},
|
|
466
1062
|
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
467
1063
|
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
468
|
-
) ?
|
|
1064
|
+
) ? _chunkIO7MJMVEcjs.getLogLevelLabel.call(void 0,
|
|
469
1065
|
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
470
1066
|
) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
471
1067
|
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
472
1068
|
};
|
|
473
1069
|
const themeNames = Object.keys(process.env).filter(
|
|
474
|
-
(envKey) => envKey.startsWith(`${prefix}COLOR_`) &&
|
|
1070
|
+
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
|
|
475
1071
|
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
|
|
476
1072
|
)
|
|
477
1073
|
);
|
|
@@ -482,16 +1078,16 @@ var getConfigEnv = () => {
|
|
|
482
1078
|
},
|
|
483
1079
|
{}
|
|
484
1080
|
) : getThemeColorConfigEnv(prefix);
|
|
485
|
-
if (config.docs ===
|
|
486
|
-
if (config.homepage ===
|
|
487
|
-
config.docs = `${
|
|
1081
|
+
if (config.docs === STORM_DEFAULT_DOCS) {
|
|
1082
|
+
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
1083
|
+
config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
488
1084
|
} else {
|
|
489
1085
|
config.docs = `${config.homepage}/docs`;
|
|
490
1086
|
}
|
|
491
1087
|
}
|
|
492
|
-
if (config.licensing ===
|
|
493
|
-
if (config.homepage ===
|
|
494
|
-
config.licensing = `${
|
|
1088
|
+
if (config.licensing === STORM_DEFAULT_LICENSING) {
|
|
1089
|
+
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
1090
|
+
config.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
|
|
495
1091
|
} else {
|
|
496
1092
|
config.licensing = `${config.homepage}/docs`;
|
|
497
1093
|
}
|
|
@@ -513,6 +1109,19 @@ var getThemeColorConfigEnv = (prefix, theme) => {
|
|
|
513
1109
|
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
|
|
514
1110
|
};
|
|
515
1111
|
var getSingleThemeColorConfigEnv = (prefix) => {
|
|
1112
|
+
const gradient = [];
|
|
1113
|
+
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
1114
|
+
gradient.push(
|
|
1115
|
+
process.env[`${prefix}GRADIENT_START`],
|
|
1116
|
+
process.env[`${prefix}GRADIENT_END`]
|
|
1117
|
+
);
|
|
1118
|
+
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
1119
|
+
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
1120
|
+
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
1121
|
+
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
1122
|
+
index++;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
516
1125
|
return {
|
|
517
1126
|
dark: process.env[`${prefix}DARK`],
|
|
518
1127
|
light: process.env[`${prefix}LIGHT`],
|
|
@@ -527,7 +1136,8 @@ var getSingleThemeColorConfigEnv = (prefix) => {
|
|
|
527
1136
|
danger: process.env[`${prefix}DANGER`],
|
|
528
1137
|
fatal: process.env[`${prefix}FATAL`],
|
|
529
1138
|
positive: process.env[`${prefix}POSITIVE`],
|
|
530
|
-
negative: process.env[`${prefix}NEGATIVE`]
|
|
1139
|
+
negative: process.env[`${prefix}NEGATIVE`],
|
|
1140
|
+
gradient
|
|
531
1141
|
};
|
|
532
1142
|
};
|
|
533
1143
|
var getMultiThemeColorConfigEnv = (prefix) => {
|
|
@@ -539,6 +1149,19 @@ var getMultiThemeColorConfigEnv = (prefix) => {
|
|
|
539
1149
|
};
|
|
540
1150
|
};
|
|
541
1151
|
var getBaseThemeColorConfigEnv = (prefix) => {
|
|
1152
|
+
const gradient = [];
|
|
1153
|
+
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
1154
|
+
gradient.push(
|
|
1155
|
+
process.env[`${prefix}GRADIENT_START`],
|
|
1156
|
+
process.env[`${prefix}GRADIENT_END`]
|
|
1157
|
+
);
|
|
1158
|
+
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
1159
|
+
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
1160
|
+
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
1161
|
+
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
1162
|
+
index++;
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
542
1165
|
return {
|
|
543
1166
|
foreground: process.env[`${prefix}FOREGROUND`],
|
|
544
1167
|
background: process.env[`${prefix}BACKGROUND`],
|
|
@@ -553,7 +1176,8 @@ var getBaseThemeColorConfigEnv = (prefix) => {
|
|
|
553
1176
|
danger: process.env[`${prefix}DANGER`],
|
|
554
1177
|
fatal: process.env[`${prefix}FATAL`],
|
|
555
1178
|
positive: process.env[`${prefix}POSITIVE`],
|
|
556
|
-
negative: process.env[`${prefix}NEGATIVE`]
|
|
1179
|
+
negative: process.env[`${prefix}NEGATIVE`],
|
|
1180
|
+
gradient
|
|
557
1181
|
};
|
|
558
1182
|
};
|
|
559
1183
|
|
|
@@ -561,16 +1185,16 @@ var getBaseThemeColorConfigEnv = (prefix) => {
|
|
|
561
1185
|
var setExtensionEnv = (extensionName, extension) => {
|
|
562
1186
|
for (const key of Object.keys(_nullishCoalesce(extension, () => ( {})))) {
|
|
563
1187
|
if (extension[key]) {
|
|
564
|
-
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess',
|
|
1188
|
+
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess', _34 => _34.replace, 'call', _35 => _35(
|
|
565
1189
|
/([A-Z])+/g,
|
|
566
|
-
(input) => input ? _optionalChain([input, 'access',
|
|
567
|
-
), 'access',
|
|
1190
|
+
(input) => input ? _optionalChain([input, 'access', _36 => _36[0], 'optionalAccess', _37 => _37.toUpperCase, 'call', _38 => _38()]) + input.slice(1) : ""
|
|
1191
|
+
), 'access', _39 => _39.split, 'call', _40 => _40(/(?=[A-Z])|[.\-\s_]/), 'access', _41 => _41.map, 'call', _42 => _42((x) => x.toLowerCase())]), () => ( []));
|
|
568
1192
|
let extensionKey;
|
|
569
1193
|
if (result.length === 0) {
|
|
570
1194
|
return;
|
|
571
1195
|
}
|
|
572
1196
|
if (result.length === 1) {
|
|
573
|
-
extensionKey = _nullishCoalesce(_optionalChain([result, 'access',
|
|
1197
|
+
extensionKey = _nullishCoalesce(_optionalChain([result, 'access', _43 => _43[0], 'optionalAccess', _44 => _44.toUpperCase, 'call', _45 => _45()]), () => ( ""));
|
|
574
1198
|
} else {
|
|
575
1199
|
extensionKey = result.reduce((ret, part) => {
|
|
576
1200
|
return `${ret}_${part.toLowerCase()}`;
|
|
@@ -684,48 +1308,49 @@ var setConfigEnv = (config) => {
|
|
|
684
1308
|
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
685
1309
|
process.env.TZ = config.timezone;
|
|
686
1310
|
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
1311
|
+
process.env.TIMEZONE = config.timezone;
|
|
687
1312
|
}
|
|
688
1313
|
if (config.locale) {
|
|
689
1314
|
process.env[`${prefix}LOCALE`] = config.locale;
|
|
690
|
-
process.env.LOCALE = config.locale;
|
|
691
1315
|
process.env.DEFAULT_LOCALE = config.locale;
|
|
1316
|
+
process.env.LOCALE = config.locale;
|
|
692
1317
|
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
693
1318
|
}
|
|
694
1319
|
if (config.configFile) {
|
|
695
|
-
process.env[`${prefix}CONFIG_FILE`] =
|
|
1320
|
+
process.env[`${prefix}CONFIG_FILE`] = correctPaths(config.configFile);
|
|
696
1321
|
}
|
|
697
1322
|
if (config.workspaceRoot) {
|
|
698
|
-
process.env[`${prefix}WORKSPACE_ROOT`] =
|
|
699
|
-
process.env.NX_WORKSPACE_ROOT =
|
|
700
|
-
process.env.NX_WORKSPACE_ROOT_PATH =
|
|
1323
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config.workspaceRoot);
|
|
1324
|
+
process.env.NX_WORKSPACE_ROOT = correctPaths(config.workspaceRoot);
|
|
1325
|
+
process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
|
|
701
1326
|
}
|
|
702
1327
|
if (config.directories) {
|
|
703
1328
|
if (!config.skipCache && config.directories.cache) {
|
|
704
|
-
process.env[`${prefix}CACHE_DIR`] =
|
|
1329
|
+
process.env[`${prefix}CACHE_DIR`] = correctPaths(
|
|
705
1330
|
config.directories.cache
|
|
706
1331
|
);
|
|
707
1332
|
process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
|
|
708
1333
|
}
|
|
709
1334
|
if (config.directories.data) {
|
|
710
|
-
process.env[`${prefix}DATA_DIR`] =
|
|
1335
|
+
process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
|
|
711
1336
|
process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
|
|
712
1337
|
}
|
|
713
1338
|
if (config.directories.config) {
|
|
714
|
-
process.env[`${prefix}CONFIG_DIR`] =
|
|
1339
|
+
process.env[`${prefix}CONFIG_DIR`] = correctPaths(
|
|
715
1340
|
config.directories.config
|
|
716
1341
|
);
|
|
717
1342
|
process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
|
|
718
1343
|
}
|
|
719
1344
|
if (config.directories.temp) {
|
|
720
|
-
process.env[`${prefix}TEMP_DIR`] =
|
|
1345
|
+
process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
|
|
721
1346
|
process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
|
|
722
1347
|
}
|
|
723
1348
|
if (config.directories.log) {
|
|
724
|
-
process.env[`${prefix}LOG_DIR`] =
|
|
1349
|
+
process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
|
|
725
1350
|
process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
|
|
726
1351
|
}
|
|
727
1352
|
if (config.directories.build) {
|
|
728
|
-
process.env[`${prefix}BUILD_DIR`] =
|
|
1353
|
+
process.env[`${prefix}BUILD_DIR`] = correctPaths(
|
|
729
1354
|
config.directories.build
|
|
730
1355
|
);
|
|
731
1356
|
process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
|
|
@@ -743,7 +1368,7 @@ var setConfigEnv = (config) => {
|
|
|
743
1368
|
process.env.NODE_ENV = config.mode;
|
|
744
1369
|
process.env.ENVIRONMENT = config.mode;
|
|
745
1370
|
}
|
|
746
|
-
if (_optionalChain([config, 'access',
|
|
1371
|
+
if (_optionalChain([config, 'access', _46 => _46.colors, 'optionalAccess', _47 => _47.base, 'optionalAccess', _48 => _48.light]) || _optionalChain([config, 'access', _49 => _49.colors, 'optionalAccess', _50 => _50.base, 'optionalAccess', _51 => _51.dark])) {
|
|
747
1372
|
for (const key of Object.keys(config.colors)) {
|
|
748
1373
|
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
749
1374
|
}
|
|
@@ -787,9 +1412,9 @@ var setConfigEnv = (config) => {
|
|
|
787
1412
|
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
788
1413
|
process.env.LOG_LEVEL = String(config.logLevel);
|
|
789
1414
|
process.env.NX_VERBOSE_LOGGING = String(
|
|
790
|
-
|
|
1415
|
+
_chunkIO7MJMVEcjs.getLogLevel.call(void 0, config.logLevel) >= _chunkIO7MJMVEcjs.LogLevel.DEBUG ? true : false
|
|
791
1416
|
);
|
|
792
|
-
process.env.RUST_BACKTRACE =
|
|
1417
|
+
process.env.RUST_BACKTRACE = _chunkIO7MJMVEcjs.getLogLevel.call(void 0, config.logLevel) >= _chunkIO7MJMVEcjs.LogLevel.DEBUG ? "full" : "none";
|
|
793
1418
|
}
|
|
794
1419
|
if (config.skipConfigLogging !== void 0) {
|
|
795
1420
|
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
|
|
@@ -804,7 +1429,7 @@ var setConfigEnv = (config) => {
|
|
|
804
1429
|
}
|
|
805
1430
|
};
|
|
806
1431
|
var setThemeColorConfigEnv = (prefix, config) => {
|
|
807
|
-
return _optionalChain([config, 'optionalAccess',
|
|
1432
|
+
return _optionalChain([config, 'optionalAccess', _52 => _52.light, 'optionalAccess', _53 => _53.brand]) || _optionalChain([config, 'optionalAccess', _54 => _54.dark, 'optionalAccess', _55 => _55.brand]) ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
808
1433
|
};
|
|
809
1434
|
var setSingleThemeColorConfigEnv = (prefix, config) => {
|
|
810
1435
|
if (config.dark) {
|
|
@@ -849,6 +1474,11 @@ var setSingleThemeColorConfigEnv = (prefix, config) => {
|
|
|
849
1474
|
if (config.negative) {
|
|
850
1475
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
851
1476
|
}
|
|
1477
|
+
if (config.gradient) {
|
|
1478
|
+
for (let i = 0; i < config.gradient.length; i++) {
|
|
1479
|
+
process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
852
1482
|
};
|
|
853
1483
|
var setMultiThemeColorConfigEnv = (prefix, config) => {
|
|
854
1484
|
return {
|
|
@@ -899,6 +1529,11 @@ var setBaseThemeColorConfigEnv = (prefix, config) => {
|
|
|
899
1529
|
if (config.negative) {
|
|
900
1530
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
901
1531
|
}
|
|
1532
|
+
if (config.gradient) {
|
|
1533
|
+
for (let i = 0; i < config.gradient.length; i++) {
|
|
1534
|
+
process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
902
1537
|
};
|
|
903
1538
|
|
|
904
1539
|
// ../config-tools/src/create-storm-config.ts
|
|
@@ -906,16 +1541,16 @@ var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
|
906
1541
|
var _static_cache = void 0;
|
|
907
1542
|
var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
|
|
908
1543
|
let result;
|
|
909
|
-
if (!_optionalChain([_static_cache, 'optionalAccess',
|
|
1544
|
+
if (!_optionalChain([_static_cache, 'optionalAccess', _56 => _56.data]) || !_optionalChain([_static_cache, 'optionalAccess', _57 => _57.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
|
|
910
1545
|
let _workspaceRoot = workspaceRoot;
|
|
911
1546
|
if (!_workspaceRoot) {
|
|
912
|
-
_workspaceRoot =
|
|
1547
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
913
1548
|
}
|
|
914
1549
|
const configEnv = getConfigEnv();
|
|
915
1550
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
916
1551
|
if (!configFile) {
|
|
917
1552
|
if (!skipLogs) {
|
|
918
|
-
|
|
1553
|
+
_chunkIO7MJMVEcjs.writeWarning.call(void 0,
|
|
919
1554
|
"No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n",
|
|
920
1555
|
{ logLevel: "all" }
|
|
921
1556
|
);
|
|
@@ -924,22 +1559,22 @@ var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, sk
|
|
|
924
1559
|
return void 0;
|
|
925
1560
|
}
|
|
926
1561
|
}
|
|
927
|
-
const defaultConfig = await
|
|
1562
|
+
const defaultConfig = await getPackageJsonConfig(_workspaceRoot);
|
|
928
1563
|
const configInput = _defu2.default.call(void 0,
|
|
929
1564
|
configEnv,
|
|
930
1565
|
configFile,
|
|
931
1566
|
defaultConfig
|
|
932
1567
|
);
|
|
933
1568
|
try {
|
|
934
|
-
result =
|
|
935
|
-
await
|
|
1569
|
+
result = applyDefaultConfig(
|
|
1570
|
+
await stormWorkspaceConfigSchema.parseAsync(configInput)
|
|
936
1571
|
);
|
|
937
1572
|
result.workspaceRoot ??= _workspaceRoot;
|
|
938
1573
|
} catch (error) {
|
|
939
1574
|
throw new Error(
|
|
940
|
-
`Failed to parse Storm Workspace configuration${_optionalChain([error, 'optionalAccess',
|
|
1575
|
+
`Failed to parse Storm Workspace configuration${_optionalChain([error, 'optionalAccess', _58 => _58.message]) ? `: ${error.message}` : ""}
|
|
941
1576
|
|
|
942
|
-
Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${
|
|
1577
|
+
Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${_chunkIO7MJMVEcjs.formatLogMessage.call(void 0,
|
|
943
1578
|
configInput
|
|
944
1579
|
)}`,
|
|
945
1580
|
{
|
|
@@ -984,9 +1619,9 @@ var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
|
|
|
984
1619
|
);
|
|
985
1620
|
setConfigEnv(config);
|
|
986
1621
|
if (!skipLogs && !config.skipConfigLogging) {
|
|
987
|
-
|
|
1622
|
+
_chunkIO7MJMVEcjs.writeTrace.call(void 0,
|
|
988
1623
|
`\u2699\uFE0F Using Storm Workspace configuration:
|
|
989
|
-
${
|
|
1624
|
+
${_chunkIO7MJMVEcjs.formatLogMessage.call(void 0, config)}`,
|
|
990
1625
|
config
|
|
991
1626
|
);
|
|
992
1627
|
}
|
|
@@ -1001,7 +1636,7 @@ var getConfig = (workspaceRoot, skipLogs = false) => {
|
|
|
1001
1636
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
1002
1637
|
|
|
1003
1638
|
var getEntryPoints = async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
1004
|
-
const workspaceRoot = config.workspaceRoot ||
|
|
1639
|
+
const workspaceRoot = config.workspaceRoot || findWorkspaceRoot();
|
|
1005
1640
|
const entryPoints = [];
|
|
1006
1641
|
if (entry) {
|
|
1007
1642
|
if (typeof entry === "string") {
|
|
@@ -1014,7 +1649,7 @@ var getEntryPoints = async (config, projectRoot, sourceRoot, entry, emitOnAll =
|
|
|
1014
1649
|
}
|
|
1015
1650
|
if (emitOnAll) {
|
|
1016
1651
|
entryPoints.push(
|
|
1017
|
-
|
|
1652
|
+
joinPaths(workspaceRoot, sourceRoot || projectRoot, "**/*.{ts,tsx}")
|
|
1018
1653
|
);
|
|
1019
1654
|
}
|
|
1020
1655
|
const results = await Promise.all(
|
|
@@ -1027,12 +1662,12 @@ var getEntryPoints = async (config, projectRoot, sourceRoot, entry, emitOnAll =
|
|
|
1027
1662
|
});
|
|
1028
1663
|
paths.push(
|
|
1029
1664
|
...files.reduce((ret, filePath) => {
|
|
1030
|
-
const result =
|
|
1031
|
-
|
|
1665
|
+
const result = correctPaths(
|
|
1666
|
+
joinPaths(filePath.path, filePath.name).replaceAll(correctPaths(workspaceRoot), "").replaceAll(correctPaths(projectRoot), "")
|
|
1032
1667
|
);
|
|
1033
1668
|
if (result) {
|
|
1034
|
-
|
|
1035
|
-
`Trying to add entry point ${result} at "${
|
|
1669
|
+
_chunkIO7MJMVEcjs.writeDebug.call(void 0,
|
|
1670
|
+
`Trying to add entry point ${result} at "${joinPaths(
|
|
1036
1671
|
filePath.path,
|
|
1037
1672
|
filePath.name
|
|
1038
1673
|
)}"`,
|
|
@@ -1046,7 +1681,7 @@ var getEntryPoints = async (config, projectRoot, sourceRoot, entry, emitOnAll =
|
|
|
1046
1681
|
}, [])
|
|
1047
1682
|
);
|
|
1048
1683
|
} else {
|
|
1049
|
-
|
|
1684
|
+
_chunkIO7MJMVEcjs.writeDebug.call(void 0, `Trying to add entry point ${entryPoint}"`, config);
|
|
1050
1685
|
if (!paths.includes(entryPoint)) {
|
|
1051
1686
|
paths.push(entryPoint);
|
|
1052
1687
|
}
|
|
@@ -1101,12 +1736,12 @@ var resolveOptions = async (userOptions) => {
|
|
|
1101
1736
|
throw new Error("Cannot find Nx workspace root");
|
|
1102
1737
|
}
|
|
1103
1738
|
const config = await getConfig(workspaceRoot.dir);
|
|
1104
|
-
|
|
1105
|
-
const stopwatch =
|
|
1739
|
+
_chunkIO7MJMVEcjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1740
|
+
const stopwatch = _chunkIO7MJMVEcjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1106
1741
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1107
1742
|
exitOnError: true
|
|
1108
1743
|
});
|
|
1109
|
-
const projectJsonPath =
|
|
1744
|
+
const projectJsonPath = joinPaths(
|
|
1110
1745
|
workspaceRoot.dir,
|
|
1111
1746
|
projectRoot,
|
|
1112
1747
|
"project.json"
|
|
@@ -1118,7 +1753,7 @@ var resolveOptions = async (userOptions) => {
|
|
|
1118
1753
|
const projectJson = JSON.parse(projectJsonFile);
|
|
1119
1754
|
const projectName = projectJson.name;
|
|
1120
1755
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1121
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
1756
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _59 => _59.projects, 'optionalAccess', _60 => _60[projectName]])) {
|
|
1122
1757
|
throw new Error(
|
|
1123
1758
|
"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."
|
|
1124
1759
|
);
|
|
@@ -1126,7 +1761,7 @@ var resolveOptions = async (userOptions) => {
|
|
|
1126
1761
|
const options = _defu2.default.call(void 0, userOptions, _chunk65E5RX7Icjs.DEFAULT_BUILD_OPTIONS);
|
|
1127
1762
|
options.name ??= `${projectName}-${options.format}`;
|
|
1128
1763
|
options.target ??= DEFAULT_TARGET;
|
|
1129
|
-
const packageJsonPath =
|
|
1764
|
+
const packageJsonPath = joinPaths(
|
|
1130
1765
|
workspaceRoot.dir,
|
|
1131
1766
|
options.projectRoot,
|
|
1132
1767
|
"package.json"
|
|
@@ -1139,7 +1774,7 @@ var resolveOptions = async (userOptions) => {
|
|
|
1139
1774
|
...options,
|
|
1140
1775
|
config,
|
|
1141
1776
|
...userOptions,
|
|
1142
|
-
tsconfig:
|
|
1777
|
+
tsconfig: joinPaths(
|
|
1143
1778
|
projectRoot,
|
|
1144
1779
|
userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"
|
|
1145
1780
|
),
|
|
@@ -1151,15 +1786,15 @@ var resolveOptions = async (userOptions) => {
|
|
|
1151
1786
|
userOptions.entry || ["./src/index.ts"],
|
|
1152
1787
|
userOptions.emitOnAll
|
|
1153
1788
|
),
|
|
1154
|
-
outdir: userOptions.outputPath ||
|
|
1789
|
+
outdir: userOptions.outputPath || joinPaths("dist", projectRoot),
|
|
1155
1790
|
plugins: [],
|
|
1156
1791
|
name: userOptions.name || projectName,
|
|
1157
1792
|
projectConfigurations,
|
|
1158
1793
|
projectName,
|
|
1159
1794
|
projectGraph,
|
|
1160
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
1795
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || joinPaths(projectRoot, "src"),
|
|
1161
1796
|
minify: userOptions.minify || !userOptions.debug,
|
|
1162
|
-
verbose: userOptions.verbose ||
|
|
1797
|
+
verbose: userOptions.verbose || _chunkIO7MJMVEcjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1163
1798
|
includeSrc: userOptions.includeSrc === true,
|
|
1164
1799
|
metafile: userOptions.metafile !== false,
|
|
1165
1800
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -1191,15 +1826,15 @@ var resolveOptions = async (userOptions) => {
|
|
|
1191
1826
|
return result;
|
|
1192
1827
|
};
|
|
1193
1828
|
async function generatePackageJson(options) {
|
|
1194
|
-
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0,
|
|
1195
|
-
|
|
1196
|
-
const stopwatch =
|
|
1197
|
-
const packageJsonPath =
|
|
1829
|
+
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, joinPaths(options.projectRoot, "package.json"))) {
|
|
1830
|
+
_chunkIO7MJMVEcjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
|
|
1831
|
+
const stopwatch = _chunkIO7MJMVEcjs.getStopwatch.call(void 0, "Write package.json file");
|
|
1832
|
+
const packageJsonPath = joinPaths(options.projectRoot, "project.json");
|
|
1198
1833
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1199
1834
|
throw new Error("Cannot find package.json configuration");
|
|
1200
1835
|
}
|
|
1201
1836
|
const packageJsonFile = await _promises2.default.readFile(
|
|
1202
|
-
|
|
1837
|
+
joinPaths(
|
|
1203
1838
|
options.config.workspaceRoot,
|
|
1204
1839
|
options.projectRoot,
|
|
1205
1840
|
"package.json"
|
|
@@ -1261,14 +1896,14 @@ async function generatePackageJson(options) {
|
|
|
1261
1896
|
},
|
|
1262
1897
|
packageJson.exports
|
|
1263
1898
|
);
|
|
1264
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1899
|
+
await _devkit.writeJsonFile.call(void 0, joinPaths(options.outdir, "package.json"), packageJson);
|
|
1265
1900
|
stopwatch();
|
|
1266
1901
|
}
|
|
1267
1902
|
return options;
|
|
1268
1903
|
}
|
|
1269
1904
|
async function executeTSDown(options) {
|
|
1270
|
-
|
|
1271
|
-
const stopwatch =
|
|
1905
|
+
_chunkIO7MJMVEcjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} build`, options.config);
|
|
1906
|
+
const stopwatch = _chunkIO7MJMVEcjs.getStopwatch.call(void 0, `${options.name} build`);
|
|
1272
1907
|
await _tsdown.build.call(void 0, {
|
|
1273
1908
|
...options,
|
|
1274
1909
|
entry: options.entryPoints,
|
|
@@ -1279,11 +1914,11 @@ async function executeTSDown(options) {
|
|
|
1279
1914
|
return options;
|
|
1280
1915
|
}
|
|
1281
1916
|
async function copyBuildAssets(options) {
|
|
1282
|
-
|
|
1917
|
+
_chunkIO7MJMVEcjs.writeDebug.call(void 0,
|
|
1283
1918
|
` \u{1F4CB} Copying asset files to output directory: ${options.outdir}`,
|
|
1284
1919
|
options.config
|
|
1285
1920
|
);
|
|
1286
|
-
const stopwatch =
|
|
1921
|
+
const stopwatch = _chunkIO7MJMVEcjs.getStopwatch.call(void 0, `${options.name} asset copy`);
|
|
1287
1922
|
await copyAssets(
|
|
1288
1923
|
options.config,
|
|
1289
1924
|
_nullishCoalesce(options.assets, () => ( [])),
|
|
@@ -1297,26 +1932,26 @@ async function copyBuildAssets(options) {
|
|
|
1297
1932
|
return options;
|
|
1298
1933
|
}
|
|
1299
1934
|
async function reportResults(options) {
|
|
1300
|
-
|
|
1935
|
+
_chunkIO7MJMVEcjs.writeSuccess.call(void 0,
|
|
1301
1936
|
` \u{1F4E6} The ${options.name} build completed successfully`,
|
|
1302
1937
|
options.config
|
|
1303
1938
|
);
|
|
1304
1939
|
}
|
|
1305
1940
|
async function cleanOutputPath(options) {
|
|
1306
1941
|
if (options.clean !== false && options.outdir) {
|
|
1307
|
-
|
|
1942
|
+
_chunkIO7MJMVEcjs.writeDebug.call(void 0,
|
|
1308
1943
|
` \u{1F9F9} Cleaning ${options.name} output path: ${options.outdir}`,
|
|
1309
1944
|
options.config
|
|
1310
1945
|
);
|
|
1311
|
-
const stopwatch =
|
|
1312
|
-
await
|
|
1946
|
+
const stopwatch = _chunkIO7MJMVEcjs.getStopwatch.call(void 0, `${options.name} output clean`);
|
|
1947
|
+
await _chunkIO7MJMVEcjs.cleanDirectories.call(void 0, options.name, options.outdir, options.config);
|
|
1313
1948
|
stopwatch();
|
|
1314
1949
|
}
|
|
1315
1950
|
return options;
|
|
1316
1951
|
}
|
|
1317
1952
|
async function build(options) {
|
|
1318
|
-
|
|
1319
|
-
const stopwatch =
|
|
1953
|
+
_chunkIO7MJMVEcjs.writeDebug.call(void 0, ` \u26A1 Executing Storm TSDown pipeline`);
|
|
1954
|
+
const stopwatch = _chunkIO7MJMVEcjs.getStopwatch.call(void 0, "TSDown pipeline");
|
|
1320
1955
|
try {
|
|
1321
1956
|
const opts = Array.isArray(options) ? options : [options];
|
|
1322
1957
|
if (opts.length === 0) {
|
|
@@ -1336,13 +1971,13 @@ async function build(options) {
|
|
|
1336
1971
|
})
|
|
1337
1972
|
);
|
|
1338
1973
|
} else {
|
|
1339
|
-
|
|
1974
|
+
_chunkIO7MJMVEcjs.writeWarning.call(void 0,
|
|
1340
1975
|
" \u{1F6A7} No options were passed to TSBuild. Please check the parameters passed to the `build` function."
|
|
1341
1976
|
);
|
|
1342
1977
|
}
|
|
1343
|
-
|
|
1978
|
+
_chunkIO7MJMVEcjs.writeSuccess.call(void 0, " \u{1F3C1} TSDown pipeline build completed successfully");
|
|
1344
1979
|
} catch (error) {
|
|
1345
|
-
|
|
1980
|
+
_chunkIO7MJMVEcjs.writeFatal.call(void 0,
|
|
1346
1981
|
"Fatal errors that the build process could not recover from have occured. The build process has been terminated."
|
|
1347
1982
|
);
|
|
1348
1983
|
throw error;
|