@powerlines/unplugin 0.0.74 → 0.0.76

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 (147) hide show
  1. package/dist/astro.cjs +11 -0
  2. package/dist/astro.mjs +6 -1
  3. package/dist/astro.mjs.map +1 -1
  4. package/dist/astro.test.cjs +23 -0
  5. package/dist/astro.test.d.cts +1 -0
  6. package/dist/astro.test.d.mts +2 -0
  7. package/dist/astro.test.mjs +25 -0
  8. package/dist/astro.test.mjs.map +1 -0
  9. package/dist/esbuild.d.cts.map +1 -1
  10. package/dist/esbuild.d.mts.map +1 -1
  11. package/dist/esbuild.test.cjs +32 -0
  12. package/dist/esbuild.test.d.cts +1 -0
  13. package/dist/esbuild.test.d.mts +2 -0
  14. package/dist/esbuild.test.mjs +34 -0
  15. package/dist/esbuild.test.mjs.map +1 -0
  16. package/dist/farm.cjs +12 -1
  17. package/dist/farm.d.cts.map +1 -1
  18. package/dist/farm.d.mts.map +1 -1
  19. package/dist/farm.mjs +6 -1
  20. package/dist/farm.mjs.map +1 -1
  21. package/dist/farm.test.cjs +23 -0
  22. package/dist/farm.test.d.cts +1 -0
  23. package/dist/farm.test.d.mts +2 -0
  24. package/dist/farm.test.mjs +25 -0
  25. package/dist/farm.test.mjs.map +1 -0
  26. package/dist/index.cjs +2 -1
  27. package/dist/index.mjs +2 -1
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/index.test.cjs +35 -0
  30. package/dist/index.test.d.cts +1 -0
  31. package/dist/index.test.d.mts +2 -0
  32. package/dist/index.test.mjs +37 -0
  33. package/dist/index.test.mjs.map +1 -0
  34. package/dist/next.cjs +12 -1
  35. package/dist/next.mjs +6 -1
  36. package/dist/next.mjs.map +1 -1
  37. package/dist/next.test.cjs +23 -0
  38. package/dist/next.test.d.cts +1 -0
  39. package/dist/next.test.d.mts +2 -0
  40. package/dist/next.test.mjs +25 -0
  41. package/dist/next.test.mjs.map +1 -0
  42. package/dist/nuxt.cjs +10 -1
  43. package/dist/nuxt.mjs +3 -1
  44. package/dist/nuxt.mjs.map +1 -1
  45. package/dist/nuxt.test.cjs +23 -0
  46. package/dist/nuxt.test.d.cts +1 -0
  47. package/dist/nuxt.test.d.mts +2 -0
  48. package/dist/nuxt.test.mjs +25 -0
  49. package/dist/nuxt.test.mjs.map +1 -0
  50. package/dist/package.cjs +1 -1
  51. package/dist/package.mjs +1 -1
  52. package/dist/rolldown.cjs +13 -1
  53. package/dist/rolldown.d.cts.map +1 -1
  54. package/dist/rolldown.d.mts.map +1 -1
  55. package/dist/rolldown.mjs +8 -1
  56. package/dist/rolldown.mjs.map +1 -1
  57. package/dist/rolldown.test.cjs +23 -0
  58. package/dist/rolldown.test.d.cts +1 -0
  59. package/dist/rolldown.test.d.mts +2 -0
  60. package/dist/rolldown.test.mjs +25 -0
  61. package/dist/rolldown.test.mjs.map +1 -0
  62. package/dist/rollup.cjs +14 -1
  63. package/dist/rollup.d.cts.map +1 -1
  64. package/dist/rollup.d.mts.map +1 -1
  65. package/dist/rollup.mjs +9 -1
  66. package/dist/rollup.mjs.map +1 -1
  67. package/dist/rollup.test.cjs +23 -0
  68. package/dist/rollup.test.d.cts +1 -0
  69. package/dist/rollup.test.d.mts +2 -0
  70. package/dist/rollup.test.mjs +25 -0
  71. package/dist/rollup.test.mjs.map +1 -0
  72. package/dist/rspack.cjs +13 -1
  73. package/dist/rspack.d.cts.map +1 -1
  74. package/dist/rspack.d.mts.map +1 -1
  75. package/dist/rspack.mjs +8 -1
  76. package/dist/rspack.mjs.map +1 -1
  77. package/dist/rspack.test.cjs +23 -0
  78. package/dist/rspack.test.d.cts +1 -0
  79. package/dist/rspack.test.d.mts +2 -0
  80. package/dist/rspack.test.mjs +25 -0
  81. package/dist/rspack.test.mjs.map +1 -0
  82. package/dist/tsdown.cjs +16 -1
  83. package/dist/tsdown.d.cts.map +1 -1
  84. package/dist/tsdown.d.mts.map +1 -1
  85. package/dist/tsdown.mjs +11 -1
  86. package/dist/tsdown.mjs.map +1 -1
  87. package/dist/tsdown.test.cjs +23 -0
  88. package/dist/tsdown.test.d.cts +1 -0
  89. package/dist/tsdown.test.d.mts +2 -0
  90. package/dist/tsdown.test.mjs +25 -0
  91. package/dist/tsdown.test.mjs.map +1 -0
  92. package/dist/tsup.cjs +14 -1
  93. package/dist/tsup.d.cts.map +1 -1
  94. package/dist/tsup.d.mts.map +1 -1
  95. package/dist/tsup.mjs +9 -1
  96. package/dist/tsup.mjs.map +1 -1
  97. package/dist/tsup.test.cjs +23 -0
  98. package/dist/tsup.test.d.cts +1 -0
  99. package/dist/tsup.test.d.mts +2 -0
  100. package/dist/tsup.test.mjs +25 -0
  101. package/dist/tsup.test.mjs.map +1 -0
  102. package/dist/types.cjs +13 -0
  103. package/dist/types.mjs +8 -1
  104. package/dist/types.mjs.map +1 -0
  105. package/dist/types.test.cjs +23 -0
  106. package/dist/types.test.d.cts +1 -0
  107. package/dist/types.test.d.mts +2 -0
  108. package/dist/types.test.mjs +25 -0
  109. package/dist/types.test.mjs.map +1 -0
  110. package/dist/unloader.cjs +13 -1
  111. package/dist/unloader.d.cts.map +1 -1
  112. package/dist/unloader.d.mts.map +1 -1
  113. package/dist/unloader.mjs +7 -1
  114. package/dist/unloader.mjs.map +1 -1
  115. package/dist/unloader.test.cjs +23 -0
  116. package/dist/unloader.test.d.cts +1 -0
  117. package/dist/unloader.test.d.mts +2 -0
  118. package/dist/unloader.test.mjs +25 -0
  119. package/dist/unloader.test.mjs.map +1 -0
  120. package/dist/unplugin.cjs +8 -0
  121. package/dist/unplugin.d.cts.map +1 -1
  122. package/dist/unplugin.d.mts.map +1 -1
  123. package/dist/unplugin.mjs +4 -1
  124. package/dist/unplugin.mjs.map +1 -1
  125. package/dist/unplugin.test.cjs +23 -0
  126. package/dist/unplugin.test.d.cts +1 -0
  127. package/dist/unplugin.test.d.mts +2 -0
  128. package/dist/unplugin.test.mjs +25 -0
  129. package/dist/unplugin.test.mjs.map +1 -0
  130. package/dist/vite.d.cts.map +1 -1
  131. package/dist/vite.d.mts.map +1 -1
  132. package/dist/vite.test.cjs +26 -0
  133. package/dist/vite.test.d.cts +1 -0
  134. package/dist/vite.test.d.mts +2 -0
  135. package/dist/vite.test.mjs +28 -0
  136. package/dist/vite.test.mjs.map +1 -0
  137. package/dist/webpack.cjs +13 -1
  138. package/dist/webpack.d.cts.map +1 -1
  139. package/dist/webpack.d.mts.map +1 -1
  140. package/dist/webpack.mjs +8 -1
  141. package/dist/webpack.mjs.map +1 -1
  142. package/dist/webpack.test.cjs +23 -0
  143. package/dist/webpack.test.d.cts +1 -0
  144. package/dist/webpack.test.d.mts +2 -0
  145. package/dist/webpack.test.mjs +25 -0
  146. package/dist/webpack.test.mjs.map +1 -0
  147. package/package.json +77 -13
package/dist/nuxt.cjs CHANGED
@@ -6,12 +6,15 @@ import __tsdown_shims_url from 'node:url'
6
6
  const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
7
  const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
8
 
9
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
10
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
9
11
  const require_vite = require('./vite.cjs');
10
12
  const require_webpack = require('./webpack.cjs');
11
13
  const require_package = require('./package.cjs');
12
14
  let _nuxt_kit = require("@nuxt/kit");
13
15
 
14
16
  //#region src/nuxt.ts
