@storm-software/workspace-tools 1.31.12 → 1.31.14
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/CHANGELOG.md +14 -0
- package/index.js +2398 -2213
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +242 -57
- package/src/executors/design-tokens/executor.js +1475 -1290
- package/src/executors/tsup/executor.js +2370 -2185
- package/src/executors/tsup-browser/executor.js +2376 -2191
- package/src/executors/tsup-neutral/executor.js +2376 -2191
- package/src/executors/tsup-node/executor.js +2376 -2191
- package/src/generators/browser-library/generator.js +945 -760
- package/src/generators/config-schema/generator.js +440 -255
- package/src/generators/neutral-library/generator.js +945 -760
- package/src/generators/node-library/generator.js +945 -760
- package/src/generators/preset/generator.js +442 -257
package/package.json
CHANGED
package/src/base/index.js
CHANGED
|
@@ -33,9 +33,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
33
33
|
var require_resolve_from = __commonJS({
|
|
34
34
|
"node_modules/.pnpm/resolve-from@4.0.0/node_modules/resolve-from/index.js"(exports, module2) {
|
|
35
35
|
"use strict";
|
|
36
|
-
var
|
|
36
|
+
var path4 = require("path");
|
|
37
37
|
var Module = require("module");
|
|
38
|
-
var
|
|
38
|
+
var fs2 = require("fs");
|
|
39
39
|
var resolveFrom = (fromDir, moduleId, silent) => {
|
|
40
40
|
if (typeof fromDir !== "string") {
|
|
41
41
|
throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``);
|
|
@@ -44,17 +44,17 @@ var require_resolve_from = __commonJS({
|
|
|
44
44
|
throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``);
|
|
45
45
|
}
|
|
46
46
|
try {
|
|
47
|
-
fromDir =
|
|
47
|
+
fromDir = fs2.realpathSync(fromDir);
|
|
48
48
|
} catch (err) {
|
|
49
49
|
if (err.code === "ENOENT") {
|
|
50
|
-
fromDir =
|
|
50
|
+
fromDir = path4.resolve(fromDir);
|
|
51
51
|
} else if (silent) {
|
|
52
52
|
return null;
|
|
53
53
|
} else {
|
|
54
54
|
throw err;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
const fromFile =
|
|
57
|
+
const fromFile = path4.join(fromDir, "noop.js");
|
|
58
58
|
const resolveFileName = () => Module._resolveFilename(moduleId, {
|
|
59
59
|
id: fromFile,
|
|
60
60
|
filename: fromFile,
|
|
@@ -126,7 +126,7 @@ var require_parent_module = __commonJS({
|
|
|
126
126
|
var require_import_fresh = __commonJS({
|
|
127
127
|
"node_modules/.pnpm/import-fresh@3.3.0/node_modules/import-fresh/index.js"(exports, module2) {
|
|
128
128
|
"use strict";
|
|
129
|
-
var
|
|
129
|
+
var path4 = require("path");
|
|
130
130
|
var resolveFrom = require_resolve_from();
|
|
131
131
|
var parentModule = require_parent_module();
|
|
132
132
|
module2.exports = (moduleId) => {
|
|
@@ -134,7 +134,7 @@ var require_import_fresh = __commonJS({
|
|
|
134
134
|
throw new TypeError("Expected a string");
|
|
135
135
|
}
|
|
136
136
|
const parentPath = parentModule(__filename);
|
|
137
|
-
const cwd = parentPath ?
|
|
137
|
+
const cwd = parentPath ? path4.dirname(parentPath) : __dirname;
|
|
138
138
|
const filePath = resolveFrom(cwd, moduleId);
|
|
139
139
|
const oldModule = require.cache[filePath];
|
|
140
140
|
if (oldModule && oldModule.parent) {
|
|
@@ -1576,15 +1576,15 @@ var require_route = __commonJS({
|
|
|
1576
1576
|
};
|
|
1577
1577
|
}
|
|
1578
1578
|
function wrapConversion(toModel, graph) {
|
|
1579
|
-
var
|
|
1579
|
+
var path4 = [graph[toModel].parent, toModel];
|
|
1580
1580
|
var fn = conversions[graph[toModel].parent][toModel];
|
|
1581
1581
|
var cur = graph[toModel].parent;
|
|
1582
1582
|
while (graph[cur].parent) {
|
|
1583
|
-
|
|
1583
|
+
path4.unshift(graph[cur].parent);
|
|
1584
1584
|
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
1585
1585
|
cur = graph[cur].parent;
|
|
1586
1586
|
}
|
|
1587
|
-
fn.conversion =
|
|
1587
|
+
fn.conversion = path4;
|
|
1588
1588
|
return fn;
|
|
1589
1589
|
}
|
|
1590
1590
|
module2.exports = function(fromModel) {
|
|
@@ -5580,7 +5580,7 @@ ${error.message}`;
|
|
|
5580
5580
|
return typescript.sys.fileExists(fileName);
|
|
5581
5581
|
});
|
|
5582
5582
|
if (filePath !== void 0) {
|
|
5583
|
-
const { config, error } = typescript.readConfigFile(filePath, (
|
|
5583
|
+
const { config, error } = typescript.readConfigFile(filePath, (path4) => typescript.sys.readFile(path4));
|
|
5584
5584
|
if (error) {
|
|
5585
5585
|
throw new Error(`Error in ${filePath}: ${error.messageText.toString()}`);
|
|
5586
5586
|
}
|
|
@@ -5703,42 +5703,42 @@ var require_defaults = __commonJS({
|
|
|
5703
5703
|
var require_env_paths = __commonJS({
|
|
5704
5704
|
"node_modules/.pnpm/env-paths@2.2.1/node_modules/env-paths/index.js"(exports, module2) {
|
|
5705
5705
|
"use strict";
|
|
5706
|
-
var
|
|
5706
|
+
var path4 = require("path");
|
|
5707
5707
|
var os = require("os");
|
|
5708
5708
|
var homedir = os.homedir();
|
|
5709
5709
|
var tmpdir = os.tmpdir();
|
|
5710
5710
|
var { env } = process;
|
|
5711
5711
|
var macos = (name) => {
|
|
5712
|
-
const library =
|
|
5712
|
+
const library = path4.join(homedir, "Library");
|
|
5713
5713
|
return {
|
|
5714
|
-
data:
|
|
5715
|
-
config:
|
|
5716
|
-
cache:
|
|
5717
|
-
log:
|
|
5718
|
-
temp:
|
|
5714
|
+
data: path4.join(library, "Application Support", name),
|
|
5715
|
+
config: path4.join(library, "Preferences", name),
|
|
5716
|
+
cache: path4.join(library, "Caches", name),
|
|
5717
|
+
log: path4.join(library, "Logs", name),
|
|
5718
|
+
temp: path4.join(tmpdir, name)
|
|
5719
5719
|
};
|
|
5720
5720
|
};
|
|
5721
5721
|
var windows = (name) => {
|
|
5722
|
-
const appData = env.APPDATA ||
|
|
5723
|
-
const localAppData = env.LOCALAPPDATA ||
|
|
5722
|
+
const appData = env.APPDATA || path4.join(homedir, "AppData", "Roaming");
|
|
5723
|
+
const localAppData = env.LOCALAPPDATA || path4.join(homedir, "AppData", "Local");
|
|
5724
5724
|
return {
|
|
5725
5725
|
// Data/config/cache/log are invented by me as Windows isn't opinionated about this
|
|
5726
|
-
data:
|
|
5727
|
-
config:
|
|
5728
|
-
cache:
|
|
5729
|
-
log:
|
|
5730
|
-
temp:
|
|
5726
|
+
data: path4.join(localAppData, name, "Data"),
|
|
5727
|
+
config: path4.join(appData, name, "Config"),
|
|
5728
|
+
cache: path4.join(localAppData, name, "Cache"),
|
|
5729
|
+
log: path4.join(localAppData, name, "Log"),
|
|
5730
|
+
temp: path4.join(tmpdir, name)
|
|
5731
5731
|
};
|
|
5732
5732
|
};
|
|
5733
5733
|
var linux = (name) => {
|
|
5734
|
-
const username =
|
|
5734
|
+
const username = path4.basename(homedir);
|
|
5735
5735
|
return {
|
|
5736
|
-
data:
|
|
5737
|
-
config:
|
|
5738
|
-
cache:
|
|
5736
|
+
data: path4.join(env.XDG_DATA_HOME || path4.join(homedir, ".local", "share"), name),
|
|
5737
|
+
config: path4.join(env.XDG_CONFIG_HOME || path4.join(homedir, ".config"), name),
|
|
5738
|
+
cache: path4.join(env.XDG_CACHE_HOME || path4.join(homedir, ".cache"), name),
|
|
5739
5739
|
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
5740
|
-
log:
|
|
5741
|
-
temp:
|
|
5740
|
+
log: path4.join(env.XDG_STATE_HOME || path4.join(homedir, ".local", "state"), name),
|
|
5741
|
+
temp: path4.join(tmpdir, username, name)
|
|
5742
5742
|
};
|
|
5743
5743
|
};
|
|
5744
5744
|
var envPaths = (name, options) => {
|
|
@@ -5811,11 +5811,11 @@ var require_util = __commonJS({
|
|
|
5811
5811
|
return result;
|
|
5812
5812
|
}
|
|
5813
5813
|
exports.emplace = emplace;
|
|
5814
|
-
function getPropertyByPath(source,
|
|
5815
|
-
if (typeof
|
|
5816
|
-
return source[
|
|
5814
|
+
function getPropertyByPath(source, path4) {
|
|
5815
|
+
if (typeof path4 === "string" && Object.prototype.hasOwnProperty.call(source, path4)) {
|
|
5816
|
+
return source[path4];
|
|
5817
5817
|
}
|
|
5818
|
-
const parsedPath = typeof
|
|
5818
|
+
const parsedPath = typeof path4 === "string" ? path4.split(".") : path4;
|
|
5819
5819
|
return parsedPath.reduce((previous, key) => {
|
|
5820
5820
|
if (previous === void 0) {
|
|
5821
5821
|
return previous;
|
|
@@ -5828,9 +5828,9 @@ var require_util = __commonJS({
|
|
|
5828
5828
|
return Object.fromEntries(Object.entries(options).filter(([, value]) => value !== void 0));
|
|
5829
5829
|
}
|
|
5830
5830
|
exports.removeUndefinedValuesFromObject = removeUndefinedValuesFromObject;
|
|
5831
|
-
async function isDirectory(
|
|
5831
|
+
async function isDirectory(path4) {
|
|
5832
5832
|
try {
|
|
5833
|
-
const stat = await fs_1.promises.stat(
|
|
5833
|
+
const stat = await fs_1.promises.stat(path4);
|
|
5834
5834
|
return stat.isDirectory();
|
|
5835
5835
|
} catch (e) {
|
|
5836
5836
|
if (e.code === "ENOENT") {
|
|
@@ -5840,9 +5840,9 @@ var require_util = __commonJS({
|
|
|
5840
5840
|
}
|
|
5841
5841
|
}
|
|
5842
5842
|
exports.isDirectory = isDirectory;
|
|
5843
|
-
function isDirectorySync(
|
|
5843
|
+
function isDirectorySync(path4) {
|
|
5844
5844
|
try {
|
|
5845
|
-
const stat = fs_1.default.statSync(
|
|
5845
|
+
const stat = fs_1.default.statSync(path4);
|
|
5846
5846
|
return stat.isDirectory();
|
|
5847
5847
|
} catch (e) {
|
|
5848
5848
|
if (e.code === "ENOENT") {
|
|
@@ -5940,7 +5940,7 @@ var require_ExplorerBase = __commonJS({
|
|
|
5940
5940
|
const idx = importStack.indexOf(fullPath);
|
|
5941
5941
|
if (idx !== -1) {
|
|
5942
5942
|
throw new Error(`Circular import detected:
|
|
5943
|
-
${[...importStack, fullPath].map((
|
|
5943
|
+
${[...importStack, fullPath].map((path4, i) => `${i + 1}. ${path4}`).join("\n")} (same as ${idx + 1}.)`);
|
|
5944
5944
|
}
|
|
5945
5945
|
}
|
|
5946
5946
|
}
|
|
@@ -6125,9 +6125,9 @@ var require_Explorer = __commonJS({
|
|
|
6125
6125
|
throw error;
|
|
6126
6126
|
}
|
|
6127
6127
|
}
|
|
6128
|
-
async #fileExists(
|
|
6128
|
+
async #fileExists(path4) {
|
|
6129
6129
|
try {
|
|
6130
|
-
await promises_1.default.stat(
|
|
6130
|
+
await promises_1.default.stat(path4);
|
|
6131
6131
|
return true;
|
|
6132
6132
|
} catch (e) {
|
|
6133
6133
|
return false;
|
|
@@ -6283,9 +6283,9 @@ var require_ExplorerSync = __commonJS({
|
|
|
6283
6283
|
throw error;
|
|
6284
6284
|
}
|
|
6285
6285
|
}
|
|
6286
|
-
#fileExists(
|
|
6286
|
+
#fileExists(path4) {
|
|
6287
6287
|
try {
|
|
6288
|
-
fs_1.default.statSync(
|
|
6288
|
+
fs_1.default.statSync(path4);
|
|
6289
6289
|
return true;
|
|
6290
6290
|
} catch (e) {
|
|
6291
6291
|
return false;
|
|
@@ -6405,7 +6405,7 @@ var require_dist = __commonJS({
|
|
|
6405
6405
|
};
|
|
6406
6406
|
}
|
|
6407
6407
|
function getResolvedSearchPlaces(moduleName, toolDefinedSearchPlaces, userConfiguredOptions) {
|
|
6408
|
-
const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((
|
|
6408
|
+
const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((path4) => path4.replace("{name}", moduleName));
|
|
6409
6409
|
if (userConfiguredOptions.mergeSearchPlaces) {
|
|
6410
6410
|
return [...userConfiguredSearchPlaces ?? [], ...toolDefinedSearchPlaces];
|
|
6411
6411
|
}
|
|
@@ -7372,15 +7372,15 @@ var require_route2 = __commonJS({
|
|
|
7372
7372
|
};
|
|
7373
7373
|
}
|
|
7374
7374
|
function wrapConversion(toModel, graph) {
|
|
7375
|
-
const
|
|
7375
|
+
const path4 = [graph[toModel].parent, toModel];
|
|
7376
7376
|
let fn = conversions[graph[toModel].parent][toModel];
|
|
7377
7377
|
let cur = graph[toModel].parent;
|
|
7378
7378
|
while (graph[cur].parent) {
|
|
7379
|
-
|
|
7379
|
+
path4.unshift(graph[cur].parent);
|
|
7380
7380
|
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
7381
7381
|
cur = graph[cur].parent;
|
|
7382
7382
|
}
|
|
7383
|
-
fn.conversion =
|
|
7383
|
+
fn.conversion = path4;
|
|
7384
7384
|
return fn;
|
|
7385
7385
|
}
|
|
7386
7386
|
module2.exports = function(fromModel) {
|
|
@@ -8116,7 +8116,6 @@ var LogLevelLabel = {
|
|
|
8116
8116
|
|
|
8117
8117
|
// packages/config-tools/src/utilities/get-default-config.ts
|
|
8118
8118
|
var import_fs = require("fs");
|
|
8119
|
-
var import_find_workspace_root = require("nx/src/utils/find-workspace-root.js");
|
|
8120
8119
|
var import_path = require("path");
|
|
8121
8120
|
|
|
8122
8121
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
@@ -8460,8 +8459,8 @@ function getErrorMap() {
|
|
|
8460
8459
|
return overrideErrorMap;
|
|
8461
8460
|
}
|
|
8462
8461
|
var makeIssue = (params) => {
|
|
8463
|
-
const { data, path, errorMaps, issueData } = params;
|
|
8464
|
-
const fullPath = [...
|
|
8462
|
+
const { data, path: path4, errorMaps, issueData } = params;
|
|
8463
|
+
const fullPath = [...path4, ...issueData.path || []];
|
|
8465
8464
|
const fullIssue = {
|
|
8466
8465
|
...issueData,
|
|
8467
8466
|
path: fullPath
|
|
@@ -8559,11 +8558,11 @@ var errorUtil;
|
|
|
8559
8558
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
|
8560
8559
|
})(errorUtil || (errorUtil = {}));
|
|
8561
8560
|
var ParseInputLazyPath = class {
|
|
8562
|
-
constructor(parent, value,
|
|
8561
|
+
constructor(parent, value, path4, key) {
|
|
8563
8562
|
this._cachedPath = [];
|
|
8564
8563
|
this.parent = parent;
|
|
8565
8564
|
this.data = value;
|
|
8566
|
-
this._path =
|
|
8565
|
+
this._path = path4;
|
|
8567
8566
|
this._key = key;
|
|
8568
8567
|
}
|
|
8569
8568
|
get path() {
|
|
@@ -11751,6 +11750,195 @@ var StormConfigSchema = objectType({
|
|
|
11751
11750
|
"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."
|
|
11752
11751
|
);
|
|
11753
11752
|
|
|
11753
|
+
// packages/config-tools/src/utilities/find-workspace-root.ts
|
|
11754
|
+
var path3 = __toESM(require("path"), 1);
|
|
11755
|
+
|
|
11756
|
+
// node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
11757
|
+
var import_node_process = __toESM(require("node:process"), 1);
|
|
11758
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
11759
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
11760
|
+
var import_node_url = require("node:url");
|
|
11761
|
+
|
|
11762
|
+
// node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
|
|
11763
|
+
var Node = class {
|
|
11764
|
+
value;
|
|
11765
|
+
next;
|
|
11766
|
+
constructor(value) {
|
|
11767
|
+
this.value = value;
|
|
11768
|
+
}
|
|
11769
|
+
};
|
|
11770
|
+
var Queue = class {
|
|
11771
|
+
#head;
|
|
11772
|
+
#tail;
|
|
11773
|
+
#size;
|
|
11774
|
+
constructor() {
|
|
11775
|
+
this.clear();
|
|
11776
|
+
}
|
|
11777
|
+
enqueue(value) {
|
|
11778
|
+
const node = new Node(value);
|
|
11779
|
+
if (this.#head) {
|
|
11780
|
+
this.#tail.next = node;
|
|
11781
|
+
this.#tail = node;
|
|
11782
|
+
} else {
|
|
11783
|
+
this.#head = node;
|
|
11784
|
+
this.#tail = node;
|
|
11785
|
+
}
|
|
11786
|
+
this.#size++;
|
|
11787
|
+
}
|
|
11788
|
+
dequeue() {
|
|
11789
|
+
const current = this.#head;
|
|
11790
|
+
if (!current) {
|
|
11791
|
+
return;
|
|
11792
|
+
}
|
|
11793
|
+
this.#head = this.#head.next;
|
|
11794
|
+
this.#size--;
|
|
11795
|
+
return current.value;
|
|
11796
|
+
}
|
|
11797
|
+
clear() {
|
|
11798
|
+
this.#head = void 0;
|
|
11799
|
+
this.#tail = void 0;
|
|
11800
|
+
this.#size = 0;
|
|
11801
|
+
}
|
|
11802
|
+
get size() {
|
|
11803
|
+
return this.#size;
|
|
11804
|
+
}
|
|
11805
|
+
*[Symbol.iterator]() {
|
|
11806
|
+
let current = this.#head;
|
|
11807
|
+
while (current) {
|
|
11808
|
+
yield current.value;
|
|
11809
|
+
current = current.next;
|
|
11810
|
+
}
|
|
11811
|
+
}
|
|
11812
|
+
};
|
|
11813
|
+
|
|
11814
|
+
// node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
11815
|
+
var typeMappings = {
|
|
11816
|
+
directory: "isDirectory",
|
|
11817
|
+
file: "isFile"
|
|
11818
|
+
};
|
|
11819
|
+
function checkType(type) {
|
|
11820
|
+
if (Object.hasOwnProperty.call(typeMappings, type)) {
|
|
11821
|
+
return;
|
|
11822
|
+
}
|
|
11823
|
+
throw new Error(`Invalid type specified: ${type}`);
|
|
11824
|
+
}
|
|
11825
|
+
var matchType = (type, stat) => stat[typeMappings[type]]();
|
|
11826
|
+
var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
11827
|
+
function locatePathSync(paths, {
|
|
11828
|
+
cwd = import_node_process.default.cwd(),
|
|
11829
|
+
type = "file",
|
|
11830
|
+
allowSymlinks = true
|
|
11831
|
+
} = {}) {
|
|
11832
|
+
checkType(type);
|
|
11833
|
+
cwd = toPath(cwd);
|
|
11834
|
+
const statFunction = allowSymlinks ? import_node_fs.default.statSync : import_node_fs.default.lstatSync;
|
|
11835
|
+
for (const path_ of paths) {
|
|
11836
|
+
try {
|
|
11837
|
+
const stat = statFunction(import_node_path.default.resolve(cwd, path_), {
|
|
11838
|
+
throwIfNoEntry: false
|
|
11839
|
+
});
|
|
11840
|
+
if (!stat) {
|
|
11841
|
+
continue;
|
|
11842
|
+
}
|
|
11843
|
+
if (matchType(type, stat)) {
|
|
11844
|
+
return path_;
|
|
11845
|
+
}
|
|
11846
|
+
} catch {
|
|
11847
|
+
}
|
|
11848
|
+
}
|
|
11849
|
+
}
|
|
11850
|
+
|
|
11851
|
+
// packages/config-tools/src/utilities/find-up.ts
|
|
11852
|
+
var path2 = __toESM(require("path"), 1);
|
|
11853
|
+
var import_url = require("url");
|
|
11854
|
+
var findUpStop = Symbol("findUpStop");
|
|
11855
|
+
function toPath2(urlOrPath) {
|
|
11856
|
+
return urlOrPath instanceof URL ? (0, import_url.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
11857
|
+
}
|
|
11858
|
+
function findUpMultipleSync(names, options = { limit: 1, type: "file" }) {
|
|
11859
|
+
let directory = path2.resolve(toPath2(options.cwd) ?? "");
|
|
11860
|
+
const { root } = path2.parse(directory);
|
|
11861
|
+
const stopAt = path2.resolve(directory, toPath2(options.stopAt) ?? root);
|
|
11862
|
+
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
11863
|
+
if (typeof names === "function") {
|
|
11864
|
+
const foundPath = names(options.cwd);
|
|
11865
|
+
return locatePathSync([foundPath], options);
|
|
11866
|
+
}
|
|
11867
|
+
const runNameMatcher = (name) => {
|
|
11868
|
+
const paths = [name].flat();
|
|
11869
|
+
const runMatcher = (locateOptions) => {
|
|
11870
|
+
if (typeof name !== "function") {
|
|
11871
|
+
return locatePathSync(paths, locateOptions);
|
|
11872
|
+
}
|
|
11873
|
+
const foundPath = name(locateOptions.cwd);
|
|
11874
|
+
if (typeof foundPath === "string") {
|
|
11875
|
+
return locatePathSync([foundPath], locateOptions);
|
|
11876
|
+
}
|
|
11877
|
+
return foundPath;
|
|
11878
|
+
};
|
|
11879
|
+
const matches = [];
|
|
11880
|
+
while (true) {
|
|
11881
|
+
const foundPath = runMatcher({ ...options, cwd: directory });
|
|
11882
|
+
if (foundPath) {
|
|
11883
|
+
matches.push(path2.resolve(directory, foundPath));
|
|
11884
|
+
}
|
|
11885
|
+
if (directory === stopAt || matches.length >= limit) {
|
|
11886
|
+
break;
|
|
11887
|
+
}
|
|
11888
|
+
directory = path2.dirname(directory);
|
|
11889
|
+
}
|
|
11890
|
+
return matches;
|
|
11891
|
+
};
|
|
11892
|
+
return (names && Array.isArray(names) ? names : [names]).map((name) => runNameMatcher(name)).flat();
|
|
11893
|
+
}
|
|
11894
|
+
function findUpSync(names, options = { limit: 1, type: "file" }) {
|
|
11895
|
+
const matches = findUpMultipleSync(names, options);
|
|
11896
|
+
return matches[0];
|
|
11897
|
+
}
|
|
11898
|
+
|
|
11899
|
+
// packages/config-tools/src/utilities/find-workspace-root.ts
|
|
11900
|
+
var rootFiles = [
|
|
11901
|
+
"lerna.json",
|
|
11902
|
+
"nx.json",
|
|
11903
|
+
"turbo.json",
|
|
11904
|
+
"npm-workspace.json",
|
|
11905
|
+
"yarn-workspace.json",
|
|
11906
|
+
"pnpm-workspace.json",
|
|
11907
|
+
"npm-workspace.yaml",
|
|
11908
|
+
"yarn-workspace.yaml",
|
|
11909
|
+
"pnpm-workspace.yaml",
|
|
11910
|
+
"npm-workspace.yml",
|
|
11911
|
+
"yarn-workspace.yml",
|
|
11912
|
+
"pnpm-workspace.yml",
|
|
11913
|
+
"npm-lock.json",
|
|
11914
|
+
"yarn-lock.json",
|
|
11915
|
+
"pnpm-lock.json",
|
|
11916
|
+
"npm-lock.yaml",
|
|
11917
|
+
"yarn-lock.yaml",
|
|
11918
|
+
"pnpm-lock.yaml",
|
|
11919
|
+
"npm-lock.yml",
|
|
11920
|
+
"yarn-lock.yml",
|
|
11921
|
+
"pnpm-lock.yml",
|
|
11922
|
+
"bun.lockb"
|
|
11923
|
+
];
|
|
11924
|
+
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
11925
|
+
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, {
|
|
11926
|
+
cwd: pathInsideMonorepo ?? process.cwd(),
|
|
11927
|
+
type: "file",
|
|
11928
|
+
limit: 1
|
|
11929
|
+
});
|
|
11930
|
+
if (!result) {
|
|
11931
|
+
throw new Error(
|
|
11932
|
+
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
11933
|
+
${rootFiles.join(
|
|
11934
|
+
"\n"
|
|
11935
|
+
)}
|
|
11936
|
+
Path: ${path3}`
|
|
11937
|
+
);
|
|
11938
|
+
}
|
|
11939
|
+
return result;
|
|
11940
|
+
}
|
|
11941
|
+
|
|
11754
11942
|
// packages/config-tools/src/utilities/get-default-config.ts
|
|
11755
11943
|
var DefaultColorConfig = {
|
|
11756
11944
|
primary: "#1fb2a6",
|
|
@@ -11786,10 +11974,7 @@ var getDefaultConfig = (config = {}) => {
|
|
|
11786
11974
|
let repository = "https://github.com/storm-software/storm-stack";
|
|
11787
11975
|
let license = DefaultStormConfig.license;
|
|
11788
11976
|
let homepage = DefaultStormConfig.homepage;
|
|
11789
|
-
const workspaceRoot =
|
|
11790
|
-
if (typeof workspaceRoot !== "string") {
|
|
11791
|
-
throw new Error("Could not find workspace root");
|
|
11792
|
-
}
|
|
11977
|
+
const workspaceRoot = findWorkspaceRoot(process.cwd());
|
|
11793
11978
|
if ((0, import_fs.existsSync)((0, import_path.join)(workspaceRoot, "package.json"))) {
|
|
11794
11979
|
const file = (0, import_fs.readFileSync)((0, import_path.join)(workspaceRoot, "package.json"), {
|
|
11795
11980
|
encoding: "utf-8"
|