powerlines 0.23.6 → 0.23.7

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 (159) hide show
  1. package/dist/api.cjs +2 -2
  2. package/dist/api.js +1 -1
  3. package/dist/astro.cjs +16 -18
  4. package/dist/astro.js +16 -5
  5. package/dist/{chunk-I3EUY74Q.cjs → chunk-32NXGMLQ.cjs} +20 -18
  6. package/dist/{chunk-Q3ZFML4W.cjs → chunk-4TAIQVJG.cjs} +2 -2
  7. package/dist/{chunk-5CCEQUAZ.js → chunk-6CYDJ53Z.js} +1 -1
  8. package/dist/{chunk-XWBVMNBI.js → chunk-CSSV6ES3.js} +1 -1
  9. package/dist/{chunk-VRFJDHDN.cjs → chunk-I7G24RUE.cjs} +2 -2
  10. package/dist/{chunk-E4M4KEL3.js → chunk-NVNBOUXL.js} +1 -1
  11. package/dist/{chunk-GZNJUK7U.js → chunk-QXTSQTX5.js} +17 -17
  12. package/dist/{chunk-W36NC3B7.js → chunk-RQAKTG6M.js} +1 -1
  13. package/dist/{chunk-62BQYRPM.cjs → chunk-V732KPW6.cjs} +1 -0
  14. package/dist/{chunk-4OAW547A.cjs → chunk-ZUQDWAUO.cjs} +2 -2
  15. package/dist/esbuild.cjs +6 -6
  16. package/dist/esbuild.js +3 -3
  17. package/dist/farm.cjs +3 -3
  18. package/dist/farm.js +2 -2
  19. package/dist/index.cjs +14 -32
  20. package/dist/index.d.cts +0 -8
  21. package/dist/index.d.ts +0 -8
  22. package/dist/index.js +2 -16
  23. package/dist/lib/{api-CD2QlMig.d.cts → api-BJ7F7DmT.d.ts} +1 -1
  24. package/dist/lib/{api-B6hfFxVS.d.ts → api-Bwwdt0YR.d.cts} +1 -1
  25. package/dist/lib/build/esbuild.d.cts +1 -1
  26. package/dist/lib/build/esbuild.d.ts +1 -1
  27. package/dist/lib/build/index.d.cts +3 -3
  28. package/dist/lib/build/index.d.ts +3 -3
  29. package/dist/lib/build/rolldown.d.cts +1 -1
  30. package/dist/lib/build/rolldown.d.ts +1 -1
  31. package/dist/lib/build/rollup.d.cts +1 -1
  32. package/dist/lib/build/rollup.d.ts +1 -1
  33. package/dist/lib/build/rspack.d.cts +1 -1
  34. package/dist/lib/build/rspack.d.ts +1 -1
  35. package/dist/lib/build/tsup.d.cts +1 -1
  36. package/dist/lib/build/tsup.d.ts +1 -1
  37. package/dist/lib/build/unbuild.d.cts +3 -3
  38. package/dist/lib/build/unbuild.d.ts +3 -3
  39. package/dist/lib/build/vite.d.cts +1 -1
  40. package/dist/lib/build/vite.d.ts +1 -1
  41. package/dist/lib/build/webpack.d.cts +1 -1
  42. package/dist/lib/build/webpack.d.ts +1 -1
  43. package/dist/lib/{config-DeUaQYc_.d.ts → config-CFZYRPQj.d.ts} +1 -1
  44. package/dist/lib/{config-DTSdCZsw.d.cts → config-CxONCKEx.d.cts} +1 -1
  45. package/dist/lib/config-file.d.cts +1 -1
  46. package/dist/lib/config-file.d.ts +1 -1
  47. package/dist/lib/contexts/api-context.d.cts +3 -3
  48. package/dist/lib/contexts/api-context.d.ts +3 -3
  49. package/dist/lib/contexts/context.d.cts +3 -3
  50. package/dist/lib/contexts/context.d.ts +3 -3
  51. package/dist/lib/contexts/environment-context.d.cts +3 -3
  52. package/dist/lib/contexts/environment-context.d.ts +3 -3
  53. package/dist/lib/contexts/index.d.cts +3 -3
  54. package/dist/lib/contexts/index.d.ts +3 -3
  55. package/dist/lib/contexts/plugin-context.d.cts +3 -3
  56. package/dist/lib/contexts/plugin-context.d.ts +3 -3
  57. package/dist/lib/entry.d.cts +1 -1
  58. package/dist/lib/entry.d.ts +1 -1
  59. package/dist/lib/index.d.cts +4 -3
  60. package/dist/lib/index.d.ts +4 -3
  61. package/dist/lib/{internal-ypnrUNZy.d.cts → internal-9D9Up5pT.d.cts} +2 -2
  62. package/dist/lib/{internal-CpVMJCaU.d.ts → internal-kEzuoIrl.d.ts} +2 -2
  63. package/dist/lib/logger.d.cts +1 -1
  64. package/dist/lib/logger.d.ts +1 -1
  65. package/dist/lib/typescript/compiler-host.d.cts +1 -1
  66. package/dist/lib/typescript/compiler-host.d.ts +1 -1
  67. package/dist/lib/typescript/import-transformer.d.cts +1 -1
  68. package/dist/lib/typescript/import-transformer.d.ts +1 -1
  69. package/dist/lib/typescript/index.d.cts +1 -1
  70. package/dist/lib/typescript/index.d.ts +1 -1
  71. package/dist/lib/typescript/program.d.cts +1 -1
  72. package/dist/lib/typescript/program.d.ts +1 -1
  73. package/dist/lib/typescript/ts-morph.d.cts +1 -1
  74. package/dist/lib/typescript/ts-morph.d.ts +1 -1
  75. package/dist/lib/unplugin/factory.d.cts +4 -16
  76. package/dist/lib/unplugin/factory.d.ts +4 -16
  77. package/dist/lib/unplugin/helpers.d.cts +1 -1
  78. package/dist/lib/unplugin/helpers.d.ts +1 -1
  79. package/dist/lib/unplugin/index.d.cts +3 -2
  80. package/dist/lib/unplugin/index.d.ts +3 -2
  81. package/dist/lib/unplugin/plugin.d.cts +5 -3
  82. package/dist/lib/unplugin/plugin.d.ts +5 -3
  83. package/dist/lib/unplugin/resolve-id.d.cts +1 -1
  84. package/dist/lib/unplugin/resolve-id.d.ts +1 -1
  85. package/dist/lib/unplugin-BdLs3dwd.d.cts +18 -0
  86. package/dist/lib/unplugin-tmNrQvUk.d.ts +18 -0
  87. package/dist/lib/utilities/bundle.d.cts +1 -1
  88. package/dist/lib/utilities/bundle.d.ts +1 -1
  89. package/dist/lib/utilities/cache.d.cts +1 -1
  90. package/dist/lib/utilities/cache.d.ts +1 -1
  91. package/dist/lib/utilities/file-header.d.cts +1 -1
  92. package/dist/lib/utilities/file-header.d.ts +1 -1
  93. package/dist/lib/utilities/index.d.cts +1 -1
  94. package/dist/lib/utilities/index.d.ts +1 -1
  95. package/dist/lib/utilities/meta.d.cts +1 -1
  96. package/dist/lib/utilities/meta.d.ts +1 -1
  97. package/dist/lib/utilities/resolve-path.d.cts +1 -1
  98. package/dist/lib/utilities/resolve-path.d.ts +1 -1
  99. package/dist/lib/utilities/resolve.d.cts +1 -1
  100. package/dist/lib/utilities/resolve.d.ts +1 -1
  101. package/dist/lib/utilities/source-file.d.cts +1 -1
  102. package/dist/lib/utilities/source-file.d.ts +1 -1
  103. package/dist/lib/utilities/source-map.d.cts +1 -1
  104. package/dist/lib/utilities/source-map.d.ts +1 -1
  105. package/dist/lib/utilities/worker.d.cts +1 -1
  106. package/dist/lib/utilities/worker.d.ts +1 -1
  107. package/dist/lib/utilities/write-file.d.cts +1 -1
  108. package/dist/lib/utilities/write-file.d.ts +1 -1
  109. package/dist/next.cjs +21 -18
  110. package/dist/next.js +21 -5
  111. package/dist/nuxt.cjs +21 -18
  112. package/dist/nuxt.js +21 -5
  113. package/dist/rolldown.cjs +8 -16
  114. package/dist/rolldown.d.cts +2 -2
  115. package/dist/rolldown.d.ts +2 -2
  116. package/dist/rolldown.js +8 -3
  117. package/dist/rollup.cjs +8 -16
  118. package/dist/rollup.d.cts +2 -2
  119. package/dist/rollup.d.ts +2 -2
  120. package/dist/rollup.js +8 -3
  121. package/dist/rspack.cjs +8 -16
  122. package/dist/rspack.js +8 -3
  123. package/dist/tsup.cjs +40 -18
  124. package/dist/tsup.js +40 -5
  125. package/dist/unloader.cjs +8 -16
  126. package/dist/unloader.d.cts +2 -2
  127. package/dist/unloader.d.ts +2 -2
  128. package/dist/unloader.js +8 -3
  129. package/dist/unplugin.cjs +186 -26
  130. package/dist/unplugin.d.cts +58 -35
  131. package/dist/unplugin.d.ts +58 -35
  132. package/dist/unplugin.js +186 -16
  133. package/dist/vite.cjs +6 -6
  134. package/dist/vite.d.cts +2 -2
  135. package/dist/vite.d.ts +2 -2
  136. package/dist/vite.js +3 -3
  137. package/dist/webpack.cjs +6 -6
  138. package/dist/webpack.d.cts +2 -2
  139. package/dist/webpack.d.ts +2 -2
  140. package/dist/webpack.js +3 -3
  141. package/package.json +3 -3
  142. package/dist/chunk-33BDG6M5.js +0 -38
  143. package/dist/chunk-3HOOIAF4.js +0 -7
  144. package/dist/chunk-AK5B45AH.js +0 -14
  145. package/dist/chunk-GHHMURR4.js +0 -7
  146. package/dist/chunk-GXJ5L37C.cjs +0 -10
  147. package/dist/chunk-IVABRCNA.js +0 -29
  148. package/dist/chunk-JJXDDTSL.cjs +0 -22
  149. package/dist/chunk-K5TOHSUD.cjs +0 -17
  150. package/dist/chunk-M7N6RX2H.js +0 -19
  151. package/dist/chunk-MAOXZVDE.cjs +0 -22
  152. package/dist/chunk-NWZXH2HK.cjs +0 -10
  153. package/dist/chunk-PFECSHR6.cjs +0 -41
  154. package/dist/chunk-RM37JA3L.cjs +0 -32
  155. package/dist/chunk-RVO5GC2H.cjs +0 -10
  156. package/dist/chunk-TSKJTJ2P.js +0 -19
  157. package/dist/chunk-XDNNFAQR.js +0 -7
  158. package/dist/chunk-YBOJFFO2.cjs +0 -10
  159. package/dist/chunk-ZOMJH52N.js +0 -7
