@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.
@@ -26319,6 +26319,195 @@ var LogLevelLabel = {
26319
26319
  TRACE: "trace"
26320
26320
  };
26321
26321
 
26322
+ // node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
26323
+ var import_node_process = __toESM(require("node:process"), 1);
26324
+ var import_node_path = __toESM(require("node:path"), 1);
26325
+ var import_node_fs = __toESM(require("node:fs"), 1);
26326
+ var import_node_url = require("node:url");
26327
+
26328
+ // node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
26329
+ var Node = class {
26330
+ value;
26331
+ next;
26332
+ constructor(value) {
26333
+ this.value = value;
26334
+ }
26335
+ };
26336
+ var Queue = class {
26337
+ #head;
26338
+ #tail;
26339
+ #size;
26340
+ constructor() {
26341
+ this.clear();
26342
+ }
26343
+ enqueue(value) {
26344
+ const node = new Node(value);
26345
+ if (this.#head) {
26346
+ this.#tail.next = node;
26347
+ this.#tail = node;
26348
+ } else {
26349
+ this.#head = node;
26350
+ this.#tail = node;
26351
+ }
26352
+ this.#size++;
26353
+ }
26354
+ dequeue() {
26355
+ const current = this.#head;
26356
+ if (!current) {
26357
+ return;
26358
+ }
26359
+ this.#head = this.#head.next;
26360
+ this.#size--;
26361
+ return current.value;
26362
+ }
26363
+ clear() {
26364
+ this.#head = void 0;
26365
+ this.#tail = void 0;
26366
+ this.#size = 0;
26367
+ }
26368
+ get size() {
26369
+ return this.#size;
26370
+ }
26371
+ *[Symbol.iterator]() {
26372
+ let current = this.#head;
26373
+ while (current) {
26374
+ yield current.value;
26375
+ current = current.next;
26376
+ }
26377
+ }
26378
+ };
26379
+
26380
+ // node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
26381
+ var typeMappings = {
26382
+ directory: "isDirectory",
26383
+ file: "isFile"
26384
+ };
26385
+ function checkType(type) {
26386
+ if (Object.hasOwnProperty.call(typeMappings, type)) {
26387
+ return;
26388
+ }
26389
+ throw new Error(`Invalid type specified: ${type}`);
26390
+ }
26391
+ var matchType = (type, stat) => stat[typeMappings[type]]();
26392
+ var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
26393
+ function locatePathSync(paths, {
26394
+ cwd = import_node_process.default.cwd(),
26395
+ type = "file",
26396
+ allowSymlinks = true
26397
+ } = {}) {
26398
+ checkType(type);
26399
+ cwd = toPath(cwd);
26400
+ const statFunction = allowSymlinks ? import_node_fs.default.statSync : import_node_fs.default.lstatSync;
26401
+ for (const path_ of paths) {
26402
+ try {
26403
+ const stat = statFunction(import_node_path.default.resolve(cwd, path_), {
26404
+ throwIfNoEntry: false
26405
+ });
26406
+ if (!stat) {
26407
+ continue;
26408
+ }
26409
+ if (matchType(type, stat)) {
26410
+ return path_;
26411
+ }
26412
+ } catch {
26413
+ }
26414
+ }
26415
+ }
26416
+
26417
+ // packages/config-tools/src/utilities/find-up.ts
26418
+ var path2 = __toESM(require("path"), 1);
26419
+ var import_url = require("url");
26420
+ var findUpStop = Symbol("findUpStop");
26421
+ function toPath2(urlOrPath) {
26422
+ return urlOrPath instanceof URL ? (0, import_url.fileURLToPath)(urlOrPath) : urlOrPath;
26423
+ }
26424
+ function findUpMultipleSync(names, options = { limit: 1, type: "file" }) {
26425
+ let directory = path2.resolve(toPath2(options.cwd) ?? "");
26426
+ const { root } = path2.parse(directory);
26427
+ const stopAt = path2.resolve(directory, toPath2(options.stopAt) ?? root);
26428
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
26429
+ if (typeof names === "function") {
26430
+ const foundPath = names(options.cwd);
26431
+ return locatePathSync([foundPath], options);
26432
+ }
26433
+ const runNameMatcher = (name) => {
26434
+ const paths = [name].flat();
26435
+ const runMatcher = (locateOptions) => {
26436
+ if (typeof name !== "function") {
26437
+ return locatePathSync(paths, locateOptions);
26438
+ }
26439
+ const foundPath = name(locateOptions.cwd);
26440
+ if (typeof foundPath === "string") {
26441
+ return locatePathSync([foundPath], locateOptions);
26442
+ }
26443
+ return foundPath;
26444
+ };
26445
+ const matches = [];
26446
+ while (true) {
26447
+ const foundPath = runMatcher({ ...options, cwd: directory });
26448
+ if (foundPath) {
26449
+ matches.push(path2.resolve(directory, foundPath));
26450
+ }
26451
+ if (directory === stopAt || matches.length >= limit) {
26452
+ break;
26453
+ }
26454
+ directory = path2.dirname(directory);
26455
+ }
26456
+ return matches;
26457
+ };
26458
+ return (names && Array.isArray(names) ? names : [names]).map((name) => runNameMatcher(name)).flat();
26459
+ }
26460
+ function findUpSync(names, options = { limit: 1, type: "file" }) {
26461
+ const matches = findUpMultipleSync(names, options);
26462
+ return matches[0];
26463
+ }
26464
+
26465
+ // packages/config-tools/src/utilities/find-workspace-root.ts
26466
+ var rootFiles = [
26467
+ "lerna.json",
26468
+ "nx.json",
26469
+ "turbo.json",
26470
+ "npm-workspace.json",
26471
+ "yarn-workspace.json",
26472
+ "pnpm-workspace.json",
26473
+ "npm-workspace.yaml",
26474
+ "yarn-workspace.yaml",
26475
+ "pnpm-workspace.yaml",
26476
+ "npm-workspace.yml",
26477
+ "yarn-workspace.yml",
26478
+ "pnpm-workspace.yml",
26479
+ "npm-lock.json",
26480
+ "yarn-lock.json",
26481
+ "pnpm-lock.json",
26482
+ "npm-lock.yaml",
26483
+ "yarn-lock.yaml",
26484
+ "pnpm-lock.yaml",
26485
+ "npm-lock.yml",
26486
+ "yarn-lock.yml",
26487
+ "pnpm-lock.yml",
26488
+ "bun.lockb"
26489
+ ];
26490
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
26491
+ 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, {
26492
+ cwd: pathInsideMonorepo ?? process.cwd(),
26493
+ type: "file",
26494
+ limit: 1
26495
+ });
26496
+ }
26497
+ function findWorkspaceRoot(pathInsideMonorepo) {
26498
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
26499
+ if (!result) {
26500
+ throw new Error(
26501
+ `Cannot find workspace root upwards from known path. Files search list includes:
26502
+ ${rootFiles.join(
26503
+ "\n"
26504
+ )}
26505
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
26506
+ );
26507
+ }
26508
+ return result;
26509
+ }
26510
+
26322
26511
  // packages/config-tools/src/utilities/get-default-config.ts
26323
26512
  var import_fs = require("fs");
26324
26513
  var import_path = require("path");
@@ -29955,192 +30144,6 @@ var StormConfigSchema = objectType({
29955
30144
  "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."
29956
30145
  );
29957
30146
 
29958
- // node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
29959
- var import_node_process = __toESM(require("node:process"), 1);
29960
- var import_node_path = __toESM(require("node:path"), 1);
29961
- var import_node_fs = __toESM(require("node:fs"), 1);
29962
- var import_node_url = require("node:url");
29963
-
29964
- // node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
29965
- var Node = class {
29966
- value;
29967
- next;
29968
- constructor(value) {
29969
- this.value = value;
29970
- }
29971
- };
29972
- var Queue = class {
29973
- #head;
29974
- #tail;
29975
- #size;
29976
- constructor() {
29977
- this.clear();
29978
- }
29979
- enqueue(value) {
29980
- const node = new Node(value);
29981
- if (this.#head) {
29982
- this.#tail.next = node;
29983
- this.#tail = node;
29984
- } else {
29985
- this.#head = node;
29986
- this.#tail = node;
29987
- }
29988
- this.#size++;
29989
- }
29990
- dequeue() {
29991
- const current = this.#head;
29992
- if (!current) {
29993
- return;
29994
- }
29995
- this.#head = this.#head.next;
29996
- this.#size--;
29997
- return current.value;
29998
- }
29999
- clear() {
30000
- this.#head = void 0;
30001
- this.#tail = void 0;
30002
- this.#size = 0;
30003
- }
30004
- get size() {
30005
- return this.#size;
30006
- }
30007
- *[Symbol.iterator]() {
30008
- let current = this.#head;
30009
- while (current) {
30010
- yield current.value;
30011
- current = current.next;
30012
- }
30013
- }
30014
- };
30015
-
30016
- // node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
30017
- var typeMappings = {
30018
- directory: "isDirectory",
30019
- file: "isFile"
30020
- };
30021
- function checkType(type) {
30022
- if (Object.hasOwnProperty.call(typeMappings, type)) {
30023
- return;
30024
- }
30025
- throw new Error(`Invalid type specified: ${type}`);
30026
- }
30027
- var matchType = (type, stat) => stat[typeMappings[type]]();
30028
- var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
30029
- function locatePathSync(paths, {
30030
- cwd = import_node_process.default.cwd(),
30031
- type = "file",
30032
- allowSymlinks = true
30033
- } = {}) {
30034
- checkType(type);
30035
- cwd = toPath(cwd);
30036
- const statFunction = allowSymlinks ? import_node_fs.default.statSync : import_node_fs.default.lstatSync;
30037
- for (const path_ of paths) {
30038
- try {
30039
- const stat = statFunction(import_node_path.default.resolve(cwd, path_), {
30040
- throwIfNoEntry: false
30041
- });
30042
- if (!stat) {
30043
- continue;
30044
- }
30045
- if (matchType(type, stat)) {
30046
- return path_;
30047
- }
30048
- } catch {
30049
- }
30050
- }
30051
- }
30052
-
30053
- // packages/config-tools/src/utilities/find-up.ts
30054
- var path2 = __toESM(require("path"), 1);
30055
- var import_url = require("url");
30056
- var findUpStop = Symbol("findUpStop");
30057
- function toPath2(urlOrPath) {
30058
- return urlOrPath instanceof URL ? (0, import_url.fileURLToPath)(urlOrPath) : urlOrPath;
30059
- }
30060
- function findUpMultipleSync(names, options = { limit: 1, type: "file" }) {
30061
- let directory = path2.resolve(toPath2(options.cwd) ?? "");
30062
- const { root } = path2.parse(directory);
30063
- const stopAt = path2.resolve(directory, toPath2(options.stopAt) ?? root);
30064
- const limit = options.limit ?? Number.POSITIVE_INFINITY;
30065
- if (typeof names === "function") {
30066
- const foundPath = names(options.cwd);
30067
- return locatePathSync([foundPath], options);
30068
- }
30069
- const runNameMatcher = (name) => {
30070
- const paths = [name].flat();
30071
- const runMatcher = (locateOptions) => {
30072
- if (typeof name !== "function") {
30073
- return locatePathSync(paths, locateOptions);
30074
- }
30075
- const foundPath = name(locateOptions.cwd);
30076
- if (typeof foundPath === "string") {
30077
- return locatePathSync([foundPath], locateOptions);
30078
- }
30079
- return foundPath;
30080
- };
30081
- const matches = [];
30082
- while (true) {
30083
- const foundPath = runMatcher({ ...options, cwd: directory });
30084
- if (foundPath) {
30085
- matches.push(path2.resolve(directory, foundPath));
30086
- }
30087
- if (directory === stopAt || matches.length >= limit) {
30088
- break;
30089
- }
30090
- directory = path2.dirname(directory);
30091
- }
30092
- return matches;
30093
- };
30094
- return (names && Array.isArray(names) ? names : [names]).map((name) => runNameMatcher(name)).flat();
30095
- }
30096
- function findUpSync(names, options = { limit: 1, type: "file" }) {
30097
- const matches = findUpMultipleSync(names, options);
30098
- return matches[0];
30099
- }
30100
-
30101
- // packages/config-tools/src/utilities/find-workspace-root.ts
30102
- var rootFiles = [
30103
- "lerna.json",
30104
- "nx.json",
30105
- "turbo.json",
30106
- "npm-workspace.json",
30107
- "yarn-workspace.json",
30108
- "pnpm-workspace.json",
30109
- "npm-workspace.yaml",
30110
- "yarn-workspace.yaml",
30111
- "pnpm-workspace.yaml",
30112
- "npm-workspace.yml",
30113
- "yarn-workspace.yml",
30114
- "pnpm-workspace.yml",
30115
- "npm-lock.json",
30116
- "yarn-lock.json",
30117
- "pnpm-lock.json",
30118
- "npm-lock.yaml",
30119
- "yarn-lock.yaml",
30120
- "pnpm-lock.yaml",
30121
- "npm-lock.yml",
30122
- "yarn-lock.yml",
30123
- "pnpm-lock.yml",
30124
- "bun.lockb"
30125
- ];
30126
- function findWorkspaceRoot(pathInsideMonorepo) {
30127
- 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, {
30128
- cwd: pathInsideMonorepo ?? process.cwd(),
30129
- type: "file",
30130
- limit: 1
30131
- });
30132
- if (!result) {
30133
- throw new Error(
30134
- `Cannot find workspace root upwards from known path. Files search list includes:
30135
- ${rootFiles.join(
30136
- "\n"
30137
- )}
30138
- Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
30139
- );
30140
- }
30141
- return result;
30142
- }
30143
-
30144
30147
  // packages/config-tools/src/utilities/get-default-config.ts
30145
30148
  var DefaultColorConfig = {
30146
30149
  primary: "#1fb2a6",