@storm-software/unbuild 0.17.0 → 0.17.2

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.
Files changed (47) hide show
  1. package/README.md +1 -1
  2. package/bin/unbuild.cjs +1404 -102
  3. package/dist/build.cjs +15 -0
  4. package/dist/build.d.cts +13 -0
  5. package/dist/build.d.ts +13 -0
  6. package/dist/build.js +15 -0
  7. package/dist/chunk-3GQAWCBQ.js +13 -0
  8. package/dist/chunk-3VV4SMHK.js +65 -0
  9. package/dist/chunk-425BMCFI.cjs +31 -0
  10. package/dist/chunk-5N2TOSNK.cjs +21 -0
  11. package/dist/chunk-5RCA5OSO.cjs +35 -0
  12. package/dist/chunk-6G4AZLTO.cjs +28 -0
  13. package/dist/chunk-BGYQAVKQ.cjs +13 -0
  14. package/dist/chunk-C2GKE7R5.js +35 -0
  15. package/dist/chunk-D7L56O4W.js +1039 -0
  16. package/dist/chunk-DWREBCC4.cjs +557 -0
  17. package/dist/chunk-EES2DAYR.cjs +65 -0
  18. package/dist/chunk-FYSN6ZVI.js +21 -0
  19. package/dist/chunk-GGNOJ77I.js +0 -0
  20. package/dist/chunk-KVVGB74V.js +31 -0
  21. package/dist/chunk-LGSLDHM4.cjs +31 -0
  22. package/dist/chunk-OP52W2X6.cjs +35 -0
  23. package/dist/chunk-P5CSSAMQ.js +557 -0
  24. package/dist/chunk-REG7YZIZ.js +31 -0
  25. package/dist/chunk-SFZRYJZ2.cjs +1 -0
  26. package/dist/chunk-V3TNL7N7.cjs +1039 -0
  27. package/dist/chunk-VN5I7Q45.js +28 -0
  28. package/dist/chunk-X42DGJLB.js +35 -0
  29. package/dist/clean-BlXMN74D.d.cts +1194 -0
  30. package/dist/clean-BlXMN74D.d.ts +1194 -0
  31. package/dist/clean.cjs +8 -0
  32. package/dist/clean.d.cts +2 -0
  33. package/dist/clean.d.ts +2 -0
  34. package/dist/clean.js +8 -0
  35. package/dist/config.cjs +13 -0
  36. package/dist/config.d.cts +8 -0
  37. package/dist/config.d.ts +8 -0
  38. package/dist/config.js +13 -0
  39. package/dist/index.cjs +27 -0
  40. package/dist/index.d.cts +23 -0
  41. package/dist/index.d.ts +23 -0
  42. package/dist/index.js +27 -0
  43. package/dist/types.cjs +1 -0
  44. package/dist/types.d.cts +30 -0
  45. package/dist/types.d.ts +30 -0
  46. package/dist/types.js +1 -0
  47. package/package.json +1 -1