package/dist/rollup.cjs CHANGED
@@ -2,25 +2,17 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkRVO5GC2H_cjs = require('./chunk-RVO5GC2H.cjs');
6
- require('./chunk-I3EUY74Q.cjs');
7
- require('./chunk-62BQYRPM.cjs');
5
+ var chunk32NXGMLQ_cjs = require('./chunk-32NXGMLQ.cjs');
6
+ require('./chunk-V732KPW6.cjs');
8
7
  require('./chunk-ETKZMGLN.cjs');
9
8
  require('./chunk-PAMSESZV.cjs');
10
9
  require('./chunk-AYKZK666.cjs');
11
10
  require('./chunk-USNT2KNT.cjs');
11
+ var unplugin = require('unplugin');
12
12
 
13
+ var rollup = unplugin.createRollupPlugin(chunk32NXGMLQ_cjs.createUnpluginFactory("rollup"));
14
+ var rollup_default = rollup;
13
15
 
14
-
15
- Object.defineProperty(exports, "default", {
16
- enumerable: true,
17
- get: function () { return chunkRVO5GC2H_cjs.rollup_default; }
18
- });
19
- Object.defineProperty(exports, "module.exports", {
20
- enumerable: true,
21
- get: function () { return chunkRVO5GC2H_cjs.rollup; }
22
- });
23
- Object.defineProperty(exports, "rollup", {
24
- enumerable: true,
25
- get: function () { return chunkRVO5GC2H_cjs.rollup; }
26
- });
16
+ exports.default = rollup_default;
17
+ exports["module.exports"] = rollup;
18
+ exports.rollup = rollup;
package/dist/rollup.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import * as rollup$1 from 'rollup';
1
+ import * as _rollup from 'rollup';
2
2
  import { T as RollupUserConfig } from './resolved-C00CJgsk.cjs';
