@powerlines/plugin-vite 0.14.62 → 0.14.64

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 (46) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.mjs +1 -1
  3. package/dist/powerlines/src/api.cjs +3 -3
  4. package/dist/powerlines/src/api.mjs +1 -1
  5. package/dist/powerlines/src/internal/helpers/environment.cjs +1 -1
  6. package/dist/powerlines/src/internal/helpers/environment.mjs +1 -1
  7. package/dist/powerlines/src/internal/helpers/hooks.d.cts +48 -0
  8. package/dist/powerlines/src/internal/helpers/hooks.d.mts +50 -0
  9. package/dist/powerlines/src/internal/helpers/install.cjs +1 -1
  10. package/dist/powerlines/src/internal/helpers/install.mjs +1 -1
  11. package/dist/powerlines/src/internal/helpers/resolve-tsconfig.cjs +1 -1
  12. package/dist/powerlines/src/internal/helpers/resolve-tsconfig.mjs +1 -1
  13. package/dist/powerlines/src/internal/helpers/resolver.cjs +1 -1
  14. package/dist/powerlines/src/internal/helpers/resolver.mjs +1 -1
  15. package/dist/powerlines/src/lib/build/esbuild.cjs +2 -2
  16. package/dist/powerlines/src/lib/build/esbuild.mjs +2 -2
  17. package/dist/powerlines/src/lib/build/vite.cjs +1 -1
  18. package/dist/powerlines/src/lib/build/vite.mjs +1 -1
  19. package/dist/powerlines/src/lib/config-file.cjs +1 -1
  20. package/dist/powerlines/src/lib/config-file.mjs +1 -1
  21. package/dist/powerlines/src/lib/contexts/api-context.cjs +1 -1
  22. package/dist/powerlines/src/lib/contexts/api-context.mjs +1 -1
  23. package/dist/powerlines/src/lib/typescript/tsconfig.cjs +1 -1
  24. package/dist/powerlines/src/lib/typescript/tsconfig.mjs +1 -1
  25. package/dist/powerlines/src/types/api.d.cts +104 -0
  26. package/dist/powerlines/src/types/api.d.mts +104 -0
  27. package/dist/powerlines/src/types/build.d.cts +13 -2
  28. package/dist/powerlines/src/types/build.d.mts +13 -2
  29. package/dist/powerlines/src/types/config.d.cts +59 -1
  30. package/dist/powerlines/src/types/config.d.mts +60 -2
  31. package/dist/powerlines/src/types/context.d.cts +112 -1
  32. package/dist/powerlines/src/types/context.d.mts +112 -3
  33. package/dist/powerlines/src/types/hooks.d.cts +30 -0
  34. package/dist/powerlines/src/types/hooks.d.mts +30 -2
  35. package/dist/powerlines/src/types/internal.d.cts +58 -0
  36. package/dist/powerlines/src/types/internal.d.mts +58 -0
  37. package/dist/powerlines/src/types/plugin.d.cts +5 -2
  38. package/dist/powerlines/src/types/plugin.d.mts +5 -2
  39. package/dist/powerlines/src/types/resolved.d.mts +1 -0
  40. package/dist/types/internal.cjs +0 -0
  41. package/dist/types/internal.d.cts +14 -0
  42. package/dist/types/internal.d.mts +14 -0
  43. package/dist/types/internal.mjs +1 -0
  44. package/dist/types/plugin.d.cts +1 -8
  45. package/dist/types/plugin.d.mts +1 -8
  46. package/package.json +8 -13
