@powerlines/unplugin 0.0.75 → 0.0.77

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.
Files changed (114) hide show
  1. package/dist/astro.cjs +0 -8
  2. package/dist/astro.d.mts +0 -2
  3. package/dist/astro.d.mts.map +1 -1
  4. package/dist/astro.mjs +0 -8
  5. package/dist/astro.mjs.map +1 -1
  6. package/dist/{_virtual/_rolldown/runtime.mjs → chunk-BUUfjzRC.mjs} +1 -9
  7. package/dist/esbuild.cjs +2 -11
  8. package/dist/esbuild.d.cts +2 -2
  9. package/dist/esbuild.d.cts.map +1 -1
  10. package/dist/esbuild.d.mts +1 -3
  11. package/dist/esbuild.d.mts.map +1 -1
  12. package/dist/esbuild.mjs +0 -8
  13. package/dist/esbuild.mjs.map +1 -1
  14. package/dist/farm.cjs +1 -9
  15. package/dist/farm.d.cts +2 -2
  16. package/dist/farm.d.cts.map +1 -1
  17. package/dist/farm.d.mts +1 -3
  18. package/dist/farm.d.mts.map +1 -1
  19. package/dist/farm.mjs +0 -8
  20. package/dist/farm.mjs.map +1 -1
  21. package/dist/index.cjs +4 -13
  22. package/dist/index.d.cts +1 -1
  23. package/dist/index.d.mts +0 -2
  24. package/dist/index.d.mts.map +1 -1
  25. package/dist/index.mjs +2 -10
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/next.cjs +0 -8
  28. package/dist/next.d.mts +0 -2
  29. package/dist/next.d.mts.map +1 -1
  30. package/dist/next.mjs +0 -8
  31. package/dist/next.mjs.map +1 -1
  32. package/dist/nuxt-DRZ7K3-X.cjs +52 -0
  33. package/dist/nuxt-Dj7SOTWN.mjs +48 -0
  34. package/dist/nuxt-Dj7SOTWN.mjs.map +1 -0
  35. package/dist/nuxt.cjs +3 -50
  36. package/dist/nuxt.d.mts +0 -2
  37. package/dist/nuxt.d.mts.map +1 -1
  38. package/dist/nuxt.mjs +3 -51
  39. package/dist/rolldown.cjs +5 -14
  40. package/dist/rolldown.d.cts +2 -2
  41. package/dist/rolldown.d.cts.map +1 -1
  42. package/dist/rolldown.d.mts +1 -3
  43. package/dist/rolldown.d.mts.map +1 -1
  44. package/dist/rolldown.mjs +0 -8
  45. package/dist/rolldown.mjs.map +1 -1
  46. package/dist/rollup.cjs +6 -15
  47. package/dist/rollup.d.cts +2 -2
  48. package/dist/rollup.d.cts.map +1 -1
  49. package/dist/rollup.d.mts +1 -3
  50. package/dist/rollup.d.mts.map +1 -1
  51. package/dist/rollup.mjs +0 -8
  52. package/dist/rollup.mjs.map +1 -1
  53. package/dist/rspack.cjs +2 -11
  54. package/dist/rspack.d.cts +2 -2
  55. package/dist/rspack.d.cts.map +1 -1
  56. package/dist/rspack.d.mts +1 -3
  57. package/dist/rspack.d.mts.map +1 -1
  58. package/dist/rspack.mjs +0 -8
  59. package/dist/rspack.mjs.map +1 -1
  60. package/dist/tsdown.cjs +2 -10
  61. package/dist/tsdown.d.cts.map +1 -1
  62. package/dist/tsdown.d.mts +0 -2
  63. package/dist/tsdown.d.mts.map +1 -1
  64. package/dist/tsdown.mjs +0 -8
  65. package/dist/tsdown.mjs.map +1 -1
  66. package/dist/tsup.cjs +2 -10
  67. package/dist/tsup.d.cts.map +1 -1
  68. package/dist/tsup.d.mts +0 -2
  69. package/dist/tsup.d.mts.map +1 -1
  70. package/dist/tsup.mjs +0 -8
  71. package/dist/tsup.mjs.map +1 -1
  72. package/dist/types-CEaXoKbk.d.cts +13 -0
  73. package/dist/types-CEaXoKbk.d.cts.map +1 -0
  74. package/dist/types.cjs +0 -8
  75. package/dist/types.d.cts +2 -11
  76. package/dist/types.d.mts +0 -2
  77. package/dist/types.d.mts.map +1 -1
  78. package/dist/types.mjs +0 -8
  79. package/dist/unloader.cjs +1 -9
  80. package/dist/unloader.d.cts +2 -2
  81. package/dist/unloader.d.cts.map +1 -1
  82. package/dist/unloader.d.mts +1 -3
  83. package/dist/unloader.d.mts.map +1 -1
  84. package/dist/unloader.mjs +0 -8
  85. package/dist/unloader.mjs.map +1 -1
  86. package/dist/unplugin-WjPT9ECw.cjs +296 -0
  87. package/dist/unplugin.cjs +2 -240
  88. package/dist/unplugin.d.cts +1 -1
  89. package/dist/unplugin.d.cts.map +1 -1
  90. package/dist/unplugin.d.mts +0 -2
  91. package/dist/unplugin.d.mts.map +1 -1
  92. package/dist/unplugin.mjs +1 -9
  93. package/dist/unplugin.mjs.map +1 -1
  94. package/dist/vite.cjs +2 -11
  95. package/dist/vite.d.cts +2 -2
  96. package/dist/vite.d.cts.map +1 -1
  97. package/dist/vite.d.mts +1 -3
  98. package/dist/vite.d.mts.map +1 -1
  99. package/dist/vite.mjs +0 -8
  100. package/dist/vite.mjs.map +1 -1
  101. package/dist/webpack.cjs +2 -11
  102. package/dist/webpack.d.cts +2 -2
  103. package/dist/webpack.d.cts.map +1 -1
  104. package/dist/webpack.d.mts +1 -3
  105. package/dist/webpack.d.mts.map +1 -1
  106. package/dist/webpack.mjs +0 -8
  107. package/dist/webpack.mjs.map +1 -1
  108. package/package.json +13 -13
  109. package/dist/_virtual/_rolldown/runtime.cjs +0 -53
  110. package/dist/nuxt.mjs.map +0 -1
  111. package/dist/package.cjs +0 -26
  112. package/dist/package.mjs +0 -15
  113. package/dist/package.mjs.map +0 -1
  114. package/dist/types.d.cts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tsdown.mjs","names":["_getDependencyConfig","rolldown"],"sources":["../src/tsdown.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 CopyConfig,\n ResolveConfig,\n UnresolvedContext\n} from \"@powerlines/core\";\nimport type { GetDependencyConfigResult } from \"@powerlines/core/plugin-utils\";\nimport { getDependencyConfig as _getDependencyConfig } from \"@powerlines/core/plugin-utils\";\nimport type { Format } from \"@storm-software/build-tools/types\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { relativePath } from \"@stryke/path/file-path-fns\";\nimport { globToRegex } from \"@stryke/path/glob-to-regex\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\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 defu from \"defu\";\nimport { ModuleFormat } from \"rolldown\";\nimport { UserConfig as BuildOptions, Format as TsdownFormat } from \"tsdown\";\nimport type { UserConfig } from \"tsdown/config\";\nimport rolldown from \"./rolldown\";\nimport { UnpluginExecutionOptions } from \"./types\";\n\n/**\n * Get the {@link ResolveConfig.external | external} and {@link ResolveConfig.noExternal | noExternal} dependencies for the build configuration.\n *\n * @param context - The build context.\n * @returns The dependency configuration.\n */\nexport function getDependencyConfig<TContext extends UnresolvedContext>(\n context: TContext\n): GetDependencyConfigResult {\n const { external, noExternal } = _getDependencyConfig(context);\n\n return {\n external:\n !external || external.length === 0\n ? undefined\n : external.map(ext =>\n isSetString(ext) && ext.includes(\"*\") ? globToRegex(ext) : ext\n ),\n noExternal:\n !noExternal || noExternal.length === 0\n ? undefined\n : noExternal.map(noExt =>\n isSetString(noExt) && noExt.includes(\"*\")\n ? globToRegex(noExt)\n : noExt\n )\n };\n}\n\nexport const DEFAULT_OPTIONS: Partial<BuildOptions> = {\n platform: \"neutral\",\n target: \"esnext\",\n fixedExtension: true,\n clean: false\n} as const;\n\n/**\n * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param formats - The formats to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveFormat(formats?: Format | Format[]): TsdownFormat[] {\n return toArray(formats).map(format => {\n switch (format) {\n case \"cjs\":\n return \"cjs\";\n case \"iife\":\n return \"iife\";\n case \"esm\":\n default:\n return \"esm\";\n }\n });\n}\n\n/**\n * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param formats - The formats to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveFromFormat(\n formats?: TsdownFormat | TsdownFormat[]\n): Format[] {\n return toArray(formats).map(format => {\n switch (format) {\n case \"cjs\":\n case \"commonjs\":\n return \"cjs\";\n case \"iife\":\n return \"iife\";\n case \"esm\":\n case \"es\":\n case \"module\":\n case \"umd\":\n default:\n return \"esm\";\n }\n });\n}\n\nconst formatMessage = <TContext extends UnresolvedContext>(\n context: TContext,\n ...msgs: any[]\n) =>\n msgs\n .filter(Boolean)\n .join(\" \")\n .trim()\n .replace(new RegExp(`\\\\[${context.config.name}\\\\]`, \"g\"), \"\")\n .replaceAll(/^\\s+/g, \"\")\n .replaceAll(/\\s+$/g, \"\")\n .trim();\n\n/**\n * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions<TContext extends UnresolvedContext>(\n context: TContext\n): BuildOptions {\n const { external, noExternal } = getDependencyConfig(context);\n\n return defu(\n {\n name: context.config.name,\n cwd: appendPath(context.config.root, context.config.cwd),\n entry:\n context.entry.filter(entry => entry?.file).length > 0\n ? Object.fromEntries(\n context.entry\n .filter(entry => entry?.file)\n .map(entry => [\n entry.output ||\n replaceExtension(\n replacePath(\n replacePath(\n entry.file,\n joinPaths(context.config.root, \"src\")\n ),\n context.entryPath\n )\n ),\n entry.file\n ])\n )\n : [\n joinPaths(\n context.config.cwd,\n context.config.root,\n \"src\",\n \"**/*.ts\"\n ),\n joinPaths(\n context.config.cwd,\n context.config.root,\n \"src\",\n \"**/*.tsx\"\n )\n ],\n exports: {\n customExports: (exports: Record<string, any>) => {\n const result = Object.fromEntries(\n Object.entries(exports).map(([key, value]) => {\n if (isSetString(value)) {\n return [key, value];\n }\n\n const currentExport = {} as Record<string, any>;\n if (isSetString(value.require)) {\n currentExport.require = {\n types: replaceExtension(value.require, \".d.cts\", {\n fullExtension: true\n }),\n default: value.require\n };\n }\n\n if (isSetString(value.import)) {\n currentExport.import = {\n types: replaceExtension(value.import, \".d.mts\", {\n fullExtension: true\n }),\n default: value.import\n };\n }\n\n if (!isSetObject(value.default)) {\n if (isSetObject(currentExport.import)) {\n currentExport.default = currentExport.import;\n } else if (isSetObject(currentExport.require)) {\n currentExport.default = currentExport.require;\n }\n }\n\n return [key, currentExport];\n })\n );\n\n return Object.keys(result)\n .sort()\n .reduce(\n (ret, key) => {\n ret[key] = result[key];\n return ret;\n },\n {} as Record<string, any>\n );\n }\n },\n define: context.config.define,\n inputOptions: {\n transform: {\n define: context.config.define,\n inject: context.config.inject,\n typescript: {\n target: context.tsconfig.tsconfigJson?.compilerOptions?.target\n }\n }\n },\n deps: {\n neverBundle: external,\n alwaysBundle: context.config.resolve.skipNodeModulesBundle\n ? undefined\n : noExternal,\n onlyBundle: context.config.resolve.skipNodeModulesBundle\n ? noExternal\n : undefined,\n skipNodeModulesBundle: context.config.resolve.skipNodeModulesBundle\n },\n alias: context.alias,\n resolve: {\n alias: context.alias\n },\n platform: context.config.platform,\n dts: context.config.output.dts,\n outDir: relativePath(\n appendPath(context.config.root, context.config.cwd),\n context.config.output.path\n ),\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.config.cwd\n ),\n format: resolveFormat(context.config.output.format).filter(Boolean),\n mode: context.config.mode,\n minify: context.config.output.minify,\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.output.sourceMap,\n nodeProtocol: context.config.output.nodeProtocol,\n debug: context.config.mode === \"development\",\n silent:\n context.config.logLevel.general === \"silent\" ||\n context.config.mode === \"production\",\n logLevel: context.config.logLevel.general === \"trace\" ? \"debug\" : \"error\",\n customLogger: {\n level: context.config.logLevel.general === \"trace\" ? \"debug\" : \"error\",\n info: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.trace(formatMessage(context, ...msgs)),\n warn: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.warn(formatMessage(context, ...msgs)),\n warnOnce: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.warn(formatMessage(context, ...msgs)),\n error: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.error(formatMessage(context, ...msgs)),\n success: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.trace(formatMessage(context, ...msgs))\n }\n },\n DEFAULT_OPTIONS\n ) as BuildOptions;\n}\n\n/**\n * A Tsdown configuration function that integrates Powerlines into the build process.\n *\n * @see https://github.com/rolldown/tsdown\n *\n * @example\n * ```ts\n * // tsdown.config.ts\n * import withPowerlines from \"@powerlines/unplugin/tsdown\";\n *\n * export default withPowerlines({\n * entry: [\"src/index.ts\"],\n * format: [\"cjs\", \"esm\"],\n * dts: true,\n * sourcemap: true,\n * clean: true,\n * });\n *\n * ```\n *\n * @param options - The Tsdown options to merge with the Powerlines configuration.\n * @returns The merged Tsdown configuration options.\n */\nexport function plugin(options: UserConfig = {}): UserConfig {\n return {\n ...options,\n entry: options.entry,\n plugins: [\n rolldown({\n ...options,\n output: {\n path: options.outDir,\n format: resolveFromFormat(\n options.format as ModuleFormat | ModuleFormat[]\n ),\n copy: {\n path: options.outDir!,\n assets: toArray(options.copy)\n .map(copy => {\n if (!copy) {\n return undefined;\n }\n if (isSetString(copy)) {\n return copy;\n }\n if (isFunction(copy)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Function-based copy options are not supported in Powerlines.\"\n );\n return undefined;\n }\n return {\n input: copy.from,\n output: copy.to\n };\n })\n .filter(Boolean) as CopyConfig[\"assets\"]\n }\n },\n resolve: {\n external: options.deps?.neverBundle\n ? (toArray(options.deps?.neverBundle)\n .map(external => {\n if (isFunction(external)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Function-based external options are not supported in Powerlines.\"\n );\n return undefined;\n }\n return external;\n })\n .filter(Boolean) as ResolveConfig[\"external\"])\n : undefined,\n noExternal:\n (options.deps?.skipNodeModulesBundle && options.deps?.onlyBundle) ||\n (!options.deps?.skipNodeModulesBundle && options.deps?.alwaysBundle)\n ? (toArray(\n options.deps?.skipNodeModulesBundle\n ? options.deps?.onlyBundle\n : options.deps?.alwaysBundle\n )\n .map(noExternal => {\n if (isFunction(noExternal)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Function-based noExternal options are not supported in Powerlines.\"\n );\n return undefined;\n }\n return noExternal;\n })\n .filter(Boolean) as ResolveConfig[\"noExternal\"])\n : undefined\n },\n tsconfig: isSetString(options.tsconfig) ? options.tsconfig : undefined\n } as UnpluginExecutionOptions)\n ]\n };\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,oBACd,SAC2B;CAC3B,MAAM,EAAE,UAAU,eAAeA,sBAAqB,OAAO;CAE7D,OAAO;EACL,UACE,CAAC,YAAY,SAAS,WAAW,IAC7B,SACA,SAAS,KAAI,QACX,YAAY,GAAG,KAAK,IAAI,SAAS,GAAG,IAAI,YAAY,GAAG,IAAI,GAC7D;EACN,YACE,CAAC,cAAc,WAAW,WAAW,IACjC,SACA,WAAW,KAAI,UACb,YAAY,KAAK,KAAK,MAAM,SAAS,GAAG,IACpC,YAAY,KAAK,IACjB,KACN;CACR;AACF;AAEA,MAAa,kBAAyC;CACpD,UAAU;CACV,QAAQ;CACR,gBAAgB;CAChB,OAAO;AACT;;;;;;;AAQA,SAAgB,cAAc,SAA6C;CACzE,OAAO,QAAQ,OAAO,EAAE,KAAI,WAAU;EACpC,QAAQ,QAAR;GACE,K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;IACN,MAAM,QAAQ;IACd,QAAQ,kBACN,QAAQ,MACV;IACA,MAAM;KACJ,MAAM,QAAQ;KACd,QAAQ,QAAQ,QAAQ,IAAI,EACzB,KAAI,SAAQ;MACX,IAAI,CAAC,MACH;MAEF,IAAI,YAAY,IAAI,GAClB,OAAO;MAET,IAAI,WAAW,IAAI,GAAG;OAEpB,QAAQ,KACN,8DACF;OACA;MACF;MACA,OAAO;OACL,OAAO,KAAK;OACZ,QAAQ,KAAK;MACf;KACF,CAAC,EACA,OAAO,OAAO;IACnB;GACF;GACA,SAAS;IACP,UAAU,QAAQ,MAAM,cACnB,QAAQ,QAAQ,MAAM,WAAW,EAC/B,KAAI,aAAY;KACf,IAAI,WAAW,QAAQ,GAAG;MAExB,QAAQ,KACN,kEACF;MACA;KACF;KACA,OAAO;IACT,CAAC,EACA,OAAO,OAAO,IACjB;IACJ,YACG,QAAQ,MAAM,yBAAyB,QAAQ,MAAM,cACrD,CAAC,QAAQ,MAAM,yBAAyB,QAAQ,MAAM,eAClD,QACC,QAAQ,MAAM,wBACV,QAAQ,MAAM,aACd,QAAQ,MAAM,YACpB,EACG,KAAI,eAAc;KACjB,IAAI,WAAW,UAAU,GAAG;MAE1B,QAAQ,KACN,oEACF;MACA;KACF;KACA,OAAO;IACT,CAAC,EACA,OAAO,OAAO,IACjB;GACR;GACA,UAAU,YAAY,QAAQ,QAAQ,IAAI,QAAQ,WAAW;EAC/D,CAA6B,CAC/B;CACF;AACF"}