3
3
  import '@stryke/types/base';
4
4
  import '@stryke/types/configuration';
@@ -49,6 +49,6 @@ import 'typescript';
49
49
  * })
50
50
  * ```
51
51
  */
52
- declare const rollup: (options: Partial<RollupUserConfig>) => rollup$1.Plugin<any> | rollup$1.Plugin<any>[];
52
+ declare const rollup: (options: Partial<RollupUserConfig>) => _rollup.Plugin<any> | _rollup.Plugin<any>[];
53
53
 
54
54
  export { rollup as "module.exports", rollup as default, rollup };
package/dist/rollup.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as rollup$1 from 'rollup';
1
+ import * as _rollup from 'rollup';
2
2
  import { T as RollupUserConfig } from './resolved-DKFZ11S7.js';
3
3
  import '@stryke/types/base';
4
4
  import '@stryke/types/configuration';
@@ -49,6 +49,6 @@ import 'typescript';
49
49
  * })
50
50
  * ```
51
51
  */
52
- declare const rollup: (options: Partial<RollupUserConfig>) => rollup$1.Plugin<any> | rollup$1.Plugin<any>[];
52
+ declare const rollup: (options: Partial<RollupUserConfig>) => _rollup.Plugin<any> | _rollup.Plugin<any>[];
53
53
 
54
54
  export { rollup as "module.exports", rollup as default, rollup };
package/dist/rollup.js CHANGED
@@ -1,7 +1,12 @@
1
- export { rollup_default as default, rollup as "module.exports", rollup } from './chunk-XDNNFAQR.js';
2
- import './chunk-GZNJUK7U.js';
3
- import './chunk-E4M4KEL3.js';
1
+ import { createUnpluginFactory } from './chunk-QXTSQTX5.js';
2
+ import './chunk-NVNBOUXL.js';
4
3
  import './chunk-JQCWV4DT.js';
5
4
  import './chunk-JKBJF3UI.js';
6
5
  import './chunk-VT7NVLLU.js';
7
6
  import './chunk-SHUYVCID.js';
7
+ import { createRollupPlugin } from 'unplugin';
8
+
9
+ var rollup = createRollupPlugin(createUnpluginFactory("rollup"));
10
+ var rollup_default = rollup;
11
+
12
+ export { rollup_default as default, rollup as "module.exports", rollup };
package/dist/rspack.cjs CHANGED
@@ -2,25 +2,17 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkNWZXH2HK_cjs = require('./chunk-NWZXH2HK.cjs');
6
- require('./chunk-I3EUY74Q.cjs');
7
- require('./chunk-62BQYRPM.cjs');
5
+ var chunk32NXGMLQ_cjs = require('./chunk-32NXGMLQ.cjs');
6
+ require('./chunk-V732KPW6.cjs');
8
7
  require('./chunk-ETKZMGLN.cjs');
9
8
  require('./chunk-PAMSESZV.cjs');
10
9
  require('./chunk-AYKZK666.cjs');
11
10
  require('./chunk-USNT2KNT.cjs');
11
+ var unplugin = require('unplugin');
12
12
 
