@powerlines/unplugin 0.0.76 → 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 (193) hide show
  1. package/dist/astro.cjs +0 -19
  2. package/dist/astro.d.mts +0 -2
  3. package/dist/astro.d.mts.map +1 -1
  4. package/dist/astro.mjs +1 -14
  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 +2 -21
  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 +1 -14
  20. package/dist/farm.mjs.map +1 -1
  21. package/dist/index.cjs +4 -14
  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 +3 -12
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/next.cjs +1 -20
  28. package/dist/next.d.mts +0 -2
  29. package/dist/next.d.mts.map +1 -1
  30. package/dist/next.mjs +1 -14
  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 -59
  36. package/dist/nuxt.d.mts +0 -2
  37. package/dist/nuxt.d.mts.map +1 -1
  38. package/dist/nuxt.mjs +3 -53
  39. package/dist/rolldown.cjs +6 -27
  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 +1 -16
  45. package/dist/rolldown.mjs.map +1 -1
  46. package/dist/rollup.cjs +7 -29
  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 +1 -17
  52. package/dist/rollup.mjs.map +1 -1
  53. package/dist/rspack.cjs +3 -24
  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 +1 -16
  59. package/dist/rspack.mjs.map +1 -1
  60. package/dist/tsdown.cjs +3 -26
  61. package/dist/tsdown.d.mts +0 -2
  62. package/dist/tsdown.d.mts.map +1 -1
  63. package/dist/tsdown.mjs +1 -19
  64. package/dist/tsdown.mjs.map +1 -1
  65. package/dist/tsup.cjs +3 -24
  66. package/dist/tsup.d.mts +0 -2
  67. package/dist/tsup.d.mts.map +1 -1
  68. package/dist/tsup.mjs +1 -17
  69. package/dist/tsup.mjs.map +1 -1
  70. package/dist/types-CEaXoKbk.d.cts +13 -0
  71. package/dist/types-CEaXoKbk.d.cts.map +1 -0
  72. package/dist/types.cjs +0 -21
  73. package/dist/types.d.cts +2 -11
  74. package/dist/types.d.mts +0 -2
  75. package/dist/types.d.mts.map +1 -1
  76. package/dist/types.mjs +1 -16
  77. package/dist/unloader.cjs +2 -22
  78. package/dist/unloader.d.cts +2 -2
  79. package/dist/unloader.d.cts.map +1 -1
  80. package/dist/unloader.d.mts +1 -3
  81. package/dist/unloader.d.mts.map +1 -1
  82. package/dist/unloader.mjs +1 -15
  83. package/dist/unloader.mjs.map +1 -1
  84. package/dist/unplugin-WjPT9ECw.cjs +296 -0
  85. package/dist/unplugin.cjs +2 -248
  86. package/dist/unplugin.d.cts +1 -1
  87. package/dist/unplugin.d.cts.map +1 -1
  88. package/dist/unplugin.d.mts +0 -2
  89. package/dist/unplugin.d.mts.map +1 -1
  90. package/dist/unplugin.mjs +2 -13
  91. package/dist/unplugin.mjs.map +1 -1
  92. package/dist/vite.cjs +2 -11
  93. package/dist/vite.d.cts +2 -2
  94. package/dist/vite.d.cts.map +1 -1
  95. package/dist/vite.d.mts +1 -3
  96. package/dist/vite.d.mts.map +1 -1
  97. package/dist/vite.mjs +0 -8
  98. package/dist/vite.mjs.map +1 -1
  99. package/dist/webpack.cjs +3 -24
  100. package/dist/webpack.d.cts +2 -2
  101. package/dist/webpack.d.cts.map +1 -1
  102. package/dist/webpack.d.mts +1 -3
  103. package/dist/webpack.d.mts.map +1 -1
  104. package/dist/webpack.mjs +1 -16
  105. package/dist/webpack.mjs.map +1 -1
  106. package/package.json +3 -67
  107. package/dist/_virtual/_rolldown/runtime.cjs +0 -53
  108. package/dist/astro.test.cjs +0 -23
  109. package/dist/astro.test.d.cts +0 -1
  110. package/dist/astro.test.d.mts +0 -2
  111. package/dist/astro.test.mjs +0 -25
  112. package/dist/astro.test.mjs.map +0 -1
  113. package/dist/esbuild.test.cjs +0 -32
  114. package/dist/esbuild.test.d.cts +0 -1
  115. package/dist/esbuild.test.d.mts +0 -2
  116. package/dist/esbuild.test.mjs +0 -34
  117. package/dist/esbuild.test.mjs.map +0 -1
  118. package/dist/farm.test.cjs +0 -23
  119. package/dist/farm.test.d.cts +0 -1
  120. package/dist/farm.test.d.mts +0 -2
  121. package/dist/farm.test.mjs +0 -25
  122. package/dist/farm.test.mjs.map +0 -1
  123. package/dist/index.test.cjs +0 -35
  124. package/dist/index.test.d.cts +0 -1
  125. package/dist/index.test.d.mts +0 -2
  126. package/dist/index.test.mjs +0 -37
  127. package/dist/index.test.mjs.map +0 -1
  128. package/dist/next.test.cjs +0 -23
  129. package/dist/next.test.d.cts +0 -1
  130. package/dist/next.test.d.mts +0 -2
  131. package/dist/next.test.mjs +0 -25
  132. package/dist/next.test.mjs.map +0 -1
  133. package/dist/nuxt.mjs.map +0 -1
  134. package/dist/nuxt.test.cjs +0 -23
  135. package/dist/nuxt.test.d.cts +0 -1
  136. package/dist/nuxt.test.d.mts +0 -2
  137. package/dist/nuxt.test.mjs +0 -25
  138. package/dist/nuxt.test.mjs.map +0 -1
  139. package/dist/package.cjs +0 -26
  140. package/dist/package.mjs +0 -15
  141. package/dist/package.mjs.map +0 -1
  142. package/dist/rolldown.test.cjs +0 -23
  143. package/dist/rolldown.test.d.cts +0 -1
  144. package/dist/rolldown.test.d.mts +0 -2
  145. package/dist/rolldown.test.mjs +0 -25
  146. package/dist/rolldown.test.mjs.map +0 -1
  147. package/dist/rollup.test.cjs +0 -23
  148. package/dist/rollup.test.d.cts +0 -1
  149. package/dist/rollup.test.d.mts +0 -2
  150. package/dist/rollup.test.mjs +0 -25
  151. package/dist/rollup.test.mjs.map +0 -1
  152. package/dist/rspack.test.cjs +0 -23
  153. package/dist/rspack.test.d.cts +0 -1
  154. package/dist/rspack.test.d.mts +0 -2
  155. package/dist/rspack.test.mjs +0 -25
  156. package/dist/rspack.test.mjs.map +0 -1
  157. package/dist/tsdown.test.cjs +0 -23
  158. package/dist/tsdown.test.d.cts +0 -1
  159. package/dist/tsdown.test.d.mts +0 -2
  160. package/dist/tsdown.test.mjs +0 -25
  161. package/dist/tsdown.test.mjs.map +0 -1
  162. package/dist/tsup.test.cjs +0 -23
  163. package/dist/tsup.test.d.cts +0 -1
  164. package/dist/tsup.test.d.mts +0 -2
  165. package/dist/tsup.test.mjs +0 -25
  166. package/dist/tsup.test.mjs.map +0 -1
  167. package/dist/types.d.cts.map +0 -1
  168. package/dist/types.mjs.map +0 -1
  169. package/dist/types.test.cjs +0 -23
  170. package/dist/types.test.d.cts +0 -1
  171. package/dist/types.test.d.mts +0 -2
  172. package/dist/types.test.mjs +0 -25
  173. package/dist/types.test.mjs.map +0 -1
  174. package/dist/unloader.test.cjs +0 -23
  175. package/dist/unloader.test.d.cts +0 -1
  176. package/dist/unloader.test.d.mts +0 -2
  177. package/dist/unloader.test.mjs +0 -25
  178. package/dist/unloader.test.mjs.map +0 -1
  179. package/dist/unplugin.test.cjs +0 -23
  180. package/dist/unplugin.test.d.cts +0 -1
  181. package/dist/unplugin.test.d.mts +0 -2
  182. package/dist/unplugin.test.mjs +0 -25
  183. package/dist/unplugin.test.mjs.map +0 -1
  184. package/dist/vite.test.cjs +0 -26
  185. package/dist/vite.test.d.cts +0 -1
  186. package/dist/vite.test.d.mts +0 -2
  187. package/dist/vite.test.mjs +0 -28
  188. package/dist/vite.test.mjs.map +0 -1
  189. package/dist/webpack.test.cjs +0 -23
  190. package/dist/webpack.test.d.cts +0 -1
  191. package/dist/webpack.test.d.mts +0 -2
  192. package/dist/webpack.test.mjs +0 -25
  193. package/dist/webpack.test.mjs.map +0 -1