1
+ {"version":3,"file":"tsdown.mjs","names":["_getDependencyConfig","rolldown"],"sources":["../src/tsdown.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 CopyConfig,\n ResolveConfig,\n UnresolvedContext\n} from \"@powerlines/core\";\nimport type { GetDependencyConfigResult } from \"@powerlines/core/plugin-utils\";\nimport { getDependencyConfig as _getDependencyConfig } from \"@powerlines/core/plugin-utils\";\nimport type { Format } from \"@storm-software/build-tools/types\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { relativePath } from \"@stryke/path/file-path-fns\";\nimport { globToRegex } from \"@stryke/path/glob-to-regex\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\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 defu from \"defu\";\nimport { ModuleFormat } from \"rolldown\";\nimport { UserConfig as BuildOptions, Format as TsdownFormat } from \"tsdown\";\nimport type { UserConfig } from \"tsdown/config\";\nimport rolldown from \"./rolldown\";\nimport { UnpluginExecutionOptions } from \"./types\";\n\n/**\n * Get the {@link ResolveConfig.external | external} and {@link ResolveConfig.noExternal | noExternal} dependencies for the build configuration.\n *\n * @param context - The build context.\n * @returns The dependency configuration.\n */\nexport function getDependencyConfig<TContext extends UnresolvedContext>(\n context: TContext\n): GetDependencyConfigResult {\n const { external, noExternal } = _getDependencyConfig(context);\n\n return {\n external:\n !external || external.length === 0\n ? undefined\n : external.map(ext =>\n isSetString(ext) && ext.includes(\"*\") ? globToRegex(ext) : ext\n ),\n noExternal:\n !noExternal || noExternal.length === 0\n ? undefined\n : noExternal.map(noExt =>\n isSetString(noExt) && noExt.includes(\"*\")\n ? globToRegex(noExt)\n : noExt\n )\n };\n}\n\nexport const DEFAULT_OPTIONS: Partial<BuildOptions> = {\n platform: \"neutral\",\n target: \"esnext\",\n fixedExtension: true,\n clean: false\n} as const;\n\n/**\n * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param formats - The formats to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveFormat(formats?: Format | Format[]): TsdownFormat[] {\n return toArray(formats).map(format => {\n switch (format) {\n case \"cjs\":\n return \"cjs\";\n case \"iife\":\n return \"iife\";\n case \"esm\":\n default:\n return \"esm\";\n }\n });\n}\n\n/**\n * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param formats - The formats to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveFromFormat(\n formats?: TsdownFormat | TsdownFormat[]\n): Format[] {\n return toArray(formats).map(format => {\n switch (format) {\n case \"cjs\":\n case \"commonjs\":\n return \"cjs\";\n case \"iife\":\n return \"iife\";\n case \"esm\":\n case \"es\":\n case \"module\":\n case \"umd\":\n default:\n return \"esm\";\n }\n });\n}\n\nconst formatMessage = <TContext extends UnresolvedContext>(\n context: TContext,\n ...msgs: any[]\n) =>\n msgs\n .filter(Boolean)\n .join(\" \")\n .trim()\n .replace(new RegExp(`\\\\[${context.config.name}\\\\]`, \"g\"), \"\")\n .replaceAll(/^\\s+/g, \"\")\n .replaceAll(/\\s+$/g, \"\")\n .trim();\n\n/**\n * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions<TContext extends UnresolvedContext>(\n context: TContext\n): BuildOptions {\n const { external, noExternal } = getDependencyConfig(context);\n\n return defu(\n {\n name: context.config.name,\n cwd: appendPath(context.config.root, context.config.cwd),\n entry:\n context.entry.filter(entry => entry?.file).length > 0\n ? Object.fromEntries(\n context.entry\n .filter(entry => entry?.file)\n .map(entry => [\n entry.output ||\n replaceExtension(\n replacePath(\n replacePath(\n entry.file,\n joinPaths(context.config.root, \"src\")\n ),\n context.entryPath\n )\n ),\n entry.file\n ])\n )\n : [\n joinPaths(\n context.config.cwd,\n context.config.root,\n \"src\",\n \"**/*.ts\"\n ),\n joinPaths(\n context.config.cwd,\n context.config.root,\n \"src\",\n \"**/*.tsx\"\n )\n ],\n exports: {\n customExports: (exports: Record<string, any>) => {\n const result = Object.fromEntries(\n Object.entries(exports).map(([key, value]) => {\n if (isSetString(value)) {\n return [key, value];\n }\n\n const currentExport = {} as Record<string, any>;\n if (isSetString(value.require)) {\n currentExport.require = {\n types: replaceExtension(value.require, \".d.cts\", {\n fullExtension: true\n }),\n default: value.require\n };\n }\n\n if (isSetString(value.import)) {\n currentExport.import = {\n types: replaceExtension(value.import, \".d.mts\", {\n fullExtension: true\n }),\n default: value.import\n };\n }\n\n if (!isSetObject(value.default)) {\n if (isSetObject(currentExport.import)) {\n currentExport.default = currentExport.import;\n } else if (isSetObject(currentExport.require)) {\n currentExport.default = currentExport.require;\n }\n }\n\n return [key, currentExport];\n })\n );\n\n return Object.keys(result)\n .sort()\n .reduce(\n (ret, key) => {\n ret[key] = result[key];\n return ret;\n },\n {} as Record<string, any>\n );\n }\n },\n define: context.config.define,\n inputOptions: {\n transform: {\n define: context.config.define,\n inject: context.config.inject,\n typescript: {\n target: context.tsconfig.tsconfigJson?.compilerOptions?.target\n }\n }\n },\n deps: {\n neverBundle: external,\n alwaysBundle: context.config.resolve.skipNodeModulesBundle\n ? undefined\n : noExternal,\n onlyBundle: context.config.resolve.skipNodeModulesBundle\n ? noExternal\n : undefined,\n skipNodeModulesBundle: context.config.resolve.skipNodeModulesBundle\n },\n alias: context.alias,\n resolve: {\n alias: context.alias\n },\n platform: context.config.platform,\n dts: context.config.output.dts,\n outDir: relativePath(\n appendPath(context.config.root, context.config.cwd),\n context.config.output.path\n ),\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.config.cwd\n ),\n format: resolveFormat(context.config.output.format).filter(Boolean),\n mode: context.config.mode,\n minify: context.config.output.minify,\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.output.sourceMap,\n nodeProtocol: context.config.output.nodeProtocol,\n debug: context.config.mode === \"development\",\n silent:\n context.config.logLevel.general === \"silent\" ||\n context.config.mode === \"production\",\n logLevel: context.config.logLevel.general === \"trace\" ? \"debug\" : \"error\",\n customLogger: {\n level: context.config.logLevel.general === \"trace\" ? \"debug\" : \"error\",\n info: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.trace(formatMessage(context, ...msgs)),\n warn: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.warn(formatMessage(context, ...msgs)),\n warnOnce: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.warn(formatMessage(context, ...msgs)),\n error: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.error(formatMessage(context, ...msgs)),\n success: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.trace(formatMessage(context, ...msgs))\n }\n },\n DEFAULT_OPTIONS\n ) as BuildOptions;\n}\n\n/**\n * A Tsdown configuration function that integrates Powerlines into the build process.\n *\n * @see https://github.com/rolldown/tsdown\n *\n * @example\n * ```ts\n * // tsdown.config.ts\n * import withPowerlines from \"@powerlines/unplugin/tsdown\";\n *\n * export default withPowerlines({\n * entry: [\"src/index.ts\"],\n * format: [\"cjs\", \"esm\"],\n * dts: true,\n * sourcemap: true,\n * clean: true,\n * });\n *\n * ```\n *\n * @param options - The Tsdown options to merge with the Powerlines configuration.\n * @returns The merged Tsdown configuration options.\n */\nexport function plugin(options: UserConfig = {}): UserConfig {\n return {\n ...options,\n entry: options.entry,\n plugins: [\n rolldown({\n ...options,\n output: {\n path: options.outDir,\n format: resolveFromFormat(\n options.format as ModuleFormat | ModuleFormat[]\n ),\n copy: {\n path: options.outDir!,\n assets: toArray(options.copy)\n .map(copy => {\n if (!copy) {\n return undefined;\n }\n if (isSetString(copy)) {\n return copy;\n }\n if (isFunction(copy)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Function-based copy options are not supported in Powerlines.\"\n );\n return undefined;\n }\n return {\n input: copy.from,\n output: copy.to\n };\n })\n .filter(Boolean) as CopyConfig[\"assets\"]\n }\n },\n resolve: {\n external: options.deps?.neverBundle\n ? (toArray(options.deps?.neverBundle)\n .map(external => {\n if (isFunction(external)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Function-based external options are not supported in Powerlines.\"\n );\n return undefined;\n }\n return external;\n })\n .filter(Boolean) as ResolveConfig[\"external\"])\n : undefined,\n noExternal:\n (options.deps?.skipNodeModulesBundle && options.deps?.onlyBundle) ||\n (!options.deps?.skipNodeModulesBundle && options.deps?.alwaysBundle)\n ? (toArray(\n options.deps?.skipNodeModulesBundle\n ? options.deps?.onlyBundle\n : options.deps?.alwaysBundle\n )\n .map(noExternal => {\n if (isFunction(noExternal)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Function-based noExternal options are not supported in Powerlines.\"\n );\n return undefined;\n }\n return noExternal;\n })\n .filter(Boolean) as ResolveConfig[\"noExternal\"])\n : undefined\n },\n tsconfig: isSetString(options.tsconfig) ? options.tsconfig : undefined\n } as UnpluginExecutionOptions)\n ]\n };\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,oBACd,SAC2B;CAC3B,MAAM,EAAE,UAAU,eAAeA,sBAAqB,OAAO;CAE7D,OAAO;EACL,UACE,CAAC,YAAY,SAAS,WAAW,IAC7B,SACA,SAAS,KAAI,QACX,YAAY,GAAG,KAAK,IAAI,SAAS,GAAG,IAAI,YAAY,GAAG,IAAI,GAC7D;EACN,YACE,CAAC,cAAc,WAAW,WAAW,IACjC,SACA,WAAW,KAAI,UACb,YAAY,KAAK,KAAK,MAAM,SAAS,GAAG,IACpC,YAAY,KAAK,IACjB,KACN;CACR;AACF;AAEA,MAAa,kBAAyC;CACpD,UAAU;CACV,QAAQ;CACR,gBAAgB;CAChB,OAAO;AACT;;;;;;;AA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,GAAe;CAC3D,OAAO;EACL,GAAG;EACH,OAAO,QAAQ;EACf,SAAS,CACPC,SAAS;GACP,GAAG;GACH,QAAQ;IACN,MAAM,QAAQ;IACd,QAAQ,kBACN,QAAQ,MACV;IACA,MAAM;KACJ,MAAM,QAAQ;KACd,QAAQ,QAAQ,QAAQ,IAAI,EACzB,KAAI,SAAQ;MACX,IAAI,CAAC,MACH;MAEF,IAAI,YAAY,IAAI,GAClB,OAAO;MAET,IAAI,WAAW,IAAI,GAAG;OAEpB,QAAQ,KACN,8DACF;OACA;MACF;MACA,OAAO;OACL,OAAO,KAAK;OACZ,QAAQ,KAAK;MACf;KACF,CAAC,EACA,OAAO,OAAO;IACnB;GACF;GACA,SAAS;IACP,UAAU,QAAQ,MAAM,cACnB,QAAQ,QAAQ,MAAM,WAAW,EAC/B,KAAI,aAAY;KACf,IAAI,WAAW,QAAQ,GAAG;MAExB,QAAQ,KACN,kEACF;MACA;KACF;KACA,OAAO;IACT,CAAC,EACA,OAAO,OAAO,IACjB;IACJ,YACG,QAAQ,MAAM,yBAAyB,QAAQ,MAAM,cACrD,CAAC,QAAQ,MAAM,yBAAyB,QAAQ,MAAM,eAClD,QACC,QAAQ,MAAM,wBACV,QAAQ,MAAM,aACd,QAAQ,MAAM,YACpB,EACG,KAAI,eAAc;KACjB,IAAI,WAAW,UAAU,GAAG;MAE1B,QAAQ,KACN,oEACF;MACA;KACF;KACA,OAAO;IACT,CAAC,EACA,OAAO,OAAO,IACjB;GACR;GACA,UAAU,YAAY,QAAQ,QAAQ,IAAI,QAAQ,WAAW;EAC/D,CAA6B,CAC/B;CACF;AACF"}
package/dist/tsup.cjs CHANGED
@@ -1,18 +1,10 @@
1
-
2
-
3
- import __tsdown_shims_path from 'node:path'
4
- import __tsdown_shims_url from 'node:url'
5
-
6
- const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
- const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
-
9
1
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
10
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
+ const require_unplugin = require('./unplugin-WjPT9ECw.cjs');
11
3
  const require_esbuild = require('./esbuild.cjs');
12
4
  let _stryke_path_append = require("@stryke/path/append");
13
5
  let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
14
6
  let defu = require("defu");
15
- defu = require_runtime.__toESM(defu, 1);
7
+ defu = require_unplugin.__toESM(defu, 1);
16
8
  let _stryke_convert_to_array = require("@stryke/convert/to-array");
17
9
  let _storm_software_tsup_constants = require("@storm-software/tsup/constants");
18
10
  let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
@@ -1 +1 @@
1
- {"version":3,"file":"tsup.d.cts","names":[],"sources":["../src/tsup.ts"],"mappings":";;;;;;cAiCa,eAAA,EAAiB,OAAO,CAAC,SAAA;;AAAtC;;;;AAA6C;AAwB7C;iBAAgB,YAAA,kBAA8B,iBAAA,CAAA,CAC5C,OAAA,EAAS,QAAA,EACT,WAAA,EAAa,0BAAA,gBACZ,KAAA;;;;;;;iBAca,cAAA,kBAAgC,iBAAA,CAAA,CAC9C,OAAA,EAAS,QAAA,GACR,UAAA,QAAkB,gBAAA;;;;;;;;;AAhBb;AAcR;;;;;;;;;;;;;;iBAwFgB,UAAA,CAAW,OAAA,EAAS,SAAA,GAAU,SAAO"}
1
+ {"version":3,"file":"tsup.d.cts","names":[],"sources":["../src/tsup.ts"],"mappings":";;;;;;cAiCa,eAAA,EAAiB,OAAO,CAAC,SAAA;;AAAtC;;;;AAA6C;AAwB7C;iBAAgB,YAAA,kBAA8B,iBAAA,EAC5C,OAAA,EAAS,QAAA,EACT,WAAA,EAAa,0BAAA,gBACZ,KAAA;;;;;;;iBAca,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,GACR,UAAA,QAAkB,gBAAA;;;;;;;;;AAhBb;AAcR;;;;;;;;;;;;;;iBAwFgB,UAAA,CAAW,OAAA,EAAS,SAAA,GAAU,SAAO"}
package/dist/tsup.d.mts CHANGED
@@ -1,5 +1,3 @@
1
- import __tsdown_shims_path from 'node:path';
2
- import __tsdown_shims_url from 'node:url';
3
1
  import { ResolvedEntryFileReference, UnresolvedContext } from "@powerlines/core";
4
2
  import { Entry } from "@storm-software/build-tools/types";
5
3
  import { resolveOptions as resolveOptions$1 } from "@storm-software/tsup";
@@ -1 +1 @@
1
- {"version":3,"file":"tsup.d.mts","names":[],"sources":["../src/tsup.ts"],"mappings":";;;;;;;;cAiCa,eAAA,EAAiB,OAAO,CAAC,SAAA;;;;;;;;iBAwBtB,YAAA,kBAA8B,iBAAA,CAAA,CAC5C,OAAA,EAAS,QAAA,EACT,WAAA,EAAa,0BAAA,gBACZ,KAAA;;AA3BH;;;;AAA6C;iBAyC7B,cAAA,kBAAgC,iBAAA,CAAA,CAC9C,OAAA,EAAS,QAAA,GACR,UAAA,QAAkB,gBAAA;;;;;;;;;;;;;;;;;AAhBb;AAcR;;;;;;iBAwFgB,UAAA,CAAW,OAAA,EAAS,SAAA,GAAU,SAAO"}
1
+ {"version":3,"file":"tsup.d.mts","names":[],"sources":["../src/tsup.ts"],"mappings":";;;;;;cAiCa,eAAA,EAAiB,OAAO,CAAC,SAAA;;AAAtC;;;;AAA6C;AAwB7C;iBAAgB,YAAA,kBAA8B,iBAAA,EAC5C,OAAA,EAAS,QAAA,EACT,WAAA,EAAa,0BAAA,gBACZ,KAAA;;;;;;;iBAca,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,GACR,UAAA,QAAkB,gBAAA;;;;;;;;;AAhBb;AAcR;;;;;;;;;;;;;;iBAwFgB,UAAA,CAAW,OAAA,EAAS,SAAA,GAAU,SAAO"}
package/dist/tsup.mjs CHANGED
@@ -1,11 +1,3 @@
1
-
2
-
3
- import __tsdown_shims_path from 'node:path'
4
- import __tsdown_shims_url from 'node:url'
5
-
6
- const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
- const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
-
9
1
  import plugin, { resolveEntry as resolveEntry$1 } from "./esbuild.mjs";
10
2
  import { appendPath } from "@stryke/path/append";
11
3
  import { relativePath } from "@stryke/path/file-path-fns";
package/dist/tsup.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tsup.mjs","names":["resolveEsbuildEntry","esbuild"],"sources":["../src/tsup.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n ResolvedEntryFileReference,\n UnresolvedContext\n} from \"@powerlines/core\";\nimport { AssetGlob, Entry } from \"@storm-software/build-tools/types\";\nimport { resolveOptions as resolveOptionsBase } from \"@storm-software/tsup\";\nimport { DEFAULT_BUILD_OPTIONS } from \"@storm-software/tsup/constants\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { relativePath } from \"@stryke/path/file-path-fns\";\nimport defu from \"defu\";\nimport type { Options } from \"tsup\";\nimport esbuild, { resolveEntry as resolveEsbuildEntry } from \"./esbuild\";\n\nexport const DEFAULT_OPTIONS: Partial<Options> = {\n ...DEFAULT_BUILD_OPTIONS,\n target: \"esnext\",\n config: false,\n minify: true,\n sourcemap: false,\n cjsInterop: true,\n bundle: true,\n dts: true,\n shims: true,\n silent: true,\n treeshake: true,\n keepNames: true,\n splitting: true,\n banner: {}\n};\n\n/**\n * Resolves the entry options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @param entryPoints - The entry points to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveEntry<TContext extends UnresolvedContext>(\n context: TContext,\n entryPoints: ResolvedEntryFileReference[] | string[]\n): Entry {\n return resolveEsbuildEntry(context, entryPoints) as Entry;\n}\n\ntype TsupEsbuildOptionsHandler = NonNullable<Options[\"esbuildOptions\"]>;\ntype TsupEsbuildOptionsArgs = Parameters<TsupEsbuildOptionsHandler>;\ntype TsupEsbuildOptions = TsupEsbuildOptionsArgs[0];\n\n/**\n * Resolves the options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions<TContext extends UnresolvedContext>(\n context: TContext\n): Parameters<typeof resolveOptionsBase>[0] {\n const result = defu(\n {\n entry: Object.fromEntries(\n Object.entries(resolveEntry(context, context.entry)).map(\n ([key, value]) => [key, appendPath(value, context.config.root)]\n )\n ),\n esbuildOptions: (options: TsupEsbuildOptions) => {\n options.alias = {\n ...context.alias,\n ...context.builtins.reduce(\n (ret, id) => {\n const path = context.fs.paths[id];\n if (path) {\n ret[id] = path;\n }\n\n return ret;\n },\n {} as Record<string, string>\n ),\n ...options.alias\n };\n },\n noExternal: context.builtins\n },\n {\n name: context.config.name,\n root: context.config.root,\n projectRoot: context.config.root,\n assets: context.config.output.copy\n ? (context.config.output.copy.assets as (string | AssetGlob)[])\n : undefined,\n resolveExtensions: context.config.resolve.extensions,\n outputPath: relativePath(\n appendPath(context.config.root, context.config.cwd),\n context.config.output.path\n ),\n tsconfig: context.tsconfig.tsconfigFilePath,\n dts: {\n compilerOptions: context.tsconfig.tsconfigJson.compilerOptions\n },\n format: context.config.output.format,\n mode: context.config.mode,\n minify: context.config.output.minify,\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.output.sourceMap,\n silent:\n context.config.logLevel.general === \"silent\" ||\n context.config.mode === \"production\",\n verbose:\n context.config.logLevel.general === \"trace\" ||\n context.config.mode === \"development\",\n workspaceConfig: { workspaceRoot: context.config.cwd }\n },\n DEFAULT_OPTIONS\n );\n\n result.format = getUnique(toArray(result.format));\n return result as Parameters<typeof resolveOptionsBase>[0];\n}\n\n/**\n * A Tsup configuration function that integrates Powerlines into the build process.\n *\n * @see https://tsup.egoist.dev/#/config\n *\n * @example\n * ```ts\n * // tsup.config.ts\n * import withPowerlines from \"@powerlines/unplugin/tsup\";\n *\n * export default withPowerlines({\n * entry: [\"src/index.ts\"],\n * format: [\"cjs\", \"esm\"],\n * dts: true,\n * sourcemap: true,\n * clean: true,\n * });\n *\n * ```\n *\n * @param options - The Tsup options to merge with the Powerlines configuration.\n * @returns The merged Tsup configuration options.\n */\nexport function withPlugin(options: Options): Options {\n return {\n ...options,\n esbuildPlugins: [...(options.esbuildPlugins ?? []), esbuild()]\n };\n}\n\nexport default withPlugin;\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCA,MAAa,kBAAoC;CAC/C,GAAG;CACH,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,WAAW;CACX,YAAY;CACZ,QAAQ;CACR,KAAK;CACL,OAAO;CACP,QAAQ;CACR,WAAW;CACX,WAAW;CACX,WAAW;CACX,QAAQ,CAAC;AACX;;;;;;;;AASA,SAAgB,aACd,SACA,aACO;CACP,OAAOA,eAAoB,SAAS,WAAW;AACjD;;;;;;;AAYA,SAAgB,eACd,SAC0C;CAC1C,MAAM,SAAS,KACb;EACE,OAAO,OAAO,YACZ,OAAO,QAAQ,aAAa,SAAS,QAAQ,KAAK,CAAC,EAAE,KAClD,CAAC,KAAK,WAAW,CAAC,KAAK,WAAW,OAAO,QAAQ,OAAO,IAAI,CAAC,CAChE,CACF;EACA,iBAAiB,YAAgC;GAC/C,QAAQ,QAAQ;IACd,GAAG,QAAQ;IACX,GAAG,QAAQ,SAAS,QACjB,KAAK,OAAO;KACX,MAAM,OAAO,QAAQ,GAAG,MAAM;KAC9B,IAAI,MACF,IAAI,MAAM;KAGZ,OAAO;IACT,GACA,CAAC,CACH;IACA,GAAG,QAAQ;GACb;EACF;EACA,YAAY,QAAQ;CACtB,GACA;EACE,MAAM,QAAQ,OAAO;EACrB,MAAM,QAAQ,OAAO;EACrB,aAAa,QAAQ,OAAO;EAC5B,QAAQ,QAAQ,OAAO,OAAO,OACzB,QAAQ,OAAO,OAAO,KAAK,SAC5B;EACJ,mBAAmB,QAAQ,OAAO,QAAQ;EAC1C,YAAY,aACV,WAAW,QAAQ,OAAO,MAAM,QAAQ,OAAO,GAAG,GAClD,QAAQ,OAAO,OAAO,IACxB;EACA,UAAU,QAAQ,SAAS;EAC3B,KAAK,EACH,iBAAiB,QAAQ,SAAS,aAAa,gBACjD;EACA,QAAQ,QAAQ,OAAO,OAAO;EAC9B,MAAM,QAAQ,OAAO;EACrB,QAAQ,QAAQ,OAAO,OAAO;EAC9B,UAAU,QAAQ,OAAO,SAAS;EAClC,WAAW,QAAQ,OAAO,OAAO;EACjC,QACE,QAAQ,OAAO,SAAS,YAAY,YACpC,QAAQ,OAAO,SAAS;EAC1B,SACE,QAAQ,OAAO,SAAS,YAAY,WACpC,QAAQ,OAAO,SAAS;EAC1B,iBAAiB,EAAE,eAAe,QAAQ,OAAO,IAAI;CACvD,GACA,eACF;CAEA,OAAO,SAAS,UAAU,QAAQ,OAAO,MAAM,CAAC;CAChD,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,WAAW,SAA2B;CACpD,OAAO;EACL,GAAG;EACH,gBAAgB,CAAC,GAAI,QAAQ,kBAAkB,CAAC,GAAIC,OAAQ,CAAC;CAC/D;AACF"}
1
+ {"version":3,"file":"tsup.mjs","names":["resolveEsbuildEntry","esbuild"],"sources":["../src/tsup.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n ResolvedEntryFileReference,\n UnresolvedContext\n} from \"@powerlines/core\";\nimport { AssetGlob, Entry } from \"@storm-software/build-tools/types\";\nimport { resolveOptions as resolveOptionsBase } from \"@storm-software/tsup\";\nimport { DEFAULT_BUILD_OPTIONS } from \"@storm-software/tsup/constants\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { relativePath } from \"@stryke/path/file-path-fns\";\nimport defu from \"defu\";\nimport type { Options } from \"tsup\";\nimport esbuild, { resolveEntry as resolveEsbuildEntry } from \"./esbuild\";\n\nexport const DEFAULT_OPTIONS: Partial<Options> = {\n ...DEFAULT_BUILD_OPTIONS,\n target: \"esnext\",\n config: false,\n minify: true,\n sourcemap: false,\n cjsInterop: true,\n bundle: true,\n dts: true,\n shims: true,\n silent: true,\n treeshake: true,\n keepNames: true,\n splitting: true,\n banner: {}\n};\n\n/**\n * Resolves the entry options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @param entryPoints - The entry points to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveEntry<TContext extends UnresolvedContext>(\n context: TContext,\n entryPoints: ResolvedEntryFileReference[] | string[]\n): Entry {\n return resolveEsbuildEntry(context, entryPoints) as Entry;\n}\n\ntype TsupEsbuildOptionsHandler = NonNullable<Options[\"esbuildOptions\"]>;\ntype TsupEsbuildOptionsArgs = Parameters<TsupEsbuildOptionsHandler>;\ntype TsupEsbuildOptions = TsupEsbuildOptionsArgs[0];\n\n/**\n * Resolves the options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions<TContext extends UnresolvedContext>(\n context: TContext\n): Parameters<typeof resolveOptionsBase>[0] {\n const result = defu(\n {\n entry: Object.fromEntries(\n Object.entries(resolveEntry(context, context.entry)).map(\n ([key, value]) => [key, appendPath(value, context.config.root)]\n )\n ),\n esbuildOptions: (options: TsupEsbuildOptions) => {\n options.alias = {\n ...context.alias,\n ...context.builtins.reduce(\n (ret, id) => {\n const path = context.fs.paths[id];\n if (path) {\n ret[id] = path;\n }\n\n return ret;\n },\n {} as Record<string, string>\n ),\n ...options.alias\n };\n },\n noExternal: context.builtins\n },\n {\n name: context.config.name,\n root: context.config.root,\n projectRoot: context.config.root,\n assets: context.config.output.copy\n ? (context.config.output.copy.assets as (string | AssetGlob)[])\n : undefined,\n resolveExtensions: context.config.resolve.extensions,\n outputPath: relativePath(\n appendPath(context.config.root, context.config.cwd),\n context.config.output.path\n ),\n tsconfig: context.tsconfig.tsconfigFilePath,\n dts: {\n compilerOptions: context.tsconfig.tsconfigJson.compilerOptions\n },\n format: context.config.output.format,\n mode: context.config.mode,\n minify: context.config.output.minify,\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.output.sourceMap,\n silent:\n context.config.logLevel.general === \"silent\" ||\n context.config.mode === \"production\",\n verbose:\n context.config.logLevel.general === \"trace\" ||\n context.config.mode === \"development\",\n workspaceConfig: { workspaceRoot: context.config.cwd }\n },\n DEFAULT_OPTIONS\n );\n\n result.format = getUnique(toArray(result.format));\n return result as Parameters<typeof resolveOptionsBase>[0];\n}\n\n/**\n * A Tsup configuration function that integrates Powerlines into the build process.\n *\n * @see https://tsup.egoist.dev/#/config\n *\n * @example\n * ```ts\n * // tsup.config.ts\n * import withPowerlines from \"@powerlines/unplugin/tsup\";\n *\n * export default withPowerlines({\n * entry: [\"src/index.ts\"],\n * format: [\"cjs\", \"esm\"],\n * dts: true,\n * sourcemap: true,\n * clean: true,\n * });\n *\n * ```\n *\n * @param options - The Tsup options to merge with the Powerlines configuration.\n * @returns The merged Tsup configuration options.\n */\nexport function withPlugin(options: Options): Options {\n return {\n ...options,\n esbuildPlugins: [...(options.esbuildPlugins ?? []), esbuild()]\n };\n}\n\nexport default withPlugin;\n"],"mappings":";;;;;;;;;AAiCA,MAAa,kBAAoC;CAC/C,GAAG;CACH,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,WAAW;CACX,YAAY;CACZ,QAAQ;CACR,KAAK;CACL,OAAO;CACP,QAAQ;CACR,WAAW;CACX,WAAW;CACX,WAAW;CACX,QAAQ,CAAC;AACX;;;;;;;;AASA,SAAgB,aACd,SACA,aACO;CACP,OAAOA,eAAoB,SAAS,WAAW;AACjD;;;;;;;AAYA,SAAgB,eACd,SAC0C;CAC1C,MAAM,SAAS,KACb;EACE,OAAO,OAAO,YACZ,OAAO,QAAQ,aAAa,SAAS,QAAQ,KAAK,CAAC,EAAE,KAClD,CAAC,KAAK,WAAW,CAAC,KAAK,WAAW,OAAO,QAAQ,OAAO,IAAI,CAAC,CAChE,CACF;EACA,iBAAiB,YAAgC;GAC/C,QAAQ,QAAQ;IACd,GAAG,QAAQ;IACX,GAAG,QAAQ,SAAS,QACjB,KAAK,OAAO;KACX,MAAM,OAAO,QAAQ,GAAG,MAAM;KAC9B,IAAI,MACF,IAAI,MAAM;KAGZ,OAAO;IACT,GACA,CAAC,CACH;IACA,GAAG,QAAQ;GACb;EACF;EACA,YAAY,QAAQ;CACtB,GACA;EACE,MAAM,QAAQ,OAAO;EACrB,MAAM,QAAQ,OAAO;EACrB,aAAa,QAAQ,OAAO;EAC5B,QAAQ,QAAQ,OAAO,OAAO,OACzB,QAAQ,OAAO,OAAO,KAAK,SAC5B;EACJ,mBAAmB,QAAQ,OAAO,QAAQ;EAC1C,YAAY,aACV,WAAW,QAAQ,OAAO,MAAM,QAAQ,OAAO,GAAG,GAClD,QAAQ,OAAO,OAAO,IACxB;EACA,UAAU,QAAQ,SAAS;EAC3B,KAAK,EACH,iBAAiB,QAAQ,SAAS,aAAa,gBACjD;EACA,QAAQ,QAAQ,OAAO,OAAO;EAC9B,MAAM,QAAQ,OAAO;EACrB,QAAQ,QAAQ,OAAO,OAAO;EAC9B,UAAU,QAAQ,OAAO,SAAS;EAClC,WAAW,QAAQ,OAAO,OAAO;EACjC,QACE,QAAQ,OAAO,SAAS,YAAY,YACpC,QAAQ,OAAO,SAAS;EAC1B,SACE,QAAQ,OAAO,SAAS,YAAY,WACpC,QAAQ,OAAO,SAAS;EAC1B,iBAAiB,EAAE,eAAe,QAAQ,OAAO,IAAI;CACvD,GACA,eACF;CAEA,OAAO,SAAS,UAAU,QAAQ,OAAO,MAAM,CAAC;CAChD,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,WAAW,SAA2B;CACpD,OAAO;EACL,GAAG;EACH,gBAAgB,CAAC,GAAI,QAAQ,kBAAkB,CAAC,GAAIC,OAAQ,CAAC;CAC/D;AACF"}
@@ -0,0 +1,13 @@
1
+ import { BuildInlineConfig, ExecutionContext, ExecutionOptions, UnpluginOptions } from "@powerlines/core";
2
+ import { PartialKeys } from "@stryke/types/base";
3
+ import { UnpluginContextMeta } from "unplugin";
4
+
5
+ //#region \0rolldown/runtime.js
6
+ //#endregion
7
+ //#region src/types.d.ts
8
+ type UnpluginExecutionOptionsBase = Omit<PartialKeys<ExecutionOptions, "cwd" | "configFile" | "framework" | "root" | "configIndex">, "executionId">;
9
+ type UnpluginExecutionOptions = Omit<BuildInlineConfig, "command"> & UnpluginExecutionOptionsBase;
10
+ type UnpluginFactory<TContext extends ExecutionContext> = (options: UnpluginExecutionOptions | undefined, meta: UnpluginContextMeta) => UnpluginOptions<TContext>;
11
+ //#endregion
12
+ export { __reExport as a, __exportAll as i, UnpluginExecutionOptionsBase as n, UnpluginFactory as r, UnpluginExecutionOptions as t };
13
+ //# sourceMappingURL=types-CEaXoKbk.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-CEaXoKbk.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;KA6BY,4BAAA,GAA+B,IAAA,CACzC,WAAA,CACE,gBAAA;AAAA,KAMQ,wBAAA,GAA2B,IAAA,CAAK,iBAAA,eAC1C,4BAAA;AAAA,KAEU,eAAA,kBAAiC,gBAAA,KAC3C,OAAA,EAAS,wBAAA,cACT,IAAA,EAAM,mBAAA,KACH,eAAA,CAAgB,QAAA"}
package/dist/types.cjs CHANGED
@@ -1,8 +0,0 @@
1
-
2
-
3
- import __tsdown_shims_path from 'node:path'
4
- import __tsdown_shims_url from 'node:url'
5
-
6
- const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
- const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
-
package/dist/types.d.cts CHANGED
@@ -1,12 +1,3 @@
1
- import { BuildInlineConfig, ExecutionContext, ExecutionOptions, UnpluginOptions } from "@powerlines/core";
2
- import { PartialKeys } from "@stryke/types/base";
3
- import { UnpluginContextMeta } from "unplugin";
1
+ import { n as UnpluginExecutionOptionsBase, r as UnpluginFactory, t as UnpluginExecutionOptions } from "./types-CEaXoKbk.cjs";
4
2
  export type * from "@powerlines/core/types/unplugin";