13
+ var rspack = unplugin.createRspackPlugin(chunk32NXGMLQ_cjs.createUnpluginFactory("rspack"));
14
+ var rspack_default = rspack;
13
15
 
14
-
15
- Object.defineProperty(exports, "default", {
16
- enumerable: true,
17
- get: function () { return chunkNWZXH2HK_cjs.rspack_default; }
18
- });
19
- Object.defineProperty(exports, "module.exports", {
20
- enumerable: true,
21
- get: function () { return chunkNWZXH2HK_cjs.rspack; }
22
- });
23
- Object.defineProperty(exports, "rspack", {
24
- enumerable: true,
25
- get: function () { return chunkNWZXH2HK_cjs.rspack; }
26
- });
16
+ exports.default = rspack_default;
17
+ exports["module.exports"] = rspack;
18
+ exports.rspack = rspack;
package/dist/rspack.js CHANGED
@@ -1,7 +1,12 @@
1
- export { rspack_default as default, rspack as "module.exports", rspack } from './chunk-ZOMJH52N.js';
2
- import './chunk-GZNJUK7U.js';
3
- import './chunk-E4M4KEL3.js';
1
+ import { createUnpluginFactory } from './chunk-QXTSQTX5.js';
2
+ import './chunk-NVNBOUXL.js';
4
3
  import './chunk-JQCWV4DT.js';
5
4
  import './chunk-JKBJF3UI.js';
6
5
  import './chunk-VT7NVLLU.js';
7
6
  import './chunk-SHUYVCID.js';
7
+ import { createRspackPlugin } from 'unplugin';
8
+
9
+ var rspack = createRspackPlugin(createUnpluginFactory("rspack"));
10
+ var rspack_default = rspack;
11
+
12
+ export { rspack_default as default, rspack as "module.exports", rspack };
package/dist/tsup.cjs CHANGED
@@ -2,27 +2,49 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkPFECSHR6_cjs = require('./chunk-PFECSHR6.cjs');
6
- require('./chunk-4OAW547A.cjs');
5
+ var chunkZUQDWAUO_cjs = require('./chunk-ZUQDWAUO.cjs');
7
6
  require('./chunk-5IBA5HC2.cjs');
8
- require('./chunk-I3EUY74Q.cjs');
9
- require('./chunk-62BQYRPM.cjs');
7
+ require('./chunk-32NXGMLQ.cjs');
8
+ require('./chunk-V732KPW6.cjs');
10
9
  require('./chunk-ETKZMGLN.cjs');
11
10
  require('./chunk-PAMSESZV.cjs');
12
11
  require('./chunk-AYKZK666.cjs');
13
- require('./chunk-USNT2KNT.cjs');
12
+ var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
13
+ var omit = require('@stryke/helpers/omit');
14
14
 
15
+ function tsup(options = {}) {
16
+ return {
17
+ ...options,
18
+ esbuildPlugins: [
19
+ chunkZUQDWAUO_cjs.esbuild_default({
20
+ output: {
21
+ outputPath: options.outDir,
22
+ format: options.format
23
+ },
24
+ build: {
25
+ ...omit.omit(options, [
26
+ "plugins",
27
+ "banner",
28
+ "footer",
29
+ "outExtension",
30
+ "outDir",
31
+ "format",
32
+ "minify",
33
+ "pure",
34
+ "inject"
35
+ ]),
36
+ minify: Boolean(options.minify),
37
+ pure: Array.isArray(options.pure) ? options.pure : typeof options.pure === "string" ? [
38
+ options.pure
39
+ ] : []
40
+ }
41
+ })
42
+ ]
43
+ };
44
+ }
45
+ chunkUSNT2KNT_cjs.__name(tsup, "tsup");
46
+ var tsup_default = tsup;
15
47
 
16
-
17
- Object.defineProperty(exports, "default", {
18
- enumerable: true,
19
- get: function () { return chunkPFECSHR6_cjs.tsup_default; }
20
- });
21
- Object.defineProperty(exports, "module.exports", {
22
- enumerable: true,
23
- get: function () { return chunkPFECSHR6_cjs.tsup; }
24
- });
25
- Object.defineProperty(exports, "tsup", {
26
- enumerable: true,
27
- get: function () { return chunkPFECSHR6_cjs.tsup; }
28
- });
48
+ exports.default = tsup_default;
49
+ exports["module.exports"] = tsup;
50
+ exports.tsup = tsup;
package/dist/tsup.js CHANGED
@@ -1,9 +1,44 @@
1
- export { tsup_default as default, tsup as "module.exports", tsup } from './chunk-33BDG6M5.js';
2
- import './chunk-W36NC3B7.js';
1
+ import { esbuild_default } from './chunk-RQAKTG6M.js';
3
2
  import './chunk-VBR53KGY.js';
4
- import './chunk-GZNJUK7U.js';
5
- import './chunk-E4M4KEL3.js';
3
+ import './chunk-QXTSQTX5.js';
4
+ import './chunk-NVNBOUXL.js';
6
5
  import './chunk-JQCWV4DT.js';
7
6
  import './chunk-JKBJF3UI.js';
8
7
  import './chunk-VT7NVLLU.js';
