@powerlines/plugin-vite 0.14.292 → 0.14.294

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 (82) hide show
  1. package/dist/core/src/lib/entry.mjs +15 -0
  2. package/dist/core/src/lib/logger.mjs +40 -0
  3. package/dist/core/src/lib/logger.mjs.map +1 -0
  4. package/dist/core/src/lib/unplugin/helpers.mjs +19 -0
  5. package/dist/core/src/lib/unplugin/helpers.mjs.map +1 -0
  6. package/dist/core/src/lib/unplugin/index.mjs +5 -0
  7. package/dist/core/src/lib/unplugin/module-resolution.mjs +66 -0
  8. package/dist/core/src/lib/unplugin/module-resolution.mjs.map +1 -0
  9. package/dist/core/src/lib/unplugin/plugin.mjs +71 -0
  10. package/dist/core/src/lib/unplugin/plugin.mjs.map +1 -0
  11. package/dist/core/src/lib/utilities/source-file.mjs +22 -0
  12. package/dist/core/src/lib/utilities/source-file.mjs.map +1 -0
  13. package/dist/core/src/plugin-utils/paths.mjs +4 -0
  14. package/dist/core/src/types/_internal.d.mts +85 -0
  15. package/dist/core/src/types/_internal.d.mts.map +1 -0
  16. package/dist/core/src/types/api.d.mts +103 -0
  17. package/dist/core/src/types/api.d.mts.map +1 -0
  18. package/dist/core/src/types/commands.d.mts +10 -0
  19. package/dist/core/src/types/commands.d.mts.map +1 -0
  20. package/dist/core/src/types/config.d.mts +552 -0
  21. package/dist/core/src/types/config.d.mts.map +1 -0
  22. package/dist/core/src/types/context.d.mts +511 -0
  23. package/dist/core/src/types/context.d.mts.map +1 -0
  24. package/dist/core/src/types/fs.d.mts +487 -0
  25. package/dist/core/src/types/fs.d.mts.map +1 -0
  26. package/dist/core/src/types/hooks.d.mts +99 -0
  27. package/dist/core/src/types/hooks.d.mts.map +1 -0
  28. package/dist/core/src/types/index.d.mts +9 -0
  29. package/dist/core/src/types/plugin.d.mts +204 -0
  30. package/dist/core/src/types/plugin.d.mts.map +1 -0
  31. package/dist/core/src/types/tsconfig.d.mts +70 -0
  32. package/dist/core/src/types/tsconfig.d.mts.map +1 -0
  33. package/dist/core/src/types/unplugin.d.mts +25 -0
  34. package/dist/core/src/types/unplugin.d.mts.map +1 -0
  35. package/dist/core/src/types/unplugin.mjs +22 -0
  36. package/dist/core/src/types/unplugin.mjs.map +1 -0
  37. package/dist/helpers/index.d.mts +2 -1
  38. package/dist/helpers/index.mjs +2 -1
  39. package/dist/helpers/resolve-options.d.mts +16 -0
  40. package/dist/helpers/resolve-options.d.mts.map +1 -0
  41. package/dist/helpers/resolve-options.mjs +69 -0
  42. package/dist/helpers/resolve-options.mjs.map +1 -0
  43. package/dist/helpers/unplugin.mjs +2 -1
  44. package/dist/helpers/unplugin.mjs.map +1 -1
  45. package/dist/index.d.mts +6 -3
  46. package/dist/index.d.mts.map +1 -1
  47. package/dist/index.mjs +6 -7
  48. package/dist/index.mjs.map +1 -1
  49. package/dist/plugin-esbuild/src/helpers/resolve-options.mjs +73 -0
  50. package/dist/plugin-esbuild/src/helpers/resolve-options.mjs.map +1 -0
  51. package/dist/plugin-rolldown/src/helpers/resolve-options.mjs +117 -0
  52. package/dist/plugin-rolldown/src/helpers/resolve-options.mjs.map +1 -0
  53. package/dist/plugin-rollup/src/helpers/resolve-options.mjs +116 -0
  54. package/dist/plugin-rollup/src/helpers/resolve-options.mjs.map +1 -0
  55. package/dist/types/{internal.d.mts → _internal.d.mts} +3 -3
  56. package/dist/types/_internal.d.mts.map +1 -0
  57. package/dist/types/build.d.mts +13 -0
  58. package/dist/types/build.d.mts.map +1 -0
  59. package/dist/types/build.mjs +1 -0
  60. package/dist/types/index.d.mts +3 -2
  61. package/dist/types/plugin.d.mts +13 -7
  62. package/dist/types/plugin.d.mts.map +1 -1
  63. package/package.json +30 -107
  64. package/dist/_virtual/rolldown_runtime.cjs +0 -29
  65. package/dist/helpers/index.cjs +0 -3
  66. package/dist/helpers/index.d.cts +0 -2
  67. package/dist/helpers/unplugin.cjs +0 -11
  68. package/dist/helpers/unplugin.d.cts +0 -8
  69. package/dist/helpers/unplugin.d.cts.map +0 -1
  70. package/dist/index.cjs +0 -47
  71. package/dist/index.d.cts +0 -14
  72. package/dist/index.d.cts.map +0 -1
  73. package/dist/types/index.cjs +0 -0
  74. package/dist/types/index.d.cts +0 -2
  75. package/dist/types/internal.cjs +0 -0
  76. package/dist/types/internal.d.cts +0 -15
  77. package/dist/types/internal.d.cts.map +0 -1
  78. package/dist/types/internal.d.mts.map +0 -1
  79. package/dist/types/plugin.cjs +0 -0
  80. package/dist/types/plugin.d.cts +0 -18
  81. package/dist/types/plugin.d.cts.map +0 -1
  82. /package/dist/types/{internal.mjs → _internal.mjs} +0 -0