5
-
6
- //#region src/types.d.ts
7
- type UnpluginExecutionOptionsBase = Omit<PartialKeys<ExecutionOptions, "cwd" | "configFile" | "framework" | "root" | "configIndex">, "executionId">;
8
- type UnpluginExecutionOptions = Omit<BuildInlineConfig, "command"> & UnpluginExecutionOptionsBase;
9
- type UnpluginFactory<TContext extends ExecutionContext> = (options: UnpluginExecutionOptions | undefined, meta: UnpluginContextMeta) => UnpluginOptions<TContext>;
10
- //#endregion
11
- export { UnpluginExecutionOptions, UnpluginExecutionOptionsBase, UnpluginFactory };
12
- //# sourceMappingURL=types.d.cts.map
3
+ export { UnpluginExecutionOptions, UnpluginExecutionOptionsBase, UnpluginFactory };
package/dist/types.d.mts CHANGED
@@ -1,5 +1,3 @@
1
- import __tsdown_shims_path from 'node:path';
2
- import __tsdown_shims_url from 'node:url';
3
1
  import { UnpluginContextMeta } from "unplugin";
4
2
  import { BuildInlineConfig, ExecutionContext, ExecutionOptions, UnpluginOptions } from "@powerlines/core";
5
3
  import { PartialKeys } from "@stryke/types/base";
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;;KA6BY,4BAAA,GAA+B,IAAA,CACzC,WAAA,CACE,gBAAA;AAAA,KAMQ,wBAAA,GAA2B,IAAA,CAAK,iBAAA,eAC1C,4BAAA;AAAA,KAEU,eAAA,kBAAiC,gBAAA,KAC3C,OAAA,EAAS,wBAAA,cACT,IAAA,EAAM,mBAAA,KACH,eAAA,CAAgB,QAAA"}
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;KA6BY,4BAAA,GAA+B,IAAA,CACzC,WAAA,CACE,gBAAA;AAAA,KAMQ,wBAAA,GAA2B,IAAA,CAAK,iBAAA,eAC1C,4BAAA;AAAA,KAEU,eAAA,kBAAiC,gBAAA,KAC3C,OAAA,EAAS,wBAAA,cACT,IAAA,EAAM,mBAAA,KACH,eAAA,CAAgB,QAAA"}
package/dist/types.mjs CHANGED
@@ -1,9 +1 @@
1
-
2
-
3
- import __tsdown_shims_path from 'node:path'
4
- import __tsdown_shims_url from 'node:url'
5
-
6
- const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
- const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
-
9
1
  export { };