9
- import './chunk-SHUYVCID.js';
8
+ import { __name } from './chunk-SHUYVCID.js';
9
+ import { omit } from '@stryke/helpers/omit';
10
+
11
+ function tsup(options = {}) {
12
+ return {
13
+ ...options,
14
+ esbuildPlugins: [
15
+ esbuild_default({
16
+ output: {
17
+ outputPath: options.outDir,
18
+ format: options.format
19
+ },
20
+ build: {
21
+ ...omit(options, [
22
+ "plugins",
23
+ "banner",
24
+ "footer",
25
+ "outExtension",
26
+ "outDir",
27
+ "format",
28
+ "minify",
29
+ "pure",
30
+ "inject"
31
+ ]),
32
+ minify: Boolean(options.minify),
33
+ pure: Array.isArray(options.pure) ? options.pure : typeof options.pure === "string" ? [
34
+ options.pure
35
+ ] : []
36
+ }
37
+ })
38
+ ]
39
+ };
40
+ }
41
+ __name(tsup, "tsup");
42
+ var tsup_default = tsup;
43
+
44
+ export { tsup_default as default, tsup as "module.exports", tsup };
package/dist/unloader.cjs CHANGED
@@ -2,25 +2,17 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkGXJ5L37C_cjs = require('./chunk-GXJ5L37C.cjs');
6
- require('./chunk-I3EUY74Q.cjs');
7
- require('./chunk-62BQYRPM.cjs');
5
+ var chunk32NXGMLQ_cjs = require('./chunk-32NXGMLQ.cjs');
6
+ require('./chunk-V732KPW6.cjs');
8
7
  require('./chunk-ETKZMGLN.cjs');
9
8
  require('./chunk-PAMSESZV.cjs');
10
9
  require('./chunk-AYKZK666.cjs');
11
10
  require('./chunk-USNT2KNT.cjs');
11
+ var unplugin = require('unplugin');
12
12
 
13
+ var unloader = unplugin.createUnloaderPlugin(chunk32NXGMLQ_cjs.createUnpluginFactory("unloader"));
14
+ var unloader_default = unloader;
13
15
 
14
-
15
- Object.defineProperty(exports, "default", {
16
- enumerable: true,
17
- get: function () { return chunkGXJ5L37C_cjs.unloader_default; }
18
- });
19
- Object.defineProperty(exports, "module.exports", {
20
- enumerable: true,
21
- get: function () { return chunkGXJ5L37C_cjs.unloader; }
22
- });
23
- Object.defineProperty(exports, "unloader", {
24
- enumerable: true,
25
- get: function () { return chunkGXJ5L37C_cjs.unloader; }
26
- });
16
+ exports.default = unloader_default;
17
+ exports["module.exports"] = unloader;
18
+ exports.unloader = unloader;
@@ -1,4 +1,4 @@
1
- import * as unloader$1 from 'unloader';
1
+ import * as _unloader from 'unloader';
2
2
  import { BuildConfig, BuildResolvedConfig } from './types/build.cjs';
3
3
  import { U as UserConfig } from './resolved-C00CJgsk.cjs';
4
4
  import '@farmfe/core';
@@ -48,6 +48,6 @@ import 'typescript';
48
48
  * })
49
49
  * ```
50
50
  */
51
- declare const unloader: (options: Partial<UserConfig<BuildConfig, BuildResolvedConfig, any>>) => unloader$1.Plugin<false> | unloader$1.Plugin<false>[];
51
+ declare const unloader: (options: Partial<UserConfig<BuildConfig, BuildResolvedConfig, any>>) => _unloader.Plugin<false> | _unloader.Plugin<false>[];
52
52
 
53
53
  export { unloader as "module.exports", unloader as default, unloader };
@@ -1,4 +1,4 @@
1
- import * as unloader$1 from 'unloader';
1
+ import * as _unloader from 'unloader';
2
2
  import { BuildConfig, BuildResolvedConfig } from './types/build.js';
3
3
  import { U as UserConfig } from './resolved-DKFZ11S7.js';
4
4
  import '@farmfe/core';
@@ -48,6 +48,6 @@ import 'typescript';
48
48
  * })
49
49
  * ```
50
50
  */
51
- declare const unloader: (options: Partial<UserConfig<BuildConfig, BuildResolvedConfig, any>>) => unloader$1.Plugin<false> | unloader$1.Plugin<false>[];
51
+ declare const unloader: (options: Partial<UserConfig<BuildConfig, BuildResolvedConfig, any>>) => _unloader.Plugin<false> | _unloader.Plugin<false>[];
52
52
 
53
53
  export { unloader as "module.exports", unloader as default, unloader };
package/dist/unloader.js CHANGED
@@ -1,7 +1,12 @@
1
- export { unloader_default as default, unloader as "module.exports", unloader } from './chunk-GHHMURR4.js';
2
- import './chunk-GZNJUK7U.js';
3
- import './chunk-E4M4KEL3.js';
1
+ import { createUnpluginFactory } from './chunk-QXTSQTX5.js';
2
+ import './chunk-NVNBOUXL.js';
4
3
  import './chunk-JQCWV4DT.js';
5
4
  import './chunk-JKBJF3UI.js';
6
5
  import './chunk-VT7NVLLU.js';
7
6
  import './chunk-SHUYVCID.js';
