@powerlines/core 0.48.2 → 0.48.3
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/dist/context/context.d.cts.map +1 -1
- package/dist/context/context.d.mts.map +1 -1
- package/dist/context/context.mjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/lib/config.d.cts +5 -5
- package/dist/lib/config.d.cts.map +1 -1
- package/dist/lib/config.d.mts +5 -5
- package/dist/lib/config.d.mts.map +1 -1
- package/dist/lib/config.mjs.map +1 -1
- package/dist/lib/context-helpers.d.cts +4 -4
- package/dist/lib/context-helpers.d.mts +4 -4
- package/dist/lib/entry.d.cts +2 -2
- package/dist/lib/entry.d.cts.map +1 -1
- package/dist/lib/entry.d.mts +2 -2
- package/dist/lib/entry.d.mts.map +1 -1
- package/dist/lib/entry.mjs.map +1 -1
- package/dist/types/config.d.cts +14 -11
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +14 -11
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.mts +1 -1
- package/package.json +2 -2
package/dist/lib/config.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.mjs","names":["loadConfigC12"],"sources":["../../src/lib/config.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n getWorkspaceConfig,\n tryGetWorkspaceConfig\n} from \"@storm-software/config-tools/get-config\";\nimport {\n isDevelopment,\n isProduction,\n isTest\n} from \"@stryke/env/environment-checks\";\nimport { getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { isFile } from \"@stryke/fs/is-file\";\nimport { readJsonFile } from \"@stryke/fs/json\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { findFilePath, relativePath } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { PartialKeys } from \"@stryke/types/base\";\nimport { PackageJson } from \"@stryke/types/package-json\";\nimport { loadConfig as loadConfigC12 } from \"c12\";\nimport defu from \"defu\";\nimport { resolveLogLevel } from \"../plugin-utils/logging\";\nimport type {\n FrameworkOptions,\n InlineConfig,\n Mode,\n ParsedUserConfig,\n UserConfigExport,\n UserConfigFn,\n UserConfigFnObject,\n UserConfigFnPromise,\n UserInputConfig,\n WorkspaceConfig\n} from \"../types/config\";\nimport { Context } from \"../types/context\";\nimport { LogLevelResolvedConfig } from \"../types/logging\";\nimport { createResolver } from \"./resolver\";\n\nexport function normalizeBasePath(base: string = \"/\"): string {\n let out = base.startsWith(\"/\") ? base : `/${base}`;\n if (!out.endsWith(\"/\")) out = `${out}/`;\n return out.replace(/\\/+/g, \"/\");\n}\n\nexport interface ResolvePackageConfigsResult {\n /**\n * The parsed `package.json` file for the project, if it exists. This file typically contains metadata about the project, such as its name, version, dependencies, and other information relevant to the build process.\n */\n packageJson?: PackageJson;\n\n /**\n * The parsed `project.json` file for the project, if it exists. This file is an optional configuration file that can be used to store additional configuration or metadata specific to the project, and is not required for all projects.\n */\n projectJson?: Record<string, unknown>;\n}\n\n/**\n * Resolve the package configurations for the project by loading the `package.json` and `project.json` files, if they exist. This function will look for these files in the project root and parse their contents as JavaScript objects. The parsed contents will be stored in the context for later use by plugins and other parts of the build process.\n *\n * @remarks\n * The `package.json` file is typically used to store metadata about the project, such as its name, version, dependencies, and other information. The `project.json` file is an optional file that can be used to store additional configuration or metadata specific to the project, and is not required for all projects.\n *\n * @param cwd - The current working directory to look for the package configurations. Defaults to the `cwd` specified in the context configuration.\n * @param root - The root directory of the project to look for the package configurations. Defaults to the `root` specified in the context configuration.\n * @returns A promise that resolves when the package configurations have been loaded and stored in the context.\n */\nexport async function resolvePackageConfigs(\n cwd: string,\n root: string\n): Promise<ResolvePackageConfigsResult> {\n const result: ResolvePackageConfigsResult = {};\n if (cwd || root) {\n const projectJsonPath = joinPaths(\n appendPath(root || \".\", cwd || \".\"),\n \"project.json\"\n );\n if (existsSync(projectJsonPath)) {\n result.projectJson = await readJsonFile(projectJsonPath);\n }\n\n const packageJsonPath = joinPaths(\n appendPath(root || \".\", cwd || \".\"),\n \"package.json\"\n );\n if (existsSync(packageJsonPath)) {\n result.packageJson = await readJsonFile<PackageJson>(packageJsonPath);\n }\n }\n\n return result;\n}\n\n/**\n * Resolve the root directory for the project based on the provided options. This function will determine the root directory by checking the provided `root` option, and if it is not provided, it will look for a configuration file (such as `powerlines.config.ts`) in the current working directory. If a configuration file is found, the root directory will be set to the directory containing that file. If no configuration file is found, the root directory will default to the current working directory.\n *\n * @param cwd - The current working directory to use as the base for resolving the root directory. This is typically the directory from which the Powerlines process was executed.\n * @param root - An optional root directory to use for the project. If provided, this will be used as the root directory instead of looking for a configuration file. This can be an absolute or relative path, and if it is relative, it will be resolved based on the current working directory.\n * @param configFile - An optional path to a configuration file to look for when resolving the root directory. If provided, this file will be used to determine the root directory if the `root` option is not provided. This can be an absolute or relative path, and if it is relative, it will be resolved based on the current working directory.\n * @returns The resolved root directory for the project, which will be used as the base for resolving other paths and configurations throughout the Powerlines process. This will typically be an absolute path to the root directory of the project.\n */\nexport function resolveRoot(\n cwd: string,\n root?: string,\n configFile?: string\n): string {\n let result = root || \".\";\n if (!root) {\n if (configFile) {\n const configFilePath = appendPath(configFile, cwd);\n if (!existsSync(configFilePath)) {\n throw new Error(\n `The user-provided configuration file at \"${configFile}\" does not exist. Please ensure this path is correct and try again.`\n );\n }\n if (!isFile(configFile)) {\n throw new Error(\n `The user-provided configuration file at \"${\n configFile\n }\" is not a file. Please ensure this path is correct and try again.`\n );\n }\n\n result = relativePath(cwd, findFilePath(configFile));\n }\n } else {\n result = replacePath(root, cwd);\n }\n\n return result;\n}\n\n/**\n * Retrieve the workspace configuration for the current project, if it exists. This function will look for a configuration file in the project root and return its contents as a JavaScript object. If no configuration file is found, it will return undefined.\n *\n * @param cwd - The current working directory to start searching from. This is typically the directory from which the Powerlines process was executed.\n * @param root - An optional root directory to use as the base for searching for the configuration file. If provided, this will be used as the starting point for searching for the configuration file instead of the current working directory. This can be an absolute or relative path, and if it is relative, it will be resolved based on the current working directory.\n * @returns A promise that resolves to the workspace configuration object, or undefined if no configuration file is found.\n */\nexport async function tryResolveWorkspaceConfig(\n cwd: string,\n root?: string\n): Promise<WorkspaceConfig | undefined> {\n return tryGetWorkspaceConfig(false, {\n cwd: root ? appendPath(root, cwd) : undefined,\n workspaceRoot: cwd\n });\n}\n\n/**\n * Determine the default mode for the current execution based on the environment and workspace configuration. This function will check the `NODE_ENV` environment variable to determine if the current environment is development, production, or test. If `NODE_ENV` is not set, it will look for a `mode` property in the workspace configuration file. If no mode is specified in the workspace configuration, it will default to \"production\".\n *\n * @remarks\n * The mode is used to determine which configuration file to load (e.g., `powerlines.development.config.js` for development mode, `powerlines.production.config.js` for production mode, etc.) and can also be used by plugins and other parts of the build process to conditionally apply certain behaviors based on the current mode.\n *\n * @param cwd - The current working directory to start searching from. This is typically the directory from which the Powerlines process was executed.\n * @param root - An optional root directory to use as the base for searching for the workspace configuration. If provided, this will be used as the starting point for searching for the workspace configuration instead of the current working directory. This can be an absolute or relative path, and if it is relative, it will be resolved based on the current working directory.\n * @returns A promise that resolves to the default mode for the current execution, which can be \"development\", \"production\", or \"test\".\n */\nexport async function getDefaultMode(\n cwd: string,\n root?: string\n): Promise<Mode> {\n const workspaceConfig = await tryResolveWorkspaceConfig(cwd, root);\n\n return isProduction\n ? \"production\"\n : isDevelopment\n ? \"development\"\n : isTest\n ? \"test\"\n : workspaceConfig?.mode || \"production\";\n}\n\n/**\n * Determine the default log level for the current execution based on the environment and workspace configuration. This function will check the `logLevel` property in the workspace configuration file and resolve it to a `LogLevelResolvedConfig` value. If no log level is specified in the workspace configuration, it will default to \"info\" for development mode and \"warn\" for production mode.\n *\n * @remarks\n * The log level is used to determine which log messages should be output during the execution of the Powerlines process. For example, if the log level is set to \"warn\", only messages with a level of \"warn\", \"error\", or \"fatal\" will be output, while messages with a level of \"info\", \"debug\", or \"trace\" will be suppressed. This allows users to control the verbosity of the logs and focus on the most relevant information based on their current needs.\n *\n * @param cwd - The current working directory to start searching from. This is typically the directory from which the Powerlines process was executed.\n * @param root - An optional root directory to use as the base for searching for the workspace configuration. If provided, this will be used as the starting point for searching for the workspace configuration instead of the current working directory. This can be an absolute or relative path, and if it is relative, it will be resolved based on the current working directory.\n * @returns A promise that resolves to the default log level for the current execution, which can be \"fatal\", \"error\", \"warn\", \"info\", \"debug\", or \"trace\".\n */\nexport async function getDefaultLogLevel(\n cwd: string,\n root?: string\n): Promise<LogLevelResolvedConfig> {\n const workspaceConfig = await tryResolveWorkspaceConfig(cwd, root);\n\n return resolveLogLevel(\n workspaceConfig?.logLevel\n ? workspaceConfig.logLevel === \"success\" ||\n workspaceConfig.logLevel === \"performance\"\n ? \"info\"\n : workspaceConfig.logLevel === \"all\"\n ? \"debug\"\n : workspaceConfig.logLevel === \"fatal\"\n ? \"error\"\n : workspaceConfig.logLevel\n : undefined,\n workspaceConfig?.mode || (await getDefaultMode(cwd, root))\n );\n}\n\n/**\n * Load the user configuration file for the project and set up the context with the loaded configuration. This function will be called during the initialization of the context to load the user configuration file based on the provided options and set up the context accordingly. It will also set up the resolver for loading modules from the user configuration file and ensure that the context is properly initialized with the loaded configuration.\n *\n * @remarks\n * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.\n *\n * @param cwd - The current working directory to start searching from. This is typically the directory from which the Powerlines process was executed.\n * @param root - The root directory of the project to look for the configuration file. This is typically the root directory of the project, which may be different from the current working directory if the process was executed from a subdirectory.\n * @param framework - The name of the framework to use when looking for configuration files (default is \"powerlines\"). This is used to determine the naming convention for the configuration files to look for (e.g., `powerlines.development.config.js` for the \"powerlines\" framework in development mode).\n * @param orgId - The name of the organization to use when looking for configuration files (optional). This can be used to further customize the naming convention for the configuration files to look for (e.g., `powerlines.myorg.development.config.js` for the \"powerlines\" framework in development mode with an organization of \"myorg\").\n * @param inlineConfig - The inline configuration options provided during the execution of a Powerlines command, which can include properties such as the project root, mode, and an explicit path to a configuration file. This is used to determine how the context should be initialized and which configuration file should be loaded for the execution.\n * @returns A promise that resolves when the context has been successfully initialized with the loaded configuration and resolver setup.\n * @throws Will throw an error if no configuration file is found in the project root or current working directory. This ensures that the context cannot be initialized without a valid configuration, which is essential for the proper functioning of the Powerlines process.\n */\nexport async function loadParsedConfig(\n cwd: string,\n root: string,\n framework: string,\n orgId: string,\n inlineConfig: InlineConfig\n) {\n const mode = inlineConfig.mode || (await getDefaultMode(cwd, root));\n\n const configFile = await loadUserConfigFile(\n cwd,\n root,\n mode,\n inlineConfig.command,\n { name: framework, orgId },\n inlineConfig.configFile\n );\n if (!configFile) {\n throw new Error(\n `No configuration file found in ${appendPath(\n root,\n cwd\n )}. Please ensure you have a valid configuration file in your project.`\n );\n }\n\n return configFile;\n}\n\nexport type PartiallyResolvedContext<TContext extends Context = Context> = Omit<\n TContext,\n \"config\" | \"tsconfig\" | \"entry\" | \"fs\" | \"compiler\" | \"unimport\"\n> &\n Partial<TContext> & {\n config: TContext[\"config\"];\n };\n\n/**\n * Loads the workspace configuration.\n *\n * @param cwd - The root directory of the workspace.\n * @param root - The current working directory to start searching from.\n * @returns A promise that resolves to the loaded workspace configuration.\n */\nexport async function loadWorkspaceConfig(\n cwd: string,\n root: string\n): Promise<WorkspaceConfig> {\n return defu(\n {\n workspaceRoot: cwd\n },\n await getWorkspaceConfig(true, {\n cwd: root,\n workspaceRoot: cwd,\n useDefault: true\n })\n );\n}\n\n/**\n * Loads the user configuration file for the project.\n *\n * @remarks\n * This function will attempt to locate and load the user configuration file for the project based on the provided parameters. It will look for configuration files in various formats (e.g., `.ts`, `.js`, `.mts`, `.mjs`) and with different naming conventions (e.g., `powerlines.config.ts`, `powerlines.development.config.js`, etc.) in the project root and current working directory. If a configuration file is found, it will be loaded using a Jiti resolver, and the resulting configuration object will be returned. If no configuration file is found, an empty configuration object will be returned.\n *\n * @param cwd - The current working directory to start searching from.\n * @param root - The root directory of the project.\n * @param mode - The mode to determine which configuration file to load (e.g., \"development\", \"test\", \"production\").\n * @param command - The command being executed (e.g., \"build\", \"dev\", \"test\"), which can be used to further customize the configuration loading logic if needed.\n * @param framework - The name of the framework to use when looking for configuration files (default is \"powerlines\").\n * @param configFile - An explicit path to a configuration file to load (optional). If provided, this file will be loaded instead of searching for configuration files based on the mode and framework.\n * @returns A promise that resolves to the resolved user configuration.\n */\nexport async function loadUserConfigFile(\n cwd: string,\n root: string,\n mode: Mode,\n command: string,\n framework?: PartialKeys<FrameworkOptions, \"orgId\">,\n configFile?: string\n): Promise<ParsedUserConfig> {\n const frameworkName = kebabCase(framework?.name || \"powerlines\");\n const frameworkOrgId = kebabCase(framework?.orgId || \"storm-software\");\n\n let resolvedUserConfig: Partial<ParsedUserConfig> = {};\n\n let resolvedUserConfigFile: string | undefined;\n if (configFile) {\n resolvedUserConfigFile = existsSync(replacePath(configFile, root))\n ? replacePath(configFile, root)\n : existsSync(\n joinPaths(appendPath(root, cwd), replacePath(configFile, root))\n )\n ? joinPaths(appendPath(root, cwd), replacePath(configFile, root))\n : existsSync(joinPaths(appendPath(root, cwd), configFile))\n ? joinPaths(appendPath(root, cwd), configFile)\n : undefined;\n }\n\n if (!resolvedUserConfigFile) {\n resolvedUserConfigFile = existsSync(\n joinPaths(appendPath(root, cwd), `${frameworkName}.${mode}.config.ts`)\n )\n ? joinPaths(appendPath(root, cwd), `${frameworkName}.${mode}.config.ts`)\n : existsSync(\n joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.${mode}.config.js`\n )\n )\n ? joinPaths(appendPath(root, cwd), `${frameworkName}.${mode}.config.js`)\n : existsSync(\n joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.${mode}.config.mts`\n )\n )\n ? joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.${mode}.config.mts`\n )\n : existsSync(\n joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.${mode}.config.mjs`\n )\n )\n ? joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.${mode}.config.mjs`\n )\n : existsSync(\n joinPaths(appendPath(root, cwd), `${frameworkName}.config.ts`)\n )\n ? joinPaths(appendPath(root, cwd), `${frameworkName}.config.ts`)\n : existsSync(\n joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.config.js`\n )\n )\n ? joinPaths(appendPath(root, cwd), `${frameworkName}.config.js`)\n : existsSync(\n joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.config.mts`\n )\n )\n ? joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.config.mts`\n )\n : existsSync(\n joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.config.mjs`\n )\n )\n ? joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.config.mjs`\n )\n : undefined;\n }\n\n const envPaths = getEnvPaths({\n orgId: frameworkOrgId,\n appId: frameworkName,\n workspaceRoot: cwd\n });\n\n const jiti = createResolver({\n cwd,\n root,\n cacheDir: envPaths.cache,\n mode\n });\n\n if (resolvedUserConfigFile) {\n const resolved = await jiti.import<{ default: UserConfigExport }>(\n jiti.esmResolve(resolvedUserConfigFile)\n );\n if (resolved?.default) {\n let config = {};\n if (isFunction(resolved.default)) {\n config = await Promise.resolve(\n resolved.default({ root, cwd, mode, command })\n );\n } else if (\n isSetObject(resolved.default) ||\n Array.isArray(resolved.default)\n ) {\n config = resolved.default;\n }\n\n if (isSetObject(config) || Array.isArray(config)) {\n resolvedUserConfig = {\n ...config,\n config,\n configFile: resolvedUserConfigFile\n };\n }\n }\n }\n\n const result = await loadConfigC12({\n cwd: root,\n name: frameworkName,\n envName: mode,\n globalRc: true,\n packageJson: camelCase(frameworkName),\n dotenv: true,\n jiti\n });\n\n return defu(\n {\n config: {\n root,\n cwd,\n framework\n }\n },\n resolvedUserConfig,\n isSetObject(result?.config) ? { ...result.config, ...result } : {}\n ) as ParsedUserConfig;\n}\n\n/**\n * Type helper to make it easier to use `powerlines.config.ts` files. Accepts a direct {@link UserConfig} object, or a function that returns it. The function receives a {@link ConfigParams} object.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'powerlines';\n *\n * export default defineConfig({\n * // Your configuration here\n * });\n *\n * // Or with a function\n * export default defineConfig((env) => {\n * console.log(`Running command: ${env.command} in mode: ${env.mode}`);\n * return {\n * // Your configuration here\n * };\n * });\n * ```\n */\nexport function defineConfig(config: UserInputConfig): UserInputConfig;\nexport function defineConfig(config: UserInputConfig[]): UserInputConfig[];\nexport function defineConfig(\n config: Promise<UserInputConfig>\n): Promise<UserInputConfig>;\nexport function defineConfig(\n config: Promise<UserInputConfig[]>\n): Promise<UserInputConfig[]>;\nexport function defineConfig(config: UserConfigFnObject): UserConfigFnObject;\nexport function defineConfig(config: UserConfigFnPromise): UserConfigFnPromise;\nexport function defineConfig(config: UserConfigFn): UserConfigFn;\nexport function defineConfig(config: UserConfigExport): UserConfigExport;\nexport function defineConfig(config: UserConfigExport): UserConfigExport {\n return config;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4DA,SAAgB,kBAAkB,OAAe,KAAa;CAC5D,IAAI,MAAM,KAAK,WAAW,GAAG,IAAI,OAAO,IAAI;CAC5C,IAAI,CAAC,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,IAAI,WAAW,SAAS,OAAO,GAC7B,SAAS,MAAM,QAAQ,QACrB,SAAS,QAAQ;IAAE;IAAM;IAAK;IAAM;GAAQ,CAAC,CAC/C;QACK,IACL,YAAY,SAAS,OAAO,KAC5B,MAAM,QAAQ,SAAS,OAAO,GAE9B,SAAS,SAAS;GAGpB,IAAI,YAAY,MAAM,KAAK,MAAM,QAAQ,MAAM,GAC7C,qBAAqB;IACnB,GAAG;IACH;IACA,YAAY;GACd;EAEJ;CACF;CAEA,MAAM,SAAS,MAAMA,WAAc;EACjC,KAAK;EACL,MAAM;EACN,SAAS;EACT,UAAU;EACV,aAAa,UAAU,aAAa;EACpC,QAAQ;EACR;CACF,CAAC;CAED,OAAO,KACL,EACE,QAAQ;EACN;EACA;EACA;CACF,EACF,GACA,oBACA,YAAY,QAAQ,MAAM,IAAI;EAAE,GAAG,OAAO;EAAQ,GAAG;CAAO,IAAI,CAAC,CACnE;AACF;AAkCA,SAAgB,aAAa,QAA4C;CACvE,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"config.mjs","names":["loadConfigC12"],"sources":["../../src/lib/config.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n getWorkspaceConfig,\n tryGetWorkspaceConfig\n} from \"@storm-software/config-tools/get-config\";\nimport {\n isDevelopment,\n isProduction,\n isTest\n} from \"@stryke/env/environment-checks\";\nimport { getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { isFile } from \"@stryke/fs/is-file\";\nimport { readJsonFile } from \"@stryke/fs/json\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { findFilePath, relativePath } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { PartialKeys } from \"@stryke/types/base\";\nimport { PackageJson } from \"@stryke/types/package-json\";\nimport { loadConfig as loadConfigC12 } from \"c12\";\nimport defu from \"defu\";\nimport { resolveLogLevel } from \"../plugin-utils/logging\";\nimport type {\n FrameworkOptions,\n InlineConfig,\n Mode,\n ParsedUserConfig,\n UserConfig,\n UserConfigExport,\n UserConfigFn,\n UserConfigFnObject,\n UserConfigFnPromise,\n WorkspaceConfig\n} from \"../types/config\";\nimport { Context } from \"../types/context\";\nimport { LogLevelResolvedConfig } from \"../types/logging\";\nimport { createResolver } from \"./resolver\";\n\nexport function normalizeBasePath(base: string = \"/\"): string {\n let out = base.startsWith(\"/\") ? base : `/${base}`;\n if (!out.endsWith(\"/\")) out = `${out}/`;\n return out.replace(/\\/+/g, \"/\");\n}\n\nexport interface ResolvePackageConfigsResult {\n /**\n * The parsed `package.json` file for the project, if it exists. This file typically contains metadata about the project, such as its name, version, dependencies, and other information relevant to the build process.\n */\n packageJson?: PackageJson;\n\n /**\n * The parsed `project.json` file for the project, if it exists. This file is an optional configuration file that can be used to store additional configuration or metadata specific to the project, and is not required for all projects.\n */\n projectJson?: Record<string, unknown>;\n}\n\n/**\n * Resolve the package configurations for the project by loading the `package.json` and `project.json` files, if they exist. This function will look for these files in the project root and parse their contents as JavaScript objects. The parsed contents will be stored in the context for later use by plugins and other parts of the build process.\n *\n * @remarks\n * The `package.json` file is typically used to store metadata about the project, such as its name, version, dependencies, and other information. The `project.json` file is an optional file that can be used to store additional configuration or metadata specific to the project, and is not required for all projects.\n *\n * @param cwd - The current working directory to look for the package configurations. Defaults to the `cwd` specified in the context configuration.\n * @param root - The root directory of the project to look for the package configurations. Defaults to the `root` specified in the context configuration.\n * @returns A promise that resolves when the package configurations have been loaded and stored in the context.\n */\nexport async function resolvePackageConfigs(\n cwd: string,\n root: string\n): Promise<ResolvePackageConfigsResult> {\n const result: ResolvePackageConfigsResult = {};\n if (cwd || root) {\n const projectJsonPath = joinPaths(\n appendPath(root || \".\", cwd || \".\"),\n \"project.json\"\n );\n if (existsSync(projectJsonPath)) {\n result.projectJson = await readJsonFile(projectJsonPath);\n }\n\n const packageJsonPath = joinPaths(\n appendPath(root || \".\", cwd || \".\"),\n \"package.json\"\n );\n if (existsSync(packageJsonPath)) {\n result.packageJson = await readJsonFile<PackageJson>(packageJsonPath);\n }\n }\n\n return result;\n}\n\n/**\n * Resolve the root directory for the project based on the provided options. This function will determine the root directory by checking the provided `root` option, and if it is not provided, it will look for a configuration file (such as `powerlines.config.ts`) in the current working directory. If a configuration file is found, the root directory will be set to the directory containing that file. If no configuration file is found, the root directory will default to the current working directory.\n *\n * @param cwd - The current working directory to use as the base for resolving the root directory. This is typically the directory from which the Powerlines process was executed.\n * @param root - An optional root directory to use for the project. If provided, this will be used as the root directory instead of looking for a configuration file. This can be an absolute or relative path, and if it is relative, it will be resolved based on the current working directory.\n * @param configFile - An optional path to a configuration file to look for when resolving the root directory. If provided, this file will be used to determine the root directory if the `root` option is not provided. This can be an absolute or relative path, and if it is relative, it will be resolved based on the current working directory.\n * @returns The resolved root directory for the project, which will be used as the base for resolving other paths and configurations throughout the Powerlines process. This will typically be an absolute path to the root directory of the project.\n */\nexport function resolveRoot(\n cwd: string,\n root?: string,\n configFile?: string\n): string {\n let result = root || \".\";\n if (!root) {\n if (configFile) {\n const configFilePath = appendPath(configFile, cwd);\n if (!existsSync(configFilePath)) {\n throw new Error(\n `The user-provided configuration file at \"${configFile}\" does not exist. Please ensure this path is correct and try again.`\n );\n }\n if (!isFile(configFile)) {\n throw new Error(\n `The user-provided configuration file at \"${\n configFile\n }\" is not a file. Please ensure this path is correct and try again.`\n );\n }\n\n result = relativePath(cwd, findFilePath(configFile));\n }\n } else {\n result = replacePath(root, cwd);\n }\n\n return result;\n}\n\n/**\n * Retrieve the workspace configuration for the current project, if it exists. This function will look for a configuration file in the project root and return its contents as a JavaScript object. If no configuration file is found, it will return undefined.\n *\n * @param cwd - The current working directory to start searching from. This is typically the directory from which the Powerlines process was executed.\n * @param root - An optional root directory to use as the base for searching for the configuration file. If provided, this will be used as the starting point for searching for the configuration file instead of the current working directory. This can be an absolute or relative path, and if it is relative, it will be resolved based on the current working directory.\n * @returns A promise that resolves to the workspace configuration object, or undefined if no configuration file is found.\n */\nexport async function tryResolveWorkspaceConfig(\n cwd: string,\n root?: string\n): Promise<WorkspaceConfig | undefined> {\n return tryGetWorkspaceConfig(false, {\n cwd: root ? appendPath(root, cwd) : undefined,\n workspaceRoot: cwd\n });\n}\n\n/**\n * Determine the default mode for the current execution based on the environment and workspace configuration. This function will check the `NODE_ENV` environment variable to determine if the current environment is development, production, or test. If `NODE_ENV` is not set, it will look for a `mode` property in the workspace configuration file. If no mode is specified in the workspace configuration, it will default to \"production\".\n *\n * @remarks\n * The mode is used to determine which configuration file to load (e.g., `powerlines.development.config.js` for development mode, `powerlines.production.config.js` for production mode, etc.) and can also be used by plugins and other parts of the build process to conditionally apply certain behaviors based on the current mode.\n *\n * @param cwd - The current working directory to start searching from. This is typically the directory from which the Powerlines process was executed.\n * @param root - An optional root directory to use as the base for searching for the workspace configuration. If provided, this will be used as the starting point for searching for the workspace configuration instead of the current working directory. This can be an absolute or relative path, and if it is relative, it will be resolved based on the current working directory.\n * @returns A promise that resolves to the default mode for the current execution, which can be \"development\", \"production\", or \"test\".\n */\nexport async function getDefaultMode(\n cwd: string,\n root?: string\n): Promise<Mode> {\n const workspaceConfig = await tryResolveWorkspaceConfig(cwd, root);\n\n return isProduction\n ? \"production\"\n : isDevelopment\n ? \"development\"\n : isTest\n ? \"test\"\n : workspaceConfig?.mode || \"production\";\n}\n\n/**\n * Determine the default log level for the current execution based on the environment and workspace configuration. This function will check the `logLevel` property in the workspace configuration file and resolve it to a `LogLevelResolvedConfig` value. If no log level is specified in the workspace configuration, it will default to \"info\" for development mode and \"warn\" for production mode.\n *\n * @remarks\n * The log level is used to determine which log messages should be output during the execution of the Powerlines process. For example, if the log level is set to \"warn\", only messages with a level of \"warn\", \"error\", or \"fatal\" will be output, while messages with a level of \"info\", \"debug\", or \"trace\" will be suppressed. This allows users to control the verbosity of the logs and focus on the most relevant information based on their current needs.\n *\n * @param cwd - The current working directory to start searching from. This is typically the directory from which the Powerlines process was executed.\n * @param root - An optional root directory to use as the base for searching for the workspace configuration. If provided, this will be used as the starting point for searching for the workspace configuration instead of the current working directory. This can be an absolute or relative path, and if it is relative, it will be resolved based on the current working directory.\n * @returns A promise that resolves to the default log level for the current execution, which can be \"fatal\", \"error\", \"warn\", \"info\", \"debug\", or \"trace\".\n */\nexport async function getDefaultLogLevel(\n cwd: string,\n root?: string\n): Promise<LogLevelResolvedConfig> {\n const workspaceConfig = await tryResolveWorkspaceConfig(cwd, root);\n\n return resolveLogLevel(\n workspaceConfig?.logLevel\n ? workspaceConfig.logLevel === \"success\" ||\n workspaceConfig.logLevel === \"performance\"\n ? \"info\"\n : workspaceConfig.logLevel === \"all\"\n ? \"debug\"\n : workspaceConfig.logLevel === \"fatal\"\n ? \"error\"\n : workspaceConfig.logLevel\n : undefined,\n workspaceConfig?.mode || (await getDefaultMode(cwd, root))\n );\n}\n\n/**\n * Load the user configuration file for the project and set up the context with the loaded configuration. This function will be called during the initialization of the context to load the user configuration file based on the provided options and set up the context accordingly. It will also set up the resolver for loading modules from the user configuration file and ensure that the context is properly initialized with the loaded configuration.\n *\n * @remarks\n * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.\n *\n * @param cwd - The current working directory to start searching from. This is typically the directory from which the Powerlines process was executed.\n * @param root - The root directory of the project to look for the configuration file. This is typically the root directory of the project, which may be different from the current working directory if the process was executed from a subdirectory.\n * @param framework - The name of the framework to use when looking for configuration files (default is \"powerlines\"). This is used to determine the naming convention for the configuration files to look for (e.g., `powerlines.development.config.js` for the \"powerlines\" framework in development mode).\n * @param orgId - The name of the organization to use when looking for configuration files (optional). This can be used to further customize the naming convention for the configuration files to look for (e.g., `powerlines.myorg.development.config.js` for the \"powerlines\" framework in development mode with an organization of \"myorg\").\n * @param inlineConfig - The inline configuration options provided during the execution of a Powerlines command, which can include properties such as the project root, mode, and an explicit path to a configuration file. This is used to determine how the context should be initialized and which configuration file should be loaded for the execution.\n * @returns A promise that resolves when the context has been successfully initialized with the loaded configuration and resolver setup.\n * @throws Will throw an error if no configuration file is found in the project root or current working directory. This ensures that the context cannot be initialized without a valid configuration, which is essential for the proper functioning of the Powerlines process.\n */\nexport async function loadParsedConfig(\n cwd: string,\n root: string,\n framework: string,\n orgId: string,\n inlineConfig: InlineConfig\n) {\n const mode = inlineConfig.mode || (await getDefaultMode(cwd, root));\n\n const configFile = await loadUserConfigFile(\n cwd,\n root,\n mode,\n inlineConfig.command,\n { name: framework, orgId },\n inlineConfig.configFile\n );\n if (!configFile) {\n throw new Error(\n `No configuration file found in ${appendPath(\n root,\n cwd\n )}. Please ensure you have a valid configuration file in your project.`\n );\n }\n\n return configFile;\n}\n\nexport type PartiallyResolvedContext<TContext extends Context = Context> = Omit<\n TContext,\n \"config\" | \"tsconfig\" | \"entry\" | \"fs\" | \"compiler\" | \"unimport\"\n> &\n Partial<TContext> & {\n config: TContext[\"config\"];\n };\n\n/**\n * Loads the workspace configuration.\n *\n * @param cwd - The root directory of the workspace.\n * @param root - The current working directory to start searching from.\n * @returns A promise that resolves to the loaded workspace configuration.\n */\nexport async function loadWorkspaceConfig(\n cwd: string,\n root: string\n): Promise<WorkspaceConfig> {\n return defu(\n {\n workspaceRoot: cwd\n },\n await getWorkspaceConfig(true, {\n cwd: root,\n workspaceRoot: cwd,\n useDefault: true\n })\n );\n}\n\n/**\n * Loads the user configuration file for the project.\n *\n * @remarks\n * This function will attempt to locate and load the user configuration file for the project based on the provided parameters. It will look for configuration files in various formats (e.g., `.ts`, `.js`, `.mts`, `.mjs`) and with different naming conventions (e.g., `powerlines.config.ts`, `powerlines.development.config.js`, etc.) in the project root and current working directory. If a configuration file is found, it will be loaded using a Jiti resolver, and the resulting configuration object will be returned. If no configuration file is found, an empty configuration object will be returned.\n *\n * @param cwd - The current working directory to start searching from.\n * @param root - The root directory of the project.\n * @param mode - The mode to determine which configuration file to load (e.g., \"development\", \"test\", \"production\").\n * @param command - The command being executed (e.g., \"build\", \"dev\", \"test\"), which can be used to further customize the configuration loading logic if needed.\n * @param framework - The name of the framework to use when looking for configuration files (default is \"powerlines\").\n * @param configFile - An explicit path to a configuration file to load (optional). If provided, this file will be loaded instead of searching for configuration files based on the mode and framework.\n * @returns A promise that resolves to the resolved user configuration.\n */\nexport async function loadUserConfigFile(\n cwd: string,\n root: string,\n mode: Mode,\n command: string,\n framework?: PartialKeys<FrameworkOptions, \"orgId\">,\n configFile?: string\n): Promise<ParsedUserConfig> {\n const frameworkName = kebabCase(framework?.name || \"powerlines\");\n const frameworkOrgId = kebabCase(framework?.orgId || \"storm-software\");\n\n let resolvedUserConfig: Partial<ParsedUserConfig> = {};\n\n let resolvedUserConfigFile: string | undefined;\n if (configFile) {\n resolvedUserConfigFile = existsSync(replacePath(configFile, root))\n ? replacePath(configFile, root)\n : existsSync(\n joinPaths(appendPath(root, cwd), replacePath(configFile, root))\n )\n ? joinPaths(appendPath(root, cwd), replacePath(configFile, root))\n : existsSync(joinPaths(appendPath(root, cwd), configFile))\n ? joinPaths(appendPath(root, cwd), configFile)\n : undefined;\n }\n\n if (!resolvedUserConfigFile) {\n resolvedUserConfigFile = existsSync(\n joinPaths(appendPath(root, cwd), `${frameworkName}.${mode}.config.ts`)\n )\n ? joinPaths(appendPath(root, cwd), `${frameworkName}.${mode}.config.ts`)\n : existsSync(\n joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.${mode}.config.js`\n )\n )\n ? joinPaths(appendPath(root, cwd), `${frameworkName}.${mode}.config.js`)\n : existsSync(\n joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.${mode}.config.mts`\n )\n )\n ? joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.${mode}.config.mts`\n )\n : existsSync(\n joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.${mode}.config.mjs`\n )\n )\n ? joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.${mode}.config.mjs`\n )\n : existsSync(\n joinPaths(appendPath(root, cwd), `${frameworkName}.config.ts`)\n )\n ? joinPaths(appendPath(root, cwd), `${frameworkName}.config.ts`)\n : existsSync(\n joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.config.js`\n )\n )\n ? joinPaths(appendPath(root, cwd), `${frameworkName}.config.js`)\n : existsSync(\n joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.config.mts`\n )\n )\n ? joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.config.mts`\n )\n : existsSync(\n joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.config.mjs`\n )\n )\n ? joinPaths(\n appendPath(root, cwd),\n `${frameworkName}.config.mjs`\n )\n : undefined;\n }\n\n const envPaths = getEnvPaths({\n orgId: frameworkOrgId,\n appId: frameworkName,\n workspaceRoot: cwd\n });\n\n const jiti = createResolver({\n cwd,\n root,\n cacheDir: envPaths.cache,\n mode\n });\n\n if (resolvedUserConfigFile) {\n const resolved = await jiti.import<{ default: UserConfigExport }>(\n jiti.esmResolve(resolvedUserConfigFile)\n );\n if (resolved?.default) {\n let config = {};\n if (isFunction(resolved.default)) {\n config = await Promise.resolve(\n resolved.default({ root, cwd, mode, command })\n );\n } else if (\n isSetObject(resolved.default) ||\n Array.isArray(resolved.default)\n ) {\n config = resolved.default;\n }\n\n if (isSetObject(config) || Array.isArray(config)) {\n resolvedUserConfig = {\n ...config,\n config,\n configFile: resolvedUserConfigFile\n };\n }\n }\n }\n\n const result = await loadConfigC12({\n cwd: root,\n name: frameworkName,\n envName: mode,\n globalRc: true,\n packageJson: camelCase(frameworkName),\n dotenv: true,\n jiti\n });\n\n return defu(\n {\n config: {\n root,\n cwd,\n framework\n }\n },\n resolvedUserConfig,\n isSetObject(result?.config) ? { ...result.config, ...result } : {}\n ) as ParsedUserConfig;\n}\n\n/**\n * Type helper to make it easier to use `powerlines.config.ts` files. Accepts a direct {@link UserConfig} object, or a function that returns it. The function receives a {@link ConfigParams} object.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'powerlines';\n *\n * export default defineConfig({\n * // Your configuration here\n * });\n *\n * // Or with a function\n * export default defineConfig((env) => {\n * console.log(`Running command: ${env.command} in mode: ${env.mode}`);\n * return {\n * // Your configuration here\n * };\n * });\n * ```\n */\nexport function defineConfig(config: UserConfig): UserConfig;\nexport function defineConfig(config: UserConfig[]): UserConfig[];\nexport function defineConfig(config: Promise<UserConfig>): Promise<UserConfig>;\nexport function defineConfig(\n config: Promise<UserConfig[]>\n): Promise<UserConfig[]>;\nexport function defineConfig(config: UserConfigFnObject): UserConfigFnObject;\nexport function defineConfig(config: UserConfigFnPromise): UserConfigFnPromise;\nexport function defineConfig(config: UserConfigFn): UserConfigFn;\nexport function defineConfig(config: UserConfigExport): UserConfigExport;\nexport function defineConfig(config: UserConfigExport): UserConfigExport {\n return config;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4DA,SAAgB,kBAAkB,OAAe,KAAa;CAC5D,IAAI,MAAM,KAAK,WAAW,GAAG,IAAI,OAAO,IAAI;CAC5C,IAAI,CAAC,IAAI,SAAS,GAAG,GAAG,MAAM,GAAG,IAAI;CACrC,OAAO,IAAI,QAAQ,QAAQ,GAAG;AAChC;;;;;;;;;;;AAwBA,eAAsB,sBACpB,KACA,MACsC;CACtC,MAAM,SAAsC,CAAC;CAC7C,IAAI,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OAAO,GAE9B,SAAS,SAAS;GAGpB,IAAI,YAAY,MAAM,KAAK,MAAM,QAAQ,MAAM,GAC7C,qBAAqB;IACnB,GAAG;IACH;IACA,YAAY;GACd;EAEJ;CACF;CAEA,MAAM,SAAS,MAAMA,WAAc;EACjC,KAAK;EACL,MAAM;EACN,SAAS;EACT,UAAU;EACV,aAAa,UAAU,aAAa;EACpC,QAAQ;EACR;CACF,CAAC;CAED,OAAO,KACL,EACE,QAAQ;EACN;EACA;EACA;CACF,EACF,GACA,oBACA,YAAY,QAAQ,MAAM,IAAI;EAAE,GAAG,OAAO;EAAQ,GAAG;CAAO,IAAI,CAAC,CACnE;AACF;AAgCA,SAAgB,aAAa,QAA4C;CACvE,OAAO;AACT"}
|
|
@@ -2,13 +2,13 @@ import { ExecutionContext } from "../types/context.cjs";
|
|
|
2
2
|
import { InferOverridableConfig, ResolvedConfig } from "../types/config.cjs";
|
|
3
3
|
//#region src/lib/context-helpers.d.ts
|
|
4
4
|
declare function getConfigProps<TResolvedConfig extends ResolvedConfig>(config?: TResolvedConfig["userConfig"] | TResolvedConfig["inlineConfig"] | TResolvedConfig["pluginConfig"] | InferOverridableConfig<TResolvedConfig>): ({
|
|
5
|
-
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "
|
|
5
|
+
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends object ? Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends infer T ? T extends Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] ? T extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T : { [K in keyof T]?: (T[K] extends object ? T[K] extends infer T_1 ? T_1 extends T[K] ? T_1 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_1 : { [K_2 in keyof T_1]?: (T_1[K_2] extends object ? T_1[K_2] extends infer T_2 ? T_2 extends T_1[K_2] ? T_2 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_2 : { [K_3 in keyof T_2]?: (T_2[K_3] extends object ? T_2[K_3] extends infer T_3 ? T_3 extends T_2[K_3] ? T_3 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_3 : { [K_4 in keyof T_3]?: (T_3[K_4] extends object ? T_3[K_4] extends infer T_4 ? T_4 extends T_3[K_4] ? T_4 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_4 : { [K_5 in keyof T_4]?: (T_4[K_5] extends object ? T_4[K_5] extends infer T_5 ? T_5 extends T_4[K_5] ? T_5 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_5 : { [K_6 in keyof T_5]?: (T_5[K_6] extends object ? T_5[K_6] extends infer T_6 ? T_6 extends T_5[K_6] ? T_6 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_6 : { [K_7 in keyof T_6]?: (T_6[K_7] extends object ? T_6[K_7] extends infer T_7 ? T_7 extends T_6[K_7] ? T_7 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_7 : { [K_8 in keyof T_7]?: (T_7[K_8] extends object ? T_7[K_8] extends infer T_8 ? T_8 extends T_7[K_8] ? T_8 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_8 : { [K_9 in keyof T_8]?: (T_8[K_9] extends object ? T_8[K_9] : T_8[K_9]) | undefined } : never : never : T_7[K_8]) | undefined } : never : never : T_6[K_7]) | undefined } : never : never : T_5[K_6]) | undefined } : never : never : T_4[K_5]) | undefined } : never : never : T_3[K_4]) | undefined } : never : never : T_2[K_3]) | undefined } : never : never : T_1[K_2]) | undefined } : never : never : T[K]) | undefined } : never : never : Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"]) | undefined;
|
|
6
6
|
} & TResolvedConfig["userConfig"]) | ({
|
|
7
|
-
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "
|
|
7
|
+
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends object ? Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends infer T_1 ? T_1 extends Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] ? T_1 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_1 : { [K_1 in keyof T_1]?: (T_1[K_1] extends object ? T_1[K_1] extends infer T_2 ? T_2 extends T_1[K_1] ? T_2 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_2 : { [K_3 in keyof T_2]?: (T_2[K_3] extends object ? T_2[K_3] extends infer T_3 ? T_3 extends T_2[K_3] ? T_3 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_3 : { [K_4 in keyof T_3]?: (T_3[K_4] extends object ? T_3[K_4] extends infer T_4 ? T_4 extends T_3[K_4] ? T_4 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_4 : { [K_5 in keyof T_4]?: (T_4[K_5] extends object ? T_4[K_5] extends infer T_5 ? T_5 extends T_4[K_5] ? T_5 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_5 : { [K_6 in keyof T_5]?: (T_5[K_6] extends object ? T_5[K_6] extends infer T_6 ? T_6 extends T_5[K_6] ? T_6 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_6 : { [K_7 in keyof T_6]?: (T_6[K_7] extends object ? T_6[K_7] extends infer T_7 ? T_7 extends T_6[K_7] ? T_7 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_7 : { [K_8 in keyof T_7]?: (T_7[K_8] extends object ? T_7[K_8] extends infer T_8 ? T_8 extends T_7[K_8] ? T_8 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_8 : { [K_9 in keyof T_8]?: (T_8[K_9] extends object ? T_8[K_9] extends infer T_9 ? T_9 extends T_8[K_9] ? T_9 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_9 : { [K_10 in keyof T_9]?: (T_9[K_10] extends object ? T_9[K_10] : T_9[K_10]) | undefined } : never : never : T_8[K_9]) | undefined } : never : never : T_7[K_8]) | undefined } : never : never : T_6[K_7]) | undefined } : never : never : T_5[K_6]) | undefined } : never : never : T_4[K_5]) | undefined } : never : never : T_3[K_4]) | undefined } : never : never : T_2[K_3]) | undefined } : never : never : T_1[K_1]) | undefined } : never : never : Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"]) | undefined;
|
|
8
8
|
} & TResolvedConfig["inlineConfig"]) | ({
|
|
9
|
-
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "
|
|
9
|
+
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends object ? Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends infer T_2 ? T_2 extends Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] ? T_2 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_2 : { [K_2 in keyof T_2]?: (T_2[K_2] extends object ? T_2[K_2] extends infer T_3 ? T_3 extends T_2[K_2] ? T_3 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_3 : { [K_4 in keyof T_3]?: (T_3[K_4] extends object ? T_3[K_4] extends infer T_4 ? T_4 extends T_3[K_4] ? T_4 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_4 : { [K_5 in keyof T_4]?: (T_4[K_5] extends object ? T_4[K_5] extends infer T_5 ? T_5 extends T_4[K_5] ? T_5 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_5 : { [K_6 in keyof T_5]?: (T_5[K_6] extends object ? T_5[K_6] extends infer T_6 ? T_6 extends T_5[K_6] ? T_6 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_6 : { [K_7 in keyof T_6]?: (T_6[K_7] extends object ? T_6[K_7] extends infer T_7 ? T_7 extends T_6[K_7] ? T_7 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_7 : { [K_8 in keyof T_7]?: (T_7[K_8] extends object ? T_7[K_8] extends infer T_8 ? T_8 extends T_7[K_8] ? T_8 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_8 : { [K_9 in keyof T_8]?: (T_8[K_9] extends object ? T_8[K_9] extends infer T_9 ? T_9 extends T_8[K_9] ? T_9 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_9 : { [K_10 in keyof T_9]?: (T_9[K_10] extends object ? T_9[K_10] extends infer T_10 ? T_10 extends T_9[K_10] ? T_10 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_10 : { [K_11 in keyof T_10]?: (T_10[K_11] extends object ? T_10[K_11] : T_10[K_11]) | undefined } : never : never : T_9[K_10]) | undefined } : never : never : T_8[K_9]) | undefined } : never : never : T_7[K_8]) | undefined } : never : never : T_6[K_7]) | undefined } : never : never : T_5[K_6]) | undefined } : never : never : T_4[K_5]) | undefined } : never : never : T_3[K_4]) | undefined } : never : never : T_2[K_2]) | undefined } : never : never : Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"]) | undefined;
|
|
10
10
|
} & TResolvedConfig["pluginConfig"]) | ({
|
|
11
|
-
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "
|
|
11
|
+
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends object ? Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends infer T_3 ? T_3 extends Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] ? T_3 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_3 : { [K_3 in keyof T_3]?: (T_3[K_3] extends object ? T_3[K_3] extends infer T_4 ? T_4 extends T_3[K_3] ? T_4 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_4 : { [K_5 in keyof T_4]?: (T_4[K_5] extends object ? T_4[K_5] extends infer T_5 ? T_5 extends T_4[K_5] ? T_5 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_5 : { [K_6 in keyof T_5]?: (T_5[K_6] extends object ? T_5[K_6] extends infer T_6 ? T_6 extends T_5[K_6] ? T_6 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_6 : { [K_7 in keyof T_6]?: (T_6[K_7] extends object ? T_6[K_7] extends infer T_7 ? T_7 extends T_6[K_7] ? T_7 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_7 : { [K_8 in keyof T_7]?: (T_7[K_8] extends object ? T_7[K_8] extends infer T_8 ? T_8 extends T_7[K_8] ? T_8 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_8 : { [K_9 in keyof T_8]?: (T_8[K_9] extends object ? T_8[K_9] extends infer T_9 ? T_9 extends T_8[K_9] ? T_9 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_9 : { [K_10 in keyof T_9]?: (T_9[K_10] extends object ? T_9[K_10] extends infer T_10 ? T_10 extends T_9[K_10] ? T_10 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_10 : { [K_11 in keyof T_10]?: (T_10[K_11] extends object ? T_10[K_11] extends infer T_11 ? T_11 extends T_10[K_11] ? T_11 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_11 : { [K_12 in keyof T_11]?: (T_11[K_12] extends object ? T_11[K_12] : T_11[K_12]) | undefined } : never : never : T_10[K_11]) | undefined } : never : never : T_9[K_10]) | undefined } : never : never : T_8[K_9]) | undefined } : never : never : T_7[K_8]) | undefined } : never : never : T_6[K_7]) | undefined } : never : never : T_5[K_6]) | undefined } : never : never : T_4[K_5]) | undefined } : never : never : T_3[K_3]) | undefined } : never : never : Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"]) | undefined;
|
|
12
12
|
} & InferOverridableConfig<TResolvedConfig>);
|
|
13
13
|
declare function resolvePluginConfig<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = unknown, TContext extends ExecutionContext<TResolvedConfig, TSystemContext> = ExecutionContext<TResolvedConfig, TSystemContext>>(context: TContext): Promise<void>;
|
|
14
14
|
//#endregion
|
|
@@ -2,13 +2,13 @@ import { ExecutionContext } from "../types/context.mjs";
|
|
|
2
2
|
import { InferOverridableConfig, ResolvedConfig } from "../types/config.mjs";
|
|
3
3
|
//#region src/lib/context-helpers.d.ts
|
|
4
4
|
declare function getConfigProps<TResolvedConfig extends ResolvedConfig>(config?: TResolvedConfig["userConfig"] | TResolvedConfig["inlineConfig"] | TResolvedConfig["pluginConfig"] | InferOverridableConfig<TResolvedConfig>): ({
|
|
5
|
-
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "
|
|
5
|
+
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends object ? Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends infer T ? T extends Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] ? T extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T : { [K in keyof T]?: (T[K] extends object ? T[K] extends infer T_1 ? T_1 extends T[K] ? T_1 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_1 : { [K_2 in keyof T_1]?: (T_1[K_2] extends object ? T_1[K_2] extends infer T_2 ? T_2 extends T_1[K_2] ? T_2 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_2 : { [K_3 in keyof T_2]?: (T_2[K_3] extends object ? T_2[K_3] extends infer T_3 ? T_3 extends T_2[K_3] ? T_3 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_3 : { [K_4 in keyof T_3]?: (T_3[K_4] extends object ? T_3[K_4] extends infer T_4 ? T_4 extends T_3[K_4] ? T_4 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_4 : { [K_5 in keyof T_4]?: (T_4[K_5] extends object ? T_4[K_5] extends infer T_5 ? T_5 extends T_4[K_5] ? T_5 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_5 : { [K_6 in keyof T_5]?: (T_5[K_6] extends object ? T_5[K_6] extends infer T_6 ? T_6 extends T_5[K_6] ? T_6 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_6 : { [K_7 in keyof T_6]?: (T_6[K_7] extends object ? T_6[K_7] extends infer T_7 ? T_7 extends T_6[K_7] ? T_7 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_7 : { [K_8 in keyof T_7]?: (T_7[K_8] extends object ? T_7[K_8] extends infer T_8 ? T_8 extends T_7[K_8] ? T_8 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_8 : { [K_9 in keyof T_8]?: (T_8[K_9] extends object ? T_8[K_9] : T_8[K_9]) | undefined } : never : never : T_7[K_8]) | undefined } : never : never : T_6[K_7]) | undefined } : never : never : T_5[K_6]) | undefined } : never : never : T_4[K_5]) | undefined } : never : never : T_3[K_4]) | undefined } : never : never : T_2[K_3]) | undefined } : never : never : T_1[K_2]) | undefined } : never : never : T[K]) | undefined } : never : never : Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"]) | undefined;
|
|
6
6
|
} & TResolvedConfig["userConfig"]) | ({
|
|
7
|
-
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "
|
|
7
|
+
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends object ? Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends infer T_1 ? T_1 extends Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] ? T_1 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_1 : { [K_1 in keyof T_1]?: (T_1[K_1] extends object ? T_1[K_1] extends infer T_2 ? T_2 extends T_1[K_1] ? T_2 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_2 : { [K_3 in keyof T_2]?: (T_2[K_3] extends object ? T_2[K_3] extends infer T_3 ? T_3 extends T_2[K_3] ? T_3 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_3 : { [K_4 in keyof T_3]?: (T_3[K_4] extends object ? T_3[K_4] extends infer T_4 ? T_4 extends T_3[K_4] ? T_4 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_4 : { [K_5 in keyof T_4]?: (T_4[K_5] extends object ? T_4[K_5] extends infer T_5 ? T_5 extends T_4[K_5] ? T_5 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_5 : { [K_6 in keyof T_5]?: (T_5[K_6] extends object ? T_5[K_6] extends infer T_6 ? T_6 extends T_5[K_6] ? T_6 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_6 : { [K_7 in keyof T_6]?: (T_6[K_7] extends object ? T_6[K_7] extends infer T_7 ? T_7 extends T_6[K_7] ? T_7 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_7 : { [K_8 in keyof T_7]?: (T_7[K_8] extends object ? T_7[K_8] extends infer T_8 ? T_8 extends T_7[K_8] ? T_8 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_8 : { [K_9 in keyof T_8]?: (T_8[K_9] extends object ? T_8[K_9] extends infer T_9 ? T_9 extends T_8[K_9] ? T_9 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_9 : { [K_10 in keyof T_9]?: (T_9[K_10] extends object ? T_9[K_10] : T_9[K_10]) | undefined } : never : never : T_8[K_9]) | undefined } : never : never : T_7[K_8]) | undefined } : never : never : T_6[K_7]) | undefined } : never : never : T_5[K_6]) | undefined } : never : never : T_4[K_5]) | undefined } : never : never : T_3[K_4]) | undefined } : never : never : T_2[K_3]) | undefined } : never : never : T_1[K_1]) | undefined } : never : never : Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"]) | undefined;
|
|
8
8
|
} & TResolvedConfig["inlineConfig"]) | ({
|
|
9
|
-
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "
|
|
9
|
+
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends object ? Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends infer T_2 ? T_2 extends Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] ? T_2 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_2 : { [K_2 in keyof T_2]?: (T_2[K_2] extends object ? T_2[K_2] extends infer T_3 ? T_3 extends T_2[K_2] ? T_3 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_3 : { [K_4 in keyof T_3]?: (T_3[K_4] extends object ? T_3[K_4] extends infer T_4 ? T_4 extends T_3[K_4] ? T_4 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_4 : { [K_5 in keyof T_4]?: (T_4[K_5] extends object ? T_4[K_5] extends infer T_5 ? T_5 extends T_4[K_5] ? T_5 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_5 : { [K_6 in keyof T_5]?: (T_5[K_6] extends object ? T_5[K_6] extends infer T_6 ? T_6 extends T_5[K_6] ? T_6 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_6 : { [K_7 in keyof T_6]?: (T_6[K_7] extends object ? T_6[K_7] extends infer T_7 ? T_7 extends T_6[K_7] ? T_7 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_7 : { [K_8 in keyof T_7]?: (T_7[K_8] extends object ? T_7[K_8] extends infer T_8 ? T_8 extends T_7[K_8] ? T_8 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_8 : { [K_9 in keyof T_8]?: (T_8[K_9] extends object ? T_8[K_9] extends infer T_9 ? T_9 extends T_8[K_9] ? T_9 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_9 : { [K_10 in keyof T_9]?: (T_9[K_10] extends object ? T_9[K_10] extends infer T_10 ? T_10 extends T_9[K_10] ? T_10 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_10 : { [K_11 in keyof T_10]?: (T_10[K_11] extends object ? T_10[K_11] : T_10[K_11]) | undefined } : never : never : T_9[K_10]) | undefined } : never : never : T_8[K_9]) | undefined } : never : never : T_7[K_8]) | undefined } : never : never : T_6[K_7]) | undefined } : never : never : T_5[K_6]) | undefined } : never : never : T_4[K_5]) | undefined } : never : never : T_3[K_4]) | undefined } : never : never : T_2[K_2]) | undefined } : never : never : Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"]) | undefined;
|
|
10
10
|
} & TResolvedConfig["pluginConfig"]) | ({
|
|
11
|
-
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "
|
|
11
|
+
input: import("@stryke/types/configuration").TypeDefinition | import("@stryke/types/configuration").TypeDefinitionParameter[] | Record<string, import("@stryke/types/configuration").TypeDefinitionParameter | import("@stryke/types/configuration").TypeDefinitionParameter[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends object ? Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] extends infer T_3 ? T_3 extends Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"] ? T_3 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_3 : { [K_3 in keyof T_3]?: (T_3[K_3] extends object ? T_3[K_3] extends infer T_4 ? T_4 extends T_3[K_3] ? T_4 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_4 : { [K_5 in keyof T_4]?: (T_4[K_5] extends object ? T_4[K_5] extends infer T_5 ? T_5 extends T_4[K_5] ? T_5 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_5 : { [K_6 in keyof T_5]?: (T_5[K_6] extends object ? T_5[K_6] extends infer T_6 ? T_6 extends T_5[K_6] ? T_6 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_6 : { [K_7 in keyof T_6]?: (T_6[K_7] extends object ? T_6[K_7] extends infer T_7 ? T_7 extends T_6[K_7] ? T_7 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_7 : { [K_8 in keyof T_7]?: (T_7[K_8] extends object ? T_7[K_8] extends infer T_8 ? T_8 extends T_7[K_8] ? T_8 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_8 : { [K_9 in keyof T_8]?: (T_8[K_9] extends object ? T_8[K_9] extends infer T_9 ? T_9 extends T_8[K_9] ? T_9 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_9 : { [K_10 in keyof T_9]?: (T_9[K_10] extends object ? T_9[K_10] extends infer T_10 ? T_10 extends T_9[K_10] ? T_10 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_10 : { [K_11 in keyof T_10]?: (T_10[K_11] extends object ? T_10[K_11] extends infer T_11 ? T_11 extends T_10[K_11] ? T_11 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_11 : { [K_12 in keyof T_11]?: (T_11[K_12] extends object ? T_11[K_12] : T_11[K_12]) | undefined } : never : never : T_10[K_11]) | undefined } : never : never : T_9[K_10]) | undefined } : never : never : T_8[K_9]) | undefined } : never : never : T_7[K_8]) | undefined } : never : never : T_6[K_7]) | undefined } : never : never : T_5[K_6]) | undefined } : never : never : T_4[K_5]) | undefined } : never : never : T_3[K_3]) | undefined } : never : never : Omit<TResolvedConfig, "cwd" | "configFile" | "command" | "userConfig" | "inlineConfig" | "pluginConfig">["input"]) | undefined;
|
|
12
12
|
} & InferOverridableConfig<TResolvedConfig>);
|
|
13
13
|
declare function resolvePluginConfig<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = unknown, TContext extends ExecutionContext<TResolvedConfig, TSystemContext> = ExecutionContext<TResolvedConfig, TSystemContext>>(context: TContext): Promise<void>;
|
|
14
14
|
//#endregion
|
package/dist/lib/entry.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnresolvedContext } from "../types/context.cjs";
|
|
2
|
-
import { Config, ResolvedEntryTypeDefinition } from "../types/config.cjs";
|
|
2
|
+
import { Config, ResolvedConfig, ResolvedEntryTypeDefinition } from "../types/config.cjs";
|
|
3
3
|
import { TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/entry.d.ts
|
|
@@ -41,7 +41,7 @@ declare function isResolvedEntryTypeDefinition(entry: TypeDefinitionParameter |
|
|
|
41
41
|
* @param inputs - The entry points to process.
|
|
42
42
|
* @returns An array of unique inputs (by file path or content hash).
|
|
43
43
|
*/
|
|
44
|
-
declare function getUniqueInputs(inputs?: Config["input"]):
|
|
44
|
+
declare function getUniqueInputs(inputs?: Config["input"]): ResolvedConfig["input"];
|
|
45
45
|
//#endregion
|
|
46
46
|
export { getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync };
|
|
47
47
|
//# sourceMappingURL=entry.d.cts.map
|
package/dist/lib/entry.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.d.cts","names":[],"sources":["../../src/lib/entry.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"entry.d.cts","names":[],"sources":["../../src/lib/entry.ts"],"mappings":";;;;;iBAyCgB,kBAAA,kBAAoC,iBAAA,CAAA,CAClD,OAAA,EAAS,QAAA,EACT,cAAA,EAAgB,cAAA;AAAA,iBAsBF,YAAA,kBAA8B,iBAAA,CAAA,CAC5C,OAAA,EAAS,QAAA,EACT,cAAA,EAAgB,cAAA,EAChB,KAAA,GAAQ,uBAAA,EACR,MAAA,YACC,2BAAA;AA7BH;;;;;;;AAAA,iBA4CsB,aAAA,kBAA+B,iBAAA,CAAA,CACnD,OAAA,EAAS,QAAA,EACT,eAAA,EACI,uBAAA,GACA,uBAAA,KACA,MAAA,SAAe,uBAAA,GAA0B,uBAAA,MAC5C,OAAA,CAAQ,2BAAA;;;;;;;;iBAyEK,iBAAA,kBAAmC,iBAAA,CAAA,CACjD,OAAA,EAAS,QAAA,EACT,eAAA,EACI,uBAAA,GACA,uBAAA,KACA,MAAA,SAAe,uBAAA,GAA0B,uBAAA,MAC5C,2BAAA;AAzGH;;;;;;AAAA,iBAiKgB,gBAAA,CAAiB,KAAA,QAAa,KAAA,IAAS,cAAc;;;;;;;iBAUrD,6BAAA,CACd,KAAA,EAAO,uBAAA,GAA0B,2BAAA,GAChC,KAAA,IAAS,2BAAA;;;;;;;iBAaI,eAAA,CACd,MAAA,GAAQ,MAAA,YACP,cAAc"}
|
package/dist/lib/entry.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnresolvedContext } from "../types/context.mjs";
|
|
2
|
-
import { Config, ResolvedEntryTypeDefinition } from "../types/config.mjs";
|
|
2
|
+
import { Config, ResolvedConfig, ResolvedEntryTypeDefinition } from "../types/config.mjs";
|
|
3
3
|
import { TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/entry.d.ts
|
|
@@ -41,7 +41,7 @@ declare function isResolvedEntryTypeDefinition(entry: TypeDefinitionParameter |
|
|
|
41
41
|
* @param inputs - The entry points to process.
|
|
42
42
|
* @returns An array of unique inputs (by file path or content hash).
|
|
43
43
|
*/
|
|
44
|
-
declare function getUniqueInputs(inputs?: Config["input"]):
|
|
44
|
+
declare function getUniqueInputs(inputs?: Config["input"]): ResolvedConfig["input"];
|
|
45
45
|
//#endregion
|
|
46
46
|
export { getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync };
|
|
47
47
|
//# sourceMappingURL=entry.d.mts.map
|
package/dist/lib/entry.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.d.mts","names":[],"sources":["../../src/lib/entry.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"entry.d.mts","names":[],"sources":["../../src/lib/entry.ts"],"mappings":";;;;;iBAyCgB,kBAAA,kBAAoC,iBAAA,CAAA,CAClD,OAAA,EAAS,QAAA,EACT,cAAA,EAAgB,cAAA;AAAA,iBAsBF,YAAA,kBAA8B,iBAAA,CAAA,CAC5C,OAAA,EAAS,QAAA,EACT,cAAA,EAAgB,cAAA,EAChB,KAAA,GAAQ,uBAAA,EACR,MAAA,YACC,2BAAA;AA7BH;;;;;;;AAAA,iBA4CsB,aAAA,kBAA+B,iBAAA,CAAA,CACnD,OAAA,EAAS,QAAA,EACT,eAAA,EACI,uBAAA,GACA,uBAAA,KACA,MAAA,SAAe,uBAAA,GAA0B,uBAAA,MAC5C,OAAA,CAAQ,2BAAA;;;;;;;;iBAyEK,iBAAA,kBAAmC,iBAAA,CAAA,CACjD,OAAA,EAAS,QAAA,EACT,eAAA,EACI,uBAAA,GACA,uBAAA,KACA,MAAA,SAAe,uBAAA,GAA0B,uBAAA,MAC5C,2BAAA;AAzGH;;;;;;AAAA,iBAiKgB,gBAAA,CAAiB,KAAA,QAAa,KAAA,IAAS,cAAc;;;;;;;iBAUrD,6BAAA,CACd,KAAA,EAAO,uBAAA,GAA0B,2BAAA,GAChC,KAAA,IAAS,2BAAA;;;;;;;iBAaI,eAAA,CACd,MAAA,GAAQ,MAAA,YACP,cAAc"}
|
package/dist/lib/entry.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.mjs","names":[],"sources":["../../src/lib/entry.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { murmurhash } from \"@stryke/hash\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { isAbsolutePath } from \"@stryke/path/is-type\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport type {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport { replacePathTokens } from \"../plugin-utils/paths\";\nimport { Config, ResolvedEntryTypeDefinition } from \"../types/config\";\nimport type { UnresolvedContext } from \"../types/context\";\n\nexport function resolveEntryOutput<TContext extends UnresolvedContext>(\n context: TContext,\n typeDefinition: TypeDefinition\n): string {\n return replaceExtension(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n typeDefinition.file,\n joinPaths(context.config.cwd, context.config.root, \"src\")\n ),\n joinPaths(context.config.cwd, context.config.root)\n ),\n joinPaths(context.config.root, \"src\")\n ),\n context.config.root\n ),\n \"src\"\n )\n );\n}\n\nexport function resolveInput<TContext extends UnresolvedContext>(\n context: TContext,\n typeDefinition: TypeDefinition,\n input?: TypeDefinitionParameter,\n output?: string\n): ResolvedEntryTypeDefinition {\n return {\n ...typeDefinition,\n input: isSetString(input) ? { file: String(input) } : typeDefinition,\n output: output || resolveEntryOutput(context, typeDefinition)\n };\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport async function resolveInputs<TContext extends UnresolvedContext>(\n context: TContext,\n typeDefinitions:\n | TypeDefinitionParameter\n | TypeDefinitionParameter[]\n | Record<string, TypeDefinitionParameter | TypeDefinitionParameter[]>\n): Promise<ResolvedEntryTypeDefinition[]> {\n return (\n await Promise.all(\n (isObject(typeDefinitions) && !isTypeDefinition(typeDefinitions)\n ? Object.values(typeDefinitions).flat()\n : toArray(typeDefinitions)\n )\n .map(async entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return {\n ...entry,\n output: entry.output\n ? replacePathTokens(context, entry.output)\n : undefined,\n file: replacePathTokens(context, entry.file)\n };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(\n context,\n typeDefinition.file\n );\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.root);\n if (await context.fs.isFile(filePath)) {\n return resolveInput(\n context,\n {\n file: replacePath(filePath, context.config.root),\n name: typeDefinition.name\n },\n (entry as ResolvedEntryTypeDefinition).input,\n (entry as ResolvedEntryTypeDefinition).output\n );\n }\n\n return (\n await context.fs.glob(appendPath(filePath, context.config.cwd))\n ).map(file =>\n resolveInput(\n context,\n {\n file: replacePath(file, context.config.root),\n name: typeDefinition.name\n },\n (entry as ResolvedEntryTypeDefinition).input,\n (entry as ResolvedEntryTypeDefinition).output\n )\n );\n })\n .flat()\n .filter(Boolean)\n )\n ).flat();\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport function resolveInputsSync<TContext extends UnresolvedContext>(\n context: TContext,\n typeDefinitions:\n | TypeDefinitionParameter\n | TypeDefinitionParameter[]\n | Record<string, TypeDefinitionParameter | TypeDefinitionParameter[]>\n): ResolvedEntryTypeDefinition[] {\n return (\n isObject(typeDefinitions) && !isTypeDefinition(typeDefinitions)\n ? Object.values(typeDefinitions).flat()\n : toArray(typeDefinitions)\n )\n .map(entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return {\n ...entry,\n output: entry.output\n ? replacePathTokens(context, entry.output)\n : undefined,\n file: replacePathTokens(context, entry.file)\n };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(context, typeDefinition.file);\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.root);\n if (context.fs.isFileSync(filePath)) {\n return resolveInput(context, {\n file: appendPath(filePath, context.config.cwd),\n name: typeDefinition.name\n });\n }\n\n return context.fs\n .globSync(appendPath(filePath, context.config.cwd))\n .map(file =>\n resolveInput(context, {\n file,\n name: typeDefinition.name\n })\n );\n })\n .flat()\n .filter(Boolean);\n}\n\n/**\n * Checks if the provided entry is a type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a type definition, false otherwise.\n */\nexport function isTypeDefinition(entry: any): entry is TypeDefinition {\n return !isString(entry) && entry.file !== undefined;\n}\n\n/**\n * Checks if the provided entry is a resolved entry type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a resolved entry type definition, false otherwise.\n */\nexport function isResolvedEntryTypeDefinition(\n entry: TypeDefinitionParameter | ResolvedEntryTypeDefinition\n): entry is ResolvedEntryTypeDefinition {\n return (\n isTypeDefinition(entry) &&\n (entry as ResolvedEntryTypeDefinition).output !== undefined\n );\n}\n\n/**\n * Get unique inputs from the provided list.\n *\n * @param inputs - The entry points to process.\n * @returns An array of unique inputs (by file path or content hash).\n */\nexport function getUniqueInputs(inputs: Config[\"input\"] = []): Config[\"input\"] {\n return isObject(inputs)\n ? inputs\n : getUniqueBy(toArray(inputs), (item: TypeDefinitionParameter) =>\n isSetString(item) ? item : murmurhash(item ?? {}, { maxLength: 24 })\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAqCA,SAAgB,mBACd,SACA,gBACQ;CACR,OAAO,iBACL,YACE,YACE,YACE,YACE,YACE,eAAe,MACf,UAAU,QAAQ,OAAO,KAAK,QAAQ,OAAO,MAAM,KAAK,CAC1D,GACA,UAAU,QAAQ,OAAO,KAAK,QAAQ,OAAO,IAAI,CACnD,GACA,UAAU,QAAQ,OAAO,MAAM,KAAK,CACtC,GACA,QAAQ,OAAO,IACjB,GACA,KACF,CACF;AACF;AAEA,SAAgB,aACd,SACA,gBACA,OACA,QAC6B;CAC7B,OAAO;EACL,GAAG;EACH,OAAO,YAAY,KAAK,IAAI,EAAE,MAAM,OAAO,KAAK,EAAE,IAAI;EACtD,QAAQ,UAAU,mBAAmB,SAAS,cAAc;CAC9D;AACF;;;;;;;;AASA,eAAsB,cACpB,SACA,iBAIwC;CACxC,QACE,MAAM,QAAQ,KACX,SAAS,eAAe,KAAK,CAAC,iBAAiB,eAAe,IAC3D,OAAO,OAAO,eAAe,EAAE,KAAK,IACpC,QAAQ,eAAe,GAExB,IAAI,OAAM,UAAS;EAClB,IAAI,8BAA8B,KAAK,GACrC,OAAO;GACL,GAAG;GACH,QAAQ,MAAM,SACV,kBAAkB,SAAS,MAAM,MAAM,IACvC;GACJ,MAAM,kBAAkB,SAAS,MAAM,IAAI;EAC7C;EAGF,IAAI;EACJ,IAAI,SAAS,KAAK,GAChB,iBAAiB,oBACf,kBAAkB,SAAS,KAAK,CAClC;OACK;GACL,iBAAiB;GACjB,eAAe,OAAO,kBACpB,SACA,eAAe,IACjB;EACF;EAEA,MAAM,WAAW,eAAe,eAAe,IAAI,IAC/C,eAAe,OACf,WAAW,eAAe,MAAM,QAAQ,OAAO,IAAI;EACvD,IAAI,MAAM,QAAQ,GAAG,OAAO,QAAQ,GAClC,OAAO,aACL,SACA;GACE,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O;AACnB;;;;;;;AAQA,SAAgB,iBAAiB,OAAqC;CACpE,OAAO,CAAC,SAAS,KAAK,KAAK,MAAM,SAAS;AAC5C;;;;;;;AAQA,SAAgB,8BACd,OACsC;CACtC,OACE,iBAAiB,KAAK,KACrB,MAAsC,WAAW;AAEtD;;;;;;;AAQA,SAAgB,gBAAgB,SAA0B,CAAC,GAAoB;CAC7E,OAAO,SAAS,MAAM,IAClB,SACA,YAAY,QAAQ,MAAM,IAAI,SAC5B,YAAY,IAAI,IAAI,OAAO,WAAW,QAAQ,CAAC,GAAG,EAAE,WAAW,GAAG,CAAC,CACrE;AACN"}
|
|
1
|
+
{"version":3,"file":"entry.mjs","names":[],"sources":["../../src/lib/entry.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { murmurhash } from \"@stryke/hash\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { isAbsolutePath } from \"@stryke/path/is-type\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport type {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport { replacePathTokens } from \"../plugin-utils/paths\";\nimport {\n Config,\n ResolvedConfig,\n ResolvedEntryTypeDefinition\n} from \"../types/config\";\nimport type { UnresolvedContext } from \"../types/context\";\n\nexport function resolveEntryOutput<TContext extends UnresolvedContext>(\n context: TContext,\n typeDefinition: TypeDefinition\n): string {\n return replaceExtension(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n typeDefinition.file,\n joinPaths(context.config.cwd, context.config.root, \"src\")\n ),\n joinPaths(context.config.cwd, context.config.root)\n ),\n joinPaths(context.config.root, \"src\")\n ),\n context.config.root\n ),\n \"src\"\n )\n );\n}\n\nexport function resolveInput<TContext extends UnresolvedContext>(\n context: TContext,\n typeDefinition: TypeDefinition,\n input?: TypeDefinitionParameter,\n output?: string\n): ResolvedEntryTypeDefinition {\n return {\n ...typeDefinition,\n input: isSetString(input) ? { file: String(input) } : typeDefinition,\n output: output || resolveEntryOutput(context, typeDefinition)\n };\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport async function resolveInputs<TContext extends UnresolvedContext>(\n context: TContext,\n typeDefinitions:\n | TypeDefinitionParameter\n | TypeDefinitionParameter[]\n | Record<string, TypeDefinitionParameter | TypeDefinitionParameter[]>\n): Promise<ResolvedEntryTypeDefinition[]> {\n return (\n await Promise.all(\n (isObject(typeDefinitions) && !isTypeDefinition(typeDefinitions)\n ? Object.values(typeDefinitions).flat()\n : toArray(typeDefinitions)\n )\n .map(async entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return {\n ...entry,\n output: entry.output\n ? replacePathTokens(context, entry.output)\n : undefined,\n file: replacePathTokens(context, entry.file)\n };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(\n context,\n typeDefinition.file\n );\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.root);\n if (await context.fs.isFile(filePath)) {\n return resolveInput(\n context,\n {\n file: replacePath(filePath, context.config.root),\n name: typeDefinition.name\n },\n (entry as ResolvedEntryTypeDefinition).input,\n (entry as ResolvedEntryTypeDefinition).output\n );\n }\n\n return (\n await context.fs.glob(appendPath(filePath, context.config.cwd))\n ).map(file =>\n resolveInput(\n context,\n {\n file: replacePath(file, context.config.root),\n name: typeDefinition.name\n },\n (entry as ResolvedEntryTypeDefinition).input,\n (entry as ResolvedEntryTypeDefinition).output\n )\n );\n })\n .flat()\n .filter(Boolean)\n )\n ).flat();\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport function resolveInputsSync<TContext extends UnresolvedContext>(\n context: TContext,\n typeDefinitions:\n | TypeDefinitionParameter\n | TypeDefinitionParameter[]\n | Record<string, TypeDefinitionParameter | TypeDefinitionParameter[]>\n): ResolvedEntryTypeDefinition[] {\n return (\n isObject(typeDefinitions) && !isTypeDefinition(typeDefinitions)\n ? Object.values(typeDefinitions).flat()\n : toArray(typeDefinitions)\n )\n .map(entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return {\n ...entry,\n output: entry.output\n ? replacePathTokens(context, entry.output)\n : undefined,\n file: replacePathTokens(context, entry.file)\n };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(context, typeDefinition.file);\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.root);\n if (context.fs.isFileSync(filePath)) {\n return resolveInput(context, {\n file: appendPath(filePath, context.config.cwd),\n name: typeDefinition.name\n });\n }\n\n return context.fs\n .globSync(appendPath(filePath, context.config.cwd))\n .map(file =>\n resolveInput(context, {\n file,\n name: typeDefinition.name\n })\n );\n })\n .flat()\n .filter(Boolean);\n}\n\n/**\n * Checks if the provided entry is a type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a type definition, false otherwise.\n */\nexport function isTypeDefinition(entry: any): entry is TypeDefinition {\n return !isString(entry) && entry.file !== undefined;\n}\n\n/**\n * Checks if the provided entry is a resolved entry type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a resolved entry type definition, false otherwise.\n */\nexport function isResolvedEntryTypeDefinition(\n entry: TypeDefinitionParameter | ResolvedEntryTypeDefinition\n): entry is ResolvedEntryTypeDefinition {\n return (\n isTypeDefinition(entry) &&\n (entry as ResolvedEntryTypeDefinition).output !== undefined\n );\n}\n\n/**\n * Get unique inputs from the provided list.\n *\n * @param inputs - The entry points to process.\n * @returns An array of unique inputs (by file path or content hash).\n */\nexport function getUniqueInputs(\n inputs: Config[\"input\"] = []\n): ResolvedConfig[\"input\"] {\n return isObject(inputs)\n ? inputs\n : getUniqueBy(toArray(inputs), (item: TypeDefinitionParameter) =>\n isSetString(item) ? item : murmurhash(item ?? {}, { maxLength: 24 })\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAyCA,SAAgB,mBACd,SACA,gBACQ;CACR,OAAO,iBACL,YACE,YACE,YACE,YACE,YACE,eAAe,MACf,UAAU,QAAQ,OAAO,KAAK,QAAQ,OAAO,MAAM,KAAK,CAC1D,GACA,UAAU,QAAQ,OAAO,KAAK,QAAQ,OAAO,IAAI,CACnD,GACA,UAAU,QAAQ,OAAO,MAAM,KAAK,CACtC,GACA,QAAQ,OAAO,IACjB,GACA,KACF,CACF;AACF;AAEA,SAAgB,aACd,SACA,gBACA,OACA,QAC6B;CAC7B,OAAO;EACL,GAAG;EACH,OAAO,YAAY,KAAK,IAAI,EAAE,MAAM,OAAO,KAAK,EAAE,IAAI;EACtD,QAAQ,UAAU,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,GACrC,OAAO;GACL,GAAG;GACH,QAAQ,MAAM,SACV,kBAAkB,SAAS,MAAM,MAAM,IACvC;GACJ,MAAM,kBAAkB,SAAS,MAAM,IAAI;EAC7C;EAGF,IAAI;EACJ,IAAI,SAAS,KAAK,GAChB,iBAAiB,oBACf,kBAAkB,SAAS,KAAK,CAClC;OACK;GACL,iBAAiB;GACjB,eAAe,OAAO,kBAAkB,SAAS,eAAe,IAAI;EACtE;EAEA,MAAM,WAAW,eAAe,eAAe,IAAI,IAC/C,eAAe,OACf,WAAW,eAAe,MAAM,QAAQ,OAAO,IAAI;EACvD,IAAI,QAAQ,GAAG,WAAW,QAAQ,GAChC,OAAO,aAAa,SAAS;GAC3B,MAAM,WAAW,UAAU,QAAQ,OAAO,GAAG;GAC7C,MAAM,eAAe;EACvB,CAAC;EAGH,OAAO,QAAQ,GACZ,SAAS,WAAW,UAAU,QAAQ,OAAO,GAAG,CAAC,EACjD,KAAI,SACH,aAAa,SAAS;GACpB;GACA,MAAM,eAAe;EACvB,CAAC,CACH;CACJ,CAAC,EACA,KAAK,EACL,OAAO,OAAO;AACnB;;;;;;;AAQA,SAAgB,iBAAiB,OAAqC;CACpE,OAAO,CAAC,SAAS,KAAK,KAAK,MAAM,SAAS;AAC5C;;;;;;;AAQA,SAAgB,8BACd,OACsC;CACtC,OACE,iBAAiB,KAAK,KACrB,MAAsC,WAAW;AAEtD;;;;;;;AAQA,SAAgB,gBACd,SAA0B,CAAC,GACF;CACzB,OAAO,SAAS,MAAM,IAClB,SACA,YAAY,QAAQ,MAAM,IAAI,SAC5B,YAAY,IAAI,IAAI,OAAO,WAAW,QAAQ,CAAC,GAAG,EAAE,WAAW,GAAG,CAAC,CACrE;AACN"}
|
package/dist/types/config.d.cts
CHANGED
|
@@ -330,7 +330,7 @@ interface Config {
|
|
|
330
330
|
/**
|
|
331
331
|
* Defines entries and location(s) of entry modules for the bundle. Relative paths are resolved based on the `root` option.
|
|
332
332
|
*/
|
|
333
|
-
input
|
|
333
|
+
input?: TypeDefinitionParameter | TypeDefinitionParameter[] | Record<string, TypeDefinitionParameter | TypeDefinitionParameter[]>;
|
|
334
334
|
/**
|
|
335
335
|
* Configuration for the output files generated by processing the source code
|
|
336
336
|
*/
|
|
@@ -527,19 +527,18 @@ type ConfigParams = BaseExecutionOptions & Pick<Required<UserConfig>, "mode"> &
|
|
|
527
527
|
*/
|
|
528
528
|
command: string;
|
|
529
529
|
};
|
|
530
|
-
type
|
|
531
|
-
type
|
|
532
|
-
type
|
|
533
|
-
type
|
|
534
|
-
type
|
|
535
|
-
type ParsedUserConfig<TUserConfig extends UserConfig = UserConfig> = ResolvedConfig<UserInputConfig<TUserConfig>> & {
|
|
530
|
+
type UserConfigFnObject = (env: ConfigParams) => UserConfig | UserConfig[];
|
|
531
|
+
type UserConfigFnPromise = (env: ConfigParams) => Promise<UserConfig | UserConfig[]>;
|
|
532
|
+
type UserConfigFn = (env: ConfigParams) => UserConfig | UserConfig[] | Promise<UserConfig | UserConfig[]>;
|
|
533
|
+
type UserConfigExport = UserConfig | UserConfig[] | Promise<UserConfig | UserConfig[]> | UserConfigFnObject | UserConfigFnPromise | UserConfigFn;
|
|
534
|
+
type ParsedUserConfig = ResolvedConfig<UserConfig> & {
|
|
536
535
|
/**
|
|
537
536
|
* The path to the user configuration file, if it exists.
|
|
538
537
|
*
|
|
539
538
|
* @remarks
|
|
540
539
|
* This is typically the `powerlines.json`, `powerlines.config.js`, or `powerlines.config.ts` file in the project root.
|
|
541
540
|
*/
|
|
542
|
-
configFile?: ConfigLayer<
|
|
541
|
+
configFile?: ConfigLayer<UserConfig>["configFile"];
|
|
543
542
|
};
|
|
544
543
|
type InlineConfigPaths = {
|
|
545
544
|
/**
|
|
@@ -623,7 +622,7 @@ interface ResolvedEntryTypeDefinition extends TypeDefinition {
|
|
|
623
622
|
*/
|
|
624
623
|
output?: string;
|
|
625
624
|
}
|
|
626
|
-
type ResolvedEnvironmentConfig = RequiredKeys<Omit<EnvironmentConfig, "preview">, "consumer" | "ssr"> & {
|
|
625
|
+
type ResolvedEnvironmentConfig = RequiredKeys<Omit<EnvironmentConfig, "preview">, "input" | "consumer" | "ssr"> & {
|
|
627
626
|
/**
|
|
628
627
|
* A string identifier for the environment used by the system and plugins to determine which environment-specific configuration to use during the build process.
|
|
629
628
|
*/
|
|
@@ -663,7 +662,7 @@ type ResolvedOutputConfig = Required<Omit<OutputConfig, "copy" | "storage">> & P
|
|
|
663
662
|
/**
|
|
664
663
|
* The base resolved configuration options for a Powerlines project, after being processed and normalized by the configuration loading process.
|
|
665
664
|
*/
|
|
666
|
-
type ResolvedConfig$1<TUserConfig extends UserConfig = UserConfig, TExecutionOptions extends ExecutionOptions = ExecutionOptions> = Omit<TExecutionOptions, "logLevel"> & Omit<RequiredKeys<TUserConfig, "
|
|
665
|
+
type ResolvedConfig$1<TUserConfig extends UserConfig = UserConfig, TExecutionOptions extends ExecutionOptions = ExecutionOptions> = Omit<TExecutionOptions, "logLevel"> & Omit<RequiredKeys<TUserConfig, "input" | "name" | "title" | "plugins" | "mode" | "input" | "tsconfig" | "platform" | "projectType">, "compatibilityDate" | "output" | "resolve" | "logLevel" | "environments"> & {
|
|
667
666
|
/**
|
|
668
667
|
* The configuration options read from a configuration file on disk, which may be used to resolve the final configuration for the context. This typically includes the user configuration options defined in the `powerlines.config.ts` file, as well as any inline configuration options provided during execution.
|
|
669
668
|
*/
|
|
@@ -713,6 +712,10 @@ type ResolvedConfig$1<TUserConfig extends UserConfig = UserConfig, TExecutionOpt
|
|
|
713
712
|
* The log level determines the minimum severity of messages that will be logged. For example, if the log level is set to `LogLevel.INFO`, then messages with a severity of `INFO`, `WARN`, and `ERROR` will be logged, while messages with a severity of `DEBUG` and `TRACE` will be ignored. Setting the log level to `LogLevel.SILENT` will disable all logging. Alternatively, you can provide a more detailed configuration object that allows you to specify different log levels for different categories of logs, providing granular control over the logging behavior for different aspects of the system.
|
|
714
713
|
*/
|
|
715
714
|
logLevel: LogLevelResolvedConfig;
|
|
715
|
+
/**
|
|
716
|
+
* Environment-specific configurations
|
|
717
|
+
*/
|
|
718
|
+
environments: Record<string, ResolvedEnvironmentConfig>;
|
|
716
719
|
};
|
|
717
720
|
type InferOverridableConfig<TResolvedConfig extends ResolvedConfig$1 = ResolvedConfig$1> = DeepPartial<Omit<TResolvedConfig, "userConfig" | "inlineConfig" | "pluginConfig" | "cwd" | "configFile" | "command">>;
|
|
718
721
|
/**
|
|
@@ -732,5 +735,5 @@ type EnvironmentResolvedConfig<TResolvedConfig extends ResolvedConfig$1 = Resolv
|
|
|
732
735
|
environment: ResolvedEnvironmentConfig;
|
|
733
736
|
};
|
|
734
737
|
//#endregion
|
|
735
|
-
export { BaseExecutionOptions, BuildInlineConfig, CleanInlineConfig, Config, ConfigParams, CopyConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, ExecutionOptions, FrameworkOptions, InferOverridableConfig, InlineConfig, InlineConfigPaths, LintInlineConfig, Mode, Options, OutputConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PrepareInlineConfig, ProjectType, ResolveConfig, ResolvedAssetGlob, ResolvedConfig$1 as ResolvedConfig, ResolvedCopyConfig, ResolvedEntryTypeDefinition, ResolvedEnvironmentConfig, ResolvedOutputConfig, ResolvedResolveConfig, TestInlineConfig, TypesInlineConfig, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnObject, UserConfigFnPromise,
|
|
738
|
+
export { BaseExecutionOptions, BuildInlineConfig, CleanInlineConfig, Config, ConfigParams, CopyConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, ExecutionOptions, FrameworkOptions, InferOverridableConfig, InlineConfig, InlineConfigPaths, LintInlineConfig, Mode, Options, OutputConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PrepareInlineConfig, ProjectType, ResolveConfig, ResolvedAssetGlob, ResolvedConfig$1 as ResolvedConfig, ResolvedCopyConfig, ResolvedEntryTypeDefinition, ResolvedEnvironmentConfig, ResolvedOutputConfig, ResolvedResolveConfig, TestInlineConfig, TypesInlineConfig, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnObject, UserConfigFnPromise, WorkspaceConfig };
|
|
736
739
|
//# sourceMappingURL=config.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.cts","names":[],"sources":["../../src/types/config.ts"],"mappings":";;;;;;;;;;;;;;;;;AA4CA;KAAY,eAAA,GAAkB,OAAA,CAAQ,oBAAA,IACpC,QAAA,CAAS,IAAA,CAAK,oBAAA;AAAA,KAEJ,aAAA,yBACc,aAAA,GAAgB,aAAA,qBAErC,OAAA,EAAS,QAAA,KAAa,YAAA,CAAa,MAAA,CAAO,QAAA,IAAY,MAAA,CAAO,QAAA;;;;KAKtD,iBAAA,kBACO,aAAA,GAAgB,aAAA,8BAErB,aAAA,CAAc,QAAA,EAAU,QAAA,GAAW,QAAA,KAAa,MAAA,CAAO,QAAA;;;;KAKzD,kBAAA,kBACO,aAAA,GAAgB,aAAA;EAI7B,MAAA,WAAiB,aAAA,CAAc,QAAA,EAAU,QAAA;EACzC,OAAA,EAAS,QAAA;AAAA;EAGT,MAAA,EAAQ,MAAA,CAAO,QAAA;EACf,OAAA;AAAA;AA1BN;;;AAAA,KAgCY,YAAA,kBAA8B,aAAA,GAAgB,aAAA,aAEtD,aAAA,CAAc,QAAA,UACd,MAAA,CAAO,QAAA,IACP,iBAAA,CAAkB,QAAA,IAClB,kBAAA,CAAmB,QAAA,IACnB,OAAA,CAAQ,YAAA,CAAa,QAAA,KACrB,YAAA,CAAa,QAAA;AAAA,KAEL,aAAA,kBAA+B,aAAA,GAAgB,aAAA,IACzD,WAAA,CAAY,MAAA,CAAO,QAAA;AAAA,KAET,oBAAA,yBACc,aAAA,GAAgB,aAAA,qBAGxC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