@storm-software/workspace-tools 1.31.16 → 1.32.0

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.
@@ -112513,6 +112513,195 @@ var LogLevelLabel = {
112513
112513
  TRACE: "trace"
112514
112514
  };
112515
112515
 
112516
+ // node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
112517
+ var import_node_process = __toESM(require("node:process"), 1);
112518
+ var import_node_path = __toESM(require("node:path"), 1);
112519
+ var import_node_fs = __toESM(require("node:fs"), 1);
112520
+ var import_node_url = require("node:url");
112521
+
112522
+ // node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
112523
+ var Node = class {
112524
+ value;
112525
+ next;
112526
+ constructor(value) {
112527
+ this.value = value;
112528
+ }
112529
+ };
112530
+ var Queue = class {
112531
+ #head;
112532
+ #tail;
112533
+ #size;
112534
+ constructor() {
112535
+ this.clear();
112536
+ }
112537
+ enqueue(value) {
112538
+ const node = new Node(value);
112539
+ if (this.#head) {
112540
+ this.#tail.next = node;
112541
+ this.#tail = node;
112542
+ } else {
112543
+ this.#head = node;
112544
+ this.#tail = node;
112545
+ }
112546
+ this.#size++;
112547
+ }
112548
+ dequeue() {
112549
+ const current = this.#head;
112550
+ if (!current) {
112551
+ return;
112552
+ }
112553
+ this.#head = this.#head.next;
112554
+ this.#size--;
112555
+ return current.value;
112556
+ }
112557
+ clear() {
112558
+ this.#head = void 0;
112559
+ this.#tail = void 0;
112560
+ this.#size = 0;
112561
+ }
112562
+ get size() {
112563
+ return this.#size;
112564
+ }
112565
+ *[Symbol.iterator]() {
112566
+ let current = this.#head;
112567
+ while (current) {
112568
+ yield current.value;
112569
+ current = current.next;
112570
+ }
112571
+ }
112572
+ };
112573
+
112574
+ // node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
112575
+ var typeMappings = {
112576
+ directory: "isDirectory",
112577
+ file: "isFile"
112578
+ };
112579
+ function checkType(type) {
112580
+ if (Object.hasOwnProperty.call(typeMappings, type)) {
112581
+ return;
112582
+ }
112583
+ throw new Error(`Invalid type specified: ${type}`);
112584
+ }
112585
+ var matchType = (type, stat) => stat[typeMappings[type]]();
112586
+ var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
112587
+ function locatePathSync(paths, {
112588
+ cwd = import_node_process.default.cwd(),
112589
+ type = "file",
112590
+ allowSymlinks = true
112591
+ } = {}) {
112592
+ checkType(type);
112593
+ cwd = toPath(cwd);
112594
+ const statFunction = allowSymlinks ? import_node_fs.default.statSync : import_node_fs.default.lstatSync;
112595
+ for (const path_ of paths) {
112596
+ try {
112597
+ const stat = statFunction(import_node_path.default.resolve(cwd, path_), {
112598
+ throwIfNoEntry: false
112599
+ });
112600
+ if (!stat) {
112601
+ continue;
112602
+ }
112603
+ if (matchType(type, stat)) {
112604
+ return path_;
112605
+ }
112606
+ } catch {
112607
+ }
112608
+ }
112609
+ }
112610
+
112611
+ // packages/config-tools/src/utilities/find-up.ts
112612
+ var path3 = __toESM(require("path"), 1);
112613
+ var import_url3 = require("url");
112614
+ var findUpStop = Symbol("findUpStop");
112615
+ function toPath2(urlOrPath) {
112616
+ return urlOrPath instanceof URL ? (0, import_url3.fileURLToPath)(urlOrPath) : urlOrPath;
112617
+ }
112618
+ function findUpMultipleSync(names, options = { limit: 1, type: "file" }) {
112619
+ let directory = path3.resolve(toPath2(options.cwd) ?? "");
112620
+ const { root } = path3.parse(directory);
112621
+ const stopAt = path3.resolve(directory, toPath2(options.stopAt) ?? root);
112622
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
112623
+ if (typeof names === "function") {
112624
+ const foundPath = names(options.cwd);
112625
+ return locatePathSync([foundPath], options);
112626
+ }
112627
+ const runNameMatcher = (name) => {
112628
+ const paths = [name].flat();
112629
+ const runMatcher = (locateOptions) => {
112630
+ if (typeof name !== "function") {
112631
+ return locatePathSync(paths, locateOptions);
112632
+ }
112633
+ const foundPath = name(locateOptions.cwd);
112634
+ if (typeof foundPath === "string") {
112635
+ return locatePathSync([foundPath], locateOptions);
112636
+ }
112637
+ return foundPath;
112638
+ };
112639
+ const matches = [];
112640
+ while (true) {
112641
+ const foundPath = runMatcher({ ...options, cwd: directory });
112642
+ if (foundPath) {
112643
+ matches.push(path3.resolve(directory, foundPath));
112644
+ }
112645
+ if (directory === stopAt || matches.length >= limit) {
112646
+ break;
112647
+ }
112648
+ directory = path3.dirname(directory);
112649
+ }
112650
+ return matches;
112651
+ };
112652
+ return (names && Array.isArray(names) ? names : [names]).map((name) => runNameMatcher(name)).flat();
112653
+ }
112654
+ function findUpSync(names, options = { limit: 1, type: "file" }) {
112655
+ const matches = findUpMultipleSync(names, options);
112656
+ return matches[0];
112657
+ }
112658
+
112659
+ // packages/config-tools/src/utilities/find-workspace-root.ts
112660
+ var rootFiles = [
112661
+ "lerna.json",
112662
+ "nx.json",
112663
+ "turbo.json",
112664
+ "npm-workspace.json",
112665
+ "yarn-workspace.json",
112666
+ "pnpm-workspace.json",
112667
+ "npm-workspace.yaml",
112668
+ "yarn-workspace.yaml",
112669
+ "pnpm-workspace.yaml",
112670
+ "npm-workspace.yml",
112671
+ "yarn-workspace.yml",
112672
+ "pnpm-workspace.yml",
112673
+ "npm-lock.json",
112674
+ "yarn-lock.json",
112675
+ "pnpm-lock.json",
112676
+ "npm-lock.yaml",
112677
+ "yarn-lock.yaml",
112678
+ "pnpm-lock.yaml",
112679
+ "npm-lock.yml",
112680
+ "yarn-lock.yml",
112681
+ "pnpm-lock.yml",
112682
+ "bun.lockb"
112683
+ ];
112684
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
112685
+ return process.env.STORM_WORKSPACE_ROOT ? process.env.STORM_WORKSPACE_ROOT : process.env.NX_WORKSPACE_ROOT_PATH ? process.env.NX_WORKSPACE_ROOT_PATH : findUpSync(rootFiles, {
112686
+ cwd: pathInsideMonorepo ?? process.cwd(),
112687
+ type: "file",
112688
+ limit: 1
112689
+ });
112690
+ }
112691
+ function findWorkspaceRoot(pathInsideMonorepo) {
112692
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
112693
+ if (!result) {
112694
+ throw new Error(
112695
+ `Cannot find workspace root upwards from known path. Files search list includes:
112696
+ ${rootFiles.join(
112697
+ "\n"
112698
+ )}
112699
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
112700
+ );
112701
+ }
112702
+ return result;
112703
+ }
112704
+
112516
112705
  // packages/config-tools/src/utilities/get-default-config.ts
112517
112706
  var import_fs2 = require("fs");
112518
112707
  var import_path2 = require("path");
@@ -116149,192 +116338,6 @@ var StormConfigSchema = objectType({
116149
116338
  "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."
116150
116339
  );
116151
116340
 
116152
- // node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
116153
- var import_node_process = __toESM(require("node:process"), 1);
116154
- var import_node_path = __toESM(require("node:path"), 1);
116155
- var import_node_fs = __toESM(require("node:fs"), 1);
116156
- var import_node_url = require("node:url");
116157
-
116158
- // node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
116159
- var Node = class {
116160
- value;
116161
- next;
116162
- constructor(value) {
116163
- this.value = value;
116164
- }
116165
- };
116166
- var Queue = class {
116167
- #head;
116168
- #tail;
116169
- #size;
116170
- constructor() {
116171
- this.clear();
116172
- }
116173
- enqueue(value) {
116174
- const node = new Node(value);
116175
- if (this.#head) {
116176
- this.#tail.next = node;
116177
- this.#tail = node;
116178
- } else {
116179
- this.#head = node;
116180
- this.#tail = node;
116181
- }
116182
- this.#size++;
116183
- }
116184
- dequeue() {
116185
- const current = this.#head;
116186
- if (!current) {
116187
- return;
116188
- }
116189
- this.#head = this.#head.next;
116190
- this.#size--;
116191
- return current.value;
116192
- }
116193
- clear() {
116194
- this.#head = void 0;
116195
- this.#tail = void 0;
116196
- this.#size = 0;
116197
- }
116198
- get size() {
116199
- return this.#size;
116200
- }
116201
- *[Symbol.iterator]() {
116202
- let current = this.#head;
116203
- while (current) {
116204
- yield current.value;
116205
- current = current.next;
116206
- }
116207
- }
116208
- };
116209
-
116210
- // node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
116211
- var typeMappings = {
116212
- directory: "isDirectory",
116213
- file: "isFile"
116214
- };
116215
- function checkType(type) {
116216
- if (Object.hasOwnProperty.call(typeMappings, type)) {
116217
- return;
116218
- }
116219
- throw new Error(`Invalid type specified: ${type}`);
116220
- }
116221
- var matchType = (type, stat) => stat[typeMappings[type]]();
116222
- var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
116223
- function locatePathSync(paths, {
116224
- cwd = import_node_process.default.cwd(),
116225
- type = "file",
116226
- allowSymlinks = true
116227
- } = {}) {
116228
- checkType(type);
116229
- cwd = toPath(cwd);
116230
- const statFunction = allowSymlinks ? import_node_fs.default.statSync : import_node_fs.default.lstatSync;
116231
- for (const path_ of paths) {
116232
- try {
116233
- const stat = statFunction(import_node_path.default.resolve(cwd, path_), {
116234
- throwIfNoEntry: false
116235
- });
116236
- if (!stat) {
116237
- continue;
116238
- }
116239
- if (matchType(type, stat)) {
116240
- return path_;
116241
- }
116242
- } catch {
116243
- }
116244
- }
116245
- }
116246
-
116247
- // packages/config-tools/src/utilities/find-up.ts
116248
- var path3 = __toESM(require("path"), 1);
116249
- var import_url3 = require("url");
116250
- var findUpStop = Symbol("findUpStop");
116251
- function toPath2(urlOrPath) {
116252
- return urlOrPath instanceof URL ? (0, import_url3.fileURLToPath)(urlOrPath) : urlOrPath;
116253
- }
116254
- function findUpMultipleSync(names, options = { limit: 1, type: "file" }) {
116255
- let directory = path3.resolve(toPath2(options.cwd) ?? "");
116256
- const { root } = path3.parse(directory);
116257
- const stopAt = path3.resolve(directory, toPath2(options.stopAt) ?? root);
116258
- const limit = options.limit ?? Number.POSITIVE_INFINITY;
116259
- if (typeof names === "function") {
116260
- const foundPath = names(options.cwd);
116261
- return locatePathSync([foundPath], options);
116262
- }
116263
- const runNameMatcher = (name) => {
116264
- const paths = [name].flat();
116265
- const runMatcher = (locateOptions) => {
116266
- if (typeof name !== "function") {
116267
- return locatePathSync(paths, locateOptions);
116268
- }
116269
- const foundPath = name(locateOptions.cwd);
116270
- if (typeof foundPath === "string") {
116271
- return locatePathSync([foundPath], locateOptions);
116272
- }
116273
- return foundPath;
116274
- };
116275
- const matches = [];
116276
- while (true) {
116277
- const foundPath = runMatcher({ ...options, cwd: directory });
116278
- if (foundPath) {
116279
- matches.push(path3.resolve(directory, foundPath));
116280
- }
116281
- if (directory === stopAt || matches.length >= limit) {
116282
- break;
116283
- }
116284
- directory = path3.dirname(directory);
116285
- }
116286
- return matches;
116287
- };
116288
- return (names && Array.isArray(names) ? names : [names]).map((name) => runNameMatcher(name)).flat();
116289
- }
116290
- function findUpSync(names, options = { limit: 1, type: "file" }) {
116291
- const matches = findUpMultipleSync(names, options);
116292
- return matches[0];
116293
- }
116294
-
116295
- // packages/config-tools/src/utilities/find-workspace-root.ts
116296
- var rootFiles = [
116297
- "lerna.json",
116298
- "nx.json",
116299
- "turbo.json",
116300
- "npm-workspace.json",
116301
- "yarn-workspace.json",
116302
- "pnpm-workspace.json",
116303
- "npm-workspace.yaml",
116304
- "yarn-workspace.yaml",
116305
- "pnpm-workspace.yaml",
116306
- "npm-workspace.yml",
116307
- "yarn-workspace.yml",
116308
- "pnpm-workspace.yml",
116309
- "npm-lock.json",
116310
- "yarn-lock.json",
116311
- "pnpm-lock.json",
116312
- "npm-lock.yaml",
116313
- "yarn-lock.yaml",
116314
- "pnpm-lock.yaml",
116315
- "npm-lock.yml",
116316
- "yarn-lock.yml",
116317
- "pnpm-lock.yml",
116318
- "bun.lockb"
116319
- ];
116320
- function findWorkspaceRoot(pathInsideMonorepo) {
116321
- const result = process.env.STORM_WORKSPACE_ROOT ? process.env.STORM_WORKSPACE_ROOT : process.env.NX_WORKSPACE_ROOT_PATH ? process.env.NX_WORKSPACE_ROOT_PATH : findUpSync(rootFiles, {
116322
- cwd: pathInsideMonorepo ?? process.cwd(),
116323
- type: "file",
116324
- limit: 1
116325
- });
116326
- if (!result) {
116327
- throw new Error(
116328
- `Cannot find workspace root upwards from known path. Files search list includes:
116329
- ${rootFiles.join(
116330
- "\n"
116331
- )}
116332
- Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
116333
- );
116334
- }
116335
- return result;
116336
- }
116337
-
116338
116341
  // packages/config-tools/src/utilities/get-default-config.ts
116339
116342
  var DefaultColorConfig = {
116340
116343
  primary: "#1fb2a6",