@powerlines/unplugin 0.0.73 → 0.0.75

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/package.cjs CHANGED
@@ -9,7 +9,7 @@ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TS
9
9
 
10
10
  //#region package.json
11
11
  var name = "@powerlines/unplugin";
12
- var version = "0.0.72";
12
+ var version = "0.0.74";
13
13
 
14
14
  //#endregion
15
15
  Object.defineProperty(exports, 'name', {
package/dist/package.mjs CHANGED
@@ -8,7 +8,7 @@ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TS
8
8
 
9
9
  //#region package.json
10
10
  var name = "@powerlines/unplugin";
11
- var version = "0.0.72";
11
+ var version = "0.0.74";
12
12
 
13
13
  //#endregion
14
14
  export { name, version };
package/dist/unplugin.cjs CHANGED
@@ -25,7 +25,6 @@ let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function")
25
25
  let _stryke_type_checks_is_object = require("@stryke/type-checks/is-object");
26
26
  let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
27
27
  let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
28
- let _stryke_unique_id_uuid = require("@stryke/unique-id/uuid");
29
28
 
30
29
  //#region src/unplugin.ts
31
30
  /**
@@ -77,7 +76,7 @@ function createUnpluginFactory(options, decorate = (options) => options) {
77
76
  ...params,
78
77
  command: "build",
79
78
  configFile: config.configFile,
80
- executionId: (0, _stryke_unique_id_uuid.uuid)(),
79
+ executionId: (0, _powerlines_core_plugin_utils.formatExecutionId)(config.config.name || root, "build", 0),
81
80
  configIndex: 0
82
81
  };
83
82
  context = await _powerlines_core_context_execution_context.PowerlinesExecutionContext.from({
package/dist/unplugin.mjs CHANGED
@@ -14,7 +14,7 @@ import { PowerlinesExecutionContext } from "@powerlines/core/context/execution-c
14
14
  import { resolvePluginConfig } from "@powerlines/core/lib/context-helpers";
15
15
  import { executeEnvironments } from "@powerlines/core/lib/environment";
16
16
  import { getString } from "@powerlines/core/lib/utilities/source-file";
17
- import { VIRTUAL_MODULE_PREFIX_REGEX, addVirtualPrefix, formatConfig, removeVirtualPrefix } from "@powerlines/core/plugin-utils";
17
+ import { VIRTUAL_MODULE_PREFIX_REGEX, addVirtualPrefix, formatConfig, formatExecutionId, removeVirtualPrefix } from "@powerlines/core/plugin-utils";
18
18
  import { toArray } from "@stryke/convert/to-array";
19
19
  import { getWorkspaceRoot } from "@stryke/fs/get-workspace-root";
20
20
  import { createDirectory } from "@stryke/fs/helpers";
@@ -24,7 +24,6 @@ import { isFunction } from "@stryke/type-checks/is-function";
24
24
  import { isObject } from "@stryke/type-checks/is-object";
25
25
  import { isSetObject } from "@stryke/type-checks/is-set-object";
26
26
  import { isSetString } from "@stryke/type-checks/is-set-string";
27
- import { uuid } from "@stryke/unique-id/uuid";
28
27
 
29
28
  export * from "@powerlines/core/lib/unplugin"
30
29
 
@@ -78,7 +77,7 @@ function createUnpluginFactory(options, decorate = (options) => options) {
78
77
  ...params,
79
78
  command: "build",
80
79
  configFile: config.configFile,
81
- executionId: uuid(),
80
+ executionId: formatExecutionId(config.config.name || root, "build", 0),
82
81
  configIndex: 0
83
82
  };
84
83
  context = await PowerlinesExecutionContext.from({
@@ -1 +1 @@
1
- {"version":3,"file":"unplugin.mjs","names":[],"sources":["../src/unplugin.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 type {\n CustomLogger,\n ExecutionContext,\n Options,\n UnpluginBuilderVariant,\n UnpluginOptions\n} from \"@powerlines/core\";\nimport {\n formatFolder,\n handleTypes,\n initializeTsconfig,\n installDependencies,\n isUnpluginBuilderVariant,\n loadParsedConfig,\n resolveRoot,\n resolveTsconfig,\n writeMetaFile\n} from \"@powerlines/core\";\nimport { UNPLUGIN_BUILDER_VARIANTS } from \"@powerlines/core/constants\";\nimport { PowerlinesExecutionContext } from \"@powerlines/core/context/execution-context\";\nimport { resolvePluginConfig } from \"@powerlines/core/lib/context-helpers\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { getString } from \"@powerlines/core/lib/utilities/source-file\";\nimport {\n addVirtualPrefix,\n formatConfig,\n removeVirtualPrefix,\n VIRTUAL_MODULE_PREFIX_REGEX\n} from \"@powerlines/core/plugin-utils\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getWorkspaceRoot } from \"@stryke/fs/get-workspace-root\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\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 { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport { LoadResult } from \"rolldown\";\nimport type {\n TransformResult,\n UnpluginBuildContext,\n UnpluginContext\n} from \"unplugin\";\nimport { UnpluginFactory } from \"./types\";\n\nexport * from \"@powerlines/core/lib/unplugin\";\n\n/**\n * The options required to create a Powerlines unplugin factory, which generates a plugin instance for a specific build variant and allows for optional customization of logging and framework identification.\n */\nexport interface UnpluginFactoryOptions extends Options {\n /**\n * The build variant for which to create the unplugin.\n *\n * @remarks\n * This option is required to ensure that the unplugin is built with the correct configuration and behavior for the intended build tool or framework. The variant will determine how the unplugin integrates with the build process and which hooks it will call during execution.\n */\n variant: UnpluginBuilderVariant;\n\n /**\n * An optional string prefix to use for virtual module IDs. This can be useful for ensuring that virtual modules are only processed by the plugin and not by other plugins or the bundler itself. If not provided, the default prefix `__powerlines-virtual:` will be used.\n *\n * @defaultValue \"\\\\0\"\n */\n virtualModulePrefix?: string | false;\n\n /**\n * A custom logger instance that implements the {@link CustomLogger} interface, which can be used for logging messages during the build process instead of the default Powerlines logger.\n *\n * @remarks\n * Providing a custom logger allows you to integrate Powerlines logging with your own logging system or to customize the logging behavior, such as formatting log messages differently or sending logs to an external service. If a custom logger is not provided, Powerlines will use its default logger implementation.\n */\n customLogger?: CustomLogger;\n}\n\nexport type UnpluginFactoryDecorator<TContext extends ExecutionContext> = (\n options: UnpluginOptions<TContext>\n) => Partial<UnpluginOptions<TContext>>;\n\n/**\n * Creates a Powerlines unplugin factory that generates a plugin instance.\n *\n * @remarks\n * The factory will handle loading the Powerlines configuration, resolving the plugin configuration, and executing the appropriate hooks during the build process. It also allows for optional customization of logging and framework identification through the provided options.\n *\n * @example\n * ```ts\n * import { createUnpluginFactory } from \"@powerlines/unplugin\";\n *\n * const factory = createUnpluginFactory({\n * variant: \"vite\",\n * framework: \"my-framework\",\n * orgId: \"my-org\",\n * customLogger: myCustomLogger\n * });\n *\n * const plugin = createVitePlugin(factory);\n * export default plugin;\n * ```\n *\n * @param options - The options for the unplugin factory, including the build variant and an optional custom logger.\n * @param decorate - An optional function to decorate the unplugin options.\n * @returns The unplugin factory that generates a plugin instance.\n */\nexport function createUnpluginFactory<\n TContext extends ExecutionContext = ExecutionContext\n>(\n options: UnpluginFactoryOptions,\n decorate: UnpluginFactoryDecorator<TContext> = options => options\n): UnpluginFactory<TContext> {\n if (!isUnpluginBuilderVariant(options.variant)) {\n throw new Error(\n `Invalid unplugin builder variant: ${String(options.variant)}. Expected one of: ${UNPLUGIN_BUILDER_VARIANTS.join(\n \", \"\n )}.`\n );\n }\n\n const cwd = getWorkspaceRoot(process.cwd());\n const virtualModulePrefix = options.virtualModulePrefix ?? \"\\\\0\";\n\n return (params = {}): UnpluginOptions<TContext> => {\n let context!: PowerlinesExecutionContext<\n TContext[\"config\"],\n TContext[\"system\"]\n >;\n try {\n const framework =\n (params.framework?.name ?? options.framework?.name) || \"powerlines\";\n const orgId =\n (params.framework?.orgId ?? options.framework?.orgId) ||\n \"storm-software\";\n\n const root = resolveRoot(cwd, params.root, params.configFile);\n\n async function buildStart(this: UnpluginBuildContext): Promise<void> {\n const config = await loadParsedConfig(cwd, root, framework, orgId, {\n ...params,\n command: \"build\"\n });\n if (!config) {\n throw new Error(\"Failed to load configuration\");\n }\n\n const configs = toArray(config.config);\n if (\n params.configIndex !== undefined &&\n params.configIndex >= configs.length\n ) {\n throw new Error(\n `Invalid execution index: ${params.configIndex}. The configuration file contains ${configs.length} execution(s).`\n );\n }\n\n const _options = {\n cwd,\n root,\n ...params,\n command: \"build\",\n configFile: config.configFile!,\n executionId: uuid(),\n configIndex: 0\n };\n\n context = await PowerlinesExecutionContext.from(\n {\n ...options,\n ..._options,\n configFile: config.configFile!\n },\n _options\n );\n context.logger.info(\n `Starting ${titleCase(framework)} ${titleCase(options.variant)} plugin execution`\n );\n\n context.logger.debug({\n meta: { category: \"config\" },\n message: `Invoking ${titleCase(framework)} ${titleCase(\n options.variant\n )} plugin with the following execution parameters: \\n --- Execution Options --- \\n${formatConfig(\n params\n )}`\n });\n\n await resolvePluginConfig(context);\n\n const timer = context.timer(\"Preparation\");\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n const entriesLength = isObject(env.config.input)\n ? Object.keys(env.config.input).length\n : toArray(env.config.input).length;\n env.debug(\n `The configuration provided ${entriesLength} entry point${\n entriesLength !== 1 ? \"s\" : \"\"\n }, Powerlines has found ${env.entry.length} entry file${\n env.entry.length !== 1 ? \"s\" : \"\"\n } for the ${env.config.title} project${\n env.entry.length > 0 && env.entry.length < 10\n ? `: \\n${env.entry\n .map(\n entry =>\n `- ${replacePath(entry.file, context.config.root)}${\n entry.output\n ? ` -> ${replacePath(\n entry.output,\n context.config.root\n )}`\n : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n env.warn(\n `No entry files were found for the ${\n env.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig(env);\n await installDependencies(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"post\"\n });\n\n env.trace({\n meta: {\n category: \"config\"\n },\n message: `Powerlines configuration after configResolved hook: \\n${formatConfig(\n env.config\n )}`\n });\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"pre\"\n });\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"normal\"\n });\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"post\"\n });\n\n if (env.config.output.types !== false) {\n await handleTypes(context, env);\n }\n\n context.debug(\"Formatting files generated during the prepare step.\");\n\n await Promise.all([\n formatFolder(env, env.builtinsPath),\n formatFolder(env, env.entryPath)\n ]);\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n }\n\n async function resolveId(\n this: UnpluginBuildContext & UnpluginContext,\n id: string,\n importer?: string,\n opts: {\n isEntry: boolean;\n } = { isEntry: false }\n ) {\n const normalizedId = removeVirtualPrefix(id);\n const normalizedImporter = importer\n ? removeVirtualPrefix(importer)\n : undefined;\n\n let result = await context.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && virtualModulePrefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await context.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && virtualModulePrefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await context.resolve(normalizedId, normalizedImporter, {\n isFile: true,\n ...opts\n });\n if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && virtualModulePrefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await context.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && virtualModulePrefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n return null;\n }\n\n const load = {\n filter:\n virtualModulePrefix !== false\n ? {\n id: VIRTUAL_MODULE_PREFIX_REGEX\n }\n : undefined,\n async handler(\n this: UnpluginBuildContext & UnpluginContext,\n id: string\n ): Promise<LoadResult | null | undefined> {\n const normalizedId = removeVirtualPrefix(id);\n\n let result = await context.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await context.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await context.load(normalizedId);\n if (result) {\n return result;\n }\n\n return context.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId\n );\n }\n } as UnpluginOptions<TContext>[\"load\"];\n\n async function transform(\n code: string,\n id: string\n ): Promise<TransformResult> {\n return context.callHook(\n \"transform\",\n {\n environment: await context.getEnvironment(),\n result: \"merge\",\n asNextParam: previousResult => getString(previousResult)\n },\n getString(code),\n id\n );\n }\n\n async function writeBundle(): Promise<void> {\n context.logger.debug(\"Finalizing Powerlines project output...\");\n\n await context.callHook(\"writeBundle\", {\n environment: await context.getEnvironment()\n });\n }\n\n context.logger.debug(\"Unplugin initialized successfully.\");\n\n const result = {\n name: `${kebabCase(framework)}:${kebabCase(options.variant)}-plugin`,\n context,\n resolveId,\n load,\n transform,\n buildStart,\n writeBundle\n } as unknown as UnpluginOptions<TContext>;\n\n return {\n ...result,\n ...decorate(result)\n };\n } catch (error) {\n if (isFunction(context?.logger?.error)) {\n context.logger.error((error as Error)?.message);\n }\n\n throw error;\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,SAAgB,sBAGd,SACA,YAA+C,YAAW,SAC/B;CAC3B,IAAI,CAAC,yBAAyB,QAAQ,OAAO,GAC3C,MAAM,IAAI,MACR,qCAAqC,OAAO,QAAQ,OAAO,EAAE,qBAAqB,0BAA0B,KAC1G,IACF,EAAE,EACJ;CAGF,MAAM,MAAM,iBAAiB,QAAQ,IAAI,CAAC;CAC1C,MAAM,sBAAsB,QAAQ,uBAAuB;CAE3D,QAAQ,SAAS,CAAC,MAAiC;EACjD,IAAI;EAIJ,IAAI;GACF,MAAM,aACH,OAAO,WAAW,QAAQ,QAAQ,WAAW,SAAS;GACzD,MAAM,SACH,OAAO,WAAW,SAAS,QAAQ,WAAW,UAC/C;GAEF,MAAM,OAAO,YAAY,KAAK,OAAO,MAAM,OAAO,UAAU;GAE5D,eAAe,aAAsD;IACnE,MAAM,SAAS,MAAM,iBAAiB,KAAK,MAAM,WAAW,OAAO;KACjE,GAAG;KACH,SAAS;IACX,CAAC;IACD,IAAI,CAAC,QACH,MAAM,IAAI,MAA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,MAAM,QAAQ,SACrB,QACA;MACE,YAAY;MACZ,QAAQ;MACR,OAAO;KACT,GACA,YACF;KACA,IAAI,QACF,OAAO;KAGT,SAAS,MAAM,QAAQ,KAAK,YAAY;KACxC,IAAI,QACF,OAAO;KAGT,OAAO,QAAQ,SACb,QACA;MACE,YAAY;MACZ,QAAQ;MACR,OAAO;KACT,GACA,YACF;IACF;GACF;GAEA,eAAe,UACb,MACA,IAC0B;IAC1B,OAAO,QAAQ,SACb,aACA;KACE,aAAa,MAAM,QAAQ,eAAe;KAC1C,QAAQ;KACR,cAAa,mBAAkB,UAAU,cAAc;IACzD,GACA,UAAU,IAAI,GACd,EACF;GACF;GAEA,eAAe,cAA6B;IAC1C,QAAQ,OAAO,MAAM,yCAAyC;IAE9D,MAAM,QAAQ,SAAS,eAAe,EACpC,aAAa,MAAM,QAAQ,eAAe,EAC5C,CAAC;GACH;GAEA,QAAQ,OAAO,MAAM,oCAAoC;GAEzD,MAAM,SAAS;IACb,MAAM,GAAG,UAAU,SAAS,EAAE,GAAG,UAAU,QAAQ,OAAO,EAAE;IAC5D;IACA;IACA;IACA;IACA;IACA;GACF;GAEA,OAAO;IACL,GAAG;IACH,GAAG,SAAS,MAAM;GACpB;EACF,SAAS,OAAO;GACd,IAAI,WAAW,SAAS,QAAQ,KAAK,GACnC,QAAQ,OAAO,MAAO,OAAiB,OAAO;GAGhD,MAAM;EACR;CACF;AACF"}
1
+ {"version":3,"file":"unplugin.mjs","names":[],"sources":["../src/unplugin.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 type {\n CustomLogger,\n ExecutionContext,\n Options,\n UnpluginBuilderVariant,\n UnpluginOptions\n} from \"@powerlines/core\";\nimport {\n formatFolder,\n handleTypes,\n initializeTsconfig,\n installDependencies,\n isUnpluginBuilderVariant,\n loadParsedConfig,\n resolveRoot,\n resolveTsconfig,\n writeMetaFile\n} from \"@powerlines/core\";\nimport { UNPLUGIN_BUILDER_VARIANTS } from \"@powerlines/core/constants\";\nimport { PowerlinesExecutionContext } from \"@powerlines/core/context/execution-context\";\nimport { resolvePluginConfig } from \"@powerlines/core/lib/context-helpers\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { getString } from \"@powerlines/core/lib/utilities/source-file\";\nimport {\n addVirtualPrefix,\n formatConfig,\n formatExecutionId,\n removeVirtualPrefix,\n VIRTUAL_MODULE_PREFIX_REGEX\n} from \"@powerlines/core/plugin-utils\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getWorkspaceRoot } from \"@stryke/fs/get-workspace-root\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\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 { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { LoadResult } from \"rolldown\";\nimport type {\n TransformResult,\n UnpluginBuildContext,\n UnpluginContext\n} from \"unplugin\";\nimport { UnpluginFactory } from \"./types\";\n\nexport * from \"@powerlines/core/lib/unplugin\";\n\n/**\n * The options required to create a Powerlines unplugin factory, which generates a plugin instance for a specific build variant and allows for optional customization of logging and framework identification.\n */\nexport interface UnpluginFactoryOptions extends Options {\n /**\n * The build variant for which to create the unplugin.\n *\n * @remarks\n * This option is required to ensure that the unplugin is built with the correct configuration and behavior for the intended build tool or framework. The variant will determine how the unplugin integrates with the build process and which hooks it will call during execution.\n */\n variant: UnpluginBuilderVariant;\n\n /**\n * An optional string prefix to use for virtual module IDs. This can be useful for ensuring that virtual modules are only processed by the plugin and not by other plugins or the bundler itself. If not provided, the default prefix `__powerlines-virtual:` will be used.\n *\n * @defaultValue \"\\\\0\"\n */\n virtualModulePrefix?: string | false;\n\n /**\n * A custom logger instance that implements the {@link CustomLogger} interface, which can be used for logging messages during the build process instead of the default Powerlines logger.\n *\n * @remarks\n * Providing a custom logger allows you to integrate Powerlines logging with your own logging system or to customize the logging behavior, such as formatting log messages differently or sending logs to an external service. If a custom logger is not provided, Powerlines will use its default logger implementation.\n */\n customLogger?: CustomLogger;\n}\n\nexport type UnpluginFactoryDecorator<TContext extends ExecutionContext> = (\n options: UnpluginOptions<TContext>\n) => Partial<UnpluginOptions<TContext>>;\n\n/**\n * Creates a Powerlines unplugin factory that generates a plugin instance.\n *\n * @remarks\n * The factory will handle loading the Powerlines configuration, resolving the plugin configuration, and executing the appropriate hooks during the build process. It also allows for optional customization of logging and framework identification through the provided options.\n *\n * @example\n * ```ts\n * import { createUnpluginFactory } from \"@powerlines/unplugin\";\n *\n * const factory = createUnpluginFactory({\n * variant: \"vite\",\n * framework: \"my-framework\",\n * orgId: \"my-org\",\n * customLogger: myCustomLogger\n * });\n *\n * const plugin = createVitePlugin(factory);\n * export default plugin;\n * ```\n *\n * @param options - The options for the unplugin factory, including the build variant and an optional custom logger.\n * @param decorate - An optional function to decorate the unplugin options.\n * @returns The unplugin factory that generates a plugin instance.\n */\nexport function createUnpluginFactory<\n TContext extends ExecutionContext = ExecutionContext\n>(\n options: UnpluginFactoryOptions,\n decorate: UnpluginFactoryDecorator<TContext> = options => options\n): UnpluginFactory<TContext> {\n if (!isUnpluginBuilderVariant(options.variant)) {\n throw new Error(\n `Invalid unplugin builder variant: ${String(options.variant)}. Expected one of: ${UNPLUGIN_BUILDER_VARIANTS.join(\n \", \"\n )}.`\n );\n }\n\n const cwd = getWorkspaceRoot(process.cwd());\n const virtualModulePrefix = options.virtualModulePrefix ?? \"\\\\0\";\n\n return (params = {}): UnpluginOptions<TContext> => {\n let context!: ExecutionContext<TContext[\"config\"], TContext[\"system\"]>;\n try {\n const framework =\n (params.framework?.name ?? options.framework?.name) || \"powerlines\";\n const orgId =\n (params.framework?.orgId ?? options.framework?.orgId) ||\n \"storm-software\";\n\n const root = resolveRoot(cwd, params.root, params.configFile);\n\n async function buildStart(this: UnpluginBuildContext): Promise<void> {\n const config = await loadParsedConfig(cwd, root, framework, orgId, {\n ...params,\n command: \"build\"\n });\n if (!config) {\n throw new Error(\"Failed to load configuration\");\n }\n\n const configs = toArray(config.config);\n if (\n params.configIndex !== undefined &&\n params.configIndex >= configs.length\n ) {\n throw new Error(\n `Invalid execution index: ${params.configIndex}. The configuration file contains ${configs.length} execution(s).`\n );\n }\n\n const _options = {\n cwd,\n root,\n ...params,\n command: \"build\",\n configFile: config.configFile!,\n executionId: formatExecutionId(\n config.config.name || root,\n \"build\",\n 0\n ),\n configIndex: 0\n };\n\n context = await PowerlinesExecutionContext.from(\n {\n ...options,\n ..._options,\n configFile: config.configFile!\n },\n _options\n );\n context.logger.info(\n `Starting ${titleCase(framework)} ${titleCase(options.variant)} plugin execution`\n );\n\n context.logger.debug({\n meta: { category: \"config\" },\n message: `Invoking ${titleCase(framework)} ${titleCase(\n options.variant\n )} plugin with the following execution parameters: \\n --- Execution Options --- \\n${formatConfig(\n params\n )}`\n });\n\n await resolvePluginConfig(context);\n\n const timer = context.timer(\"Preparation\");\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n const entriesLength = isObject(env.config.input)\n ? Object.keys(env.config.input).length\n : toArray(env.config.input).length;\n env.debug(\n `The configuration provided ${entriesLength} entry point${\n entriesLength !== 1 ? \"s\" : \"\"\n }, Powerlines has found ${env.entry.length} entry file${\n env.entry.length !== 1 ? \"s\" : \"\"\n } for the ${env.config.title} project${\n env.entry.length > 0 && env.entry.length < 10\n ? `: \\n${env.entry\n .map(\n entry =>\n `- ${replacePath(entry.file, context.config.root)}${\n entry.output\n ? ` -> ${replacePath(\n entry.output,\n context.config.root\n )}`\n : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n env.warn(\n `No entry files were found for the ${\n env.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig(env);\n await installDependencies(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"post\"\n });\n\n env.trace({\n meta: {\n category: \"config\"\n },\n message: `Powerlines configuration after configResolved hook: \\n${formatConfig(\n env.config\n )}`\n });\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"pre\"\n });\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"normal\"\n });\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"post\"\n });\n\n if (env.config.output.types !== false) {\n await handleTypes(context, env);\n }\n\n context.debug(\"Formatting files generated during the prepare step.\");\n\n await Promise.all([\n formatFolder(env, env.builtinsPath),\n formatFolder(env, env.entryPath)\n ]);\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n }\n\n async function resolveId(\n this: UnpluginBuildContext & UnpluginContext,\n id: string,\n importer?: string,\n opts: {\n isEntry: boolean;\n } = { isEntry: false }\n ) {\n const normalizedId = removeVirtualPrefix(id);\n const normalizedImporter = importer\n ? removeVirtualPrefix(importer)\n : undefined;\n\n let result = await context.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && virtualModulePrefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await context.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && virtualModulePrefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await context.resolve(normalizedId, normalizedImporter, {\n isFile: true,\n ...opts\n });\n if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && virtualModulePrefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await context.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && virtualModulePrefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n return null;\n }\n\n const load = {\n filter:\n virtualModulePrefix !== false\n ? {\n id: VIRTUAL_MODULE_PREFIX_REGEX\n }\n : undefined,\n async handler(\n this: UnpluginBuildContext & UnpluginContext,\n id: string\n ): Promise<LoadResult | null | undefined> {\n const normalizedId = removeVirtualPrefix(id);\n\n let result = await context.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await context.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await context.load(normalizedId);\n if (result) {\n return result;\n }\n\n return context.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId\n );\n }\n } as UnpluginOptions<TContext>[\"load\"];\n\n async function transform(\n code: string,\n id: string\n ): Promise<TransformResult> {\n return context.callHook(\n \"transform\",\n {\n environment: await context.getEnvironment(),\n result: \"merge\",\n asNextParam: previousResult => getString(previousResult)\n },\n getString(code),\n id\n );\n }\n\n async function writeBundle(): Promise<void> {\n context.logger.debug(\"Finalizing Powerlines project output...\");\n\n await context.callHook(\"writeBundle\", {\n environment: await context.getEnvironment()\n });\n }\n\n context.logger.debug(\"Unplugin initialized successfully.\");\n\n const result = {\n name: `${kebabCase(framework)}:${kebabCase(options.variant)}-plugin`,\n context,\n resolveId,\n load,\n transform,\n buildStart,\n writeBundle\n } as unknown as UnpluginOptions<TContext>;\n\n return {\n ...result,\n ...decorate(result)\n };\n } catch (error) {\n if (isFunction(context?.logger?.error)) {\n context.logger.error((error as Error)?.message);\n }\n\n throw error;\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,SAAgB,sBAGd,SACA,YAA+C,YAAW,SAC/B;CAC3B,IAAI,CAAC,yBAAyB,QAAQ,OAAO,GAC3C,MAAM,IAAI,MACR,qCAAqC,OAAO,QAAQ,OAAO,EAAE,qBAAqB,0BAA0B,KAC1G,IACF,EAAE,EACJ;CAGF,MAAM,MAAM,iBAAiB,QAAQ,IAAI,CAAC;CAC1C,MAAM,sBAAsB,QAAQ,uBAAuB;CAE3D,QAAQ,SAAS,CAAC,MAAiC;EACjD,IAAI;EACJ,IAAI;GACF,MAAM,aACH,OAAO,WAAW,QAAQ,QAAQ,WAAW,SAAS;GACzD,MAAM,SACH,OAAO,WAAW,SAAS,QAAQ,WAAW,UAC/C;GAEF,MAAM,OAAO,YAAY,KAAK,OAAO,MAAM,OAAO,UAAU;GAE5D,eAAe,aAAsD;IACnE,MAAM,SAAS,MAAM,iBAAiB,KAAK,MAAM,WAAW,OAAO;KACjE,GAAG;KACH,SAAS;IACX,CAAC;IACD,I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QAAQ;MACR,OAAO;KACT,GACA,YACF;KACA,IAAI,QACF,OAAO;KAGT,SAAS,MAAM,QAAQ,SACrB,QACA;MACE,YAAY;MACZ,QAAQ;MACR,OAAO;KACT,GACA,YACF;KACA,IAAI,QACF,OAAO;KAGT,SAAS,MAAM,QAAQ,KAAK,YAAY;KACxC,IAAI,QACF,OAAO;KAGT,OAAO,QAAQ,SACb,QACA;MACE,YAAY;MACZ,QAAQ;MACR,OAAO;KACT,GACA,YACF;IACF;GACF;GAEA,eAAe,UACb,MACA,IAC0B;IAC1B,OAAO,QAAQ,SACb,aACA;KACE,aAAa,MAAM,QAAQ,eAAe;KAC1C,QAAQ;KACR,cAAa,mBAAkB,UAAU,cAAc;IACzD,GACA,UAAU,IAAI,GACd,EACF;GACF;GAEA,eAAe,cAA6B;IAC1C,QAAQ,OAAO,MAAM,yCAAyC;IAE9D,MAAM,QAAQ,SAAS,eAAe,EACpC,aAAa,MAAM,QAAQ,eAAe,EAC5C,CAAC;GACH;GAEA,QAAQ,OAAO,MAAM,oCAAoC;GAEzD,MAAM,SAAS;IACb,MAAM,GAAG,UAAU,SAAS,EAAE,GAAG,UAAU,QAAQ,OAAO,EAAE;IAC5D;IACA;IACA;IACA;IACA;IACA;GACF;GAEA,OAAO;IACL,GAAG;IACH,GAAG,SAAS,MAAM;GACpB;EACF,SAAS,OAAO;GACd,IAAI,WAAW,SAAS,QAAQ,KAAK,GACnC,QAAQ,OAAO,MAAO,OAAiB,OAAO;GAGhD,MAAM;EACR;CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/unplugin",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "private": false,
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "keywords": [
@@ -105,7 +105,7 @@
105
105
  "typings": "dist/index.d.mts",
106
106
  "files": ["dist"],
107
107
  "dependencies": {
108
- "@powerlines/core": "^0.48.25",
108
+ "@powerlines/core": "^0.48.27",
109
109
  "@rollup/plugin-alias": "^6.0.0",
110
110
  "@rollup/plugin-inject": "^5.0.5",
111
111
  "@rollup/plugin-node-resolve": "^16.0.3",
@@ -167,5 +167,5 @@
167
167
  "webpack": { "optional": true }
168
168
  },
169
169
  "publishConfig": { "access": "public" },
170
- "gitHead": "2a7208605db4b9d25c7e6462fe44deb0284e3b8c"
170
+ "gitHead": "8712f695515d4d33d5bcfe8c460580d83f321c0e"
171
171
  }