@storm-software/workspace-tools 1.43.6 → 1.43.8
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 +15 -0
- package/index.js +57 -119
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +8 -69
- package/src/executors/design-tokens/executor.js +21 -82
- package/src/executors/tsup/executor.js +36 -98
- package/src/executors/tsup-browser/executor.js +36 -98
- package/src/executors/tsup-neutral/executor.js +36 -98
- package/src/executors/tsup-node/executor.js +36 -98
- package/src/generators/browser-library/generator.js +8 -69
- package/src/generators/config-schema/generator.js +6 -67
- package/src/generators/neutral-library/generator.js +8 -69
- package/src/generators/node-library/generator.js +8 -69
- package/src/generators/preset/generator.js +6 -67
|
@@ -29754,7 +29754,7 @@ var require_jsonfile = __commonJS({
|
|
|
29754
29754
|
return obj;
|
|
29755
29755
|
}
|
|
29756
29756
|
var readFile = universalify.fromPromise(_readFile);
|
|
29757
|
-
function
|
|
29757
|
+
function readFileSync2(file, options = {}) {
|
|
29758
29758
|
if (typeof options === "string") {
|
|
29759
29759
|
options = { encoding: options };
|
|
29760
29760
|
}
|
|
@@ -29786,7 +29786,7 @@ var require_jsonfile = __commonJS({
|
|
|
29786
29786
|
}
|
|
29787
29787
|
var jsonfile = {
|
|
29788
29788
|
readFile,
|
|
29789
|
-
readFileSync:
|
|
29789
|
+
readFileSync: readFileSync2,
|
|
29790
29790
|
writeFile: writeFile2,
|
|
29791
29791
|
writeFileSync: writeFileSync2
|
|
29792
29792
|
};
|
|
@@ -46989,7 +46989,7 @@ var require_lib6 = __commonJS({
|
|
|
46989
46989
|
function _interopRequireDefault(obj) {
|
|
46990
46990
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
46991
46991
|
}
|
|
46992
|
-
var
|
|
46992
|
+
var readFileSync2 = (fp) => {
|
|
46993
46993
|
return _fs.default.readFileSync(fp, "utf8");
|
|
46994
46994
|
};
|
|
46995
46995
|
var pathExists = (fp) => new Promise((resolve) => {
|
|
@@ -47113,7 +47113,7 @@ var require_lib6 = __commonJS({
|
|
|
47113
47113
|
if (this.packageJsonCache.has(filepath2)) {
|
|
47114
47114
|
return this.packageJsonCache.get(filepath2)[options.packageKey];
|
|
47115
47115
|
}
|
|
47116
|
-
const data2 = this.options.parseJSON(
|
|
47116
|
+
const data2 = this.options.parseJSON(readFileSync2(filepath2));
|
|
47117
47117
|
return data2;
|
|
47118
47118
|
}
|
|
47119
47119
|
};
|
|
@@ -47147,7 +47147,7 @@ var require_lib6 = __commonJS({
|
|
|
47147
47147
|
if (this.packageJsonCache.has(filepath2)) {
|
|
47148
47148
|
return this.packageJsonCache.get(filepath2)[options.packageKey];
|
|
47149
47149
|
}
|
|
47150
|
-
const data2 = this.options.parseJSON(
|
|
47150
|
+
const data2 = this.options.parseJSON(readFileSync2(filepath2));
|
|
47151
47151
|
return data2;
|
|
47152
47152
|
}
|
|
47153
47153
|
};
|
|
@@ -73213,7 +73213,7 @@ var require_util5 = __commonJS({
|
|
|
73213
73213
|
var normalize2 = createSafeHandler((url) => {
|
|
73214
73214
|
});
|
|
73215
73215
|
exports.normalize = normalize2;
|
|
73216
|
-
function
|
|
73216
|
+
function join3(aRoot, aPath) {
|
|
73217
73217
|
const pathType = getURLType(aPath);
|
|
73218
73218
|
const rootType = getURLType(aRoot);
|
|
73219
73219
|
aRoot = ensureDirectory(aRoot);
|
|
@@ -73239,7 +73239,7 @@ var require_util5 = __commonJS({
|
|
|
73239
73239
|
const newPath = withBase(aPath, withBase(aRoot, base));
|
|
73240
73240
|
return computeRelativeURL(base, newPath);
|
|
73241
73241
|
}
|
|
73242
|
-
exports.join =
|
|
73242
|
+
exports.join = join3;
|
|
73243
73243
|
function relative(rootURL, targetURL) {
|
|
73244
73244
|
const result = relativeIfPossible(rootURL, targetURL);
|
|
73245
73245
|
return typeof result === "string" ? result : normalize2(targetURL);
|
|
@@ -73269,9 +73269,9 @@ var require_util5 = __commonJS({
|
|
|
73269
73269
|
}
|
|
73270
73270
|
let url = normalize2(sourceURL || "");
|
|
73271
73271
|
if (sourceRoot)
|
|
73272
|
-
url =
|
|
73272
|
+
url = join3(sourceRoot, url);
|
|
73273
73273
|
if (sourceMapURL)
|
|
73274
|
-
url =
|
|
73274
|
+
url = join3(trimFilename(sourceMapURL), url);
|
|
73275
73275
|
return url;
|
|
73276
73276
|
}
|
|
73277
73277
|
exports.computeSourceURL = computeSourceURL;
|
|
@@ -75036,8 +75036,8 @@ var require_source_map = __commonJS({
|
|
|
75036
75036
|
// node_modules/.pnpm/rollup@4.5.0/node_modules/rollup/dist/native.js
|
|
75037
75037
|
var require_native = __commonJS({
|
|
75038
75038
|
"node_modules/.pnpm/rollup@4.5.0/node_modules/rollup/dist/native.js"(exports, module2) {
|
|
75039
|
-
var { existsSync:
|
|
75040
|
-
var { join:
|
|
75039
|
+
var { existsSync: existsSync2 } = require("node:fs");
|
|
75040
|
+
var { join: join3 } = require("node:path");
|
|
75041
75041
|
var { platform, arch, report } = require("node:process");
|
|
75042
75042
|
var isMusl = () => !report.getReport().header.glibcVersionRuntime;
|
|
75043
75043
|
var bindingsByPlatformAndArch = {
|
|
@@ -75087,7 +75087,7 @@ If this is important to you, please consider supporting Rollup to make a native
|
|
|
75087
75087
|
return imported.base;
|
|
75088
75088
|
}
|
|
75089
75089
|
var localName = `./rollup.${packageBase}.node`;
|
|
75090
|
-
var { parse, parseAsync, xxhashBase64Url } =
|
|
75090
|
+
var { parse, parseAsync, xxhashBase64Url } = existsSync2(join3(__dirname, localName)) ? require(localName) : require(`@rollup/rollup-${packageBase}`);
|
|
75091
75091
|
module2.exports.parse = parse;
|
|
75092
75092
|
module2.exports.parseAsync = parseAsync;
|
|
75093
75093
|
module2.exports.xxhashBase64Url = xxhashBase64Url;
|
|
@@ -111220,7 +111220,7 @@ var require_TransformerError = __commonJS({
|
|
|
111220
111220
|
TransformerError2.from = function(method) {
|
|
111221
111221
|
return function(errors) {
|
|
111222
111222
|
var body = errors.map(function(e) {
|
|
111223
|
-
var subject = e.explore.object === null ? "" :
|
|
111223
|
+
var subject = e.explore.object === null ? "" : join3(e.explore.object)(e.explore.property);
|
|
111224
111224
|
var type = "".concat(subject.length ? "".concat(subject, ": ") : "").concat(e.name);
|
|
111225
111225
|
return "- ".concat(type, "\n").concat(e.messages.map(function(msg) {
|
|
111226
111226
|
return " - ".concat(msg);
|
|
@@ -111232,7 +111232,7 @@ var require_TransformerError = __commonJS({
|
|
|
111232
111232
|
});
|
|
111233
111233
|
};
|
|
111234
111234
|
};
|
|
111235
|
-
var
|
|
111235
|
+
var join3 = function(object) {
|
|
111236
111236
|
return function(key) {
|
|
111237
111237
|
if (key === null)
|
|
111238
111238
|
return object.name;
|
|
@@ -117312,13 +117312,13 @@ var require_application_object = __commonJS({
|
|
|
117312
117312
|
return __assign2(__assign2({ type: "object", properties, nullable: options.purpose === "swagger" ? nullable : void 0, required: required.length ? required : void 0, description: obj.description }, options.surplus ? { "x-typia-jsDocTags": obj.jsDocTags } : {}), options.purpose === "ajv" ? extraProps : options.surplus ? {
|
|
117313
117313
|
"x-typia-additionalProperties": extraProps.additionalProperties,
|
|
117314
117314
|
"x-typia-patternProperties": extraProps.patternProperties,
|
|
117315
|
-
additionalProperties:
|
|
117315
|
+
additionalProperties: join3(options)(components)(extraMeta)
|
|
117316
117316
|
} : {});
|
|
117317
117317
|
};
|
|
117318
117318
|
};
|
|
117319
117319
|
};
|
|
117320
117320
|
};
|
|
117321
|
-
var
|
|
117321
|
+
var join3 = function(options) {
|
|
117322
117322
|
return function(components) {
|
|
117323
117323
|
return function(extra) {
|
|
117324
117324
|
var _a;
|
|
@@ -126332,7 +126332,7 @@ module.exports = __toCommonJS(executor_exports);
|
|
|
126332
126332
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
126333
126333
|
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
126334
126334
|
var _static_cache = void 0;
|
|
126335
|
-
var getConfigFileName = (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
126335
|
+
var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
126336
126336
|
var getConfigFile = async (filePath) => {
|
|
126337
126337
|
if (_static_cache) {
|
|
126338
126338
|
return _static_cache;
|
|
@@ -126460,10 +126460,6 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
126460
126460
|
return result;
|
|
126461
126461
|
}
|
|
126462
126462
|
|
|
126463
|
-
// packages/config-tools/src/utilities/get-default-config.ts
|
|
126464
|
-
var import_node_fs2 = require("node:fs");
|
|
126465
|
-
var import_node_path2 = require("node:path");
|
|
126466
|
-
|
|
126467
126463
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
126468
126464
|
var util;
|
|
126469
126465
|
(function(util2) {
|
|
@@ -130124,51 +130120,6 @@ var DefaultStormConfig = {
|
|
|
130124
130120
|
colors: { ...DefaultColorConfig },
|
|
130125
130121
|
extensions: {}
|
|
130126
130122
|
};
|
|
130127
|
-
var getDefaultConfig = (config = {}, root) => {
|
|
130128
|
-
let name = "storm-workspace";
|
|
130129
|
-
let namespace = "storm-software";
|
|
130130
|
-
let repository = "https://github.com/storm-software/storm-ops";
|
|
130131
|
-
let license = DefaultStormConfig.license;
|
|
130132
|
-
let homepage = DefaultStormConfig.homepage;
|
|
130133
|
-
const workspaceRoot = findWorkspaceRoot(root);
|
|
130134
|
-
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
130135
|
-
const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
|
|
130136
|
-
encoding: "utf-8"
|
|
130137
|
-
});
|
|
130138
|
-
if (file) {
|
|
130139
|
-
const packageJson = JSON.parse(file);
|
|
130140
|
-
if (packageJson.name) {
|
|
130141
|
-
name = packageJson.name;
|
|
130142
|
-
}
|
|
130143
|
-
if (packageJson.namespace) {
|
|
130144
|
-
namespace = packageJson.namespace;
|
|
130145
|
-
}
|
|
130146
|
-
if (packageJson.repository?.url) {
|
|
130147
|
-
repository = packageJson.repository?.url;
|
|
130148
|
-
}
|
|
130149
|
-
if (packageJson.license) {
|
|
130150
|
-
license = packageJson.license;
|
|
130151
|
-
}
|
|
130152
|
-
if (packageJson.homepage) {
|
|
130153
|
-
homepage = packageJson.homepage;
|
|
130154
|
-
}
|
|
130155
|
-
}
|
|
130156
|
-
}
|
|
130157
|
-
return StormConfigSchema.parse({
|
|
130158
|
-
...config,
|
|
130159
|
-
...DefaultStormConfig,
|
|
130160
|
-
colors: { ...config.colors, ...DefaultColorConfig },
|
|
130161
|
-
workspaceRoot,
|
|
130162
|
-
name,
|
|
130163
|
-
namespace,
|
|
130164
|
-
repository,
|
|
130165
|
-
license: license ?? DefaultStormConfig.license,
|
|
130166
|
-
homepage: homepage ?? DefaultStormConfig.homepage,
|
|
130167
|
-
extensions: {
|
|
130168
|
-
...config.extensions
|
|
130169
|
-
}
|
|
130170
|
-
});
|
|
130171
|
-
};
|
|
130172
130123
|
|
|
130173
130124
|
// packages/config-tools/src/utilities/get-log-level.ts
|
|
130174
130125
|
var getLogLevel = (label) => {
|
|
@@ -130570,26 +130521,15 @@ var getConfigEnv = () => {
|
|
|
130570
130521
|
|
|
130571
130522
|
// packages/config-tools/src/create-storm-config.ts
|
|
130572
130523
|
var loadStormConfig = async (workspaceRoot) => {
|
|
130573
|
-
let config = {};
|
|
130574
130524
|
let _workspaceRoot = workspaceRoot;
|
|
130575
130525
|
if (!_workspaceRoot) {
|
|
130576
130526
|
_workspaceRoot = findWorkspaceRoot();
|
|
130577
130527
|
}
|
|
130578
|
-
const configFile =
|
|
130579
|
-
|
|
130580
|
-
|
|
130581
|
-
|
|
130582
|
-
|
|
130583
|
-
_workspaceRoot
|
|
130584
|
-
);
|
|
130585
|
-
if (configFile) {
|
|
130586
|
-
config = StormConfigSchema.parse(configFile);
|
|
130587
|
-
} else {
|
|
130588
|
-
writeWarning(
|
|
130589
|
-
config,
|
|
130590
|
-
"No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.config.js` file to the root of your workspace if it is not."
|
|
130591
|
-
);
|
|
130592
|
-
}
|
|
130528
|
+
const configFile = {
|
|
130529
|
+
...await getConfigFile(_workspaceRoot),
|
|
130530
|
+
...getConfigEnv()
|
|
130531
|
+
};
|
|
130532
|
+
const config = StormConfigSchema.parse(configFile);
|
|
130593
130533
|
setConfigEnv(config);
|
|
130594
130534
|
return config;
|
|
130595
130535
|
};
|
|
@@ -130807,9 +130747,9 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
130807
130747
|
};
|
|
130808
130748
|
|
|
130809
130749
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
130810
|
-
var
|
|
130750
|
+
var import_node_fs2 = require("node:fs");
|
|
130811
130751
|
var import_promises2 = require("node:fs/promises");
|
|
130812
|
-
var
|
|
130752
|
+
var import_node_path2 = require("node:path");
|
|
130813
130753
|
var import_esbuild_decorators = __toESM(require_src());
|
|
130814
130754
|
var import_devkit2 = __toESM(require_devkit());
|
|
130815
130755
|
var import_js = __toESM(require_src2());
|
|
@@ -137229,9 +137169,9 @@ ${Object.keys(options).map(
|
|
|
137229
137169
|
if (!result.success) {
|
|
137230
137170
|
throw new Error("The Build process failed trying to copy assets");
|
|
137231
137171
|
}
|
|
137232
|
-
const pathToPackageJson = (0,
|
|
137172
|
+
const pathToPackageJson = (0, import_node_path2.join)(context.root, projectRoot, "package.json");
|
|
137233
137173
|
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
|
|
137234
|
-
const workspacePackageJson = (0, import_devkit2.readJsonFile)((0,
|
|
137174
|
+
const workspacePackageJson = (0, import_devkit2.readJsonFile)((0, import_node_path2.join)(workspaceRoot, "package.json"));
|
|
137235
137175
|
options.external = options.external || [];
|
|
137236
137176
|
if (workspacePackageJson?.dependencies) {
|
|
137237
137177
|
options.external = Object.keys(workspacePackageJson?.dependencies).reduce(
|
|
@@ -137269,9 +137209,7 @@ ${Object.keys(options).map(
|
|
|
137269
137209
|
}
|
|
137270
137210
|
if (implicitDependencies && implicitDependencies.length > 0) {
|
|
137271
137211
|
options.external = implicitDependencies.reduce((ret, key) => {
|
|
137272
|
-
|
|
137273
|
-
writeDebug(config, `\u26A1 Adding implicit dependency: ${key}`);
|
|
137274
|
-
}
|
|
137212
|
+
writeDebug(config, `\u26A1 Adding implicit dependency: ${key}`);
|
|
137275
137213
|
const projectConfig = projectConfigs[key];
|
|
137276
137214
|
if (projectConfig?.targets?.build) {
|
|
137277
137215
|
const projectPackageJson = (0, import_devkit2.readJsonFile)(projectConfig.targets?.build.options.project);
|
|
@@ -137392,11 +137330,11 @@ ${externalDependencies.map((dep) => {
|
|
|
137392
137330
|
},
|
|
137393
137331
|
...(options.additionalEntryPoints ?? []).map((entryPoint) => ({
|
|
137394
137332
|
[removeExtension(entryPoint).replace(sourceRoot, "")]: {
|
|
137395
|
-
types: (0,
|
|
137333
|
+
types: (0, import_node_path2.join)(
|
|
137396
137334
|
`./${distPaths[0]}`,
|
|
137397
137335
|
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.d.ts`
|
|
137398
137336
|
),
|
|
137399
|
-
default: (0,
|
|
137337
|
+
default: (0, import_node_path2.join)(
|
|
137400
137338
|
`./${distPaths[0]}`,
|
|
137401
137339
|
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.js`
|
|
137402
137340
|
)
|
|
@@ -137442,7 +137380,7 @@ ${externalDependencies.map((dep) => {
|
|
|
137442
137380
|
if (distSrc.startsWith("/")) {
|
|
137443
137381
|
distSrc = distSrc.substring(1);
|
|
137444
137382
|
}
|
|
137445
|
-
packageJson.source ??= `${(0,
|
|
137383
|
+
packageJson.source ??= `${(0, import_node_path2.join)(distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
137446
137384
|
}
|
|
137447
137385
|
packageJson.sideEffects ??= false;
|
|
137448
137386
|
packageJson.files ??= ["dist/**/*"];
|
|
@@ -137460,10 +137398,10 @@ ${externalDependencies.map((dep) => {
|
|
|
137460
137398
|
packageJson.license ??= workspacePackageJson.license;
|
|
137461
137399
|
packageJson.keywords ??= workspacePackageJson.keywords;
|
|
137462
137400
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
137463
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot : (0,
|
|
137464
|
-
const packageJsonPath = (0,
|
|
137401
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_node_path2.join)("packages", context.projectName);
|
|
137402
|
+
const packageJsonPath = (0, import_node_path2.join)(context.root, options.outputPath, "package.json");
|
|
137465
137403
|
writeDebug(config, `\u26A1 Writing package.json file to: ${packageJsonPath}`);
|
|
137466
|
-
(0,
|
|
137404
|
+
(0, import_node_fs2.writeFileSync)(
|
|
137467
137405
|
packageJsonPath,
|
|
137468
137406
|
await (0, import_prettier.format)(JSON.stringify(packageJson), {
|
|
137469
137407
|
...prettierOptions,
|
|
@@ -137487,7 +137425,7 @@ ${externalDependencies.map((dep) => {
|
|
|
137487
137425
|
await (0, import_prettier.format)(
|
|
137488
137426
|
`${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
|
|
137489
137427
|
|
|
137490
|
-
${(0,
|
|
137428
|
+
${(0, import_node_fs2.readFileSync)(file, "utf-8")}`,
|
|
137491
137429
|
{
|
|
137492
137430
|
...prettierOptions,
|
|
137493
137431
|
parser: "typescript"
|
|
@@ -137592,11 +137530,11 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
137592
137530
|
emitDeclarationOnly: true,
|
|
137593
137531
|
declaration: true,
|
|
137594
137532
|
declarationMap: true,
|
|
137595
|
-
declarationDir: (0,
|
|
137533
|
+
declarationDir: (0, import_node_path2.join)(workspaceRoot, "tmp", ".tsup", "declaration")
|
|
137596
137534
|
}
|
|
137597
137535
|
},
|
|
137598
137536
|
ts.sys,
|
|
137599
|
-
(0,
|
|
137537
|
+
(0, import_node_path2.dirname)(options.tsConfig)
|
|
137600
137538
|
);
|
|
137601
137539
|
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
137602
137540
|
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
@@ -34308,7 +34308,7 @@ var require_jsonfile = __commonJS({
|
|
|
34308
34308
|
return obj;
|
|
34309
34309
|
}
|
|
34310
34310
|
var readFile = universalify.fromPromise(_readFile);
|
|
34311
|
-
function
|
|
34311
|
+
function readFileSync(file, options = {}) {
|
|
34312
34312
|
if (typeof options === "string") {
|
|
34313
34313
|
options = { encoding: options };
|
|
34314
34314
|
}
|
|
@@ -34340,7 +34340,7 @@ var require_jsonfile = __commonJS({
|
|
|
34340
34340
|
}
|
|
34341
34341
|
var jsonfile = {
|
|
34342
34342
|
readFile,
|
|
34343
|
-
readFileSync
|
|
34343
|
+
readFileSync,
|
|
34344
34344
|
writeFile,
|
|
34345
34345
|
writeFileSync
|
|
34346
34346
|
};
|
|
@@ -43478,7 +43478,7 @@ var import_devkit2 = __toESM(require_devkit());
|
|
|
43478
43478
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
43479
43479
|
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
43480
43480
|
var _static_cache = void 0;
|
|
43481
|
-
var getConfigFileName = (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
43481
|
+
var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
43482
43482
|
var getConfigFile = async (filePath) => {
|
|
43483
43483
|
if (_static_cache) {
|
|
43484
43484
|
return _static_cache;
|
|
@@ -43606,10 +43606,6 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
43606
43606
|
return result;
|
|
43607
43607
|
}
|
|
43608
43608
|
|
|
43609
|
-
// packages/config-tools/src/utilities/get-default-config.ts
|
|
43610
|
-
var import_node_fs2 = require("node:fs");
|
|
43611
|
-
var import_node_path2 = require("node:path");
|
|
43612
|
-
|
|
43613
43609
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
43614
43610
|
var util;
|
|
43615
43611
|
(function(util2) {
|
|
@@ -47270,51 +47266,6 @@ var DefaultStormConfig = {
|
|
|
47270
47266
|
colors: { ...DefaultColorConfig },
|
|
47271
47267
|
extensions: {}
|
|
47272
47268
|
};
|
|
47273
|
-
var getDefaultConfig = (config = {}, root) => {
|
|
47274
|
-
let name = "storm-workspace";
|
|
47275
|
-
let namespace = "storm-software";
|
|
47276
|
-
let repository = "https://github.com/storm-software/storm-ops";
|
|
47277
|
-
let license = DefaultStormConfig.license;
|
|
47278
|
-
let homepage = DefaultStormConfig.homepage;
|
|
47279
|
-
const workspaceRoot = findWorkspaceRoot(root);
|
|
47280
|
-
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
47281
|
-
const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
|
|
47282
|
-
encoding: "utf-8"
|
|
47283
|
-
});
|
|
47284
|
-
if (file) {
|
|
47285
|
-
const packageJson = JSON.parse(file);
|
|
47286
|
-
if (packageJson.name) {
|
|
47287
|
-
name = packageJson.name;
|
|
47288
|
-
}
|
|
47289
|
-
if (packageJson.namespace) {
|
|
47290
|
-
namespace = packageJson.namespace;
|
|
47291
|
-
}
|
|
47292
|
-
if (packageJson.repository?.url) {
|
|
47293
|
-
repository = packageJson.repository?.url;
|
|
47294
|
-
}
|
|
47295
|
-
if (packageJson.license) {
|
|
47296
|
-
license = packageJson.license;
|
|
47297
|
-
}
|
|
47298
|
-
if (packageJson.homepage) {
|
|
47299
|
-
homepage = packageJson.homepage;
|
|
47300
|
-
}
|
|
47301
|
-
}
|
|
47302
|
-
}
|
|
47303
|
-
return StormConfigSchema.parse({
|
|
47304
|
-
...config,
|
|
47305
|
-
...DefaultStormConfig,
|
|
47306
|
-
colors: { ...config.colors, ...DefaultColorConfig },
|
|
47307
|
-
workspaceRoot,
|
|
47308
|
-
name,
|
|
47309
|
-
namespace,
|
|
47310
|
-
repository,
|
|
47311
|
-
license: license ?? DefaultStormConfig.license,
|
|
47312
|
-
homepage: homepage ?? DefaultStormConfig.homepage,
|
|
47313
|
-
extensions: {
|
|
47314
|
-
...config.extensions
|
|
47315
|
-
}
|
|
47316
|
-
});
|
|
47317
|
-
};
|
|
47318
47269
|
|
|
47319
47270
|
// packages/config-tools/src/utilities/get-log-level.ts
|
|
47320
47271
|
var getLogLevel = (label) => {
|
|
@@ -47494,7 +47445,6 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
47494
47445
|
};
|
|
47495
47446
|
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
47496
47447
|
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
47497
|
-
var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
|
|
47498
47448
|
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
47499
47449
|
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
47500
47450
|
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
@@ -47716,26 +47666,15 @@ var getConfigEnv = () => {
|
|
|
47716
47666
|
|
|
47717
47667
|
// packages/config-tools/src/create-storm-config.ts
|
|
47718
47668
|
var loadStormConfig = async (workspaceRoot) => {
|
|
47719
|
-
let config = {};
|
|
47720
47669
|
let _workspaceRoot = workspaceRoot;
|
|
47721
47670
|
if (!_workspaceRoot) {
|
|
47722
47671
|
_workspaceRoot = findWorkspaceRoot();
|
|
47723
47672
|
}
|
|
47724
|
-
const configFile =
|
|
47725
|
-
|
|
47726
|
-
|
|
47727
|
-
|
|
47728
|
-
|
|
47729
|
-
_workspaceRoot
|
|
47730
|
-
);
|
|
47731
|
-
if (configFile) {
|
|
47732
|
-
config = StormConfigSchema.parse(configFile);
|
|
47733
|
-
} else {
|
|
47734
|
-
writeWarning(
|
|
47735
|
-
config,
|
|
47736
|
-
"No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.config.js` file to the root of your workspace if it is not."
|
|
47737
|
-
);
|
|
47738
|
-
}
|
|
47673
|
+
const configFile = {
|
|
47674
|
+
...await getConfigFile(_workspaceRoot),
|
|
47675
|
+
...getConfigEnv()
|
|
47676
|
+
};
|
|
47677
|
+
const config = StormConfigSchema.parse(configFile);
|
|
47739
47678
|
setConfigEnv(config);
|
|
47740
47679
|
return config;
|
|
47741
47680
|
};
|
|
@@ -26236,7 +26236,7 @@ var import_devkit = __toESM(require_devkit());
|
|
|
26236
26236
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
26237
26237
|
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
26238
26238
|
var _static_cache = void 0;
|
|
26239
|
-
var getConfigFileName = (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
26239
|
+
var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
26240
26240
|
var getConfigFile = async (filePath) => {
|
|
26241
26241
|
if (_static_cache) {
|
|
26242
26242
|
return _static_cache;
|
|
@@ -26364,10 +26364,6 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
26364
26364
|
return result;
|
|
26365
26365
|
}
|
|
26366
26366
|
|
|
26367
|
-
// packages/config-tools/src/utilities/get-default-config.ts
|
|
26368
|
-
var import_node_fs2 = require("node:fs");
|
|
26369
|
-
var import_node_path2 = require("node:path");
|
|
26370
|
-
|
|
26371
26367
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
26372
26368
|
var util;
|
|
26373
26369
|
(function(util2) {
|
|
@@ -30028,51 +30024,6 @@ var DefaultStormConfig = {
|
|
|
30028
30024
|
colors: { ...DefaultColorConfig },
|
|
30029
30025
|
extensions: {}
|
|
30030
30026
|
};
|
|
30031
|
-
var getDefaultConfig = (config = {}, root) => {
|
|
30032
|
-
let name = "storm-workspace";
|
|
30033
|
-
let namespace = "storm-software";
|
|
30034
|
-
let repository = "https://github.com/storm-software/storm-ops";
|
|
30035
|
-
let license = DefaultStormConfig.license;
|
|
30036
|
-
let homepage = DefaultStormConfig.homepage;
|
|
30037
|
-
const workspaceRoot = findWorkspaceRoot(root);
|
|
30038
|
-
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
30039
|
-
const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
|
|
30040
|
-
encoding: "utf-8"
|
|
30041
|
-
});
|
|
30042
|
-
if (file) {
|
|
30043
|
-
const packageJson = JSON.parse(file);
|
|
30044
|
-
if (packageJson.name) {
|
|
30045
|
-
name = packageJson.name;
|
|
30046
|
-
}
|
|
30047
|
-
if (packageJson.namespace) {
|
|
30048
|
-
namespace = packageJson.namespace;
|
|
30049
|
-
}
|
|
30050
|
-
if (packageJson.repository?.url) {
|
|
30051
|
-
repository = packageJson.repository?.url;
|
|
30052
|
-
}
|
|
30053
|
-
if (packageJson.license) {
|
|
30054
|
-
license = packageJson.license;
|
|
30055
|
-
}
|
|
30056
|
-
if (packageJson.homepage) {
|
|
30057
|
-
homepage = packageJson.homepage;
|
|
30058
|
-
}
|
|
30059
|
-
}
|
|
30060
|
-
}
|
|
30061
|
-
return StormConfigSchema.parse({
|
|
30062
|
-
...config,
|
|
30063
|
-
...DefaultStormConfig,
|
|
30064
|
-
colors: { ...config.colors, ...DefaultColorConfig },
|
|
30065
|
-
workspaceRoot,
|
|
30066
|
-
name,
|
|
30067
|
-
namespace,
|
|
30068
|
-
repository,
|
|
30069
|
-
license: license ?? DefaultStormConfig.license,
|
|
30070
|
-
homepage: homepage ?? DefaultStormConfig.homepage,
|
|
30071
|
-
extensions: {
|
|
30072
|
-
...config.extensions
|
|
30073
|
-
}
|
|
30074
|
-
});
|
|
30075
|
-
};
|
|
30076
30027
|
|
|
30077
30028
|
// packages/config-tools/src/utilities/get-log-level.ts
|
|
30078
30029
|
var getLogLevel = (label) => {
|
|
@@ -30252,7 +30203,6 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
30252
30203
|
};
|
|
30253
30204
|
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
30254
30205
|
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
30255
|
-
var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
|
|
30256
30206
|
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
30257
30207
|
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
30258
30208
|
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
@@ -30474,26 +30424,15 @@ var getConfigEnv = () => {
|
|
|
30474
30424
|
|
|
30475
30425
|
// packages/config-tools/src/create-storm-config.ts
|
|
30476
30426
|
var loadStormConfig = async (workspaceRoot) => {
|
|
30477
|
-
let config = {};
|
|
30478
30427
|
let _workspaceRoot = workspaceRoot;
|
|
30479
30428
|
if (!_workspaceRoot) {
|
|
30480
30429
|
_workspaceRoot = findWorkspaceRoot();
|
|
30481
30430
|
}
|
|
30482
|
-
const configFile =
|
|
30483
|
-
|
|
30484
|
-
|
|
30485
|
-
|
|
30486
|
-
|
|
30487
|
-
_workspaceRoot
|
|
30488
|
-
);
|
|
30489
|
-
if (configFile) {
|
|
30490
|
-
config = StormConfigSchema.parse(configFile);
|
|
30491
|
-
} else {
|
|
30492
|
-
writeWarning(
|
|
30493
|
-
config,
|
|
30494
|
-
"No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.config.js` file to the root of your workspace if it is not."
|
|
30495
|
-
);
|
|
30496
|
-
}
|
|
30431
|
+
const configFile = {
|
|
30432
|
+
...await getConfigFile(_workspaceRoot),
|
|
30433
|
+
...getConfigEnv()
|
|
30434
|
+
};
|
|
30435
|
+
const config = StormConfigSchema.parse(configFile);
|
|
30497
30436
|
setConfigEnv(config);
|
|
30498
30437
|
return config;
|
|
30499
30438
|
};
|