@storm-software/workspace-tools 1.32.1 → 1.33.1
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/README.md +1 -1
- package/index.js +1502 -1502
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +64 -64
- package/src/executors/design-tokens/executor.js +641 -641
- package/src/executors/tsup/executor.js +1489 -1489
- package/src/executors/tsup-browser/executor.js +1495 -1495
- package/src/executors/tsup-neutral/executor.js +1495 -1495
- package/src/executors/tsup-node/executor.js +1495 -1495
- package/src/generators/browser-library/generator.js +365 -365
- package/src/generators/config-schema/generator.js +168 -168
- package/src/generators/neutral-library/generator.js +365 -365
- package/src/generators/node-library/generator.js +365 -365
- package/src/generators/preset/generator.js +167 -167
package/package.json
CHANGED
package/src/base/index.js
CHANGED
|
@@ -33,7 +33,7 @@ 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 path2 = require("path");
|
|
37
37
|
var Module = require("module");
|
|
38
38
|
var fs2 = require("fs");
|
|
39
39
|
var resolveFrom = (fromDir, moduleId, silent) => {
|
|
@@ -47,14 +47,14 @@ var require_resolve_from = __commonJS({
|
|
|
47
47
|
fromDir = fs2.realpathSync(fromDir);
|
|
48
48
|
} catch (err) {
|
|
49
49
|
if (err.code === "ENOENT") {
|
|
50
|
-
fromDir =
|
|
50
|
+
fromDir = path2.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 = path2.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 path2 = 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 ? path2.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 path2 = [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
|
+
path2.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 = path2;
|
|
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, (path2) => typescript.sys.readFile(path2));
|
|
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 path2 = 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 = path2.join(homedir, "Library");
|
|
5713
5713
|
return {
|
|
5714
|
-
data:
|
|
5715
|
-
config:
|
|
5716
|
-
cache:
|
|
5717
|
-
log:
|
|
5718
|
-
temp:
|
|
5714
|
+
data: path2.join(library, "Application Support", name),
|
|
5715
|
+
config: path2.join(library, "Preferences", name),
|
|
5716
|
+
cache: path2.join(library, "Caches", name),
|
|
5717
|
+
log: path2.join(library, "Logs", name),
|
|
5718
|
+
temp: path2.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 || path2.join(homedir, "AppData", "Roaming");
|
|
5723
|
+
const localAppData = env.LOCALAPPDATA || path2.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: path2.join(localAppData, name, "Data"),
|
|
5727
|
+
config: path2.join(appData, name, "Config"),
|
|
5728
|
+
cache: path2.join(localAppData, name, "Cache"),
|
|
5729
|
+
log: path2.join(localAppData, name, "Log"),
|
|
5730
|
+
temp: path2.join(tmpdir, name)
|
|
5731
5731
|
};
|
|
5732
5732
|
};
|
|
5733
5733
|
var linux = (name) => {
|
|
5734
|
-
const username =
|
|
5734
|
+
const username = path2.basename(homedir);
|
|
5735
5735
|
return {
|
|
5736
|
-
data:
|
|
5737
|
-
config:
|
|
5738
|
-
cache:
|
|
5736
|
+
data: path2.join(env.XDG_DATA_HOME || path2.join(homedir, ".local", "share"), name),
|
|
5737
|
+
config: path2.join(env.XDG_CONFIG_HOME || path2.join(homedir, ".config"), name),
|
|
5738
|
+
cache: path2.join(env.XDG_CACHE_HOME || path2.join(homedir, ".cache"), name),
|
|
5739
5739
|
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
5740
|
-
log:
|
|
5741
|
-
temp:
|
|
5740
|
+
log: path2.join(env.XDG_STATE_HOME || path2.join(homedir, ".local", "state"), name),
|
|
5741
|
+
temp: path2.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, path2) {
|
|
5815
|
+
if (typeof path2 === "string" && Object.prototype.hasOwnProperty.call(source, path2)) {
|
|
5816
|
+
return source[path2];
|
|
5817
5817
|
}
|
|
5818
|
-
const parsedPath = typeof
|
|
5818
|
+
const parsedPath = typeof path2 === "string" ? path2.split(".") : path2;
|
|
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(path2) {
|
|
5832
5832
|
try {
|
|
5833
|
-
const stat = await fs_1.promises.stat(
|
|
5833
|
+
const stat = await fs_1.promises.stat(path2);
|
|
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(path2) {
|
|
5844
5844
|
try {
|
|
5845
|
-
const stat = fs_1.default.statSync(
|
|
5845
|
+
const stat = fs_1.default.statSync(path2);
|
|
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((path2, i) => `${i + 1}. ${path2}`).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(path2) {
|
|
6129
6129
|
try {
|
|
6130
|
-
await promises_1.default.stat(
|
|
6130
|
+
await promises_1.default.stat(path2);
|
|
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(path2) {
|
|
6287
6287
|
try {
|
|
6288
|
-
fs_1.default.statSync(
|
|
6288
|
+
fs_1.default.statSync(path2);
|
|
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((path2) => path2.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 path2 = [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
|
+
path2.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 = path2;
|
|
7384
7384
|
return fn;
|
|
7385
7385
|
}
|
|
7386
7386
|
module2.exports = function(fromModel) {
|
|
@@ -8210,16 +8210,16 @@ function locatePathSync(paths, {
|
|
|
8210
8210
|
}
|
|
8211
8211
|
|
|
8212
8212
|
// packages/config-tools/src/utilities/find-up.ts
|
|
8213
|
-
var
|
|
8213
|
+
var import_path = require("path");
|
|
8214
8214
|
var import_url = require("url");
|
|
8215
8215
|
var findUpStop = Symbol("findUpStop");
|
|
8216
8216
|
function toPath2(urlOrPath) {
|
|
8217
8217
|
return urlOrPath instanceof URL ? (0, import_url.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
8218
8218
|
}
|
|
8219
8219
|
function findUpMultipleSync(names, options = { limit: 1, type: "file" }) {
|
|
8220
|
-
let directory =
|
|
8221
|
-
const { root } =
|
|
8222
|
-
const stopAt =
|
|
8220
|
+
let directory = (0, import_path.resolve)(toPath2(options.cwd) ?? "");
|
|
8221
|
+
const { root } = (0, import_path.parse)(directory);
|
|
8222
|
+
const stopAt = (0, import_path.resolve)(directory, toPath2(options.stopAt) ?? root);
|
|
8223
8223
|
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
8224
8224
|
if (typeof names === "function") {
|
|
8225
8225
|
const foundPath = names(options.cwd);
|
|
@@ -8241,16 +8241,16 @@ function findUpMultipleSync(names, options = { limit: 1, type: "file" }) {
|
|
|
8241
8241
|
while (true) {
|
|
8242
8242
|
const foundPath = runMatcher({ ...options, cwd: directory });
|
|
8243
8243
|
if (foundPath) {
|
|
8244
|
-
matches.push(
|
|
8244
|
+
matches.push((0, import_path.resolve)(directory, foundPath));
|
|
8245
8245
|
}
|
|
8246
8246
|
if (directory === stopAt || matches.length >= limit) {
|
|
8247
8247
|
break;
|
|
8248
8248
|
}
|
|
8249
|
-
directory =
|
|
8249
|
+
directory = (0, import_path.dirname)(directory);
|
|
8250
8250
|
}
|
|
8251
8251
|
return matches;
|
|
8252
8252
|
};
|
|
8253
|
-
return (names && Array.isArray(names) ? names : [names]).map((name) => runNameMatcher(name)).flat();
|
|
8253
|
+
return (names && Array.isArray(names) ? names : [names]).map((name) => runNameMatcher(name)).flat().map((path2) => path2 ? path2 : "");
|
|
8254
8254
|
}
|
|
8255
8255
|
function findUpSync(names, options = { limit: 1, type: "file" }) {
|
|
8256
8256
|
const matches = findUpMultipleSync(names, options);
|
|
@@ -8282,15 +8282,15 @@ var rootFiles = [
|
|
|
8282
8282
|
"pnpm-lock.yml",
|
|
8283
8283
|
"bun.lockb"
|
|
8284
8284
|
];
|
|
8285
|
-
function
|
|
8285
|
+
function findWorkspaceRootSafeSync(pathInsideMonorepo) {
|
|
8286
8286
|
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, {
|
|
8287
8287
|
cwd: pathInsideMonorepo ?? process.cwd(),
|
|
8288
8288
|
type: "file",
|
|
8289
8289
|
limit: 1
|
|
8290
8290
|
});
|
|
8291
8291
|
}
|
|
8292
|
-
function
|
|
8293
|
-
const result =
|
|
8292
|
+
function findWorkspaceRootSync(pathInsideMonorepo) {
|
|
8293
|
+
const result = findWorkspaceRootSafeSync(pathInsideMonorepo);
|
|
8294
8294
|
if (!result) {
|
|
8295
8295
|
throw new Error(
|
|
8296
8296
|
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
@@ -8305,7 +8305,7 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
8305
8305
|
|
|
8306
8306
|
// packages/config-tools/src/utilities/get-default-config.ts
|
|
8307
8307
|
var import_fs = require("fs");
|
|
8308
|
-
var
|
|
8308
|
+
var import_path2 = require("path");
|
|
8309
8309
|
|
|
8310
8310
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
8311
8311
|
var util;
|
|
@@ -8648,8 +8648,8 @@ function getErrorMap() {
|
|
|
8648
8648
|
return overrideErrorMap;
|
|
8649
8649
|
}
|
|
8650
8650
|
var makeIssue = (params) => {
|
|
8651
|
-
const { data, path:
|
|
8652
|
-
const fullPath = [...
|
|
8651
|
+
const { data, path: path2, errorMaps, issueData } = params;
|
|
8652
|
+
const fullPath = [...path2, ...issueData.path || []];
|
|
8653
8653
|
const fullIssue = {
|
|
8654
8654
|
...issueData,
|
|
8655
8655
|
path: fullPath
|
|
@@ -8747,11 +8747,11 @@ var errorUtil;
|
|
|
8747
8747
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
|
8748
8748
|
})(errorUtil || (errorUtil = {}));
|
|
8749
8749
|
var ParseInputLazyPath = class {
|
|
8750
|
-
constructor(parent, value,
|
|
8750
|
+
constructor(parent, value, path2, key) {
|
|
8751
8751
|
this._cachedPath = [];
|
|
8752
8752
|
this.parent = parent;
|
|
8753
8753
|
this.data = value;
|
|
8754
|
-
this._path =
|
|
8754
|
+
this._path = path2;
|
|
8755
8755
|
this._key = key;
|
|
8756
8756
|
}
|
|
8757
8757
|
get path() {
|
|
@@ -11974,9 +11974,9 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
11974
11974
|
let repository = "https://github.com/storm-software/storm-stack";
|
|
11975
11975
|
let license = DefaultStormConfig.license;
|
|
11976
11976
|
let homepage = DefaultStormConfig.homepage;
|
|
11977
|
-
const workspaceRoot =
|
|
11978
|
-
if ((0, import_fs.existsSync)((0,
|
|
11979
|
-
const file = (0, import_fs.readFileSync)((0,
|
|
11977
|
+
const workspaceRoot = findWorkspaceRootSync(root);
|
|
11978
|
+
if ((0, import_fs.existsSync)((0, import_path2.join)(workspaceRoot, "package.json"))) {
|
|
11979
|
+
const file = (0, import_fs.readFileSync)((0, import_path2.join)(workspaceRoot, "package.json"), {
|
|
11980
11980
|
encoding: "utf-8"
|
|
11981
11981
|
});
|
|
11982
11982
|
if (file) {
|