@@ -1,29 +0,0 @@
1
- //#region rolldown:runtime
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
- value: mod,
24
- enumerable: true
25
- }) : target, mod));
26
-
27
- //#endregion
28
-
29
- exports.__toESM = __toESM;
@@ -1,3 +0,0 @@
1
- const require_helpers_unplugin = require('./unplugin.cjs');
2
-
3
- exports.createVitePlugin = require_helpers_unplugin.createVitePlugin;
@@ -1,2 +0,0 @@
1
- import { createVitePlugin } from "./unplugin.cjs";
2
- export { createVitePlugin };
@@ -1,11 +0,0 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- let powerlines_lib_unplugin = require("powerlines/lib/unplugin");
3
- let unplugin = require("unplugin");
4
-
5
- //#region src/helpers/unplugin.ts
6
- function createVitePlugin(context) {
7
- return (0, unplugin.createVitePlugin)((0, powerlines_lib_unplugin.createUnplugin)(context))({});
8
- }
9
-
10
- //#endregion
11
- exports.createVitePlugin = createVitePlugin;
@@ -1,8 +0,0 @@
1
- import { VitePluginContext } from "../types/plugin.cjs";
2
- import * as vite0 from "vite";
3
-
4
- //#region src/helpers/unplugin.d.ts
5
- declare function createVitePlugin(context: VitePluginContext): vite0.Plugin<any> | vite0.Plugin<any>[];
6
- //#endregion
7
- export { createVitePlugin };
8
- //# sourceMappingURL=unplugin.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,gBAAA,UAA0B,oBAAiB,KAAA,CAAA,cAAA,KAAA,CAAA"}
package/dist/index.cjs DELETED
@@ -1,47 +0,0 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
- const require_helpers_unplugin = require('./helpers/unplugin.cjs');
4
- require('./helpers/index.cjs');
5
- let defu = require("defu");
6
- defu = require_rolldown_runtime.__toESM(defu);
7
- let powerlines_lib_build_vite = require("powerlines/lib/build/vite");
8
- let vite = require("vite");
9
-
10
- //#region src/index.ts
11
- /**
12
- * A Powerlines plugin to assist in developing other Powerlines plugins.
13
- */
14
- const plugin = (options = {}) => {
15
- return {
16
- name: "vite",
17
- config() {
18
- this.trace("Providing default configuration for the Powerlines `vite` build plugin.");
19
- return {
20
- output: { format: ["cjs", "esm"] },
21
- build: {
22
- ...powerlines_lib_build_vite.DEFAULT_VITE_CONFIG,
23
- ...options,
24
- variant: "vite"
25
- },
26
- singleBuild: true
27
- };
28
- },
29
- async build() {
30
- this.trace(`Building the Powerlines plugin.`);
31
- const environments = this?.$$internal?.api?.context?.environments;
32
- if (!environments || Object.keys(environments).length === 0) throw new Error(`No environments found in the Powerlines context. At least one environment should have been generated - please report this issue to https://github.com/storm-software/powerlines/issues.`);
33
- this.trace(`Running Vite for ${Object.keys(environments).length} environments.`);
34
- await (0, vite.build)((0, defu.default)({
35
- config: false,
36
- entry: this.entry,
37
- environments: Object.fromEntries(Object.entries(environments).map(([name, env]) => [name, (0, powerlines_lib_build_vite.extractViteConfig)(env)]))
38
- }, (0, powerlines_lib_build_vite.extractViteConfig)(this), { plugins: [require_helpers_unplugin.createVitePlugin(this)] }));
39
- }
40
- };
41
- };
42
- var src_default = plugin;
43
-
44
- //#endregion
45
- exports.createVitePlugin = require_helpers_unplugin.createVitePlugin;
46
- exports.default = src_default;
47
- exports.plugin = plugin;
package/dist/index.d.cts DELETED
@@ -1,14 +0,0 @@
1
- import { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig } from "./types/plugin.cjs";
2
- import { createVitePlugin } from "./helpers/unplugin.cjs";
3
- import "./helpers/index.cjs";
4
- import "./types/index.cjs";
5
- import { Plugin } from "powerlines/types/plugin";
6
-
7
- //#region src/index.d.ts
8
- /**
9
- * A Powerlines plugin to assist in developing other Powerlines plugins.
10
- */
11
- declare const plugin: <TContext extends VitePluginContext = VitePluginContext>(options?: VitePluginOptions) => Plugin<TContext>;
12
- //#endregion
13
- export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, createVitePlugin, plugin as default, plugin };
14
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAqCa,cAAA,MAyDZ,EAAA,CAAA,iBAzDuC,iBAyDvC,GAzD2D,iBAyD3D,CAAA,CAAA,OAAA,CAAA,EAxDU,iBAwDV,EAAA,GAvDE,MAuDF,CAvDS,QAuDT,CAAA"}
File without changes
@@ -1,2 +0,0 @@
1
- import { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig } from "./plugin.cjs";
2
- export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig };
File without changes
@@ -1,15 +0,0 @@
1
- import { VitePluginResolvedConfig } from "./plugin.cjs";
2
- import { UNSAFE_PluginContext } from "powerlines/types/internal";
3
-
4
- //#region src/types/internal.d.ts
5
-
6
- /**
7
- * Internal fields and methods for internal Vite plugin contexts
8
- *
9
- * @internal
10
- */
11
- type UNSAFE_VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePluginResolvedConfig> = UNSAFE_PluginContext<TResolvedConfig>;
12
- declare type __ΩUNSAFE_VitePluginContext = any[];
13
- //#endregion
14
- export { UNSAFE_VitePluginContext, __ΩUNSAFE_VitePluginContext };
15
- //# sourceMappingURL=internal.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internal.d.cts","names":[],"sources":["../../src/types/internal.ts"],"sourcesContent":[],"mappings":";;;;;;;AA0BA;;;AAEyB,KAFb,wBAEa,CAAA,wBADC,wBACD,GAD4B,wBAC5B,CAAA,GAArB,oBAAqB,CAAA,eAAA,CAAA;AAArB,2CAAA,GAAA,EAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"internal.d.mts","names":[],"sources":["../../src/types/internal.ts"],"sourcesContent":[],"mappings":";;;;;;;AA0BA;;;AAEyB,KAFb,wBAEa,CAAA,wBADC,wBACD,GAD4B,wBAC5B,CAAA,GAArB,oBAAqB,CAAA,eAAA,CAAA;AAArB,2CAAA,GAAA,EAAA"}
File without changes
@@ -1,18 +0,0 @@
1
- import { ViteBuildConfig } from "powerlines/types/build";
2
- import { ConfigEnv } from "powerlines/types/config";
3
- import { PluginContext } from "powerlines/types/context";
4
- import { ViteResolvedConfig } from "powerlines/types/resolved";
5
-
6
- //#region src/types/plugin.d.ts
7
- type VitePluginOptions = Partial<ViteBuildConfig>;
8
- type VitePluginResolvedConfig = ViteResolvedConfig;
9
- type VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePluginResolvedConfig> = PluginContext<TResolvedConfig> & {
10
- dev: boolean;
11
- configEnv: ConfigEnv;
12
- };
13
- declare type __ΩVitePluginOptions = any[];
14
- declare type __ΩVitePluginResolvedConfig = any[];
15
- declare type __ΩVitePluginContext = any[];
16
- //#endregion
17
- export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig };
18
- //# sourceMappingURL=plugin.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAuBY,iBAAA,GAAoB,QAAQ;KAE5B,wBAAA,GAA2B;AAF3B,KAIA,iBAJiB,CAAA,wBAKH,wBALa,GAKc,wBALd,CAAA,GAMnC,aANmC,CAMrB,eANqB,CAAA,GAAA;EAE3B,GAAA,EAAA,OAAA;EAEA,SAAA,EAIC,SAJgB;CACH;AAA2B,oCAAA,GAAA,EAAA;AACnC,2CAAA,GAAA,EAAA;AAAd,oCAAA,GAAA,EAAA"}
File without changes