@@ -0,0 +1,557 @@
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; }
2
+
3
+ var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
4
+
5
+ // ../config-tools/src/types.ts
6
+ var LogLevel = {
7
+ SILENT: 0,
8
+ FATAL: 10,
9
+ ERROR: 20,
10
+ WARN: 30,
11
+ SUCCESS: 35,
12
+ INFO: 40,
13
+ DEBUG: 60,
14
+ TRACE: 70,
15
+ ALL: 100
16
+ };
17
+ var LogLevelLabel = {
18
+ SILENT: "silent",
19
+ FATAL: "fatal",
20
+ ERROR: "error",
21
+ WARN: "warn",
22
+ INFO: "info",
23
+ DEBUG: "debug",
24
+ TRACE: "trace",
25
+ ALL: "all"
26
+ };
27
+
28
+ // ../config-tools/src/utilities/correct-paths.ts
29
+ var _devkit = require('@nx/devkit');
30
+ var correctPaths = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (path) => {
31
+ if (!path) {
32
+ return "";
33
+ }
34
+ if (!path.toUpperCase().startsWith("C:") && path.includes("\\")) {
35
+ path = `C:${path}`;
36
+ }
37
+ return path.replaceAll("\\", "/");
38
+ }, "correctPaths");
39
+ var joinPaths = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (...paths) => {
40
+ if (!paths || paths.length === 0) {
41
+ return "";
42
+ }
43
+ return correctPaths(_devkit.joinPathFragments.call(void 0, ...paths.map((path) => correctPaths(path))));
44
+ }, "joinPaths");
45
+
46
+ // ../config-tools/src/logger/get-log-level.ts
47
+ var getLogLevel = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (label) => {
48
+ switch (label) {
49
+ case "all":
50
+ return LogLevel.ALL;
51
+ case "trace":
52
+ return LogLevel.TRACE;
53
+ case "debug":
54
+ return LogLevel.DEBUG;
55
+ case "info":
56
+ return LogLevel.INFO;
57
+ case "warn":
58
+ return LogLevel.WARN;
59
+ case "error":
60
+ return LogLevel.ERROR;
61
+ case "fatal":
62
+ return LogLevel.FATAL;
63
+ case "silent":
64
+ return LogLevel.SILENT;
65
+ default:
66
+ return LogLevel.INFO;
67
+ }
68
+ }, "getLogLevel");
69
+ var getLogLevelLabel = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (logLevel = LogLevel.INFO) => {
70
+ if (logLevel >= LogLevel.ALL) {
71
+ return LogLevelLabel.ALL;
72
+ }
73
+ if (logLevel >= LogLevel.TRACE) {
74
+ return LogLevelLabel.TRACE;
75
+ }
76
+ if (logLevel >= LogLevel.DEBUG) {
77
+ return LogLevelLabel.DEBUG;
78
+ }
79
+ if (logLevel >= LogLevel.INFO) {
80
+ return LogLevelLabel.INFO;
81
+ }
82
+ if (logLevel >= LogLevel.WARN) {
83
+ return LogLevelLabel.WARN;
84
+ }
85
+ if (logLevel >= LogLevel.ERROR) {
86
+ return LogLevelLabel.ERROR;
87
+ }
88
+ if (logLevel >= LogLevel.FATAL) {
89
+ return LogLevelLabel.FATAL;
90
+ }
91
+ if (logLevel <= LogLevel.SILENT) {
92
+ return LogLevelLabel.SILENT;
93
+ }
94
+ return LogLevelLabel.INFO;
95
+ }, "getLogLevelLabel");
96
+ var isVerbose = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (label = LogLevelLabel.SILENT) => {
97
+ const logLevel = typeof label === "string" ? getLogLevel(label) : label;
98
+ return logLevel <= LogLevel.DEBUG;
99
+ }, "isVerbose");
100
+
101
+ // ../config/src/constants.ts
102
+ var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
103
+ var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
104
+ var STORM_DEFAULT_LICENSING = "https://license.stormsoftware.com";
105
+ var STORM_DEFAULT_LICENSE = "Apache-2.0";
106
+
107
+ // ../config/src/schema.ts
108
+ var _zod = require('zod'); var _zod2 = _interopRequireDefault(_zod);
109
+ var DarkColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1d1e22").describe("The dark background color of the workspace");
110
+ var LightColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#f4f4f5").describe("The light background color of the workspace");
111
+ var BrandColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1fb2a6").describe("The primary brand specific color of the workspace");
112
+ var AlternateColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The alternate brand specific color of the workspace");
113
+ var AccentColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The secondary brand specific color of the workspace");
114
+ var LinkColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The color used to display hyperlink text");
115
+ var HelpColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#8256D0").describe("The second brand specific color of the workspace");
116
+ var SuccessColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#12B66A").describe("The success color of the workspace");
117
+ var InfoColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#0070E0").describe("The informational color of the workspace");
118
+ var WarningColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#fcc419").describe("The warning color of the workspace");
119
+ var DangerColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#D8314A").describe("The danger color of the workspace");
120
+ var FatalColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The fatal color of the workspace");
121
+ var PositiveColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#4ade80").describe("The positive number color of the workspace");
122
+ var NegativeColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#ef4444").describe("The negative number color of the workspace");
123
+ var DarkThemeColorConfigSchema = _zod2.default.object({
124
+ foreground: LightColorSchema,
125
+ background: DarkColorSchema,
126
+ brand: BrandColorSchema,
127
+ alternate: AlternateColorSchema,
128
+ accent: AccentColorSchema,
129
+ link: LinkColorSchema,
130
+ help: HelpColorSchema,
131
+ success: SuccessColorSchema,
132
+ info: InfoColorSchema,
133
+ warning: WarningColorSchema,
134
+ danger: DangerColorSchema,
135
+ fatal: FatalColorSchema,
136
+ positive: PositiveColorSchema,
137
+ negative: NegativeColorSchema
138
+ });
139
+ var LightThemeColorConfigSchema = _zod2.default.object({
140
+ foreground: DarkColorSchema,
141
+ background: LightColorSchema,
142
+ brand: BrandColorSchema,
143
+ alternate: AlternateColorSchema,
144
+ accent: AccentColorSchema,
145
+ link: LinkColorSchema,
146
+ help: HelpColorSchema,
147
+ success: SuccessColorSchema,
148
+ info: InfoColorSchema,
149
+ warning: WarningColorSchema,
150
+ danger: DangerColorSchema,
151
+ fatal: FatalColorSchema,
152
+ positive: PositiveColorSchema,
153
+ negative: NegativeColorSchema
154
+ });
155
+ var MultiThemeColorConfigSchema = _zod2.default.object({
156
+ dark: DarkThemeColorConfigSchema,
157
+ light: LightThemeColorConfigSchema
158
+ });
159
+ var SingleThemeColorConfigSchema = _zod2.default.object({
160
+ dark: DarkColorSchema,
161
+ light: LightColorSchema,
162
+ brand: BrandColorSchema,
163
+ alternate: AlternateColorSchema,
164
+ accent: AccentColorSchema,
165
+ link: LinkColorSchema,
166
+ help: HelpColorSchema,
167
+ success: SuccessColorSchema,
168
+ info: InfoColorSchema,
169
+ warning: WarningColorSchema,
170
+ danger: DangerColorSchema,
171
+ fatal: FatalColorSchema,
172
+ positive: PositiveColorSchema,
173
+ negative: NegativeColorSchema
174
+ });
175
+ var RegistryUrlConfigSchema = _zod2.default.string().trim().toLowerCase().url().optional().describe("A remote registry URL used to publish distributable packages");
176
+ var RegistryConfigSchema = _zod2.default.object({
177
+ github: RegistryUrlConfigSchema,
178
+ npm: RegistryUrlConfigSchema,
179
+ cargo: RegistryUrlConfigSchema,
180
+ cyclone: RegistryUrlConfigSchema,
181
+ container: RegistryUrlConfigSchema
182
+ }).default({}).describe("A list of remote registry URLs used by Storm Software");
183
+ var ColorConfigSchema = SingleThemeColorConfigSchema.or(MultiThemeColorConfigSchema).describe("Colors used for various workspace elements");
184
+ var ColorConfigMapSchema = _zod2.default.union([
185
+ _zod2.default.object({
186
+ "base": ColorConfigSchema
187
+ }),
188
+ _zod2.default.record(_zod2.default.string(), ColorConfigSchema)
189
+ ]);
190
+ var WorkspaceBotConfigSchema = _zod2.default.object({
191
+ name: _zod2.default.string().trim().default("Stormie-Bot").describe("The workspace bot user's name (this is the bot that will be used to perform various tasks)"),
192
+ email: _zod2.default.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
193
+ }).describe("The workspace's bot user's config used to automated various operations tasks");
194
+ var WorkspaceDirectoryConfigSchema = _zod2.default.object({
195
+ cache: _zod2.default.string().trim().optional().describe("The directory used to store the environment's cached file data"),
196
+ data: _zod2.default.string().trim().optional().describe("The directory used to store the environment's data files"),
197
+ config: _zod2.default.string().trim().optional().describe("The directory used to store the environment's configuration files"),
198
+ temp: _zod2.default.string().trim().optional().describe("The directory used to store the environment's temp files"),
199
+ log: _zod2.default.string().trim().optional().describe("The directory used to store the environment's temp files"),
200
+ build: _zod2.default.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
201
+ }).describe("Various directories used by the workspace to store data, cache, and configuration files");
202
+ var StormConfigSchema = _zod2.default.object({
203
+ $schema: _zod2.default.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
204
+ extends: _zod2.default.string().trim().optional().describe("The path to a base JSON file to use as a configuration preset file"),
205
+ name: _zod2.default.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
206
+ namespace: _zod2.default.string().trim().toLowerCase().optional().describe("The namespace of the package"),
207
+ organization: _zod2.default.string().trim().default("storm-software").describe("The organization of the workspace"),
208
+ repository: _zod2.default.string().trim().url().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
209
+ license: _zod2.default.string().trim().default("Apache-2.0").describe("The license type of the package"),
210
+ homepage: _zod2.default.string().trim().url().default(STORM_DEFAULT_HOMEPAGE).describe("The homepage of the workspace"),
211
+ docs: _zod2.default.string().trim().url().default(STORM_DEFAULT_DOCS).describe("The base documentation site for the workspace"),
212
+ licensing: _zod2.default.string().trim().url().default(STORM_DEFAULT_LICENSING).describe("The base licensing site for the workspace"),
213
+ branch: _zod2.default.string().trim().default("main").describe("The branch of the workspace"),
214
+ preid: _zod2.default.string().optional().describe("A tag specifying the version pre-release identifier"),
215
+ owner: _zod2.default.string().trim().default("@storm-software/admin").describe("The owner of the package"),
216
+ bot: WorkspaceBotConfigSchema,
217
+ env: _zod2.default.enum([
218
+ "development",
219
+ "staging",
220
+ "production"
221
+ ]).default("production").describe("The current runtime environment name for the package"),
222
+ workspaceRoot: _zod2.default.string().trim().default("").describe("The root directory of the workspace"),
223
+ externalPackagePatterns: _zod2.default.array(_zod2.default.string()).default([]).describe("The build will use these package patterns to determine if they should be external to the bundle"),
224
+ skipCache: _zod2.default.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
225
+ directories: WorkspaceDirectoryConfigSchema,
226
+ packageManager: _zod2.default.enum([
227
+ "npm",
228
+ "yarn",
229
+ "pnpm",
230
+ "bun"
231
+ ]).default("npm").describe("The JavaScript/TypeScript package manager used by the repository"),
232
+ timezone: _zod2.default.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
233
+ locale: _zod2.default.string().trim().default("en-US").describe("The default locale of the workspace"),
234
+ logLevel: _zod2.default.enum([
235
+ "silent",
236
+ "fatal",
237
+ "error",
238
+ "warn",
239
+ "info",
240
+ "debug",
241
+ "trace",
242
+ "all"
243
+ ]).default("info").describe("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`)."),
244
+ registry: RegistryConfigSchema,
245
+ configFile: _zod2.default.string().trim().nullable().default(null).describe("The filepath of the Storm config. When this field is null, no config file was found in the current workspace."),
246
+ colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
247
+ extensions: _zod2.default.record(_zod2.default.any()).optional().default({}).describe("Configuration of each used extension")
248
+ }).describe("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.");
249
+
250
+ // ../config/src/types.ts
251
+ var COLOR_KEYS = [
252
+ "dark",
253
+ "light",
254
+ "base",
255
+ "brand",
256
+ "alternate",
257
+ "accent",
258
+ "link",
259
+ "success",
260
+ "help",
261
+ "info",
262
+ "warning",
263
+ "danger",
264
+ "fatal",
265
+ "positive",
266
+ "negative"
267
+ ];
268
+
269
+ // ../config-tools/src/utilities/get-default-config.ts
270
+ var _fs = require('fs');
271
+ var _path = require('path');
272
+
273
+ // ../config-tools/src/utilities/find-up.ts
274
+
275
+
276
+ var MAX_PATH_SEARCH_DEPTH = 30;
277
+ var depth = 0;
278
+ function findFolderUp(startPath, endFileNames) {
279
+ const _startPath = _nullishCoalesce(startPath, () => ( process.cwd()));
280
+ if (endFileNames.some((endFileName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endFileName)))) {
281
+ return _startPath;
282
+ }
283
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
284
+ const parent = _path.join.call(void 0, _startPath, "..");
285
+ return findFolderUp(parent, endFileNames);
286
+ }
287
+ return void 0;
288
+ }
289
+ _chunkBGYQAVKQcjs.__name.call(void 0, findFolderUp, "findFolderUp");
290
+
291
+ // ../config-tools/src/utilities/find-workspace-root.ts
292
+ var rootFiles = [
293
+ "storm.json",
294
+ "storm.json",
295
+ "storm.yaml",
296
+ "storm.yml",
297
+ "storm.js",
298
+ "storm.ts",
299
+ ".storm.json",
300
+ ".storm.yaml",
301
+ ".storm.yml",
302
+ ".storm.js",
303
+ ".storm.ts",
304
+ "lerna.json",
305
+ "nx.json",
306
+ "turbo.json",
307
+ "npm-workspace.json",
308
+ "yarn-workspace.json",
309
+ "pnpm-workspace.json",
310
+ "npm-workspace.yaml",
311
+ "yarn-workspace.yaml",
312
+ "pnpm-workspace.yaml",
313
+ "npm-workspace.yml",
314
+ "yarn-workspace.yml",
315
+ "pnpm-workspace.yml",
316
+ "npm-lock.json",
317
+ "yarn-lock.json",
318
+ "pnpm-lock.json",
319
+ "npm-lock.yaml",
320
+ "yarn-lock.yaml",
321
+ "pnpm-lock.yaml",
322
+ "npm-lock.yml",
323
+ "yarn-lock.yml",
324
+ "pnpm-lock.yml",
325
+ "bun.lockb"
326
+ ];
327
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
328
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
329
+ return correctPaths(_nullishCoalesce(process.env.STORM_WORKSPACE_ROOT, () => ( process.env.NX_WORKSPACE_ROOT_PATH)));
330
+ }
331
+ return correctPaths(findFolderUp(_nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())), rootFiles));
332
+ }
333
+ _chunkBGYQAVKQcjs.__name.call(void 0, findWorkspaceRootSafe, "findWorkspaceRootSafe");
334
+ function findWorkspaceRoot(pathInsideMonorepo) {
335
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
336
+ if (!result) {
337
+ throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
338
+ ${rootFiles.join("\n")}
339
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`);
340
+ }
341
+ return result;
342
+ }
343
+ _chunkBGYQAVKQcjs.__name.call(void 0, findWorkspaceRoot, "findWorkspaceRoot");
344
+
345
+ // ../config-tools/src/utilities/get-default-config.ts
346
+ var DEFAULT_COLOR_CONFIG = {
347
+ "light": {
348
+ "background": "#fafafa",
349
+ "foreground": "#1d1e22",
350
+ "brand": "#1fb2a6",
351
+ "alternate": "#db2777",
352
+ "help": "#5C4EE5",
353
+ "success": "#087f5b",
354
+ "info": "#0550ae",
355
+ "warning": "#e3b341",
356
+ "danger": "#D8314A",
357
+ "positive": "#22c55e",
358
+ "negative": "#dc2626"
359
+ },
360
+ "dark": {
361
+ "background": "#1d1e22",
362
+ "foreground": "#cbd5e1",
363
+ "brand": "#2dd4bf",
364
+ "alternate": "#db2777",
365
+ "help": "#818cf8",
366
+ "success": "#10b981",
367
+ "info": "#58a6ff",
368
+ "warning": "#f3d371",
369
+ "danger": "#D8314A",
370
+ "positive": "#22c55e",
371
+ "negative": "#dc2626"
372
+ }
373
+ };
374
+ var getDefaultConfig = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (root) => {
375
+ let license = STORM_DEFAULT_LICENSE;
376
+ let homepage = STORM_DEFAULT_HOMEPAGE;
377
+ let name;
378
+ let namespace;
379
+ let repository;
380
+ const workspaceRoot = findWorkspaceRoot(root);
381
+ if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"))) {
382
+ const file = _fs.readFileSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"), {
383
+ encoding: "utf8"
384
+ });
385
+ if (file) {
386
+ const packageJson = JSON.parse(file);
387
+ if (packageJson.name) {
388
+ name = packageJson.name;
389
+ }
390
+ if (packageJson.namespace) {
391
+ namespace = packageJson.namespace;
392
+ }
393
+ if (_optionalChain([packageJson, 'access', _2 => _2.repository, 'optionalAccess', _3 => _3.url])) {
394
+ repository = _optionalChain([packageJson, 'access', _4 => _4.repository, 'optionalAccess', _5 => _5.url]);
395
+ }
396
+ if (packageJson.license) {
397
+ license = packageJson.license;
398
+ }
399
+ if (packageJson.homepage) {
400
+ homepage = packageJson.homepage;
401
+ }
402
+ }
403
+ }
404
+ return {
405
+ workspaceRoot,
406
+ name,
407
+ namespace,
408
+ repository,
409
+ license,
410
+ homepage,
411
+ docs: `${homepage || STORM_DEFAULT_HOMEPAGE}/docs`,
412
+ licensing: `${homepage || STORM_DEFAULT_HOMEPAGE}/license`
413
+ };
414
+ }, "getDefaultConfig");
415
+
416
+ // ../config-tools/src/logger/chalk.ts
417
+ var _chalk2 = require('chalk'); var _chalk3 = _interopRequireDefault(_chalk2);
418
+ var chalkDefault = {
419
+ hex: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (_) => (message) => message, "hex"),
420
+ bgHex: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (_) => ({
421
+ whiteBright: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message) => message, "whiteBright")
422
+ }), "bgHex"),
423
+ whiteBright: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message) => message, "whiteBright"),
424
+ bold: {
425
+ hex: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (_) => (message) => message, "hex"),
426
+ bgHex: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (_) => ({
427
+ whiteBright: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message) => message, "whiteBright")
428
+ }), "bgHex"),
429
+ whiteBright: /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message) => message, "whiteBright")
430
+ }
431
+ };
432
+ var getChalk = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, () => {
433
+ let _chalk = _chalk3.default;
434
+ if (!_optionalChain([_chalk, 'optionalAccess', _6 => _6.hex]) || !_optionalChain([_chalk, 'optionalAccess', _7 => _7.bold, 'optionalAccess', _8 => _8.hex]) || !_optionalChain([_chalk, 'optionalAccess', _9 => _9.bgHex]) || !_optionalChain([_chalk, 'optionalAccess', _10 => _10.whiteBright])) {
435
+ _chalk = chalkDefault;
436
+ }
437
+ return _chalk;
438
+ }, "getChalk");
439
+
440
+ // ../config-tools/src/logger/console.ts
441
+ var getLogFn = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (logLevel = LogLevel.INFO, config = {}) => {
442
+ const _chalk = getChalk();
443
+ const colors = !_optionalChain([config, 'access', _11 => _11.colors, 'optionalAccess', _12 => _12.dark]) && !_optionalChain([config, 'access', _13 => _13.colors, 'optionalAccess', _14 => _14["base"]]) && !_optionalChain([config, 'access', _15 => _15.colors, 'optionalAccess', _16 => _16["base"], 'optionalAccess', _17 => _17.dark]) ? DEFAULT_COLOR_CONFIG : _optionalChain([config, 'access', _18 => _18.colors, 'optionalAccess', _19 => _19.dark]) && typeof config.colors.dark === "string" ? config.colors : _optionalChain([config, 'access', _20 => _20.colors, 'optionalAccess', _21 => _21["base"], 'optionalAccess', _22 => _22.dark]) && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : _optionalChain([config, 'access', _23 => _23.colors, 'optionalAccess', _24 => _24["base"]]) ? _optionalChain([config, 'access', _25 => _25.colors, 'optionalAccess', _26 => _26["base"]]) : DEFAULT_COLOR_CONFIG;
444
+ const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
445
+ if (typeof logLevel === "number" && (logLevel >= getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(configLogLevel)) {
446
+ return (_) => {
447
+ };
448
+ }
449
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
450
+ return (message) => {
451
+ console.error(`${_chalk.bold.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a"))).whiteBright(" \u{1F480} Fatal ")} ${_chalk.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(formatLogMessage(message))}
452
+ `);
453
+ };
454
+ }
455
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
456
+ return (message) => {
457
+ console.error(`${_chalk.bold.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.danger, () => ( "#f85149"))).whiteBright(" \u2718 Error ")} ${_chalk.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(formatLogMessage(message))}
458
+ `);
459
+ };
460
+ }
461
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
462
+ return (message) => {
463
+ console.warn(`${_chalk.bold.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.warning, () => ( "#e3b341"))).whiteBright(" \u26A0 Warn ")} ${_chalk.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(formatLogMessage(message))}
464
+ `);
465
+ };
466
+ }
467
+ if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel || typeof logLevel === "string" && LogLevel.SUCCESS >= getLogLevel(logLevel)) {
468
+ return (message) => {
469
+ console.info(`${_chalk.bold.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.success, () => ( "#56d364"))).whiteBright(" \u2713 Success ")} ${_chalk.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(formatLogMessage(message))}
470
+ `);
471
+ };
472
+ }
473
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
474
+ return (message) => {
475
+ console.info(`${_chalk.bold.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.info, () => ( "#58a6ff"))).whiteBright(" \u2139 Info ")} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(formatLogMessage(message))}
476
+ `);
477
+ };
478
+ }
479
+ if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel || typeof logLevel === "string" && LogLevel.TRACE >= getLogLevel(logLevel)) {
480
+ return (message) => {
481
+ console.debug(`${_chalk.bold.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6"))).whiteBright(" \u{1F6E0} Debug ")} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(formatLogMessage(message))}
482
+ `);
483
+ };
484
+ }
485
+ return (message) => {
486
+ console.log(`${_chalk.bold.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(">")} ${_chalk.bold.bgHex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6"))).whiteBright(" \u2709 System ")} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(formatLogMessage(message))}
487
+ `);
488
+ };
489
+ }, "getLogFn");
490
+ var writeFatal = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.FATAL, config)(message), "writeFatal");
491
+ var writeError = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.ERROR, config)(message), "writeError");
492
+ var writeWarning = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.WARN, config)(message), "writeWarning");
493
+ var writeInfo = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.INFO, config)(message), "writeInfo");
494
+ var writeSuccess = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
495
+ var writeDebug = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
496
+ var writeTrace = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
497
+ var writeSystem = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
498
+ var getStopwatch = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (name) => {
499
+ const start = process.hrtime();
500
+ return () => {
501
+ const end = process.hrtime(start);
502
+ console.info(`
503
+ > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(end[0] * 1e3 + end[1] / 1e6)}ms to complete
504
+
505
+ `);
506
+ };
507
+ }, "getStopwatch");
508
+ var MAX_DEPTH = 4;
509
+ var formatLogMessage = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (message, options = {}, depth2 = 0) => {
510
+ if (depth2 > MAX_DEPTH) {
511
+ return "<max depth>";
512
+ }
513
+ const prefix = _nullishCoalesce(options.prefix, () => ( "-"));
514
+ const skip = _nullishCoalesce(options.skip, () => ( []));
515
+ return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
516
+ ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
517
+ prefix: `${prefix}-`,
518
+ skip
519
+ }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
520
+ ${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
521
+ prefix: `${prefix}-`,
522
+ skip
523
+ }, depth2 + 1) : message[key]}`).join("\n")}` : message;
524
+ }, "formatLogMessage");
525
+ var _isFunction = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (value) => {
526
+ try {
527
+ return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _27 => _27.constructor]) && _optionalChain([value, 'optionalAccess', _28 => _28.call]) && _optionalChain([value, 'optionalAccess', _29 => _29.apply]));
528
+ } catch (e) {
529
+ return false;
530
+ }
531
+ }, "_isFunction");
532
+
533
+
534
+
535
+
536
+
537
+
538
+
539
+
540
+
541
+
542
+
543
+
544
+
545
+
546
+
547
+
548
+
549
+
550
+
551
+
552
+
553
+
554
+
555
+
556
+
557
+ exports.LogLevel = LogLevel; exports.LogLevelLabel = LogLevelLabel; exports.STORM_DEFAULT_DOCS = STORM_DEFAULT_DOCS; exports.STORM_DEFAULT_HOMEPAGE = STORM_DEFAULT_HOMEPAGE; exports.STORM_DEFAULT_LICENSING = STORM_DEFAULT_LICENSING; exports.COLOR_KEYS = COLOR_KEYS; exports.correctPaths = correctPaths; exports.joinPaths = joinPaths; exports.findWorkspaceRoot = findWorkspaceRoot; exports.getDefaultConfig = getDefaultConfig; exports.getLogLevel = getLogLevel; exports.getLogLevelLabel = getLogLevelLabel; exports.isVerbose = isVerbose; exports.writeFatal = writeFatal; exports.writeError = writeError; exports.writeWarning = writeWarning; exports.writeInfo = writeInfo; exports.writeSuccess = writeSuccess; exports.writeDebug = writeDebug; exports.writeTrace = writeTrace; exports.writeSystem = writeSystem; exports.getStopwatch = getStopwatch; exports.formatLogMessage = formatLogMessage;
@@ -0,0 +1,65 @@
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(); } }
2
+
3
+ var _chunkDWREBCC4cjs = require('./chunk-DWREBCC4.cjs');
4
+
5
+
6
+ var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
7
+
8
+ // src/plugins/tsc.ts
9
+ var _devkit = require('@nx/devkit');
10
+ var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
11
+ var _compilerhelperdependency = require('@nx/js/src/utils/compiler-helper-dependency');
12
+ var _rollupplugintypescript2 = require('rollup-plugin-typescript2'); var _rollupplugintypescript22 = _interopRequireDefault(_rollupplugintypescript2);
13
+
14
+ // src/utilities/helpers.ts
15
+
16
+
17
+ var _path = require('path');
18
+ var _url = require('url');
19
+ var _typescript = require('typescript'); var _typescript2 = _interopRequireDefault(_typescript);
20
+ async function loadConfig(configPath) {
21
+ if (!/\.(js|mjs)$/.test(_path.extname.call(void 0, configPath))) {
22
+ throw new Error("Unsupported config file format");
23
+ }
24
+ return Promise.resolve().then(() => _interopRequireWildcard(require(_url.pathToFileURL.call(void 0, configPath).toString()))).then((config) => config.default);
25
+ }
26
+ _chunkBGYQAVKQcjs.__name.call(void 0, loadConfig, "loadConfig");
27
+ async function createTsCompilerOptions(config, tsConfigPath, projectRoot, dependencies) {
28
+ const tsConfigFile = _typescript2.default.readConfigFile(_devkit.joinPathFragments.call(void 0, config.workspaceRoot, projectRoot, tsConfigPath), _typescript2.default.sys.readFile);
29
+ const tsConfig = _typescript2.default.parseJsonConfigFileContent(tsConfigFile.config, _typescript2.default.sys, _path.dirname.call(void 0, _devkit.joinPathFragments.call(void 0, config.workspaceRoot, projectRoot, tsConfigPath)));
30
+ const compilerOptions = {
31
+ rootDir: projectRoot,
32
+ declaration: true,
33
+ paths: _buildablelibsutils.computeCompilerOptionsPaths.call(void 0, tsConfig, _nullishCoalesce(dependencies, () => ( [])))
34
+ };
35
+ _chunkDWREBCC4cjs.writeTrace.call(void 0, compilerOptions, config);
36
+ return compilerOptions;
37
+ }
38
+ _chunkBGYQAVKQcjs.__name.call(void 0, createTsCompilerOptions, "createTsCompilerOptions");
39
+
40
+ // src/plugins/tsc.ts
41
+ var tscPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (options, resolvedOptions) => {
42
+ const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
43
+ exitOnError: true
44
+ });
45
+ const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, resolvedOptions.config.workspaceRoot, resolvedOptions.projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
46
+ let dependencies = result.dependencies;
47
+ const tsLibDependency = _compilerhelperdependency.getHelperDependency.call(void 0, _compilerhelperdependency.HelperDependency.tsc, resolvedOptions.tsconfig, dependencies, projectGraph, true);
48
+ if (tsLibDependency) {
49
+ dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
50
+ dependencies.push(tsLibDependency);
51
+ }
52
+ return _rollupplugintypescript22.default.call(void 0, {
53
+ check: options.emitTypes !== false,
54
+ tsconfig: resolvedOptions.tsconfig,
55
+ tsconfigOverride: {
56
+ compilerOptions: await createTsCompilerOptions(resolvedOptions.config, resolvedOptions.tsconfig, resolvedOptions.projectRoot, dependencies)
57
+ }
58
+ });
59
+ }, "tscPlugin");
60
+
61
+
62
+
63
+
64
+
65
+ exports.loadConfig = loadConfig; exports.createTsCompilerOptions = createTsCompilerOptions; exports.tscPlugin = tscPlugin;
@@ -0,0 +1,21 @@
1
+ import {
2
+ getStopwatch,
3
+ writeDebug
4
+ } from "./chunk-P5CSSAMQ.js";
5
+ import {
6
+ __name
7
+ } from "./chunk-3GQAWCBQ.js";
8
+
9
+ // src/clean.ts
10
+ import { hfs } from "@humanfs/node";
11
+ async function clean(name = "Unbuild", directory, config) {
12
+ writeDebug(` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
13
+ const stopwatch = getStopwatch(`${name} output clean`);
14
+ await hfs.deleteAll(directory);
15
+ stopwatch();
16
+ }
17
+ __name(clean, "clean");
18
+
19
+ export {
20
+ clean
21
+ };
File without changes