@@ -0,0 +1,58 @@
1
+ import { ResolvedConfig } from "./resolved.cjs";
2
+ import { PluginConfig } from "./config.cjs";
3
+ import { HookKeys, InferHookParameters, InferHookReturnType } from "./hooks.cjs";
4
+ import { EnvironmentContext, PluginContext } from "./context.cjs";
5
+ import { CallHookOptions } from "../internal/helpers/hooks.cjs";
6
+ import { API } from "./api.cjs";
7
+
8
+ //#region ../powerlines/src/types/internal.d.ts
9
+
10
+ /**
11
+ * Internal fields and methods for internal contexts
12
+ *
13
+ * @internal
14
+ */
15
+ interface UNSAFE_ContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
16
+ /**
17
+ * The API instance for interacting with Powerlines
18
+ *
19
+ * @internal
20
+ */
21
+ api: API<TResolvedConfig>;
22
+ /**
23
+ * Add a Powerlines plugin used in the build process
24
+ *
25
+ * @internal
26
+ *
27
+ * @param config - The import path of the plugin to add
28
+ */
29
+ addPlugin: (config: PluginConfig<PluginContext<TResolvedConfig>>) => Promise<void>;
30
+ }
31
+ /**
32
+ * An internal representation of the environment context, used for managing hooks and environment data.
33
+ *
34
+ * @internal
35
+ */
36
+ interface UNSAFE_EnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends EnvironmentContext<TResolvedConfig> {
37
+ $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
38
+ }
39
+ /**
40
+ * Internal fields and methods for the internal plugin context
41
+ *
42
+ * @internal
43
+ */
44
+ interface UNSAFE_PluginContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends UNSAFE_ContextInternal<TResolvedConfig> {
45
+ api: API<TResolvedConfig>;
46
+ environment: UNSAFE_EnvironmentContext<TResolvedConfig>;
47
+ callHook: <TKey extends HookKeys<PluginContext<TResolvedConfig>>>(hook: TKey, options: CallHookOptions, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
48
+ }
49
+ /**
50
+ * An internal representation of the plugin context, used for managing hooks and environment data.
51
+ *
52
+ * @internal
53
+ */
54
+ interface UNSAFE_PluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PluginContext<TResolvedConfig> {
55
+ $$internal: UNSAFE_PluginContextInternal<TResolvedConfig>;
56
+ }
57
+ //#endregion
58
+ export { UNSAFE_PluginContext };
@@ -0,0 +1,58 @@
1
+ import { ResolvedConfig } from "./resolved.mjs";
2
+ import { PluginConfig } from "./config.mjs";
3
+ import { HookKeys, InferHookParameters, InferHookReturnType } from "./hooks.mjs";
4
+ import { EnvironmentContext, PluginContext } from "./context.mjs";
5
+ import { CallHookOptions } from "../internal/helpers/hooks.mjs";
6
+ import { API } from "./api.mjs";
7
+
8
+ //#region ../powerlines/src/types/internal.d.ts
9
+
10
+ /**
11
+ * Internal fields and methods for internal contexts
12
+ *
13
+ * @internal
14
+ */
15
+ interface UNSAFE_ContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
16
+ /**
17
+ * The API instance for interacting with Powerlines
18
+ *
19
+ * @internal
20
+ */
21
+ api: API<TResolvedConfig>;
22
+ /**
23
+ * Add a Powerlines plugin used in the build process
24
+ *
25
+ * @internal
26
+ *
27
+ * @param config - The import path of the plugin to add
28
+ */
29
+ addPlugin: (config: PluginConfig<PluginContext<TResolvedConfig>>) => Promise<void>;
30
+ }
31
+ /**
32
+ * An internal representation of the environment context, used for managing hooks and environment data.
33
+ *
34
+ * @internal
35
+ */
36
+ interface UNSAFE_EnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends EnvironmentContext<TResolvedConfig> {
37
+ $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
38
+ }
39
+ /**
40
+ * Internal fields and methods for the internal plugin context
41
+ *
42
+ * @internal
43
+ */
44
+ interface UNSAFE_PluginContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends UNSAFE_ContextInternal<TResolvedConfig> {
45
+ api: API<TResolvedConfig>;
46
+ environment: UNSAFE_EnvironmentContext<TResolvedConfig>;
47
+ callHook: <TKey extends HookKeys<PluginContext<TResolvedConfig>>>(hook: TKey, options: CallHookOptions, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
48
+ }
49
+ /**
50
+ * An internal representation of the plugin context, used for managing hooks and environment data.
51
+ *
52
+ * @internal
53
+ */
54
+ interface UNSAFE_PluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PluginContext<TResolvedConfig> {
55
+ $$internal: UNSAFE_PluginContextInternal<TResolvedConfig>;
56
+ }
57
+ //#endregion
58
+ export { UNSAFE_PluginContext };
@@ -131,6 +131,9 @@ interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext
131
131
  writeBundle: (this: TContext) => MaybePromise<void>;
132
132
  }