package/dist/unloader.cjs CHANGED
@@ -1,13 +1,5 @@
1
-
2
-
3
- import __tsdown_shims_path from 'node:path'
4
- import __tsdown_shims_url from 'node:url'
5
-
6
- const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
- const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
-
9
1
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
10
- const require_unplugin = require('./unplugin.cjs');
2
+ const require_unplugin = require('./unplugin-WjPT9ECw.cjs');
11
3
  let unplugin = require("unplugin");
12
4
 
13
5
  //#region src/unloader.ts
@@ -1,4 +1,4 @@
1
- import { UnpluginExecutionOptions, UnpluginFactory } from "./types.cjs";
1
+ import { r as UnpluginFactory, t as UnpluginExecutionOptions } from "./types-CEaXoKbk.cjs";
2
2
  import { UnpluginFactoryDecorator, UnpluginFactoryOptions } from "./unplugin.cjs";
3
3
  import { ExecutionContext } from "@powerlines/core";
4
4
 
@@ -23,7 +23,7 @@ import { ExecutionContext } from "@powerlines/core";
23
23
  * @param decorate - A function to decorate the plugin options with additional properties or hooks. This can be used to add custom behavior to the plugin instance, such as additional hooks or configuration options. The function receives the generated plugin options and should return an object containing any additional properties or hooks to be merged into the final plugin options.
