@powerlines/plugin-env 0.15.8 → 0.15.10
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/babel/plugin.cjs +1 -1
- package/dist/babel/plugin.mjs +1 -1
- package/dist/helpers/load.cjs +2 -2
- package/dist/helpers/load.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/plugin-alloy/src/core/components/source-file.cjs +1 -1
- package/dist/plugin-alloy/src/core/components/source-file.mjs +1 -1
- package/dist/plugin-alloy/src/index.cjs +12 -5
- package/dist/plugin-alloy/src/index.mjs +12 -5
- package/dist/plugin-alloy/src/types/components.d.cts +2 -5
- package/dist/plugin-alloy/src/types/components.d.mts +2 -5
- package/dist/plugin-alloy/src/types/index.d.cts +1 -1
- package/dist/plugin-alloy/src/types/index.d.mts +1 -1
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +1 -1
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +1 -1
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +23 -5
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +24 -6
- package/dist/plugin-automd/src/index.cjs +2 -2
- package/dist/plugin-automd/src/index.mjs +1 -1
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +1 -1
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +1 -1
- package/dist/plugin-babel/src/index.cjs +4 -7
- package/dist/plugin-babel/src/index.mjs +2 -5
- package/dist/powerlines/src/api.d.mts +2 -2
- package/dist/powerlines/src/index.d.mts +8 -5
- package/dist/powerlines/src/internal/helpers/hooks.cjs +37 -19
- package/dist/powerlines/src/internal/helpers/hooks.d.cts +47 -0
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +46 -2
- package/dist/powerlines/src/internal/helpers/hooks.mjs +37 -20
- 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/entry.cjs +1 -1
- package/dist/powerlines/src/lib/entry.mjs +1 -1
- package/dist/powerlines/src/types/api.cjs +62 -1
- package/dist/powerlines/src/types/api.d.cts +104 -0
- package/dist/powerlines/src/types/api.d.mts +104 -5
- package/dist/powerlines/src/types/api.mjs +61 -2
- package/dist/powerlines/src/types/build.cjs +26 -4
- package/dist/powerlines/src/types/build.d.cts +43 -3
- package/dist/powerlines/src/types/build.d.mts +42 -4
- package/dist/powerlines/src/types/build.mjs +23 -3
- package/dist/powerlines/src/types/config.cjs +107 -0
- package/dist/powerlines/src/types/config.d.cts +60 -4
- package/dist/powerlines/src/types/config.d.mts +61 -5
- package/dist/powerlines/src/types/config.mjs +99 -1
- package/dist/powerlines/src/types/context.cjs +57 -0
- package/dist/powerlines/src/types/context.d.cts +113 -1
- package/dist/powerlines/src/types/context.d.mts +113 -3
- package/dist/powerlines/src/types/context.mjs +54 -1
- package/dist/powerlines/src/types/hooks.cjs +33 -14
- package/dist/powerlines/src/types/hooks.d.cts +32 -0
- package/dist/powerlines/src/types/hooks.d.mts +32 -2
- package/dist/powerlines/src/types/hooks.mjs +32 -12
- package/dist/powerlines/src/types/index.cjs +3 -3
- package/dist/powerlines/src/types/index.d.mts +8 -8
- package/dist/powerlines/src/types/index.mjs +7 -7
- package/dist/powerlines/src/types/plugin.cjs +40 -105
- package/dist/powerlines/src/types/plugin.d.cts +35 -61
- package/dist/powerlines/src/types/plugin.d.mts +35 -61
- package/dist/powerlines/src/types/plugin.mjs +40 -102
- package/dist/powerlines/src/types/resolved.d.cts +16 -4
- package/dist/powerlines/src/types/resolved.d.mts +16 -5
- package/dist/powerlines/src/types/unplugin.cjs +47 -1
- package/dist/powerlines/src/types/unplugin.d.cts +22 -0
- package/dist/powerlines/src/types/unplugin.d.mts +22 -6
- package/dist/powerlines/src/types/unplugin.mjs +45 -2
- package/package.json +9 -9
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BUILDER_VARIANTS } from "./build.mjs";
|
|
2
|
+
import { __ΩInferUnpluginOptions } from "./unplugin.mjs";
|
|
2
3
|
import { SUPPORTED_COMMANDS } from "./commands.mjs";
|
|
3
4
|
|
|
4
5
|
//#region ../powerlines/src/types/plugin.ts
|
|
@@ -8,44 +9,17 @@ const __ΩPick = [
|
|
|
8
9
|
"Pick",
|
|
9
10
|
"l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
|
|
10
11
|
];
|
|
12
|
+
const __ΩPartial = [
|
|
13
|
+
"T",
|
|
14
|
+
"Partial",
|
|
15
|
+
"l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
|
|
16
|
+
];
|
|
11
17
|
const __ΩRecord = [
|
|
12
18
|
"K",
|
|
13
19
|
"T",
|
|
14
20
|
"Record",
|
|
15
21
|
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
16
22
|
];
|
|
17
|
-
const __ΩRequired = [
|
|
18
|
-
"T",
|
|
19
|
-
"Required",
|
|
20
|
-
"l+e#!e\"!fRb!Pde\"!gN##w\"y"
|
|
21
|
-
];
|
|
22
|
-
const __ΩThisParameterType = [
|
|
23
|
-
"T",
|
|
24
|
-
"this",
|
|
25
|
-
"args",
|
|
26
|
-
"",
|
|
27
|
-
"ThisParameterType",
|
|
28
|
-
"lAe\"!R#RPde#!Ph\"!2\"!@2#\"/$qk#'QRb!Pde\"!p)w%y"
|
|
29
|
-
];
|
|
30
|
-
const __ΩParameters = [
|
|
31
|
-
"T",
|
|
32
|
-
"args",
|
|
33
|
-
"",
|
|
34
|
-
"Parameters",
|
|
35
|
-
"l>e\"!R!RPde#!Ph\"!@2\"\"/#qk#'QRb!Pde\"!p)w$y"
|
|
36
|
-
];
|
|
37
|
-
const __ΩReturnType = [
|
|
38
|
-
"T",
|
|
39
|
-
"args",
|
|
40
|
-
"",
|
|
41
|
-
"ReturnType",
|
|
42
|
-
"l>e\"!R\"RPde#!P\"@2\"h\"!/#qk#'QRb!Pde\"!p)w$y"
|
|
43
|
-
];
|
|
44
|
-
const __ΩPartial = [
|
|
45
|
-
"T",
|
|
46
|
-
"Partial",
|
|
47
|
-
"l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
|
|
48
|
-
];
|
|
49
23
|
const __ΩPluginHookObject = [
|
|
50
24
|
"THookFunction",
|
|
51
25
|
"TFilter",
|
|
@@ -68,25 +42,8 @@ const __ΩPluginHook = [
|
|
|
68
42
|
"PluginHook",
|
|
69
43
|
"b!!c\"Pe\"!e\"!e\"\"o##Jw$y"
|
|
70
44
|
];
|
|
71
|
-
const __Ω
|
|
72
|
-
"T",
|
|
73
|
-
0,
|
|
74
|
-
"DeepPartial",
|
|
75
|
-
"l.e#!e\"!fo\"\"Rb!Pde\"!gN#\"w#y"
|
|
76
|
-
];
|
|
77
|
-
const __ΩConfigResult = [
|
|
78
|
-
"PluginContext",
|
|
45
|
+
const __ΩPluginHookFunctions = [
|
|
79
46
|
"TContext",
|
|
80
|
-
() => __ΩDeepPartial,
|
|
81
|
-
"config",
|
|
82
|
-
() => __ΩRecord,
|
|
83
|
-
"ConfigResult",
|
|
84
|
-
"\"w!c\"Pe\"!.$fo#\"&\"o%#Kw&y"
|
|
85
|
-
];
|
|
86
|
-
const __ΩBasePluginHookFunctions = [
|
|
87
|
-
"PluginContext",
|
|
88
|
-
"TContext",
|
|
89
|
-
() => __ΩRecord,
|
|
90
47
|
"CommandType",
|
|
91
48
|
"this",
|
|
92
49
|
"",
|
|
@@ -120,74 +77,44 @@ const __ΩBasePluginHookFunctions = [
|
|
|
120
77
|
"A hook that is called to resolve the identifier of the source code.",
|
|
121
78
|
"writeBundle",
|
|
122
79
|
"A hook that is called to write the bundle to disk.",
|
|
123
|
-
"
|
|
124
|
-
"\"w
|
|
125
|
-
];
|
|
126
|
-
const __ΩBuildPlugin = [
|
|
127
|
-
"PluginContext",
|
|
128
|
-
"TContext",
|
|
129
|
-
"UnpluginBuildVariant",
|
|
130
|
-
"TBuildVariant",
|
|
131
|
-
() => __ΩRequired,
|
|
132
|
-
"TOptions",
|
|
133
|
-
() => __ΩThisParameterType,
|
|
134
|
-
"this",
|
|
135
|
-
() => __ΩParameters,
|
|
136
|
-
"args",
|
|
137
|
-
() => __ΩReturnType,
|
|
138
|
-
"",
|
|
139
|
-
"BuildPlugin",
|
|
140
|
-
"liPPe'#e&!fo'\"e'!K2(e&#e%!fo)\"@2*Pe'#e&!fo+\"!J/,Re%#e$!fRPe$#e#!f!qk#RQR\"w!c\"\"w#c$!o%\"e!\"fc&Pde\"#gNZ!w-y"
|
|
80
|
+
"PluginHookFunctions",
|
|
81
|
+
"l-Pe%!2#!/$Rb!PPd\"w\"N#!PP\"w%2#!/$4&?'Pe$!2#&2(\"w)2*!/$4+?,Pe$!2#!/$4-?.Pe$!2#&2/!/$40?1PP\"w2e%!K2#!/$43?4PP\"w2e%!K2#!/$45?6PP\"w2e%!K2#&2/&27!/$48?9PP\"w2e%!K2#&27!/$4:?;PP\"w2e%!K2#&27P&-J2<P)4=M2>!/$4??@Pe$!2#!/$4A?BMKwCy"
|
|
141
82
|
];
|
|
142
83
|
const __ΩPluginHooks = [
|
|
143
|
-
"PluginContext",
|
|
144
84
|
"TContext",
|
|
145
|
-
() => __Ω
|
|
146
|
-
() => __ΩPluginHook,
|
|
147
|
-
() => __ΩBasePluginHookFunctions,
|
|
85
|
+
() => __ΩPluginHookFunctions,
|
|
148
86
|
() => __ΩPluginHook,
|
|
149
|
-
|
|
150
|
-
"this",
|
|
151
|
-
"",
|
|
152
|
-
() => __ΩConfigResult,
|
|
153
|
-
"config",
|
|
154
|
-
"A function that returns configuration options to be merged with the build context's options.",
|
|
87
|
+
() => __ΩPluginHookFunctions,
|
|
155
88
|
() => __ΩPluginHook,
|
|
156
|
-
|
|
157
|
-
"
|
|
158
|
-
"id",
|
|
89
|
+
() => __ΩPluginHookFunctions,
|
|
90
|
+
"transform",
|
|
159
91
|
"code",
|
|
160
92
|
"id",
|
|
161
93
|
"transform",
|
|
162
|
-
"A hook that is called to transform the source code.",
|
|
163
94
|
() => __ΩPluginHook,
|
|
95
|
+
() => __ΩPluginHookFunctions,
|
|
96
|
+
"load",
|
|
164
97
|
"id",
|
|
165
98
|
"load",
|
|
166
|
-
"A hook that is called to load the source code.",
|
|
167
99
|
() => __ΩPluginHook,
|
|
168
|
-
|
|
169
|
-
"
|
|
170
|
-
"options",
|
|
100
|
+
() => __ΩPluginHookFunctions,
|
|
101
|
+
"resolveId",
|
|
171
102
|
"id",
|
|
172
103
|
"resolveId",
|
|
173
|
-
"A hook that is called to resolve the identifier of the source code.",
|
|
174
104
|
"PluginHooks",
|
|
175
|
-
"l1e$!o
|
|
105
|
+
"l1e$!o$\"e\"!fo#\"Rb!PPde#!o\"\"gN#\"Pe#!o&\".'fP.(.)Jo%#4*e#!o,\".-f..o+#4/e#!o1\".2f.3o0#44MKw5y"
|
|
176
106
|
];
|
|
177
|
-
const __Ω
|
|
178
|
-
"
|
|
179
|
-
|
|
180
|
-
"
|
|
181
|
-
|
|
182
|
-
"PluginBuildPlugins",
|
|
183
|
-
"l-e#!e\"!o$#R\"w!c\"Pd\"w#N#\"w%y"
|
|
107
|
+
const __ΩDeepPartial = [
|
|
108
|
+
"T",
|
|
109
|
+
0,
|
|
110
|
+
"DeepPartial",
|
|
111
|
+
"l.e#!e\"!fo\"\"Rb!Pde\"!gN#\"w#y"
|
|
184
112
|
];
|
|
185
113
|
const __ΩPlugin = [
|
|
186
114
|
"PluginContext",
|
|
187
115
|
"TContext",
|
|
188
116
|
() => __ΩPartial,
|
|
189
117
|
() => __ΩPluginHooks,
|
|
190
|
-
() => __ΩPluginBuildPlugins,
|
|
191
118
|
"name",
|
|
192
119
|
"The name of the plugin, for use in deduplication, error messages and logs.",
|
|
193
120
|
() => __ΩRecord,
|
|
@@ -208,8 +135,18 @@ const __ΩPlugin = [
|
|
|
208
135
|
"PluginConfig",
|
|
209
136
|
"applyToEnvironment",
|
|
210
137
|
"Define environments where this plugin should be active. By default, the plugin is active in all environments.",
|
|
138
|
+
() => __ΩPluginHook,
|
|
139
|
+
"UnresolvedContext",
|
|
140
|
+
"this",
|
|
141
|
+
() => __ΩDeepPartial,
|
|
142
|
+
"config",
|
|
143
|
+
() => __ΩRecord,
|
|
144
|
+
"config",
|
|
145
|
+
"A function that returns configuration options to be merged with the build context's options.",
|
|
146
|
+
"BuilderVariant",
|
|
147
|
+
() => __ΩInferUnpluginOptions,
|
|
211
148
|
"Plugin",
|
|
212
|
-
"\"w!c\"Pe\"!o$\"o#\"
|
|
149
|
+
"l-e$!e\"!oB#R\"w!c\"Pe\"!o$\"o#\"P&4%?&&\"o'#4(8?)P.*.+J4,8?-P..P\"o/\"20)/1J428?3P\"w425P)\"w6J/1478?8PP\"w:2;!/1o9\"Pe%!.=fo<\"&\"o>#KJ4?8?@MPd\"wAN#\"KwCy"
|
|
213
150
|
];
|
|
214
151
|
const PLUGIN_NON_HOOK_FIELDS = [
|
|
215
152
|
"name",
|
|
@@ -218,11 +155,12 @@ const PLUGIN_NON_HOOK_FIELDS = [
|
|
|
218
155
|
"dedupe",
|
|
219
156
|
"applyToEnvironment"
|
|
220
157
|
];
|
|
221
|
-
const
|
|
158
|
+
const PLUGIN_HOOKS_FIELDS = [
|
|
222
159
|
...SUPPORTED_COMMANDS,
|
|
223
160
|
"config",
|
|
224
161
|
"configEnvironment",
|
|
225
162
|
"configResolved",
|
|
163
|
+
"types",
|
|
226
164
|
"buildStart",
|
|
227
165
|
"buildEnd",
|
|
228
166
|
"transform",
|
|
@@ -232,9 +170,9 @@ const KNOWN_HOOKS = [
|
|
|
232
170
|
];
|
|
233
171
|
const KNOWN_PLUGIN_FIELDS = [
|
|
234
172
|
...PLUGIN_NON_HOOK_FIELDS,
|
|
235
|
-
...
|
|
236
|
-
...
|
|
173
|
+
...PLUGIN_HOOKS_FIELDS,
|
|
174
|
+
...BUILDER_VARIANTS
|
|
237
175
|
];
|
|
238
176
|
|
|
239
177
|
//#endregion
|
|
240
|
-
export {
|
|
178
|
+
export { PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, __ΩPlugin, __ΩPluginHook, __ΩPluginHookFunctions, __ΩPluginHookObject, __ΩPluginHooks };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BuilderVariant } from "./build.cjs";
|
|
2
|
+
import { BabelUserConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.cjs";
|
|
2
3
|
import { NonUndefined } from "@stryke/types/base";
|
|
3
4
|
import { AssetGlob } from "@stryke/types/file";
|
|
4
5
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
@@ -33,7 +34,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> &
|
|
|
33
34
|
/**
|
|
34
35
|
* The resolved options for the Powerlines project configuration.
|
|
35
36
|
*/
|
|
36
|
-
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
|
|
37
|
+
type ResolvedConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
|
|
37
38
|
/**
|
|
38
39
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
39
40
|
*/
|
|
@@ -68,7 +69,7 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
|
|
|
68
69
|
* Configuration provided to build processes
|
|
69
70
|
*
|
|
70
71
|
* @remarks
|
|
71
|
-
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link
|
|
72
|
+
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuilderVariant | build variant}.
|
|
72
73
|
*/
|
|
73
74
|
build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
|
|
74
75
|
/**
|
|
@@ -78,5 +79,16 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
|
|
|
78
79
|
*/
|
|
79
80
|
logLevel: "error" | "warn" | "info" | "debug" | "trace" | null;
|
|
80
81
|
};
|
|
82
|
+
type ViteResolvedConfig = ResolvedConfig<ViteUserConfig>;
|
|
83
|
+
type WebpackResolvedConfig = ResolvedConfig<WebpackUserConfig>;
|
|
84
|
+
type RspackResolvedConfig = ResolvedConfig<RspackUserConfig>;
|
|
85
|
+
type ESBuildResolvedConfig = ResolvedConfig<ESBuildUserConfig>;
|
|
86
|
+
type RollupResolvedConfig = ResolvedConfig<RollupUserConfig>;
|
|
87
|
+
type RolldownResolvedConfig = ResolvedConfig<RolldownUserConfig>;
|
|
88
|
+
type TsupResolvedConfig = ResolvedConfig<TsupUserConfig>;
|
|
89
|
+
type TsdownResolvedConfig = ResolvedConfig<TsdownUserConfig>;
|
|
90
|
+
type UnbuildResolvedConfig = ResolvedConfig<UnbuildUserConfig>;
|
|
91
|
+
type FarmResolvedConfig = ResolvedConfig<FarmUserConfig>;
|
|
92
|
+
type InferResolvedConfig<TBuildVariant extends BuilderVariant | undefined> = TBuildVariant extends undefined ? ResolvedConfig : TBuildVariant extends "webpack" ? WebpackResolvedConfig : TBuildVariant extends "rspack" ? RspackResolvedConfig : TBuildVariant extends "vite" ? ViteResolvedConfig : TBuildVariant extends "esbuild" ? ESBuildResolvedConfig : TBuildVariant extends "unbuild" ? UnbuildResolvedConfig : TBuildVariant extends "tsup" ? TsupResolvedConfig : TBuildVariant extends "tsdown" ? TsdownResolvedConfig : TBuildVariant extends "rolldown" ? RolldownResolvedConfig : TBuildVariant extends "rollup" ? RollupResolvedConfig : TBuildVariant extends "farm" ? FarmResolvedConfig : ResolvedConfig;
|
|
81
93
|
//#endregion
|
|
82
|
-
export { BabelResolvedConfig, EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition };
|
|
94
|
+
export { BabelResolvedConfig, EnvironmentResolvedConfig, InferResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./build.mjs";
|
|
2
|
-
import { BabelUserConfig, EnvironmentConfig, InlineConfig, OutputConfig, UserConfig } from "./config.mjs";
|
|
1
|
+
import { BuilderVariant } from "./build.mjs";
|
|
2
|
+
import { BabelUserConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.mjs";
|
|
3
3
|
import { NonUndefined } from "@stryke/types/base";
|
|
4
4
|
import { AssetGlob } from "@stryke/types/file";
|
|
5
5
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
@@ -34,7 +34,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> &
|
|
|
34
34
|
/**
|
|
35
35
|
* The resolved options for the Powerlines project configuration.
|
|
36
36
|
*/
|
|
37
|
-
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
|
|
37
|
+
type ResolvedConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
|
|
38
38
|
/**
|
|
39
39
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
40
40
|
*/
|
|
@@ -69,7 +69,7 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
|
|
|
69
69
|
* Configuration provided to build processes
|
|
70
70
|
*
|
|
71
71
|
* @remarks
|
|
72
|
-
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link
|
|
72
|
+
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuilderVariant | build variant}.
|
|
73
73
|
*/
|
|
74
74
|
build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
|
|
75
75
|
/**
|
|
@@ -79,5 +79,16 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
|
|
|
79
79
|
*/
|
|
80
80
|
logLevel: "error" | "warn" | "info" | "debug" | "trace" | null;
|
|
81
81
|
};
|
|
82
|
+
type ViteResolvedConfig = ResolvedConfig<ViteUserConfig>;
|
|
83
|
+
type WebpackResolvedConfig = ResolvedConfig<WebpackUserConfig>;
|
|
84
|
+
type RspackResolvedConfig = ResolvedConfig<RspackUserConfig>;
|
|
85
|
+
type ESBuildResolvedConfig = ResolvedConfig<ESBuildUserConfig>;
|
|
86
|
+
type RollupResolvedConfig = ResolvedConfig<RollupUserConfig>;
|
|
87
|
+
type RolldownResolvedConfig = ResolvedConfig<RolldownUserConfig>;
|
|
88
|
+
type TsupResolvedConfig = ResolvedConfig<TsupUserConfig>;
|
|
89
|
+
type TsdownResolvedConfig = ResolvedConfig<TsdownUserConfig>;
|
|
90
|
+
type UnbuildResolvedConfig = ResolvedConfig<UnbuildUserConfig>;
|
|
91
|
+
type FarmResolvedConfig = ResolvedConfig<FarmUserConfig>;
|
|
92
|
+
type InferResolvedConfig<TBuildVariant extends BuilderVariant | undefined> = TBuildVariant extends undefined ? ResolvedConfig : TBuildVariant extends "webpack" ? WebpackResolvedConfig : TBuildVariant extends "rspack" ? RspackResolvedConfig : TBuildVariant extends "vite" ? ViteResolvedConfig : TBuildVariant extends "esbuild" ? ESBuildResolvedConfig : TBuildVariant extends "unbuild" ? UnbuildResolvedConfig : TBuildVariant extends "tsup" ? TsupResolvedConfig : TBuildVariant extends "tsdown" ? TsdownResolvedConfig : TBuildVariant extends "rolldown" ? RolldownResolvedConfig : TBuildVariant extends "rollup" ? RollupResolvedConfig : TBuildVariant extends "farm" ? FarmResolvedConfig : ResolvedConfig;
|
|
82
93
|
//#endregion
|
|
83
|
-
export { BabelResolvedConfig, EnvironmentResolvedConfig, OutputResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition };
|
|
94
|
+
export { BabelResolvedConfig, ESBuildResolvedConfig, EnvironmentResolvedConfig, FarmResolvedConfig, InferResolvedConfig, OutputResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, RolldownResolvedConfig, RollupResolvedConfig, RspackResolvedConfig, TsdownResolvedConfig, TsupResolvedConfig, UnbuildResolvedConfig, ViteResolvedConfig, WebpackResolvedConfig };
|
|
@@ -1 +1,47 @@
|
|
|
1
|
-
require('./api.cjs');
|
|
1
|
+
const require_api = require('./api.cjs');
|
|
2
|
+
const require_plugin = require('./plugin.cjs');
|
|
3
|
+
|
|
4
|
+
//#region ../powerlines/src/types/unplugin.ts
|
|
5
|
+
const __ΩRequired = [
|
|
6
|
+
"T",
|
|
7
|
+
"Required",
|
|
8
|
+
"l+e#!e\"!fRb!Pde\"!gN##w\"y"
|
|
9
|
+
];
|
|
10
|
+
const __ΩUnpluginOptions = [
|
|
11
|
+
"UnpluginBuilderVariant",
|
|
12
|
+
"TUnpluginBuilderVariant",
|
|
13
|
+
() => require_api.__ΩAPI,
|
|
14
|
+
"InferResolvedConfig",
|
|
15
|
+
"api",
|
|
16
|
+
"An API object that can be used for inter-plugin communication.",
|
|
17
|
+
"// };",
|
|
18
|
+
"UnpluginOptions",
|
|
19
|
+
"\"w!c\"P!\"w$o#\"4%?&M?'w(y"
|
|
20
|
+
];
|
|
21
|
+
const __ΩInferUnpluginOptions = [
|
|
22
|
+
"Context",
|
|
23
|
+
"TContext",
|
|
24
|
+
"BuilderVariant",
|
|
25
|
+
"TBuilderVariant",
|
|
26
|
+
"InferUnpluginVariant",
|
|
27
|
+
"TUnpluginVariant",
|
|
28
|
+
() => __ΩRequired,
|
|
29
|
+
() => __ΩUnpluginOptions,
|
|
30
|
+
() => __ΩRequired,
|
|
31
|
+
() => __ΩUnpluginOptions,
|
|
32
|
+
"handler",
|
|
33
|
+
"this",
|
|
34
|
+
"args",
|
|
35
|
+
"",
|
|
36
|
+
() => require_plugin.__ΩPluginHook,
|
|
37
|
+
() => __ΩRequired,
|
|
38
|
+
() => __ΩUnpluginOptions,
|
|
39
|
+
() => __ΩRequired,
|
|
40
|
+
() => __ΩUnpluginOptions,
|
|
41
|
+
"InferUnpluginOptions",
|
|
42
|
+
"l¬PPe$!e+!K2,e#\"@2-!/.!go/#Re)#o1\"o0\"e)#fe(!fRPddde#!Ph\"!2,h\"\"@2-h\"#/.qk#=QRPde#!pORe%#o3\"o2\"e%#fe$!fRPde$#o*\"o)\"e$#fe#!fPh\"!Ph#!4+MJqkmuQR\"w!c\"\"w#c$\"w%c&Pde\"#o(\"o'\"e\"#fgN\"w4y"
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
exports.__ΩInferUnpluginOptions = __ΩInferUnpluginOptions;
|
|
47
|
+
exports.__ΩUnpluginOptions = __ΩUnpluginOptions;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BuilderVariant, InferUnpluginVariant, UnpluginBuilderVariant } from "./build.cjs";
|
|
2
|
+
import { API } from "./api.cjs";
|
|
3
|
+
import { PluginHook } from "./plugin.cjs";
|
|
4
|
+
import { Context } from "./context.cjs";
|
|
5
|
+
import { InferResolvedConfig } from "./resolved.cjs";
|
|
6
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
7
|
+
import { HookFilter, UnpluginOptions } from "unplugin";
|
|
8
|
+
|
|
9
|
+
//#region ../powerlines/src/types/unplugin.d.ts
|
|
10
|
+
interface UnpluginOptions$1<TUnpluginBuilderVariant extends UnpluginBuilderVariant = UnpluginBuilderVariant> extends UnpluginOptions {
|
|
11
|
+
/**
|
|
12
|
+
* An API object that can be used for inter-plugin communication.
|
|
13
|
+
*
|
|
14
|
+
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
15
|
+
*/
|
|
16
|
+
api: API<InferResolvedConfig<TUnpluginBuilderVariant>>;
|
|
17
|
+
}
|
|
18
|
+
type InferUnpluginOptions<TContext extends Context = Context, TBuilderVariant extends BuilderVariant = BuilderVariant, TUnpluginVariant extends InferUnpluginVariant<TBuilderVariant> = InferUnpluginVariant<TBuilderVariant>> = { [TKey in keyof Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant]]?: Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant][TKey] extends infer THandler | {
|
|
19
|
+
handler: infer THandler;
|
|
20
|
+
} ? THandler extends ((this: infer TOriginalContext, ...args: infer TArgs) => infer TReturn) ? PluginHook<(this: TOriginalContext & TContext, ...args: TArgs) => MaybePromise<TReturn>, keyof HookFilter> : Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant][TKey] : Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant][TKey] };
|
|
21
|
+
//#endregion
|
|
22
|
+
export { InferUnpluginOptions };
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
import "./build.mjs";
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
1
|
+
import { BuilderVariant, InferUnpluginVariant, UnpluginBuilderVariant } from "./build.mjs";
|
|
2
|
+
import { API } from "./api.mjs";
|
|
3
|
+
import { PluginHook } from "./plugin.mjs";
|
|
4
|
+
import { Context } from "./context.mjs";
|
|
4
5
|
import "./config.mjs";
|
|
5
|
-
import "./resolved.mjs";
|
|
6
|
-
import "
|
|
7
|
-
import { UnpluginOptions } from "unplugin";
|
|
6
|
+
import { InferResolvedConfig } from "./resolved.mjs";
|
|
7
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
8
|
+
import { HookFilter, UnpluginOptions } from "unplugin";
|
|
9
|
+
|
|
10
|
+
//#region ../powerlines/src/types/unplugin.d.ts
|
|
11
|
+
interface UnpluginOptions$1<TUnpluginBuilderVariant extends UnpluginBuilderVariant = UnpluginBuilderVariant> extends UnpluginOptions {
|
|
12
|
+
/**
|
|
13
|
+
* An API object that can be used for inter-plugin communication.
|
|
14
|
+
*
|
|
15
|
+
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
16
|
+
*/
|
|
17
|
+
api: API<InferResolvedConfig<TUnpluginBuilderVariant>>;
|
|
18
|
+
}
|
|
19
|
+
type InferUnpluginOptions<TContext extends Context = Context, TBuilderVariant extends BuilderVariant = BuilderVariant, TUnpluginVariant extends InferUnpluginVariant<TBuilderVariant> = InferUnpluginVariant<TBuilderVariant>> = { [TKey in keyof Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant]]?: Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant][TKey] extends infer THandler | {
|
|
20
|
+
handler: infer THandler;
|
|
21
|
+
} ? THandler extends ((this: infer TOriginalContext, ...args: infer TArgs) => infer TReturn) ? PluginHook<(this: TOriginalContext & TContext, ...args: TArgs) => MaybePromise<TReturn>, keyof HookFilter> : Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant][TKey] : Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant][TKey] };
|
|
22
|
+
//#endregion
|
|
23
|
+
export { InferUnpluginOptions, UnpluginOptions$1 as UnpluginOptions };
|
|
@@ -1,3 +1,46 @@
|
|
|
1
|
-
import "./api.mjs";
|
|
1
|
+
import { __ΩAPI } from "./api.mjs";
|
|
2
|
+
import { __ΩPluginHook } from "./plugin.mjs";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
//#region ../powerlines/src/types/unplugin.ts
|
|
5
|
+
const __ΩRequired = [
|
|
6
|
+
"T",
|
|
7
|
+
"Required",
|
|
8
|
+
"l+e#!e\"!fRb!Pde\"!gN##w\"y"
|
|
9
|
+
];
|
|
10
|
+
const __ΩUnpluginOptions = [
|
|
11
|
+
"UnpluginBuilderVariant",
|
|
12
|
+
"TUnpluginBuilderVariant",
|
|
13
|
+
() => __ΩAPI,
|
|
14
|
+
"InferResolvedConfig",
|
|
15
|
+
"api",
|
|
16
|
+
"An API object that can be used for inter-plugin communication.",
|
|
17
|
+
"// };",
|
|
18
|
+
"UnpluginOptions",
|
|
19
|
+
"\"w!c\"P!\"w$o#\"4%?&M?'w(y"
|
|
20
|
+
];
|
|
21
|
+
const __ΩInferUnpluginOptions = [
|
|
22
|
+
"Context",
|
|
23
|
+
"TContext",
|
|
24
|
+
"BuilderVariant",
|
|
25
|
+
"TBuilderVariant",
|
|
26
|
+
"InferUnpluginVariant",
|
|
27
|
+
"TUnpluginVariant",
|
|
28
|
+
() => __ΩRequired,
|
|
29
|
+
() => __ΩUnpluginOptions,
|
|
30
|
+
() => __ΩRequired,
|
|
31
|
+
() => __ΩUnpluginOptions,
|
|
32
|
+
"handler",
|
|
33
|
+
"this",
|
|
34
|
+
"args",
|
|
35
|
+
"",
|
|
36
|
+
() => __ΩPluginHook,
|
|
37
|
+
() => __ΩRequired,
|
|
38
|
+
() => __ΩUnpluginOptions,
|
|
39
|
+
() => __ΩRequired,
|
|
40
|
+
() => __ΩUnpluginOptions,
|
|
41
|
+
"InferUnpluginOptions",
|
|
42
|
+
"l¬PPe$!e+!K2,e#\"@2-!/.!go/#Re)#o1\"o0\"e)#fe(!fRPddde#!Ph\"!2,h\"\"@2-h\"#/.qk#=QRPde#!pORe%#o3\"o2\"e%#fe$!fRPde$#o*\"o)\"e$#fe#!fPh\"!Ph#!4+MJqkmuQR\"w!c\"\"w#c$\"w%c&Pde\"#o(\"o'\"e\"#fgN\"w4y"
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { __ΩInferUnpluginOptions, __ΩUnpluginOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-env",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
|
|
6
6
|
"repository": {
|
|
@@ -193,11 +193,10 @@
|
|
|
193
193
|
"@alloy-js/json": "^0.22.0",
|
|
194
194
|
"@babel/core": "^7.28.5",
|
|
195
195
|
"@babel/types": "^7.28.5",
|
|
196
|
-
"@powerlines/
|
|
197
|
-
"@powerlines/plugin-
|
|
198
|
-
"@powerlines/plugin-
|
|
199
|
-
"@powerlines/plugin-
|
|
200
|
-
"@powerlines/plugin-plugin": "^0.12.77",
|
|
196
|
+
"@powerlines/plugin-alloy": "^0.18.8",
|
|
197
|
+
"@powerlines/plugin-automd": "^0.1.126",
|
|
198
|
+
"@powerlines/plugin-babel": "^0.12.135",
|
|
199
|
+
"@powerlines/plugin-plugin": "^0.12.78",
|
|
201
200
|
"@storm-software/config-tools": "^1.188.75",
|
|
202
201
|
"@stryke/capnp": "^0.12.52",
|
|
203
202
|
"@stryke/env": "^0.20.44",
|
|
@@ -207,13 +206,14 @@
|
|
|
207
206
|
"@stryke/type-checks": "^0.5.15",
|
|
208
207
|
"@stryke/types": "^0.10.29",
|
|
209
208
|
"automd": "^0.4.2",
|
|
210
|
-
"powerlines": "^0.
|
|
209
|
+
"powerlines": "^0.37.0"
|
|
211
210
|
},
|
|
212
211
|
"devDependencies": {
|
|
213
|
-
"@powerlines/
|
|
212
|
+
"@powerlines/deepkit": "^0.5.41",
|
|
213
|
+
"@powerlines/plugin-deepkit": "^0.11.2",
|
|
214
214
|
"@types/node": "^24.10.4",
|
|
215
215
|
"vite": "8.0.0-beta.2"
|
|
216
216
|
},
|
|
217
217
|
"publishConfig": { "access": "public" },
|
|
218
|
-
"gitHead": "
|
|
218
|
+
"gitHead": "00141b82214ec2772cec7ec7873aba06f593289b"
|
|
219
219
|
}
|