133
133
  type BuildPlugin<TContext extends PluginContext = PluginContext, TBuildVariant$1 extends UnpluginBuildVariant = UnpluginBuildVariant, TOptions extends Required<UnpluginOptions>[TBuildVariant$1] = Required<UnpluginOptions>[TBuildVariant$1]> = { [TKey in keyof TOptions]: TOptions[TKey] extends FunctionLike ? (this: ThisParameterType<TOptions[TKey]> & TContext, ...args: Parameters<TOptions[TKey]>) => ReturnType<TOptions[TKey]> | MaybePromise<ReturnType<TOptions[TKey]>> : TOptions[TKey] };
134
+ type ExternalPluginHookFunctionsVariant<TContext extends PluginContext = PluginContext, TBuildVariant$1 extends UnpluginBuildVariant = UnpluginBuildVariant> = { [TKey in keyof BuildPlugin<TContext, TBuildVariant$1> & string as `${TBuildVariant$1}:${TKey}`]: BuildPlugin<TContext, TBuildVariant$1>[TKey] };
135
+ type ExternalPluginHookFunctions<TContext extends PluginContext> = ExternalPluginHookFunctionsVariant<TContext, "vite"> & ExternalPluginHookFunctionsVariant<TContext, "esbuild"> & ExternalPluginHookFunctionsVariant<TContext, "rolldown"> & ExternalPluginHookFunctionsVariant<TContext, "rollup"> & ExternalPluginHookFunctionsVariant<TContext, "webpack"> & ExternalPluginHookFunctionsVariant<TContext, "rspack"> & ExternalPluginHookFunctionsVariant<TContext, "farm">;
136
+ type PluginHookFunctions<TContext extends PluginContext = PluginContext> = BasePluginHookFunctions<TContext> & ExternalPluginHookFunctions<TContext>;
134
137
  type PluginHooks<TContext extends PluginContext = PluginContext> = { [TKey in keyof BasePluginHookFunctions<TContext>]: PluginHook<BasePluginHookFunctions<TContext>[TKey]> } & {
135
138
  /**
136
139
  * A function that returns configuration options to be merged with the build context's options.
@@ -178,7 +181,7 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = { [TKey in ke
178
181
  }) => MaybePromise<string | ExternalIdResult | null | undefined>, "id">;
179
182
  };
180
183
  type PluginBuildPlugins<TContext extends PluginContext = PluginContext> = { [TBuildVariant in UnpluginBuildVariant]?: BuildPlugin<TContext, TBuildVariant> };
181
- interface Plugin<in out TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> extends Partial<PluginHooks<TContext>>, PluginBuildPlugins<TContext> {
184
+ interface Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> extends Partial<PluginHooks<TContext>>, PluginBuildPlugins<TContext> {
182
185
  /**
183
186
  * The name of the plugin, for use in deduplication, error messages and logs.
184
187
  */
@@ -229,4 +232,4 @@ interface Plugin<in out TContext extends PluginContext<ResolvedConfig> = PluginC
229
232
  applyToEnvironment?: (environment: EnvironmentResolvedConfig) => boolean | PluginConfig<TContext>;
230
233
  }
231
234
  //#endregion
232
- export { Plugin };
235
+ export { BasePluginHookFunctions, ExternalPluginHookFunctions, Plugin, PluginHookFunctions, PluginHookObject };
@@ -131,6 +131,9 @@ interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext
131
131
  writeBundle: (this: TContext) => MaybePromise<void>;
