@powerlines/core 0.48.64 → 0.48.66
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/lib/context-helpers.d.cts.map +1 -1
- package/dist/lib/context-helpers.d.mts.map +1 -1
- package/dist/lib/plugins.d.cts.map +1 -1
- package/dist/lib/plugins.d.mts.map +1 -1
- package/dist/lib/plugins.mjs.map +1 -1
- package/dist/lib/typescript/ts-morph.d.cts.map +1 -1
- package/dist/lib/typescript/ts-morph.d.mts.map +1 -1
- package/dist/storage/base.d.cts.map +1 -1
- package/dist/storage/base.d.mts.map +1 -1
- package/dist/storage/file-system.d.cts.map +1 -1
- package/dist/storage/file-system.d.mts.map +1 -1
- package/dist/storage/virtual.d.cts.map +1 -1
- package/dist/storage/virtual.d.mts.map +1 -1
- package/package.json +21 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-helpers.d.cts","names":[],"sources":["../../src/lib/context-helpers.ts"],"mappings":";;;;iBA+BgB,eAAe,wBAAwB,gBACrD,SACI,gCACA,kCACA,kCACA,uBAAuB
|
|
1
|
+
{"version":3,"file":"context-helpers.d.cts","names":[],"sources":["../../src/lib/context-helpers.ts"],"mappings":";;;;iBA+BgB,eAAe,wBAAwB,gBACrD,SACI,gCACA,kCACA,kCACA,uBAAuB;;;;;;;;IAM5B,uBAAA;iBAEqB,oBACpB,wBAAwB,iBAAiB,gBACzC,0BACA,iBAAiB,iBAAiB,iBAAiB,kBACjD,iBAAiB,iBAAiB,iBACpC,SAAS,WAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-helpers.d.mts","names":[],"sources":["../../src/lib/context-helpers.ts"],"mappings":";;;;iBA+BgB,eAAe,wBAAwB,gBACrD,SACI,gCACA,kCACA,kCACA,uBAAuB
|
|
1
|
+
{"version":3,"file":"context-helpers.d.mts","names":[],"sources":["../../src/lib/context-helpers.ts"],"mappings":";;;;iBA+BgB,eAAe,wBAAwB,gBACrD,SACI,gCACA,kCACA,kCACA,uBAAuB;;;;;;;;IAM5B,uBAAA;iBAEqB,oBACpB,wBAAwB,iBAAiB,gBACzC,0BACA,iBAAiB,iBAAiB,iBAAiB,kBACjD,iBAAiB,iBAAiB,iBACpC,SAAS,WAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.cts","names":[],"sources":["../../src/lib/plugins.ts"],"mappings":";;;;;;;;;;;;;iBAwDsB,cACpB,wBAAwB,gBACxB,gBACA,iBACI,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,kBAClC,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,iBACtC,uBAAuB,cAAc,iBAAiB,kBACpD,cAAc,iBAAiB,iBAEjC,SAAS,UACT,qBACC,QACC,OAAO,kBACP,OAAO,sBAEL,kBACG,aAAa,OAAO,kBAAkB,OAAO;;;;;;;;iBAsGhC,WACpB,wBAAwB,gBACxB,gBACA,iBACI,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,kBAClC,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,iBACtC,uBAAuB,cAAc,iBAAiB,kBACpD,cAAc,iBAAiB,iBAEjC,SAAS,UACT,QAAQ,aAAa,iBACrB,UAAS,wBACR,QAAQ,OAAO;
|
|
1
|
+
{"version":3,"file":"plugins.d.cts","names":[],"sources":["../../src/lib/plugins.ts"],"mappings":";;;;;;;;;;;;;iBAwDsB,cACpB,wBAAwB,gBACxB,gBACA,iBACI,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,kBAClC,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,iBACtC,uBAAuB,cAAc,iBAAiB,kBACpD,cAAc,iBAAiB,iBAEjC,SAAS,UACT,qBACC,QACC,OAAO,kBACP,OAAO,sBAEL,kBACG,aAAa,OAAO,kBAAkB,OAAO;;;;;;;;iBAsGhC,WACpB,wBAAwB,gBACxB,gBACA,iBACI,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,kBAClC,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,iBACtC,uBAAuB,cAAc,iBAAiB,kBACpD,cAAc,iBAAiB,iBAEjC,SAAS,UACT,QAAQ,aAAa,iBACrB,UAAS,wBACR,QAAQ,OAAO;UAsJD;;;;EAIf;;;;;;;;;iBAUoB,eACpB,wBAAwB,gBACxB,gBACA,iBACI,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,kBAClC,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,iBACtC,uBAAuB,cAAc,iBAAiB,kBACpD,cAAc,iBAAiB,iBAEjC,SAAS,UACT,QAAQ,aAAa,iBACrB,UAAS,wBAA0B,QAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.mts","names":[],"sources":["../../src/lib/plugins.ts"],"mappings":";;;;;;;;;;;;;iBAwDsB,cACpB,wBAAwB,gBACxB,gBACA,iBACI,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,kBAClC,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,iBACtC,uBAAuB,cAAc,iBAAiB,kBACpD,cAAc,iBAAiB,iBAEjC,SAAS,UACT,qBACC,QACC,OAAO,kBACP,OAAO,sBAEL,kBACG,aAAa,OAAO,kBAAkB,OAAO;;;;;;;;iBAsGhC,WACpB,wBAAwB,gBACxB,gBACA,iBACI,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,kBAClC,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,iBACtC,uBAAuB,cAAc,iBAAiB,kBACpD,cAAc,iBAAiB,iBAEjC,SAAS,UACT,QAAQ,aAAa,iBACrB,UAAS,wBACR,QAAQ,OAAO;
|
|
1
|
+
{"version":3,"file":"plugins.d.mts","names":[],"sources":["../../src/lib/plugins.ts"],"mappings":";;;;;;;;;;;;;iBAwDsB,cACpB,wBAAwB,gBACxB,gBACA,iBACI,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,kBAClC,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,iBACtC,uBAAuB,cAAc,iBAAiB,kBACpD,cAAc,iBAAiB,iBAEjC,SAAS,UACT,qBACC,QACC,OAAO,kBACP,OAAO,sBAEL,kBACG,aAAa,OAAO,kBAAkB,OAAO;;;;;;;;iBAsGhC,WACpB,wBAAwB,gBACxB,gBACA,iBACI,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,kBAClC,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,iBACtC,uBAAuB,cAAc,iBAAiB,kBACpD,cAAc,iBAAiB,iBAEjC,SAAS,UACT,QAAQ,aAAa,iBACrB,UAAS,wBACR,QAAQ,OAAO;UAsJD;;;;EAIf;;;;;;;;;iBAUoB,eACpB,wBAAwB,gBACxB,gBACA,iBACI,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,kBAClC,mBAAmB,iBAAiB,kBACpC,iBAAiB,iBAAiB,iBACtC,uBAAuB,cAAc,iBAAiB,kBACpD,cAAc,iBAAiB,iBAEjC,SAAS,UACT,QAAQ,aAAa,iBACrB,UAAS,wBAA0B,QAAA,OAAA"}
|
package/dist/lib/plugins.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.mjs","names":[],"sources":["../../src/lib/plugins.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 { install } from \"@stryke/fs/install\";\nimport { isPackageExists } from \"@stryke/fs/package-fns\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isPromiseLike } from \"@stryke/type-checks/is-promise\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { MaybePromise } from \"@stryke/types/base\";\nimport chalk from \"chalk\";\nimport {\n findInvalidPluginConfig,\n isDuplicate,\n isPlugin,\n isPluginConfig,\n isPluginConfigObject,\n isPluginConfigTuple\n} from \"../plugin-utils\";\nimport type {\n EnvironmentContext,\n ExecutionContext,\n Plugin,\n PluginConfig,\n PluginConfigTuple,\n PluginContext,\n PluginFactory,\n ResolvedConfig\n} from \"../types\";\n\n/**\n * Resolve a plugin module based on the provided plugin path. This function checks if the plugin package is installed, attempts to import the plugin module, and handles various error cases such as missing packages or invalid module exports. It supports both direct plugin exports and plugins exported from a \"plugin\" subdirectory within the package.\n *\n * @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.\n * @param pluginPath - The path to the plugin module. This can be a package name, a scoped package name, or a path to a local module.\n * @returns A promise that resolves to the plugin module, which can be a plugin instance, a factory function that returns a plugin, or an array of plugins.\n */\nexport async function resolvePlugin<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext,\n TContext extends\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext> =\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext>,\n TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> =\n PluginContext<TResolvedConfig, TSystemContext>\n>(\n context: TContext,\n pluginPath: string\n): Promise<\n | Plugin<TPluginContext>\n | Plugin<TPluginContext>[]\n | ((\n options?: any\n ) => MaybePromise<Plugin<TPluginContext> | Plugin<TPluginContext>[]>)\n> {\n if (\n pluginPath.startsWith(\"@\") &&\n pluginPath.split(\"/\").filter(Boolean).length > 2\n ) {\n const splits = pluginPath.split(\"/\").filter(Boolean);\n pluginPath = `${splits[0]}/${splits[1]}`;\n }\n\n const isInstalled = isPackageExists(pluginPath, {\n paths: [context.config.cwd, context.config.root]\n });\n if (!isInstalled && context.config.autoInstall) {\n context.warn(\n `The plugin package \"${\n pluginPath\n }\" is not installed. It will be installed automatically.`\n );\n\n const result = await install(pluginPath, {\n cwd: context.config.root\n });\n if (isNumber(result.exitCode) && result.exitCode > 0) {\n context.error(result.stderr);\n\n throw new Error(\n `An error occurred while installing the build plugin package \"${\n pluginPath\n }\" `\n );\n }\n }\n\n try {\n // First check if the package has a \"plugin\" subdirectory - @scope/package/plugin\n const module = await context.resolver.plugin.import<{\n plugin?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n default?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n }>(context.resolver.plugin.esmResolve(joinPaths(pluginPath, \"plugin\")));\n\n const result = module.plugin ?? module.default;\n if (!result) {\n throw new Error(\n `The plugin package \"${pluginPath}\" does not export a valid module.`\n );\n }\n\n return result;\n } catch (error) {\n try {\n const module = await context.resolver.plugin.import<{\n plugin?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n default?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n }>(context.resolver.plugin.esmResolve(pluginPath));\n\n const result = module.plugin ?? module.default;\n if (!result) {\n throw new Error(\n `The plugin package \"${pluginPath}\" does not export a valid module.`\n );\n }\n\n return result;\n } catch {\n if (!isInstalled) {\n throw new Error(\n `The plugin package \"${\n pluginPath\n }\" is not installed. Please install the package using the command: \"npm install ${\n pluginPath\n } --save-dev\"`\n );\n } else {\n throw new Error(\n `An error occurred while importing the build plugin package \"${\n pluginPath\n }\":\n${isError(error) ? error.message : String(error)}\n\nNote: Please ensure the plugin package's default export is a class that extends \\`Plugin\\` with a constructor that excepts a single arguments of type \\`PluginOptions\\`.`\n );\n }\n }\n }\n}\n\n/**\n * Initialize a plugin based on the provided plugin configuration. This function handles various forms of plugin configurations, including direct plugin instances, factory functions, string paths to plugins, and arrays of plugins or plugin configurations. It validates the plugin configuration, resolves any plugin paths, and returns an array of initialized plugins.\n *\n * @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.\n * @param config - The plugin configuration, which can be in various forms such as a direct plugin instance, a string path to a plugin, a factory function that returns a plugin, or an array of plugins or plugin configurations. This configuration will be processed and validated to initialize the appropriate plugins.\n * @returns A promise that resolves to an array of initialized plugins based on the provided configuration. If the configuration is invalid, an error will be thrown with details about the issue.\n */\nexport async function initPlugin<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext,\n TContext extends\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext> =\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext>,\n TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> =\n PluginContext<TResolvedConfig, TSystemContext>\n>(\n context: TContext,\n config: PluginConfig<TPluginContext>,\n options: ResolvePluginsOptions = {}\n): Promise<Plugin<TPluginContext>[] | null> {\n const { skipLogging = false } = options;\n\n let awaited = config;\n if (isPromiseLike(config)) {\n awaited = (await Promise.resolve(\n config as Promise<any>\n )) as PluginConfig<TPluginContext>;\n }\n\n if (!isPluginConfig<TPluginContext>(awaited)) {\n const invalid = findInvalidPluginConfig(awaited);\n\n throw new Error(\n `Invalid ${\n invalid && invalid.length > 1 ? \"plugins\" : \"plugin\"\n } specified in the configuration - ${\n invalid && invalid.length > 0\n ? JSON.stringify(awaited)\n : invalid?.join(\"\\n\\n\")\n } \\n\\nPlease ensure the value is one of the following: \\n - an instance of \\`Plugin\\` \\n - a plugin name \\n - an object with the \\`plugin\\` and \\`options\\` properties \\n - a tuple array with the plugin and options \\n - a factory function that returns a plugin or array of plugins \\n - an array of plugins or plugin configurations`\n );\n }\n\n let plugins!: Plugin<TPluginContext>[];\n if (isPlugin<TPluginContext>(awaited)) {\n plugins = [awaited];\n } else if (isFunction(awaited)) {\n plugins = toArray(await Promise.resolve(awaited()));\n } else if (isString(awaited)) {\n const resolved = await resolvePlugin<\n TResolvedConfig,\n TSystemContext,\n TContext\n >(context, awaited);\n if (isFunction(resolved)) {\n plugins = toArray(await Promise.resolve(resolved()));\n } else {\n plugins = toArray(resolved);\n }\n } else if (\n Array.isArray(awaited) &&\n (awaited as TPluginContext[]).every(isPlugin<TPluginContext>)\n ) {\n plugins = awaited as Plugin<TPluginContext>[];\n } else if (\n Array.isArray(awaited) &&\n (awaited as PluginConfig<TPluginContext>[]).every(\n isPluginConfig<TPluginContext>\n )\n ) {\n plugins = [];\n for (const pluginConfig of awaited as PluginConfig<TPluginContext>[]) {\n const initialized = await initPlugin<\n TResolvedConfig,\n TSystemContext,\n TContext,\n TPluginContext\n >(context, pluginConfig);\n if (initialized) {\n plugins.push(...initialized);\n }\n }\n } else if (\n isPluginConfigTuple<TPluginContext>(awaited) ||\n isPluginConfigObject<TPluginContext>(awaited)\n ) {\n let pluginConfig!:\n | string\n | PluginFactory<TPluginContext>\n | Plugin<TPluginContext>;\n let pluginOptions: any;\n\n if (isPluginConfigTuple<TPluginContext>(awaited)) {\n pluginConfig = awaited[0] as Plugin<TPluginContext>;\n pluginOptions =\n (awaited as PluginConfigTuple)?.length === 2 ? awaited[1] : undefined;\n } else {\n pluginConfig = awaited.plugin as Plugin<TPluginContext>;\n pluginOptions = awaited.options;\n }\n\n if (isSetString(pluginConfig)) {\n const resolved = await resolvePlugin<\n TResolvedConfig,\n TSystemContext,\n TContext,\n TPluginContext\n >(context, pluginConfig);\n if (isFunction(resolved)) {\n plugins = toArray(\n await Promise.resolve(\n pluginOptions ? resolved(pluginOptions) : resolved()\n )\n );\n } else {\n plugins = toArray(resolved);\n }\n } else if (isFunction(pluginConfig)) {\n plugins = toArray(await Promise.resolve(pluginConfig(pluginOptions)));\n } else if (\n Array.isArray(pluginConfig) &&\n pluginConfig.every(isPlugin<TPluginContext>)\n ) {\n plugins = pluginConfig;\n } else if (isPlugin<TPluginContext>(pluginConfig)) {\n plugins = toArray(pluginConfig);\n }\n }\n\n if (!plugins) {\n throw new Error(\n `The plugin configuration ${JSON.stringify(awaited)} is invalid. This configuration must point to a valid Powerlines plugin module.`\n );\n }\n\n if (plugins.length > 0 && !plugins.every(isPlugin<TPluginContext>)) {\n throw new Error(\n `The plugin option ${JSON.stringify(plugins)} does not export a valid module. This configuration must point to a valid Powerlines plugin module.`\n );\n }\n\n const result = [] as Plugin<TPluginContext>[];\n for (const plugin of plugins) {\n if (isDuplicate<TPluginContext>(plugin, context.plugins)) {\n if (!skipLogging) {\n context.trace({\n meta: {\n category: \"plugins\"\n },\n message: `Duplicate ${chalk.bold.cyanBright(\n plugin.name\n )} plugin dependency detected - Skipping initialization.`\n });\n }\n } else {\n result.push(plugin);\n\n if (!skipLogging) {\n context.trace({\n meta: {\n category: \"plugins\"\n },\n message: `Initializing the ${chalk.bold.cyanBright(plugin.name)} plugin...`\n });\n }\n }\n }\n\n return result;\n}\n\nexport interface ResolvePluginsOptions {\n /**\n * If true, the plugin resolution process will skip logging messages about the plugin initialization. This can be useful in scenarios where you want to suppress plugin-related logs, such as when running in a non-interactive environment or when you want to reduce log verbosity. By default, this option is false, and plugin initialization messages will be logged using the context's logger.\n */\n skipLogging?: boolean;\n}\n\n/**\n * Initialize a plugin based on the provided plugin configuration. This function handles various forms of plugin configurations, including direct plugin instances, plugin names, factory functions, and arrays of plugins. It validates the configuration, resolves plugin modules if necessary, and returns an array of initialized plugins ready to be added to the execution context.\n *\n * @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.\n * @param config - The plugin configuration, which can be in various forms such as a plugin instance, a plugin name string, a factory function that returns a plugin or an array of plugins, or an array of plugin configurations. The function will handle the resolution and initialization of the plugin(s) based on the provided configuration.\n * @returns A promise that resolves to an array of initialized plugins that can be added to the execution context, or null if the configuration is invalid or results in no plugins being initialized.\n */\nexport async function resolvePlugins<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext,\n TContext extends\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext> =\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext>,\n TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> =\n PluginContext<TResolvedConfig, TSystemContext>\n>(\n context: TContext,\n config: PluginConfig<TPluginContext>,\n options: ResolvePluginsOptions = {}\n) {\n const { skipLogging = false } = options;\n\n const plugins = [] as Plugin<TPluginContext>[];\n if (config) {\n const result = await initPlugin<\n TResolvedConfig,\n TSystemContext,\n TContext,\n TPluginContext\n >(context, config);\n if (result) {\n for (const plugin of result) {\n if (!skipLogging) {\n context.trace({\n meta: {\n category: \"plugins\"\n },\n message: `Successfully initialized the ${chalk.bold.cyanBright(\n plugin.name\n )} plugin`\n });\n }\n\n plugins.push(plugin);\n }\n }\n }\n\n return plugins;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwDA,eAAsB,cAWpB,SACA,YAOA;CACA,IACE,WAAW,WAAW,GAAG,KACzB,WAAW,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,SAAS,GAC/C;EACA,MAAM,SAAS,WAAW,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;EACnD,aAAa,GAAG,OAAO,GAAG,GAAG,OAAO;CACtC;CAEA,MAAM,cAAc,gBAAgB,YAAY,EAC9C,OAAO,CAAC,QAAQ,OAAO,KAAK,QAAQ,OAAO,IAAI,EACjD,CAAC;CACD,IAAI,CAAC,eAAe,QAAQ,OAA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AQ,YAAY,KAC1B,aAAa,MAAM,QAAwB,GAE3C,UAAU;OACL,IAAI,SAAyB,YAAY,GAC9C,UAAU,QAAQ,YAAY;CAElC;CAEA,IAAI,CAAC,SACH,MAAM,IAAI,MACR,4BAA4B,KAAK,UAAU,OAAO,EAAE,gFACtD;CAGF,IAAI,QAAQ,SAAS,KAAK,CAAC,QAAQ,MAAM,QAAwB,GAC/D,MAAM,IAAI,MACR,qBAAqB,KAAK,UAAU,OAAO,EAAE,oGAC/C;CAGF,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,UAAU,SACnB,IAAI,YAA4B,QAAQ,QAAQ,OAAO,GACrD;MAAI,CAAC,aACH,QAAQ,MAAM;GACZ,MAAM,EACJ,UAAU,UACZ;GACA,SAAS,aAAa,MAAM,KAAK,WAC/B,OAAO,IACT,EAAE;EACJ,CAAC;CACH,OACK;EACL,OAAO,KAAK,MAAM;EAElB,IAAI,CAAC,aACH,QAAQ,MAAM;GACZ,MAAM,EACJ,UAAU,UACZ;GACA,SAAS,oBAAoB,MAAM,KAAK,WAAW,OAAO,IAAI,EAAE;EAClE,CAAC;CAEL;CAGF,OAAO;AACT;;;;;;;;AAgBA,eAAsB,eAWpB,SACA,QACA,UAAiC,CAAC,GAClC;CACA,MAAM,EAAE,cAAc,UAAU;CAEhC,MAAM,UAAU,CAAC;CACjB,IAAI,QAAQ;EACV,MAAM,SAAS,MAAM,WAKnB,SAAS,MAAM;EACjB,IAAI,QACF,KAAK,MAAM,UAAU,QAAQ;GAC3B,IAAI,CAAC,aACH,QAAQ,MAAM;IACZ,MAAM,EACJ,UAAU,UACZ;IACA,SAAS,gCAAgC,MAAM,KAAK,WAClD,OAAO,IACT,EAAE;GACJ,CAAC;GAGH,QAAQ,KAAK,MAAM;EACrB;CAEJ;CAEA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"plugins.mjs","names":[],"sources":["../../src/lib/plugins.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 { install } from \"@stryke/fs/install\";\nimport { isPackageExists } from \"@stryke/fs/package-fns\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isPromiseLike } from \"@stryke/type-checks/is-promise\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { MaybePromise } from \"@stryke/types/base\";\nimport chalk from \"chalk\";\nimport {\n findInvalidPluginConfig,\n isDuplicate,\n isPlugin,\n isPluginConfig,\n isPluginConfigObject,\n isPluginConfigTuple\n} from \"../plugin-utils\";\nimport type {\n EnvironmentContext,\n ExecutionContext,\n Plugin,\n PluginConfig,\n PluginConfigTuple,\n PluginContext,\n PluginFactory,\n ResolvedConfig\n} from \"../types\";\n\n/**\n * Resolve a plugin module based on the provided plugin path. This function checks if the plugin package is installed, attempts to import the plugin module, and handles various error cases such as missing packages or invalid module exports. It supports both direct plugin exports and plugins exported from a \"plugin\" subdirectory within the package.\n *\n * @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.\n * @param pluginPath - The path to the plugin module. This can be a package name, a scoped package name, or a path to a local module.\n * @returns A promise that resolves to the plugin module, which can be a plugin instance, a factory function that returns a plugin, or an array of plugins.\n */\nexport async function resolvePlugin<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext,\n TContext extends\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext> =\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext>,\n TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> =\n PluginContext<TResolvedConfig, TSystemContext>\n>(\n context: TContext,\n pluginPath: string\n): Promise<\n | Plugin<TPluginContext>\n | Plugin<TPluginContext>[]\n | ((\n options?: any\n ) => MaybePromise<Plugin<TPluginContext> | Plugin<TPluginContext>[]>)\n> {\n if (\n pluginPath.startsWith(\"@\") &&\n pluginPath.split(\"/\").filter(Boolean).length > 2\n ) {\n const splits = pluginPath.split(\"/\").filter(Boolean);\n pluginPath = `${splits[0]}/${splits[1]}`;\n }\n\n const isInstalled = isPackageExists(pluginPath, {\n paths: [context.config.cwd, context.config.root]\n });\n if (!isInstalled && context.config.autoInstall) {\n context.warn(\n `The plugin package \"${\n pluginPath\n }\" is not installed. It will be installed automatically.`\n );\n\n const result = await install(pluginPath, {\n cwd: context.config.root\n });\n if (isNumber(result.exitCode) && result.exitCode > 0) {\n context.error(result.stderr);\n\n throw new Error(\n `An error occurred while installing the build plugin package \"${\n pluginPath\n }\" `\n );\n }\n }\n\n try {\n // First check if the package has a \"plugin\" subdirectory - @scope/package/plugin\n const module = await context.resolver.plugin.import<{\n plugin?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n default?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n }>(context.resolver.plugin.esmResolve(joinPaths(pluginPath, \"plugin\")));\n\n const result = module.plugin ?? module.default;\n if (!result) {\n throw new Error(\n `The plugin package \"${pluginPath}\" does not export a valid module.`\n );\n }\n\n return result;\n } catch (error) {\n try {\n const module = await context.resolver.plugin.import<{\n plugin?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n default?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n }>(context.resolver.plugin.esmResolve(pluginPath));\n\n const result = module.plugin ?? module.default;\n if (!result) {\n throw new Error(\n `The plugin package \"${pluginPath}\" does not export a valid module.`\n );\n }\n\n return result;\n } catch {\n if (!isInstalled) {\n throw new Error(\n `The plugin package \"${\n pluginPath\n }\" is not installed. Please install the package using the command: \"npm install ${\n pluginPath\n } --save-dev\"`\n );\n } else {\n throw new Error(\n `An error occurred while importing the build plugin package \"${\n pluginPath\n }\":\n${isError(error) ? error.message : String(error)}\n\nNote: Please ensure the plugin package's default export is a class that extends \\`Plugin\\` with a constructor that excepts a single arguments of type \\`PluginOptions\\`.`\n );\n }\n }\n }\n}\n\n/**\n * Initialize a plugin based on the provided plugin configuration. This function handles various forms of plugin configurations, including direct plugin instances, factory functions, string paths to plugins, and arrays of plugins or plugin configurations. It validates the plugin configuration, resolves any plugin paths, and returns an array of initialized plugins.\n *\n * @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.\n * @param config - The plugin configuration, which can be in various forms such as a direct plugin instance, a string path to a plugin, a factory function that returns a plugin, or an array of plugins or plugin configurations. This configuration will be processed and validated to initialize the appropriate plugins.\n * @returns A promise that resolves to an array of initialized plugins based on the provided configuration. If the configuration is invalid, an error will be thrown with details about the issue.\n */\nexport async function initPlugin<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext,\n TContext extends\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext> =\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext>,\n TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> =\n PluginContext<TResolvedConfig, TSystemContext>\n>(\n context: TContext,\n config: PluginConfig<TPluginContext>,\n options: ResolvePluginsOptions = {}\n): Promise<Plugin<TPluginContext>[] | null> {\n const { skipLogging = false } = options;\n\n let awaited = config;\n if (isPromiseLike(config)) {\n awaited = (await Promise.resolve(\n config as Promise<any>\n )) as PluginConfig<TPluginContext>;\n }\n\n if (!isPluginConfig<TPluginContext>(awaited)) {\n const invalid = findInvalidPluginConfig(awaited);\n\n throw new Error(\n `Invalid ${\n invalid && invalid.length > 1 ? \"plugins\" : \"plugin\"\n } specified in the configuration - ${\n invalid && invalid.length > 0\n ? JSON.stringify(awaited)\n : invalid?.join(\"\\n\\n\")\n } \\n\\nPlease ensure the value is one of the following: \\n - an instance of \\`Plugin\\` \\n - a plugin name \\n - an object with the \\`plugin\\` and \\`options\\` properties \\n - a tuple array with the plugin and options \\n - a factory function that returns a plugin or array of plugins \\n - an array of plugins or plugin configurations`\n );\n }\n\n let plugins!: Plugin<TPluginContext>[];\n if (isPlugin<TPluginContext>(awaited)) {\n plugins = [awaited];\n } else if (isFunction(awaited)) {\n plugins = toArray(await Promise.resolve(awaited()));\n } else if (isString(awaited)) {\n const resolved = await resolvePlugin<\n TResolvedConfig,\n TSystemContext,\n TContext\n >(context, awaited);\n if (isFunction(resolved)) {\n plugins = toArray(await Promise.resolve(resolved()));\n } else {\n plugins = toArray(resolved);\n }\n } else if (\n Array.isArray(awaited) &&\n (awaited as TPluginContext[]).every(isPlugin<TPluginContext>)\n ) {\n plugins = awaited as Plugin<TPluginContext>[];\n } else if (\n Array.isArray(awaited) &&\n (awaited as PluginConfig<TPluginContext>[]).every(\n isPluginConfig<TPluginContext>\n )\n ) {\n plugins = [];\n for (const pluginConfig of awaited as PluginConfig<TPluginContext>[]) {\n const initialized = await initPlugin<\n TResolvedConfig,\n TSystemContext,\n TContext,\n TPluginContext\n >(context, pluginConfig);\n if (initialized) {\n plugins.push(...initialized);\n }\n }\n } else if (\n isPluginConfigTuple<TPluginContext>(awaited) ||\n isPluginConfigObject<TPluginContext>(awaited)\n ) {\n let pluginConfig!:\n string | PluginFactory<TPluginContext> | Plugin<TPluginContext>;\n let pluginOptions: any;\n\n if (isPluginConfigTuple<TPluginContext>(awaited)) {\n pluginConfig = awaited[0] as Plugin<TPluginContext>;\n pluginOptions =\n (awaited as PluginConfigTuple)?.length === 2 ? awaited[1] : undefined;\n } else {\n pluginConfig = awaited.plugin as Plugin<TPluginContext>;\n pluginOptions = awaited.options;\n }\n\n if (isSetString(pluginConfig)) {\n const resolved = await resolvePlugin<\n TResolvedConfig,\n TSystemContext,\n TContext,\n TPluginContext\n >(context, pluginConfig);\n if (isFunction(resolved)) {\n plugins = toArray(\n await Promise.resolve(\n pluginOptions ? resolved(pluginOptions) : resolved()\n )\n );\n } else {\n plugins = toArray(resolved);\n }\n } else if (isFunction(pluginConfig)) {\n plugins = toArray(await Promise.resolve(pluginConfig(pluginOptions)));\n } else if (\n Array.isArray(pluginConfig) &&\n pluginConfig.every(isPlugin<TPluginContext>)\n ) {\n plugins = pluginConfig;\n } else if (isPlugin<TPluginContext>(pluginConfig)) {\n plugins = toArray(pluginConfig);\n }\n }\n\n if (!plugins) {\n throw new Error(\n `The plugin configuration ${JSON.stringify(awaited)} is invalid. This configuration must point to a valid Powerlines plugin module.`\n );\n }\n\n if (plugins.length > 0 && !plugins.every(isPlugin<TPluginContext>)) {\n throw new Error(\n `The plugin option ${JSON.stringify(plugins)} does not export a valid module. This configuration must point to a valid Powerlines plugin module.`\n );\n }\n\n const result = [] as Plugin<TPluginContext>[];\n for (const plugin of plugins) {\n if (isDuplicate<TPluginContext>(plugin, context.plugins)) {\n if (!skipLogging) {\n context.trace({\n meta: {\n category: \"plugins\"\n },\n message: `Duplicate ${chalk.bold.cyanBright(\n plugin.name\n )} plugin dependency detected - Skipping initialization.`\n });\n }\n } else {\n result.push(plugin);\n\n if (!skipLogging) {\n context.trace({\n meta: {\n category: \"plugins\"\n },\n message: `Initializing the ${chalk.bold.cyanBright(plugin.name)} plugin...`\n });\n }\n }\n }\n\n return result;\n}\n\nexport interface ResolvePluginsOptions {\n /**\n * If true, the plugin resolution process will skip logging messages about the plugin initialization. This can be useful in scenarios where you want to suppress plugin-related logs, such as when running in a non-interactive environment or when you want to reduce log verbosity. By default, this option is false, and plugin initialization messages will be logged using the context's logger.\n */\n skipLogging?: boolean;\n}\n\n/**\n * Initialize a plugin based on the provided plugin configuration. This function handles various forms of plugin configurations, including direct plugin instances, plugin names, factory functions, and arrays of plugins. It validates the configuration, resolves plugin modules if necessary, and returns an array of initialized plugins ready to be added to the execution context.\n *\n * @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.\n * @param config - The plugin configuration, which can be in various forms such as a plugin instance, a plugin name string, a factory function that returns a plugin or an array of plugins, or an array of plugin configurations. The function will handle the resolution and initialization of the plugin(s) based on the provided configuration.\n * @returns A promise that resolves to an array of initialized plugins that can be added to the execution context, or null if the configuration is invalid or results in no plugins being initialized.\n */\nexport async function resolvePlugins<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext,\n TContext extends\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext> =\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext>,\n TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> =\n PluginContext<TResolvedConfig, TSystemContext>\n>(\n context: TContext,\n config: PluginConfig<TPluginContext>,\n options: ResolvePluginsOptions = {}\n) {\n const { skipLogging = false } = options;\n\n const plugins = [] as Plugin<TPluginContext>[];\n if (config) {\n const result = await initPlugin<\n TResolvedConfig,\n TSystemContext,\n TContext,\n TPluginContext\n >(context, config);\n if (result) {\n for (const plugin of result) {\n if (!skipLogging) {\n context.trace({\n meta: {\n category: \"plugins\"\n },\n message: `Successfully initialized the ${chalk.bold.cyanBright(\n plugin.name\n )} plugin`\n });\n }\n\n plugins.push(plugin);\n }\n }\n }\n\n return plugins;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwDA,eAAsB,cAWpB,SACA,YAOA;CACA,IACE,WAAW,WAAW,GAAG,KACzB,WAAW,MAAM,GAAG,CAAC,C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CAAC,aACH,QAAQ,MAAM;IACZ,MAAM,EACJ,UAAU,UACZ;IACA,SAAS,gCAAgC,MAAM,KAAK,WAClD,OAAO,IACT,EAAE;GACJ,CAAC;GAGH,QAAQ,KAAK,MAAM;EACrB;CAEJ;CAEA,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts-morph.d.cts","names":[],"sources":["../../../src/lib/typescript/ts-morph.ts"],"mappings":";;;cA6Ba,8BACH,kCACG;;
|
|
1
|
+
{"version":3,"file":"ts-morph.d.cts","names":[],"sources":["../../../src/lib/typescript/ts-morph.ts"],"mappings":";;;cA6Ba,8BACH,kCACG;;EAIQ,YAAA,SAAS;EAMZ,WAAW;EAIX,YAAY,kBAAkB;EAoBxB,SAAS,mBAAgB;EAQ/B,aAAa;EAQP,UAAU,kBAAkB,mBAAgB;EAIlD,cAAc,kBAAkB;EAI1B,MAAM,kBAAe;EAI3B,UAAU;EAIJ,KAAK,iBAAiB,mBAAgB;EAI5C,SAAS,iBAAiB;EAIpB,KAAK,iBAAiB,mBAAgB;EAI5C,SAAS,iBAAiB;EAIpB,WAAW,mBAAgB;EAIjC,eAAe;EAIT,gBAAgB,kBAAe;EAIrC,oBAAoB;EAIpB,aAAa;EAIb;EAIM,KACpB,UAAU,wBACT;EAIa,SAAS,UAAU;;;;;;;;iBAWrB,cACd,SAAS,SACT,UAAU,QAAQ,kBACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts-morph.d.mts","names":[],"sources":["../../../src/lib/typescript/ts-morph.ts"],"mappings":";;;cA6Ba,8BACH,kCACG;;
|
|
1
|
+
{"version":3,"file":"ts-morph.d.mts","names":[],"sources":["../../../src/lib/typescript/ts-morph.ts"],"mappings":";;;cA6Ba,8BACH,kCACG;;EAIQ,YAAA,SAAS;EAMZ,WAAW;EAIX,YAAY,kBAAkB;EAoBxB,SAAS,mBAAgB;EAQ/B,aAAa;EAQP,UAAU,kBAAkB,mBAAgB;EAIlD,cAAc,kBAAkB;EAI1B,MAAM,kBAAe;EAI3B,UAAU;EAIJ,KAAK,iBAAiB,mBAAgB;EAI5C,SAAS,iBAAiB;EAIpB,KAAK,iBAAiB,mBAAgB;EAI5C,SAAS,iBAAiB;EAIpB,WAAW,mBAAgB;EAIjC,eAAe;EAIT,gBAAgB,kBAAe;EAIrC,oBAAoB;EAIpB,aAAa;EAIb;EAIM,KACpB,UAAU,wBACT;EAIa,SAAS,UAAU;;;;;;;;iBAWrB,cACd,SAAS,SACT,UAAU,QAAQ,kBACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.cts","names":[],"sources":["../../src/storage/base.ts"],"mappings":";;;;UA0BiB;EACf;EACA;EACA;;;;;uBAMoB,mBACpB,iBAAiB,wBAAwB,kCAC9B;;YA+BC,SAAS;;;;WAtBL;;;;EAKT,SAAS;;;;;;;WAQA,SAAS;;;;;;;
|
|
1
|
+
{"version":3,"file":"base.d.cts","names":[],"sources":["../../src/storage/base.ts"],"mappings":";;;;UA0BiB;EACf;EACA;EACA;;;;;uBAMoB,mBACpB,iBAAiB,wBAAwB,kCAC9B;;YA+BC,SAAS;;;;WAtBL;;;;EAKT,SAAS;;;;;;;WAQA,SAAS;;;;;;;EASb,YAAA,SAAS,SACnB,UAAS;;;;;;;WAaK,WAAW;;;;;;;EAQd,OAAO,cAAc;;;;;;;WAUlB,QAAQ,uBAAuB,OAAO;;;;;;;EAQzC,IACX,cACC,iBAAiB,OAAO;;;;;;;WAUX,QACd,aACA,gBAAgB,OAAO;;;;;;;EASZ,IACX,aACA,gBAAgB,OAAO,kBACtB;;;;;;EAWI,UAAU;;;;;;EAOJ,MAAM,kBAAkB;;;;;;WASrB,WAAW;;;;;;EAOd,OAAO,cAAc;;;;;;EAW3B,UAAU;;;;;;;EAqBJ,MAAM,gBAAgB;;;;;;;WAuBnB,SAAS;;;;;;;EAQZ,KAAK,gBAAgB;;;;;;;EAU3B,gBAAgB;;;;;;;EAUV,YAAY,cAAW;;;;;;;EAU7B,WAAW;;;;;;;EAUL,OAAO,cAAW;;;;;;EASxB,WAAW;;;;;;GASJ,OAAO,iBAAa;;;;;;gBASpB;;;;;;gBASA;;;;;;;YAUJ,QAAQ;;;;;;YAmBF,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.mts","names":[],"sources":["../../src/storage/base.ts"],"mappings":";;;;UA0BiB;EACf;EACA;EACA;;;;;uBAMoB,mBACpB,iBAAiB,wBAAwB,kCAC9B;;YA+BC,SAAS;;;;WAtBL;;;;EAKT,SAAS;;;;;;;WAQA,SAAS;;;;;;;
|
|
1
|
+
{"version":3,"file":"base.d.mts","names":[],"sources":["../../src/storage/base.ts"],"mappings":";;;;UA0BiB;EACf;EACA;EACA;;;;;uBAMoB,mBACpB,iBAAiB,wBAAwB,kCAC9B;;YA+BC,SAAS;;;;WAtBL;;;;EAKT,SAAS;;;;;;;WAQA,SAAS;;;;;;;EASb,YAAA,SAAS,SACnB,UAAS;;;;;;;WAaK,WAAW;;;;;;;EAQd,OAAO,cAAc;;;;;;;WAUlB,QAAQ,uBAAuB,OAAO;;;;;;;EAQzC,IACX,cACC,iBAAiB,OAAO;;;;;;;WAUX,QACd,aACA,gBAAgB,OAAO;;;;;;;EASZ,IACX,aACA,gBAAgB,OAAO,kBACtB;;;;;;EAWI,UAAU;;;;;;EAOJ,MAAM,kBAAkB;;;;;;WASrB,WAAW;;;;;;EAOd,OAAO,cAAc;;;;;;EAW3B,UAAU;;;;;;;EAqBJ,MAAM,gBAAgB;;;;;;;WAuBnB,SAAS;;;;;;;EAQZ,KAAK,gBAAgB;;;;;;;EAU3B,gBAAgB;;;;;;;EAUV,YAAY,cAAW;;;;;;;EAU7B,WAAW;;;;;;;EAUL,OAAO,cAAW;;;;;;EASxB,WAAW;;;;;;GASJ,OAAO,iBAAa;;;;;;gBASpB;;;;;;gBASA;;;;;;;YAUJ,QAAQ;;;;;;YAmBF,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-system.d.cts","names":[],"sources":["../../src/storage/file-system.ts"],"mappings":";;;;KAkCY,iBAAiB,kBAAkB;KACnC,aAAa,kBAAkB;;;;cAK9B,iCAAiC;;;;EAIrC;;;;;;;WAQkB;;;;;;;
|
|
1
|
+
{"version":3,"file":"file-system.d.cts","names":[],"sources":["../../src/storage/file-system.ts"],"mappings":";;;;KAkCY,iBAAiB,kBAAkB;KACnC,aAAa,kBAAkB;;;;cAK9B,iCAAiC;;;;EAIrC;;;;;;;WAQkB;;;;;;;EAQN,YAAA,SAAS,SAAS,UAAU;;;;;;;EAUxC,WAAW;;;;;;;EAUI,OAAO,cAAc;;;;;;;EAUpC,QAAQ;;;;;;;EAUO,IAAI,cAAc;;;;;;;EAUjC,QAAQ,aAAa,gBAAgB,OAAO;;;;;;;EA+C7B,IACpB,aACA,gBAAgB,OAAO,kBACtB;;;;;;EA8CI,WAAW;;;;;;EAeI,OAAO,cAAc;;;;;;EAW3B,UAAU;;;;;;EASJ,MAAM,kBAAkB;;;;;;;EAUvC,SAAS;;;;;;;EAgBM,KAAK,gBAAgB;;;;;;;EAc3B,gBAAgB;;;;;;;EAUhB,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-system.d.mts","names":[],"sources":["../../src/storage/file-system.ts"],"mappings":";;;;KAkCY,iBAAiB,kBAAkB;KACnC,aAAa,kBAAkB;;;;cAK9B,iCAAiC;;;;EAIrC;;;;;;;WAQkB;;;;;;;
|
|
1
|
+
{"version":3,"file":"file-system.d.mts","names":[],"sources":["../../src/storage/file-system.ts"],"mappings":";;;;KAkCY,iBAAiB,kBAAkB;KACnC,aAAa,kBAAkB;;;;cAK9B,iCAAiC;;;;EAIrC;;;;;;;WAQkB;;;;;;;EAQN,YAAA,SAAS,SAAS,UAAU;;;;;;;EAUxC,WAAW;;;;;;;EAUI,OAAO,cAAc;;;;;;;EAUpC,QAAQ;;;;;;;EAUO,IAAI,cAAc;;;;;;;EAUjC,QAAQ,aAAa,gBAAgB,OAAO;;;;;;;EA+C7B,IACpB,aACA,gBAAgB,OAAO,kBACtB;;;;;;EA8CI,WAAW;;;;;;EAeI,OAAO,cAAc;;;;;;EAW3B,UAAU;;;;;;EASJ,MAAM,kBAAkB;;;;;;;EAUvC,SAAS;;;;;;;EAgBM,KAAK,gBAAgB;;;;;;;EAc3B,gBAAgB;;;;;;;EAUhB,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual.d.cts","names":[],"sources":["../../src/storage/virtual.ts"],"mappings":";;;;;;cAyBa,8BAA8B;;;;EAIlC;;;;;;;WAQkB;;;;YAKf,MAAI;;;;;;;
|
|
1
|
+
{"version":3,"file":"virtual.d.cts","names":[],"sources":["../../src/storage/virtual.ts"],"mappings":";;;;;;cAyBa,8BAA8B;;;;EAIlC;;;;;;;WAQkB;;;;YAKf,MAAI;;;;;;;EAQK,YAAA,SAAS,SAAS,UAAU;;;;;;;EAUxC,WAAW;;;;;;;EAUX,QAAQ,uBAAuB,OAAO;;;;;;;EAUtC,QAAQ,aAAa,gBAAgB,OAAO;;;;;;EAW5C,WAAW;;;;;;;EAYX,SAAS;;;;;;EAaM,WAAW;;;;;;gBASV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual.d.mts","names":[],"sources":["../../src/storage/virtual.ts"],"mappings":";;;;;;cAyBa,8BAA8B;;;;EAIlC;;;;;;;WAQkB;;;;YAKf,MAAI;;;;;;;
|
|
1
|
+
{"version":3,"file":"virtual.d.mts","names":[],"sources":["../../src/storage/virtual.ts"],"mappings":";;;;;;cAyBa,8BAA8B;;;;EAIlC;;;;;;;WAQkB;;;;YAKf,MAAI;;;;;;;EAQK,YAAA,SAAS,SAAS,UAAU;;;;;;;EAUxC,WAAW;;;;;;;EAUX,QAAQ,uBAAuB,OAAO;;;;;;;EAUtC,QAAQ,aAAa,gBAAgB,OAAO;;;;;;EAW5C,WAAW;;;;;;;EAYX,SAAS;;;;;;EAaM,WAAW;;;;;;gBASV"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/core",
|
|
3
|
-
"version": "0.48.
|
|
3
|
+
"version": "0.48.66",
|
|
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",
|
|
@@ -327,20 +327,20 @@
|
|
|
327
327
|
"@donedeal0/superdiff": "^3.2.0",
|
|
328
328
|
"@jridgewell/sourcemap-codec": "^1.5.5",
|
|
329
329
|
"@rolldown/pluginutils": "^1.0.1",
|
|
330
|
-
"@storm-software/config": "^1.138.
|
|
331
|
-
"@storm-software/config-tools": "^1.190.
|
|
332
|
-
"@storm-software/prettier": "^0.59.
|
|
333
|
-
"@stryke/capnp": "^0.12.
|
|
334
|
-
"@stryke/convert": "^0.7.
|
|
335
|
-
"@stryke/env": "^0.20.
|
|
336
|
-
"@stryke/fs": "^0.33.
|
|
337
|
-
"@stryke/hash": "^0.13.
|
|
338
|
-
"@stryke/helpers": "^0.10.
|
|
339
|
-
"@stryke/json": "^0.15.
|
|
340
|
-
"@stryke/path": "^0.29.
|
|
341
|
-
"@stryke/string-format": "^0.17.
|
|
342
|
-
"@stryke/type-checks": "^0.6.
|
|
343
|
-
"@stryke/unique-id": "^0.3.
|
|
330
|
+
"@storm-software/config": "^1.138.46",
|
|
331
|
+
"@storm-software/config-tools": "^1.190.109",
|
|
332
|
+
"@storm-software/prettier": "^0.59.162",
|
|
333
|
+
"@stryke/capnp": "^0.12.123",
|
|
334
|
+
"@stryke/convert": "^0.7.27",
|
|
335
|
+
"@stryke/env": "^0.20.114",
|
|
336
|
+
"@stryke/fs": "^0.33.97",
|
|
337
|
+
"@stryke/hash": "^0.13.50",
|
|
338
|
+
"@stryke/helpers": "^0.10.36",
|
|
339
|
+
"@stryke/json": "^0.15.20",
|
|
340
|
+
"@stryke/path": "^0.29.23",
|
|
341
|
+
"@stryke/string-format": "^0.17.38",
|
|
342
|
+
"@stryke/type-checks": "^0.6.29",
|
|
343
|
+
"@stryke/unique-id": "^0.3.108",
|
|
344
344
|
"birpc": "^4.0.0",
|
|
345
345
|
"bundle-require": "^5.1.0",
|
|
346
346
|
"c12": "^3.3.4",
|
|
@@ -355,17 +355,17 @@
|
|
|
355
355
|
"locate-character": "^3.0.0",
|
|
356
356
|
"magic-string": "^0.30.21",
|
|
357
357
|
"oxc-parser": "^0.99.0",
|
|
358
|
-
"oxc-resolver": "^11.
|
|
358
|
+
"oxc-resolver": "^11.24.2",
|
|
359
359
|
"picomatch": "^4.0.5",
|
|
360
|
-
"prettier": "^3.9.
|
|
360
|
+
"prettier": "^3.9.6",
|
|
361
361
|
"ts-morph": "^27.0.2",
|
|
362
362
|
"undici": "^7.28.0",
|
|
363
363
|
"unplugin": "^3.3.0",
|
|
364
364
|
"unplugin-combine": "^2.4.0"
|
|
365
365
|
},
|
|
366
366
|
"devDependencies": {
|
|
367
|
-
"@storm-software/testing-tools": "^1.119.
|
|
368
|
-
"@stryke/types": "^0.12.
|
|
367
|
+
"@storm-software/testing-tools": "^1.119.262",
|
|
368
|
+
"@stryke/types": "^0.12.24",
|
|
369
369
|
"@types/bun": "^1.3.14",
|
|
370
370
|
"@types/diff-match-patch": "^1.0.36",
|
|
371
371
|
"@types/node": "^25.9.5",
|
|
@@ -373,10 +373,10 @@
|
|
|
373
373
|
"@types/semver": "^7.7.1",
|
|
374
374
|
"bun-types-no-globals": "^1.3.11",
|
|
375
375
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
376
|
-
"tsdown": "^0.22.
|
|
376
|
+
"tsdown": "^0.22.13",
|
|
377
377
|
"typescript": "^6.0.3",
|
|
378
378
|
"undici-types": "^7.28.0"
|
|
379
379
|
},
|
|
380
380
|
"publishConfig": { "access": "public" },
|
|
381
|
-
"gitHead": "
|
|
381
|
+
"gitHead": "d81170b608c0b80e7726e129c3edd1b7b6ca2605"
|
|
382
382
|
}
|