@powerlines/core 0.48.42 → 0.48.43
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.cjs
CHANGED
|
@@ -856,6 +856,7 @@ var PowerlinesContext = class extends require_context_base_context.PowerlinesBas
|
|
|
856
856
|
mergedConfig.logLevel = require_plugin_utils_logging.resolveLogLevel(mergedConfig.logLevel);
|
|
857
857
|
if ((0, _stryke_type_checks_is_set_string.isSetString)(mergedConfig.tsconfig)) mergedConfig.tsconfig = (0, _stryke_path_replace.replacePath)(require_plugin_utils_paths.replacePathTokens(this, mergedConfig.tsconfig), mergedConfig.cwd);
|
|
858
858
|
else mergedConfig.tsconfig = require_lib_typescript_tsconfig.getTsconfigFilePath(mergedConfig.cwd, mergedConfig.root);
|
|
859
|
+
mergedConfig.organization ??= await require_plugin_utils_context_helpers.getOrganizationName(this);
|
|
859
860
|
mergedConfig.output.format = (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(mergedConfig.output?.format ?? (mergedConfig.projectType === "library" ? ["cjs", "esm"] : ["esm"])));
|
|
860
861
|
if ((0, _stryke_type_checks_is_set_string.isSetString)(mergedConfig.output.path)) mergedConfig.output.path = (0, _stryke_path_append.appendPath)(require_plugin_utils_paths.replacePathTokens(this, mergedConfig.output.path), mergedConfig.cwd);
|
|
861
862
|
else mergedConfig.output.path = (0, _stryke_path_append.appendPath)((0, _stryke_path_join.joinPaths)(mergedConfig.root, "dist"), mergedConfig.cwd);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.cts","names":[],"sources":["../../src/context/context.ts"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"context.d.cts","names":[],"sources":["../../src/context/context.ts"],"mappings":";;;;;;;;;;;;;;;cAiKa,iBAAA,yBACa,cAAA,GAAiB,cAAA,oCAGjC,qBAAA,CAAsB,cAAA,aACnB,OAAA,CAAQ,eAAA,EAAi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EAkM1C;;;;;;;EA9JE,SAAA,CACX,IAAA,UACA,IAAA,UACA,OAAA,GAAS,gBAAA,GACR,OAAA;EAmMA;;;;;;;EAtKI,aAAA,CACL,IAAA,UACA,IAAA,UACA,OAAA,GAAS,gBAAA;EAyQD;;;;;;;EA3OG,WAAA,CACX,IAAA,UACA,EAAA,UACA,OAAA,GAAS,WAAA,GACR,OAAA;;;;;;;;EA2BI,eAAA,CAAgB,IAAA,UAAc,EAAA,UAAY,OAAA,GAAS,WAAA;;;;;;;;EA2B7C,kBAAA,CACX,IAAA,UACA,EAAA,UACA,OAAA,GAAS,WAAA,GACR,OAAA;;;;;;;;EA2BI,sBAAA,CACL,IAAA,UACA,EAAA,UACA,OAAA,GAAS,WAAA;;;;;;;EA2BE,gBAAA,CAAiB,IAAA,YAAgB,OAAA;;;;;;;EAYjC,eAAA,CACX,MAAA,EAAQ,eAAA,mBACP,OAAA;;;;;;;EAwDU,eAAA,CACX,MAAA,EAAQ,eAAA,mBACP,OAAA;;;;;;YAeO,WAAA,IAAe,eAAA;;;;;;;YA4BT,aAAA,CACd,MAAA,EAAQ,eAAA,iBACP,OAAA;;;;YAaa,aAAA,IAAiB,OAAA;EAAA,QAmWzB,iBAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.mts","names":[],"sources":["../../src/context/context.ts"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"context.d.mts","names":[],"sources":["../../src/context/context.ts"],"mappings":";;;;;;;;;;;;;;;cAiKa,iBAAA,yBACa,cAAA,GAAiB,cAAA,oCAGjC,qBAAA,CAAsB,cAAA,aACnB,OAAA,CAAQ,eAAA,EAAiB,cAAA;EAAA;EA6dE,OAAA,EAAS,gBAAA;EA3cxC,QAAA,EAAW,QAAA;EAvBU;;;EA4BrB,WAAA,EAAc,WAAA;EAvBF;;;EA4BZ,WAAA,EAAa,MAAA;EALC;;;EAUd,UAAA,EAAa,gBAAA;EAKC;;;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WAAA,CACX,IAAA,UACA,EAAA,UACA,OAAA,GAAS,WAAA,GACR,OAAA;;;;;;;;EA2BI,eAAA,CAAgB,IAAA,UAAc,EAAA,UAAY,OAAA,GAAS,WAAA;;;;;;;;EA2B7C,kBAAA,CACX,IAAA,UACA,EAAA,UACA,OAAA,GAAS,WAAA,GACR,OAAA;;;;;;;;EA2BI,sBAAA,CACL,IAAA,UACA,EAAA,UACA,OAAA,GAAS,WAAA;;;;;;;EA2BE,gBAAA,CAAiB,IAAA,YAAgB,OAAA;;;;;;;EAYjC,eAAA,CACX,MAAA,EAAQ,eAAA,mBACP,OAAA;;;;;;;EAwDU,eAAA,CACX,MAAA,EAAQ,eAAA,mBACP,OAAA;;;;;;YAeO,WAAA,IAAe,eAAA;;;;;;;YA4BT,aAAA,CACd,MAAA,EAAQ,eAAA,iBACP,OAAA;;;;YAaa,aAAA,IAAiB,OAAA;EAAA,QAmWzB,iBAAA;AAAA"}
|
package/dist/context/context.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { createResolver } from "../lib/resolver.mjs";
|
|
|
4
4
|
import { getDefaultMode, loadParsedConfig, resolvePackageConfigs } from "../lib/config.mjs";
|
|
5
5
|
import { isDuplicate, isPlugin } from "../plugin-utils/helpers.mjs";
|
|
6
6
|
import { mergeConfig } from "../plugin-utils/merge.mjs";
|
|
7
|
-
import { formatExecutionId, getPackageJsonOrganization, getWorkspaceName } from "../plugin-utils/context-helpers.mjs";
|
|
7
|
+
import { formatExecutionId, getOrganizationName, getPackageJsonOrganization, getWorkspaceName } from "../plugin-utils/context-helpers.mjs";
|
|
8
8
|
import { formatConfig } from "../plugin-utils/format.mjs";
|
|
9
9
|
import { replacePathTokens } from "../plugin-utils/paths.mjs";
|
|
10
10
|
import { callHook } from "../lib/hooks.mjs";
|
|
@@ -853,6 +853,7 @@ var PowerlinesContext = class extends PowerlinesBaseContext {
|
|
|
853
853
|
mergedConfig.logLevel = resolveLogLevel(mergedConfig.logLevel);
|
|
854
854
|
if (isSetString(mergedConfig.tsconfig)) mergedConfig.tsconfig = replacePath(replacePathTokens(this, mergedConfig.tsconfig), mergedConfig.cwd);
|
|
855
855
|
else mergedConfig.tsconfig = getTsconfigFilePath(mergedConfig.cwd, mergedConfig.root);
|
|
856
|
+
mergedConfig.organization ??= await getOrganizationName(this);
|
|
856
857
|
mergedConfig.output.format = getUnique(toArray(mergedConfig.output?.format ?? (mergedConfig.projectType === "library" ? ["cjs", "esm"] : ["esm"])));
|
|
857
858
|
if (isSetString(mergedConfig.output.path)) mergedConfig.output.path = appendPath(replacePathTokens(this, mergedConfig.output.path), mergedConfig.cwd);
|
|
858
859
|
else mergedConfig.output.path = appendPath(joinPaths(mergedConfig.root, "dist"), mergedConfig.cwd);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.mjs","names":["#tsconfig","#fs","#checksum","#buildId","#releaseId","#configProxy","#parserCache","#requestCache"],"sources":["../../src/context/context.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 { toArray } from \"@stryke/convert/to-array\";\nimport { EnvPaths, getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { relativeToWorkspaceRoot } from \"@stryke/fs/get-workspace-root\";\nimport { murmurhash } from \"@stryke/hash\";\nimport { hashDirectory } from \"@stryke/hash/node\";\nimport { getUnique, getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { appendPath } from \"@stryke/path/append\";\nimport {\n findFileDotExtensionSafe,\n findFileExtensionSafe\n} from \"@stryke/path/file-path-fns\";\nimport { isEqual } from \"@stryke/path/is-equal\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { FileReference } from \"@stryke/types/configuration\";\nimport { PackageJson } from \"@stryke/types/package-json\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport { match, tsconfigPathsToRegExp } from \"bundle-require\";\nimport { resolveCompatibilityDates } from \"compatx\";\nimport defu from \"defu\";\nimport { create, FlatCache } from \"flat-cache\";\nimport { existsSync } from \"node:fs\";\nimport { parse, ParseResult } from \"oxc-parser\";\nimport { Range } from \"semver\";\nimport {\n Agent,\n BodyInit,\n fetch,\n interceptors,\n RequestInfo,\n Response,\n setGlobalDispatcher,\n RequestInit as UndiciRequestInit\n} from \"undici\";\nimport { UnpluginBuildContext } from \"unplugin\";\nimport {\n CACHE_HASH_LENGTH,\n DEFAULT_DEVELOPMENT_LOG_LEVEL,\n DEFAULT_PRODUCTION_LOG_LEVEL,\n DEFAULT_TEST_LOG_LEVEL,\n ROOT_HASH_LENGTH\n} from \"../constants\";\nimport {\n getDefaultMode,\n loadParsedConfig,\n resolvePackageConfigs\n} from \"../lib/config\";\nimport { getConfigProps } from \"../lib/context-helpers\";\nimport {\n getUniqueInputs,\n isFileReference,\n resolveInputsSync\n} from \"../lib/entry\";\nimport { callHook } from \"../lib/hooks\";\nimport { getPrefixedRootHash } from \"../lib/meta\";\nimport { createResolver } from \"../lib/resolver\";\nimport { getTsconfigFilePath } from \"../lib/typescript/tsconfig\";\nimport { VirtualFileSystem } from \"../lib/vfs\";\nimport {\n formatExecutionId,\n getPackageJsonOrganization,\n getWorkspaceName\n} from \"../plugin-utils/context-helpers\";\nimport { formatConfig } from \"../plugin-utils/format\";\nimport { isDuplicate, isPlugin } from \"../plugin-utils/helpers\";\nimport { createLogger, resolveLogLevel } from \"../plugin-utils/logging\";\nimport { mergeConfig } from \"../plugin-utils/merge\";\nimport { replacePathTokens } from \"../plugin-utils/paths\";\nimport {\n CopyConfig,\n ExecutionOptions,\n FrameworkOptions,\n InferOverridableConfig,\n ParsedUserConfig,\n PluginConfig,\n ResolvedAssetGlob,\n ResolvedConfig,\n ResolvedCopyConfig,\n ResolvedEntryFileReference,\n ResolvedOutputConfig\n} from \"../types/config\";\nimport {\n Context,\n EmitEntryOptions,\n EmitOptions,\n EnvironmentContext,\n ExecutionContext,\n FetchOptions,\n MetaInfo,\n ParseOptions,\n PluginContext,\n Resolver,\n ResolveResult,\n TransformResult\n} from \"../types/context\";\nimport {\n ResolveOptions,\n VirtualFile,\n VirtualFileSystemInterface\n} from \"../types/fs\";\nimport {\n CallHookOptions,\n InferHookParameters,\n InferHookReturnType\n} from \"../types/hooks\";\nimport {\n Logger,\n LoggerOptions,\n LogLevelResolvedConfig\n} from \"../types/logging\";\nimport { ParsedTypeScriptConfig } from \"../types/tsconfig\";\nimport { PowerlinesBaseContext } from \"./base-context\";\n\nconst agent = new Agent({ keepAliveTimeout: 10000 });\nsetGlobalDispatcher(\n agent.compose(\n interceptors.retry({\n maxRetries: 3,\n minTimeout: 1000,\n maxTimeout: 10000,\n timeoutFactor: 2,\n retryAfter: true\n })\n )\n);\n\nconst UNRESOLVED_CONFIG_NAMES = [\n \"userConfig\",\n \"inlineConfig\",\n \"pluginConfig\",\n \"environmentConfig\"\n];\n\nexport class PowerlinesContext<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TSystemContext = unknown\n>\n extends PowerlinesBaseContext<TSystemContext>\n implements Context<TResolvedConfig, TSystemContext>\n{\n #checksum: string | null = null;\n\n #buildId: string = uuid();\n\n #releaseId: string = uuid();\n\n #fs!: VirtualFileSystemInterface;\n\n #tsconfig!: ParsedTypeScriptConfig;\n\n #parserCache!: FlatCache;\n\n #requestCache!: FlatCache;\n\n #configProxy!: TResolvedConfig;\n\n public resolver!: Resolver;\n\n /**\n * The parsed `package.json` file for the project\n */\n public packageJson!: PackageJson;\n\n /**\n * The parsed `project.json` file for the project\n */\n public projectJson: Record<string, any> | undefined = undefined;\n\n /**\n * The parsed configuration file for the project\n */\n public configFile!: ParsedUserConfig;\n\n /**\n * An object containing the dependencies that should be installed for the project\n */\n public dependencies: Record<string, string | Range> = {};\n\n /**\n * An object containing the development dependencies that should be installed for the project\n */\n public devDependencies: Record<string, string | Range> = {};\n\n /**\n * The persisted meta information about the current build\n */\n public persistedMeta: MetaInfo | undefined = undefined;\n\n /**\n * The resolved tsconfig file paths for the project\n */\n public resolvePatterns: RegExp[] = [];\n\n /**\n * The resolved configuration for this context\n */\n protected resolvedConfig: TResolvedConfig = {} as TResolvedConfig;\n\n /**\n * The configuration options that were overridden by plugins during the build process, which may include additional properties or modifications made during the configuration loading process.\n */\n protected overriddenConfig: InferOverridableConfig<TResolvedConfig> =\n {} as InferOverridableConfig<TResolvedConfig>;\n\n /**\n * The configuration options provided inline during execution, such as CLI flags or other parameters that may be relevant to the command being executed. These options can be used to override or supplement the configuration options defined in a configuration file on disk, and are typically provided as part of the execution context when running a Powerlines command.\n */\n protected inlineConfig: TResolvedConfig[\"inlineConfig\"] =\n {} as TResolvedConfig[\"inlineConfig\"];\n\n /**\n * 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.\n */\n protected userConfig: TResolvedConfig[\"userConfig\"] = {};\n\n /**\n * The configuration options provided by plugins added by the user (and other plugins)\n */\n protected pluginConfig: TResolvedConfig[\"pluginConfig\"] = {};\n\n /**\n * The configuration options provided by the environment\n */\n protected environmentConfig: any = {};\n\n /**\n * A unique identifier for the current execution, which can be used for logging and other purposes to distinguish between different executions in the same process.\n */\n protected get executionId(): string {\n return (\n this.options.executionId ||\n formatExecutionId(\n this.config.name,\n this.config.command,\n this.options.configIndex\n )\n );\n }\n\n /**\n * The resolved entry type definitions for the project\n */\n public get entry(): ResolvedEntryFileReference[] {\n const entry = this.resolvedEntry;\n\n return resolveInputsSync(\n this,\n entry && entry.length > 0\n ? entry\n : Array.isArray(this.config.input) ||\n (isSetObject(this.config.input) &&\n !isFileReference(this.config.input))\n ? this.config.input\n : toArray(this.config.input).flat()\n );\n }\n\n /**\n * The TypeScript configuration parsed from the tsconfig file\n */\n public get tsconfig(): ParsedTypeScriptConfig {\n if (!this.#tsconfig) {\n this.tsconfig = {\n tsconfigFilePath: this.config.tsconfig\n } as ParsedTypeScriptConfig;\n }\n\n return this.#tsconfig;\n }\n\n /**\n * Sets the TypeScript configuration parsed from the tsconfig file\n */\n public set tsconfig(value: ParsedTypeScriptConfig) {\n this.#tsconfig = value;\n this.resolvePatterns = tsconfigPathsToRegExp(value?.options?.paths ?? {});\n }\n\n /**\n * The virtual file system interface for the project\n */\n public get fs(): VirtualFileSystemInterface {\n if (!this.#fs) {\n this.#fs = VirtualFileSystem.createSync(this);\n }\n\n return this.#fs;\n }\n\n /**\n * Get the checksum of the project's current state\n */\n public get checksum(): string | null {\n return this.#checksum;\n }\n\n /**\n * Invokes the configured plugin hooks\n *\n * @remarks\n * By default, it will call the `\"pre\"`, `\"normal\"`, and `\"post\"` ordered hooks in sequence\n *\n * @param hook - The hook to call\n * @param options - The options to provide to the hook\n * @param args - The arguments to pass to the hook\n * @returns The result of the hook call\n */\n public callHook = async <TKey extends string>(\n hook: TKey,\n options: CallHookOptions & {\n environment?: string | EnvironmentContext<any>;\n },\n ...args: InferHookParameters<PluginContext<any>, TKey>\n ): Promise<InferHookReturnType<PluginContext<any>, TKey> | undefined> =>\n callHook<TKey, TResolvedConfig>(\n this as unknown as ExecutionContext<TResolvedConfig>,\n hook,\n options,\n ...args\n );\n\n /**\n * The meta information about the current build\n */\n public get meta() {\n return {\n executionId: this.executionId,\n buildId: this.#buildId,\n releaseId: this.#releaseId,\n checksum: this.#checksum,\n timestamp: this.timestamp,\n rootHash: murmurhash(\n {\n workspaceRoot: this.config?.cwd,\n root: this.config?.root\n },\n {\n maxLength: ROOT_HASH_LENGTH\n }\n ),\n configHash: murmurhash(this.config, {\n maxLength: CACHE_HASH_LENGTH\n })\n } as MetaInfo;\n }\n\n /**\n * The resolved configuration options\n */\n public get config(): TResolvedConfig {\n if (!this.#configProxy) {\n this.#configProxy = this.createConfigProxy();\n }\n\n return this.#configProxy;\n }\n\n /**\n * Get the path to the artifacts directory for the project\n */\n public get artifactsPath(): string {\n return joinPaths(\n this.config.cwd,\n this.config.root,\n this.config.output?.artifactsPath ||\n `.${this.config.framework?.name || \"powerlines\"}`\n );\n }\n\n /**\n * Get the path to the builtin modules used by the project\n */\n public get builtinsPath(): string {\n return joinPaths(this.artifactsPath, \"builtins\");\n }\n\n /**\n * Get the path to the entry directory for the project\n */\n public get entryPath(): string {\n return joinPaths(this.artifactsPath, \"entry\");\n }\n\n /**\n * Get the path to the infrastructure modules used by the project\n */\n public get infrastructurePath(): string {\n return joinPaths(this.artifactsPath, \"infrastructure\");\n }\n\n /**\n * Get the path to the data directory for the project\n */\n public get dataPath(): string {\n return joinPaths(\n this.envPaths.data,\n \"projects\",\n getPrefixedRootHash(this.config.name, this.meta.rootHash)\n );\n }\n\n /**\n * Get the path to the cache directory for the project\n */\n public get cachePath(): string {\n return joinPaths(\n this.envPaths.cache,\n \"projects\",\n murmurhash(\n {\n checksum: this.#checksum,\n config: this.meta.configHash\n },\n {\n maxLength: CACHE_HASH_LENGTH\n }\n )\n );\n }\n\n /**\n * Get the path to the generated declaration file for the project\n */\n public get typesPath(): string {\n return this.config.output.types\n ? appendPath(this.config.output.types, this.config.cwd)\n : joinPaths(this.config.cwd, this.config.root, \"powerlines.d.ts\");\n }\n\n /**\n * Get the project root relative to the workspace root\n */\n public get relativeToWorkspaceRoot() {\n return relativeToWorkspaceRoot(this.config.root);\n }\n\n /**\n * The builtin module id that exist in the Powerlines virtual file system\n */\n public get builtins(): string[] {\n return Object.values(this.fs.metadata)\n .filter(meta => meta && meta.type === \"builtin\")\n .map(meta => meta?.id)\n .filter(Boolean);\n }\n\n /**\n * Additional arguments provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed.\n */\n public get additionalArgs(): Record<string, string | string[]> {\n return Object.entries(this.config.inlineConfig.additionalArgs ?? {}).reduce(\n (ret, [key, value]) => {\n const formattedKey = key.replace(/^--?/, \"\");\n\n if (ret[formattedKey]) {\n if (Array.isArray(ret[formattedKey])) {\n if (Array.isArray(value)) {\n ret[formattedKey] = [...toArray(ret[formattedKey]), ...value];\n } else {\n ret[formattedKey] = [...toArray(ret[formattedKey]), value];\n }\n } else {\n ret[formattedKey] = [\n ret[formattedKey],\n ...(Array.isArray(value) ? value : [value])\n ];\n }\n } else {\n ret[formattedKey] = value;\n }\n return ret;\n },\n {} as Record<string, string | string[]>\n );\n }\n\n /**\n * The alias mappings for the project used during module resolution\n *\n * @remarks\n * This includes both the built-in module aliases as well as any custom aliases defined in the build configuration.\n */\n public get alias(): Record<string, string> {\n return this.builtins.reduce(\n (ret, id) => {\n const moduleId = `${\n this.config?.framework?.name || \"powerlines\"\n }:${id.replace(/^.*:/, \"\")}`;\n if (!ret[moduleId]) {\n const path = this.fs.paths[id];\n if (path) {\n ret[moduleId] = path;\n }\n }\n\n return ret;\n },\n this.config.resolve.alias\n ? Array.isArray(this.config.resolve.alias)\n ? this.config.resolve.alias.reduce(\n (ret, alias) => {\n if (!ret[alias.find.toString()]) {\n ret[alias.find.toString()] = alias.replacement;\n }\n\n return ret;\n },\n {} as Record<string, string>\n )\n : this.config.resolve.alias\n : {}\n );\n }\n\n public override get logger(): Logger {\n return this.createLogger();\n }\n\n /**\n * The log level for the context, which determines the minimum level of log messages that will be emitted by the logger. This is resolved based on the configuration options provided by the user, and can be set to different levels for development, production, and test environments. The log level can also be overridden by plugins or other parts of the build process to provide more granular control over logging output.\n */\n public get logLevel(): LogLevelResolvedConfig {\n return resolveLogLevel(this.config.logLevel, this.config.mode);\n }\n\n /**\n * The environment paths for the project, which provide the locations of various directories and files used by the Powerlines framework. These paths are resolved based on the organization ID, application ID, and workspace root directory, and can be used to access configuration files, cache directories, and other resources in a consistent manner.\n */\n public override get envPaths(): EnvPaths {\n return getEnvPaths({\n orgId: kebabCase(this.config.framework?.orgId || \"storm-software\"),\n appId: kebabCase(this.config.framework?.name || \"powerlines\"),\n workspaceRoot: this.config.cwd\n });\n }\n\n /**\n * Gets the parser cache.\n */\n protected get parserCache(): FlatCache {\n if (!this.#parserCache) {\n this.#parserCache = create({\n cacheId: \"parser\",\n cacheDir: this.cachePath,\n ttl: 2 * 60 * 60 * 1000,\n lruSize: 5000,\n persistInterval: 250\n });\n }\n\n return this.#parserCache;\n }\n\n /**\n * Gets the request cache.\n */\n protected get requestCache(): FlatCache {\n if (!this.#requestCache) {\n this.#requestCache = create({\n cacheId: \"http\",\n cacheDir: this.cachePath,\n ttl: 6 * 60 * 60 * 1000,\n lruSize: 5000,\n persistInterval: 250\n });\n }\n\n return this.#requestCache;\n }\n\n /**\n * The entry points that exist in the Powerlines virtual file system\n */\n protected get resolvedEntry(): ResolvedEntryFileReference[] {\n return Object.entries(this.fs.metadata)\n .filter(([, meta]) => meta && meta.type === \"entry\")\n .map(([path, meta]) => {\n const fileReference = {\n file: path\n } as ResolvedEntryFileReference;\n\n if (meta.properties) {\n if (isSetString(meta.properties.file)) {\n fileReference.file = meta.properties.file;\n }\n if (isSetString(meta.properties.export)) {\n fileReference.export = meta.properties.export;\n }\n if (\n isSetString(meta.properties[\"input.file\"]) ||\n isSetString(meta.properties[\"input.export\"])\n ) {\n fileReference.input ??= {} as FileReference;\n if (isSetString(meta.properties[\"input.file\"])) {\n fileReference.input.file = meta.properties[\"input.file\"];\n }\n if (isSetString(meta.properties[\"input.export\"])) {\n fileReference.input.export = meta.properties[\"input.export\"];\n }\n }\n if (isSetString(meta.properties.output)) {\n fileReference.output = meta.properties.output;\n }\n }\n\n return fileReference;\n })\n .filter(Boolean);\n }\n\n /**\n * Creates a new Context instance.\n *\n * @param options - The options to use for creating the context, including the resolved configuration and workspace settings.\n */\n protected constructor(public override options: ExecutionOptions) {\n super(options);\n }\n\n public override createLogger(options: LoggerOptions = {}) {\n return createLogger(\n this.config.name || this.options.root,\n {\n logLevel: this.logLevel,\n ...options\n },\n this.options.logFn\n );\n }\n\n /**\n * A function to perform HTTP fetch requests\n *\n * @remarks\n * This function uses a caching layer to avoid duplicate requests during the Powerlines process.\n *\n * @example\n * ```ts\n * const response = await context.fetch(\"https://api.example.com/data\");\n * const data = await response.json();\n * ```\n *\n * @see https://github.com/nodejs/undici\n *\n * @param input - The URL to fetch.\n * @param options - The fetch request options.\n * @returns A promise that resolves to a response returned by the fetch.\n */\n public async fetch(\n input: RequestInfo,\n options: FetchOptions = {}\n ): Promise<Response> {\n const { skipCache, timeout = 30000, signal, ...fetchOptions } = options;\n const url =\n typeof input === \"string\"\n ? input\n : \"url\" in input\n ? input.url\n : input.toString();\n\n const cacheKey = murmurhash({\n input: url,\n options: JSON.stringify({\n ...fetchOptions,\n timeout\n })\n });\n\n if (!this.config.skipCache && !skipCache) {\n const cached = this.requestCache.get<\n {\n body: BodyInit;\n } & Pick<Response, \"status\" | \"statusText\" | \"headers\">\n >(cacheKey);\n if (cached) {\n return new Response(cached.body, {\n status: cached.status,\n statusText: cached.statusText,\n headers: cached.headers\n });\n }\n }\n\n const logger = this.extendLogger({ category: \"communication\" });\n const startTime = Date.now();\n\n logger.trace(\n `Sending fetch request (${\n fetchOptions.method?.toUpperCase() || \"GET\"\n }): ${url}`\n );\n\n const requestController = new AbortController();\n const timeoutMs =\n typeof timeout === \"number\" && Number.isFinite(timeout) ? timeout : 30000;\n const timeoutId =\n timeoutMs > 0\n ? setTimeout(() => {\n requestController.abort(\n new Error(`Fetch request timed out after ${timeoutMs}ms`)\n );\n }, timeoutMs)\n : undefined;\n\n const onAbort = () => {\n requestController.abort(signal?.reason);\n };\n\n if (signal) {\n if (signal.aborted) {\n onAbort();\n } else {\n signal.addEventListener(\"abort\", onAbort, { once: true });\n }\n }\n\n let response: Response;\n try {\n response = await fetch(input, {\n ...(fetchOptions as UndiciRequestInit),\n signal: requestController.signal\n });\n } finally {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (signal) {\n signal.removeEventListener(\"abort\", onAbort);\n }\n }\n\n const result = {\n body: await response.text(),\n status: response.status,\n statusText: response.statusText,\n headers: Object.fromEntries(response.headers.entries())\n };\n\n if (!this.config.skipCache && !skipCache) {\n try {\n this.requestCache.set(cacheKey, result);\n } catch {\n // Do nothing\n }\n }\n\n logger.trace(\n `Fetch request (${\n fetchOptions.method?.toUpperCase() || \"GET\"\n }) completed in ${Date.now() - startTime}ms: ${url} - ${\n response.status\n } / ${response.statusText} \\n - Response Headers: ${JSON.stringify(\n result.headers\n )}\\n - Response Body: ${\n typeof result.body === \"string\"\n ? result.body.length > 1000\n ? `${result.body.slice(0, 1000)}... (truncated, total length: ${\n result.body.length\n })`\n : result.body\n : \"[Non-string body]\"\n }`\n );\n\n return new Response(result.body, {\n status: result.status,\n statusText: result.statusText,\n headers: result.headers\n });\n }\n\n /**\n * Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.\n *\n * @remarks\n * This function can be used to parse TypeScript code into an AST for further analysis or transformation.\n *\n * @example\n * ```ts\n * const ast = context.parse(\"const x: number = 42;\");\n * ```\n *\n * @see https://rollupjs.org/plugin-development/#this-parse\n * @see https://github.com/oxc/oxc\n *\n * @param code - The source code to parse.\n * @param options - The options to pass to the parser.\n * @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.\n */\n public async parse(code: string, options: ParseOptions = {}) {\n const cacheKey = murmurhash({\n code,\n options\n });\n\n let result!: ParseResult;\n if (!this.config.skipCache) {\n result = this.parserCache.get<ParseResult>(cacheKey);\n if (result) {\n return result;\n }\n }\n\n result = await parse(`source.${options.lang || \"ts\"}`, code, {\n ...options,\n sourceType: \"module\",\n showSemanticErrors: this.config.mode === \"development\"\n });\n\n if (!this.config.skipCache) {\n this.parserCache.set(cacheKey, result);\n }\n\n return result;\n }\n\n /**\n * A helper function to resolve modules in the Virtual File System\n *\n * @remarks\n * This function can be used to resolve modules relative to the project root directory.\n *\n * @example\n * ```ts\n * const resolved = await context.resolve(\"some-module\", \"/path/to/importer\");\n * ```\n *\n * @param id - The module to resolve.\n * @param importer - An optional path to the importer module.\n * @param options - Additional resolution options.\n * @returns A promise that resolves to the resolved module path.\n */\n public async resolve(\n id: string,\n importer?: string,\n options: ResolveOptions = {}\n ): Promise<ResolveResult | undefined> {\n let moduleId = id;\n if (this.config.resolve.alias) {\n if (Array.isArray(this.config.resolve.alias)) {\n const alias = this.config.resolve.alias.find(a =>\n match(moduleId, [a.find])\n );\n if (alias) {\n moduleId = alias.replacement;\n }\n } else if (\n isSetObject(this.config.resolve.alias) &&\n this.config.resolve.alias[id]\n ) {\n moduleId = this.config.resolve.alias[id];\n }\n }\n\n if (\n this.fs.isResolvableId(moduleId) ||\n (importer && this.fs.isResolvableId(importer))\n ) {\n let resolvedImporter = importer;\n if (importer && this.fs.isResolvableId(importer)) {\n resolvedImporter = await this.fs.resolve(\n importer,\n undefined,\n defu(\n {\n conditions: this.config.resolve.conditions,\n extensions: this.config.resolve.extensions\n },\n options\n )\n );\n }\n\n const result = await this.fs.resolve(\n moduleId,\n resolvedImporter,\n defu(\n {\n conditions: this.config.resolve.conditions,\n extensions: this.config.resolve.extensions\n },\n options\n )\n );\n if (!result) {\n return undefined;\n }\n\n const external = Boolean(\n !match(moduleId, this.config.resolve.noExternal) &&\n (match(moduleId, this.config.resolve.external) ||\n moduleId.startsWith(\"node:\") ||\n ((!this.fs.isVirtual(moduleId, importer, options) ||\n (this.fs.isVirtual(moduleId, importer, options) &&\n this.config.projectType !== \"application\")) &&\n this.config.resolve.skipNodeModulesBundle &&\n !/^[A-Z]:[/\\\\]|^\\.{0,2}\\/|^\\.{1,2}$/.test(moduleId)))\n );\n\n return {\n id: result,\n external,\n virtual: !external\n };\n }\n\n if (this.config.resolve.skipNodeModulesBundle) {\n if (\n match(moduleId, this.resolvePatterns) ||\n match(moduleId, this.config.resolve.noExternal)\n ) {\n return undefined;\n }\n\n if (\n match(moduleId, this.config.resolve.external) ||\n moduleId.startsWith(\"node:\")\n ) {\n return { id: moduleId, external: true, virtual: false };\n }\n\n // Exclude any other import that looks like a Node module\n if (!/^[A-Z]:[/\\\\]|^\\.{0,2}\\/|^\\.{1,2}$/.test(moduleId)) {\n return {\n id: moduleId,\n external: true,\n virtual: false\n };\n }\n } else {\n if (match(moduleId, this.config.resolve.noExternal)) {\n return undefined;\n }\n\n if (\n match(moduleId, this.config.resolve.external) ||\n moduleId.startsWith(\"node:\")\n ) {\n return { id: moduleId, external: true, virtual: false };\n }\n }\n\n return undefined;\n }\n\n /**\n * A helper function to load modules from the Virtual File System\n *\n * @remarks\n * This function can be used to load modules relative to the project root directory.\n *\n * @example\n * ```ts\n * const module = await context.load(\"some-module\", \"/path/to/importer\");\n * ```\n *\n * @param id - The module to load.\n * @returns A promise that resolves to the loaded module.\n */\n public async load(id: string): Promise<TransformResult | undefined> {\n const resolvedId = await this.fs.resolve(id);\n if (!resolvedId) {\n return undefined;\n }\n\n const code = await this.fs.read(resolvedId);\n if (!code) {\n return undefined;\n }\n\n return { code, map: null };\n }\n\n /**\n * Get the builtin virtual files that exist in the Powerlines virtual file system\n */\n public async getBuiltins() {\n return Promise.all(\n Object.entries(this.fs.metadata)\n .filter(([, meta]) => meta && meta.type === \"builtin\")\n .map(async ([id, meta]) => {\n const code = await this.fs.read(id);\n const path = this.fs.paths[id];\n\n return { ...meta, path, code } as VirtualFile;\n })\n );\n }\n\n /**\n * Resolves a file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the file\n * @param path - The path to write the file to\n * @param options - Additional options for writing the file\n */\n public async emit(\n code: string,\n path: string,\n options: EmitOptions = {}\n ): Promise<void> {\n const filePath = options.extension\n ? findFileExtensionSafe(path)\n ? options.extension.startsWith(\".\")\n ? path.replace(findFileDotExtensionSafe(path), options.extension)\n : path.replace(findFileExtensionSafe(path), options.extension)\n : options.extension.startsWith(\".\")\n ? `${path}${options.extension}`\n : `${path}.${options.extension}`\n : findFileExtensionSafe(path)\n ? path\n : `${path}.ts`;\n\n if (\n isFunction((this as unknown as UnpluginBuildContext).emitFile) &&\n options.emitWithBundler\n ) {\n return (this as unknown as UnpluginBuildContext).emitFile({\n needsCodeReference: options.needsCodeReference,\n originalFileName: options.originalFileName,\n fileName: filePath,\n source: code,\n type: \"asset\"\n });\n }\n\n return this.fs.write(filePath, code, options);\n }\n\n /**\n * Synchronously resolves a file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the file\n * @param path - The path to write the file to\n * @param options - Additional options for writing the file\n */\n public emitSync(code: string, path: string, options: EmitOptions = {}) {\n const filePath = options.extension\n ? findFileExtensionSafe(path)\n ? options.extension.startsWith(\".\")\n ? path.replace(findFileDotExtensionSafe(path), options.extension)\n : path.replace(findFileExtensionSafe(path), options.extension)\n : options.extension.startsWith(\".\")\n ? `${path}${options.extension}`\n : `${path}.${options.extension}`\n : findFileExtensionSafe(path)\n ? path\n : `${path}.ts`;\n\n if (\n isFunction((this as unknown as UnpluginBuildContext).emitFile) &&\n options.emitWithBundler\n ) {\n return (this as unknown as UnpluginBuildContext).emitFile({\n needsCodeReference: options.needsCodeReference,\n originalFileName: options.originalFileName,\n fileName: filePath,\n source: code,\n type: \"asset\"\n });\n }\n\n return this.fs.writeSync(filePath, code, options);\n }\n\n /**\n * Resolves a entry virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the entry file\n * @param path - A path to write the entry file to\n * @param options - Optional write file options\n */\n public async emitEntry(\n code: string,\n path: string,\n options: EmitEntryOptions = {}\n ): Promise<void> {\n return this.emit(\n code,\n appendPath(path, this.entryPath),\n defu(\n {\n meta: {\n type: \"entry\",\n properties: {\n file: appendPath(path, this.entryPath),\n export: options?.export,\n output: options?.output,\n \"input.file\": options?.input?.file,\n \"input.export\": options?.input?.export\n }\n }\n },\n omit(options, [\"export\"])\n )\n );\n }\n\n /**\n * Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the entry file\n * @param path - A path to write the entry file to\n * @param options - Optional write file options\n */\n public emitEntrySync(\n code: string,\n path: string,\n options: EmitEntryOptions = {}\n ): void {\n return this.emitSync(\n code,\n appendPath(path, this.entryPath),\n defu(\n {\n meta: {\n type: \"entry\",\n properties: {\n file: appendPath(path, this.entryPath),\n export: options?.export,\n output: options?.output,\n \"input.file\": options?.input?.file,\n \"input.export\": options?.input?.export\n }\n }\n },\n omit(options, [\"export\"])\n )\n );\n }\n\n /**\n * Resolves a builtin virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the builtin file\n * @param id - The unique identifier of the builtin file\n * @param options - Optional write file options\n */\n public async emitBuiltin(\n code: string,\n id: string,\n options: EmitOptions = {}\n ): Promise<void> {\n if (!this.builtinsPath) {\n throw new Error(\n `The builtins path is not set. Cannot emit builtin file with id \"${id}\".`\n );\n }\n\n if (!isSetString(id)) {\n throw new Error(\n `The builtin id must be a non-empty string. Received: ${String(id)}`\n );\n }\n\n return this.emit(\n code,\n appendPath(id, this.builtinsPath),\n defu(options, { meta: { type: \"builtin\", id } })\n );\n }\n\n /**\n * Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the builtin file\n * @param id - The unique identifier of the builtin file\n * @param options - Optional write file options\n */\n public emitBuiltinSync(code: string, id: string, options: EmitOptions = {}) {\n if (!this.builtinsPath) {\n throw new Error(\n `The builtins path is not set. Cannot emit builtin file with id \"${id}\".`\n );\n }\n\n if (!isSetString(id)) {\n throw new Error(\n `The builtin id must be a non-empty string. Received: ${String(id)}`\n );\n }\n\n return this.emitSync(\n code,\n appendPath(id, this.builtinsPath),\n defu(options, { meta: { type: \"builtin\", id } })\n );\n }\n\n /**\n * Resolves a builtin virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the builtin file\n * @param id - The unique identifier of the builtin file\n * @param options - Optional write file options\n */\n public async emitInfrastructure(\n code: string,\n id: string,\n options: EmitOptions = {}\n ): Promise<void> {\n if (!this.infrastructurePath) {\n throw new Error(\n `The infrastructure path is not set. Cannot emit infrastructure file with id \"${id}\".`\n );\n }\n\n if (!isSetString(id)) {\n throw new Error(\n `The infrastructure id must be a non-empty string. Received: ${String(id)}`\n );\n }\n\n return this.emit(\n code,\n appendPath(id, this.infrastructurePath),\n defu(options, { meta: { type: \"infrastructure\", id } })\n );\n }\n\n /**\n * Synchronously resolves an infrastructure virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the infrastructure file\n * @param id - The unique identifier of the infrastructure file\n * @param options - Optional write file options\n */\n public emitInfrastructureSync(\n code: string,\n id: string,\n options: EmitOptions = {}\n ) {\n if (!this.infrastructurePath) {\n throw new Error(\n `The infrastructure path is not set. Cannot emit infrastructure file with id \"${id}\".`\n );\n }\n\n if (!isSetString(id)) {\n throw new Error(\n `The infrastructure id must be a non-empty string. Received: ${String(id)}`\n );\n }\n\n return this.emitSync(\n code,\n appendPath(id, this.infrastructurePath),\n defu(options, { meta: { type: \"infrastructure\", id } })\n );\n }\n\n /**\n * Generates a checksum representing the current context state\n *\n * @param path - The root directory of the project to generate the checksum for\n * @returns A promise that resolves to a string representing the checksum\n */\n public async generateChecksum(path?: string): Promise<string> {\n return hashDirectory(\n path || appendPath(this.options.root, this.options.cwd)\n );\n }\n\n /**\n * A setter function to populate the inline config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the inline configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any inline configuration provided during execution.\n *\n * @param config - The inline configuration values to set.\n * @returns A promise that resolves when the inline configuration values have been set.\n */\n public async setInlineConfig(\n config: TResolvedConfig[\"inlineConfig\"]\n ): Promise<void> {\n this.logger.debug({\n meta: { category: \"config\" },\n message: `Updating inline configuration object: \\n${formatConfig(config)}`\n });\n\n this.inlineConfig = config;\n this.#checksum = await this.generateChecksum();\n\n this.configFile = await loadParsedConfig(\n this.options.cwd,\n this.options.root,\n this.options.framework?.name || \"powerlines\",\n this.options.framework?.orgId || \"storm-software\",\n config\n );\n\n const configIndex = this.options.configIndex ?? 0;\n\n const result =\n this.configFile.config &&\n toArray(this.configFile.config).length > configIndex\n ? toArray(this.configFile.config)[configIndex]!\n : this.configFile.config;\n if (!result) {\n this.logger.warn(\n `No configuration found in ${\n this.options.configFile\n } for execution index ${this.options.configIndex}.`\n );\n } else {\n await this.setUserConfig(\n (isFunction(result)\n ? await Promise.resolve(\n result({\n cwd: this.cwd,\n root: this.options.root,\n mode:\n this.inlineConfig.mode ||\n (await getDefaultMode(this.cwd, this.options.root)),\n command: this.inlineConfig.command\n })\n )\n : result) as TResolvedConfig[\"userConfig\"]\n );\n }\n\n await this.resolveConfig();\n }\n\n /**\n * A setter function to populate the plugin config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the plugin configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any plugin configuration provided during execution.\n *\n * @param config - The plugin configuration values to set.\n * @returns A promise that resolves when the plugin configuration values have been set.\n */\n public async setPluginConfig(\n config: TResolvedConfig[\"pluginConfig\"]\n ): Promise<void> {\n this.logger.debug({\n meta: { category: \"config\" },\n message: `Updating plugin configuration object: \\n${formatConfig(config)}`\n });\n\n this.pluginConfig = config;\n await this.resolveConfig();\n }\n\n /**\n * A function to merge the various configuration objects (initial, user, inline, and plugin) into a single resolved configuration object that can be used throughout the Powerlines process. This function takes into account the different sources of configuration and their respective priorities, ensuring that the final configuration reflects the intended settings for the project. The merged configuration is then returned as a new object that can be accessed through the `config` property of the context.\n *\n * @returns The merged configuration object that combines the initial, user, inline, and plugin configurations.\n */\n protected mergeConfig(): TResolvedConfig {\n return mergeConfig(\n {\n inlineConfig: this.inlineConfig,\n userConfig: this.userConfig,\n pluginConfig: this.pluginConfig,\n environmentConfig: this.environmentConfig\n },\n getConfigProps<TResolvedConfig>(this.overriddenConfig),\n this.options,\n getConfigProps<TResolvedConfig>(this.inlineConfig),\n getConfigProps<TResolvedConfig>(this.userConfig),\n getConfigProps<TResolvedConfig>(this.pluginConfig),\n {\n version: this.packageJson?.version,\n description: this.packageJson?.description,\n environments: {},\n resolve: {}\n }\n ) as TResolvedConfig;\n }\n\n /**\n * A setter function to populate the user config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the user configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any inline configuration provided during execution.\n *\n * @param config - The user configuration values to set.\n * @returns A promise that resolves when the user configuration values have been set.\n */\n protected async setUserConfig(\n config: TResolvedConfig[\"userConfig\"]\n ): Promise<void> {\n this.logger.debug({\n meta: { category: \"config\" },\n message: `Updating user configuration object: \\n${formatConfig(config)}`\n });\n\n this.userConfig = config;\n await this.resolveConfig();\n }\n\n /**\n * Initialize the context with the provided configuration options\n */\n protected async resolveConfig(): Promise<void> {\n const mergedConfig = this.mergeConfig();\n\n this.logger.trace({\n meta: { category: \"config\" },\n message: `Pre-setup Powerlines configuration object: \\n --- Merged Config --- \\n${formatConfig(\n mergedConfig\n )} \\n\\n --- User Config --- \\n${formatConfig(\n this.userConfig\n )} \\n\\n --- Inline Config --- \\n${formatConfig(\n this.inlineConfig\n )} \\n\\n --- Plugin Config --- \\n${formatConfig(\n this.pluginConfig\n )} \\n\\n --- Environment Config --- \\n${formatConfig(\n this.environmentConfig\n )} \\n\\n --- Overridden Config --- \\n${formatConfig(\n this.overriddenConfig\n )}`\n });\n\n mergedConfig.output = defu(mergedConfig.output ?? {}, {\n copy: {\n assets: [\n {\n glob: \"LICENSE\"\n },\n {\n input: mergedConfig.root,\n glob: \"*.md\"\n },\n {\n input: mergedConfig.root,\n glob: \"package.json\"\n }\n ]\n },\n dts: true\n }) as ResolvedOutputConfig;\n\n if (isUndefined(mergedConfig.mode)) {\n mergedConfig.mode = await getDefaultMode(this.cwd, mergedConfig.root);\n }\n\n if (\n isUndefined(mergedConfig.framework) ||\n !isSetString(mergedConfig.framework.name)\n ) {\n mergedConfig.framework ??= {} as FrameworkOptions;\n mergedConfig.framework.name ??=\n (await getWorkspaceName(this)) || \"powerlines\";\n }\n\n if (isUndefined(mergedConfig.platform)) {\n mergedConfig.platform = \"neutral\";\n }\n\n mergedConfig.compatibilityDate = resolveCompatibilityDates(\n mergedConfig.compatibilityDate,\n \"latest\"\n );\n\n if (\n (!this.packageJson &&\n existsSync(\n joinPaths(\n appendPath(mergedConfig.root, mergedConfig.cwd),\n \"package.json\"\n )\n )) ||\n (!this.projectJson &&\n existsSync(\n joinPaths(\n appendPath(mergedConfig.root, mergedConfig.cwd),\n \"project.json\"\n )\n ))\n ) {\n const result = await resolvePackageConfigs(\n mergedConfig.cwd,\n mergedConfig.root\n );\n if (result) {\n if (result.packageJson) {\n this.packageJson = result.packageJson;\n }\n if (result.projectJson) {\n this.projectJson = result.projectJson;\n }\n\n if (this.packageJson) {\n mergedConfig.framework ??= {} as FrameworkOptions;\n mergedConfig.framework.name ??=\n (await getWorkspaceName(this)) || \"powerlines\";\n mergedConfig.framework.orgId ??=\n getPackageJsonOrganization(this.packageJson) || \"storm-software\";\n }\n }\n }\n\n if (isUndefined(mergedConfig.projectType)) {\n mergedConfig.projectType = this.projectJson?.projectType || \"application\";\n }\n\n this.resolvedConfig = mergedConfig;\n this.#configProxy = this.createConfigProxy();\n\n mergedConfig.input = getUniqueInputs(mergedConfig.input);\n\n if (\n mergedConfig.name?.startsWith(\"@\") &&\n mergedConfig.name.split(\"/\").filter(Boolean).length > 1\n ) {\n mergedConfig.name = mergedConfig.name.split(\"/\").filter(Boolean)[1]!;\n }\n\n mergedConfig.title ??= titleCase(mergedConfig.name);\n\n if (mergedConfig.resolve.external) {\n mergedConfig.resolve.external = getUnique(mergedConfig.resolve.external);\n }\n if (mergedConfig.resolve.noExternal) {\n mergedConfig.resolve.noExternal = getUnique(\n mergedConfig.resolve.noExternal\n );\n }\n\n mergedConfig.plugins = (mergedConfig.plugins ?? [])\n .flatMap(plugin => toArray(plugin))\n .filter(Boolean)\n .reduce((ret, plugin) => {\n if (\n isPlugin(plugin) &&\n isDuplicate(\n plugin,\n ret.filter(p => isPlugin(p))\n )\n ) {\n return ret;\n }\n\n ret.push(plugin);\n\n return ret;\n }, [] as PluginConfig[]);\n\n if (isUndefined(mergedConfig.logLevel)) {\n if (mergedConfig.mode === \"development\") {\n mergedConfig.logLevel = DEFAULT_DEVELOPMENT_LOG_LEVEL;\n } else if (mergedConfig.mode === \"test\") {\n mergedConfig.logLevel = DEFAULT_TEST_LOG_LEVEL;\n } else {\n mergedConfig.logLevel = DEFAULT_PRODUCTION_LOG_LEVEL;\n }\n }\n\n mergedConfig.logLevel = resolveLogLevel(mergedConfig.logLevel);\n\n if (isSetString(mergedConfig.tsconfig)) {\n mergedConfig.tsconfig = replacePath(\n replacePathTokens(this, mergedConfig.tsconfig),\n mergedConfig.cwd\n );\n } else {\n mergedConfig.tsconfig = getTsconfigFilePath(\n mergedConfig.cwd,\n mergedConfig.root\n );\n }\n\n // #region Configure output\n\n mergedConfig.output.format = getUnique(\n toArray(\n mergedConfig.output?.format ??\n (mergedConfig.projectType === \"library\" ? [\"cjs\", \"esm\"] : [\"esm\"])\n )\n );\n\n if (isSetString(mergedConfig.output.path)) {\n mergedConfig.output.path = appendPath(\n replacePathTokens(this, mergedConfig.output.path),\n mergedConfig.cwd\n );\n } else {\n mergedConfig.output.path = appendPath(\n joinPaths(mergedConfig.root, \"dist\"),\n mergedConfig.cwd\n );\n }\n\n mergedConfig.output.copy ??= {} as ResolvedCopyConfig;\n if (mergedConfig.output.copy !== false) {\n if (!mergedConfig.root.replace(/^\\.\\/?/, \"\")) {\n mergedConfig.output.copy.path = isSetString(\n mergedConfig.output.copy.path\n )\n ? appendPath(\n replacePathTokens(this, mergedConfig.output.copy.path),\n mergedConfig.cwd\n )\n : mergedConfig.output.path;\n } else {\n mergedConfig.output.copy.path = appendPath(\n replacePathTokens(\n this,\n isSetString(mergedConfig.output.copy.path)\n ? mergedConfig.output.copy.path\n : joinPaths(\"dist\", mergedConfig.root)\n ),\n mergedConfig.cwd\n );\n }\n }\n\n if (mergedConfig.output.types !== false) {\n mergedConfig.output.types = appendPath(\n replacePathTokens(\n this,\n mergedConfig.output.types ||\n joinPaths(\n mergedConfig.root,\n `${mergedConfig.framework?.name ?? \"powerlines\"}.d.ts`\n )\n ),\n mergedConfig.cwd\n );\n }\n\n if (\n mergedConfig.output.copy &&\n mergedConfig.output.copy.path &&\n mergedConfig.output.copy.assets &&\n Array.isArray(mergedConfig.output.copy.assets)\n ) {\n mergedConfig.output.copy.assets = getUniqueBy(\n mergedConfig.output.copy.assets.map(asset => {\n return {\n glob: isSetObject(asset) ? asset.glob : asset,\n input:\n isString(asset) ||\n !asset.input ||\n asset.input === \".\" ||\n asset.input === \"/\" ||\n asset.input === \"./\"\n ? mergedConfig.cwd\n : isParentPath(asset.input, mergedConfig.cwd) ||\n isEqual(asset.input, mergedConfig.cwd)\n ? asset.input\n : appendPath(asset.input, mergedConfig.cwd),\n output:\n isSetObject(asset) && isSetString(asset.output)\n ? isParentPath(asset.output, mergedConfig.cwd)\n ? asset.output\n : appendPath(\n joinPaths(\n (mergedConfig.output.copy as CopyConfig).path,\n replacePath(\n replacePath(\n asset.output,\n replacePath(\n (mergedConfig.output.copy as CopyConfig).path,\n mergedConfig.cwd\n )\n ),\n (mergedConfig.output.copy as CopyConfig).path\n )\n ),\n mergedConfig.cwd\n )\n : appendPath(\n (mergedConfig.output.copy as CopyConfig).path,\n mergedConfig.cwd\n ),\n ignore:\n isSetObject(asset) && asset.ignore\n ? toArray(asset.ignore)\n : undefined\n };\n }),\n (a: ResolvedAssetGlob) => `${a.input}-${a.glob}-${a.output}`\n );\n }\n\n if (isUndefined(mergedConfig.output?.sourceMap)) {\n if (mergedConfig.mode === \"development\") {\n mergedConfig.output.sourceMap = true;\n } else {\n mergedConfig.output.sourceMap = false;\n }\n }\n\n if (isUndefined(mergedConfig.output?.minify)) {\n if (mergedConfig.mode === \"production\") {\n mergedConfig.output.minify = true;\n } else {\n mergedConfig.output.minify = false;\n }\n }\n\n if (isUndefined(mergedConfig.output?.artifactsPath)) {\n mergedConfig.output.artifactsPath = `.${\n mergedConfig.framework?.name ?? \"powerlines\"\n }`;\n }\n\n if (mergedConfig.output.copy && mergedConfig.output.copy.assets) {\n mergedConfig.output.copy.assets = mergedConfig.output.copy.assets.map(\n asset => ({\n ...asset,\n glob: replacePathTokens(this, asset.glob),\n ignore: asset.ignore\n ? asset.ignore.map(ignore => replacePathTokens(this, ignore))\n : undefined,\n input: replacePathTokens(this, asset.input),\n output: replacePathTokens(this, asset.output)\n })\n );\n }\n\n if (\n (isSetString(mergedConfig.output?.storage) &&\n mergedConfig.output.storage === \"virtual\") ||\n (isSetObject(mergedConfig.output?.storage) &&\n Object.values(mergedConfig.output.storage).every(\n adapter => adapter.preset === \"virtual\"\n ))\n ) {\n mergedConfig.output.overwrite = true;\n }\n\n // #endregion Configure output\n\n this.resolvedConfig = mergedConfig;\n this.#configProxy = this.createConfigProxy();\n\n this.resolver = createResolver({\n cwd: this.resolvedConfig.cwd,\n root: this.resolvedConfig.root,\n cacheDir: this.envPaths.cache,\n mode: this.resolvedConfig.mode\n });\n\n this.logger.info({\n meta: { category: \"config\" },\n message: `Resolved Powerlines configuration object: \\n${formatConfig(\n this.resolvedConfig\n )}`\n });\n\n this.#fs ??= await VirtualFileSystem.create(this);\n this.#checksum = await this.generateChecksum();\n }\n\n private createConfigProxy(): TResolvedConfig {\n return new Proxy(this.resolvedConfig, {\n /**\n * A trap for the `delete` operator.\n * @param target - The original object which is being proxied.\n * @param key - The name or `Symbol` of the property to delete.\n * @returns A `boolean` indicating whether or not the property was deleted.\n */\n deleteProperty: (target: TResolvedConfig, key) => {\n if (UNRESOLVED_CONFIG_NAMES.includes(key.toString())) {\n throw new Error(\n `Cannot delete property ${key.toString()} from config - it is only intended to be used as a reference.`\n );\n }\n\n Reflect.deleteProperty(this.overriddenConfig, key);\n return Reflect.deleteProperty(target, key);\n },\n\n /**\n * A trap for getting a property value.\n * @param target - The original object which is being proxied.\n * @param key - The name or `Symbol` of the property to get.\n * @param receiver - The proxy or an object that inherits from the proxy.\n */\n get: (target: TResolvedConfig, key, receiver) => {\n if (UNRESOLVED_CONFIG_NAMES.includes(key.toString())) {\n if (key === \"cwd\") {\n return this.cwd;\n }\n if (key === \"userConfig\") {\n return this.userConfig;\n }\n if (key === \"inlineConfig\") {\n return this.inlineConfig;\n }\n if (key === \"pluginConfig\") {\n return this.pluginConfig;\n }\n if (key === \"environmentConfig\") {\n return this.environmentConfig;\n }\n }\n\n return Reflect.get(target, key, receiver);\n },\n\n /**\n * A trap for the `in` operator.\n * @param target - The original object which is being proxied.\n * @param key - The name or `Symbol` of the property to check for existence.\n */\n has: (target: TResolvedConfig, key: string | symbol): boolean => {\n return (\n Reflect.has(target, key) ||\n UNRESOLVED_CONFIG_NAMES.includes(key.toString())\n );\n },\n\n /**\n * A trap for `Reflect.ownKeys()`.\n * @param target - The original object which is being proxied.\n */\n ownKeys: (target: TResolvedConfig): ArrayLike<string | symbol> => {\n return getUnique([\n ...Reflect.ownKeys(target),\n ...UNRESOLVED_CONFIG_NAMES\n ]);\n },\n\n /**\n * A trap for setting a property value.\n * @param target - The original object which is being proxied.\n * @param key - The name or `Symbol` of the property to set.\n * @param newValue - The new value to assign to the property.\n * @param receiver - The object to which the assignment was originally directed.\n * @returns A `boolean` indicating whether or not the property was set.\n */\n set: (\n target: TResolvedConfig,\n key: string | symbol,\n newValue: any,\n receiver: any\n ): boolean => {\n if (UNRESOLVED_CONFIG_NAMES.includes(key.toString())) {\n throw new Error(\n `Cannot change property ${key.toString()} from config - it is only intended to be used as a reference.`\n );\n }\n\n Reflect.set(this.overriddenConfig, key, newValue, receiver);\n return Reflect.set(target, key, newValue, receiver);\n }\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6IA,oBACE,IAFgB,MAAM,EAAE,kBAAkB,IAAM,CAE5C,EAAE,QACJ,aAAa,MAAM;CACjB,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,eAAe;CACf,YAAY;AACd,CAAC,CACH,CACF;AAEA,MAAM,0BAA0B;CAC9B;CACA;CACA;CACA;AACF;AAEA,IAAa,oBAAb,cAIU,sBAEV;CA4dwC;CA3dtC,YAA2B;CAE3B,WAAmB,KAAK;CAExB,aAAqB,KAAK;CAE1B;CAEA;CAEA;CAEA;CAEA;CAEA,AAAO;;;;CAKP,AAAO;;;;CAKP,AAAO,cAA+C;;;;CAKtD,AAAO;;;;CAKP,AAAO,eAA+C,CAAC;;;;CAKvD,AAAO,kBAAkD,CAAC;;;;CAK1D,AAAO,gBAAsC;;;;CAK7C,AAAO,kBAA4B,CAAC;;;;CAKpC,AAAU,iBAAkC,CAAC;;;;CAK7C,AAAU,mBACR,CAAC;;;;CAKH,AAAU,eACR,CAAC;;;;CAKH,AAAU,aAA4C,CAAC;;;;CAKvD,AAAU,eAAgD,CAAC;;;;CAK3D,AAAU,oBAAyB,CAAC;;;;CAKpC,IAAc,cAAsB;EAClC,OACE,KAAK,QAAQ,eACb,kBACE,KAAK,OAAO,MACZ,KAAK,OAAO,SACZ,KAAK,QAAQ,WACf;CAEJ;;;;CAKA,IAAW,QAAsC;EAC/C,MAAM,QAAQ,KAAK;EAEnB,OAAO,kBACL,MACA,SAAS,MAAM,SAAS,IACpB,QACA,MAAM,QAAQ,KAAK,OAAO,KAAK,KAC5B,YAAY,KAAK,OAAO,KAAK,KAC5B,CAAC,gBAAgB,KAAK,OAAO,KAAK,I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CAC/C;CAEA,AAAQ,oBAAqC;EAC3C,OAAO,IAAI,MAAM,KAAK,gBAAgB;;;;;;;GAOpC,iBAAiB,QAAyB,QAAQ;IAChD,IAAI,wBAAwB,SAAS,IAAI,SAAS,CAAC,GACjD,MAAM,IAAI,MACR,0BAA0B,IAAI,SAAS,EAAE,8DAC3C;IAGF,QAAQ,eAAe,KAAK,kBAAkB,GAAG;IACjD,OAAO,QAAQ,eAAe,QAAQ,GAAG;GAC3C;;;;;;;GAQA,MAAM,QAAyB,KAAK,aAAa;IAC/C,IAAI,wBAAwB,SAAS,IAAI,SAAS,CAAC,GAAG;KACpD,IAAI,QAAQ,OACV,OAAO,KAAK;KAEd,IAAI,QAAQ,cACV,OAAO,KAAK;KAEd,IAAI,QAAQ,gBACV,OAAO,KAAK;KAEd,IAAI,QAAQ,gBACV,OAAO,KAAK;KAEd,IAAI,QAAQ,qBACV,OAAO,KAAK;IAEhB;IAEA,OAAO,QAAQ,IAAI,QAAQ,KAAK,QAAQ;GAC1C;;;;;;GAOA,MAAM,QAAyB,QAAkC;IAC/D,OACE,QAAQ,IAAI,QAAQ,GAAG,KACvB,wBAAwB,SAAS,IAAI,SAAS,CAAC;GAEnD;;;;;GAMA,UAAU,WAAwD;IAChE,OAAO,UAAU,CACf,GAAG,QAAQ,QAAQ,MAAM,GACzB,GAAG,uBACL,CAAC;GACH;;;;;;;;;GAUA,MACE,QACA,KACA,UACA,aACY;IACZ,IAAI,wBAAwB,SAAS,IAAI,SAAS,CAAC,GACjD,MAAM,IAAI,MACR,0BAA0B,IAAI,SAAS,EAAE,8DAC3C;IAGF,QAAQ,IAAI,KAAK,kBAAkB,KAAK,UAAU,QAAQ;IAC1D,OAAO,QAAQ,IAAI,QAAQ,KAAK,UAAU,QAAQ;GACpD;EACF,CAAC;CACH;AACF"}
|
|
1
|
+
{"version":3,"file":"context.mjs","names":["#tsconfig","#fs","#checksum","#buildId","#releaseId","#configProxy","#parserCache","#requestCache"],"sources":["../../src/context/context.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 { toArray } from \"@stryke/convert/to-array\";\nimport { EnvPaths, getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { relativeToWorkspaceRoot } from \"@stryke/fs/get-workspace-root\";\nimport { murmurhash } from \"@stryke/hash\";\nimport { hashDirectory } from \"@stryke/hash/node\";\nimport { getUnique, getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { appendPath } from \"@stryke/path/append\";\nimport {\n findFileDotExtensionSafe,\n findFileExtensionSafe\n} from \"@stryke/path/file-path-fns\";\nimport { isEqual } from \"@stryke/path/is-equal\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { FileReference } from \"@stryke/types/configuration\";\nimport { PackageJson } from \"@stryke/types/package-json\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport { match, tsconfigPathsToRegExp } from \"bundle-require\";\nimport { resolveCompatibilityDates } from \"compatx\";\nimport defu from \"defu\";\nimport { create, FlatCache } from \"flat-cache\";\nimport { existsSync } from \"node:fs\";\nimport { parse, ParseResult } from \"oxc-parser\";\nimport { Range } from \"semver\";\nimport {\n Agent,\n BodyInit,\n fetch,\n interceptors,\n RequestInfo,\n Response,\n setGlobalDispatcher,\n RequestInit as UndiciRequestInit\n} from \"undici\";\nimport { UnpluginBuildContext } from \"unplugin\";\nimport {\n CACHE_HASH_LENGTH,\n DEFAULT_DEVELOPMENT_LOG_LEVEL,\n DEFAULT_PRODUCTION_LOG_LEVEL,\n DEFAULT_TEST_LOG_LEVEL,\n ROOT_HASH_LENGTH\n} from \"../constants\";\nimport {\n getDefaultMode,\n loadParsedConfig,\n resolvePackageConfigs\n} from \"../lib/config\";\nimport { getConfigProps } from \"../lib/context-helpers\";\nimport {\n getUniqueInputs,\n isFileReference,\n resolveInputsSync\n} from \"../lib/entry\";\nimport { callHook } from \"../lib/hooks\";\nimport { getPrefixedRootHash } from \"../lib/meta\";\nimport { createResolver } from \"../lib/resolver\";\nimport { getTsconfigFilePath } from \"../lib/typescript/tsconfig\";\nimport { VirtualFileSystem } from \"../lib/vfs\";\nimport {\n formatExecutionId,\n getOrganizationName,\n getPackageJsonOrganization,\n getWorkspaceName\n} from \"../plugin-utils/context-helpers\";\nimport { formatConfig } from \"../plugin-utils/format\";\nimport { isDuplicate, isPlugin } from \"../plugin-utils/helpers\";\nimport { createLogger, resolveLogLevel } from \"../plugin-utils/logging\";\nimport { mergeConfig } from \"../plugin-utils/merge\";\nimport { replacePathTokens } from \"../plugin-utils/paths\";\nimport {\n CopyConfig,\n ExecutionOptions,\n FrameworkOptions,\n InferOverridableConfig,\n ParsedUserConfig,\n PluginConfig,\n ResolvedAssetGlob,\n ResolvedConfig,\n ResolvedCopyConfig,\n ResolvedEntryFileReference,\n ResolvedOutputConfig\n} from \"../types/config\";\nimport {\n Context,\n EmitEntryOptions,\n EmitOptions,\n EnvironmentContext,\n ExecutionContext,\n FetchOptions,\n MetaInfo,\n ParseOptions,\n PluginContext,\n Resolver,\n ResolveResult,\n TransformResult\n} from \"../types/context\";\nimport {\n ResolveOptions,\n VirtualFile,\n VirtualFileSystemInterface\n} from \"../types/fs\";\nimport {\n CallHookOptions,\n InferHookParameters,\n InferHookReturnType\n} from \"../types/hooks\";\nimport {\n Logger,\n LoggerOptions,\n LogLevelResolvedConfig\n} from \"../types/logging\";\nimport { ParsedTypeScriptConfig } from \"../types/tsconfig\";\nimport { PowerlinesBaseContext } from \"./base-context\";\n\nconst agent = new Agent({ keepAliveTimeout: 10000 });\nsetGlobalDispatcher(\n agent.compose(\n interceptors.retry({\n maxRetries: 3,\n minTimeout: 1000,\n maxTimeout: 10000,\n timeoutFactor: 2,\n retryAfter: true\n })\n )\n);\n\nconst UNRESOLVED_CONFIG_NAMES = [\n \"userConfig\",\n \"inlineConfig\",\n \"pluginConfig\",\n \"environmentConfig\"\n];\n\nexport class PowerlinesContext<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TSystemContext = unknown\n>\n extends PowerlinesBaseContext<TSystemContext>\n implements Context<TResolvedConfig, TSystemContext>\n{\n #checksum: string | null = null;\n\n #buildId: string = uuid();\n\n #releaseId: string = uuid();\n\n #fs!: VirtualFileSystemInterface;\n\n #tsconfig!: ParsedTypeScriptConfig;\n\n #parserCache!: FlatCache;\n\n #requestCache!: FlatCache;\n\n #configProxy!: TResolvedConfig;\n\n public resolver!: Resolver;\n\n /**\n * The parsed `package.json` file for the project\n */\n public packageJson!: PackageJson;\n\n /**\n * The parsed `project.json` file for the project\n */\n public projectJson: Record<string, any> | undefined = undefined;\n\n /**\n * The parsed configuration file for the project\n */\n public configFile!: ParsedUserConfig;\n\n /**\n * An object containing the dependencies that should be installed for the project\n */\n public dependencies: Record<string, string | Range> = {};\n\n /**\n * An object containing the development dependencies that should be installed for the project\n */\n public devDependencies: Record<string, string | Range> = {};\n\n /**\n * The persisted meta information about the current build\n */\n public persistedMeta: MetaInfo | undefined = undefined;\n\n /**\n * The resolved tsconfig file paths for the project\n */\n public resolvePatterns: RegExp[] = [];\n\n /**\n * The resolved configuration for this context\n */\n protected resolvedConfig: TResolvedConfig = {} as TResolvedConfig;\n\n /**\n * The configuration options that were overridden by plugins during the build process, which may include additional properties or modifications made during the configuration loading process.\n */\n protected overriddenConfig: InferOverridableConfig<TResolvedConfig> =\n {} as InferOverridableConfig<TResolvedConfig>;\n\n /**\n * The configuration options provided inline during execution, such as CLI flags or other parameters that may be relevant to the command being executed. These options can be used to override or supplement the configuration options defined in a configuration file on disk, and are typically provided as part of the execution context when running a Powerlines command.\n */\n protected inlineConfig: TResolvedConfig[\"inlineConfig\"] =\n {} as TResolvedConfig[\"inlineConfig\"];\n\n /**\n * 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.\n */\n protected userConfig: TResolvedConfig[\"userConfig\"] = {};\n\n /**\n * The configuration options provided by plugins added by the user (and other plugins)\n */\n protected pluginConfig: TResolvedConfig[\"pluginConfig\"] = {};\n\n /**\n * The configuration options provided by the environment\n */\n protected environmentConfig: any = {};\n\n /**\n * A unique identifier for the current execution, which can be used for logging and other purposes to distinguish between different executions in the same process.\n */\n protected get executionId(): string {\n return (\n this.options.executionId ||\n formatExecutionId(\n this.config.name,\n this.config.command,\n this.options.configIndex\n )\n );\n }\n\n /**\n * The resolved entry type definitions for the project\n */\n public get entry(): ResolvedEntryFileReference[] {\n const entry = this.resolvedEntry;\n\n return resolveInputsSync(\n this,\n entry && entry.length > 0\n ? entry\n : Array.isArray(this.config.input) ||\n (isSetObject(this.config.input) &&\n !isFileReference(this.config.input))\n ? this.config.input\n : toArray(this.config.input).flat()\n );\n }\n\n /**\n * The TypeScript configuration parsed from the tsconfig file\n */\n public get tsconfig(): ParsedTypeScriptConfig {\n if (!this.#tsconfig) {\n this.tsconfig = {\n tsconfigFilePath: this.config.tsconfig\n } as ParsedTypeScriptConfig;\n }\n\n return this.#tsconfig;\n }\n\n /**\n * Sets the TypeScript configuration parsed from the tsconfig file\n */\n public set tsconfig(value: ParsedTypeScriptConfig) {\n this.#tsconfig = value;\n this.resolvePatterns = tsconfigPathsToRegExp(value?.options?.paths ?? {});\n }\n\n /**\n * The virtual file system interface for the project\n */\n public get fs(): VirtualFileSystemInterface {\n if (!this.#fs) {\n this.#fs = VirtualFileSystem.createSync(this);\n }\n\n return this.#fs;\n }\n\n /**\n * Get the checksum of the project's current state\n */\n public get checksum(): string | null {\n return this.#checksum;\n }\n\n /**\n * Invokes the configured plugin hooks\n *\n * @remarks\n * By default, it will call the `\"pre\"`, `\"normal\"`, and `\"post\"` ordered hooks in sequence\n *\n * @param hook - The hook to call\n * @param options - The options to provide to the hook\n * @param args - The arguments to pass to the hook\n * @returns The result of the hook call\n */\n public callHook = async <TKey extends string>(\n hook: TKey,\n options: CallHookOptions & {\n environment?: string | EnvironmentContext<any>;\n },\n ...args: InferHookParameters<PluginContext<any>, TKey>\n ): Promise<InferHookReturnType<PluginContext<any>, TKey> | undefined> =>\n callHook<TKey, TResolvedConfig>(\n this as unknown as ExecutionContext<TResolvedConfig>,\n hook,\n options,\n ...args\n );\n\n /**\n * The meta information about the current build\n */\n public get meta() {\n return {\n executionId: this.executionId,\n buildId: this.#buildId,\n releaseId: this.#releaseId,\n checksum: this.#checksum,\n timestamp: this.timestamp,\n rootHash: murmurhash(\n {\n workspaceRoot: this.config?.cwd,\n root: this.config?.root\n },\n {\n maxLength: ROOT_HASH_LENGTH\n }\n ),\n configHash: murmurhash(this.config, {\n maxLength: CACHE_HASH_LENGTH\n })\n } as MetaInfo;\n }\n\n /**\n * The resolved configuration options\n */\n public get config(): TResolvedConfig {\n if (!this.#configProxy) {\n this.#configProxy = this.createConfigProxy();\n }\n\n return this.#configProxy;\n }\n\n /**\n * Get the path to the artifacts directory for the project\n */\n public get artifactsPath(): string {\n return joinPaths(\n this.config.cwd,\n this.config.root,\n this.config.output?.artifactsPath ||\n `.${this.config.framework?.name || \"powerlines\"}`\n );\n }\n\n /**\n * Get the path to the builtin modules used by the project\n */\n public get builtinsPath(): string {\n return joinPaths(this.artifactsPath, \"builtins\");\n }\n\n /**\n * Get the path to the entry directory for the project\n */\n public get entryPath(): string {\n return joinPaths(this.artifactsPath, \"entry\");\n }\n\n /**\n * Get the path to the infrastructure modules used by the project\n */\n public get infrastructurePath(): string {\n return joinPaths(this.artifactsPath, \"infrastructure\");\n }\n\n /**\n * Get the path to the data directory for the project\n */\n public get dataPath(): string {\n return joinPaths(\n this.envPaths.data,\n \"projects\",\n getPrefixedRootHash(this.config.name, this.meta.rootHash)\n );\n }\n\n /**\n * Get the path to the cache directory for the project\n */\n public get cachePath(): string {\n return joinPaths(\n this.envPaths.cache,\n \"projects\",\n murmurhash(\n {\n checksum: this.#checksum,\n config: this.meta.configHash\n },\n {\n maxLength: CACHE_HASH_LENGTH\n }\n )\n );\n }\n\n /**\n * Get the path to the generated declaration file for the project\n */\n public get typesPath(): string {\n return this.config.output.types\n ? appendPath(this.config.output.types, this.config.cwd)\n : joinPaths(this.config.cwd, this.config.root, \"powerlines.d.ts\");\n }\n\n /**\n * Get the project root relative to the workspace root\n */\n public get relativeToWorkspaceRoot() {\n return relativeToWorkspaceRoot(this.config.root);\n }\n\n /**\n * The builtin module id that exist in the Powerlines virtual file system\n */\n public get builtins(): string[] {\n return Object.values(this.fs.metadata)\n .filter(meta => meta && meta.type === \"builtin\")\n .map(meta => meta?.id)\n .filter(Boolean);\n }\n\n /**\n * Additional arguments provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed.\n */\n public get additionalArgs(): Record<string, string | string[]> {\n return Object.entries(this.config.inlineConfig.additionalArgs ?? {}).reduce(\n (ret, [key, value]) => {\n const formattedKey = key.replace(/^--?/, \"\");\n\n if (ret[formattedKey]) {\n if (Array.isArray(ret[formattedKey])) {\n if (Array.isArray(value)) {\n ret[formattedKey] = [...toArray(ret[formattedKey]), ...value];\n } else {\n ret[formattedKey] = [...toArray(ret[formattedKey]), value];\n }\n } else {\n ret[formattedKey] = [\n ret[formattedKey],\n ...(Array.isArray(value) ? value : [value])\n ];\n }\n } else {\n ret[formattedKey] = value;\n }\n return ret;\n },\n {} as Record<string, string | string[]>\n );\n }\n\n /**\n * The alias mappings for the project used during module resolution\n *\n * @remarks\n * This includes both the built-in module aliases as well as any custom aliases defined in the build configuration.\n */\n public get alias(): Record<string, string> {\n return this.builtins.reduce(\n (ret, id) => {\n const moduleId = `${\n this.config?.framework?.name || \"powerlines\"\n }:${id.replace(/^.*:/, \"\")}`;\n if (!ret[moduleId]) {\n const path = this.fs.paths[id];\n if (path) {\n ret[moduleId] = path;\n }\n }\n\n return ret;\n },\n this.config.resolve.alias\n ? Array.isArray(this.config.resolve.alias)\n ? this.config.resolve.alias.reduce(\n (ret, alias) => {\n if (!ret[alias.find.toString()]) {\n ret[alias.find.toString()] = alias.replacement;\n }\n\n return ret;\n },\n {} as Record<string, string>\n )\n : this.config.resolve.alias\n : {}\n );\n }\n\n public override get logger(): Logger {\n return this.createLogger();\n }\n\n /**\n * The log level for the context, which determines the minimum level of log messages that will be emitted by the logger. This is resolved based on the configuration options provided by the user, and can be set to different levels for development, production, and test environments. The log level can also be overridden by plugins or other parts of the build process to provide more granular control over logging output.\n */\n public get logLevel(): LogLevelResolvedConfig {\n return resolveLogLevel(this.config.logLevel, this.config.mode);\n }\n\n /**\n * The environment paths for the project, which provide the locations of various directories and files used by the Powerlines framework. These paths are resolved based on the organization ID, application ID, and workspace root directory, and can be used to access configuration files, cache directories, and other resources in a consistent manner.\n */\n public override get envPaths(): EnvPaths {\n return getEnvPaths({\n orgId: kebabCase(this.config.framework?.orgId || \"storm-software\"),\n appId: kebabCase(this.config.framework?.name || \"powerlines\"),\n workspaceRoot: this.config.cwd\n });\n }\n\n /**\n * Gets the parser cache.\n */\n protected get parserCache(): FlatCache {\n if (!this.#parserCache) {\n this.#parserCache = create({\n cacheId: \"parser\",\n cacheDir: this.cachePath,\n ttl: 2 * 60 * 60 * 1000,\n lruSize: 5000,\n persistInterval: 250\n });\n }\n\n return this.#parserCache;\n }\n\n /**\n * Gets the request cache.\n */\n protected get requestCache(): FlatCache {\n if (!this.#requestCache) {\n this.#requestCache = create({\n cacheId: \"http\",\n cacheDir: this.cachePath,\n ttl: 6 * 60 * 60 * 1000,\n lruSize: 5000,\n persistInterval: 250\n });\n }\n\n return this.#requestCache;\n }\n\n /**\n * The entry points that exist in the Powerlines virtual file system\n */\n protected get resolvedEntry(): ResolvedEntryFileReference[] {\n return Object.entries(this.fs.metadata)\n .filter(([, meta]) => meta && meta.type === \"entry\")\n .map(([path, meta]) => {\n const fileReference = {\n file: path\n } as ResolvedEntryFileReference;\n\n if (meta.properties) {\n if (isSetString(meta.properties.file)) {\n fileReference.file = meta.properties.file;\n }\n if (isSetString(meta.properties.export)) {\n fileReference.export = meta.properties.export;\n }\n if (\n isSetString(meta.properties[\"input.file\"]) ||\n isSetString(meta.properties[\"input.export\"])\n ) {\n fileReference.input ??= {} as FileReference;\n if (isSetString(meta.properties[\"input.file\"])) {\n fileReference.input.file = meta.properties[\"input.file\"];\n }\n if (isSetString(meta.properties[\"input.export\"])) {\n fileReference.input.export = meta.properties[\"input.export\"];\n }\n }\n if (isSetString(meta.properties.output)) {\n fileReference.output = meta.properties.output;\n }\n }\n\n return fileReference;\n })\n .filter(Boolean);\n }\n\n /**\n * Creates a new Context instance.\n *\n * @param options - The options to use for creating the context, including the resolved configuration and workspace settings.\n */\n protected constructor(public override options: ExecutionOptions) {\n super(options);\n }\n\n public override createLogger(options: LoggerOptions = {}) {\n return createLogger(\n this.config.name || this.options.root,\n {\n logLevel: this.logLevel,\n ...options\n },\n this.options.logFn\n );\n }\n\n /**\n * A function to perform HTTP fetch requests\n *\n * @remarks\n * This function uses a caching layer to avoid duplicate requests during the Powerlines process.\n *\n * @example\n * ```ts\n * const response = await context.fetch(\"https://api.example.com/data\");\n * const data = await response.json();\n * ```\n *\n * @see https://github.com/nodejs/undici\n *\n * @param input - The URL to fetch.\n * @param options - The fetch request options.\n * @returns A promise that resolves to a response returned by the fetch.\n */\n public async fetch(\n input: RequestInfo,\n options: FetchOptions = {}\n ): Promise<Response> {\n const { skipCache, timeout = 30000, signal, ...fetchOptions } = options;\n const url =\n typeof input === \"string\"\n ? input\n : \"url\" in input\n ? input.url\n : input.toString();\n\n const cacheKey = murmurhash({\n input: url,\n options: JSON.stringify({\n ...fetchOptions,\n timeout\n })\n });\n\n if (!this.config.skipCache && !skipCache) {\n const cached = this.requestCache.get<\n {\n body: BodyInit;\n } & Pick<Response, \"status\" | \"statusText\" | \"headers\">\n >(cacheKey);\n if (cached) {\n return new Response(cached.body, {\n status: cached.status,\n statusText: cached.statusText,\n headers: cached.headers\n });\n }\n }\n\n const logger = this.extendLogger({ category: \"communication\" });\n const startTime = Date.now();\n\n logger.trace(\n `Sending fetch request (${\n fetchOptions.method?.toUpperCase() || \"GET\"\n }): ${url}`\n );\n\n const requestController = new AbortController();\n const timeoutMs =\n typeof timeout === \"number\" && Number.isFinite(timeout) ? timeout : 30000;\n const timeoutId =\n timeoutMs > 0\n ? setTimeout(() => {\n requestController.abort(\n new Error(`Fetch request timed out after ${timeoutMs}ms`)\n );\n }, timeoutMs)\n : undefined;\n\n const onAbort = () => {\n requestController.abort(signal?.reason);\n };\n\n if (signal) {\n if (signal.aborted) {\n onAbort();\n } else {\n signal.addEventListener(\"abort\", onAbort, { once: true });\n }\n }\n\n let response: Response;\n try {\n response = await fetch(input, {\n ...(fetchOptions as UndiciRequestInit),\n signal: requestController.signal\n });\n } finally {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (signal) {\n signal.removeEventListener(\"abort\", onAbort);\n }\n }\n\n const result = {\n body: await response.text(),\n status: response.status,\n statusText: response.statusText,\n headers: Object.fromEntries(response.headers.entries())\n };\n\n if (!this.config.skipCache && !skipCache) {\n try {\n this.requestCache.set(cacheKey, result);\n } catch {\n // Do nothing\n }\n }\n\n logger.trace(\n `Fetch request (${\n fetchOptions.method?.toUpperCase() || \"GET\"\n }) completed in ${Date.now() - startTime}ms: ${url} - ${\n response.status\n } / ${response.statusText} \\n - Response Headers: ${JSON.stringify(\n result.headers\n )}\\n - Response Body: ${\n typeof result.body === \"string\"\n ? result.body.length > 1000\n ? `${result.body.slice(0, 1000)}... (truncated, total length: ${\n result.body.length\n })`\n : result.body\n : \"[Non-string body]\"\n }`\n );\n\n return new Response(result.body, {\n status: result.status,\n statusText: result.statusText,\n headers: result.headers\n });\n }\n\n /**\n * Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.\n *\n * @remarks\n * This function can be used to parse TypeScript code into an AST for further analysis or transformation.\n *\n * @example\n * ```ts\n * const ast = context.parse(\"const x: number = 42;\");\n * ```\n *\n * @see https://rollupjs.org/plugin-development/#this-parse\n * @see https://github.com/oxc/oxc\n *\n * @param code - The source code to parse.\n * @param options - The options to pass to the parser.\n * @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.\n */\n public async parse(code: string, options: ParseOptions = {}) {\n const cacheKey = murmurhash({\n code,\n options\n });\n\n let result!: ParseResult;\n if (!this.config.skipCache) {\n result = this.parserCache.get<ParseResult>(cacheKey);\n if (result) {\n return result;\n }\n }\n\n result = await parse(`source.${options.lang || \"ts\"}`, code, {\n ...options,\n sourceType: \"module\",\n showSemanticErrors: this.config.mode === \"development\"\n });\n\n if (!this.config.skipCache) {\n this.parserCache.set(cacheKey, result);\n }\n\n return result;\n }\n\n /**\n * A helper function to resolve modules in the Virtual File System\n *\n * @remarks\n * This function can be used to resolve modules relative to the project root directory.\n *\n * @example\n * ```ts\n * const resolved = await context.resolve(\"some-module\", \"/path/to/importer\");\n * ```\n *\n * @param id - The module to resolve.\n * @param importer - An optional path to the importer module.\n * @param options - Additional resolution options.\n * @returns A promise that resolves to the resolved module path.\n */\n public async resolve(\n id: string,\n importer?: string,\n options: ResolveOptions = {}\n ): Promise<ResolveResult | undefined> {\n let moduleId = id;\n if (this.config.resolve.alias) {\n if (Array.isArray(this.config.resolve.alias)) {\n const alias = this.config.resolve.alias.find(a =>\n match(moduleId, [a.find])\n );\n if (alias) {\n moduleId = alias.replacement;\n }\n } else if (\n isSetObject(this.config.resolve.alias) &&\n this.config.resolve.alias[id]\n ) {\n moduleId = this.config.resolve.alias[id];\n }\n }\n\n if (\n this.fs.isResolvableId(moduleId) ||\n (importer && this.fs.isResolvableId(importer))\n ) {\n let resolvedImporter = importer;\n if (importer && this.fs.isResolvableId(importer)) {\n resolvedImporter = await this.fs.resolve(\n importer,\n undefined,\n defu(\n {\n conditions: this.config.resolve.conditions,\n extensions: this.config.resolve.extensions\n },\n options\n )\n );\n }\n\n const result = await this.fs.resolve(\n moduleId,\n resolvedImporter,\n defu(\n {\n conditions: this.config.resolve.conditions,\n extensions: this.config.resolve.extensions\n },\n options\n )\n );\n if (!result) {\n return undefined;\n }\n\n const external = Boolean(\n !match(moduleId, this.config.resolve.noExternal) &&\n (match(moduleId, this.config.resolve.external) ||\n moduleId.startsWith(\"node:\") ||\n ((!this.fs.isVirtual(moduleId, importer, options) ||\n (this.fs.isVirtual(moduleId, importer, options) &&\n this.config.projectType !== \"application\")) &&\n this.config.resolve.skipNodeModulesBundle &&\n !/^[A-Z]:[/\\\\]|^\\.{0,2}\\/|^\\.{1,2}$/.test(moduleId)))\n );\n\n return {\n id: result,\n external,\n virtual: !external\n };\n }\n\n if (this.config.resolve.skipNodeModulesBundle) {\n if (\n match(moduleId, this.resolvePatterns) ||\n match(moduleId, this.config.resolve.noExternal)\n ) {\n return undefined;\n }\n\n if (\n match(moduleId, this.config.resolve.external) ||\n moduleId.startsWith(\"node:\")\n ) {\n return { id: moduleId, external: true, virtual: false };\n }\n\n // Exclude any other import that looks like a Node module\n if (!/^[A-Z]:[/\\\\]|^\\.{0,2}\\/|^\\.{1,2}$/.test(moduleId)) {\n return {\n id: moduleId,\n external: true,\n virtual: false\n };\n }\n } else {\n if (match(moduleId, this.config.resolve.noExternal)) {\n return undefined;\n }\n\n if (\n match(moduleId, this.config.resolve.external) ||\n moduleId.startsWith(\"node:\")\n ) {\n return { id: moduleId, external: true, virtual: false };\n }\n }\n\n return undefined;\n }\n\n /**\n * A helper function to load modules from the Virtual File System\n *\n * @remarks\n * This function can be used to load modules relative to the project root directory.\n *\n * @example\n * ```ts\n * const module = await context.load(\"some-module\", \"/path/to/importer\");\n * ```\n *\n * @param id - The module to load.\n * @returns A promise that resolves to the loaded module.\n */\n public async load(id: string): Promise<TransformResult | undefined> {\n const resolvedId = await this.fs.resolve(id);\n if (!resolvedId) {\n return undefined;\n }\n\n const code = await this.fs.read(resolvedId);\n if (!code) {\n return undefined;\n }\n\n return { code, map: null };\n }\n\n /**\n * Get the builtin virtual files that exist in the Powerlines virtual file system\n */\n public async getBuiltins() {\n return Promise.all(\n Object.entries(this.fs.metadata)\n .filter(([, meta]) => meta && meta.type === \"builtin\")\n .map(async ([id, meta]) => {\n const code = await this.fs.read(id);\n const path = this.fs.paths[id];\n\n return { ...meta, path, code } as VirtualFile;\n })\n );\n }\n\n /**\n * Resolves a file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the file\n * @param path - The path to write the file to\n * @param options - Additional options for writing the file\n */\n public async emit(\n code: string,\n path: string,\n options: EmitOptions = {}\n ): Promise<void> {\n const filePath = options.extension\n ? findFileExtensionSafe(path)\n ? options.extension.startsWith(\".\")\n ? path.replace(findFileDotExtensionSafe(path), options.extension)\n : path.replace(findFileExtensionSafe(path), options.extension)\n : options.extension.startsWith(\".\")\n ? `${path}${options.extension}`\n : `${path}.${options.extension}`\n : findFileExtensionSafe(path)\n ? path\n : `${path}.ts`;\n\n if (\n isFunction((this as unknown as UnpluginBuildContext).emitFile) &&\n options.emitWithBundler\n ) {\n return (this as unknown as UnpluginBuildContext).emitFile({\n needsCodeReference: options.needsCodeReference,\n originalFileName: options.originalFileName,\n fileName: filePath,\n source: code,\n type: \"asset\"\n });\n }\n\n return this.fs.write(filePath, code, options);\n }\n\n /**\n * Synchronously resolves a file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the file\n * @param path - The path to write the file to\n * @param options - Additional options for writing the file\n */\n public emitSync(code: string, path: string, options: EmitOptions = {}) {\n const filePath = options.extension\n ? findFileExtensionSafe(path)\n ? options.extension.startsWith(\".\")\n ? path.replace(findFileDotExtensionSafe(path), options.extension)\n : path.replace(findFileExtensionSafe(path), options.extension)\n : options.extension.startsWith(\".\")\n ? `${path}${options.extension}`\n : `${path}.${options.extension}`\n : findFileExtensionSafe(path)\n ? path\n : `${path}.ts`;\n\n if (\n isFunction((this as unknown as UnpluginBuildContext).emitFile) &&\n options.emitWithBundler\n ) {\n return (this as unknown as UnpluginBuildContext).emitFile({\n needsCodeReference: options.needsCodeReference,\n originalFileName: options.originalFileName,\n fileName: filePath,\n source: code,\n type: \"asset\"\n });\n }\n\n return this.fs.writeSync(filePath, code, options);\n }\n\n /**\n * Resolves a entry virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the entry file\n * @param path - A path to write the entry file to\n * @param options - Optional write file options\n */\n public async emitEntry(\n code: string,\n path: string,\n options: EmitEntryOptions = {}\n ): Promise<void> {\n return this.emit(\n code,\n appendPath(path, this.entryPath),\n defu(\n {\n meta: {\n type: \"entry\",\n properties: {\n file: appendPath(path, this.entryPath),\n export: options?.export,\n output: options?.output,\n \"input.file\": options?.input?.file,\n \"input.export\": options?.input?.export\n }\n }\n },\n omit(options, [\"export\"])\n )\n );\n }\n\n /**\n * Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the entry file\n * @param path - A path to write the entry file to\n * @param options - Optional write file options\n */\n public emitEntrySync(\n code: string,\n path: string,\n options: EmitEntryOptions = {}\n ): void {\n return this.emitSync(\n code,\n appendPath(path, this.entryPath),\n defu(\n {\n meta: {\n type: \"entry\",\n properties: {\n file: appendPath(path, this.entryPath),\n export: options?.export,\n output: options?.output,\n \"input.file\": options?.input?.file,\n \"input.export\": options?.input?.export\n }\n }\n },\n omit(options, [\"export\"])\n )\n );\n }\n\n /**\n * Resolves a builtin virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the builtin file\n * @param id - The unique identifier of the builtin file\n * @param options - Optional write file options\n */\n public async emitBuiltin(\n code: string,\n id: string,\n options: EmitOptions = {}\n ): Promise<void> {\n if (!this.builtinsPath) {\n throw new Error(\n `The builtins path is not set. Cannot emit builtin file with id \"${id}\".`\n );\n }\n\n if (!isSetString(id)) {\n throw new Error(\n `The builtin id must be a non-empty string. Received: ${String(id)}`\n );\n }\n\n return this.emit(\n code,\n appendPath(id, this.builtinsPath),\n defu(options, { meta: { type: \"builtin\", id } })\n );\n }\n\n /**\n * Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the builtin file\n * @param id - The unique identifier of the builtin file\n * @param options - Optional write file options\n */\n public emitBuiltinSync(code: string, id: string, options: EmitOptions = {}) {\n if (!this.builtinsPath) {\n throw new Error(\n `The builtins path is not set. Cannot emit builtin file with id \"${id}\".`\n );\n }\n\n if (!isSetString(id)) {\n throw new Error(\n `The builtin id must be a non-empty string. Received: ${String(id)}`\n );\n }\n\n return this.emitSync(\n code,\n appendPath(id, this.builtinsPath),\n defu(options, { meta: { type: \"builtin\", id } })\n );\n }\n\n /**\n * Resolves a builtin virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the builtin file\n * @param id - The unique identifier of the builtin file\n * @param options - Optional write file options\n */\n public async emitInfrastructure(\n code: string,\n id: string,\n options: EmitOptions = {}\n ): Promise<void> {\n if (!this.infrastructurePath) {\n throw new Error(\n `The infrastructure path is not set. Cannot emit infrastructure file with id \"${id}\".`\n );\n }\n\n if (!isSetString(id)) {\n throw new Error(\n `The infrastructure id must be a non-empty string. Received: ${String(id)}`\n );\n }\n\n return this.emit(\n code,\n appendPath(id, this.infrastructurePath),\n defu(options, { meta: { type: \"infrastructure\", id } })\n );\n }\n\n /**\n * Synchronously resolves an infrastructure virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the infrastructure file\n * @param id - The unique identifier of the infrastructure file\n * @param options - Optional write file options\n */\n public emitInfrastructureSync(\n code: string,\n id: string,\n options: EmitOptions = {}\n ) {\n if (!this.infrastructurePath) {\n throw new Error(\n `The infrastructure path is not set. Cannot emit infrastructure file with id \"${id}\".`\n );\n }\n\n if (!isSetString(id)) {\n throw new Error(\n `The infrastructure id must be a non-empty string. Received: ${String(id)}`\n );\n }\n\n return this.emitSync(\n code,\n appendPath(id, this.infrastructurePath),\n defu(options, { meta: { type: \"infrastructure\", id } })\n );\n }\n\n /**\n * Generates a checksum representing the current context state\n *\n * @param path - The root directory of the project to generate the checksum for\n * @returns A promise that resolves to a string representing the checksum\n */\n public async generateChecksum(path?: string): Promise<string> {\n return hashDirectory(\n path || appendPath(this.options.root, this.options.cwd)\n );\n }\n\n /**\n * A setter function to populate the inline config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the inline configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any inline configuration provided during execution.\n *\n * @param config - The inline configuration values to set.\n * @returns A promise that resolves when the inline configuration values have been set.\n */\n public async setInlineConfig(\n config: TResolvedConfig[\"inlineConfig\"]\n ): Promise<void> {\n this.logger.debug({\n meta: { category: \"config\" },\n message: `Updating inline configuration object: \\n${formatConfig(config)}`\n });\n\n this.inlineConfig = config;\n this.#checksum = await this.generateChecksum();\n\n this.configFile = await loadParsedConfig(\n this.options.cwd,\n this.options.root,\n this.options.framework?.name || \"powerlines\",\n this.options.framework?.orgId || \"storm-software\",\n config\n );\n\n const configIndex = this.options.configIndex ?? 0;\n\n const result =\n this.configFile.config &&\n toArray(this.configFile.config).length > configIndex\n ? toArray(this.configFile.config)[configIndex]!\n : this.configFile.config;\n if (!result) {\n this.logger.warn(\n `No configuration found in ${\n this.options.configFile\n } for execution index ${this.options.configIndex}.`\n );\n } else {\n await this.setUserConfig(\n (isFunction(result)\n ? await Promise.resolve(\n result({\n cwd: this.cwd,\n root: this.options.root,\n mode:\n this.inlineConfig.mode ||\n (await getDefaultMode(this.cwd, this.options.root)),\n command: this.inlineConfig.command\n })\n )\n : result) as TResolvedConfig[\"userConfig\"]\n );\n }\n\n await this.resolveConfig();\n }\n\n /**\n * A setter function to populate the plugin config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the plugin configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any plugin configuration provided during execution.\n *\n * @param config - The plugin configuration values to set.\n * @returns A promise that resolves when the plugin configuration values have been set.\n */\n public async setPluginConfig(\n config: TResolvedConfig[\"pluginConfig\"]\n ): Promise<void> {\n this.logger.debug({\n meta: { category: \"config\" },\n message: `Updating plugin configuration object: \\n${formatConfig(config)}`\n });\n\n this.pluginConfig = config;\n await this.resolveConfig();\n }\n\n /**\n * A function to merge the various configuration objects (initial, user, inline, and plugin) into a single resolved configuration object that can be used throughout the Powerlines process. This function takes into account the different sources of configuration and their respective priorities, ensuring that the final configuration reflects the intended settings for the project. The merged configuration is then returned as a new object that can be accessed through the `config` property of the context.\n *\n * @returns The merged configuration object that combines the initial, user, inline, and plugin configurations.\n */\n protected mergeConfig(): TResolvedConfig {\n return mergeConfig(\n {\n inlineConfig: this.inlineConfig,\n userConfig: this.userConfig,\n pluginConfig: this.pluginConfig,\n environmentConfig: this.environmentConfig\n },\n getConfigProps<TResolvedConfig>(this.overriddenConfig),\n this.options,\n getConfigProps<TResolvedConfig>(this.inlineConfig),\n getConfigProps<TResolvedConfig>(this.userConfig),\n getConfigProps<TResolvedConfig>(this.pluginConfig),\n {\n version: this.packageJson?.version,\n description: this.packageJson?.description,\n environments: {},\n resolve: {}\n }\n ) as TResolvedConfig;\n }\n\n /**\n * A setter function to populate the user config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the user configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any inline configuration provided during execution.\n *\n * @param config - The user configuration values to set.\n * @returns A promise that resolves when the user configuration values have been set.\n */\n protected async setUserConfig(\n config: TResolvedConfig[\"userConfig\"]\n ): Promise<void> {\n this.logger.debug({\n meta: { category: \"config\" },\n message: `Updating user configuration object: \\n${formatConfig(config)}`\n });\n\n this.userConfig = config;\n await this.resolveConfig();\n }\n\n /**\n * Initialize the context with the provided configuration options\n */\n protected async resolveConfig(): Promise<void> {\n const mergedConfig = this.mergeConfig();\n\n this.logger.trace({\n meta: { category: \"config\" },\n message: `Pre-setup Powerlines configuration object: \\n --- Merged Config --- \\n${formatConfig(\n mergedConfig\n )} \\n\\n --- User Config --- \\n${formatConfig(\n this.userConfig\n )} \\n\\n --- Inline Config --- \\n${formatConfig(\n this.inlineConfig\n )} \\n\\n --- Plugin Config --- \\n${formatConfig(\n this.pluginConfig\n )} \\n\\n --- Environment Config --- \\n${formatConfig(\n this.environmentConfig\n )} \\n\\n --- Overridden Config --- \\n${formatConfig(\n this.overriddenConfig\n )}`\n });\n\n mergedConfig.output = defu(mergedConfig.output ?? {}, {\n copy: {\n assets: [\n {\n glob: \"LICENSE\"\n },\n {\n input: mergedConfig.root,\n glob: \"*.md\"\n },\n {\n input: mergedConfig.root,\n glob: \"package.json\"\n }\n ]\n },\n dts: true\n }) as ResolvedOutputConfig;\n\n if (isUndefined(mergedConfig.mode)) {\n mergedConfig.mode = await getDefaultMode(this.cwd, mergedConfig.root);\n }\n\n if (\n isUndefined(mergedConfig.framework) ||\n !isSetString(mergedConfig.framework.name)\n ) {\n mergedConfig.framework ??= {} as FrameworkOptions;\n mergedConfig.framework.name ??=\n (await getWorkspaceName(this)) || \"powerlines\";\n }\n\n if (isUndefined(mergedConfig.platform)) {\n mergedConfig.platform = \"neutral\";\n }\n\n mergedConfig.compatibilityDate = resolveCompatibilityDates(\n mergedConfig.compatibilityDate,\n \"latest\"\n );\n\n if (\n (!this.packageJson &&\n existsSync(\n joinPaths(\n appendPath(mergedConfig.root, mergedConfig.cwd),\n \"package.json\"\n )\n )) ||\n (!this.projectJson &&\n existsSync(\n joinPaths(\n appendPath(mergedConfig.root, mergedConfig.cwd),\n \"project.json\"\n )\n ))\n ) {\n const result = await resolvePackageConfigs(\n mergedConfig.cwd,\n mergedConfig.root\n );\n if (result) {\n if (result.packageJson) {\n this.packageJson = result.packageJson;\n }\n if (result.projectJson) {\n this.projectJson = result.projectJson;\n }\n\n if (this.packageJson) {\n mergedConfig.framework ??= {} as FrameworkOptions;\n mergedConfig.framework.name ??=\n (await getWorkspaceName(this)) || \"powerlines\";\n mergedConfig.framework.orgId ??=\n getPackageJsonOrganization(this.packageJson) || \"storm-software\";\n }\n }\n }\n\n if (isUndefined(mergedConfig.projectType)) {\n mergedConfig.projectType = this.projectJson?.projectType || \"application\";\n }\n\n this.resolvedConfig = mergedConfig;\n this.#configProxy = this.createConfigProxy();\n\n mergedConfig.input = getUniqueInputs(mergedConfig.input);\n\n if (\n mergedConfig.name?.startsWith(\"@\") &&\n mergedConfig.name.split(\"/\").filter(Boolean).length > 1\n ) {\n mergedConfig.name = mergedConfig.name.split(\"/\").filter(Boolean)[1]!;\n }\n\n mergedConfig.title ??= titleCase(mergedConfig.name);\n\n if (mergedConfig.resolve.external) {\n mergedConfig.resolve.external = getUnique(mergedConfig.resolve.external);\n }\n if (mergedConfig.resolve.noExternal) {\n mergedConfig.resolve.noExternal = getUnique(\n mergedConfig.resolve.noExternal\n );\n }\n\n mergedConfig.plugins = (mergedConfig.plugins ?? [])\n .flatMap(plugin => toArray(plugin))\n .filter(Boolean)\n .reduce((ret, plugin) => {\n if (\n isPlugin(plugin) &&\n isDuplicate(\n plugin,\n ret.filter(p => isPlugin(p))\n )\n ) {\n return ret;\n }\n\n ret.push(plugin);\n\n return ret;\n }, [] as PluginConfig[]);\n\n if (isUndefined(mergedConfig.logLevel)) {\n if (mergedConfig.mode === \"development\") {\n mergedConfig.logLevel = DEFAULT_DEVELOPMENT_LOG_LEVEL;\n } else if (mergedConfig.mode === \"test\") {\n mergedConfig.logLevel = DEFAULT_TEST_LOG_LEVEL;\n } else {\n mergedConfig.logLevel = DEFAULT_PRODUCTION_LOG_LEVEL;\n }\n }\n\n mergedConfig.logLevel = resolveLogLevel(mergedConfig.logLevel);\n\n if (isSetString(mergedConfig.tsconfig)) {\n mergedConfig.tsconfig = replacePath(\n replacePathTokens(this, mergedConfig.tsconfig),\n mergedConfig.cwd\n );\n } else {\n mergedConfig.tsconfig = getTsconfigFilePath(\n mergedConfig.cwd,\n mergedConfig.root\n );\n }\n\n mergedConfig.organization ??= await getOrganizationName(this);\n\n // #region Configure output\n\n mergedConfig.output.format = getUnique(\n toArray(\n mergedConfig.output?.format ??\n (mergedConfig.projectType === \"library\" ? [\"cjs\", \"esm\"] : [\"esm\"])\n )\n );\n\n if (isSetString(mergedConfig.output.path)) {\n mergedConfig.output.path = appendPath(\n replacePathTokens(this, mergedConfig.output.path),\n mergedConfig.cwd\n );\n } else {\n mergedConfig.output.path = appendPath(\n joinPaths(mergedConfig.root, \"dist\"),\n mergedConfig.cwd\n );\n }\n\n mergedConfig.output.copy ??= {} as ResolvedCopyConfig;\n if (mergedConfig.output.copy !== false) {\n if (!mergedConfig.root.replace(/^\\.\\/?/, \"\")) {\n mergedConfig.output.copy.path = isSetString(\n mergedConfig.output.copy.path\n )\n ? appendPath(\n replacePathTokens(this, mergedConfig.output.copy.path),\n mergedConfig.cwd\n )\n : mergedConfig.output.path;\n } else {\n mergedConfig.output.copy.path = appendPath(\n replacePathTokens(\n this,\n isSetString(mergedConfig.output.copy.path)\n ? mergedConfig.output.copy.path\n : joinPaths(\"dist\", mergedConfig.root)\n ),\n mergedConfig.cwd\n );\n }\n }\n\n if (mergedConfig.output.types !== false) {\n mergedConfig.output.types = appendPath(\n replacePathTokens(\n this,\n mergedConfig.output.types ||\n joinPaths(\n mergedConfig.root,\n `${mergedConfig.framework?.name ?? \"powerlines\"}.d.ts`\n )\n ),\n mergedConfig.cwd\n );\n }\n\n if (\n mergedConfig.output.copy &&\n mergedConfig.output.copy.path &&\n mergedConfig.output.copy.assets &&\n Array.isArray(mergedConfig.output.copy.assets)\n ) {\n mergedConfig.output.copy.assets = getUniqueBy(\n mergedConfig.output.copy.assets.map(asset => {\n return {\n glob: isSetObject(asset) ? asset.glob : asset,\n input:\n isString(asset) ||\n !asset.input ||\n asset.input === \".\" ||\n asset.input === \"/\" ||\n asset.input === \"./\"\n ? mergedConfig.cwd\n : isParentPath(asset.input, mergedConfig.cwd) ||\n isEqual(asset.input, mergedConfig.cwd)\n ? asset.input\n : appendPath(asset.input, mergedConfig.cwd),\n output:\n isSetObject(asset) && isSetString(asset.output)\n ? isParentPath(asset.output, mergedConfig.cwd)\n ? asset.output\n : appendPath(\n joinPaths(\n (mergedConfig.output.copy as CopyConfig).path,\n replacePath(\n replacePath(\n asset.output,\n replacePath(\n (mergedConfig.output.copy as CopyConfig).path,\n mergedConfig.cwd\n )\n ),\n (mergedConfig.output.copy as CopyConfig).path\n )\n ),\n mergedConfig.cwd\n )\n : appendPath(\n (mergedConfig.output.copy as CopyConfig).path,\n mergedConfig.cwd\n ),\n ignore:\n isSetObject(asset) && asset.ignore\n ? toArray(asset.ignore)\n : undefined\n };\n }),\n (a: ResolvedAssetGlob) => `${a.input}-${a.glob}-${a.output}`\n );\n }\n\n if (isUndefined(mergedConfig.output?.sourceMap)) {\n if (mergedConfig.mode === \"development\") {\n mergedConfig.output.sourceMap = true;\n } else {\n mergedConfig.output.sourceMap = false;\n }\n }\n\n if (isUndefined(mergedConfig.output?.minify)) {\n if (mergedConfig.mode === \"production\") {\n mergedConfig.output.minify = true;\n } else {\n mergedConfig.output.minify = false;\n }\n }\n\n if (isUndefined(mergedConfig.output?.artifactsPath)) {\n mergedConfig.output.artifactsPath = `.${\n mergedConfig.framework?.name ?? \"powerlines\"\n }`;\n }\n\n if (mergedConfig.output.copy && mergedConfig.output.copy.assets) {\n mergedConfig.output.copy.assets = mergedConfig.output.copy.assets.map(\n asset => ({\n ...asset,\n glob: replacePathTokens(this, asset.glob),\n ignore: asset.ignore\n ? asset.ignore.map(ignore => replacePathTokens(this, ignore))\n : undefined,\n input: replacePathTokens(this, asset.input),\n output: replacePathTokens(this, asset.output)\n })\n );\n }\n\n if (\n (isSetString(mergedConfig.output?.storage) &&\n mergedConfig.output.storage === \"virtual\") ||\n (isSetObject(mergedConfig.output?.storage) &&\n Object.values(mergedConfig.output.storage).every(\n adapter => adapter.preset === \"virtual\"\n ))\n ) {\n mergedConfig.output.overwrite = true;\n }\n\n // #endregion Configure output\n\n this.resolvedConfig = mergedConfig;\n this.#configProxy = this.createConfigProxy();\n\n this.resolver = createResolver({\n cwd: this.resolvedConfig.cwd,\n root: this.resolvedConfig.root,\n cacheDir: this.envPaths.cache,\n mode: this.resolvedConfig.mode\n });\n\n this.logger.info({\n meta: { category: \"config\" },\n message: `Resolved Powerlines configuration object: \\n${formatConfig(\n this.resolvedConfig\n )}`\n });\n\n this.#fs ??= await VirtualFileSystem.create(this);\n this.#checksum = await this.generateChecksum();\n }\n\n private createConfigProxy(): TResolvedConfig {\n return new Proxy(this.resolvedConfig, {\n /**\n * A trap for the `delete` operator.\n * @param target - The original object which is being proxied.\n * @param key - The name or `Symbol` of the property to delete.\n * @returns A `boolean` indicating whether or not the property was deleted.\n */\n deleteProperty: (target: TResolvedConfig, key) => {\n if (UNRESOLVED_CONFIG_NAMES.includes(key.toString())) {\n throw new Error(\n `Cannot delete property ${key.toString()} from config - it is only intended to be used as a reference.`\n );\n }\n\n Reflect.deleteProperty(this.overriddenConfig, key);\n return Reflect.deleteProperty(target, key);\n },\n\n /**\n * A trap for getting a property value.\n * @param target - The original object which is being proxied.\n * @param key - The name or `Symbol` of the property to get.\n * @param receiver - The proxy or an object that inherits from the proxy.\n */\n get: (target: TResolvedConfig, key, receiver) => {\n if (UNRESOLVED_CONFIG_NAMES.includes(key.toString())) {\n if (key === \"cwd\") {\n return this.cwd;\n }\n if (key === \"userConfig\") {\n return this.userConfig;\n }\n if (key === \"inlineConfig\") {\n return this.inlineConfig;\n }\n if (key === \"pluginConfig\") {\n return this.pluginConfig;\n }\n if (key === \"environmentConfig\") {\n return this.environmentConfig;\n }\n }\n\n return Reflect.get(target, key, receiver);\n },\n\n /**\n * A trap for the `in` operator.\n * @param target - The original object which is being proxied.\n * @param key - The name or `Symbol` of the property to check for existence.\n */\n has: (target: TResolvedConfig, key: string | symbol): boolean => {\n return (\n Reflect.has(target, key) ||\n UNRESOLVED_CONFIG_NAMES.includes(key.toString())\n );\n },\n\n /**\n * A trap for `Reflect.ownKeys()`.\n * @param target - The original object which is being proxied.\n */\n ownKeys: (target: TResolvedConfig): ArrayLike<string | symbol> => {\n return getUnique([\n ...Reflect.ownKeys(target),\n ...UNRESOLVED_CONFIG_NAMES\n ]);\n },\n\n /**\n * A trap for setting a property value.\n * @param target - The original object which is being proxied.\n * @param key - The name or `Symbol` of the property to set.\n * @param newValue - The new value to assign to the property.\n * @param receiver - The object to which the assignment was originally directed.\n * @returns A `boolean` indicating whether or not the property was set.\n */\n set: (\n target: TResolvedConfig,\n key: string | symbol,\n newValue: any,\n receiver: any\n ): boolean => {\n if (UNRESOLVED_CONFIG_NAMES.includes(key.toString())) {\n throw new Error(\n `Cannot change property ${key.toString()} from config - it is only intended to be used as a reference.`\n );\n }\n\n Reflect.set(this.overriddenConfig, key, newValue, receiver);\n return Reflect.set(target, key, newValue, receiver);\n }\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8IA,oBACE,IAFgB,MAAM,EAAE,kBAAkB,IAAM,CAE5C,EAAE,QACJ,aAAa,MAAM;CACjB,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,eAAe;CACf,YAAY;AACd,CAAC,CACH,CACF;AAEA,MAAM,0BAA0B;CAC9B;CACA;CACA;CACA;AACF;AAEA,IAAa,oBAAb,cAIU,sBAEV;CA4dwC;CA3dtC,YAA2B;CAE3B,WAAmB,KAAK;CAExB,aAAqB,KAAK;CAE1B;CAEA;CAEA;CAEA;CAE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AAI,QAAQ,gBACV,OAAO,KAAK;KAEd,IAAI,QAAQ,qBACV,OAAO,KAAK;IAEhB;IAEA,OAAO,QAAQ,IAAI,QAAQ,KAAK,QAAQ;GAC1C;;;;;;GAOA,MAAM,QAAyB,QAAkC;IAC/D,OACE,QAAQ,IAAI,QAAQ,GAAG,KACvB,wBAAwB,SAAS,IAAI,SAAS,CAAC;GAEnD;;;;;GAMA,UAAU,WAAwD;IAChE,OAAO,UAAU,CACf,GAAG,QAAQ,QAAQ,MAAM,GACzB,GAAG,uBACL,CAAC;GACH;;;;;;;;;GAUA,MACE,QACA,KACA,UACA,aACY;IACZ,IAAI,wBAAwB,SAAS,IAAI,SAAS,CAAC,GACjD,MAAM,IAAI,MACR,0BAA0B,IAAI,SAAS,EAAE,8DAC3C;IAGF,QAAQ,IAAI,KAAK,kBAAkB,KAAK,UAAU,QAAQ;IAC1D,OAAO,QAAQ,IAAI,QAAQ,KAAK,UAAU,QAAQ;GACpD;EACF,CAAC;CACH;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/core",
|
|
3
|
-
"version": "0.48.
|
|
3
|
+
"version": "0.48.43",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "An internal core package for Powerlines - please use the `powerlines` package for public usage.",
|
|
6
6
|
"homepage": "https://stormsoftware.com",
|
|
@@ -375,5 +375,5 @@
|
|
|
375
375
|
"undici-types": "^7.27.0"
|
|
376
376
|
},
|
|
377
377
|
"publishConfig": { "access": "public" },
|
|
378
|
-
"gitHead": "
|
|
378
|
+
"gitHead": "c9758c9d806df5f1182c03427243a456dda8d062"
|
|
379
379
|
}
|