132
132
  }
133
133
  type BuildPlugin<TContext extends PluginContext = PluginContext, TBuildVariant$1 extends UnpluginBuildVariant = UnpluginBuildVariant, TOptions extends Required<UnpluginOptions>[TBuildVariant$1] = Required<UnpluginOptions>[TBuildVariant$1]> = { [TKey in keyof TOptions]: TOptions[TKey] extends FunctionLike ? (this: ThisParameterType<TOptions[TKey]> & TContext, ...args: Parameters<TOptions[TKey]>) => ReturnType<TOptions[TKey]> | MaybePromise<ReturnType<TOptions[TKey]>> : TOptions[TKey] };
134
+ type ExternalPluginHookFunctionsVariant<TContext extends PluginContext = PluginContext, TBuildVariant$1 extends UnpluginBuildVariant = UnpluginBuildVariant> = { [TKey in keyof BuildPlugin<TContext, TBuildVariant$1> & string as `${TBuildVariant$1}:${TKey}`]: BuildPlugin<TContext, TBuildVariant$1>[TKey] };
135
+ type ExternalPluginHookFunctions<TContext extends PluginContext> = ExternalPluginHookFunctionsVariant<TContext, "vite"> & ExternalPluginHookFunctionsVariant<TContext, "esbuild"> & ExternalPluginHookFunctionsVariant<TContext, "rolldown"> & ExternalPluginHookFunctionsVariant<TContext, "rollup"> & ExternalPluginHookFunctionsVariant<TContext, "webpack"> & ExternalPluginHookFunctionsVariant<TContext, "rspack"> & ExternalPluginHookFunctionsVariant<TContext, "farm">;
136
+ type PluginHookFunctions<TContext extends PluginContext = PluginContext> = BasePluginHookFunctions<TContext> & ExternalPluginHookFunctions<TContext>;
134
137
  type PluginHooks<TContext extends PluginContext = PluginContext> = { [TKey in keyof BasePluginHookFunctions<TContext>]: PluginHook<BasePluginHookFunctions<TContext>[TKey]> } & {
135
138
  /**
136
139
  * A function that returns configuration options to be merged with the build context's options.
@@ -178,7 +181,7 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = { [TKey in ke
178
181
  }) => MaybePromise<string | ExternalIdResult | null | undefined>, "id">;
179
182
  };
180
183
  type PluginBuildPlugins<TContext extends PluginContext = PluginContext> = { [TBuildVariant in UnpluginBuildVariant]?: BuildPlugin<TContext, TBuildVariant> };
181
- interface Plugin<in out TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> extends Partial<PluginHooks<TContext>>, PluginBuildPlugins<TContext> {
184
+ interface Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> extends Partial<PluginHooks<TContext>>, PluginBuildPlugins<TContext> {
182
185
  /**
183
186
  * The name of the plugin, for use in deduplication, error messages and logs.
184
187
  */
@@ -229,4 +232,4 @@ interface Plugin<in out TContext extends PluginContext<ResolvedConfig> = PluginC
229
232
  applyToEnvironment?: (environment: EnvironmentResolvedConfig) => boolean | PluginConfig<TContext>;
230
233
  }
231
234
  //#endregion
232
- export { Plugin };
235
+ export { BasePluginHookFunctions, ExternalPluginHookFunctions, Plugin, PluginHookFunctions, PluginHookObject };
@@ -1,3 +1,4 @@
1
+ import "./build.mjs";
1
2
  import { EnvironmentConfig, InlineConfig, OutputConfig, UserConfig as UserConfig$1, ViteUserConfig } from "./config.mjs";
2
3
  import { ResolvedPreviewOptions } from "vite";
3
4
  import { NonUndefined } from "@stryke/types/base";