package/dist/astro.cjs CHANGED
@@ -1,20 +1,7 @@
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');
11
2
  const require_vite = require('./vite.cjs');
12
3
 
13
4
  //#region src/astro.ts
14
- var astro_exports = /* @__PURE__ */ require_runtime.__exportAll({
15
- default: () => withPlugin,
16
- withPlugin: () => withPlugin
17
- });
18
5
  /**
19
6
  * An Astro plugin that will invoke the Powerlines API hooks during the build process.
20
7
  *
@@ -46,11 +33,5 @@ function withPlugin(options) {
46
33
  }
47
34
 
48
35
  //#endregion
49
- Object.defineProperty(exports, 'astro_exports', {
50
- enumerable: true,
51
- get: function () {
52
- return astro_exports;
53
- }
54
- });
55
36
  exports.default = withPlugin;
56
37
  exports.withPlugin = withPlugin;
package/dist/astro.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 { AstroUserConfig } from "astro";
4
2
 
5
3
  //#region src/astro.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"astro.d.mts","names":[],"sources":["../src/astro.ts"],"mappings":";;;;;;;;;;;;;;;AAyCA;;;;;;;;AAAqE;;iBAArD,UAAA,CAAW,OAAA,EAAS,eAAA,GAAkB,eAAe"}
1
+ {"version":3,"file":"astro.d.mts","names":[],"sources":["../src/astro.ts"],"mappings":";;;;;AAyCA;;;;;;;;AAAqE;;;;;;;;;;iBAArD,UAAA,CAAW,OAAA,EAAS,eAAA,GAAkB,eAAe"}
package/dist/astro.mjs CHANGED
@@ -1,19 +1,6 @@
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
- import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
10
1
  import plugin from "./vite.mjs";
11
2
 
12
3
  //#region src/astro.ts
13
- var astro_exports = /* @__PURE__ */ __exportAll({
14
- default: () => withPlugin,
15
- withPlugin: () => withPlugin
16
- });
17
4
  /**
18
5
  * An Astro plugin that will invoke the Powerlines API hooks during the build process.
19
6
  *
@@ -45,5 +32,5 @@ function withPlugin(options) {
45
32
  }
46
33
 
47
34
  //#endregion
48
- export { astro_exports, withPlugin as default, withPlugin };
35
+ export { withPlugin as default, withPlugin };
49
36
  //# sourceMappingURL=astro.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"astro.mjs","names":["vite"],"sources":["../src/astro.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 { AstroUserConfig } from \"astro\";\nimport vite from \"./vite\";\n\n/**\n * An Astro plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://docs.astro.build/en/guides/integrations-guide/#creating-an-integration\n *\n * @example\n * ```js\n * // astro.config.mjs\n * import { defineConfig } from \"astro/config\";\n * import powerlines from \"@powerlines/unplugin/astro\";\n *\n * export default defineConfig({\n * integrations: [powerlines({ name: \"example-app\", ... })]\n * });\n *\n * ```\n *\n * @param options - The Astro options to merge with the Powerlines configuration.\n * @returns The merged Astro configuration options.\n */\nexport function withPlugin(options: AstroUserConfig): AstroUserConfig {\n return {\n ...options,\n vite: {\n ...options.vite,\n plugins: [...(options.vite?.plugins ?? []), vite()] as NonNullable<\n AstroUserConfig[\"vite\"]\n >[\"plugins\"]\n }\n };\n}\n\nexport default withPlugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAgB,WAAW,SAA2C;CACpE,OAAO;EACL,GAAG;EACH,MAAM;GACJ,GAAG,QAAQ;GACX,SAAS,CAAC,GAAI,QAAQ,MAAM,WAAW,CAAC,GAAIA,OAAK,CAAC;EAGpD;CACF;AACF"}
1
+ {"version":3,"file":"astro.mjs","names":["vite"],"sources":["../src/astro.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 { AstroUserConfig } from \"astro\";\nimport vite from \"./vite\";\n\n/**\n * An Astro plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://docs.astro.build/en/guides/integrations-guide/#creating-an-integration\n *\n * @example\n * ```js\n * // astro.config.mjs\n * import { defineConfig } from \"astro/config\";\n * import powerlines from \"@powerlines/unplugin/astro\";\n *\n * export default defineConfig({\n * integrations: [powerlines({ name: \"example-app\", ... })]\n * });\n *\n * ```\n *\n * @param options - The Astro options to merge with the Powerlines configuration.\n * @returns The merged Astro configuration options.\n */\nexport function withPlugin(options: AstroUserConfig): AstroUserConfig {\n return {\n ...options,\n vite: {\n ...options.vite,\n plugins: [...(options.vite?.plugins ?? []), vite()] as NonNullable<\n AstroUserConfig[\"vite\"]\n >[\"plugins\"]\n }\n };\n}\n\nexport default withPlugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAgB,WAAW,SAA2C;CACpE,OAAO;EACL,GAAG;EACH,MAAM;GACJ,GAAG,QAAQ;GACX,SAAS,CAAC,GAAI,QAAQ,MAAM,WAAW,CAAC,GAAIA,OAAK,CAAC;EAGpD;CACF;AACF"}
@@ -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
  //#region \0rolldown/runtime.js
10
2
  var __defProp = Object.defineProperty;
11
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -41,4 +33,4 @@ var __copyProps = (to, from, except, desc) => {
41
33
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
42
34
 
43
35
  //#endregion
44
- export { __exportAll, __reExport };
36
+ export { __reExport as n, __exportAll as t };
package/dist/esbuild.cjs CHANGED
@@ -1,17 +1,8 @@
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');
11
- const require_unplugin = require('./unplugin.cjs');
2
+ const require_unplugin = require('./unplugin-WjPT9ECw.cjs');
12
3
  let _stryke_path_join_paths = require("@stryke/path/join-paths");
13
4
  let defu = require("defu");
14
- defu = require_runtime.__toESM(defu, 1);
5
+ defu = require_unplugin.__toESM(defu, 1);
15
6
  let unplugin = require("unplugin");
16
7
  let _powerlines_core_lib_entry = require("@powerlines/core/lib/entry");
17
8
  let _stryke_path_replace = require("@stryke/path/replace");
@@ -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, ResolvedEntryFileReference, UnresolvedContext } from "@powerlines/core";
4
4
  import { DeepPartial } from "@stryke/types/base";
@@ -44,7 +44,7 @@ declare function resolveOptions<TContext extends UnresolvedContext>(context: TCo
44
44
  * @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.
45
45
  * @returns A function that generates an ESBuild plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your ESBuild build.
46
46
  */
47
- declare function createEsbuildFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig, any>>;
47
+ declare function createEsbuildFactory<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>>;
48
48
  /**
49
49
  * An ESBuild plugin that will invoke the Powerlines API hooks during the build process.
50
50
  *
@@ -1 +1 @@
1
- {"version":3,"file":"esbuild.d.cts","names":[],"sources":["../src/esbuild.ts"],"mappings":";;;;;;;cAyCa,eAAA,EAAiB,OAAO,CAAC,YAAA;;;AAAtC;;;;AAAkD;iBAqBlC,YAAA,kBAA8B,iBAAA,EAC5C,OAAA,EAAS,QAAA,EACT,WAAA,GAAa,0BAAA,gBACZ,YAAA;;;;;;;;iBAuBa,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,EACT,QAAA,GAAU,WAAA,CAAY,YAAA,IACrB,YAAA;;;;;;;;;AA1BY;AAuBf;;;;;;;;;;;;;iBAgHgB,oBAAA,kBAAsC,gBAAA,EACpD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;AA/GpD;AA6Gf;;;;;;;;;;cAqDM,MAAA,GAAM,OAAA,GAA8C,wBAA9C,mCAAA,MAAA"}
1
+ {"version":3,"file":"esbuild.d.cts","names":[],"sources":["../src/esbuild.ts"],"mappings":";;;;;;;cAyCa,eAAA,EAAiB,OAAO,CAAC,YAAA;;;AAAtC;;;;AAAkD;iBAqBlC,YAAA,kBAA8B,iBAAA,EAC5C,OAAA,EAAS,QAAA,EACT,WAAA,GAAa,0BAAA,gBACZ,YAAA;;;;;;;;iBAuBa,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,EACT,QAAA,GAAU,WAAA,CAAY,YAAA,IACrB,YAAA;;;;;;;;;AA1BY;AAuBf;;;;;;;;;;;;;iBAgHgB,oBAAA,kBAAsC,gBAAA,EACpD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA,4BAAA,UAAA,6BAAA,gBAAA;;;;;;AA/GpD;AA6Gf;;;;;;;;;;cAqDM,MAAA,GAAM,OAAA,GAA8C,wBAA9C,mCAAA,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, ResolvedEntryFileReference, UnresolvedContext } from "@powerlines/core";
@@ -46,7 +44,7 @@ declare function resolveOptions<TContext extends UnresolvedContext>(context: TCo
46
44
  * @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.
47
45
  * @returns A function that generates an ESBuild plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your ESBuild build.
48
46
  */
49
- declare function createEsbuildFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig, any>>;
47
+ declare function createEsbuildFactory<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>>;
50
48
  /**
51
49
  * An ESBuild plugin that will invoke the Powerlines API hooks during the build process.
52
50
  *
@@ -1 +1 @@
1
- {"version":3,"file":"esbuild.d.mts","names":[],"sources":["../src/esbuild.ts"],"mappings":";;;;;;;;;cAyCa,eAAA,EAAiB,OAAO,CAAC,YAAA;;;;;;;;iBAqBtB,YAAA,kBAA8B,iBAAA,EAC5C,OAAA,EAAS,QAAA,EACT,WAAA,GAAa,0BAAA,gBACZ,YAAA;;;AAxBH;;;;AAAkD;iBA+ClC,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,EACT,QAAA,GAAU,WAAA,CAAY,YAAA,IACrB,YAAA;;;;;;;;;;;;;;;;;AA1BY;AAuBf;;;;;iBAgHgB,oBAAA,kBAAsC,gBAAA,EACpD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;AA/GpD;AA6Gf;;cAqDM,MAAA,GAAM,OAAA,GAA8C,wBAA9C,mCAAA,MAAA"}
1
+ {"version":3,"file":"esbuild.d.mts","names":[],"sources":["../src/esbuild.ts"],"mappings":";;;;;;;cAyCa,eAAA,EAAiB,OAAO,CAAC,YAAA;;;AAAtC;;;;AAAkD;iBAqBlC,YAAA,kBAA8B,iBAAA,EAC5C,OAAA,EAAS,QAAA,EACT,WAAA,GAAa,0BAAA,gBACZ,YAAA;;;;;;;;iBAuBa,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,EACT,QAAA,GAAU,WAAA,CAAY,YAAA,IACrB,YAAA;;;;;;;;;AA1BY;AAuBf;;;;;;;;;;;;;iBAgHgB,oBAAA,kBAAsC,gBAAA,EACpD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA,4BAAA,UAAA,6BAAA,gBAAA;;;;;;AA/GpD;AA6Gf;;;;;;;;;;cAqDM,MAAA,GAAM,OAAA,GAA8C,wBAA9C,mCAAA,MAAA"}
package/dist/esbuild.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 { joinPaths } from "@stryke/path/join-paths";
11
3
  import defu from "defu";
@@ -1 +1 @@
1
- {"version":3,"file":"esbuild.mjs","names":[],"sources":["../src/esbuild.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 ExecutionContext,\n ResolvedEntryFileReference,\n UnpluginOptions,\n UnresolvedContext\n} from \"@powerlines/core\";\nimport { resolveEntryOutput } from \"@powerlines/core/lib/entry\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { DeepPartial } from \"@stryke/types/base\";\nimport defu from \"defu\";\nimport type { BuildOptions, PluginBuild } from \"esbuild\";\nimport { Format } from \"esbuild\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport {\n createUnpluginFactory,\n UnpluginFactoryDecorator,\n UnpluginFactoryOptions\n} from \"./unplugin\";\n\nexport const DEFAULT_OPTIONS: Partial<BuildOptions> = {\n target: \"esnext\",\n platform: \"neutral\",\n format: \"esm\",\n write: true,\n minify: true,\n sourcemap: false,\n bundle: true,\n treeShaking: true,\n keepNames: true,\n splitting: true,\n logLevel: \"silent\"\n};\n\n/**\n * Resolves the entry options for esbuild.\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): BuildOptions[\"entryPoints\"] {\n return entryPoints.reduce(\n (ret, entry) => {\n if (isString(entry)) {\n ret[replaceExtension(replacePath(entry, context.config.root))] =\n replacePath(entry, context.config.root);\n } else {\n ret[entry.output || resolveEntryOutput(context, entry)] = entry.file;\n }\n\n return ret;\n },\n {} as Record<string, string>\n );\n}\n\n/**\n * Resolves the esbuild options.\n *\n * @param context - The build context.\n * @param override - Optional esbuild options to override the resolved options.\n * @returns The resolved esbuild options.\n */\nexport function resolveOptions<TContext extends UnresolvedContext>(\n context: TContext,\n override: DeepPartial<BuildOptions> = {}\n): BuildOptions {\n if (context.config.inject && Object.keys(context.config.inject).length > 0) {\n context.fs.writeSync(\n joinPaths(\n context.config.cwd,\n context.config.root,\n context.artifactsPath,\n \"inject-shim.js\"\n ),\n Object.entries(context.config.inject)\n .map(([key, value]) => {\n if (value) {\n if (Array.isArray(value)) {\n if (camelCase(key) !== key) {\n if (value.length === 1) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n }\n } else if (value.length === 1) {\n return `\nimport ${key} from \"${value[0]}\";\nexport { ${key} };`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from \"${value[0]}\";\nexport { ${key} };`;\n }\n } else if (camelCase(key) !== key) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else {\n return `\nimport ${key} from \"${value}\";\nexport { ${key} };`;\n }\n }\n\n return \"\";\n })\n .join(\"\\n\")\n );\n }\n\n return defu(\n {\n alias: context.alias,\n inject:\n context.config.inject && Object.keys(context.config.inject).length > 0\n ? [\n joinPaths(\n context.config.cwd,\n context.config.root,\n context.artifactsPath,\n \"inject-shim.js\"\n )\n ]\n : undefined\n },\n override,\n {\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n define: context.config.define,\n resolveExtensions: context.config.resolve.extensions,\n packages: context.config.resolve.skipNodeModulesBundle\n ? \"external\"\n : \"bundle\",\n format: (Array.isArray(context.config.output.format)\n ? context.config.output.format[0]\n : context.config.output.format) as Format,\n platform: context.config.platform,\n outdir: context.config.output.path,\n tsconfig: context.tsconfig.tsconfigFilePath,\n minify: context.config.output.minify,\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.output.sourceMap\n },\n DEFAULT_OPTIONS\n ) as BuildOptions;\n}\n\n/**\n * Creates an ESBuild plugin factory that generates a plugin instance.\n *\n * @see https://esbuild.github.io/plugins/\n *\n * @example\n * ```ts\n * // esbuild.config.ts\n * import { createEsbuildFactory } from \"@powerlines/unplugin/esbuild\";\n *\n * const powerlinesPlugin = createEsbuildFactory({ 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 an ESBuild plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your ESBuild build.\n */\nexport function createEsbuildFactory<TContext extends ExecutionContext>(\n options: Omit<UnpluginFactoryOptions, \"variant\"> = {},\n decorate: UnpluginFactoryDecorator<TContext> = options => options\n) {\n return createUnpluginFactory({ ...options, variant: \"esbuild\" }, unplugin =>\n decorate({\n ...(unplugin as UnpluginOptions<TContext>),\n esbuild: {\n config: opts => {\n opts ??= {};\n\n const result = resolveOptions(unplugin.context);\n for (const key in result) {\n if (\n isUndefined(opts[key as keyof BuildOptions]) &&\n !isUndefined(result[key as keyof BuildOptions])\n ) {\n opts[key as keyof BuildOptions] = result[\n key as keyof BuildOptions\n ] as any;\n }\n }\n },\n setup: async (build: PluginBuild) => {\n const environment = await unplugin.context.getEnvironment();\n\n return unplugin.context.callHook(\n \"esbuild:setup\",\n { environment },\n build\n );\n }\n }\n })\n );\n}\n\n/**\n * An ESBuild plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://esbuild.github.io/plugins/\n *\n * @example\n * ```js\n * // esbuild.config.js\n * import powerlines from \"@powerlines/unplugin/esbuild\";\n *\n * export default {\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * };\n *\n * ```\n */\nconst plugin = createEsbuildPlugin(createEsbuildFactory());\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyCA,MAAa,kBAAyC;CACpD,QAAQ;CACR,UA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QAChB,IACE,YAAY,KAAK,IAA0B,KAC3C,CAAC,YAAY,OAAO,IAA0B,GAE9C,KAAK,OAA6B,OAChC;GAIR;GACA,OAAO,OAAO,UAAuB;IACnC,MAAM,cAAc,MAAM,SAAS,QAAQ,eAAe;IAE1D,OAAO,SAAS,QAAQ,SACtB,iBACA,EAAE,YAAY,GACd,KACF;GACF;EACF;CACF,CAAC,CACH;AACF;;;;;;;;;;;;;;;;;AAkBA,MAAM,SAAS,oBAAoB,qBAAqB,CAAC"}
1
+ {"version":3,"file":"esbuild.mjs","names":[],"sources":["../src/esbuild.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 ExecutionContext,\n ResolvedEntryFileReference,\n UnpluginOptions,\n UnresolvedContext\n} from \"@powerlines/core\";\nimport { resolveEntryOutput } from \"@powerlines/core/lib/entry\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { DeepPartial } from \"@stryke/types/base\";\nimport defu from \"defu\";\nimport type { BuildOptions, PluginBuild } from \"esbuild\";\nimport { Format } from \"esbuild\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport {\n createUnpluginFactory,\n UnpluginFactoryDecorator,\n UnpluginFactoryOptions\n} from \"./unplugin\";\n\nexport const DEFAULT_OPTIONS: Partial<BuildOptions> = {\n target: \"esnext\",\n platform: \"neutral\",\n format: \"esm\",\n write: true,\n minify: true,\n sourcemap: false,\n bundle: true,\n treeShaking: true,\n keepNames: true,\n splitting: true,\n logLevel: \"silent\"\n};\n\n/**\n * Resolves the entry options for esbuild.\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): BuildOptions[\"entryPoints\"] {\n return entryPoints.reduce(\n (ret, entry) => {\n if (isString(entry)) {\n ret[replaceExtension(replacePath(entry, context.config.root))] =\n replacePath(entry, context.config.root);\n } else {\n ret[entry.output || resolveEntryOutput(context, entry)] = entry.file;\n }\n\n return ret;\n },\n {} as Record<string, string>\n );\n}\n\n/**\n * Resolves the esbuild options.\n *\n * @param context - The build context.\n * @param override - Optional esbuild options to override the resolved options.\n * @returns The resolved esbuild options.\n */\nexport function resolveOptions<TContext extends UnresolvedContext>(\n context: TContext,\n override: DeepPartial<BuildOptions> = {}\n): BuildOptions {\n if (context.config.inject && Object.keys(context.config.inject).length > 0) {\n context.fs.writeSync(\n joinPaths(\n context.config.cwd,\n context.config.root,\n context.artifactsPath,\n \"inject-shim.js\"\n ),\n Object.entries(context.config.inject)\n .map(([key, value]) => {\n if (value) {\n if (Array.isArray(value)) {\n if (camelCase(key) !== key) {\n if (value.length === 1) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n }\n } else if (value.length === 1) {\n return `\nimport ${key} from \"${value[0]}\";\nexport { ${key} };`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from \"${value[0]}\";\nexport { ${key} };`;\n }\n } else if (camelCase(key) !== key) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else {\n return `\nimport ${key} from \"${value}\";\nexport { ${key} };`;\n }\n }\n\n return \"\";\n })\n .join(\"\\n\")\n );\n }\n\n return defu(\n {\n alias: context.alias,\n inject:\n context.config.inject && Object.keys(context.config.inject).length > 0\n ? [\n joinPaths(\n context.config.cwd,\n context.config.root,\n context.artifactsPath,\n \"inject-shim.js\"\n )\n ]\n : undefined\n },\n override,\n {\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n define: context.config.define,\n resolveExtensions: context.config.resolve.extensions,\n packages: context.config.resolve.skipNodeModulesBundle\n ? \"external\"\n : \"bundle\",\n format: (Array.isArray(context.config.output.format)\n ? context.config.output.format[0]\n : context.config.output.format) as Format,\n platform: context.config.platform,\n outdir: context.config.output.path,\n tsconfig: context.tsconfig.tsconfigFilePath,\n minify: context.config.output.minify,\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.output.sourceMap\n },\n DEFAULT_OPTIONS\n ) as BuildOptions;\n}\n\n/**\n * Creates an ESBuild plugin factory that generates a plugin instance.\n *\n * @see https://esbuild.github.io/plugins/\n *\n * @example\n * ```ts\n * // esbuild.config.ts\n * import { createEsbuildFactory } from \"@powerlines/unplugin/esbuild\";\n *\n * const powerlinesPlugin = createEsbuildFactory({ 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 an ESBuild plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your ESBuild build.\n */\nexport function createEsbuildFactory<TContext extends ExecutionContext>(\n options: Omit<UnpluginFactoryOptions, \"variant\"> = {},\n decorate: UnpluginFactoryDecorator<TContext> = options => options\n) {\n return createUnpluginFactory({ ...options, variant: \"esbuild\" }, unplugin =>\n decorate({\n ...(unplugin as UnpluginOptions<TContext>),\n esbuild: {\n config: opts => {\n opts ??= {};\n\n const result = resolveOptions(unplugin.context);\n for (const key in result) {\n if (\n isUndefined(opts[key as keyof BuildOptions]) &&\n !isUndefined(result[key as keyof BuildOptions])\n ) {\n opts[key as keyof BuildOptions] = result[\n key as keyof BuildOptions\n ] as any;\n }\n }\n },\n setup: async (build: PluginBuild) => {\n const environment = await unplugin.context.getEnvironment();\n\n return unplugin.context.callHook(\n \"esbuild:setup\",\n { environment },\n build\n );\n }\n }\n })\n );\n}\n\n/**\n * An ESBuild plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://esbuild.github.io/plugins/\n *\n * @example\n * ```js\n * // esbuild.config.js\n * import powerlines from \"@powerlines/unplugin/esbuild\";\n *\n * export default {\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * };\n *\n * ```\n */\nconst plugin = createEsbuildPlugin(createEsbuildFactory());\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AAyCA,MAAa,kBAAyC;CACpD,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,aAAa;CACb,WAAW;CACX,WAAW;CACX,UAAU;AACZ;;;;;;;;AASA,SAAgB,aACd,SACA,cAAuD,CAAC,GAC3B;CAC7B,OAAO,YAAY,QAChB,KAAK,UAAU;EACd,IAAI,SAAS,KAAK,GAChB,IAAI,iBAAiB,YAAY,OAAO,QAAQ,OAAO,IAAI,CAAC,KAC1D,YAAY,OAAO,QAAQ,OAAO,IAAI;OAExC,IAAI,MAAM,UAAU,mBAAmB,SAAS,KAAK,KAAK,MAAM;EAGlE,OAAO;CACT,GACA,CAAC,CACH;AACF;;;;;;;;AASA,SAAgB,eACd,SACA,WAAsC,CAAC,GAC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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');
11
- const require_unplugin = require('./unplugin.cjs');
2
+ const require_unplugin = require('./unplugin-WjPT9ECw.cjs');
12
3
  let unplugin = require("unplugin");
13
4
 
14
5
  //#region src/farm.ts
15
- var farm_exports = /* @__PURE__ */ require_runtime.__exportAll({
16
- createFarmFactory: () => createFarmFactory,
17
- default: () => farm
18
- });
19
6
  /**
20
7
  * Creates a Farm plugin factory that generates a plugin instance.
21
8
  *
@@ -65,10 +52,4 @@ const farm = (0, unplugin.createFarmPlugin)(createFarmFactory());
65
52
 
66
53
  //#endregion
67
54
  exports.createFarmFactory = createFarmFactory;
68
- exports.default = farm;
69
- Object.defineProperty(exports, 'farm_exports', {
70
- enumerable: true,
71
- get: function () {
72
- return farm_exports;
73
- }
74
- });
55
+ exports.default = farm;
package/dist/farm.d.cts CHANGED
@@ -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
 
@@ -25,7 +25,7 @@ import { ExecutionContext } from "@powerlines/core";
25
25
  * @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
26
  * @returns A function that generates a Farm plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Farm build.
27
27
  */
28
- declare function createFarmFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig, any>>;
28
+ declare function createFarmFactory<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
29
  /**
30
30
  * A Farm plugin that will invoke the Powerlines API hooks during the build process.
31
31
  *
@@ -1 +1 @@
1
- {"version":3,"file":"farm.d.cts","names":[],"sources":["../src/farm.ts"],"mappings":";;;;;;;;AAgDA;;;;;;;;;;;;;;;;;;;iBAAgB,iBAAA,kBAAmC,gBAAA,EACjD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;AAAA;AAKlE;;;;;;;;AAmBiD;;;;cAA5C,IAAA,GAAI,OAAA,GAAwC,wBAAxC,wCAAA,QAAA"}
1
+ {"version":3,"file":"farm.d.cts","names":[],"sources":["../src/farm.ts"],"mappings":";;;;;;;;AAgDA;;;;;;;;;;;;;;;;;;;iBAAgB,iBAAA,kBAAmC,gBAAA,EACjD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA,4BAAA,UAAA,6BAAA,gBAAA;;;;;;;AAAA;AAKlE;;;;;;;;AAmBiD;;cAA5C,IAAA,GAAI,OAAA,GAAwC,wBAAxC,wCAAA,QAAA"}
package/dist/farm.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 { UnpluginExecutionOptions, UnpluginFactory } from "./types.mjs";
4
2
  import { UnpluginFactoryDecorator, UnpluginFactoryOptions } from "./unplugin.mjs";
5
3
  import { ExecutionContext } from "@powerlines/core";
@@ -27,7 +25,7 @@ import { ExecutionContext } from "@powerlines/core";
27
25
  * @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.
28
26
  * @returns A function that generates a Farm plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Farm build.
29
27
  */
30
- declare function createFarmFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig, any>>;
28
+ declare function createFarmFactory<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>>;
31
29
  /**
32
30
  * A Farm plugin that will invoke the Powerlines API hooks during the build process.
33
31
  *
@@ -1 +1 @@
1
- {"version":3,"file":"farm.d.mts","names":[],"sources":["../src/farm.ts"],"mappings":";;;;;;;;;;;;;;;;;;AAgDA;;;;;;;;;;;iBAAgB,iBAAA,kBAAmC,gBAAA,EACjD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;AAAA;AAKlE;;;;cAmBK,IAAA,GAAI,OAAA,GAAwC,wBAAxC,wCAAA,QAAA"}
1
+ {"version":3,"file":"farm.d.mts","names":[],"sources":["../src/farm.ts"],"mappings":";;;;;;;;AAgDA;;;;;;;;;;;;;;;;;;;iBAAgB,iBAAA,kBAAmC,gBAAA,EACjD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA,4BAAA,UAAA,6BAAA,gBAAA;;;;;;;AAAA;AAKlE;;;;;;;;AAmBiD;;cAA5C,IAAA,GAAI,OAAA,GAAwC,wBAAxC,wCAAA,QAAA"}
package/dist/farm.mjs CHANGED
@@ -1,20 +1,7 @@
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
- import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
10
1
  import { createUnpluginFactory } from "./unplugin.mjs";
11
2
  import { createFarmPlugin } from "unplugin";
12
3
 
13
4
  //#region src/farm.ts
14
- var farm_exports = /* @__PURE__ */ __exportAll({
15
- createFarmFactory: () => createFarmFactory,
16
- default: () => farm
17
- });
18
5
  /**
19
6
  * Creates a Farm plugin factory that generates a plugin instance.
20
7
  *
@@ -63,5 +50,5 @@ function createFarmFactory(options = {}, decorate = (options) => options) {
63
50
  const farm = createFarmPlugin(createFarmFactory());
64
51
 
65
52
  //#endregion
66
- export { createFarmFactory, farm as default, farm_exports };
53
+ export { createFarmFactory, farm as default };
67
54
  //# sourceMappingURL=farm.mjs.map
package/dist/farm.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"farm.mjs","names":[],"sources":["../src/farm.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 { createFarmPlugin } from \"unplugin\";\nimport {\n createUnpluginFactory,\n UnpluginFactoryDecorator,\n UnpluginFactoryOptions\n} from \"./unplugin\";\n\n/**\n * Creates a Farm plugin factory that generates a plugin instance.\n *\n * @see https://farmjs.dev/plugins/writing-plugins\n *\n * @example\n * ```ts\n * // farm.config.ts\n * import { createFarmFactory } from \"@powerlines/unplugin/farm\";\n *\n * const powerlinesPlugin = createFarmFactory({ 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 Farm plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Farm build.\n */\nexport function createFarmFactory<TContext extends ExecutionContext>(\n options: Omit<UnpluginFactoryOptions, \"variant\"> = {},\n decorate: UnpluginFactoryDecorator<TContext> = options => options\n) {\n return createUnpluginFactory({ ...options, variant: \"farm\" }, unplugin =>\n decorate(unplugin as UnpluginOptions<TContext>)\n );\n}\n\n/**\n * A Farm plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://farmjs.dev/plugins/writing-plugins\n *\n * @example\n * ```ts\n * // farm.config.ts\n * import powerlines from \"@powerlines/unplugin/farm\";\n * import { defineConfig } from \"@farmfe/core\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * });\n *\n * ```\n */\nconst farm = createFarmPlugin(createFarmFactory());\n\nexport default farm;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,kBACd,UAAmD,CAAC,GACpD,YAA+C,YAAW,SAC1D;CACA,OAAO,sBAAsB;EAAE,GAAG;EAAS,SAAS;CAAO,IAAG,aAC5D,SAAS,QAAqC,CAChD;AACF;;;;;;;;;;;;;;;;;;AAmBA,MAAM,OAAO,iBAAiB,kBAAkB,CAAC"}
1
+ {"version":3,"file":"farm.mjs","names":[],"sources":["../src/farm.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 { createFarmPlugin } from \"unplugin\";\nimport {\n createUnpluginFactory,\n UnpluginFactoryDecorator,\n UnpluginFactoryOptions\n} from \"./unplugin\";\n\n/**\n * Creates a Farm plugin factory that generates a plugin instance.\n *\n * @see https://farmjs.dev/plugins/writing-plugins\n *\n * @example\n * ```ts\n * // farm.config.ts\n * import { createFarmFactory } from \"@powerlines/unplugin/farm\";\n *\n * const powerlinesPlugin = createFarmFactory({ 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 Farm plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Farm build.\n */\nexport function createFarmFactory<TContext extends ExecutionContext>(\n options: Omit<UnpluginFactoryOptions, \"variant\"> = {},\n decorate: UnpluginFactoryDecorator<TContext> = options => options\n) {\n return createUnpluginFactory({ ...options, variant: \"farm\" }, unplugin =>\n decorate(unplugin as UnpluginOptions<TContext>)\n );\n}\n\n/**\n * A Farm plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://farmjs.dev/plugins/writing-plugins\n *\n * @example\n * ```ts\n * // farm.config.ts\n * import powerlines from \"@powerlines/unplugin/farm\";\n * import { defineConfig } from \"@farmfe/core\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * });\n *\n * ```\n */\nconst farm = createFarmPlugin(createFarmFactory());\n\nexport default farm;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,kBACd,UAAmD,CAAC,GACpD,YAA+C,YAAW,SAC1D;CACA,OAAO,sBAAsB;EAAE,GAAG;EAAS,SAAS;CAAO,IAAG,aAC5D,SAAS,QAAqC,CAChD;AACF;;;;;;;;;;;;;;;;;;AAmBA,MAAM,OAAO,iBAAiB,kBAAkB,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,21 +1,12 @@
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');
11
- const require_unplugin = require('./unplugin.cjs');
2
+ const require_unplugin = require('./unplugin-WjPT9ECw.cjs');
12
3
  const require_esbuild = require('./esbuild.cjs');
13
4
  const require_rolldown = require('./rolldown.cjs');
14
5
  const require_vite = require('./vite.cjs');
15
6
  const require_astro = require('./astro.cjs');
16
7
  const require_farm = require('./farm.cjs');
17
8
  const require_next = require('./next.cjs');
18
- const require_nuxt = require('./nuxt.cjs');
9
+ const require_nuxt = require('./nuxt-DRZ7K3-X.cjs');
19
10
  const require_rollup = require('./rollup.cjs');
20
11
  const require_rspack = require('./rspack.cjs');
21
12
  const require_tsdown = require('./tsdown.cjs');
@@ -23,18 +14,17 @@ const require_tsup = require('./tsup.cjs');
23
14
  const require_unloader = require('./unloader.cjs');
24
15
 
25
16
  //#region src/index.ts
26
- var src_exports = /* @__PURE__ */ require_runtime.__exportAll({
17
+ var src_exports = /* @__PURE__ */ require_unplugin.__exportAll({
27
18
  createUnpluginFactory: () => require_unplugin.createUnpluginFactory,
28
19
  default: () => plugins,
29
20
  plugins: () => plugins
30
21
  });
31
- require_runtime.__reExport(src_exports, require_unplugin.unplugin_exports);
32
22
  const plugins = {
33
23
  astro: require_astro.default,
34
24
  esbuild: require_esbuild.default,
35
25
  farm: require_farm.default,
36
26
  next: require_next.default,
37
- nuxt: require_nuxt.default,
27
+ nuxt: require_nuxt.plugin,
38
28
  rolldown: require_rolldown.default,
39
29
  rollup: require_rollup.default,
40
30
  rspack: require_rspack.default,
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
+ import { a as __reExport, i as __exportAll, n as UnpluginExecutionOptionsBase, r as UnpluginFactory, t as UnpluginExecutionOptions } from "./types-CEaXoKbk.cjs";
1
2
  import withPlugin from "./astro.cjs";
2
- import { UnpluginExecutionOptions, UnpluginExecutionOptionsBase, UnpluginFactory } from "./types.cjs";
3
3
  import { UnpluginFactoryDecorator, UnpluginFactoryOptions, createUnpluginFactory } from "./unplugin.cjs";
4
4
  import withPlugin$1 from "./next.cjs";
5
5
  import plugin from "./tsdown.cjs";
package/dist/index.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 withPlugin from "./astro.mjs";
4
2
  import { UnpluginExecutionOptions, UnpluginExecutionOptionsBase, UnpluginFactory } from "./types.mjs";
5
3
  import { UnpluginFactoryDecorator, UnpluginFactoryOptions, createUnpluginFactory } from "./unplugin.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;cAkCa,OAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;cAkCa,OAAA"}
package/dist/index.mjs CHANGED
@@ -1,20 +1,12 @@
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
- import { __exportAll, __reExport } from "./_virtual/_rolldown/runtime.mjs";
10
- import { createUnpluginFactory, unplugin_exports } from "./unplugin.mjs";
1
+ import { n as __reExport, t as __exportAll } from "./chunk-BUUfjzRC.mjs";
2
+ import { createUnpluginFactory } from "./unplugin.mjs";
11
3
  import plugin from "./esbuild.mjs";
12
4
  import plugin$1 from "./rolldown.mjs";
13
5
  import plugin$2 from "./vite.mjs";
14
6
  import withPlugin from "./astro.mjs";
15
7
  import farm from "./farm.mjs";
16
8
  import withPlugin$1 from "./next.mjs";
17
- import plugin$3 from "./nuxt.mjs";
9
+ import { t as plugin$3 } from "./nuxt-Dj7SOTWN.mjs";
18
10
  import plugin$4 from "./rollup.mjs";
19
11
  import plugin$5 from "./rspack.mjs";
20
12
  import plugin$6 from "./tsdown.mjs";
@@ -29,7 +21,6 @@ var src_exports = /* @__PURE__ */ __exportAll({
29
21
  default: () => plugins,
30
22
  plugins: () => plugins
31
23
  });
32
- __reExport(src_exports, unplugin_exports);
33
24
  const plugins = {
34
25
  astro: withPlugin,
35
26
  esbuild: plugin,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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 astro from \"./astro\";\nimport esbuild from \"./esbuild\";\nimport farm from \"./farm\";\nimport next from \"./next\";\nimport nuxt from \"./nuxt\";\nimport rolldown from \"./rolldown\";\nimport rollup from \"./rollup\";\nimport rspack from \"./rspack\";\nimport tsdown from \"./tsdown\";\nimport tsup from \"./tsup\";\nimport unloader from \"./unloader\";\nimport vite from \"./vite\";\n\nexport type * from \"./types\";\nexport * from \"./unplugin\";\n\nexport const plugins = {\n astro,\n esbuild,\n farm,\n next,\n nuxt,\n rolldown,\n rollup,\n rspack,\n tsdown,\n tsup,\n unloader,\n vite\n};\n\nexport default plugins;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,UAAU;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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 astro from \"./astro\";\nimport esbuild from \"./esbuild\";\nimport farm from \"./farm\";\nimport next from \"./next\";\nimport nuxt from \"./nuxt\";\nimport rolldown from \"./rolldown\";\nimport rollup from \"./rollup\";\nimport rspack from \"./rspack\";\nimport tsdown from \"./tsdown\";\nimport tsup from \"./tsup\";\nimport unloader from \"./unloader\";\nimport vite from \"./vite\";\n\nexport type * from \"./types\";\nexport * from \"./unplugin\";\n\nexport const plugins = {\n astro,\n esbuild,\n farm,\n next,\n nuxt,\n rolldown,\n rollup,\n rspack,\n tsdown,\n tsup,\n unloader,\n vite\n};\n\nexport default plugins;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,UAAU;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
package/dist/next.cjs CHANGED
@@ -1,20 +1,7 @@
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');
11
2
  const require_webpack = require('./webpack.cjs');
12
3
 
13
4
  //#region src/next.ts
14
- var next_exports = /* @__PURE__ */ require_runtime.__exportAll({
15
- default: () => withPlugin,
16
- withPlugin: () => withPlugin
17
- });
18
5
  /**
19
6
  * A Next.js configuration function that integrates Powerlines into the build process.
20
7
  *
@@ -47,10 +34,4 @@ function withPlugin(options) {
47
34
 
48
35
  //#endregion
49
36
  exports.default = withPlugin;
50
- exports.withPlugin = withPlugin;
51
- Object.defineProperty(exports, 'next_exports', {
52
- enumerable: true,
53
- get: function () {
54
- return next_exports;
55
- }
56
- });
37
+ exports.withPlugin = withPlugin;
package/dist/next.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 { NextConfig } from "next";
4
2
 
5
3
  //#region src/next.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"next.d.mts","names":[],"sources":["../src/next.ts"],"mappings":";;;;;;;;;;;;;;;AAyCA;;;;;;;;iBAAgB,UAAA,CAAW,OAAA,EAAS,UAAA,GAAa,UAAU"}
1
+ {"version":3,"file":"next.d.mts","names":[],"sources":["../src/next.ts"],"mappings":";;;;;AAyCA;;;;;;;;AAA2D;;;;;;;;iBAA3C,UAAA,CAAW,OAAA,EAAS,UAAA,GAAa,UAAU"}
package/dist/next.mjs CHANGED
@@ -1,19 +1,6 @@
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
- import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
10
1
  import plugin from "./webpack.mjs";
11
2
 
12
3
  //#region src/next.ts
13
- var next_exports = /* @__PURE__ */ __exportAll({
14
- default: () => withPlugin,
15
- withPlugin: () => withPlugin
16
- });
17
4
  /**
18
5
  * A Next.js configuration function that integrates Powerlines into the build process.
19
6
  *
@@ -45,5 +32,5 @@ function withPlugin(options) {
45
32
  }
46
33
 
47
34
  //#endregion
48
- export { withPlugin as default, withPlugin, next_exports };
35
+ export { withPlugin as default, withPlugin };
49
36
  //# sourceMappingURL=next.mjs.map
package/dist/next.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"next.mjs","names":["webpack"],"sources":["../src/next.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 { NextConfig } from \"next\";\nimport type { WebpackConfigContext } from \"next/dist/server/config-shared\";\nimport type { Configuration } from \"webpack\";\nimport webpack from \"./webpack\";\n\n/**\n * A Next.js configuration function that integrates Powerlines into the build process.\n *\n * @see https://nextjs.org/docs/api-reference/next.config.js/introduction\n *\n * @example\n * ```js\n * // next.config.js\n * import withPowerlines from '@powerlines/unplugin/next'\n *\n * export default withPowerlines({\n * reactStrictMode: true,\n * })\n * ```\n *\n * @param options - The Next.js configuration to merge with the Powerlines configuration.\n * @returns The merged Next.js configuration.\n */\nexport function withPlugin(options: NextConfig): NextConfig {\n return {\n ...options,\n webpack(config: Configuration, context: WebpackConfigContext) {\n const result = (options.webpack?.(config, context) ||\n config) as Configuration;\n\n result.plugins ??= [];\n result.plugins.push(webpack());\n\n return result;\n }\n };\n}\n\nexport default withPlugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAgB,WAAW,SAAiC;CAC1D,OAAO;EACL,GAAG;EACH,QAAQ,QAAuB,SAA+B;GAC5D,MAAM,SAAU,QAAQ,UAAU,QAAQ,OAAO,KAC/C;GAEF,OAAO,YAAY,CAAC;GACpB,OAAO,QAAQ,KAAKA,OAAQ,CAAC;GAE7B,OAAO;EACT;CACF;AACF"}
1
+ {"version":3,"file":"next.mjs","names":["webpack"],"sources":["../src/next.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 { NextConfig } from \"next\";\nimport type { WebpackConfigContext } from \"next/dist/server/config-shared\";\nimport type { Configuration } from \"webpack\";\nimport webpack from \"./webpack\";\n\n/**\n * A Next.js configuration function that integrates Powerlines into the build process.\n *\n * @see https://nextjs.org/docs/api-reference/next.config.js/introduction\n *\n * @example\n * ```js\n * // next.config.js\n * import withPowerlines from '@powerlines/unplugin/next'\n *\n * export default withPowerlines({\n * reactStrictMode: true,\n * })\n * ```\n *\n * @param options - The Next.js configuration to merge with the Powerlines configuration.\n * @returns The merged Next.js configuration.\n */\nexport function withPlugin(options: NextConfig): NextConfig {\n return {\n ...options,\n webpack(config: Configuration, context: WebpackConfigContext) {\n const result = (options.webpack?.(config, context) ||\n config) as Configuration;\n\n result.plugins ??= [];\n result.plugins.push(webpack());\n\n return result;\n }\n };\n}\n\nexport default withPlugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyCA,SAAgB,WAAW,SAAiC;CAC1D,OAAO;EACL,GAAG;EACH,QAAQ,QAAuB,SAA+B;GAC5D,MAAM,SAAU,QAAQ,UAAU,QAAQ,OAAO,KAC/C;GAEF,OAAO,YAAY,CAAC;GACpB,OAAO,QAAQ,KAAKA,OAAQ,CAAC;GAE7B,OAAO;EACT;CACF;AACF"}
@@ -0,0 +1,52 @@
1
+ const require_vite = require('./vite.cjs');
2
+ const require_webpack = require('./webpack.cjs');
3
+ let _nuxt_kit = require("@nuxt/kit");
4
+
5
+ //#region package.json
6
+ var name = "@powerlines/unplugin";
7
+ var version = "0.0.76";
8
+
9
+ //#endregion
10
+ //#region src/nuxt.ts
11
+ /**
12
+ * A Nuxt plugin that will invoke the Powerlines API hooks during the build process.
13
+ *
14
+ * @see https://nuxt.com/docs/guide/directory-structure/modules
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * // nuxt.config.ts
19
+ * import { defineNuxtConfig } from "@nuxt/kit";
20
+ *
21
+ * export default defineNuxtConfig({
22
+ * modules: [
23
+ * [
24
+ * "@powerlines/unplugin/nuxt",
25
+ * { name: "example-app", ... }
26
+ * ],
27
+ * ],
28
+ * });
29
+ *
30
+ * ```
31
+ */
32
+ const plugin = (0, _nuxt_kit.defineNuxtModule)({
33
+ meta: {
34
+ name,
35
+ version,
36
+ configKey: "powerlines",
37
+ compatibility: { builder: { vite: "^8.0.0" } }
38
+ },
39
+ defaults: {},
40
+ setup(options) {
41
+ (0, _nuxt_kit.addVitePlugin)(() => require_vite.default(options));
42
+ (0, _nuxt_kit.addWebpackPlugin)(() => require_webpack.default(options));
43
+ }
44
+ });
45
+
46
+ //#endregion
47
+ Object.defineProperty(exports, 'plugin', {
48
+ enumerable: true,
49
+ get: function () {
50
+ return plugin;
51
+ }
52
+ });