7
+ import { createUnloaderPlugin } from 'unplugin';
8
+
9
+ var unloader = createUnloaderPlugin(createUnpluginFactory("unloader"));
10
+ var unloader_default = unloader;
11
+
12
+ export { unloader_default as default, unloader as "module.exports", unloader };
package/dist/unplugin.cjs CHANGED
@@ -1,38 +1,198 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var chunkRM37JA3L_cjs = require('./chunk-RM37JA3L.cjs');
6
- require('./chunk-YBOJFFO2.cjs');
7
- require('./chunk-RVO5GC2H.cjs');
8
- require('./chunk-NWZXH2HK.cjs');
9
- require('./chunk-PFECSHR6.cjs');
10
- require('./chunk-GXJ5L37C.cjs');
11
- require('./chunk-K5TOHSUD.cjs');
12
- require('./chunk-4OAW547A.cjs');
13
- require('./chunk-MAOXZVDE.cjs');
14
- require('./chunk-JJXDDTSL.cjs');
15
- require('./chunk-VRFJDHDN.cjs');
16
- require('./chunk-5IBA5HC2.cjs');
17
- require('./chunk-Q3ZFML4W.cjs');
18
- var chunkI3EUY74Q_cjs = require('./chunk-I3EUY74Q.cjs');
19
- require('./chunk-62BQYRPM.cjs');
3
+ var chunk32NXGMLQ_cjs = require('./chunk-32NXGMLQ.cjs');
4
+ var chunkV732KPW6_cjs = require('./chunk-V732KPW6.cjs');
20
5
  require('./chunk-ETKZMGLN.cjs');
21
6
  require('./chunk-PAMSESZV.cjs');
22
7
  require('./chunk-AYKZK666.cjs');
23
- require('./chunk-USNT2KNT.cjs');
8
+ var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
9
+ var types = require('@storm-software/config-tools/types');
10
+ var filePathFns = require('@stryke/path/file-path-fns');
11
+ var replace = require('@stryke/path/replace');
12
+ var isString = require('@stryke/type-checks/is-string');
13
+ var defu = require('defu');
24
14
 
15
+ function combineContexts(context, unplugin) {
16
+ return defu.defu(context, unplugin);
17
+ }
18
+ chunkUSNT2KNT_cjs.__name(combineContexts, "combineContexts");
25
19
 