17
+ var nuxt_exports = /* @__PURE__ */ require_runtime.__exportAll({ default: () => plugin });
15
18
  /**
16
19
  * A Nuxt plugin that will invoke the Powerlines API hooks during the build process.
17
20
  *
@@ -48,4 +51,10 @@ const plugin = (0, _nuxt_kit.defineNuxtModule)({
48
51
  });
49
52
 
50
53
  //#endregion
51
- module.exports = plugin;
54
+ exports.default = plugin;
55
+ Object.defineProperty(exports, 'nuxt_exports', {
56
+ enumerable: true,
57
+ get: function () {
58
+ return nuxt_exports;
59
+ }
60
+ });
package/dist/nuxt.mjs CHANGED
@@ -6,12 +6,14 @@ import __tsdown_shims_url from 'node:url'
6
6
  const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
7
  const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
8
 
9
+ import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
9
10
  import plugin$1 from "./vite.mjs";
10
11
  import plugin$2 from "./webpack.mjs";
11
12
  import { name, version } from "./package.mjs";
12
13
  import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
13
14
 
14
15
  //#region src/nuxt.ts
16
+ var nuxt_exports = /* @__PURE__ */ __exportAll({ default: () => plugin });
15
17
  /**
16
18
  * A Nuxt plugin that will invoke the Powerlines API hooks during the build process.
17
19
  *
@@ -48,5 +50,5 @@ const plugin = defineNuxtModule({
48
50
  });
49
51
 
50
52
  //#endregion
51
- export { plugin as default };
53
+ export { plugin as default, nuxt_exports };
52
54
  //# sourceMappingURL=nuxt.mjs.map
package/dist/nuxt.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"nuxt.mjs","names":["vite","webpack"],"sources":["../src/nuxt.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 { addVitePlugin, addWebpackPlugin, defineNuxtModule } from \"@nuxt/kit\";\nimport type { UserConfig } from \"@powerlines/core\";\nimport { name, version } from \"../package.json\";\nimport vite from \"./vite\";\nimport webpack from \"./webpack\";\n\n/**\n * A Nuxt plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://nuxt.com/docs/guide/directory-structure/modules\n *\n * @example\n * ```ts\n * // nuxt.config.ts\n * import { defineNuxtConfig } from \"@nuxt/kit\";\n *\n * export default defineNuxtConfig({\n * modules: [\n * [\n * \"@powerlines/unplugin/nuxt\",\n * { name: \"example-app\", ... }\n * ],\n * ],\n * });\n *\n * ```\n */\nconst plugin = defineNuxtModule<UserConfig>({\n meta: {\n name,\n version,\n configKey: \"powerlines\",\n compatibility: {\n builder: {\n vite: \"^8.0.0\"\n }\n }\n },\n defaults: {},\n setup(options) {\n addVitePlugin(() => vite(options));\n addWebpackPlugin(() => webpack(options));\n }\n});\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAM,SAAS,iBAA6B;CAC1C,MAAM;EACJ;EACA;EACA,WAAW;EACX,eAAe,EACb,SAAS,EACP,MAAM,SACR,EACF;CACF;CACA,UAAU,CAAC;CACX,MAAM,SAAS;EACb,oBAAoBA,SAAK,OAAO,CAAC;EACjC,uBAAuBC,SAAQ,OAAO,CAAC;CACzC;AACF,CAAC"}
1
+ {"version":3,"file":"nuxt.mjs","names":["vite","webpack"],"sources":["../src/nuxt.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 { addVitePlugin, addWebpackPlugin, defineNuxtModule } from \"@nuxt/kit\";\nimport type { UserConfig } from \"@powerlines/core\";\nimport { name, version } from \"../package.json\";\nimport vite from \"./vite\";\nimport webpack from \"./webpack\";\n\n/**\n * A Nuxt plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://nuxt.com/docs/guide/directory-structure/modules\n *\n * @example\n * ```ts\n * // nuxt.config.ts\n * import { defineNuxtConfig } from \"@nuxt/kit\";\n *\n * export default defineNuxtConfig({\n * modules: [\n * [\n * \"@powerlines/unplugin/nuxt\",\n * { name: \"example-app\", ... }\n * ],\n * ],\n * });\n *\n * ```\n */\nconst plugin = defineNuxtModule<UserConfig>({\n meta: {\n name,\n version,\n configKey: \"powerlines\",\n compatibility: {\n builder: {\n vite: \"^8.0.0\"\n }\n }\n },\n defaults: {},\n setup(options) {\n addVitePlugin(() => vite(options));\n addWebpackPlugin(() => webpack(options));\n }\n});\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAM,SAAS,iBAA6B;CAC1C,MAAM;EACJ;EACA;EACA,WAAW;EACX,eAAe,EACb,SAAS,EACP,MAAM,SACR,EACF;CACF;CACA,UAAU,CAAC;CACX,MAAM,SAAS;EACb,oBAAoBA,SAAK,OAAO,CAAC;EACjC,uBAAuBC,SAAQ,OAAO,CAAC;CACzC;AACF,CAAC"}
@@ -0,0 +1,23 @@
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
+ const require_nuxt = require('./nuxt.cjs');
10
+ let vitest = require("vitest");
11
+
12
+ //#region src/nuxt.test.ts
13
+ (0, vitest.describe)("devkit/unplugin/src/nuxt.ts", () => {
14
+ (0, vitest.it)("loads module exports", () => {
15
+ (0, vitest.expect)(require_nuxt.nuxt_exports).toBeDefined();
16
+ (0, vitest.expect)(typeof require_nuxt.nuxt_exports).toBe("object");
17
+ });
18
+ (0, vitest.it)("has at least one runtime export", () => {
19
+ (0, vitest.expect)(Object.keys(require_nuxt.nuxt_exports).length).toBeGreaterThan(0);
20
+ });
21
+ });
22
+
23
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,2 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
@@ -0,0 +1,25 @@
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 { nuxt_exports } from "./nuxt.mjs";
10
+ import { describe, expect, it } from "vitest";
11
+
12
+ //#region src/nuxt.test.ts
13
+ describe("devkit/unplugin/src/nuxt.ts", () => {
14
+ it("loads module exports", () => {
15
+ expect(nuxt_exports).toBeDefined();
16
+ expect(typeof nuxt_exports).toBe("object");
17
+ });
18
+ it("has at least one runtime export", () => {
19
+ expect(Object.keys(nuxt_exports).length).toBeGreaterThan(0);
20
+ });
21
+ });
22
+
23
+ //#endregion
24
+ export { };
25
+ //# sourceMappingURL=nuxt.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nuxt.test.mjs","names":["moduleExports"],"sources":["../src/nuxt.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./nuxt\";\n\ndescribe(\"devkit/unplugin/src/nuxt.ts\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;;;;;;;AAGA,SAAS,qCAAqC;CAC5C,GAAG,8BAA8B;EAC/B,OAAOA,YAAa,EAAE,YAAY;EAClC,OAAO,OAAOA,YAAa,EAAE,KAAK,QAAQ;CAC5C,CAAC;CAED,GAAG,yCAAyC;EAC1C,OAAO,OAAO,KAAKA,YAAa,EAAE,MAAM,EAAE,gBAAgB,CAAC;CAC7D,CAAC;AACH,CAAC"}
package/dist/package.cjs CHANGED
@@ -9,7 +9,7 @@ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TS
9
9
 
10
10
  //#region package.json
11
11
  var name = "@powerlines/unplugin";
12
- var version = "0.0.73";
12
+ var version = "0.0.75";
13
13
 
14
14
  //#endregion
15
15
  Object.defineProperty(exports, 'name', {
package/dist/package.mjs CHANGED
@@ -8,7 +8,7 @@ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TS
8
8
 
9
9
  //#region package.json
10
10
  var name = "@powerlines/unplugin";
11
- var version = "0.0.73";
11
+ var version = "0.0.75";
12
12
 
13
13
  //#endregion
14
14
  export { name, version };
package/dist/rolldown.cjs CHANGED
@@ -29,6 +29,12 @@ let rollup_plugin_typescript2 = require("rollup-plugin-typescript2");
29
29
  rollup_plugin_typescript2 = require_runtime.__toESM(rollup_plugin_typescript2, 1);
30
30
 
31
31
  //#region src/rolldown.ts
32
+ var rolldown_exports = /* @__PURE__ */ require_runtime.__exportAll({
33
+ DEFAULT_OPTIONS: () => DEFAULT_OPTIONS,
34
+ createRolldownFactory: () => createRolldownFactory,
35
+ default: () => plugin,
36
+ resolveOptions: () => resolveOptions
37
+ });
32
38
  const DEFAULT_OPTIONS = {
33
39
  keepNames: true,
34
40
  treeshake: true,
@@ -211,4 +217,10 @@ const plugin = (0, unplugin.createRolldownPlugin)(createRolldownFactory());
211
217
  exports.DEFAULT_OPTIONS = DEFAULT_OPTIONS;
212
218
  exports.createRolldownFactory = createRolldownFactory;
213
219
  exports.default = plugin;
214
- exports.resolveOptions = resolveOptions;
220
+ exports.resolveOptions = resolveOptions;
221
+ Object.defineProperty(exports, 'rolldown_exports', {
222
+ enumerable: true,
223
+ get: function () {
224
+ return rolldown_exports;
225
+ }
226
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"rolldown.d.cts","names":[],"sources":["../src/rolldown.ts"],"mappings":";;;;;;cA6Ca,eAAA;;;;;;;;;;;;;AAeb;iBAAgB,cAAA,kBAAgC,iBAAA,CAAA,CAC9C,OAAA,EAAS,QAAA,GACR,eAAA;;;;;;;;;;;;;AAAe;AA4PlB;;;;;;;;;iBAAgB,qBAAA,kBAAuC,gBAAA,CAAA,CACrD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;;AAAA;cAuC7D,MAAA,GAAM,OAAA,GAAgD,wBAAA,iBAAhD,MAAA,QAAA,MAAA"}
1
+ {"version":3,"file":"rolldown.d.cts","names":[],"sources":["../src/rolldown.ts"],"mappings":";;;;;;cA6Ca,eAAA;;;;;;;;;;;;;AAeb;iBAAgB,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,GACR,eAAA;;;;;;;;;;;;;AAAe;AA4PlB;;;;;;;;;iBAAgB,qBAAA,kBAAuC,gBAAA,EACrD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;;AAAA;cAuC7D,MAAA,GAAM,OAAA,GAAgD,wBAAA,iBAAhD,MAAA,QAAA,MAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"rolldown.d.mts","names":[],"sources":["../src/rolldown.ts"],"mappings":";;;;;;;;cA6Ca,eAAA;;;;;;;;;;AAAb;;;;iBAegB,cAAA,kBAAgC,iBAAA,CAAA,CAC9C,OAAA,EAAS,QAAA,GACR,eAAA;;;;;;;AAFH;;;;;;;;;;;;;;AAEkB;AA4PlB;iBAAgB,qBAAA,kBAAuC,gBAAA,CAAA,CACrD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;;;cAuC7D,MAAA,GAAM,OAAA,GAAgD,wBAAA,iBAAhD,MAAA,QAAA,MAAA"}
1
+ {"version":3,"file":"rolldown.d.mts","names":[],"sources":["../src/rolldown.ts"],"mappings":";;;;;;;;cA6Ca,eAAA;;;;;;;;;;AAAb;;;;iBAegB,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,GACR,eAAA;;;;;;;AAFH;;;;;;;;;;;;;;AAEkB;AA4PlB;iBAAgB,qBAAA,kBAAuC,gBAAA,EACrD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;;;cAuC7D,MAAA,GAAM,OAAA,GAAgD,wBAAA,iBAAhD,MAAA,QAAA,MAAA"}
package/dist/rolldown.mjs CHANGED
@@ -6,6 +6,7 @@ import __tsdown_shims_url from 'node:url'
6
6
  const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
7
  const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
8
 
9
+ import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
9
10
  import { createUnpluginFactory } from "./unplugin.mjs";
10
11
  import { builtinModules } from "node:module";
11
12
  import { appendPath } from "@stryke/path/append";
@@ -23,6 +24,12 @@ import { viteAliasPlugin } from "rolldown/experimental";
23
24
  import typescriptPlugin from "rollup-plugin-typescript2";
24
25
 
25
26
  //#region src/rolldown.ts
27
+ var rolldown_exports = /* @__PURE__ */ __exportAll({
28
+ DEFAULT_OPTIONS: () => DEFAULT_OPTIONS,
29
+ createRolldownFactory: () => createRolldownFactory,
30
+ default: () => plugin,
31
+ resolveOptions: () => resolveOptions
32
+ });
26
33
  const DEFAULT_OPTIONS = {
27
34
  keepNames: true,
28
35
  treeshake: true,
@@ -202,5 +209,5 @@ function createRolldownFactory(options = {}, decorate = (options) => options) {
202
209
  const plugin = createRolldownPlugin(createRolldownFactory());
203
210
 
204
211
  //#endregion
205
- export { DEFAULT_OPTIONS, createRolldownFactory, plugin as default, resolveOptions };
212
+ export { DEFAULT_OPTIONS, createRolldownFactory, plugin as default, resolveOptions, rolldown_exports };
206
213
  //# sourceMappingURL=rolldown.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"rolldown.mjs","names":["defu","alias","dtsBundlePlugin"],"sources":["../src/rolldown.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 UnpluginOptions,\n UnresolvedContext\n} from \"@powerlines/core\";\nimport inject from \"@rollup/plugin-inject\";\nimport resolve from \"@rollup/plugin-node-resolve\";\nimport replace from \"@rollup/plugin-replace\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { defu } from \"defu\";\nimport { globSync } from \"glob\";\nimport { builtinModules } from \"node:module\";\nimport type { InputOptions, Plugin } from \"rolldown\";\nimport { RolldownOptions, RollupLog } from \"rolldown\";\nimport { dts as dtsBundlePlugin } from \"rolldown-plugin-dts\";\nimport { viteAliasPlugin as alias } from \"rolldown/experimental\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport { createRolldownPlugin } from \"unplugin\";\nimport {\n createUnpluginFactory,\n UnpluginFactoryDecorator,\n UnpluginFactoryOptions\n} from \"./unplugin\";\n\nexport const DEFAULT_OPTIONS = {\n keepNames: true,\n treeshake: true,\n shimMissingExports: true,\n transform: {\n target: \"esnext\"\n }\n};\n\n/**\n * Resolves the options for [rolldown](https://rolldown.rs).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions<TContext extends UnresolvedContext>(\n context: TContext\n): RolldownOptions {\n return defu<RolldownOptions, any>(\n {\n input: globSync(\n toArray(context.entry).map(entry =>\n isString(entry) ? entry : entry.file\n )\n ).flat(),\n external: (source: string) => {\n if (\n context.config.resolve.external &&\n toArray(context.config.resolve.external).includes(source)\n ) {\n return true;\n }\n\n if (\n context.config.resolve.noExternal &&\n toArray(context.config.resolve.noExternal).includes(source)\n ) {\n return false;\n }\n\n if (context.builtins.includes(source)) {\n return context.config.projectType !== \"application\";\n }\n\n return !context.config.resolve.skipNodeModulesBundle;\n },\n plugins: [\n typescriptPlugin({\n check: false,\n tsconfig: context.tsconfig.tsconfigFilePath\n }),\n context.config.define &&\n Object.keys(context.config.define).length > 0 &&\n replace({\n sourceMap: context.config.mode === \"development\",\n preventAssignment: true,\n ...(context.config.define ?? {})\n }),\n context.config.inject &&\n Object.keys(context.config.inject).length > 0 &&\n inject({\n sourceMap: context.config.mode === \"development\",\n ...context.config.inject\n }),\n alias({\n entries: Object.entries(context.alias).reduce(\n (ret, [id, path]) => {\n if (!ret.find(e => e.find === id)) {\n ret.push({\n find: id,\n replacement: path\n });\n } else {\n context.warn(\n `Duplicate alias entry for '${id}' detected. The first entry will be used.`\n );\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n )\n }),\n resolve({\n moduleDirectories: [\"node_modules\"],\n preferBuiltins: true\n }),\n context.config.output.dts &&\n toArray(context.config.output.format).includes(\"esm\")\n ? dtsBundlePlugin({\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.config.cwd\n )\n })\n : undefined,\n context.config.output.dts &&\n toArray(context.config.output.format).includes(\"cjs\")\n ? dtsBundlePlugin({\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.config.cwd\n ),\n emitDtsOnly: true,\n cjsDefault: true\n })\n : undefined,\n {\n name: `powerlines:node-protocol`,\n resolveId: {\n order: \"pre\",\n filter: {\n id:\n context.config.output.nodeProtocol === \"strip\"\n ? new RegExp(\n `^node:(${builtinModules\n .filter(mod => !mod.startsWith(\"node:\"))\n .join(\"|\")})$`\n )\n : new RegExp(\n `^(${builtinModules\n .filter(mod => !mod.startsWith(\"node:\"))\n .join(\"|\")})$`\n )\n },\n handler:\n context.config.output.nodeProtocol === \"strip\"\n ? async (id: string, ...args: any[]) => {\n const resolved = await context.resolve(\n id.slice(5),\n ...args\n );\n if (resolved && !resolved.external) {\n return resolved;\n }\n\n return {\n id: id.slice(5), // \"node:\".length\n external: true,\n moduleSideEffects: false\n };\n }\n : id => {\n return {\n id: `node:${id}`,\n external: true,\n moduleSideEffects: false\n };\n }\n }\n } as Plugin\n ].filter(Boolean) as Plugin[],\n resolve: {\n alias: context.alias,\n mainFields: context.config.resolve.mainFields,\n define: context.config.define,\n extensions: context.config.resolve.extensions\n },\n transform: {\n target: context.tsconfig.tsconfigJson?.compilerOptions?.target,\n define: context.config.define,\n inject: context.config.inject\n },\n platform: context.config.platform,\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.config.cwd\n ),\n cache: !context.config.skipCache\n ? joinPaths(context.cachePath, \"rolldown\")\n : false,\n logLevel:\n context.config.logLevel.general === \"trace\"\n ? \"debug\"\n : context.config.logLevel.general === \"debug\"\n ? \"warn\"\n : \"error\",\n onLog(level: \"info\" | \"debug\" | \"warn\", log: RollupLog) {\n if (\n context.config.logLevel.general !== \"trace\" &&\n level === \"warn\" &&\n log.code === \"PLUGIN_TIMINGS\"\n ) {\n return;\n }\n\n if (log.message?.trim()) {\n if (level === \"info\") {\n context.logger.debug(log.message?.trim() ?? \"\");\n } else {\n context.logger.log(level, log.message?.trim() ?? \"\");\n }\n }\n },\n output: [\n toArray(context.config.output.format).includes(\"esm\")\n ? {\n dir: context.config.output.path,\n format: \"es\",\n sourcemap: context.config.output.sourceMap,\n codeSplitting: true,\n exports: \"named\",\n minify: context.config.output.minify\n ? {\n compress: {\n dropDebugger:\n context.config.mode === \"production\" ? true : undefined,\n unused:\n context.config.mode === \"production\" ? true : undefined,\n treeshake: true\n },\n mangle: true\n }\n : context.config.mode === \"production\"\n ? \"dce-only\"\n : undefined\n }\n : undefined,\n toArray(context.config.output.format).includes(\"cjs\")\n ? {\n dir: context.config.output.path,\n format: \"cjs\",\n sourcemap: context.config.output.sourceMap,\n codeSplitting: true,\n exports: \"auto\",\n minify: context.config.output.minify\n ? {\n compress: {\n dropDebugger:\n context.config.mode === \"production\" ? true : undefined,\n unused:\n context.config.mode === \"production\" ? true : undefined,\n treeshake: true\n },\n mangle: true\n }\n : context.config.mode === \"production\"\n ? \"dce-only\"\n : undefined\n }\n : undefined\n ].filter(Boolean) as RolldownOptions[\"output\"]\n },\n DEFAULT_OPTIONS\n );\n}\n\n/**\n * Creates a Rolldown plugin factory that generates a plugin instance.\n *\n * @see https://rolldown.rs/guide/en/#plugins-overview\n *\n * @example\n * ```ts\n * // rolldown.config.ts\n * import { createRolldownFactory } from \"@powerlines/unplugin/rolldown\";\n *\n * const powerlinesPlugin = createRolldownFactory({ 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 Rolldown plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Rolldown build.\n */\nexport function createRolldownFactory<TContext extends ExecutionContext>(\n options: Omit<UnpluginFactoryOptions, \"variant\"> = {},\n decorate: UnpluginFactoryDecorator<TContext> = options => options\n) {\n return createUnpluginFactory({ ...options, variant: \"rolldown\" }, unplugin =>\n decorate({\n ...(unplugin as UnpluginOptions<TContext>),\n rolldown: {\n async options(options: InputOptions) {\n const environment = await unplugin.context.getEnvironment();\n\n return defu(\n resolveOptions(environment),\n options,\n (await unplugin.context.callHook(\n \"rolldown:options\",\n { environment },\n options\n )) ?? {}\n );\n }\n }\n })\n );\n}\n\n/**\n * A Rolldown plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://rolldown.rs/guide/en/#plugins-overview\n *\n * @example\n * ```ts\n * // rolldown.config.ts\n * import powerlines from \"@powerlines/unplugin/rolldown\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * })\n * ```\n */\nconst plugin = createRolldownPlugin(createRolldownFactory());\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,kBAAkB;CAC7B,WAAW;CACX,WAAW;CACX,oBAAoB;CACpB,WAAW,EACT,QAAQ,SACV;AACF;;;;;;;AAQA,SAAgB,eACd,SACiB;CACjB,OAAOA,OACL;EACE,OAAO,SACL,QAAQ,QAAQ,KAAK,EAAE,KAAI,UACzB,SAAS,KAAK,IAAI,QAAQ,MAAM,IAClC,CACF,EAAE,KAAK;EACP,WAAW,WAAmB;GAC5B,IACE,QAAQ,OAAO,QAAQ,YACvB,QAAQ,QAAQ,OAAO,QAAQ,QAAQ,EAAE,SAAS,MAAM,GAExD,OAA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uB;GACnC,MAAM,cAAc,MAAM,SAAS,QAAQ,eAAe;GAE1D,OAAOF,OACL,eAAe,WAAW,GAC1B,SACC,MAAM,SAAS,QAAQ,SACtB,oBACA,EAAE,YAAY,GACd,OACF,KAAM,CAAC,CACT;EACF,EACF;CACF,CAAC,CACH;AACF;;;;;;;;;;;;;;;;AAiBA,MAAM,SAAS,qBAAqB,sBAAsB,CAAC"}
1
+ {"version":3,"file":"rolldown.mjs","names":["defu","alias","dtsBundlePlugin"],"sources":["../src/rolldown.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 UnpluginOptions,\n UnresolvedContext\n} from \"@powerlines/core\";\nimport inject from \"@rollup/plugin-inject\";\nimport resolve from \"@rollup/plugin-node-resolve\";\nimport replace from \"@rollup/plugin-replace\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { defu } from \"defu\";\nimport { globSync } from \"glob\";\nimport { builtinModules } from \"node:module\";\nimport type { InputOptions, Plugin } from \"rolldown\";\nimport { RolldownOptions, RollupLog } from \"rolldown\";\nimport { dts as dtsBundlePlugin } from \"rolldown-plugin-dts\";\nimport { viteAliasPlugin as alias } from \"rolldown/experimental\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport { createRolldownPlugin } from \"unplugin\";\nimport {\n createUnpluginFactory,\n UnpluginFactoryDecorator,\n UnpluginFactoryOptions\n} from \"./unplugin\";\n\nexport const DEFAULT_OPTIONS = {\n keepNames: true,\n treeshake: true,\n shimMissingExports: true,\n transform: {\n target: \"esnext\"\n }\n};\n\n/**\n * Resolves the options for [rolldown](https://rolldown.rs).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions<TContext extends UnresolvedContext>(\n context: TContext\n): RolldownOptions {\n return defu<RolldownOptions, any>(\n {\n input: globSync(\n toArray(context.entry).map(entry =>\n isString(entry) ? entry : entry.file\n )\n ).flat(),\n external: (source: string) => {\n if (\n context.config.resolve.external &&\n toArray(context.config.resolve.external).includes(source)\n ) {\n return true;\n }\n\n if (\n context.config.resolve.noExternal &&\n toArray(context.config.resolve.noExternal).includes(source)\n ) {\n return false;\n }\n\n if (context.builtins.includes(source)) {\n return context.config.projectType !== \"application\";\n }\n\n return !context.config.resolve.skipNodeModulesBundle;\n },\n plugins: [\n typescriptPlugin({\n check: false,\n tsconfig: context.tsconfig.tsconfigFilePath\n }),\n context.config.define &&\n Object.keys(context.config.define).length > 0 &&\n replace({\n sourceMap: context.config.mode === \"development\",\n preventAssignment: true,\n ...(context.config.define ?? {})\n }),\n context.config.inject &&\n Object.keys(context.config.inject).length > 0 &&\n inject({\n sourceMap: context.config.mode === \"development\",\n ...context.config.inject\n }),\n alias({\n entries: Object.entries(context.alias).reduce(\n (ret, [id, path]) => {\n if (!ret.find(e => e.find === id)) {\n ret.push({\n find: id,\n replacement: path\n });\n } else {\n context.warn(\n `Duplicate alias entry for '${id}' detected. The first entry will be used.`\n );\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n )\n }),\n resolve({\n moduleDirectories: [\"node_modules\"],\n preferBuiltins: true\n }),\n context.config.output.dts &&\n toArray(context.config.output.format).includes(\"esm\")\n ? dtsBundlePlugin({\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.config.cwd\n )\n })\n : undefined,\n context.config.output.dts &&\n toArray(context.config.output.format).includes(\"cjs\")\n ? dtsBundlePlugin({\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.config.cwd\n ),\n emitDtsOnly: true,\n cjsDefault: true\n })\n : undefined,\n {\n name: `powerlines:node-protocol`,\n resolveId: {\n order: \"pre\",\n filter: {\n id:\n context.config.output.nodeProtocol === \"strip\"\n ? new RegExp(\n `^node:(${builtinModules\n .filter(mod => !mod.startsWith(\"node:\"))\n .join(\"|\")})$`\n )\n : new RegExp(\n `^(${builtinModules\n .filter(mod => !mod.startsWith(\"node:\"))\n .join(\"|\")})$`\n )\n },\n handler:\n context.config.output.nodeProtocol === \"strip\"\n ? async (id: string, ...args: any[]) => {\n const resolved = await context.resolve(\n id.slice(5),\n ...args\n );\n if (resolved && !resolved.external) {\n return resolved;\n }\n\n return {\n id: id.slice(5), // \"node:\".length\n external: true,\n moduleSideEffects: false\n };\n }\n : id => {\n return {\n id: `node:${id}`,\n external: true,\n moduleSideEffects: false\n };\n }\n }\n } as Plugin\n ].filter(Boolean) as Plugin[],\n resolve: {\n alias: context.alias,\n mainFields: context.config.resolve.mainFields,\n define: context.config.define,\n extensions: context.config.resolve.extensions\n },\n transform: {\n target: context.tsconfig.tsconfigJson?.compilerOptions?.target,\n define: context.config.define,\n inject: context.config.inject\n },\n platform: context.config.platform,\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.config.cwd\n ),\n cache: !context.config.skipCache\n ? joinPaths(context.cachePath, \"rolldown\")\n : false,\n logLevel:\n context.config.logLevel.general === \"trace\"\n ? \"debug\"\n : context.config.logLevel.general === \"debug\"\n ? \"warn\"\n : \"error\",\n onLog(level: \"info\" | \"debug\" | \"warn\", log: RollupLog) {\n if (\n context.config.logLevel.general !== \"trace\" &&\n level === \"warn\" &&\n log.code === \"PLUGIN_TIMINGS\"\n ) {\n return;\n }\n\n if (log.message?.trim()) {\n if (level === \"info\") {\n context.logger.debug(log.message?.trim() ?? \"\");\n } else {\n context.logger.log(level, log.message?.trim() ?? \"\");\n }\n }\n },\n output: [\n toArray(context.config.output.format).includes(\"esm\")\n ? {\n dir: context.config.output.path,\n format: \"es\",\n sourcemap: context.config.output.sourceMap,\n codeSplitting: true,\n exports: \"named\",\n minify: context.config.output.minify\n ? {\n compress: {\n dropDebugger:\n context.config.mode === \"production\" ? true : undefined,\n unused:\n context.config.mode === \"production\" ? true : undefined,\n treeshake: true\n },\n mangle: true\n }\n : context.config.mode === \"production\"\n ? \"dce-only\"\n : undefined\n }\n : undefined,\n toArray(context.config.output.format).includes(\"cjs\")\n ? {\n dir: context.config.output.path,\n format: \"cjs\",\n sourcemap: context.config.output.sourceMap,\n codeSplitting: true,\n exports: \"auto\",\n minify: context.config.output.minify\n ? {\n compress: {\n dropDebugger:\n context.config.mode === \"production\" ? true : undefined,\n unused:\n context.config.mode === \"production\" ? true : undefined,\n treeshake: true\n },\n mangle: true\n }\n : context.config.mode === \"production\"\n ? \"dce-only\"\n : undefined\n }\n : undefined\n ].filter(Boolean) as RolldownOptions[\"output\"]\n },\n DEFAULT_OPTIONS\n );\n}\n\n/**\n * Creates a Rolldown plugin factory that generates a plugin instance.\n *\n * @see https://rolldown.rs/guide/en/#plugins-overview\n *\n * @example\n * ```ts\n * // rolldown.config.ts\n * import { createRolldownFactory } from \"@powerlines/unplugin/rolldown\";\n *\n * const powerlinesPlugin = createRolldownFactory({ 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 Rolldown plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Rolldown build.\n */\nexport function createRolldownFactory<TContext extends ExecutionContext>(\n options: Omit<UnpluginFactoryOptions, \"variant\"> = {},\n decorate: UnpluginFactoryDecorator<TContext> = options => options\n) {\n return createUnpluginFactory({ ...options, variant: \"rolldown\" }, unplugin =>\n decorate({\n ...(unplugin as UnpluginOptions<TContext>),\n rolldown: {\n async options(options: InputOptions) {\n const environment = await unplugin.context.getEnvironment();\n\n return defu(\n resolveOptions(environment),\n options,\n (await unplugin.context.callHook(\n \"rolldown:options\",\n { environment },\n options\n )) ?? {}\n );\n }\n }\n })\n );\n}\n\n/**\n * A Rolldown plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://rolldown.rs/guide/en/#plugins-overview\n *\n * @example\n * ```ts\n * // rolldown.config.ts\n * import powerlines from \"@powerlines/unplugin/rolldown\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * })\n * ```\n */\nconst plugin = createRolldownPlugin(createRolldownFactory());\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,kBAAkB;CAC7B,WAAW;CACX,WAAW;CACX,oBAAoB;CACpB,WAAW,EACT,QAAQ,SACV;AACF;;;;;;;AAQA,SAAgB,eACd,SACiB;CACjB,OAAOA,OACL;EACE,OAAO,SACL,QAAQ,QAAQ,KAAK,EAAE,KAAI,UACzB,SAAS,KAAK,IAAI,QAAQ,MAAM,IAClC,CACF,EAAE,KAAK;EACP,WAAW,WAAmB;GAC5B,IACE,QAAQ,OAAO,QAAQ,YACvB,QAAQ,QAAQ,OAAO,QAAQ,QAAQ,EAAE,SAAS,MAAM,GAExD,OAAO;GAGT,IACE,QAAQ,OAAO,QAAQ,cACvB,QAAQ,QAAQ,OAAO,QAAQ,UAAU,EAAE,SAAS,MAAM,GAE1D,OAAO;GAGT,IAAI,QAAQ,SAAS,SAAS,MAAM,GAClC,OAAO,QAAQ,OAAO,gBAAgB;GAGxC,OAAO,CAAC,QAAQ,OAAO,QAAQ;EACjC;EACA,SAAS;GACP,iBAAiB;IACf,OAAO;IACP,UAAU,QAAQ,SAAS;GAC7B,CAAC;GACD,QAAQ,O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'
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
+ const require_rolldown = require('./rolldown.cjs');
10
+ let vitest = require("vitest");
11
+
12
+ //#region src/rolldown.test.ts
13
+ (0, vitest.describe)("devkit/unplugin/src/rolldown.ts", () => {
14
+ (0, vitest.it)("loads module exports", () => {
15
+ (0, vitest.expect)(require_rolldown.rolldown_exports).toBeDefined();
16
+ (0, vitest.expect)(typeof require_rolldown.rolldown_exports).toBe("object");
17
+ });
18
+ (0, vitest.it)("has at least one runtime export", () => {
19
+ (0, vitest.expect)(Object.keys(require_rolldown.rolldown_exports).length).toBeGreaterThan(0);
20
+ });
21
+ });
22
+
23
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,2 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
@@ -0,0 +1,25 @@
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 { rolldown_exports } from "./rolldown.mjs";
10
+ import { describe, expect, it } from "vitest";
11
+
12
+ //#region src/rolldown.test.ts
13
+ describe("devkit/unplugin/src/rolldown.ts", () => {
14
+ it("loads module exports", () => {
15
+ expect(rolldown_exports).toBeDefined();
16
+ expect(typeof rolldown_exports).toBe("object");
17
+ });
18
+ it("has at least one runtime export", () => {
19
+ expect(Object.keys(rolldown_exports).length).toBeGreaterThan(0);
20
+ });
21
+ });
22
+
23
+ //#endregion
24
+ export { };
25
+ //# sourceMappingURL=rolldown.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rolldown.test.mjs","names":["moduleExports"],"sources":["../src/rolldown.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./rolldown\";\n\ndescribe(\"devkit/unplugin/src/rolldown.ts\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;;;;;;;AAGA,SAAS,yCAAyC;CAChD,GAAG,8BAA8B;EAC/B,OAAOA,gBAAa,EAAE,YAAY;EAClC,OAAO,OAAOA,gBAAa,EAAE,KAAK,QAAQ;CAC5C,CAAC;CAED,GAAG,yCAAyC;EAC1C,OAAO,OAAO,KAAKA,gBAAa,EAAE,MAAM,EAAE,gBAAgB,CAAC;CAC7D,CAAC;AACH,CAAC"}
package/dist/rollup.cjs CHANGED
@@ -26,6 +26,13 @@ _rollup_plugin_alias = require_runtime.__toESM(_rollup_plugin_alias, 1);
26
26
  let node_fs = require("node:fs");
27
27
 
28
28
  //#region src/rollup.ts
29
+ var rollup_exports = /* @__PURE__ */ require_runtime.__exportAll({
30
+ createRollupFactory: () => createRollupFactory,
31
+ default: () => plugin,
32
+ dtsBundlePlugin: () => dtsBundlePlugin,
33
+ plugin: () => plugin,
34
+ resolveOptions: () => resolveOptions
35
+ });
29
36
  /**
30
37
  * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
31
38
  *
@@ -164,4 +171,10 @@ exports.createRollupFactory = createRollupFactory;
164
171
  exports.default = plugin;
165
172
  exports.plugin = plugin;
166
173
  exports.dtsBundlePlugin = dtsBundlePlugin;
167
- exports.resolveOptions = resolveOptions;
174
+ exports.resolveOptions = resolveOptions;
175
+ Object.defineProperty(exports, 'rollup_exports', {
176
+ enumerable: true,
177
+ get: function () {
178
+ return rollup_exports;
179
+ }
180
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.d.cts","names":[],"sources":["../src/rollup.ts"],"mappings":";;;;;;;;AA+CA;;;;cAAa,eAAA,EAAiB,MA+B7B;AAQD;;;;;;AAAA,iBAAgB,cAAA,kBAAgC,iBAAA,CAAA,CAC9C,OAAA,EAAS,QAAA,GACR,aAAA;;;;;;;;AAAa;AAuHhB;;;;;;;;;;;;;;iBAAgB,mBAAA,kBAAqC,gBAAA,CAAA,CACnD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;AAAA;AAwCnE;;;;;;cAAa,MAAA,GAAM,OAAA,GAA4C,wBAAA,iBAA5C,MAAA,QAAA,MAAA"}
1
+ {"version":3,"file":"rollup.d.cts","names":[],"sources":["../src/rollup.ts"],"mappings":";;;;;;;;AA+CA;;;;cAAa,eAAA,EAAiB,MA+B7B;AAQD;;;;;;AAAA,iBAAgB,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,GACR,aAAA;;;;;;;;AAAa;AAuHhB;;;;;;;;;;;;;;iBAAgB,mBAAA,kBAAqC,gBAAA,EACnD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;AAAA;AAwCnE;;;;;;cAAa,MAAA,GAAM,OAAA,GAA4C,wBAAA,iBAA5C,MAAA,QAAA,MAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.d.mts","names":[],"sources":["../src/rollup.ts"],"mappings":";;;;;;;;;;;;;;cA+Ca,eAAA,EAAiB,MA+B7B;;;;AA/BD;;;iBAuCgB,cAAA,kBAAgC,iBAAA,CAAA,CAC9C,OAAA,EAAS,QAAA,GACR,aAAA;AAVF;AAQD;;;;;;;;;;;;;;AAEgB;AAuHhB;;;;;;AAjIC,iBAiIe,mBAAA,kBAAqC,gBAAA,CAAA,CACnD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;;;;cAwCtD,MAAA,GAAM,OAAA,GAA4C,wBAAA,iBAA5C,MAAA,QAAA,MAAA"}
1
+ {"version":3,"file":"rollup.d.mts","names":[],"sources":["../src/rollup.ts"],"mappings":";;;;;;;;;;;;;;cA+Ca,eAAA,EAAiB,MA+B7B;;;;AA/BD;;;iBAuCgB,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,GACR,aAAA;AAVF;AAQD;;;;;;;;;;;;;;AAEgB;AAuHhB;;;;;;AAjIC,iBAiIe,mBAAA,kBAAqC,gBAAA,EACnD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;;;;cAwCtD,MAAA,GAAM,OAAA,GAA4C,wBAAA,iBAA5C,MAAA,QAAA,MAAA"}
package/dist/rollup.mjs CHANGED
@@ -6,6 +6,7 @@ import __tsdown_shims_url from 'node:url'
6
6
  const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
7
  const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
8
 
9
+ import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
9
10
  import { createUnpluginFactory } from "./unplugin.mjs";
10
11
  import { defu as defu$1 } from "defu";
11
12
  import { createRollupPlugin } from "unplugin";
@@ -19,6 +20,13 @@ import alias from "@rollup/plugin-alias";
19
20
  import { globSync } from "node:fs";
20
21
 
21
22
  //#region src/rollup.ts
23
+ var rollup_exports = /* @__PURE__ */ __exportAll({
24
+ createRollupFactory: () => createRollupFactory,
25
+ default: () => plugin,
26
+ dtsBundlePlugin: () => dtsBundlePlugin,
27
+ plugin: () => plugin,
28
+ resolveOptions: () => resolveOptions
29
+ });
22
30
  /**
23
31
  * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
24
32
  *
@@ -153,5 +161,5 @@ function createRollupFactory(options = {}, decorate = (options) => options) {
153
161
  const plugin = createRollupPlugin(createRollupFactory());
154
162
 
155
163
  //#endregion
156
- export { createRollupFactory, plugin as default, plugin, dtsBundlePlugin, resolveOptions };
164
+ export { createRollupFactory, plugin as default, plugin, dtsBundlePlugin, resolveOptions, rollup_exports };
157
165
  //# sourceMappingURL=rollup.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.mjs","names":["defu"],"sources":["../src/rollup.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 UnpluginOptions,\n UnresolvedContext\n} from \"@powerlines/core\";\nimport alias from \"@rollup/plugin-alias\";\nimport inject from \"@rollup/plugin-inject\";\nimport resolve from \"@rollup/plugin-node-resolve\";\nimport replace from \"@rollup/plugin-replace\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { defu } from \"defu\";\nimport { globSync } from \"node:fs\";\nimport type { InputOptions, RollupOptions } from \"rollup\";\nimport { Plugin } from \"rollup\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport { createRollupPlugin } from \"unplugin\";\nimport {\n createUnpluginFactory,\n UnpluginFactoryDecorator,\n UnpluginFactoryOptions\n} from \"./unplugin\";\n\n/**\n * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.\n *\n * @remarks\n * This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.\n */\nexport const dtsBundlePlugin: Plugin = {\n name: \"powerlines:dts-bundle\",\n async generateBundle(_opts, bundle) {\n for (const [, file] of Object.entries(bundle)) {\n if (\n file.type === \"asset\" ||\n !file.isEntry ||\n file.facadeModuleId == null\n ) {\n continue;\n }\n\n // Replace various JavaScript file extensions (e.g., .js, .cjs, .mjs, .cjs.js, .mjs.js) with .d.ts for generating type definition file names.\n const dtsFileName = file.fileName.replace(\n /(?:\\.cjs|\\.mjs|\\.esm\\.js|\\.cjs\\.js|\\.mjs\\.js|\\.js)$/,\n \".d.ts\"\n );\n\n const relativeSourceDtsName = JSON.stringify(\n `./${file.facadeModuleId.replace(/\\.[cm]?[jt]sx?$/, \"\")}`\n );\n\n this.emitFile({\n type: \"asset\",\n fileName: dtsFileName,\n source: file.exports.includes(\"default\")\n ? `export * from ${relativeSourceDtsName};\\nexport { default } from ${relativeSourceDtsName};\\n`\n : `export * from ${relativeSourceDtsName};\\n`\n });\n }\n }\n};\n\n/**\n * Resolves the options for [rollup](https://rollupjs.org).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions<TContext extends UnresolvedContext>(\n context: TContext\n): RollupOptions {\n return {\n input: globSync(\n toArray(context.entry).map(entry =>\n isString(entry) ? entry : entry.file\n )\n ).flat(),\n external: (source: string) => {\n if (\n context.config.resolve.external &&\n toArray(context.config.resolve.external).includes(source)\n ) {\n return true;\n }\n\n if (\n context.config.resolve.noExternal &&\n toArray(context.config.resolve.noExternal).includes(source)\n ) {\n return false;\n }\n\n if (context.builtins.includes(source)) {\n return context.config.projectType !== \"application\";\n }\n\n return !context.config.resolve.skipNodeModulesBundle;\n },\n plugins: [\n typescriptPlugin({\n check: false,\n tsconfig: context.tsconfig.tsconfigFilePath\n }),\n context.config.define &&\n Object.keys(context.config.define).length > 0 &&\n replace({\n sourceMap: context.config.mode === \"development\",\n preventAssignment: true,\n ...(context.config.define ?? {})\n }),\n context.config.inject &&\n Object.keys(context.config.inject).length > 0 &&\n inject({\n sourceMap: context.config.mode === \"development\",\n ...context.config.inject\n }),\n alias({\n entries: Object.entries(context.alias).reduce(\n (ret, [id, path]) => {\n if (!ret.find(e => e.find === id)) {\n ret.push({\n find: id,\n replacement: path\n });\n } else {\n context.warn(\n `Duplicate alias entry for '${id}' detected. The first entry will be used.`\n );\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n )\n }),\n resolve({\n moduleDirectories: [\"node_modules\"],\n preferBuiltins: true\n }),\n dtsBundlePlugin\n ].filter(Boolean) as Plugin[],\n cache: !context.config.skipCache ? undefined : false,\n logLevel:\n context.config.logLevel.general === \"trace\"\n ? \"debug\"\n : context.config.logLevel.general === \"debug\"\n ? \"warn\"\n : \"silent\",\n output: [\n {\n dir: context.config.output.path,\n format: \"es\",\n entryFileNames: \"[name].js\",\n preserveModules: true,\n sourcemap: context.config.output.sourceMap\n },\n {\n dir: context.config.output.path,\n format: \"cjs\",\n entryFileNames: \"[name].cjs\",\n preserveModules: true,\n sourcemap: context.config.output.sourceMap\n }\n ]\n };\n}\n\n/**\n * Creates a Rollup plugin factory that generates a plugin instance.\n *\n * @see https://rollupjs.org/guide/en/#plugins-overview\n *\n * @example\n * ```ts\n * // rollup.config.ts\n * import { createRollupFactory } from \"@powerlines/unplugin/rollup\";\n *\n * const powerlinesPlugin = createRollupFactory({ 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 Rollup plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Rollup build.\n */\nexport function createRollupFactory<TContext extends ExecutionContext>(\n options: Omit<UnpluginFactoryOptions, \"variant\"> = {},\n decorate: UnpluginFactoryDecorator<TContext> = options => options\n) {\n return createUnpluginFactory({ ...options, variant: \"rollup\" }, unplugin =>\n decorate({\n ...(unplugin as UnpluginOptions<TContext>),\n rollup: {\n async options(opts: InputOptions) {\n const environment = await unplugin.context.getEnvironment();\n\n return defu(\n resolveOptions(environment),\n opts,\n unplugin.context.callHook(\n \"rollup:options\",\n { environment },\n opts\n ) ?? {}\n );\n }\n }\n })\n );\n}\n\n/**\n * A Rollup plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://rollupjs.org/guide/en/#plugins-overview\n *\n * @example\n * ```ts\n * // rollup.config.ts\n *\n * import powerlines from \"@powerlines/unplugin/rollup\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * })\n * ```\n */\nexport const plugin = createRollupPlugin(createRollupFactory());\n\nexport { plugin as default };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAa,kBAA0B;CACrC,MAAM;CACN,MAAM,eAAe,OAAO,QAAQ;EAClC,KAAK,MAAM,GAAG,SAAS,OAAO,QAAQ,MAAM,GAAG;GAC7C,IACE,KAAK,SAAS,WACd,CAAC,KAAK,WACN,KAAK,kBAAkB,MAEvB;GAIF,MAAM,cAAc,KAAK,SAAS,QAChC,uDACA,OACF;GAEA,MAAM,wBAAwB,KAAK,UACjC,KAAK,KAAK,eAAe,QAAQ,mBAAmB,EAAE,GACxD;GAEA,KAAK,SAAS;IACZ,MAAM;IACN,UAAU;IACV,QAAQ,KAAK,QAAQ,SAAS,SAAS,IACnC,iBAAiB,sBAAsB,6BAA6B,sBAAsB,OAC1F,iBAAiB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AClC,gBAAgB;GAClB,CAAC;GACD;EACF,EAAE,OAAO,OAAO;EAChB,OAAO,CAAC,QAAQ,OAAO,YAAY,SAAY;EAC/C,UACE,QAAQ,OAAO,SAAS,YAAY,UAChC,UACA,QAAQ,OAAO,SAAS,YAAY,UAClC,SACA;EACR,QAAQ,CACN;GACE,KAAK,QAAQ,OAAO,OAAO;GAC3B,QAAQ;GACR,gBAAgB;GAChB,iBAAiB;GACjB,WAAW,QAAQ,OAAO,OAAO;EACnC,GACA;GACE,KAAK,QAAQ,OAAO,OAAO;GAC3B,QAAQ;GACR,gBAAgB;GAChB,iBAAiB;GACjB,WAAW,QAAQ,OAAO,OAAO;EACnC,CACF;CACF;AACF;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAgB,oBACd,UAAmD,CAAC,GACpD,YAA+C,YAAW,SAC1D;CACA,OAAO,sBAAsB;EAAE,GAAG;EAAS,SAAS;CAAS,IAAG,aAC9D,SAAS;EACP,GAAI;EACJ,QAAQ,EACN,MAAM,QAAQ,MAAoB;GAChC,MAAM,cAAc,MAAM,SAAS,QAAQ,eAAe;GAE1D,OAAOA,OACL,eAAe,WAAW,GAC1B,MACA,SAAS,QAAQ,SACf,kBACA,EAAE,YAAY,GACd,IACF,KAAK,CAAC,CACR;EACF,EACF;CACF,CAAC,CACH;AACF;;;;;;;;;;;;;;;;;AAkBA,MAAa,SAAS,mBAAmB,oBAAoB,CAAC"}
1
+ {"version":3,"file":"rollup.mjs","names":["defu"],"sources":["../src/rollup.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 UnpluginOptions,\n UnresolvedContext\n} from \"@powerlines/core\";\nimport alias from \"@rollup/plugin-alias\";\nimport inject from \"@rollup/plugin-inject\";\nimport resolve from \"@rollup/plugin-node-resolve\";\nimport replace from \"@rollup/plugin-replace\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { defu } from \"defu\";\nimport { globSync } from \"node:fs\";\nimport type { InputOptions, RollupOptions } from \"rollup\";\nimport { Plugin } from \"rollup\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport { createRollupPlugin } from \"unplugin\";\nimport {\n createUnpluginFactory,\n UnpluginFactoryDecorator,\n UnpluginFactoryOptions\n} from \"./unplugin\";\n\n/**\n * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.\n *\n * @remarks\n * This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.\n */\nexport const dtsBundlePlugin: Plugin = {\n name: \"powerlines:dts-bundle\",\n async generateBundle(_opts, bundle) {\n for (const [, file] of Object.entries(bundle)) {\n if (\n file.type === \"asset\" ||\n !file.isEntry ||\n file.facadeModuleId == null\n ) {\n continue;\n }\n\n // Replace various JavaScript file extensions (e.g., .js, .cjs, .mjs, .cjs.js, .mjs.js) with .d.ts for generating type definition file names.\n const dtsFileName = file.fileName.replace(\n /(?:\\.cjs|\\.mjs|\\.esm\\.js|\\.cjs\\.js|\\.mjs\\.js|\\.js)$/,\n \".d.ts\"\n );\n\n const relativeSourceDtsName = JSON.stringify(\n `./${file.facadeModuleId.replace(/\\.[cm]?[jt]sx?$/, \"\")}`\n );\n\n this.emitFile({\n type: \"asset\",\n fileName: dtsFileName,\n source: file.exports.includes(\"default\")\n ? `export * from ${relativeSourceDtsName};\\nexport { default } from ${relativeSourceDtsName};\\n`\n : `export * from ${relativeSourceDtsName};\\n`\n });\n }\n }\n};\n\n/**\n * Resolves the options for [rollup](https://rollupjs.org).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions<TContext extends UnresolvedContext>(\n context: TContext\n): RollupOptions {\n return {\n input: globSync(\n toArray(context.entry).map(entry =>\n isString(entry) ? entry : entry.file\n )\n ).flat(),\n external: (source: string) => {\n if (\n context.config.resolve.external &&\n toArray(context.config.resolve.external).includes(source)\n ) {\n return true;\n }\n\n if (\n context.config.resolve.noExternal &&\n toArray(context.config.resolve.noExternal).includes(source)\n ) {\n return false;\n }\n\n if (context.builtins.includes(source)) {\n return context.config.projectType !== \"application\";\n }\n\n return !context.config.resolve.skipNodeModulesBundle;\n },\n plugins: [\n typescriptPlugin({\n check: false,\n tsconfig: context.tsconfig.tsconfigFilePath\n }),\n context.config.define &&\n Object.keys(context.config.define).length > 0 &&\n replace({\n sourceMap: context.config.mode === \"development\",\n preventAssignment: true,\n ...(context.config.define ?? {})\n }),\n context.config.inject &&\n Object.keys(context.config.inject).length > 0 &&\n inject({\n sourceMap: context.config.mode === \"development\",\n ...context.config.inject\n }),\n alias({\n entries: Object.entries(context.alias).reduce(\n (ret, [id, path]) => {\n if (!ret.find(e => e.find === id)) {\n ret.push({\n find: id,\n replacement: path\n });\n } else {\n context.warn(\n `Duplicate alias entry for '${id}' detected. The first entry will be used.`\n );\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n )\n }),\n resolve({\n moduleDirectories: [\"node_modules\"],\n preferBuiltins: true\n }),\n dtsBundlePlugin\n ].filter(Boolean) as Plugin[],\n cache: !context.config.skipCache ? undefined : false,\n logLevel:\n context.config.logLevel.general === \"trace\"\n ? \"debug\"\n : context.config.logLevel.general === \"debug\"\n ? \"warn\"\n : \"silent\",\n output: [\n {\n dir: context.config.output.path,\n format: \"es\",\n entryFileNames: \"[name].js\",\n preserveModules: true,\n sourcemap: context.config.output.sourceMap\n },\n {\n dir: context.config.output.path,\n format: \"cjs\",\n entryFileNames: \"[name].cjs\",\n preserveModules: true,\n sourcemap: context.config.output.sourceMap\n }\n ]\n };\n}\n\n/**\n * Creates a Rollup plugin factory that generates a plugin instance.\n *\n * @see https://rollupjs.org/guide/en/#plugins-overview\n *\n * @example\n * ```ts\n * // rollup.config.ts\n * import { createRollupFactory } from \"@powerlines/unplugin/rollup\";\n *\n * const powerlinesPlugin = createRollupFactory({ 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 Rollup plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Rollup build.\n */\nexport function createRollupFactory<TContext extends ExecutionContext>(\n options: Omit<UnpluginFactoryOptions, \"variant\"> = {},\n decorate: UnpluginFactoryDecorator<TContext> = options => options\n) {\n return createUnpluginFactory({ ...options, variant: \"rollup\" }, unplugin =>\n decorate({\n ...(unplugin as UnpluginOptions<TContext>),\n rollup: {\n async options(opts: InputOptions) {\n const environment = await unplugin.context.getEnvironment();\n\n return defu(\n resolveOptions(environment),\n opts,\n unplugin.context.callHook(\n \"rollup:options\",\n { environment },\n opts\n ) ?? {}\n );\n }\n }\n })\n );\n}\n\n/**\n * A Rollup plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://rollupjs.org/guide/en/#plugins-overview\n *\n * @example\n * ```ts\n * // rollup.config.ts\n *\n * import powerlines from \"@powerlines/unplugin/rollup\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * })\n * ```\n */\nexport const plugin = createRollupPlugin(createRollupFactory());\n\nexport { plugin as default };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAa,kBAA0B;CACrC,MAAM;CACN,MAAM,eAAe,OAAO,QAAQ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,SAAS,mBAAmB,oBAAoB,CAAC"}
@@ -0,0 +1,23 @@
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
+ const require_rollup = require('./rollup.cjs');
10
+ let vitest = require("vitest");
11
+
12
+ //#region src/rollup.test.ts
13
+ (0, vitest.describe)("devkit/unplugin/src/rollup.ts", () => {
14
+ (0, vitest.it)("loads module exports", () => {
15
+ (0, vitest.expect)(require_rollup.rollup_exports).toBeDefined();
16
+ (0, vitest.expect)(typeof require_rollup.rollup_exports).toBe("object");
17
+ });
18
+ (0, vitest.it)("has at least one runtime export", () => {
19
+ (0, vitest.expect)(Object.keys(require_rollup.rollup_exports).length).toBeGreaterThan(0);
20
+ });
21
+ });
22
+
23
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,2 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
@@ -0,0 +1,25 @@
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 { rollup_exports } from "./rollup.mjs";
10
+ import { describe, expect, it } from "vitest";
11
+
12
+ //#region src/rollup.test.ts
13
+ describe("devkit/unplugin/src/rollup.ts", () => {
14
+ it("loads module exports", () => {
15
+ expect(rollup_exports).toBeDefined();
16
+ expect(typeof rollup_exports).toBe("object");
17
+ });
18
+ it("has at least one runtime export", () => {
19
+ expect(Object.keys(rollup_exports).length).toBeGreaterThan(0);
20
+ });
21
+ });
22
+
23
+ //#endregion
24
+ export { };
25
+ //# sourceMappingURL=rollup.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollup.test.mjs","names":["moduleExports"],"sources":["../src/rollup.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./rollup\";\n\ndescribe(\"devkit/unplugin/src/rollup.ts\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;;;;;;;AAGA,SAAS,uCAAuC;CAC9C,GAAG,8BAA8B;EAC/B,OAAOA,cAAa,EAAE,YAAY;EAClC,OAAO,OAAOA,cAAa,EAAE,KAAK,QAAQ;CAC5C,CAAC;CAED,GAAG,yCAAyC;EAC1C,OAAO,OAAO,KAAKA,cAAa,EAAE,MAAM,EAAE,gBAAgB,CAAC;CAC7D,CAAC;AACH,CAAC"}
package/dist/rspack.cjs CHANGED
@@ -15,6 +15,12 @@ defu = require_runtime.__toESM(defu, 1);
15
15
  let unplugin = require("unplugin");
16
16
 
17
17
  //#region src/rspack.ts
18
+ var rspack_exports = /* @__PURE__ */ require_runtime.__exportAll({
19
+ createRspackFactory: () => createRspackFactory,
20
+ default: () => plugin,
21
+ plugin: () => plugin,
22
+ resolveOptions: () => resolveOptions
23
+ });
18
24
  /**
19
25
  * Resolves the options for [rspack](https://rspack.rs/).
20
26
  *
@@ -100,4 +106,10 @@ const plugin = (0, unplugin.createRspackPlugin)(createRspackFactory());
100
106
  exports.createRspackFactory = createRspackFactory;
101
107
  exports.default = plugin;
102
108
  exports.plugin = plugin;
103
- exports.resolveOptions = resolveOptions;
109
+ exports.resolveOptions = resolveOptions;
110
+ Object.defineProperty(exports, 'rspack_exports', {
111
+ enumerable: true,
112
+ get: function () {
113
+ return rspack_exports;
114
+ }
115
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"rspack.d.cts","names":[],"sources":["../src/rspack.ts"],"mappings":";;;;;;;;;AAuCA;;;iBAAgB,cAAA,kBAAgC,iBAAA,CAAA,CAC9C,OAAA,EAAS,QAAA,GACR,OAAA,CAAQ,uBAAA;;;;;;;;;;;;;AAAuB;AAoElC;;;;;;;;;iBAAgB,mBAAA,kBAAqC,gBAAA,CAAA,CACnD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;;AAAA;AAiCnE;cAAa,MAAA,GAAM,OAAA,GAA4C,wBAA5C,oCAAA,oBAAA"}
1
+ {"version":3,"file":"rspack.d.cts","names":[],"sources":["../src/rspack.ts"],"mappings":";;;;;;;;;AAuCA;;;iBAAgB,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,GACR,OAAA,CAAQ,uBAAA;;;;;;;;;;;;;AAAuB;AAoElC;;;;;;;;;iBAAgB,mBAAA,kBAAqC,gBAAA,EACnD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;;AAAA;AAiCnE;cAAa,MAAA,GAAM,OAAA,GAA4C,wBAA5C,oCAAA,oBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"rspack.d.mts","names":[],"sources":["../src/rspack.ts"],"mappings":";;;;;;;;;;;;;;iBAuCgB,cAAA,kBAAgC,iBAAA,CAAA,CAC9C,OAAA,EAAS,QAAA,GACR,OAAA,CAAQ,uBAAA;;;;;AAFX;;;;;;;;;;;;;;;;AAEkC;AAoElC;iBAAgB,mBAAA,kBAAqC,gBAAA,CAAA,CACnD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;;;;cAiCtD,MAAA,GAAM,OAAA,GAA4C,wBAA5C,oCAAA,oBAAA"}
1
+ {"version":3,"file":"rspack.d.mts","names":[],"sources":["../src/rspack.ts"],"mappings":";;;;;;;;;;;;;;iBAuCgB,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,GACR,OAAA,CAAQ,uBAAA;;;;;AAFX;;;;;;;;;;;;;;;;AAEkC;AAoElC;iBAAgB,mBAAA,kBAAqC,gBAAA,EACnD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;;;;cAiCtD,MAAA,GAAM,OAAA,GAA4C,wBAA5C,oCAAA,oBAAA"}
package/dist/rspack.mjs CHANGED
@@ -6,12 +6,19 @@ import __tsdown_shims_url from 'node:url'
6
6
  const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
7
  const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
8
 
9
+ import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
9
10
  import { createUnpluginFactory } from "./unplugin.mjs";
10
11
  import { joinPaths } from "@stryke/path/join-paths";
11
12
  import defu from "defu";
12
13
  import { createRspackPlugin } from "unplugin";
13
14
 
14
15
  //#region src/rspack.ts
16
+ var rspack_exports = /* @__PURE__ */ __exportAll({
17
+ createRspackFactory: () => createRspackFactory,
18
+ default: () => plugin,
19
+ plugin: () => plugin,
20
+ resolveOptions: () => resolveOptions
21
+ });
15
22
  /**
16
23
  * Resolves the options for [rspack](https://rspack.rs/).
17
24
  *
@@ -94,5 +101,5 @@ function createRspackFactory(options = {}, decorate = (options) => options) {
94
101
  const plugin = createRspackPlugin(createRspackFactory());
95
102
 
96
103
  //#endregion
97
- export { createRspackFactory, plugin as default, plugin, resolveOptions };
104
+ export { createRspackFactory, plugin as default, plugin, resolveOptions, rspack_exports };
98
105
  //# sourceMappingURL=rspack.mjs.map