File without changes
@@ -0,0 +1,14 @@
1
+ import { VitePluginResolvedConfig } from "./plugin.cjs";
2
+ import { UNSAFE_PluginContext } from "../powerlines/src/types/internal.cjs";
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 };
@@ -0,0 +1,14 @@
1
+ import { VitePluginResolvedConfig } from "./plugin.mjs";
2
+ import { UNSAFE_PluginContext } from "../powerlines/src/types/internal.mjs";
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 };
@@ -0,0 +1 @@
1
+ export{};
@@ -3,14 +3,7 @@ import { ViteResolvedConfig } from "../powerlines/src/types/resolved.cjs";
3
3
  import { PluginContext } from "../powerlines/src/types/context.cjs";
4
4
 
5
5
  //#region src/types/plugin.d.ts
6
- type VitePluginOptions = Partial<ViteBuildConfig> & {
7
- /**
8
- * Whether to use [rolldown-vite](https://vite.dev/guide/rolldown.html) for the build.
9
- *
10
- * @defaultValue false
11
- */
12
- rolldown?: boolean;
13
- };
6
+ type VitePluginOptions = Partial<ViteBuildConfig>;
14
7
  type VitePluginResolvedConfig = ViteResolvedConfig;
15
8
  type VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePluginResolvedConfig> = PluginContext<TResolvedConfig>;
16
9
  declare type __ΩVitePluginOptions = any[];
@@ -3,14 +3,7 @@ import { ViteResolvedConfig } from "../powerlines/src/types/resolved.mjs";
3
3
  import { PluginContext } from "../powerlines/src/types/context.mjs";
4
4
 
5
5
  //#region src/types/plugin.d.ts
6
- type VitePluginOptions = Partial<ViteBuildConfig> & {
7
- /**
8
- * Whether to use [rolldown-vite](https://vite.dev/guide/rolldown.html) for the build.
9
- *
10
- * @defaultValue false
11
- */
12
- rolldown?: boolean;
13
- };
6
+ type VitePluginOptions = Partial<ViteBuildConfig>;
14
7
  type VitePluginResolvedConfig = ViteResolvedConfig;
15
8
  type VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePluginResolvedConfig> = PluginContext<TResolvedConfig>;
16
9
  declare type __ΩVitePluginOptions = any[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-vite",
3
- "version": "0.14.62",
3
+ "version": "0.14.64",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "repository": {
@@ -144,11 +144,6 @@
144
144
  "typings": "dist/index.d.mts",
145
145
  "files": ["dist/**/*"],
146
146
  "keywords": ["vite", "powerlines", "storm-software", "powerlines-plugin"],
147
- "peerDependencies": { "vite": "^7.1.0", "rolldown-vite": "^7.1.0" },
148
- "peerDependenciesMeta": {
149
- "vite": { "optional": true },
150
- "rolldown-vite": { "optional": true }
151
- },
152
147
  "dependencies": {
153
148
  "@stryke/fs": "^0.33.20",
154
149
  "@stryke/path": "^0.22.11",
@@ -156,15 +151,15 @@
156
151
  "@stryke/types": "^0.10.23",
157
152
  "defu": "^6.1.4",
158
153
  "jiti": "^2.6.1",
159
- "powerlines": "^0.30.13"
154
+ "vite": "8.0.0-beta.1",
155
+ "powerlines": "^0.31.1"
160
156
  },
161
157
  "devDependencies": {
162
- "vite": "^7.2.7",
163
- "rolldown-vite": "^7.2.10",
164
- "@powerlines/nx": "^0.10.62",
165
- "@powerlines/plugin-plugin": "^0.12.14",
166
- "@types/node": "^24.10.1"
158
+ "vite": "8.0.0-beta.1",
159
+ "@powerlines/nx": "^0.10.64",
160
+ "@powerlines/plugin-plugin": "^0.12.16",
161
+ "@types/node": "^24.10.4"
167
162
  },
168
163
  "publishConfig": { "access": "public" },
169
- "gitHead": "56e0428b32d445614bde031bbd30c077b1432641"
164
+ "gitHead": "970018c8e5c0c11f91527bdf8981930d6e05fcb2"
170
165
  }