24
24
  * @returns A function that generates a Unloader plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Unloader build.
25
25
  */
26
- declare function createUnloaderFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig, any>>;
26
+ declare function createUnloaderFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig<import("@powerlines/core").UserConfig, import("@powerlines/core").ExecutionOptions>, any>>;
27
27
  /**
28
28
  * An Unloader plugin that will invoke the Powerlines API hooks during processing.
29
29
  *
@@ -1 +1 @@
1
- {"version":3,"file":"unloader.d.cts","names":[],"sources":["../src/unloader.ts"],"mappings":";;;;;;;;AA8CA;;;;;;;;;;;;;;;;;iBAAgB,qBAAA,kBAAuC,gBAAA,CAAA,CACrD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;AAAA;AAqBnE;;;;;;;cAAa,MAAA,GAAM,OAAA,GAAgD,wBAAhD,oCAAA,MAAA,sBAAA,MAAA"}
1
+ {"version":3,"file":"unloader.d.cts","names":[],"sources":["../src/unloader.ts"],"mappings":";;;;;;;;AA8CA;;;;;;;;;;;;;;;;;iBAAgB,qBAAA,kBAAuC,gBAAA,EACrD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA,4BAAA,UAAA,6BAAA,gBAAA;;;;;;;;;AAAA;AAqBnE;;;;;cAAa,MAAA,GAAM,OAAA,GAAgD,wBAAhD,oCAAA,MAAA,sBAAA,MAAA"}
@@ -1,5 +1,3 @@
1
- import __tsdown_shims_path from 'node:path';
2
- import __tsdown_shims_url from 'node:url';
3
1
  import { UnpluginExecutionOptions, UnpluginFactory } from "./types.mjs";
4
2
  import { UnpluginFactoryDecorator, UnpluginFactoryOptions } from "./unplugin.mjs";
5
3
  import { ExecutionContext } from "@powerlines/core";
@@ -25,7 +23,7 @@ import { ExecutionContext } from "@powerlines/core";
25
23
  * @param decorate - A function to decorate the plugin options with additional properties or hooks. This can be used to add custom behavior to the plugin instance, such as additional hooks or configuration options. The function receives the generated plugin options and should return an object containing any additional properties or hooks to be merged into the final plugin options.
26
24
  * @returns A function that generates a Unloader plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Unloader build.
27
25
  */
