@storm-software/build-tools
Version:
A comprehensive set of tools for building and managing projects within a Storm workspace. Includes builders such as rollup, rolldown, tsup, and unbuild, along with various utilities.
1,232 lines (1,209 loc) • 57.2 kB
JavaScript
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
var _chunkUMP4EIASjs = require('./chunk-UMP4EIAS.js');
var _chunkJVKCJMCKjs = require('./chunk-JVKCJMCK.js');
var _chunkKTEGKYAHjs = require('./chunk-KTEGKYAH.js');
// ../config-tools/src/config-file/get-config-file.ts
var _c12 = require('c12');
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
// ../config/src/constants.ts
var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
var STORM_DEFAULT_LICENSE = "Apache-2.0";
var STORM_DEFAULT_SOCIAL_DISCORD = "https://discord.gg/MQ6YVzakM5";
var STORM_DEFAULT_SOCIAL_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
var STORM_DEFAULT_RELEASE_FOOTER = `
Storm Software is an open source software development organization with the mission is to make software development more accessible. Our ideal future is one where anyone can create software without years of prior development experience serving as a barrier to entry. We hope to achieve this via LLMs, Generative AI, and intuitive, high-level data modeling/programming languages.
Join us on [Discord](${STORM_DEFAULT_SOCIAL_DISCORD}) to chat with the team, receive release notifications, ask questions, and get involved.
If this sounds interesting, and you would like to help us in creating the next generation of development tools, please reach out on our [website](${STORM_DEFAULT_CONTACT}) or join our [Slack](${STORM_DEFAULT_SOCIAL_SLACK}) channel!
`;
var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
var STORM_DEFAULT_BANNER_ALT = "The workspace's banner image";
// ../config/src/schema.ts
var _mini = require('zod/mini'); var z = _interopRequireWildcard(_mini);
var schemaRegistry = z.registry();
var colorSchema = z.string().check(
z.length(7),
z.toLowerCase(),
z.regex(/^#([0-9a-f]{3}){1,2}$/i),
z.trim()
);
schemaRegistry.add(colorSchema, {
description: "A base schema for describing the format of colors"
});
var darkColorSchema = z._default(colorSchema, "#151718");
schemaRegistry.add(darkColorSchema, {
description: "The dark background color of the workspace"
});
var lightColorSchema = z._default(colorSchema, "#cbd5e1");
schemaRegistry.add(lightColorSchema, {
description: "The light background color of the workspace"
});
var brandColorSchema = z._default(colorSchema, "#1fb2a6");
schemaRegistry.add(brandColorSchema, {
description: "The primary brand specific color of the workspace"
});
var alternateColorSchema = z.optional(colorSchema);
schemaRegistry.add(alternateColorSchema, {
description: "The alternate brand specific color of the workspace"
});
var accentColorSchema = z.optional(colorSchema);
schemaRegistry.add(accentColorSchema, {
description: "The secondary brand specific color of the workspace"
});
var linkColorSchema = z._default(colorSchema, "#3fa6ff");
schemaRegistry.add(linkColorSchema, {
description: "The color used to display hyperlink text"
});
var helpColorSchema = z._default(colorSchema, "#818cf8");
schemaRegistry.add(helpColorSchema, {
description: "The second brand specific color of the workspace"
});
var successColorSchema = z._default(colorSchema, "#45b27e");
schemaRegistry.add(successColorSchema, {
description: "The success color of the workspace"
});
var infoColorSchema = z._default(colorSchema, "#38bdf8");
schemaRegistry.add(infoColorSchema, {
description: "The informational color of the workspace"
});
var warningColorSchema = z._default(colorSchema, "#f3d371");
schemaRegistry.add(warningColorSchema, {
description: "The warning color of the workspace"
});
var dangerColorSchema = z._default(colorSchema, "#d8314a");
schemaRegistry.add(dangerColorSchema, {
description: "The danger color of the workspace"
});
var fatalColorSchema = z.optional(colorSchema);
schemaRegistry.add(fatalColorSchema, {
description: "The fatal color of the workspace"
});
var positiveColorSchema = z._default(colorSchema, "#4ade80");
schemaRegistry.add(positiveColorSchema, {
description: "The positive number color of the workspace"
});
var negativeColorSchema = z._default(colorSchema, "#ef4444");
schemaRegistry.add(negativeColorSchema, {
description: "The negative number color of the workspace"
});
var gradientStopsSchema = z.optional(z.array(colorSchema));
schemaRegistry.add(gradientStopsSchema, {
description: "The color stops for the base gradient color pattern used in the workspace"
});
var darkColorsSchema = z.object({
foreground: lightColorSchema,
background: darkColorSchema,
brand: brandColorSchema,
alternate: alternateColorSchema,
accent: accentColorSchema,
link: linkColorSchema,
help: helpColorSchema,
success: successColorSchema,
info: infoColorSchema,
warning: warningColorSchema,
danger: dangerColorSchema,
fatal: fatalColorSchema,
positive: positiveColorSchema,
negative: negativeColorSchema,
gradient: gradientStopsSchema
});
var lightColorsSchema = z.object({
foreground: darkColorSchema,
background: lightColorSchema,
brand: brandColorSchema,
alternate: alternateColorSchema,
accent: accentColorSchema,
link: linkColorSchema,
help: helpColorSchema,
success: successColorSchema,
info: infoColorSchema,
warning: warningColorSchema,
danger: dangerColorSchema,
fatal: fatalColorSchema,
positive: positiveColorSchema,
negative: negativeColorSchema,
gradient: gradientStopsSchema
});
var multiColorsSchema = z.object({
dark: darkColorsSchema,
light: lightColorsSchema
});
var singleColorsSchema = z.object({
dark: darkColorSchema,
light: lightColorSchema,
brand: brandColorSchema,
alternate: alternateColorSchema,
accent: accentColorSchema,
link: linkColorSchema,
help: helpColorSchema,
success: successColorSchema,
info: infoColorSchema,
warning: warningColorSchema,
danger: dangerColorSchema,
fatal: fatalColorSchema,
positive: positiveColorSchema,
negative: negativeColorSchema,
gradient: gradientStopsSchema
});
var registryUrlConfigSchema = z.optional(z.url());
schemaRegistry.add(registryUrlConfigSchema, {
description: "A remote registry URL used to publish distributable packages"
});
var registrySchema = z._default(
z.object({
github: registryUrlConfigSchema,
npm: registryUrlConfigSchema,
cargo: registryUrlConfigSchema,
cyclone: registryUrlConfigSchema,
container: registryUrlConfigSchema
}),
{}
);
schemaRegistry.add(registrySchema, {
description: "A list of remote registry URLs used by Storm Software"
});
var colorsSchema = z.union([singleColorsSchema, multiColorsSchema]);
schemaRegistry.add(colorsSchema, {
description: "Colors used for various workspace elements"
});
var themeColorsSchema = z.record(
z.union([z.union([z.literal("base"), z.string()]), z.string()]),
colorsSchema
);
schemaRegistry.add(themeColorsSchema, {
description: "Storm theme config values used for styling various package elements"
});
var extendsSchema = z.optional(
z.union([z.string().check(z.trim()), z.array(z.string().check(z.trim()))])
);
schemaRegistry.add(extendsSchema, {
description: "The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration."
});
var workspaceBotNameSchema = z.string().check(z.trim());
schemaRegistry.add(workspaceBotNameSchema, {
description: "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
});
var workspaceBotEmailSchema = z.string().check(z.trim());
schemaRegistry.add(workspaceBotEmailSchema, {
description: "The email of the workspace bot"
});
var workspaceBotSchema = z.object({
name: workspaceBotNameSchema,
email: workspaceBotEmailSchema
});
schemaRegistry.add(workspaceBotSchema, {
description: "The workspace's bot user's config used to automated various operations tasks"
});
var workspaceReleaseBannerUrlSchema = z.optional(
z.string().check(z.trim(), z.url())
);
schemaRegistry.add(workspaceReleaseBannerUrlSchema, {
description: "A URL to a banner image used to display the workspace's release"
});
var workspaceReleaseBannerAltSchema = z._default(
z.string().check(z.trim()),
STORM_DEFAULT_BANNER_ALT
);
schemaRegistry.add(workspaceReleaseBannerAltSchema, {
description: "The alt text for the workspace's release banner image"
});
var workspaceReleaseBannerSchema = z.object({
url: workspaceReleaseBannerUrlSchema,
alt: workspaceReleaseBannerAltSchema
});
schemaRegistry.add(workspaceReleaseBannerSchema, {
description: "The workspace's banner image used during the release process"
});
var workspaceReleaseHeaderSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(workspaceReleaseHeaderSchema, {
description: "A header message appended to the start of the workspace's release notes"
});
var workspaceReleaseFooterSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(workspaceReleaseFooterSchema, {
description: "A footer message appended to the end of the workspace's release notes"
});
var workspaceReleaseSchema = z.object({
banner: z.union([
workspaceReleaseBannerSchema,
z.string().check(z.trim(), z.url())
]),
header: workspaceReleaseHeaderSchema,
footer: workspaceReleaseFooterSchema
});
schemaRegistry.add(workspaceReleaseSchema, {
description: "The workspace's release config used during the release process"
});
var workspaceSocialsTwitterSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(workspaceSocialsTwitterSchema, {
description: "A Twitter/X account associated with the organization/project"
});
var workspaceSocialsDiscordSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(workspaceSocialsDiscordSchema, {
description: "A Discord account associated with the organization/project"
});
var workspaceSocialsTelegramSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(workspaceSocialsTelegramSchema, {
description: "A Telegram account associated with the organization/project"
});
var workspaceSocialsSlackSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(workspaceSocialsSlackSchema, {
description: "A Slack account associated with the organization/project"
});
var workspaceSocialsMediumSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(workspaceSocialsMediumSchema, {
description: "A Medium account associated with the organization/project"
});
var workspaceSocialsGithubSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(workspaceSocialsGithubSchema, {
description: "A GitHub account associated with the organization/project"
});
var workspaceSocialsSchema = z.object({
twitter: workspaceSocialsTwitterSchema,
discord: workspaceSocialsDiscordSchema,
telegram: workspaceSocialsTelegramSchema,
slack: workspaceSocialsSlackSchema,
medium: workspaceSocialsMediumSchema,
github: workspaceSocialsGithubSchema
});
schemaRegistry.add(workspaceSocialsSchema, {
description: "The workspace's account config used to store various social media links"
});
var workspaceDirectoryCacheSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(workspaceDirectoryCacheSchema, {
description: "The directory used to store the environment's cached file data"
});
var workspaceDirectoryDataSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(workspaceDirectoryDataSchema, {
description: "The directory used to store the environment's data files"
});
var workspaceDirectoryConfigSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(workspaceDirectoryConfigSchema, {
description: "The directory used to store the environment's configuration files"
});
var workspaceDirectoryTempSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(workspaceDirectoryTempSchema, {
description: "The directory used to store the environment's temp files"
});
var workspaceDirectoryLogSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(workspaceDirectoryLogSchema, {
description: "The directory used to store the environment's log files"
});
var workspaceDirectoryBuildSchema = z._default(
z.string().check(z.trim()),
"dist"
);
schemaRegistry.add(workspaceDirectoryBuildSchema, {
description: "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
});
var workspaceDirectorySchema = z.object({
cache: workspaceDirectoryCacheSchema,
data: workspaceDirectoryDataSchema,
config: workspaceDirectoryConfigSchema,
temp: workspaceDirectoryTempSchema,
log: workspaceDirectoryLogSchema,
build: workspaceDirectoryBuildSchema
});
schemaRegistry.add(workspaceDirectorySchema, {
description: "Various directories used by the workspace to store data, cache, and configuration files"
});
var errorCodesFileSchema = z._default(
z.string().check(z.trim()),
STORM_DEFAULT_ERROR_CODES_FILE
);
schemaRegistry.add(errorCodesFileSchema, {
description: "The path to the workspace's error codes JSON file"
});
var errorUrlSchema = z.optional(z.url());
schemaRegistry.add(errorUrlSchema, {
description: "A URL to a page that looks up the workspace's error messages given a specific error code"
});
var errorSchema = z.object({
codesFile: errorCodesFileSchema,
url: errorUrlSchema
});
schemaRegistry.add(errorSchema, {
description: "The workspace's error config used when creating error details during a system error"
});
var organizationNameSchema = z.optional(
z.string().check(z.trim(), z.toLowerCase())
);
schemaRegistry.add(organizationNameSchema, {
description: "The name of the organization"
});
var organizationDescriptionSchema = z.optional(
z.string().check(z.trim())
);
schemaRegistry.add(organizationDescriptionSchema, {
description: "A description of the organization"
});
var organizationLogoSchema = z.optional(z.url());
schemaRegistry.add(organizationLogoSchema, {
description: "A URL to the organization's logo image"
});
var organizationIconSchema = z.optional(z.url());
schemaRegistry.add(organizationIconSchema, {
description: "A URL to the organization's icon image"
});
var organizationUrlSchema = z.optional(z.url());
schemaRegistry.add(organizationUrlSchema, {
description: "A URL to a page that provides more information about the organization"
});
var organizationSchema = z.object({
name: organizationNameSchema,
description: organizationDescriptionSchema,
logo: organizationLogoSchema,
icon: organizationIconSchema,
url: organizationUrlSchema
});
schemaRegistry.add(organizationSchema, {
description: "The workspace's organization details"
});
var schemaNameSchema = z._default(
z.string().check(z.trim(), z.toLowerCase()),
"https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
);
schemaRegistry.add(schemaNameSchema, {
description: "The URL or file path to the JSON schema file that describes the Storm configuration file"
});
var nameSchema = z.string().check(z.trim(), z.toLowerCase());
schemaRegistry.add(nameSchema, {
description: "The name of the workspace/project/service/package/scope using this configuration"
});
var namespaceSchema = z.string().check(z.trim(), z.toLowerCase());
schemaRegistry.add(namespaceSchema, {
description: "The namespace of the workspace/project/service/package/scope using this configuration"
});
var orgSchema = z.union([
organizationSchema,
z.string().check(z.trim(), z.toLowerCase())
]);
schemaRegistry.add(orgSchema, {
description: "The organization of the workspace. This can be a string or an object containing the organization's details"
});
var repositorySchema = z.string().check(z.trim(), z.toLowerCase());
schemaRegistry.add(repositorySchema, {
description: "The repo URL of the workspace (i.e. the GitHub repository URL)"
});
var licenseSchema = z._default(
z.string().check(z.trim()),
"Apache-2.0"
);
schemaRegistry.add(licenseSchema, {
description: "The license type of the package"
});
var homepageSchema = z.optional(z.url());
schemaRegistry.add(homepageSchema, {
description: "The homepage of the workspace"
});
var docsSchema = z.optional(z.url());
schemaRegistry.add(docsSchema, {
description: "The documentation site for the workspace"
});
var portalSchema = z.optional(z.url());
schemaRegistry.add(portalSchema, {
description: "The development portal site for the workspace"
});
var licensingSchema = z.optional(z.url());
schemaRegistry.add(licensingSchema, {
description: "The licensing site for the workspace"
});
var contactSchema = z.optional(z.url());
schemaRegistry.add(contactSchema, {
description: "The contact site for the workspace"
});
var supportSchema = z.optional(z.url());
schemaRegistry.add(supportSchema, {
description: "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
});
var branchSchema = z._default(
z.string().check(z.trim(), z.toLowerCase()),
"main"
);
schemaRegistry.add(branchSchema, {
description: "The branch of the workspace"
});
var preidSchema = z.optional(
z.string().check(z.trim(), z.toLowerCase())
);
schemaRegistry.add(preidSchema, {
description: "A tag specifying the version pre-release identifier"
});
var ownerSchema = z.optional(
z.string().check(z.trim(), z.toLowerCase())
);
schemaRegistry.add(ownerSchema, {
description: "The owner of the package"
});
var modeSchema = z._default(
z.enum(["development", "staging", "production"]).check(z.trim(), z.toLowerCase()),
"production"
);
schemaRegistry.add(modeSchema, {
description: "The current runtime environment mode for the package"
});
var workspaceRootSchema = z.string().check(z.trim(), z.toLowerCase());
schemaRegistry.add(workspaceRootSchema, {
description: "The root directory of the workspace"
});
var skipCacheSchema = z._default(z.boolean(), false);
schemaRegistry.add(skipCacheSchema, {
description: "Should all known types of workspace caching be skipped?"
});
var packageManagerSchema = z._default(
z.enum(["npm", "yarn", "pnpm", "bun"]),
"npm"
);
schemaRegistry.add(packageManagerSchema, {
description: "The JavaScript/TypeScript package manager used by the repository"
});
var timezoneSchema = z._default(
z.string().check(z.trim()),
"America/New_York"
);
schemaRegistry.add(timezoneSchema, {
description: "The default timezone of the workspace"
});
var localeSchema = z._default(z.string().check(z.trim()), "en-US");
schemaRegistry.add(localeSchema, {
description: "The default locale of the workspace"
});
var logLevelSchema = z._default(
z.enum([
"silent",
"fatal",
"error",
"warn",
"success",
"info",
"debug",
"trace",
"all"
]),
"info"
);
schemaRegistry.add(logLevelSchema, {
description: "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`)."
});
var skipConfigLoggingSchema = z._default(z.boolean(), true);
schemaRegistry.add(skipConfigLoggingSchema, {
description: "Should the logging of the current Storm Workspace configuration be skipped?"
});
var configFileSchema = z._default(
z.nullable(z.string().check(z.trim())),
null
);
schemaRegistry.add(configFileSchema, {
description: "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
});
var extensionsSchema = z._default(z.record(z.string(), z.any()), {});
schemaRegistry.add(extensionsSchema, {
description: "Configuration of each used extension"
});
var workspaceConfigSchema = z.object({
$schema: schemaNameSchema,
extends: extendsSchema,
name: nameSchema,
namespace: namespaceSchema,
organization: orgSchema,
repository: repositorySchema,
license: licenseSchema,
homepage: homepageSchema,
docs: docsSchema,
portal: portalSchema,
licensing: licensingSchema,
contact: contactSchema,
support: supportSchema,
branch: branchSchema,
preid: preidSchema,
owner: ownerSchema,
bot: workspaceBotSchema,
release: workspaceReleaseSchema,
socials: workspaceSocialsSchema,
error: errorSchema,
mode: modeSchema,
workspaceRoot: workspaceRootSchema,
skipCache: skipCacheSchema,
directories: workspaceDirectorySchema,
packageManager: packageManagerSchema,
timezone: timezoneSchema,
locale: localeSchema,
logLevel: logLevelSchema,
skipConfigLogging: skipConfigLoggingSchema,
registry: registrySchema,
configFile: configFileSchema,
colors: z.union([colorsSchema, themeColorsSchema]),
extensions: extensionsSchema
});
schemaRegistry.add(extensionsSchema, {
description: "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."
});
// ../config/src/types.ts
var COLOR_KEYS = [
"dark",
"light",
"base",
"brand",
"alternate",
"accent",
"link",
"success",
"help",
"info",
"warning",
"danger",
"fatal",
"positive",
"negative"
];
// ../config-tools/src/utilities/get-default-config.ts
var _fs = require('fs');
var _promises = require('fs/promises');
var _path = require('path');
async function getPackageJsonConfig(root) {
let license = STORM_DEFAULT_LICENSE;
let homepage = void 0;
let support = void 0;
let name = void 0;
let namespace = void 0;
let repository = void 0;
const workspaceRoot = _chunkUMP4EIASjs.findWorkspaceRoot.call(void 0, root);
if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"))) {
const file = await _promises.readFile.call(void 0,
_chunkJVKCJMCKjs.joinPaths.call(void 0, workspaceRoot, "package.json"),
"utf8"
);
if (file) {
const packageJson = JSON.parse(file);
if (packageJson.name) {
name = packageJson.name;
}
if (packageJson.namespace) {
namespace = packageJson.namespace;
}
if (packageJson.repository) {
if (typeof packageJson.repository === "string") {
repository = packageJson.repository;
} else if (packageJson.repository.url) {
repository = packageJson.repository.url;
}
}
if (packageJson.license) {
license = packageJson.license;
}
if (packageJson.homepage) {
homepage = packageJson.homepage;
}
if (packageJson.bugs) {
if (typeof packageJson.bugs === "string") {
support = packageJson.bugs;
} else if (packageJson.bugs.url) {
support = packageJson.bugs.url;
}
}
}
}
return {
workspaceRoot,
name,
namespace,
repository,
license,
homepage,
support
};
}
function applyDefaultConfig(config) {
if (!config.support && config.contact) {
config.support = config.contact;
}
if (!config.contact && config.support) {
config.contact = config.support;
}
if (config.homepage) {
if (!config.docs) {
config.docs = `${config.homepage}/docs`;
}
if (!config.license) {
config.license = `${config.homepage}/license`;
}
if (!config.support) {
config.support = `${config.homepage}/support`;
}
if (!config.contact) {
config.contact = `${config.homepage}/contact`;
}
if (!_optionalChain([config, 'access', _ => _.error, 'optionalAccess', _2 => _2.codesFile]) || !_optionalChain([config, 'optionalAccess', _3 => _3.error, 'optionalAccess', _4 => _4.url])) {
config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
if (config.homepage) {
config.error.url ??= `${config.homepage}/errors`;
}
}
}
return config;
}
// ../config-tools/src/config-file/get-config-file.ts
var getConfigFileByName = async (fileName, filePath, options = {}) => {
const workspacePath = filePath || _chunkUMP4EIASjs.findWorkspaceRoot.call(void 0, filePath);
const configs = await Promise.all([
_c12.loadConfig.call(void 0, {
cwd: workspacePath,
packageJson: true,
name: fileName,
envName: _optionalChain([fileName, 'optionalAccess', _5 => _5.toUpperCase, 'call', _6 => _6()]),
jitiOptions: {
debug: false,
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkJVKCJMCKjs.joinPaths.call(void 0,
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
"jiti"
)
},
...options
}),
_c12.loadConfig.call(void 0, {
cwd: workspacePath,
packageJson: true,
name: fileName,
envName: _optionalChain([fileName, 'optionalAccess', _7 => _7.toUpperCase, 'call', _8 => _8()]),
jitiOptions: {
debug: false,
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkJVKCJMCKjs.joinPaths.call(void 0,
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
"jiti"
)
},
configFile: fileName,
...options
})
]);
return _defu2.default.call(void 0, _nullishCoalesce(configs[0], () => ( {})), _nullishCoalesce(configs[1], () => ( {})));
};
var getConfigFile = async (filePath, additionalFileNames = []) => {
const workspacePath = filePath ? filePath : _chunkUMP4EIASjs.findWorkspaceRoot.call(void 0, filePath);
const result = await getConfigFileByName("storm-workspace", workspacePath);
let config = result.config;
const configFile = result.configFile;
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
_chunkKTEGKYAHjs.writeTrace.call(void 0,
`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
{
logLevel: "all"
}
);
}
if (additionalFileNames && additionalFileNames.length > 0) {
const results = await Promise.all(
additionalFileNames.map(
(fileName) => getConfigFileByName(fileName, workspacePath)
)
);
for (const result2 of results) {
if (_optionalChain([result2, 'optionalAccess', _9 => _9.config]) && _optionalChain([result2, 'optionalAccess', _10 => _10.configFile]) && Object.keys(result2.config).length > 0) {
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
_chunkKTEGKYAHjs.writeTrace.call(void 0,
`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
{
logLevel: "all"
}
);
}
config = _defu2.default.call(void 0, _nullishCoalesce(result2.config, () => ( {})), _nullishCoalesce(config, () => ( {})));
}
}
}
if (!config || Object.keys(config).length === 0) {
return void 0;
}
config.configFile = configFile;
return config;
};
// ../config-tools/src/create-storm-config.ts
// ../config-tools/src/env/get-env.ts
var getExtensionEnv = (extensionName) => {
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
const name = key.replace(prefix, "").split("_").map(
(i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : ""
).join("");
if (name) {
ret[name] = process.env[key];
}
return ret;
}, {});
};
var getConfigEnv = () => {
const prefix = "STORM_";
let config = {
extends: process.env[`${prefix}EXTENDS`] || void 0,
name: process.env[`${prefix}NAME`] || void 0,
namespace: process.env[`${prefix}NAMESPACE`] || void 0,
owner: process.env[`${prefix}OWNER`] || void 0,
bot: {
name: process.env[`${prefix}BOT_NAME`] || void 0,
email: process.env[`${prefix}BOT_EMAIL`] || void 0
},
release: {
banner: {
url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
},
header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
},
error: {
codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
url: process.env[`${prefix}ERROR_URL`] || void 0
},
socials: {
twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
},
organization: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] ? process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] ? {
name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
} : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
license: process.env[`${prefix}LICENSE`] || void 0,
homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
docs: process.env[`${prefix}DOCS`] || void 0,
portal: process.env[`${prefix}PORTAL`] || void 0,
licensing: process.env[`${prefix}LICENSING`] || void 0,
contact: process.env[`${prefix}CONTACT`] || void 0,
support: process.env[`${prefix}SUPPORT`] || void 0,
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
directories: {
cache: process.env[`${prefix}CACHE_DIR`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
data: process.env[`${prefix}DATA_DIR`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
config: process.env[`${prefix}CONFIG_DIR`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
temp: process.env[`${prefix}TEMP_DIR`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
log: process.env[`${prefix}LOG_DIR`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
build: process.env[`${prefix}BUILD_DIR`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? _chunkJVKCJMCKjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
},
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
mode: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}MODE`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
// ci:
// process.env[`${prefix}CI`] !== undefined
// ? Boolean(
// process.env[`${prefix}CI`] ??
// process.env.CI ??
// process.env.CONTINUOUS_INTEGRATION
// )
// : undefined,
repository: process.env[`${prefix}REPOSITORY`] || void 0,
branch: process.env[`${prefix}BRANCH`] || void 0,
preid: process.env[`${prefix}PRE_ID`] || void 0,
registry: {
github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
},
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
) ? _chunkKTEGKYAHjs.getLogLevelLabel.call(void 0,
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
) : process.env[`${prefix}LOG_LEVEL`] : void 0,
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
};
const themeNames = Object.keys(process.env).filter(
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
)
);
config.colors = themeNames.length > 0 ? themeNames.reduce(
(ret, themeName) => {
ret[themeName] = getThemeColorsEnv(prefix, themeName);
return ret;
},
{}
) : getThemeColorsEnv(prefix);
if (config.docs === STORM_DEFAULT_DOCS) {
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
} else {
config.docs = `${config.homepage}/docs`;
}
}
if (config.licensing === STORM_DEFAULT_LICENSING) {
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
config.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
} else {
config.licensing = `${config.homepage}/docs`;
}
}
const serializedConfig = process.env[`${prefix}CONFIG`];
if (serializedConfig) {
const parsed = JSON.parse(serializedConfig);
config = {
...config,
...parsed,
colors: { ...config.colors, ...parsed.colors },
extensions: { ...config.extensions, ...parsed.extensions }
};
}
return config;
};
var getThemeColorsEnv = (prefix, theme) => {
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
};
var getSingleThemeColorsEnv = (prefix) => {
const gradient = [];
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
gradient.push(
process.env[`${prefix}GRADIENT_START`],
process.env[`${prefix}GRADIENT_END`]
);
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
while (process.env[`${prefix}GRADIENT_${index}`]) {
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
index++;
}
}
return {
dark: process.env[`${prefix}DARK`],
light: process.env[`${prefix}LIGHT`],
brand: process.env[`${prefix}BRAND`],
alternate: process.env[`${prefix}ALTERNATE`],
accent: process.env[`${prefix}ACCENT`],
link: process.env[`${prefix}LINK`],
help: process.env[`${prefix}HELP`],
success: process.env[`${prefix}SUCCESS`],
info: process.env[`${prefix}INFO`],
warning: process.env[`${prefix}WARNING`],
danger: process.env[`${prefix}DANGER`],
fatal: process.env[`${prefix}FATAL`],
positive: process.env[`${prefix}POSITIVE`],
negative: process.env[`${prefix}NEGATIVE`],
gradient
};
};
var getMultiThemeColorsEnv = (prefix) => {
return {
light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
};
};
var getBaseThemeColorsEnv = (prefix) => {
const gradient = [];
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
gradient.push(
process.env[`${prefix}GRADIENT_START`],
process.env[`${prefix}GRADIENT_END`]
);
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
while (process.env[`${prefix}GRADIENT_${index}`]) {
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
index++;
}
}
return {
foreground: process.env[`${prefix}FOREGROUND`],
background: process.env[`${prefix}BACKGROUND`],
brand: process.env[`${prefix}BRAND`],
alternate: process.env[`${prefix}ALTERNATE`],
accent: process.env[`${prefix}ACCENT`],
link: process.env[`${prefix}LINK`],
help: process.env[`${prefix}HELP`],
success: process.env[`${prefix}SUCCESS`],
info: process.env[`${prefix}INFO`],
warning: process.env[`${prefix}WARNING`],
danger: process.env[`${prefix}DANGER`],
fatal: process.env[`${prefix}FATAL`],
positive: process.env[`${prefix}POSITIVE`],
negative: process.env[`${prefix}NEGATIVE`],
gradient
};
};
// ../config-tools/src/env/set-env.ts
var setExtensionEnv = (extensionName, extension) => {
for (const key of Object.keys(_nullishCoalesce(extension, () => ( {})))) {
if (extension[key]) {
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess', _11 => _11.replace, 'call', _12 => _12(
/([A-Z])+/g,
(input) => input ? _optionalChain([input, 'access', _13 => _13[0], 'optionalAccess', _14 => _14.toUpperCase, 'call', _15 => _15()]) + input.slice(1) : ""
), 'access', _16 => _16.split, 'call', _17 => _17(/(?=[A-Z])|[.\-\s_]/), 'access', _18 => _18.map, 'call', _19 => _19((x) => x.toLowerCase())]), () => ( []));
let extensionKey;
if (result.length === 0) {
return;
}
if (result.length === 1) {
extensionKey = _nullishCoalesce(_optionalChain([result, 'access', _20 => _20[0], 'optionalAccess', _21 => _21.toUpperCase, 'call', _22 => _22()]), () => ( ""));
} else {
extensionKey = result.reduce((ret, part) => {
return `${ret}_${part.toLowerCase()}`;
});
}
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
}
}
};
var setConfigEnv = (config) => {
const prefix = "STORM_";
if (config.extends) {
process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
}
if (config.name) {
process.env[`${prefix}NAME`] = config.name;
}
if (config.namespace) {
process.env[`${prefix}NAMESPACE`] = config.namespace;
}
if (config.owner) {
process.env[`${prefix}OWNER`] = config.owner;
}
if (config.bot) {
process.env[`${prefix}BOT_NAME`] = config.bot.name;
process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
}
if (config.error) {
process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
process.env[`${prefix}ERROR_URL`] = config.error.url;
}
if (config.release) {
if (config.release.banner) {
if (typeof config.release.banner === "string") {
process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
} else {
process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
}
}
process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
}
if (config.socials) {
if (config.socials.twitter) {
process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
}
if (config.socials.discord) {
process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
}
if (config.socials.telegram) {
process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
}
if (config.socials.slack) {
process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
}
if (config.socials.medium) {
process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
}
if (config.socials.github) {
process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
}
}
if (config.organization) {
if (typeof config.organization === "string") {
process.env[`${prefix}ORG`] = config.organization;
process.env[`${prefix}ORG_NAME`] = config.organization;
process.env[`${prefix}ORGANIZATION`] = config.organization;
process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
} else {
process.env[`${prefix}ORG`] = config.organization.name;
process.env[`${prefix}ORG_NAME`] = config.organization.name;
process.env[`${prefix}ORGANIZATION`] = config.organization.name;
process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
if (config.organization.url) {
process.env[`${prefix}ORG_URL`] = config.organization.url;
process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
}
if (config.organization.description) {
process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
}
if (config.organization.logo) {
process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
}
if (config.organization.icon) {
process.env[`${prefix}ORG_ICON`] = config.organization.icon;
process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
}
}
}
if (config.packageManager) {
process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
}
if (config.license) {
process.env[`${prefix}LICENSE`] = config.license;
}
if (config.homepage) {
process.env[`${prefix}HOMEPAGE`] = config.homepage;
}
if (config.docs) {
process.env[`${prefix}DOCS`] = config.docs;
}
if (config.portal) {
process.env[`${prefix}PORTAL`] = config.portal;
}
if (config.licensing) {
process.env[`${prefix}LICENSING`] = config.licensing;
}
if (config.contact) {
process.env[`${prefix}CONTACT`] = config.contact;
}
if (config.support) {
process.env[`${prefix}SUPPORT`] = config.support;
}
if (config.timezone) {
process.env[`${prefix}TIMEZONE`] = config.timezone;
process.env.TZ = config.timezone;
process.env.DEFAULT_TIMEZONE = config.timezone;
process.env.TIMEZONE = config.timezone;
}
if (config.locale) {
process.env[`${prefix}LOCALE`] = config.locale;
process.env.DEFAULT_LOCALE = config.locale;
process.env.LOCALE = config.locale;
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
}
if (config.configFile) {
process.env[`${prefix}CONFIG_FILE`] = _chunkJVKCJMCKjs.correctPaths.call(void 0, config.configFile);
}
if (config.workspaceRoot) {
process.env[`${prefix}WORKSPACE_ROOT`] = _chunkJVKCJMCKjs.correctPaths.call(void 0, config.workspaceRoot);
process.env.NX_WORKSPACE_ROOT = _chunkJVKCJMCKjs.correctPaths.call(void 0, config.workspaceRoot);
process.env.NX_WORKSPACE_ROOT_PATH = _chunkJVKCJMCKjs.correctPaths.call(void 0, config.workspaceRoot);
}
if (config.directories) {
if (!config.skipCache && config.directories.cache) {
process.env[`${prefix}CACHE_DIR`] = _chunkJVKCJMCKjs.correctPaths.call(void 0,
config.directories.cache
);
process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
}
if (config.directories.data) {
process.env[`${prefix}DATA_DIR`] = _chunkJVKCJMCKjs.correctPaths.call(void 0, config.directories.data);
process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
}
if (config.directories.config) {
process.env[`${prefix}CONFIG_DIR`] = _chunkJVKCJMCKjs.correctPaths.call(void 0,
config.directories.config
);
process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
}
if (config.directories.temp) {
process.env[`${prefix}TEMP_DIR`] = _chunkJVKCJMCKjs.correctPaths.call(void 0, config.directories.temp);
process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
}
if (config.directories.log) {
process.env[`${prefix}LOG_DIR`] = _chunkJVKCJMCKjs.correctPaths.call(void 0, config.directories.log);
process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
}
if (config.directories.build) {
process.env[`${prefix}BUILD_DIR`] = _chunkJVKCJMCKjs.correctPaths.call(void 0,
config.directories.build
);
process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
}
}
if (config.skipCache !== void 0) {
process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
if (config.skipCache) {
process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
}
}
if (config.mode) {
process.env[`${prefix}MODE`] = config.mode;
process.env.NODE_ENV = config.mode;
process.env.ENVIRONMENT = config.mode;
}
if (_optionalChain([config, 'access', _23 => _23.colors, 'optionalAccess', _24 => _24.base, 'optionalAccess', _25 => _25.light]) || _optionalChain([config, 'access', _26 => _26.colors, 'optionalAccess', _27 => _27.base, 'optionalAccess', _28 => _28.dark])) {
for (const key of Object.keys(config.colors)) {
setThemeColorsEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
}
} else {
setThemeColorsEnv(
`${prefix}COLOR_`,
config.colors
);
}
if (config.repository) {
process.env[`${prefix}REPOSITORY`] = config.repository;
}
if (config.branch) {
process.env[`${prefix}BRANCH`] = config.branch;
}
if (config.preid) {
process.env[`${prefix}PRE_ID`] = String(config.preid);
}
if (config.registry) {
if (config.registry.github) {
process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
}
if (config.registry.npm) {
process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
}
if (config.registry.cargo) {
process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
}
if (config.registry.cyclone) {
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
config.registry.cyclone
);
}
if (config.registry.container) {
process.env[`${prefix}REGISTRY_CONTAINER`] = String(
config.registry.container
);
}
}
if (config.logLevel) {
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
process.env.LOG_LEVEL = String(config.logLevel);
process.env.NX_VERBOSE_LOGGING = String(
_chunkKTEGKYAHjs.getLogLevel.call(void 0, config.logLevel) >= _chunkKTEGKYAHjs.LogLevel.DEBUG ? true : false
);
process.env.RUST_BACKTRACE = _chunkKTEGKYAHjs.getLogLevel.call(void 0, config.logLevel) >= _chunkKTEGKYAHjs.LogLevel.DEBUG ? "full" : "none";
}
if (config.skipConfigLogging !== void 0) {
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
config.skipConfigLogging
);
}
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
for (const key of Object.keys(_nullishCoalesce(config.extensions, () => ( {})))) {
if (config.extensions