@powerlines/plugin-vite 0.14.61 → 0.14.63
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.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/powerlines/src/api.cjs +3 -3
- package/dist/powerlines/src/api.mjs +1 -1
- package/dist/powerlines/src/internal/helpers/environment.cjs +1 -1
- package/dist/powerlines/src/internal/helpers/environment.mjs +1 -1
- package/dist/powerlines/src/internal/helpers/hooks.d.cts +48 -0
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +50 -0
- package/dist/powerlines/src/internal/helpers/install.cjs +1 -1
- package/dist/powerlines/src/internal/helpers/install.mjs +1 -1
- package/dist/powerlines/src/internal/helpers/resolve-tsconfig.cjs +1 -1
- package/dist/powerlines/src/internal/helpers/resolve-tsconfig.mjs +1 -1
- package/dist/powerlines/src/internal/helpers/resolver.cjs +1 -1
- package/dist/powerlines/src/internal/helpers/resolver.mjs +1 -1
- package/dist/powerlines/src/lib/build/esbuild.cjs +2 -2
- package/dist/powerlines/src/lib/build/esbuild.mjs +2 -2
- package/dist/powerlines/src/lib/build/vite.cjs +1 -1
- package/dist/powerlines/src/lib/build/vite.mjs +1 -1
- package/dist/powerlines/src/lib/config-file.cjs +1 -1
- package/dist/powerlines/src/lib/config-file.mjs +1 -1
- package/dist/powerlines/src/lib/contexts/api-context.cjs +1 -1
- package/dist/powerlines/src/lib/contexts/api-context.mjs +1 -1
- package/dist/powerlines/src/lib/typescript/tsconfig.cjs +1 -1
- package/dist/powerlines/src/lib/typescript/tsconfig.mjs +1 -1
- package/dist/powerlines/src/types/api.d.cts +104 -0
- package/dist/powerlines/src/types/api.d.mts +104 -0
- package/dist/powerlines/src/types/build.d.cts +13 -2
- package/dist/powerlines/src/types/build.d.mts +13 -2
- package/dist/powerlines/src/types/config.d.cts +59 -1
- package/dist/powerlines/src/types/config.d.mts +60 -2
- package/dist/powerlines/src/types/context.d.cts +112 -1
- package/dist/powerlines/src/types/context.d.mts +112 -3
- package/dist/powerlines/src/types/hooks.d.cts +30 -0
- package/dist/powerlines/src/types/hooks.d.mts +30 -2
- package/dist/powerlines/src/types/internal.d.cts +58 -0
- package/dist/powerlines/src/types/internal.d.mts +58 -0
- package/dist/powerlines/src/types/plugin.d.cts +4 -1
- package/dist/powerlines/src/types/plugin.d.mts +4 -1
- package/dist/powerlines/src/types/resolved.d.mts +1 -0
- package/dist/types/internal.cjs +0 -0
- package/dist/types/internal.d.cts +14 -0
- package/dist/types/internal.d.mts +14 -0
- package/dist/types/internal.mjs +1 -0
- package/dist/types/plugin.d.cts +1 -8
- package/dist/types/plugin.d.mts +1 -8
- 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.
|
|
@@ -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.
|
|
@@ -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 };
|
|
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{};
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -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[];
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "0.14.63",
|
|
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
|
-
"
|
|
154
|
+
"vite": "8.0.0-beta.1",
|
|
155
|
+
"powerlines": "^0.31.0"
|
|
160
156
|
},
|
|
161
157
|
"devDependencies": {
|
|
162
|
-
"vite": "
|
|
163
|
-
"
|
|
164
|
-
"@powerlines/
|
|
165
|
-
"@
|
|
166
|
-
"@types/node": "^24.10.1"
|
|
158
|
+
"vite": "8.0.0-beta.1",
|
|
159
|
+
"@powerlines/nx": "^0.10.63",
|
|
160
|
+
"@powerlines/plugin-plugin": "^0.12.15",
|
|
161
|
+
"@types/node": "^24.10.2"
|
|
167
162
|
},
|
|
168
163
|
"publishConfig": { "access": "public" },
|
|
169
|
-
"gitHead": "
|
|
164
|
+
"gitHead": "2a4c29a361c5702474c60ee5f06a3e4e87d23c35"
|
|
170
165
|
}
|