@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.
- package/CHANGELOG.md +14 -0
- package/index.js +189 -186
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +189 -186
- package/src/executors/design-tokens/executor.js +189 -186
- package/src/executors/tsup/executor.js +189 -186
- package/src/executors/tsup-browser/executor.js +189 -186
- package/src/executors/tsup-neutral/executor.js +189 -186
- package/src/executors/tsup-node/executor.js +189 -186
- package/src/generators/browser-library/generator.js +189 -186
- package/src/generators/config-schema/generator.js +189 -186
- package/src/generators/neutral-library/generator.js +189 -186
- package/src/generators/node-library/generator.js +189 -186
- package/src/generators/preset/generator.js +189 -186
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.31.17](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.31.16...workspace-tools-v1.31.17) (2023-12-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **config-tools:** Update declaration types ([8ca8850](https://github.com/storm-software/storm-ops/commit/8ca8850c5ba1d92e7bc3fa273f332cf8c1acce18))
|
|
7
|
+
|
|
8
|
+
## [1.31.16](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.31.15...workspace-tools-v1.31.16) (2023-12-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **config-tools:** Add workspace root parameter to config creator ([a22f0fb](https://github.com/storm-software/storm-ops/commit/a22f0fb10970bf49c4ab384ef9a4e8988ef6f372))
|
|
14
|
+
|
|
1
15
|
## [1.31.15](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.31.14...workspace-tools-v1.31.15) (2023-12-21)
|
|
2
16
|
|
|
3
17
|
|
package/index.js
CHANGED
|
@@ -106319,6 +106319,195 @@ var LogLevelLabel = {
|
|
|
106319
106319
|
TRACE: "trace"
|
|
106320
106320
|
};
|
|
106321
106321
|
|
|
106322
|
+
// node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
106323
|
+
var import_node_process = __toESM(require("node:process"), 1);
|
|
106324
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
106325
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
106326
|
+
var import_node_url = require("node:url");
|
|
106327
|
+
|
|
106328
|
+
// node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
|
|
106329
|
+
var Node = class {
|
|
106330
|
+
value;
|
|
106331
|
+
next;
|
|
106332
|
+
constructor(value) {
|
|
106333
|
+
this.value = value;
|
|
106334
|
+
}
|
|
106335
|
+
};
|
|
106336
|
+
var Queue = class {
|
|
106337
|
+
#head;
|
|
106338
|
+
#tail;
|
|
106339
|
+
#size;
|
|
106340
|
+
constructor() {
|
|
106341
|
+
this.clear();
|
|
106342
|
+
}
|
|
106343
|
+
enqueue(value) {
|
|
106344
|
+
const node = new Node(value);
|
|
106345
|
+
if (this.#head) {
|
|
106346
|
+
this.#tail.next = node;
|
|
106347
|
+
this.#tail = node;
|
|
106348
|
+
} else {
|
|
106349
|
+
this.#head = node;
|
|
106350
|
+
this.#tail = node;
|
|
106351
|
+
}
|
|
106352
|
+
this.#size++;
|
|
106353
|
+
}
|
|
106354
|
+
dequeue() {
|
|
106355
|
+
const current = this.#head;
|
|
106356
|
+
if (!current) {
|
|
106357
|
+
return;
|
|
106358
|
+
}
|
|
106359
|
+
this.#head = this.#head.next;
|
|
106360
|
+
this.#size--;
|
|
106361
|
+
return current.value;
|
|
106362
|
+
}
|
|
106363
|
+
clear() {
|
|
106364
|
+
this.#head = void 0;
|
|
106365
|
+
this.#tail = void 0;
|
|
106366
|
+
this.#size = 0;
|
|
106367
|
+
}
|
|
106368
|
+
get size() {
|
|
106369
|
+
return this.#size;
|
|
106370
|
+
}
|
|
106371
|
+
*[Symbol.iterator]() {
|
|
106372
|
+
let current = this.#head;
|
|
106373
|
+
while (current) {
|
|
106374
|
+
yield current.value;
|
|
106375
|
+
current = current.next;
|
|
106376
|
+
}
|
|
106377
|
+
}
|
|
106378
|
+
};
|
|
106379
|
+
|
|
106380
|
+
// node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
106381
|
+
var typeMappings = {
|
|
106382
|
+
directory: "isDirectory",
|
|
106383
|
+
file: "isFile"
|
|
106384
|
+
};
|
|
106385
|
+
function checkType(type) {
|
|
106386
|
+
if (Object.hasOwnProperty.call(typeMappings, type)) {
|
|
106387
|
+
return;
|
|
106388
|
+
}
|
|
106389
|
+
throw new Error(`Invalid type specified: ${type}`);
|
|
106390
|
+
}
|
|
106391
|
+
var matchType = (type, stat) => stat[typeMappings[type]]();
|
|
106392
|
+
var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
106393
|
+
function locatePathSync(paths, {
|
|
106394
|
+
cwd = import_node_process.default.cwd(),
|
|
106395
|
+
type = "file",
|
|
106396
|
+
allowSymlinks = true
|
|
106397
|
+
} = {}) {
|
|
106398
|
+
checkType(type);
|
|
106399
|
+
cwd = toPath(cwd);
|
|
106400
|
+
const statFunction = allowSymlinks ? import_node_fs.default.statSync : import_node_fs.default.lstatSync;
|
|
106401
|
+
for (const path_ of paths) {
|
|
106402
|
+
try {
|
|
106403
|
+
const stat = statFunction(import_node_path.default.resolve(cwd, path_), {
|
|
106404
|
+
throwIfNoEntry: false
|
|
106405
|
+
});
|
|
106406
|
+
if (!stat) {
|
|
106407
|
+
continue;
|
|
106408
|
+
}
|
|
106409
|
+
if (matchType(type, stat)) {
|
|
106410
|
+
return path_;
|
|
106411
|
+
}
|
|
106412
|
+
} catch {
|
|
106413
|
+
}
|
|
106414
|
+
}
|
|
106415
|
+
}
|
|
106416
|
+
|
|
106417
|
+
// packages/config-tools/src/utilities/find-up.ts
|
|
106418
|
+
var path2 = __toESM(require("path"), 1);
|
|
106419
|
+
var import_url = require("url");
|
|
106420
|
+
var findUpStop = Symbol("findUpStop");
|
|
106421
|
+
function toPath2(urlOrPath) {
|
|
106422
|
+
return urlOrPath instanceof URL ? (0, import_url.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
106423
|
+
}
|
|
106424
|
+
function findUpMultipleSync(names3, options = { limit: 1, type: "file" }) {
|
|
106425
|
+
let directory = path2.resolve(toPath2(options.cwd) ?? "");
|
|
106426
|
+
const { root } = path2.parse(directory);
|
|
106427
|
+
const stopAt = path2.resolve(directory, toPath2(options.stopAt) ?? root);
|
|
106428
|
+
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
106429
|
+
if (typeof names3 === "function") {
|
|
106430
|
+
const foundPath = names3(options.cwd);
|
|
106431
|
+
return locatePathSync([foundPath], options);
|
|
106432
|
+
}
|
|
106433
|
+
const runNameMatcher = (name) => {
|
|
106434
|
+
const paths = [name].flat();
|
|
106435
|
+
const runMatcher = (locateOptions) => {
|
|
106436
|
+
if (typeof name !== "function") {
|
|
106437
|
+
return locatePathSync(paths, locateOptions);
|
|
106438
|
+
}
|
|
106439
|
+
const foundPath = name(locateOptions.cwd);
|
|
106440
|
+
if (typeof foundPath === "string") {
|
|
106441
|
+
return locatePathSync([foundPath], locateOptions);
|
|
106442
|
+
}
|
|
106443
|
+
return foundPath;
|
|
106444
|
+
};
|
|
106445
|
+
const matches = [];
|
|
106446
|
+
while (true) {
|
|
106447
|
+
const foundPath = runMatcher({ ...options, cwd: directory });
|
|
106448
|
+
if (foundPath) {
|
|
106449
|
+
matches.push(path2.resolve(directory, foundPath));
|
|
106450
|
+
}
|
|
106451
|
+
if (directory === stopAt || matches.length >= limit) {
|
|
106452
|
+
break;
|
|
106453
|
+
}
|
|
106454
|
+
directory = path2.dirname(directory);
|
|
106455
|
+
}
|
|
106456
|
+
return matches;
|
|
106457
|
+
};
|
|
106458
|
+
return (names3 && Array.isArray(names3) ? names3 : [names3]).map((name) => runNameMatcher(name)).flat();
|
|
106459
|
+
}
|
|
106460
|
+
function findUpSync(names3, options = { limit: 1, type: "file" }) {
|
|
106461
|
+
const matches = findUpMultipleSync(names3, options);
|
|
106462
|
+
return matches[0];
|
|
106463
|
+
}
|
|
106464
|
+
|
|
106465
|
+
// packages/config-tools/src/utilities/find-workspace-root.ts
|
|
106466
|
+
var rootFiles = [
|
|
106467
|
+
"lerna.json",
|
|
106468
|
+
"nx.json",
|
|
106469
|
+
"turbo.json",
|
|
106470
|
+
"npm-workspace.json",
|
|
106471
|
+
"yarn-workspace.json",
|
|
106472
|
+
"pnpm-workspace.json",
|
|
106473
|
+
"npm-workspace.yaml",
|
|
106474
|
+
"yarn-workspace.yaml",
|
|
106475
|
+
"pnpm-workspace.yaml",
|
|
106476
|
+
"npm-workspace.yml",
|
|
106477
|
+
"yarn-workspace.yml",
|
|
106478
|
+
"pnpm-workspace.yml",
|
|
106479
|
+
"npm-lock.json",
|
|
106480
|
+
"yarn-lock.json",
|
|
106481
|
+
"pnpm-lock.json",
|
|
106482
|
+
"npm-lock.yaml",
|
|
106483
|
+
"yarn-lock.yaml",
|
|
106484
|
+
"pnpm-lock.yaml",
|
|
106485
|
+
"npm-lock.yml",
|
|
106486
|
+
"yarn-lock.yml",
|
|
106487
|
+
"pnpm-lock.yml",
|
|
106488
|
+
"bun.lockb"
|
|
106489
|
+
];
|
|
106490
|
+
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
106491
|
+
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, {
|
|
106492
|
+
cwd: pathInsideMonorepo ?? process.cwd(),
|
|
106493
|
+
type: "file",
|
|
106494
|
+
limit: 1
|
|
106495
|
+
});
|
|
106496
|
+
}
|
|
106497
|
+
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
106498
|
+
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
106499
|
+
if (!result) {
|
|
106500
|
+
throw new Error(
|
|
106501
|
+
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
106502
|
+
${rootFiles.join(
|
|
106503
|
+
"\n"
|
|
106504
|
+
)}
|
|
106505
|
+
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
106506
|
+
);
|
|
106507
|
+
}
|
|
106508
|
+
return result;
|
|
106509
|
+
}
|
|
106510
|
+
|
|
106322
106511
|
// packages/config-tools/src/utilities/get-default-config.ts
|
|
106323
106512
|
var import_fs = require("fs");
|
|
106324
106513
|
var import_path = require("path");
|
|
@@ -109955,192 +110144,6 @@ var StormConfigSchema = objectType({
|
|
|
109955
110144
|
"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."
|
|
109956
110145
|
);
|
|
109957
110146
|
|
|
109958
|
-
// node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
109959
|
-
var import_node_process = __toESM(require("node:process"), 1);
|
|
109960
|
-
var import_node_path = __toESM(require("node:path"), 1);
|
|
109961
|
-
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
109962
|
-
var import_node_url = require("node:url");
|
|
109963
|
-
|
|
109964
|
-
// node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
|
|
109965
|
-
var Node = class {
|
|
109966
|
-
value;
|
|
109967
|
-
next;
|
|
109968
|
-
constructor(value) {
|
|
109969
|
-
this.value = value;
|
|
109970
|
-
}
|
|
109971
|
-
};
|
|
109972
|
-
var Queue = class {
|
|
109973
|
-
#head;
|
|
109974
|
-
#tail;
|
|
109975
|
-
#size;
|
|
109976
|
-
constructor() {
|
|
109977
|
-
this.clear();
|
|
109978
|
-
}
|
|
109979
|
-
enqueue(value) {
|
|
109980
|
-
const node = new Node(value);
|
|
109981
|
-
if (this.#head) {
|
|
109982
|
-
this.#tail.next = node;
|
|
109983
|
-
this.#tail = node;
|
|
109984
|
-
} else {
|
|
109985
|
-
this.#head = node;
|
|
109986
|
-
this.#tail = node;
|
|
109987
|
-
}
|
|
109988
|
-
this.#size++;
|
|
109989
|
-
}
|
|
109990
|
-
dequeue() {
|
|
109991
|
-
const current = this.#head;
|
|
109992
|
-
if (!current) {
|
|
109993
|
-
return;
|
|
109994
|
-
}
|
|
109995
|
-
this.#head = this.#head.next;
|
|
109996
|
-
this.#size--;
|
|
109997
|
-
return current.value;
|
|
109998
|
-
}
|
|
109999
|
-
clear() {
|
|
110000
|
-
this.#head = void 0;
|
|
110001
|
-
this.#tail = void 0;
|
|
110002
|
-
this.#size = 0;
|
|
110003
|
-
}
|
|
110004
|
-
get size() {
|
|
110005
|
-
return this.#size;
|
|
110006
|
-
}
|
|
110007
|
-
*[Symbol.iterator]() {
|
|
110008
|
-
let current = this.#head;
|
|
110009
|
-
while (current) {
|
|
110010
|
-
yield current.value;
|
|
110011
|
-
current = current.next;
|
|
110012
|
-
}
|
|
110013
|
-
}
|
|
110014
|
-
};
|
|
110015
|
-
|
|
110016
|
-
// node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
110017
|
-
var typeMappings = {
|
|
110018
|
-
directory: "isDirectory",
|
|
110019
|
-
file: "isFile"
|
|
110020
|
-
};
|
|
110021
|
-
function checkType(type) {
|
|
110022
|
-
if (Object.hasOwnProperty.call(typeMappings, type)) {
|
|
110023
|
-
return;
|
|
110024
|
-
}
|
|
110025
|
-
throw new Error(`Invalid type specified: ${type}`);
|
|
110026
|
-
}
|
|
110027
|
-
var matchType = (type, stat) => stat[typeMappings[type]]();
|
|
110028
|
-
var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
110029
|
-
function locatePathSync(paths, {
|
|
110030
|
-
cwd = import_node_process.default.cwd(),
|
|
110031
|
-
type = "file",
|
|
110032
|
-
allowSymlinks = true
|
|
110033
|
-
} = {}) {
|
|
110034
|
-
checkType(type);
|
|
110035
|
-
cwd = toPath(cwd);
|
|
110036
|
-
const statFunction = allowSymlinks ? import_node_fs.default.statSync : import_node_fs.default.lstatSync;
|
|
110037
|
-
for (const path_ of paths) {
|
|
110038
|
-
try {
|
|
110039
|
-
const stat = statFunction(import_node_path.default.resolve(cwd, path_), {
|
|
110040
|
-
throwIfNoEntry: false
|
|
110041
|
-
});
|
|
110042
|
-
if (!stat) {
|
|
110043
|
-
continue;
|
|
110044
|
-
}
|
|
110045
|
-
if (matchType(type, stat)) {
|
|
110046
|
-
return path_;
|
|
110047
|
-
}
|
|
110048
|
-
} catch {
|
|
110049
|
-
}
|
|
110050
|
-
}
|
|
110051
|
-
}
|
|
110052
|
-
|
|
110053
|
-
// packages/config-tools/src/utilities/find-up.ts
|
|
110054
|
-
var path2 = __toESM(require("path"), 1);
|
|
110055
|
-
var import_url = require("url");
|
|
110056
|
-
var findUpStop = Symbol("findUpStop");
|
|
110057
|
-
function toPath2(urlOrPath) {
|
|
110058
|
-
return urlOrPath instanceof URL ? (0, import_url.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
110059
|
-
}
|
|
110060
|
-
function findUpMultipleSync(names3, options = { limit: 1, type: "file" }) {
|
|
110061
|
-
let directory = path2.resolve(toPath2(options.cwd) ?? "");
|
|
110062
|
-
const { root } = path2.parse(directory);
|
|
110063
|
-
const stopAt = path2.resolve(directory, toPath2(options.stopAt) ?? root);
|
|
110064
|
-
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
110065
|
-
if (typeof names3 === "function") {
|
|
110066
|
-
const foundPath = names3(options.cwd);
|
|
110067
|
-
return locatePathSync([foundPath], options);
|
|
110068
|
-
}
|
|
110069
|
-
const runNameMatcher = (name) => {
|
|
110070
|
-
const paths = [name].flat();
|
|
110071
|
-
const runMatcher = (locateOptions) => {
|
|
110072
|
-
if (typeof name !== "function") {
|
|
110073
|
-
return locatePathSync(paths, locateOptions);
|
|
110074
|
-
}
|
|
110075
|
-
const foundPath = name(locateOptions.cwd);
|
|
110076
|
-
if (typeof foundPath === "string") {
|
|
110077
|
-
return locatePathSync([foundPath], locateOptions);
|
|
110078
|
-
}
|
|
110079
|
-
return foundPath;
|
|
110080
|
-
};
|
|
110081
|
-
const matches = [];
|
|
110082
|
-
while (true) {
|
|
110083
|
-
const foundPath = runMatcher({ ...options, cwd: directory });
|
|
110084
|
-
if (foundPath) {
|
|
110085
|
-
matches.push(path2.resolve(directory, foundPath));
|
|
110086
|
-
}
|
|
110087
|
-
if (directory === stopAt || matches.length >= limit) {
|
|
110088
|
-
break;
|
|
110089
|
-
}
|
|
110090
|
-
directory = path2.dirname(directory);
|
|
110091
|
-
}
|
|
110092
|
-
return matches;
|
|
110093
|
-
};
|
|
110094
|
-
return (names3 && Array.isArray(names3) ? names3 : [names3]).map((name) => runNameMatcher(name)).flat();
|
|
110095
|
-
}
|
|
110096
|
-
function findUpSync(names3, options = { limit: 1, type: "file" }) {
|
|
110097
|
-
const matches = findUpMultipleSync(names3, options);
|
|
110098
|
-
return matches[0];
|
|
110099
|
-
}
|
|
110100
|
-
|
|
110101
|
-
// packages/config-tools/src/utilities/find-workspace-root.ts
|
|
110102
|
-
var rootFiles = [
|
|
110103
|
-
"lerna.json",
|
|
110104
|
-
"nx.json",
|
|
110105
|
-
"turbo.json",
|
|
110106
|
-
"npm-workspace.json",
|
|
110107
|
-
"yarn-workspace.json",
|
|
110108
|
-
"pnpm-workspace.json",
|
|
110109
|
-
"npm-workspace.yaml",
|
|
110110
|
-
"yarn-workspace.yaml",
|
|
110111
|
-
"pnpm-workspace.yaml",
|
|
110112
|
-
"npm-workspace.yml",
|
|
110113
|
-
"yarn-workspace.yml",
|
|
110114
|
-
"pnpm-workspace.yml",
|
|
110115
|
-
"npm-lock.json",
|
|
110116
|
-
"yarn-lock.json",
|
|
110117
|
-
"pnpm-lock.json",
|
|
110118
|
-
"npm-lock.yaml",
|
|
110119
|
-
"yarn-lock.yaml",
|
|
110120
|
-
"pnpm-lock.yaml",
|
|
110121
|
-
"npm-lock.yml",
|
|
110122
|
-
"yarn-lock.yml",
|
|
110123
|
-
"pnpm-lock.yml",
|
|
110124
|
-
"bun.lockb"
|
|
110125
|
-
];
|
|
110126
|
-
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
110127
|
-
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, {
|
|
110128
|
-
cwd: pathInsideMonorepo ?? process.cwd(),
|
|
110129
|
-
type: "file",
|
|
110130
|
-
limit: 1
|
|
110131
|
-
});
|
|
110132
|
-
if (!result) {
|
|
110133
|
-
throw new Error(
|
|
110134
|
-
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
110135
|
-
${rootFiles.join(
|
|
110136
|
-
"\n"
|
|
110137
|
-
)}
|
|
110138
|
-
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
110139
|
-
);
|
|
110140
|
-
}
|
|
110141
|
-
return result;
|
|
110142
|
-
}
|
|
110143
|
-
|
|
110144
110147
|
// packages/config-tools/src/utilities/get-default-config.ts
|
|
110145
110148
|
var DefaultColorConfig = {
|
|
110146
110149
|
primary: "#1fb2a6",
|