20
+ // src/lib/unplugin/plugin.ts
21
+ function createUnplugin(context, options = {}) {
22
+ const ctx = context;
23
+ return () => {
24
+ const log = chunkV732KPW6_cjs.extendLog(ctx.log, "unplugin");
25
+ log(types.LogLevelLabel.DEBUG, "Initializing Unplugin");
26
+ try {
27
+ async function buildStart() {
28
+ log(types.LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
29
+ await ctx.$$internal.callHook("buildStart", {
30
+ sequential: true
31
+ });
32
+ }
33
+ chunkUSNT2KNT_cjs.__name(buildStart, "buildStart");
34
+ async function resolveId(id, importer, opts = {
35
+ isEntry: false
36
+ }) {
37
+ const resolved = await (async () => {
38
+ let result = await ctx.$$internal.callHook("resolveId", {
39
+ sequential: true,
40
+ result: "first",
41
+ order: "pre"
42
+ }, id, importer, opts);
43
+ if (result) {
44
+ return result;
45
+ }
46
+ result = await ctx.$$internal.callHook("resolveId", {
47
+ sequential: true,
48
+ result: "first",
49
+ order: "normal"
50
+ }, id, importer, opts);
51
+ if (result) {
52
+ return result;
53
+ }
54
+ result = await chunk32NXGMLQ_cjs.handleResolveId(ctx, {
55
+ id,
56
+ importer,
57
+ options: opts
58
+ }, {
59
+ skipResolve: options.skipResolve,
60
+ skipNodeModulesBundle: ctx.config.build.skipNodeModulesBundle,
61
+ external: ctx.config.build.external,
62
+ noExternal: ctx.config.build.noExternal
63
+ });
64
+ if (result) {
65
+ return result;
66
+ }
67
+ return ctx.$$internal.callHook("resolveId", {
68
+ sequential: true,
69
+ result: "first",
70
+ order: "post"
71
+ }, id, importer, opts);
72
+ })();
73
+ if (resolved && opts.isEntry && ctx.config.build.polyfill && ctx.config.build.polyfill.length > 0) {
74
+ const entry = ctx.entry.find((entry2) => entry2.file === (isString.isString(resolved) ? resolved : resolved.id));
75
+ if (entry) {
76
+ entry.file = `${replace.replaceExtension(isString.isString(resolved) ? resolved : resolved.id)}-polyfill.ts`;
77
+ entry.output ||= entry.output?.replace(filePathFns.findFileName(entry.output, {
78
+ withExtension: true
79
+ }), entry.file);
80
+ await ctx.emitEntry(`
81
+ ${ctx.config.build.polyfill.map((p) => `import "${p}";`).join("\n")}
26
82
 
27
- Object.defineProperty(exports, "default", {
28
- enumerable: true,
29
- get: function () { return chunkRM37JA3L_cjs.unplugin_default; }
30
- });
31
- Object.defineProperty(exports, "plugins", {
83
+ export * from "${isString.isString(resolved) ? resolved : resolved.id}";
84
+ `, entry.file, {
85
+ mode: "virtual"
86
+ });
87
+ return entry.file;
88
+ }
89
+ }
90
+ return resolved;
91
+ }
92
+ chunkUSNT2KNT_cjs.__name(resolveId, "resolveId");
93
+ async function load(id) {
94
+ let result = await ctx.$$internal.callHook("load", {
95
+ sequential: true,
96
+ result: "first",
97
+ order: "pre"
98
+ }, id);
99
+ if (result) {
100
+ return result;
101
+ }
102
+ result = await ctx.$$internal.callHook("load", {
103
+ sequential: true,
104
+ result: "first",
105
+ order: "normal"
106
+ }, id);
107
+ if (result) {
108
+ return result;
109
+ }
110
+ if (id) {
111
+ const resolvedPath = ctx.fs.resolve(id);
112
+ if (resolvedPath) {
113
+ return ctx.fs.readFile(resolvedPath);
114
+ }
115
+ }
116
+ return ctx.$$internal.callHook("load", {
117
+ sequential: true,
118
+ result: "first",
119
+ order: "post"
120
+ }, id);
121
+ }
122
+ chunkUSNT2KNT_cjs.__name(load, "load");
123
+ async function transform(code, id) {
124
+ let transformed = code;
125
+ for (const handler of ctx.$$internal.environment.selectHooks("transform")) {
126
+ const result = await handler.apply(combineContexts(ctx, this), [
127
+ chunk32NXGMLQ_cjs.getString(transformed),
128
+ id
129
+ ]);
130
+ if (result) {
131
+ transformed = result;
132
+ }
133
+ }
134
+ return transformed;
135
+ }
136
+ chunkUSNT2KNT_cjs.__name(transform, "transform");
137
+ async function buildEnd() {
138
+ log(types.LogLevelLabel.DEBUG, "Powerlines build plugin finishing...");
139
+ return ctx.$$internal.callHook("buildEnd", {
140
+ sequential: true
141
+ });
142
+ }
143
+ chunkUSNT2KNT_cjs.__name(buildEnd, "buildEnd");
144
+ async function writeBundle() {
145
+ log(types.LogLevelLabel.DEBUG, "Finalizing Powerlines project output...");
146
+ return ctx.$$internal.callHook("writeBundle", {
147
+ sequential: true
148
+ });
149
+ }
150
+ chunkUSNT2KNT_cjs.__name(writeBundle, "writeBundle");
151
+ return {
152
+ name: "powerlines",
153
+ api: ctx.$$internal.api,
154
+ resolveId: {
155
+ filter: {
156
+ id: {
157
+ include: [
158
+ /.*/
159
+ ]
160
+ }
161
+ },
162
+ handler: resolveId
163
+ },
164
+ load: {
165
+ filter: {
166
+ id: {
167
+ include: [
168
+ /.*/
169
+ ]
170
+ }
171
+ },
172
+ handler: load
173
+ },
174
+ transform,
175
+ buildStart,
176
+ buildEnd,
177
+ writeBundle,
178
+ vite: {
179
+ sharedDuringBuild: true
180
+ }
181
+ };
182
+ } catch (error) {
183
+ log(types.LogLevelLabel.FATAL, error?.message);
184
+ throw error;
185
+ }
186
+ };
187
+ }
188
+ chunkUSNT2KNT_cjs.__name(createUnplugin, "createUnplugin");
189
+
190
+ Object.defineProperty(exports, "createUnpluginFactory", {
32
191
  enumerable: true,
33
- get: function () { return chunkRM37JA3L_cjs.plugins; }
192
+ get: function () { return chunk32NXGMLQ_cjs.createUnpluginFactory; }
34
193
  });
35
- Object.defineProperty(exports, "createUnpluginFactory", {
194
+ Object.defineProperty(exports, "handleResolveId", {
36
195
  enumerable: true,
37
- get: function () { return chunkI3EUY74Q_cjs.createUnpluginFactory; }
196
+ get: function () { return chunk32NXGMLQ_cjs.handleResolveId; }
38
197
  });
198
+ exports.createUnplugin = createUnplugin;
@@ -1,21 +1,21 @@
1
- import * as webpack from 'webpack';
2
- import * as vite from 'vite';
3
- import * as unloader from 'unloader';
4
- import * as unplugin from 'unplugin';
5
- import * as rollup from 'rollup';
6
- import * as rolldown from 'rolldown';
7
- import * as _nuxt_schema from '@nuxt/schema';
8
- import * as _esbuild from 'esbuild';
9
- import * as astro from 'astro';
10
- import { b7 as Context, cB as InferResolvedConfig, cs as ViteResolvedConfig, Y as ESBuildUserConfig, V as RolldownUserConfig, T as RollupUserConfig, Q as RspackUserConfig, U as UserConfig, X as ViteUserConfig, M as WebpackUserConfig } from './resolved-C00CJgsk.cjs';
11
- import { UnpluginBuildVariant, BuildConfig, BuildResolvedConfig } from './types/build.cjs';
12
- import next from './next.cjs';
13
- import tsup from './tsup.cjs';
14
1
  import { PowerlinesAPI } from './api.cjs';
2
+ import { UnpluginBuildVariant } from './types/build.cjs';
3
+ import { b7 as Context, cB as InferResolvedConfig, bb as PluginContext } from './resolved-C00CJgsk.cjs';
15
4
  import { PowerlinesUnpluginOptions, InferUnpluginOptions, PowerlinesUnpluginFactory } from './types/unplugin.cjs';
5
+ import { ExternalIdResult } from 'unplugin';
6
+ import './api--9pVSIbm.cjs';
16
7
  import '@stryke/types/base';
17
8
  import '@stryke/types/configuration';
18
9
  import '@stryke/types/file';
10
+ import 'vite';
11
+ import '@farmfe/core';
12
+ import '@rspack/core';
13
+ import '@storm-software/tsup/types';
14
+ import '@storm-software/unbuild/types';
15
+ import 'esbuild';
16
+ import 'rolldown';
17
+ import 'rollup';
18
+ import 'webpack';
19
19
  import '@babel/core';
20
20
  import '@storm-software/build-tools/types';
21
21
  import '@storm-software/config-tools/types';
@@ -36,13 +36,6 @@ import '@stryke/types/array';
36
36
  import './types/tsconfig.cjs';
37
37
  import '@stryke/types/tsconfig';
38
38
  import 'typescript';
39
- import '@farmfe/core';
40
- import '@rspack/core';
41
- import '@storm-software/tsup/types';
42
- import '@storm-software/unbuild/types';
43
- import 'next';
44
- import 'tsup';
45
- import './api--9pVSIbm.cjs';
46
39
 
47
40
  /**
48
41
  * Creates a Powerlines unplugin factory that generates a plugin instance.
@@ -53,21 +46,51 @@ import './api--9pVSIbm.cjs';
53
46
  */
54
47
  declare function createUnpluginFactory<TBuildVariant extends UnpluginBuildVariant, TContext extends Context<InferResolvedConfig<TBuildVariant>> = Context<InferResolvedConfig<TBuildVariant>>>(variant: TBuildVariant, decorate?: (api: PowerlinesAPI<TContext["config"]>, plugin: Omit<PowerlinesUnpluginOptions<TBuildVariant>, UnpluginBuildVariant>) => InferUnpluginOptions<TBuildVariant>): PowerlinesUnpluginFactory<TBuildVariant>;
55
48
 
49
+ interface CreateUnpluginOptions {
50
+ /**
51
+ * If true, skips the plugin resolution step.
52
+ *
53
+ * @remarks
54
+ * This value should be set to `true` when using a build tool that handles `external` and `noExternal` options itself (for example `tsup`).
55
+ *
56
+ * @defaultValue false
57
+ */
58
+ skipResolve?: boolean;
59
+ }
56
60
  /**
57
- * An object containing all Powerlines plugins for various build tools and frameworks.
61
+ * Creates a Powerlines unplugin instance.
62
+ *
63
+ * @param context - The plugin context.
64
+ * @param options - Options for creating the unplugin.
65
+ * @returns The unplugin instance.
66
+ */
67
+ declare function createUnplugin<TContext extends PluginContext = PluginContext>(context: TContext, options?: CreateUnpluginOptions): PowerlinesUnpluginFactory<UnpluginBuildVariant>;
68
+ declare type __ΩCreateUnpluginOptions = any[];
69
+
70
+ interface ResolveIdArgs {
71
+ id: string;
72
+ importer: string | undefined;
73
+ options: {
74
+ isEntry: boolean;
75
+ };
76
+ }
77
+ interface ResolveIdOptions {
78
+ skipResolve?: boolean;
79
+ skipNodeModulesBundle?: boolean;
80
+ external: (string | RegExp)[];
81
+ noExternal: (string | RegExp)[];
82
+ resolvePatterns: (string | RegExp)[];
83
+ }
84
+ /**
85
+ * Handle the resolveId hook for the unplugin.
86
+ *
87
+ * @param context - The plugin context.
88
+ * @param args - The arguments for the hook.
89
+ * @param options - The options for the hook.
90
+ * @returns The resolved id or null if not found.
58
91
  */
59
- declare const plugins: {
60
- readonly astro: (config: Partial<Omit<ViteResolvedConfig["userConfig"], "variant">>) => astro.AstroUserConfig;
61
- readonly esbuild: (options: Partial<ESBuildUserConfig>) => _esbuild.Plugin;
62
- readonly next: typeof next;
63
- readonly nuxt: _nuxt_schema.NuxtModule<_nuxt_schema.ModuleOptions, _nuxt_schema.ModuleOptions, false>;
64
- readonly rolldown: (options: Partial<RolldownUserConfig>) => rolldown.Plugin<any> | rolldown.Plugin<any>[];
65
- readonly rollup: (options: Partial<RollupUserConfig>) => rollup.Plugin<any> | rollup.Plugin<any>[];
66
- readonly rspack: (options: Partial<RspackUserConfig>) => unplugin.RspackPluginInstance;
67
- readonly tsup: typeof tsup;
68
- readonly unloader: (options: Partial<UserConfig<BuildConfig, BuildResolvedConfig, any>>) => unloader.Plugin<false> | unloader.Plugin<false>[];
69
- readonly vite: (options: Partial<ViteUserConfig>) => vite.Plugin<any> | vite.Plugin<any>[];
70
- readonly webpack: (options: Partial<WebpackUserConfig>) => webpack.WebpackPluginInstance;
71
- };
92
+ declare function handleResolveId(context: Context, args: ResolveIdArgs, options?: Partial<ResolveIdOptions>): Promise<ExternalIdResult | null | undefined>;
93
+ declare type __ΩResolveIdArgs = any[];
94
+ declare type __ΩResolveIdOptions = any[];
72
95
 
73
- export { createUnpluginFactory, plugins as default, plugins };
96
+ export { type CreateUnpluginOptions, type ResolveIdArgs, type ResolveIdOptions, type __ΩCreateUnpluginOptions, type __ΩResolveIdArgs, type __ΩResolveIdOptions, createUnplugin, createUnpluginFactory, handleResolveId };