@storm-software/config-tools 1.50.0 → 1.51.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 +7 -0
- package/README.md +1 -1
- package/index.cjs +49 -18
- package/index.js +49 -18
- package/meta.cjs.json +1 -1
- package/meta.esm.json +1 -1
- package/package.json +1 -1
- package/utilities/logger.cjs +8 -0
- package/utilities/logger.js +8 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/)
|
|
25
25
|
[](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://docusaurus.io/) 
|
|
26
26
|
|
|
27
27
|
> [!IMPORTANT]
|
package/index.cjs
CHANGED
|
@@ -57086,7 +57086,7 @@ function hash(object, options = {}) {
|
|
|
57086
57086
|
return sha256base64(hashed).slice(0, 10);
|
|
57087
57087
|
}
|
|
57088
57088
|
|
|
57089
|
-
// node_modules/.pnpm/pkg-types@1.1.
|
|
57089
|
+
// node_modules/.pnpm/pkg-types@1.1.1/node_modules/pkg-types/dist/index.mjs
|
|
57090
57090
|
var import_node_fs4 = require("node:fs");
|
|
57091
57091
|
init_dist();
|
|
57092
57092
|
|
|
@@ -62418,11 +62418,6 @@ var import_node_module = require("node:module");
|
|
|
62418
62418
|
var import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
62419
62419
|
init_dist2();
|
|
62420
62420
|
init_dist();
|
|
62421
|
-
|
|
62422
|
-
// node_modules/.pnpm/confbox@0.1.7/node_modules/confbox/dist/index.mjs
|
|
62423
|
-
init_confbox_bcd59e75();
|
|
62424
|
-
|
|
62425
|
-
// node_modules/.pnpm/mlly@1.7.0/node_modules/mlly/dist/index.mjs
|
|
62426
62421
|
var import_node_url = require("node:url");
|
|
62427
62422
|
var import_node_assert = __toESM(require("node:assert"), 1);
|
|
62428
62423
|
var import_node_process = __toESM(require("node:process"), 1);
|
|
@@ -63776,7 +63771,10 @@ function resolvePath(id, options) {
|
|
|
63776
63771
|
}
|
|
63777
63772
|
}
|
|
63778
63773
|
|
|
63779
|
-
// node_modules/.pnpm/
|
|
63774
|
+
// node_modules/.pnpm/confbox@0.1.7/node_modules/confbox/dist/index.mjs
|
|
63775
|
+
init_confbox_bcd59e75();
|
|
63776
|
+
|
|
63777
|
+
// node_modules/.pnpm/pkg-types@1.1.1/node_modules/pkg-types/dist/index.mjs
|
|
63780
63778
|
var defaultFindOptions = {
|
|
63781
63779
|
startingFrom: ".",
|
|
63782
63780
|
rootPattern: /^node_modules$/,
|
|
@@ -63791,6 +63789,7 @@ var defaultFindOptions = {
|
|
|
63791
63789
|
}
|
|
63792
63790
|
};
|
|
63793
63791
|
async function findFile(filename, _options = {}) {
|
|
63792
|
+
const filenames = Array.isArray(filename) ? filename : [filename];
|
|
63794
63793
|
const options = { ...defaultFindOptions, ..._options };
|
|
63795
63794
|
const basePath = resolve(options.startingFrom);
|
|
63796
63795
|
const leadingSlash = basePath[0] === "/";
|
|
@@ -63804,16 +63803,20 @@ async function findFile(filename, _options = {}) {
|
|
|
63804
63803
|
}
|
|
63805
63804
|
if (options.reverse) {
|
|
63806
63805
|
for (let index = root + 1; index <= segments.length; index++) {
|
|
63807
|
-
const
|
|
63808
|
-
|
|
63809
|
-
|
|
63806
|
+
for (const filename2 of filenames) {
|
|
63807
|
+
const filePath = join2(...segments.slice(0, index), filename2);
|
|
63808
|
+
if (await options.test(filePath)) {
|
|
63809
|
+
return filePath;
|
|
63810
|
+
}
|
|
63810
63811
|
}
|
|
63811
63812
|
}
|
|
63812
63813
|
} else {
|
|
63813
63814
|
for (let index = segments.length; index > root; index--) {
|
|
63814
|
-
const
|
|
63815
|
-
|
|
63816
|
-
|
|
63815
|
+
for (const filename2 of filenames) {
|
|
63816
|
+
const filePath = join2(...segments.slice(0, index), filename2);
|
|
63817
|
+
if (await options.test(filePath)) {
|
|
63818
|
+
return filePath;
|
|
63819
|
+
}
|
|
63817
63820
|
}
|
|
63818
63821
|
}
|
|
63819
63822
|
}
|
|
@@ -63858,11 +63861,9 @@ var lockFiles = [
|
|
|
63858
63861
|
async function resolveLockfile(id = process.cwd(), options = {}) {
|
|
63859
63862
|
const resolvedPath = isAbsolute(id) ? id : await resolvePath(id, options);
|
|
63860
63863
|
const _options = { startingFrom: resolvedPath, ...options };
|
|
63861
|
-
|
|
63862
|
-
|
|
63863
|
-
|
|
63864
|
-
} catch {
|
|
63865
|
-
}
|
|
63864
|
+
try {
|
|
63865
|
+
return await findNearestFile(lockFiles, _options);
|
|
63866
|
+
} catch {
|
|
63866
63867
|
}
|
|
63867
63868
|
throw new Error("No lockfile found from " + id);
|
|
63868
63869
|
}
|
|
@@ -68203,6 +68204,13 @@ var SingleThemeColorConfigSchema = z2.object({
|
|
|
68203
68204
|
error: ErrorColorSchema,
|
|
68204
68205
|
fatal: FatalColorSchema
|
|
68205
68206
|
});
|
|
68207
|
+
var RegistryUrlConfigSchema = z2.string().trim().toLowerCase().url().optional().describe("A remote registry URL used to publish distributable packages");
|
|
68208
|
+
var RegistryConfigSchema = z2.object({
|
|
68209
|
+
github: RegistryUrlConfigSchema,
|
|
68210
|
+
npm: RegistryUrlConfigSchema,
|
|
68211
|
+
cargo: RegistryUrlConfigSchema,
|
|
68212
|
+
cyclone: RegistryUrlConfigSchema
|
|
68213
|
+
}).describe("A list of remote registry URLs used by Storm Software");
|
|
68206
68214
|
var ColorConfigSchema = SingleThemeColorConfigSchema.or(
|
|
68207
68215
|
MultiThemeColorConfigSchema
|
|
68208
68216
|
).describe("Colors used for various workspace elements");
|
|
@@ -68258,6 +68266,7 @@ var StormConfigSchema = z2.object({
|
|
|
68258
68266
|
"The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."
|
|
68259
68267
|
),
|
|
68260
68268
|
cloudflareAccountId: z2.string().trim().toLowerCase().length(32).regex(/^([0-9a-fA-F]{32})$/i).nullable().default(null).describe("The default Cloudflare account ID of the workspace"),
|
|
68269
|
+
registry: RegistryConfigSchema,
|
|
68261
68270
|
configFile: z2.string().trim().nullable().default(null).describe(
|
|
68262
68271
|
"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
68263
68272
|
),
|
|
@@ -68851,6 +68860,12 @@ var getConfigEnv = () => {
|
|
|
68851
68860
|
preid: process.env[`${prefix}PRE_ID`],
|
|
68852
68861
|
externalPackagePatterns: process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] ? JSON.parse(process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`]) : [],
|
|
68853
68862
|
cloudflareAccountId: process.env[`${prefix}CLOUDFLARE_ACCOUNT_ID`] ? process.env[`${prefix}CLOUDFLARE_ACCOUNT_ID`] : process.env.CLOUDFLARE_ACCOUNT_ID ? process.env.CLOUDFLARE_ACCOUNT_ID : process.env.STORM_BOT_CLOUDFLARE_ACCOUNT,
|
|
68863
|
+
registry: {
|
|
68864
|
+
github: process.env[`${prefix}REGISTRY_GITHUB`],
|
|
68865
|
+
npm: process.env[`${prefix}REGISTRY_NPM`],
|
|
68866
|
+
cargo: process.env[`${prefix}REGISTRY_CARGO`],
|
|
68867
|
+
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`]
|
|
68868
|
+
},
|
|
68854
68869
|
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
68855
68870
|
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
68856
68871
|
) ? getLogLevelLabel(
|
|
@@ -69066,6 +69081,22 @@ var setConfigEnv = (config) => {
|
|
|
69066
69081
|
config.cloudflareAccountId
|
|
69067
69082
|
);
|
|
69068
69083
|
}
|
|
69084
|
+
if (config.registry) {
|
|
69085
|
+
if (config.registry.github) {
|
|
69086
|
+
process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
|
|
69087
|
+
}
|
|
69088
|
+
if (config.registry.npm) {
|
|
69089
|
+
process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
|
|
69090
|
+
}
|
|
69091
|
+
if (config.registry.cargo) {
|
|
69092
|
+
process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
|
|
69093
|
+
}
|
|
69094
|
+
if (config.registry.cyclone) {
|
|
69095
|
+
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
|
|
69096
|
+
config.registry.cyclone
|
|
69097
|
+
);
|
|
69098
|
+
}
|
|
69099
|
+
}
|
|
69069
69100
|
if (config.logLevel) {
|
|
69070
69101
|
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
69071
69102
|
process.env.LOG_LEVEL = String(config.logLevel);
|
package/index.js
CHANGED
|
@@ -57043,7 +57043,7 @@ function hash(object, options = {}) {
|
|
|
57043
57043
|
return sha256base64(hashed).slice(0, 10);
|
|
57044
57044
|
}
|
|
57045
57045
|
|
|
57046
|
-
// node_modules/.pnpm/pkg-types@1.1.
|
|
57046
|
+
// node_modules/.pnpm/pkg-types@1.1.1/node_modules/pkg-types/dist/index.mjs
|
|
57047
57047
|
init_dist();
|
|
57048
57048
|
import { statSync as statSync2, promises as promises2 } from "node:fs";
|
|
57049
57049
|
|
|
@@ -62375,11 +62375,6 @@ init_dist2();
|
|
|
62375
62375
|
init_dist();
|
|
62376
62376
|
import { builtinModules, createRequire } from "node:module";
|
|
62377
62377
|
import fs, { realpathSync, statSync, promises } from "node:fs";
|
|
62378
|
-
|
|
62379
|
-
// node_modules/.pnpm/confbox@0.1.7/node_modules/confbox/dist/index.mjs
|
|
62380
|
-
init_confbox_bcd59e75();
|
|
62381
|
-
|
|
62382
|
-
// node_modules/.pnpm/mlly@1.7.0/node_modules/mlly/dist/index.mjs
|
|
62383
62378
|
import { fileURLToPath as fileURLToPath$1, URL as URL$1, pathToFileURL as pathToFileURL$1 } from "node:url";
|
|
62384
62379
|
import assert from "node:assert";
|
|
62385
62380
|
import process$1 from "node:process";
|
|
@@ -63733,7 +63728,10 @@ function resolvePath(id, options) {
|
|
|
63733
63728
|
}
|
|
63734
63729
|
}
|
|
63735
63730
|
|
|
63736
|
-
// node_modules/.pnpm/
|
|
63731
|
+
// node_modules/.pnpm/confbox@0.1.7/node_modules/confbox/dist/index.mjs
|
|
63732
|
+
init_confbox_bcd59e75();
|
|
63733
|
+
|
|
63734
|
+
// node_modules/.pnpm/pkg-types@1.1.1/node_modules/pkg-types/dist/index.mjs
|
|
63737
63735
|
var defaultFindOptions = {
|
|
63738
63736
|
startingFrom: ".",
|
|
63739
63737
|
rootPattern: /^node_modules$/,
|
|
@@ -63748,6 +63746,7 @@ var defaultFindOptions = {
|
|
|
63748
63746
|
}
|
|
63749
63747
|
};
|
|
63750
63748
|
async function findFile(filename, _options = {}) {
|
|
63749
|
+
const filenames = Array.isArray(filename) ? filename : [filename];
|
|
63751
63750
|
const options = { ...defaultFindOptions, ..._options };
|
|
63752
63751
|
const basePath = resolve(options.startingFrom);
|
|
63753
63752
|
const leadingSlash = basePath[0] === "/";
|
|
@@ -63761,16 +63760,20 @@ async function findFile(filename, _options = {}) {
|
|
|
63761
63760
|
}
|
|
63762
63761
|
if (options.reverse) {
|
|
63763
63762
|
for (let index = root + 1; index <= segments.length; index++) {
|
|
63764
|
-
const
|
|
63765
|
-
|
|
63766
|
-
|
|
63763
|
+
for (const filename2 of filenames) {
|
|
63764
|
+
const filePath = join2(...segments.slice(0, index), filename2);
|
|
63765
|
+
if (await options.test(filePath)) {
|
|
63766
|
+
return filePath;
|
|
63767
|
+
}
|
|
63767
63768
|
}
|
|
63768
63769
|
}
|
|
63769
63770
|
} else {
|
|
63770
63771
|
for (let index = segments.length; index > root; index--) {
|
|
63771
|
-
const
|
|
63772
|
-
|
|
63773
|
-
|
|
63772
|
+
for (const filename2 of filenames) {
|
|
63773
|
+
const filePath = join2(...segments.slice(0, index), filename2);
|
|
63774
|
+
if (await options.test(filePath)) {
|
|
63775
|
+
return filePath;
|
|
63776
|
+
}
|
|
63774
63777
|
}
|
|
63775
63778
|
}
|
|
63776
63779
|
}
|
|
@@ -63815,11 +63818,9 @@ var lockFiles = [
|
|
|
63815
63818
|
async function resolveLockfile(id = process.cwd(), options = {}) {
|
|
63816
63819
|
const resolvedPath = isAbsolute(id) ? id : await resolvePath(id, options);
|
|
63817
63820
|
const _options = { startingFrom: resolvedPath, ...options };
|
|
63818
|
-
|
|
63819
|
-
|
|
63820
|
-
|
|
63821
|
-
} catch {
|
|
63822
|
-
}
|
|
63821
|
+
try {
|
|
63822
|
+
return await findNearestFile(lockFiles, _options);
|
|
63823
|
+
} catch {
|
|
63823
63824
|
}
|
|
63824
63825
|
throw new Error("No lockfile found from " + id);
|
|
63825
63826
|
}
|
|
@@ -68160,6 +68161,13 @@ var SingleThemeColorConfigSchema = z2.object({
|
|
|
68160
68161
|
error: ErrorColorSchema,
|
|
68161
68162
|
fatal: FatalColorSchema
|
|
68162
68163
|
});
|
|
68164
|
+
var RegistryUrlConfigSchema = z2.string().trim().toLowerCase().url().optional().describe("A remote registry URL used to publish distributable packages");
|
|
68165
|
+
var RegistryConfigSchema = z2.object({
|
|
68166
|
+
github: RegistryUrlConfigSchema,
|
|
68167
|
+
npm: RegistryUrlConfigSchema,
|
|
68168
|
+
cargo: RegistryUrlConfigSchema,
|
|
68169
|
+
cyclone: RegistryUrlConfigSchema
|
|
68170
|
+
}).describe("A list of remote registry URLs used by Storm Software");
|
|
68163
68171
|
var ColorConfigSchema = SingleThemeColorConfigSchema.or(
|
|
68164
68172
|
MultiThemeColorConfigSchema
|
|
68165
68173
|
).describe("Colors used for various workspace elements");
|
|
@@ -68215,6 +68223,7 @@ var StormConfigSchema = z2.object({
|
|
|
68215
68223
|
"The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."
|
|
68216
68224
|
),
|
|
68217
68225
|
cloudflareAccountId: z2.string().trim().toLowerCase().length(32).regex(/^([0-9a-fA-F]{32})$/i).nullable().default(null).describe("The default Cloudflare account ID of the workspace"),
|
|
68226
|
+
registry: RegistryConfigSchema,
|
|
68218
68227
|
configFile: z2.string().trim().nullable().default(null).describe(
|
|
68219
68228
|
"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
68220
68229
|
),
|
|
@@ -68808,6 +68817,12 @@ var getConfigEnv = () => {
|
|
|
68808
68817
|
preid: process.env[`${prefix}PRE_ID`],
|
|
68809
68818
|
externalPackagePatterns: process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] ? JSON.parse(process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`]) : [],
|
|
68810
68819
|
cloudflareAccountId: process.env[`${prefix}CLOUDFLARE_ACCOUNT_ID`] ? process.env[`${prefix}CLOUDFLARE_ACCOUNT_ID`] : process.env.CLOUDFLARE_ACCOUNT_ID ? process.env.CLOUDFLARE_ACCOUNT_ID : process.env.STORM_BOT_CLOUDFLARE_ACCOUNT,
|
|
68820
|
+
registry: {
|
|
68821
|
+
github: process.env[`${prefix}REGISTRY_GITHUB`],
|
|
68822
|
+
npm: process.env[`${prefix}REGISTRY_NPM`],
|
|
68823
|
+
cargo: process.env[`${prefix}REGISTRY_CARGO`],
|
|
68824
|
+
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`]
|
|
68825
|
+
},
|
|
68811
68826
|
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
68812
68827
|
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
68813
68828
|
) ? getLogLevelLabel(
|
|
@@ -69023,6 +69038,22 @@ var setConfigEnv = (config) => {
|
|
|
69023
69038
|
config.cloudflareAccountId
|
|
69024
69039
|
);
|
|
69025
69040
|
}
|
|
69041
|
+
if (config.registry) {
|
|
69042
|
+
if (config.registry.github) {
|
|
69043
|
+
process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
|
|
69044
|
+
}
|
|
69045
|
+
if (config.registry.npm) {
|
|
69046
|
+
process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
|
|
69047
|
+
}
|
|
69048
|
+
if (config.registry.cargo) {
|
|
69049
|
+
process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
|
|
69050
|
+
}
|
|
69051
|
+
if (config.registry.cyclone) {
|
|
69052
|
+
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
|
|
69053
|
+
config.registry.cyclone
|
|
69054
|
+
);
|
|
69055
|
+
}
|
|
69056
|
+
}
|
|
69026
69057
|
if (config.logLevel) {
|
|
69027
69058
|
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
69028
69059
|
process.env.LOG_LEVEL = String(config.logLevel);
|