28
- declare function createUnloaderFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig, any>>;
26
+ declare function createUnloaderFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig<import("@powerlines/core").UserConfig, import("@powerlines/core").ExecutionOptions>, any>>;
29
27
  /**
30
28
  * An Unloader plugin that will invoke the Powerlines API hooks during processing.
31
29
  *
@@ -1 +1 @@
1
- {"version":3,"file":"unloader.d.mts","names":[],"sources":["../src/unloader.ts"],"mappings":";;;;;;;;;;;;;;;;;;AA8CA;;;;;;;;;iBAAgB,qBAAA,kBAAuC,gBAAA,CAAA,CACrD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;;cAqBtD,MAAA,GAAM,OAAA,GAAgD,wBAAhD,oCAAA,MAAA,sBAAA,MAAA"}
1
+ {"version":3,"file":"unloader.d.mts","names":[],"sources":["../src/unloader.ts"],"mappings":";;;;;;;;AA8CA;;;;;;;;;;;;;;;;;iBAAgB,qBAAA,kBAAuC,gBAAA,EACrD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA,4BAAA,UAAA,6BAAA,gBAAA;;;;;;;;;AAAA;AAqBnE;;;;;cAAa,MAAA,GAAM,OAAA,GAAgD,wBAAhD,oCAAA,MAAA,sBAAA,MAAA"}
package/dist/unloader.mjs CHANGED
@@ -1,11 +1,3 @@
1
-
2
-
3
- import __tsdown_shims_path from 'node:path'
4
- import __tsdown_shims_url from 'node:url'
5
-
6
- const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
- const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
-
9
1
  import { createUnpluginFactory } from "./unplugin.mjs";
10
2
  import { createUnloaderPlugin } from "unplugin";
11
3
 
@@ -1 +1 @@
1
- {"version":3,"file":"unloader.mjs","names":[],"sources":["../src/unloader.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 { ExecutionContext, UnpluginOptions } from \"@powerlines/core\";\nimport { createUnloaderPlugin } from \"unplugin\";\nimport {\n createUnpluginFactory,\n UnpluginFactoryDecorator,\n UnpluginFactoryOptions\n} from \"./unplugin\";\n\n/**\n * Creates a Unloader plugin factory that generates a plugin instance.\n *\n * @example\n * ```js\n * // unloader.config.js\n * import { createUnloaderFactory } from \"@powerlines/unplugin/unloader\";\n *\n * const powerlinesPlugin = createUnloaderFactory({ name: \"example-app\", ... });\n *\n * export default defineConfig({\n * plugins: [powerlinesPlugin()],\n * });\n *\n * ```\n *\n * @param options - The options to create the plugin factory with.\n * @param decorate - A function to decorate the plugin options with additional properties or hooks. This can be used to add custom behavior to the plugin instance, such as additional hooks or configuration options. The function receives the generated plugin options and should return an object containing any additional properties or hooks to be merged into the final plugin options.\n * @returns A function that generates a Unloader plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Unloader build.\n */\nexport function createUnloaderFactory<TContext extends ExecutionContext>(\n options: Omit<UnpluginFactoryOptions, \"variant\"> = {},\n decorate: UnpluginFactoryDecorator<TContext> = options => options\n) {\n return createUnpluginFactory({ ...options, variant: \"unloader\" }, unplugin =>\n decorate(unplugin as UnpluginOptions<TContext>)\n );\n}\n\n/**\n * An Unloader plugin that will invoke the Powerlines API hooks during processing.\n *\n * @example\n * ```js\n * // unloader.config.js\n * import powerlines from \"@powerlines/unplugin/unloader\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * });\n *\n * ```\n */\nexport const plugin = createUnloaderPlugin(createUnloaderFactory());\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,sBACd,UAAmD,CAAC,GACpD,YAA+C,YAAW,SAC1D;CACA,OAAO,sBAAsB;EAAE,GAAG;EAAS,SAAS;CAAW,IAAG,aAChE,SAAS,QAAqC,CAChD;AACF;;;;;;;;;;;;;;;AAgBA,MAAa,SAAS,qBAAqB,sBAAsB,CAAC"}
1
+ {"version":3,"file":"unloader.mjs","names":[],"sources":["../src/unloader.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 { ExecutionContext, UnpluginOptions } from \"@powerlines/core\";\nimport { createUnloaderPlugin } from \"unplugin\";\nimport {\n createUnpluginFactory,\n UnpluginFactoryDecorator,\n UnpluginFactoryOptions\n} from \"./unplugin\";\n\n/**\n * Creates a Unloader plugin factory that generates a plugin instance.\n *\n * @example\n * ```js\n * // unloader.config.js\n * import { createUnloaderFactory } from \"@powerlines/unplugin/unloader\";\n *\n * const powerlinesPlugin = createUnloaderFactory({ name: \"example-app\", ... });\n *\n * export default defineConfig({\n * plugins: [powerlinesPlugin()],\n * });\n *\n * ```\n *\n * @param options - The options to create the plugin factory with.\n * @param decorate - A function to decorate the plugin options with additional properties or hooks. This can be used to add custom behavior to the plugin instance, such as additional hooks or configuration options. The function receives the generated plugin options and should return an object containing any additional properties or hooks to be merged into the final plugin options.\n * @returns A function that generates a Unloader plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Unloader build.\n */\nexport function createUnloaderFactory<TContext extends ExecutionContext>(\n options: Omit<UnpluginFactoryOptions, \"variant\"> = {},\n decorate: UnpluginFactoryDecorator<TContext> = options => options\n) {\n return createUnpluginFactory({ ...options, variant: \"unloader\" }, unplugin =>\n decorate(unplugin as UnpluginOptions<TContext>)\n );\n}\n\n/**\n * An Unloader plugin that will invoke the Powerlines API hooks during processing.\n *\n * @example\n * ```js\n * // unloader.config.js\n * import powerlines from \"@powerlines/unplugin/unloader\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * });\n *\n * ```\n */\nexport const plugin = createUnloaderPlugin(createUnloaderFactory());\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,sBACd,UAAmD,CAAC,GACpD,YAA+C,YAAW,SAC1D;CACA,OAAO,sBAAsB;EAAE,GAAG;EAAS,SAAS;CAAW,IAAG,aAChE,SAAS,QAAqC,CAChD;AACF;;;;;;;;;;;;;;;AAgBA,MAAa,SAAS,qBAAqB,sBAAsB,CAAC"}