@powerlines/plugin-env 0.15.122 → 0.15.124
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 +11 -11
- package/dist/babel/plugin.d.cts +2 -2
- package/dist/babel/plugin.d.mts +2 -3
- package/dist/babel/plugin.mjs +5 -5
- package/dist/components/docs.cjs +6 -6
- package/dist/components/docs.d.cts +1 -1
- package/dist/components/docs.d.mts +1 -1
- package/dist/components/docs.mjs +3 -3
- package/dist/components/env.cjs +40 -40
- package/dist/components/env.d.cts +2 -2
- package/dist/components/env.d.mts +2 -2
- package/dist/components/env.mjs +11 -11
- package/dist/helpers/automd-generator.cjs +2 -2
- package/dist/helpers/automd-generator.d.cts +1 -1
- package/dist/helpers/automd-generator.d.mts +1 -1
- package/dist/helpers/automd-generator.mjs +1 -1
- package/dist/helpers/load.cjs +7 -7
- package/dist/helpers/load.mjs +8 -8
- package/dist/helpers/persistence.cjs +23 -23
- package/dist/helpers/persistence.d.cts +1 -1
- package/dist/helpers/persistence.d.mts +1 -1
- package/dist/helpers/persistence.mjs +5 -5
- package/dist/helpers/reflect.cjs +5 -5
- package/dist/helpers/reflect.mjs +1 -1
- package/dist/helpers/source-file-env.cjs +1 -1
- package/dist/helpers/source-file-env.mjs +1 -1
- package/dist/index.cjs +13 -10
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +12 -12
- package/dist/types/plugin.cjs +19 -18
- package/dist/types/plugin.d.cts +5 -6
- package/dist/types/plugin.d.mts +4 -6
- package/dist/types/plugin.mjs +4 -4
- package/package.json +7 -7
- package/dist/deepkit/schemas/reflection.cjs +0 -5426
- package/dist/deepkit/schemas/reflection.d.cts +0 -1560
- package/dist/deepkit/schemas/reflection.d.mts +0 -1560
- package/dist/deepkit/schemas/reflection.mjs +0 -5423
- package/dist/deepkit/schemas/reflection2.cjs +0 -4112
- package/dist/deepkit/schemas/reflection2.mjs +0 -4110
- package/dist/deepkit/src/capnp.cjs +0 -1692
- package/dist/deepkit/src/capnp.mjs +0 -1690
- package/dist/deepkit/src/esbuild-plugin.cjs +0 -99
- package/dist/deepkit/src/esbuild-plugin.mjs +0 -98
- package/dist/deepkit/src/reflect-type.cjs +0 -40
- package/dist/deepkit/src/reflect-type.mjs +0 -38
- package/dist/deepkit/src/resolve-reflections.cjs +0 -23
- package/dist/deepkit/src/resolve-reflections.mjs +0 -22
- package/dist/deepkit/src/transformer.cjs +0 -92
- package/dist/deepkit/src/transformer.mjs +0 -89
- package/dist/deepkit/src/transpile.cjs +0 -39
- package/dist/deepkit/src/transpile.mjs +0 -37
- package/dist/deepkit/src/types.cjs +0 -22
- package/dist/deepkit/src/types.d.cts +0 -10
- package/dist/deepkit/src/types.d.mts +0 -10
- package/dist/deepkit/src/types.mjs +0 -21
- package/dist/deepkit/src/utilities.cjs +0 -184
- package/dist/deepkit/src/utilities.mjs +0 -183
- package/dist/plugin-alloy/src/core/components/output.cjs +0 -43
- package/dist/plugin-alloy/src/core/components/output.mjs +0 -42
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -22
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -21
- package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -64
- package/dist/plugin-alloy/src/core/components/source-file.d.cts +0 -23
- package/dist/plugin-alloy/src/core/components/source-file.d.mts +0 -23
- package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -62
- package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -134
- package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -126
- package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
- package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -110
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -101
- package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -23
- package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -22
- package/dist/plugin-alloy/src/index.cjs +0 -105
- package/dist/plugin-alloy/src/index.mjs +0 -103
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -115
- package/dist/plugin-alloy/src/markdown/components/markdown-file.d.cts +0 -8
- package/dist/plugin-alloy/src/markdown/components/markdown-file.d.mts +0 -8
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -114
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -39
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -38
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -72
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -71
- package/dist/plugin-alloy/src/types/components.cjs +0 -22
- package/dist/plugin-alloy/src/types/components.d.cts +0 -20
- package/dist/plugin-alloy/src/types/components.d.mts +0 -21
- package/dist/plugin-alloy/src/types/components.mjs +0 -21
- package/dist/plugin-alloy/src/types/index.d.cts +0 -2
- package/dist/plugin-alloy/src/types/index.d.mts +0 -2
- package/dist/plugin-alloy/src/types/plugin.cjs +0 -53
- package/dist/plugin-alloy/src/types/plugin.d.cts +0 -36
- package/dist/plugin-alloy/src/types/plugin.d.mts +0 -36
- package/dist/plugin-alloy/src/types/plugin.mjs +0 -50
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -62
- package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +0 -26
- package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +0 -26
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -61
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -131
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -129
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -451
- package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +0 -37
- package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +0 -37
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -442
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -216
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +0 -16
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +0 -16
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -213
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -72
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +0 -12
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.mts +0 -12
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -71
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -124
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -123
- package/dist/plugin-automd/src/index.cjs +0 -127
- package/dist/plugin-automd/src/index.mjs +0 -124
- package/dist/plugin-automd/src/types/plugin.cjs +0 -47
- package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
- package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
- package/dist/plugin-automd/src/types/plugin.mjs +0 -47
- package/dist/plugin-automd/src/types/toc.cjs +0 -26
- package/dist/plugin-automd/src/types/toc.d.cts +0 -33
- package/dist/plugin-automd/src/types/toc.d.mts +0 -33
- package/dist/plugin-automd/src/types/toc.mjs +0 -25
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -74
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -70
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -71
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -69
- package/dist/plugin-babel/src/helpers/filters.cjs +0 -158
- package/dist/plugin-babel/src/helpers/filters.mjs +0 -154
- package/dist/plugin-babel/src/helpers/index.cjs +0 -5
- package/dist/plugin-babel/src/helpers/index.mjs +0 -7
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -200
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -192
- package/dist/plugin-babel/src/helpers/options.cjs +0 -73
- package/dist/plugin-babel/src/helpers/options.mjs +0 -70
- package/dist/plugin-babel/src/index.cjs +0 -125
- package/dist/plugin-babel/src/index.mjs +0 -123
- package/dist/plugin-babel/src/types/index.d.mts +0 -1
- package/dist/plugin-babel/src/types/plugin.cjs +0 -42
- package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
- package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
- package/dist/plugin-babel/src/types/plugin.mjs +0 -39
- package/dist/powerlines/src/internal/helpers/hooks.cjs +0 -136
- package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -49
- package/dist/powerlines/src/internal/helpers/hooks.mjs +0 -134
- package/dist/powerlines/src/lib/build/esbuild.cjs +0 -142
- package/dist/powerlines/src/lib/build/esbuild.mjs +0 -140
- package/dist/powerlines/src/lib/constants/environments.cjs +0 -6
- package/dist/powerlines/src/lib/constants/environments.mjs +0 -5
- package/dist/powerlines/src/lib/entry.cjs +0 -195
- package/dist/powerlines/src/lib/entry.mjs +0 -194
- package/dist/powerlines/src/lib/logger.cjs +0 -108
- package/dist/powerlines/src/lib/logger.mjs +0 -106
- package/dist/powerlines/src/lib/unplugin/helpers.cjs +0 -41
- package/dist/powerlines/src/lib/unplugin/helpers.mjs +0 -40
- package/dist/powerlines/src/lib/unplugin/module-resolution.cjs +0 -98
- package/dist/powerlines/src/lib/unplugin/module-resolution.mjs +0 -97
- package/dist/powerlines/src/lib/unplugin/plugin.cjs +0 -139
- package/dist/powerlines/src/lib/unplugin/plugin.mjs +0 -138
- package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -74
- package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -72
- package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -69
- package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -68
- package/dist/powerlines/src/lib/utilities/source-file.cjs +0 -68
- package/dist/powerlines/src/lib/utilities/source-file.mjs +0 -66
- package/dist/powerlines/src/plugin-utils/paths.cjs +0 -46
- package/dist/powerlines/src/plugin-utils/paths.mjs +0 -45
- package/dist/powerlines/src/types/api.cjs +0 -62
- package/dist/powerlines/src/types/api.d.cts +0 -104
- package/dist/powerlines/src/types/api.d.mts +0 -104
- package/dist/powerlines/src/types/api.mjs +0 -62
- package/dist/powerlines/src/types/babel.cjs +0 -156
- package/dist/powerlines/src/types/babel.d.cts +0 -23
- package/dist/powerlines/src/types/babel.d.mts +0 -23
- package/dist/powerlines/src/types/babel.mjs +0 -147
- package/dist/powerlines/src/types/build.cjs +0 -127
- package/dist/powerlines/src/types/build.d.cts +0 -185
- package/dist/powerlines/src/types/build.d.mts +0 -185
- package/dist/powerlines/src/types/build.mjs +0 -121
- package/dist/powerlines/src/types/commands.cjs +0 -16
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/commands.d.mts +0 -9
- package/dist/powerlines/src/types/commands.mjs +0 -15
- package/dist/powerlines/src/types/config.cjs +0 -420
- package/dist/powerlines/src/types/config.d.cts +0 -435
- package/dist/powerlines/src/types/config.d.mts +0 -436
- package/dist/powerlines/src/types/config.mjs +0 -397
- package/dist/powerlines/src/types/context.cjs +0 -388
- package/dist/powerlines/src/types/context.d.cts +0 -514
- package/dist/powerlines/src/types/context.d.mts +0 -514
- package/dist/powerlines/src/types/context.mjs +0 -371
- package/dist/powerlines/src/types/fs.cjs +0 -78
- package/dist/powerlines/src/types/fs.d.cts +0 -486
- package/dist/powerlines/src/types/fs.d.mts +0 -486
- package/dist/powerlines/src/types/fs.mjs +0 -75
- package/dist/powerlines/src/types/hooks.cjs +0 -71
- package/dist/powerlines/src/types/hooks.d.cts +0 -32
- package/dist/powerlines/src/types/hooks.d.mts +0 -32
- package/dist/powerlines/src/types/hooks.mjs +0 -68
- package/dist/powerlines/src/types/index.cjs +0 -11
- package/dist/powerlines/src/types/index.d.mts +0 -12
- package/dist/powerlines/src/types/index.mjs +0 -13
- package/dist/powerlines/src/types/plugin.cjs +0 -184
- package/dist/powerlines/src/types/plugin.d.cts +0 -205
- package/dist/powerlines/src/types/plugin.d.mts +0 -205
- package/dist/powerlines/src/types/plugin.mjs +0 -178
- package/dist/powerlines/src/types/resolved.cjs +0 -149
- package/dist/powerlines/src/types/resolved.d.cts +0 -94
- package/dist/powerlines/src/types/resolved.d.mts +0 -94
- package/dist/powerlines/src/types/resolved.mjs +0 -144
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
- package/dist/powerlines/src/types/unplugin.cjs +0 -64
- package/dist/powerlines/src/types/unplugin.d.cts +0 -22
- package/dist/powerlines/src/types/unplugin.d.mts +0 -23
- package/dist/powerlines/src/types/unplugin.mjs +0 -62
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { UnpluginBuilderVariant } from "./build.mjs";
|
|
2
|
-
import { PluginContext, WithUnpluginBuildContext } from "./context.mjs";
|
|
3
|
-
import { Plugin, PluginHookFields, PluginHookFunctions } from "./plugin.mjs";
|
|
4
|
-
import { UnpluginOptions } from "unplugin";
|
|
5
|
-
|
|
6
|
-
//#region ../powerlines/src/types/hooks.d.ts
|
|
7
|
-
type HookListOrders = "preOrdered" | "preEnforced" | "normal" | "postEnforced" | "postOrdered";
|
|
8
|
-
type UnpluginHookFunctions<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant$1 extends UnpluginBuilderVariant = UnpluginBuilderVariant, TField$1 extends keyof Required<UnpluginOptions>[TUnpluginBuilderVariant$1] = keyof Required<UnpluginOptions>[TUnpluginBuilderVariant$1]> = Required<UnpluginOptions>[TUnpluginBuilderVariant$1][TField$1] extends infer THandler | {
|
|
9
|
-
handler: infer THandler;
|
|
10
|
-
} ? THandler extends ((this: infer THandlerOriginalContext, ...args: infer THandlerArgs) => infer THandlerReturn) ? (this: THandlerOriginalContext & WithUnpluginBuildContext<TContext>, ...args: THandlerArgs) => THandlerReturn : THandler extends {
|
|
11
|
-
handler: infer THandlerFunction;
|
|
12
|
-
} ? THandlerFunction extends ((this: infer THandlerFunctionOriginalContext, ...args: infer THandlerFunctionArgs) => infer THandlerFunctionReturn) ? (this: THandlerFunctionOriginalContext & WithUnpluginBuildContext<TContext>, ...args: THandlerFunctionArgs) => THandlerFunctionReturn : never : never : never;
|
|
13
|
-
interface PluginHooksListItem<TContext extends PluginContext = PluginContext, TFields extends PluginHookFields<TContext> = PluginHookFields<TContext>> {
|
|
14
|
-
plugin: Plugin<TContext>;
|
|
15
|
-
handler: PluginHookFunctions<TContext>[TFields];
|
|
16
|
-
}
|
|
17
|
-
type PluginHooksList<TContext extends PluginContext = PluginContext, TFields extends PluginHookFields<TContext> = PluginHookFields<TContext>> = { [TKey in HookListOrders]?: PluginHooksListItem<TContext, TFields>[] | undefined };
|
|
18
|
-
interface UnpluginHooksListItem<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant$1 extends UnpluginBuilderVariant = UnpluginBuilderVariant, TField$1 extends keyof Required<UnpluginOptions>[TUnpluginBuilderVariant$1] = keyof Required<UnpluginOptions>[TUnpluginBuilderVariant$1]> {
|
|
19
|
-
plugin: Plugin<TContext>;
|
|
20
|
-
handler: UnpluginHookFunctions<TContext, TUnpluginBuilderVariant$1, TField$1>;
|
|
21
|
-
}
|
|
22
|
-
type UnpluginHookList<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant$1 extends UnpluginBuilderVariant = UnpluginBuilderVariant, TField$1 extends keyof UnpluginOptions[TUnpluginBuilderVariant$1] = keyof UnpluginOptions[TUnpluginBuilderVariant$1]> = { [TKey in HookListOrders]?: UnpluginHooksListItem<TContext, TUnpluginBuilderVariant$1, TField$1>[] | undefined };
|
|
23
|
-
type UnpluginHookVariantField<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant$1 extends UnpluginBuilderVariant = UnpluginBuilderVariant> = { [TKey in keyof UnpluginOptions[TUnpluginBuilderVariant$1]]?: UnpluginHookList<TContext, TUnpluginBuilderVariant$1, TKey> };
|
|
24
|
-
type UnpluginHookVariant<TContext extends PluginContext = PluginContext> = { [TKey in UnpluginBuilderVariant]?: UnpluginHookVariantField<TContext, TKey> };
|
|
25
|
-
type HookFields<TContext extends PluginContext = PluginContext> = PluginHookFields<TContext> | UnpluginBuilderVariant;
|
|
26
|
-
type HooksList<TContext extends PluginContext = PluginContext> = { [TField in HookFields<TContext>]?: TField extends PluginHookFields<TContext> ? PluginHooksList<TContext, TField> : TField extends UnpluginBuilderVariant ? UnpluginHookVariant<TContext>[TField] : never };
|
|
27
|
-
type InferHooksListItem<TContext extends PluginContext, TKey$1 extends string> = TKey$1 extends `${infer TUnpluginBuilderVariant}:${infer TUnpluginField}` ? TUnpluginBuilderVariant extends UnpluginBuilderVariant ? TUnpluginField extends keyof Required<UnpluginOptions>[TUnpluginBuilderVariant] ? UnpluginHooksListItem<TContext, TUnpluginBuilderVariant, TUnpluginField> : never : never : TKey$1 extends keyof PluginHookFunctions<TContext> ? PluginHooksListItem<TContext, TKey$1> : never;
|
|
28
|
-
type InferHookFunction<TContext extends PluginContext, TKey$1 extends string> = TKey$1 extends `${infer TUnpluginBuilderVariant}:${infer TUnpluginField}` ? TUnpluginBuilderVariant extends UnpluginBuilderVariant ? TUnpluginField extends keyof Required<UnpluginOptions>[TUnpluginBuilderVariant] ? UnpluginHookFunctions<TContext, TUnpluginBuilderVariant, TUnpluginField> : never : never : TKey$1 extends keyof PluginHookFunctions<TContext> ? PluginHookFunctions<TContext>[TKey$1] : never;
|
|
29
|
-
type InferHookReturnType<TContext extends PluginContext, TKey$1 extends string> = ReturnType<InferHookFunction<TContext, TKey$1>>;
|
|
30
|
-
type InferHookParameters<TContext extends PluginContext, TKey$1 extends string> = Parameters<InferHookFunction<TContext, TKey$1>>;
|
|
31
|
-
//#endregion
|
|
32
|
-
export { HookFields, HookListOrders, HooksList, InferHookFunction, InferHookParameters, InferHookReturnType, InferHooksListItem, PluginHooksList, PluginHooksListItem, UnpluginHookFunctions, UnpluginHookList, UnpluginHookVariant, UnpluginHookVariantField, UnpluginHooksListItem };
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { __ΩUnpluginBuilderVariant } from "./build.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../powerlines/src/types/hooks.ts
|
|
4
|
-
const __ΩRequired = [
|
|
5
|
-
"T",
|
|
6
|
-
"Required",
|
|
7
|
-
"l+e#!e\"!fRb!Pde\"!gN##w\"y"
|
|
8
|
-
];
|
|
9
|
-
const __ΩReturnType = [
|
|
10
|
-
"T",
|
|
11
|
-
"args",
|
|
12
|
-
"",
|
|
13
|
-
"ReturnType",
|
|
14
|
-
"l>e\"!R\"RPde#!P\"@2\"h\"!/#qk#'QRb!Pde\"!p)w$y"
|
|
15
|
-
];
|
|
16
|
-
const __ΩParameters = [
|
|
17
|
-
"T",
|
|
18
|
-
"args",
|
|
19
|
-
"",
|
|
20
|
-
"Parameters",
|
|
21
|
-
"l>e\"!R!RPde#!Ph\"!@2\"\"/#qk#'QRb!Pde\"!p)w$y"
|
|
22
|
-
];
|
|
23
|
-
const __ΩUnpluginHookFunctions = [
|
|
24
|
-
"PluginContext",
|
|
25
|
-
"TContext",
|
|
26
|
-
() => __ΩUnpluginBuilderVariant,
|
|
27
|
-
"TUnpluginBuilderVariant",
|
|
28
|
-
() => __ΩRequired,
|
|
29
|
-
"TField",
|
|
30
|
-
() => __ΩRequired,
|
|
31
|
-
"handler",
|
|
32
|
-
"this",
|
|
33
|
-
"args",
|
|
34
|
-
"",
|
|
35
|
-
"WithUnpluginBuildContext",
|
|
36
|
-
"UnpluginHookFunctions",
|
|
37
|
-
"l½PPe$!\"w,K2)e#\"@2*e##/+RPPe$!\"w,K2)e#\"@2*e##/+R!RPddde#!Ph\"!2)h\"\"@2*h\"#/+qk:QQRPde#!pSR!RPde#!Ph\"!4(MqkqyQRPde%!p{RPddde#!Ph\"!2)h\"\"@2*h\"#/+qk#QRPde#!pR!R\"w!c\"n#c$!o%\"e!\"fgc&Pd!o'\"e\"\"fe\"#fPh\"!Ph#!4(MJqk³»Qw-y"
|
|
38
|
-
];
|
|
39
|
-
const __ΩInferHookFunction = [
|
|
40
|
-
"TContext",
|
|
41
|
-
"TKey",
|
|
42
|
-
":",
|
|
43
|
-
() => __ΩUnpluginBuilderVariant,
|
|
44
|
-
() => __ΩRequired,
|
|
45
|
-
() => __ΩUnpluginHookFunctions,
|
|
46
|
-
"PluginHookFunctions",
|
|
47
|
-
"InferHookFunction",
|
|
48
|
-
"le-!e(!e$!o&$R!RPe#!!o%\"e'!fgqk#0QRPde'\"p2R!RPe#!n$qkEMQRPde#!pOR\"w'e$!fR!RPe#!\"w'gqkckQRPde%!pmRPdde#!Ph\"!.#h\"\"Sqk[{QRb!b\"Pde\"\"pw(y"
|
|
49
|
-
];
|
|
50
|
-
const __ΩInferHookReturnType = [
|
|
51
|
-
"TContext",
|
|
52
|
-
"TKey",
|
|
53
|
-
() => __ΩReturnType,
|
|
54
|
-
() => __ΩInferHookFunction,
|
|
55
|
-
"InferHookReturnType",
|
|
56
|
-
"b!b\"e!!e!\"o$#o#\"w%y"
|
|
57
|
-
];
|
|
58
|
-
const __ΩInferHookParameters = [
|
|
59
|
-
"TContext",
|
|
60
|
-
"TKey",
|
|
61
|
-
() => __ΩParameters,
|
|
62
|
-
() => __ΩInferHookFunction,
|
|
63
|
-
"InferHookParameters",
|
|
64
|
-
"b!b\"e!!e!\"o$#o#\"w%y"
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
//#endregion
|
|
68
|
-
export { __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩUnpluginHookFunctions };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const require_fs = require('./fs.cjs');
|
|
2
|
-
const require_config = require('./config.cjs');
|
|
3
|
-
const require_resolved = require('./resolved.cjs');
|
|
4
|
-
const require_context = require('./context.cjs');
|
|
5
|
-
const require_build = require('./build.cjs');
|
|
6
|
-
const require_hooks = require('./hooks.cjs');
|
|
7
|
-
const require_api = require('./api.cjs');
|
|
8
|
-
const require_commands = require('./commands.cjs');
|
|
9
|
-
const require_plugin = require('./plugin.cjs');
|
|
10
|
-
const require_unplugin = require('./unplugin.cjs');
|
|
11
|
-
const require_babel = require('./babel.cjs');
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BuildConfig, BuildResolvedConfig, BuilderVariant, ESBuildBuildConfig, ESBuildResolvedBuildConfig, FarmBuildConfig, FarmResolvedBuildConfig, InferUnpluginVariant, RolldownBuildConfig, RolldownResolvedBuildConfig, RollupBuildConfig, RollupBuildOutputConfig, RollupResolvedBuildConfig, RspackBuildConfig, RspackResolvedBuildConfig, TsdownBuildConfig, TsdownResolvedBuildConfig, TsupBuildConfig, TsupResolvedBuildConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, UnpluginBuilderVariant, ViteBuildConfig, ViteResolvedBuildConfig, WebpackBuildConfig, WebpackResolvedBuildConfig } from "./build.mjs";
|
|
2
|
-
import { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn } from "./babel.mjs";
|
|
3
|
-
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileMetadata, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
|
|
4
|
-
import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig } from "./tsconfig.mjs";
|
|
5
|
-
import { BabelUserConfig, BaseConfig, BuildInlineConfig, CleanInlineConfig, CommonUserConfig, DeployConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, NewInlineConfig, OutputConfig, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig } from "./config.mjs";
|
|
6
|
-
import { HookFields, HookListOrders, HooksList, InferHookFunction, InferHookParameters, InferHookReturnType, InferHooksListItem, PluginHooksList, PluginHooksListItem, UnpluginHookFunctions, UnpluginHookList, UnpluginHookVariant, UnpluginHookVariantField, UnpluginHooksListItem } from "./hooks.mjs";
|
|
7
|
-
import { BabelResolvedConfig, ESBuildResolvedConfig, EnvironmentResolvedConfig, FarmResolvedConfig, InferResolvedConfig, OutputResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, RolldownResolvedConfig, RollupResolvedConfig, RspackResolvedConfig, TsdownResolvedConfig, TsupResolvedConfig, UnbuildResolvedConfig, ViteResolvedConfig, WebpackResolvedConfig } from "./resolved.mjs";
|
|
8
|
-
import { APIContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EnvironmentContext, EnvironmentContextPlugin, FetchOptions, InitContextOptions, MetaInfo, ParseOptions, PluginContext, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, TransformResult, UnresolvedContext, WithUnpluginBuildContext } from "./context.mjs";
|
|
9
|
-
import { CommandType, SUPPORTED_COMMANDS } from "./commands.mjs";
|
|
10
|
-
import { API } from "./api.mjs";
|
|
11
|
-
import { InferUnpluginOptions, UnpluginOptions } from "./unplugin.mjs";
|
|
12
|
-
import { Plugin, PluginHook, PluginHookFields, PluginHookFunctions, PluginHookObject, PluginHooks, TypesResult } from "./plugin.mjs";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset } from "./fs.mjs";
|
|
2
|
-
import { __ΩBabelUserConfig, __ΩBaseConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩCommonUserConfig, __ΩDeployConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEnvironmentConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩNewInlineConfig, __ΩOutputConfig, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩUserConfig, __ΩWorkspaceConfig } from "./config.mjs";
|
|
3
|
-
import { __ΩBabelResolvedConfig, __ΩOutputResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition } from "./resolved.mjs";
|
|
4
|
-
import { __ΩContext, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩFetchOptions, __ΩInitContextOptions, __ΩMetaInfo, __ΩParseOptions, __ΩPluginContext, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩTransformResult, __ΩUnresolvedContext } from "./context.mjs";
|
|
5
|
-
import { BUILDER_VARIANTS, UNPLUGIN_BUILDER_VARIANTS, __ΩBuildConfig, __ΩBuildResolvedConfig, __ΩESBuildResolvedBuildConfig, __ΩUnpluginBuilderVariant } from "./build.mjs";
|
|
6
|
-
import { __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩUnpluginHookFunctions } from "./hooks.mjs";
|
|
7
|
-
import { __ΩAPI } from "./api.mjs";
|
|
8
|
-
import { SUPPORTED_COMMANDS } from "./commands.mjs";
|
|
9
|
-
import { PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, __ΩPlugin, __ΩPluginHook, __ΩPluginHookFunctions, __ΩPluginHookObject, __ΩPluginHooks } from "./plugin.mjs";
|
|
10
|
-
import { __ΩInferUnpluginOptions, __ΩUnpluginFactory, __ΩUnpluginOptions } from "./unplugin.mjs";
|
|
11
|
-
import { __ΩBabelPluginPass, __ΩBabelTransformPlugin, __ΩBabelTransformPluginBuilder, __ΩBabelTransformPluginBuilderParams, __ΩBabelTransformPluginFilter, __ΩBabelTransformPluginOptions, __ΩDeclareBabelTransformPluginReturn, __ΩImportSpecifier, __ΩResolvedBabelTransformPluginOptions } from "./babel.mjs";
|
|
12
|
-
|
|
13
|
-
export { };
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
const require_build = require('./build.cjs');
|
|
2
|
-
const require_commands = require('./commands.cjs');
|
|
3
|
-
const require_unplugin = require('./unplugin.cjs');
|
|
4
|
-
|
|
5
|
-
//#region ../powerlines/src/types/plugin.ts
|
|
6
|
-
const __ΩPick = [
|
|
7
|
-
"T",
|
|
8
|
-
"K",
|
|
9
|
-
"Pick",
|
|
10
|
-
"l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
|
|
11
|
-
];
|
|
12
|
-
const __ΩPartial = [
|
|
13
|
-
"T",
|
|
14
|
-
"Partial",
|
|
15
|
-
"l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
|
|
16
|
-
];
|
|
17
|
-
const __ΩRecord = [
|
|
18
|
-
"K",
|
|
19
|
-
"T",
|
|
20
|
-
"Record",
|
|
21
|
-
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
22
|
-
];
|
|
23
|
-
const __ΩPluginHookObject = [
|
|
24
|
-
"THookFunction",
|
|
25
|
-
"TFilter",
|
|
26
|
-
"pre",
|
|
27
|
-
"post",
|
|
28
|
-
"order",
|
|
29
|
-
"The order in which the plugin should be applied.",
|
|
30
|
-
() => __ΩPick,
|
|
31
|
-
"filter",
|
|
32
|
-
"A filter to determine when the hook should be called.",
|
|
33
|
-
"handler",
|
|
34
|
-
"The hook function to be called.",
|
|
35
|
-
"PluginHookObject",
|
|
36
|
-
"b!!c\"PP.#.$,-J4%8?&!e\"\"o'#4(8?)e\"!4*?+Mw,y"
|
|
37
|
-
];
|
|
38
|
-
const __ΩPluginHook = [
|
|
39
|
-
"THookFunction",
|
|
40
|
-
"TFilter",
|
|
41
|
-
() => __ΩPluginHookObject,
|
|
42
|
-
"PluginHook",
|
|
43
|
-
"b!!c\"Pe\"!e\"!e\"\"o##Jw$y"
|
|
44
|
-
];
|
|
45
|
-
const __ΩPluginHookFunctions = [
|
|
46
|
-
"TContext",
|
|
47
|
-
"CommandType",
|
|
48
|
-
"this",
|
|
49
|
-
"",
|
|
50
|
-
"UnresolvedContext",
|
|
51
|
-
"config",
|
|
52
|
-
"A function that returns configuration options to be merged with the build context's options.",
|
|
53
|
-
"name",
|
|
54
|
-
"EnvironmentConfig",
|
|
55
|
-
"environment",
|
|
56
|
-
"configEnvironment",
|
|
57
|
-
"Modify environment configs before it's resolved. The hook can either mutate the passed-in environment config directly, or return a partial config object that will be deeply merged into existing config.",
|
|
58
|
-
"configResolved",
|
|
59
|
-
"A hook that is called when the plugin is resolved.",
|
|
60
|
-
"code",
|
|
61
|
-
"types",
|
|
62
|
-
"A hook that is called to overwrite the generated declaration types file (.d.ts). The generated type definitions should describe the built-in modules/logic added during the `prepare` task.",
|
|
63
|
-
"BuildPluginContext",
|
|
64
|
-
"buildStart",
|
|
65
|
-
"A hook that is called at the start of the build process.",
|
|
66
|
-
"buildEnd",
|
|
67
|
-
"A hook that is called at the end of the build process.",
|
|
68
|
-
"id",
|
|
69
|
-
"transform",
|
|
70
|
-
"A hook that is called to transform the source code.",
|
|
71
|
-
"load",
|
|
72
|
-
"A hook that is called to load the source code.",
|
|
73
|
-
"importer",
|
|
74
|
-
"isEntry",
|
|
75
|
-
"options",
|
|
76
|
-
"resolveId",
|
|
77
|
-
"A hook that is called to resolve the identifier of the source code.",
|
|
78
|
-
"writeBundle",
|
|
79
|
-
"A hook that is called to write the bundle to disk.",
|
|
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"
|
|
82
|
-
];
|
|
83
|
-
const __ΩPluginHooks = [
|
|
84
|
-
"TContext",
|
|
85
|
-
() => __ΩPluginHookFunctions,
|
|
86
|
-
() => __ΩPluginHook,
|
|
87
|
-
() => __ΩPluginHookFunctions,
|
|
88
|
-
() => __ΩPluginHook,
|
|
89
|
-
() => __ΩPluginHookFunctions,
|
|
90
|
-
"transform",
|
|
91
|
-
"code",
|
|
92
|
-
"id",
|
|
93
|
-
"transform",
|
|
94
|
-
() => __ΩPluginHook,
|
|
95
|
-
() => __ΩPluginHookFunctions,
|
|
96
|
-
"load",
|
|
97
|
-
"id",
|
|
98
|
-
"load",
|
|
99
|
-
() => __ΩPluginHook,
|
|
100
|
-
() => __ΩPluginHookFunctions,
|
|
101
|
-
"resolveId",
|
|
102
|
-
"id",
|
|
103
|
-
"resolveId",
|
|
104
|
-
"PluginHooks",
|
|
105
|
-
"l1e$!o$\"e\"!fo#\"Rb!PPde#!o\"\"gN#\"Pe#!o&\".'fP.(.)Jo%#4*e#!o,\".-f..o+#4/e#!o1\".2f.3o0#44MKw5y"
|
|
106
|
-
];
|
|
107
|
-
const __ΩDeepPartial = [
|
|
108
|
-
"T",
|
|
109
|
-
0,
|
|
110
|
-
"DeepPartial",
|
|
111
|
-
"l.e#!e\"!fo\"\"Rb!Pde\"!gN#\"w#y"
|
|
112
|
-
];
|
|
113
|
-
const __ΩPlugin = [
|
|
114
|
-
"PluginContext",
|
|
115
|
-
"TContext",
|
|
116
|
-
() => __ΩPartial,
|
|
117
|
-
() => __ΩPluginHooks,
|
|
118
|
-
"name",
|
|
119
|
-
"The name of the plugin, for use in deduplication, error messages and logs.",
|
|
120
|
-
() => __ΩRecord,
|
|
121
|
-
"api",
|
|
122
|
-
"An API object that can be used for inter-plugin communication.",
|
|
123
|
-
"pre",
|
|
124
|
-
"post",
|
|
125
|
-
"enforce",
|
|
126
|
-
"Enforce plugin invocation tier similar to webpack loaders. Hooks ordering is still subject to the `order` property in the hook object.",
|
|
127
|
-
false,
|
|
128
|
-
0,
|
|
129
|
-
"other",
|
|
130
|
-
"",
|
|
131
|
-
"dedupe",
|
|
132
|
-
"A function to determine if two plugins are the same and can be de-duplicated.",
|
|
133
|
-
"EnvironmentResolvedConfig",
|
|
134
|
-
"environment",
|
|
135
|
-
"PluginConfig",
|
|
136
|
-
"applyToEnvironment",
|
|
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
|
-
() => require_unplugin.__ΩInferUnpluginOptions,
|
|
148
|
-
"Plugin",
|
|
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"
|
|
150
|
-
];
|
|
151
|
-
const PLUGIN_NON_HOOK_FIELDS = [
|
|
152
|
-
"name",
|
|
153
|
-
"api",
|
|
154
|
-
"enforce",
|
|
155
|
-
"dedupe",
|
|
156
|
-
"applyToEnvironment"
|
|
157
|
-
];
|
|
158
|
-
const PLUGIN_HOOKS_FIELDS = [
|
|
159
|
-
...require_commands.SUPPORTED_COMMANDS,
|
|
160
|
-
"config",
|
|
161
|
-
"configEnvironment",
|
|
162
|
-
"configResolved",
|
|
163
|
-
"types",
|
|
164
|
-
"buildStart",
|
|
165
|
-
"buildEnd",
|
|
166
|
-
"transform",
|
|
167
|
-
"load",
|
|
168
|
-
"resolveId",
|
|
169
|
-
"writeBundle"
|
|
170
|
-
];
|
|
171
|
-
const KNOWN_PLUGIN_FIELDS = [
|
|
172
|
-
...PLUGIN_NON_HOOK_FIELDS,
|
|
173
|
-
...PLUGIN_HOOKS_FIELDS,
|
|
174
|
-
...require_build.BUILDER_VARIANTS
|
|
175
|
-
];
|
|
176
|
-
|
|
177
|
-
//#endregion
|
|
178
|
-
exports.PLUGIN_HOOKS_FIELDS = PLUGIN_HOOKS_FIELDS;
|
|
179
|
-
exports.PLUGIN_NON_HOOK_FIELDS = PLUGIN_NON_HOOK_FIELDS;
|
|
180
|
-
exports.__ΩPlugin = __ΩPlugin;
|
|
181
|
-
exports.__ΩPluginHook = __ΩPluginHook;
|
|
182
|
-
exports.__ΩPluginHookFunctions = __ΩPluginHookFunctions;
|
|
183
|
-
exports.__ΩPluginHookObject = __ΩPluginHookObject;
|
|
184
|
-
exports.__ΩPluginHooks = __ΩPluginHooks;
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
import { BuilderVariant } from "./build.cjs";
|
|
2
|
-
import { EnvironmentConfig, PluginConfig } from "./config.cjs";
|
|
3
|
-
import { EnvironmentResolvedConfig, ResolvedConfig } from "./resolved.cjs";
|
|
4
|
-
import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.cjs";
|
|
5
|
-
import { CommandType } from "./commands.cjs";
|
|
6
|
-
import { InferUnpluginOptions } from "./unplugin.cjs";
|
|
7
|
-
import { ArrayValues } from "@stryke/types/array";
|
|
8
|
-
import { AnyFunction, MaybePromise } from "@stryke/types/base";
|
|
9
|
-
import { LoadResult } from "rollup";
|
|
10
|
-
import { ExternalIdResult, HookFilter, TransformResult } from "unplugin";
|
|
11
|
-
|
|
12
|
-
//#region ../powerlines/src/types/plugin.d.ts
|
|
13
|
-
interface PluginHookObject<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> {
|
|
14
|
-
/**
|
|
15
|
-
* The order in which the plugin should be applied.
|
|
16
|
-
*/
|
|
17
|
-
order?: "pre" | "post" | null | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* A filter to determine when the hook should be called.
|
|
20
|
-
*/
|
|
21
|
-
filter?: Pick<HookFilter, TFilter>;
|
|
22
|
-
/**
|
|
23
|
-
* The hook function to be called.
|
|
24
|
-
*/
|
|
25
|
-
handler: THookFunction;
|
|
26
|
-
}
|
|
27
|
-
type PluginHook<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> = THookFunction | PluginHookObject<THookFunction, TFilter>;
|
|
28
|
-
/**
|
|
29
|
-
* A result returned by the plugin from the `types` hook that describes the declaration types output file.
|
|
30
|
-
*/
|
|
31
|
-
interface TypesResult {
|
|
32
|
-
directives?: string[];
|
|
33
|
-
code: string;
|
|
34
|
-
}
|
|
35
|
-
type PluginHookFunctions<TContext extends PluginContext> = { [TCommandType in CommandType]: (this: TContext) => MaybePromise<void> } & {
|
|
36
|
-
/**
|
|
37
|
-
* A function that returns configuration options to be merged with the build context's options.
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
|
|
41
|
-
*
|
|
42
|
-
* @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect.
|
|
43
|
-
*
|
|
44
|
-
* @see https://vitejs.dev/guide/api-plugin#config
|
|
45
|
-
*
|
|
46
|
-
* @param this - The build context.
|
|
47
|
-
* @param config - The partial configuration object to be modified.
|
|
48
|
-
* @returns A promise that resolves to a partial configuration object.
|
|
49
|
-
*/
|
|
50
|
-
config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial<TContext["config"]> & Record<string, any>>;
|
|
51
|
-
/**
|
|
52
|
-
* Modify environment configs before it's resolved. The hook can either mutate the passed-in environment config directly, or return a partial config object that will be deeply merged into existing config.
|
|
53
|
-
*
|
|
54
|
-
* @remarks
|
|
55
|
-
* This hook is called for each environment with a partially resolved environment config that already accounts for the default environment config values set at the root level. If plugins need to modify the config of a given environment, they should do it in this hook instead of the config hook. Leaving the config hook only for modifying the root default environment config.
|
|
56
|
-
*
|
|
57
|
-
* @see https://vitejs.dev/guide/api-plugin#configenvironment
|
|
58
|
-
*
|
|
59
|
-
* @param this - The build context.
|
|
60
|
-
* @param name - The name of the environment being configured.
|
|
61
|
-
* @param environment - The Vite-like environment object containing information about the current build environment.
|
|
62
|
-
* @returns A promise that resolves when the hook is complete.
|
|
63
|
-
*/
|
|
64
|
-
configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>;
|
|
65
|
-
/**
|
|
66
|
-
* A hook that is called when the plugin is resolved.
|
|
67
|
-
*
|
|
68
|
-
* @see https://vitejs.dev/guide/api-plugin#configresolved
|
|
69
|
-
*
|
|
70
|
-
* @param this - The build context.
|
|
71
|
-
* @returns A promise that resolves when the hook is complete.
|
|
72
|
-
*/
|
|
73
|
-
configResolved: (this: TContext) => MaybePromise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* A hook that is called to overwrite the generated declaration types file (.d.ts). The generated type definitions should describe the built-in modules/logic added during the `prepare` task.
|
|
76
|
-
*
|
|
77
|
-
* @param this - The build context.
|
|
78
|
-
* @param code - The source code to generate types for.
|
|
79
|
-
* @returns A promise that resolves when the hook is complete.
|
|
80
|
-
*/
|
|
81
|
-
types: (this: TContext, code: string) => MaybePromise<TypesResult | string | undefined | null>;
|
|
82
|
-
/**
|
|
83
|
-
* A hook that is called at the start of the build process.
|
|
84
|
-
*
|
|
85
|
-
* @param this - The build context and unplugin build context.
|
|
86
|
-
* @returns A promise that resolves when the hook is complete.
|
|
87
|
-
*/
|
|
88
|
-
buildStart: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
|
|
89
|
-
/**
|
|
90
|
-
* A hook that is called at the end of the build process.
|
|
91
|
-
*
|
|
92
|
-
* @param this - The build context and unplugin build context.
|
|
93
|
-
* @returns A promise that resolves when the hook is complete.
|
|
94
|
-
*/
|
|
95
|
-
buildEnd: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
|
|
96
|
-
/**
|
|
97
|
-
* A hook that is called to transform the source code.
|
|
98
|
-
*
|
|
99
|
-
* @param this - The build context, unplugin build context, and unplugin context.
|
|
100
|
-
* @param code - The source code to transform.
|
|
101
|
-
* @param id - The identifier of the source code.
|
|
102
|
-
* @returns A promise that resolves when the hook is complete.
|
|
103
|
-
*/
|
|
104
|
-
transform: (this: BuildPluginContext<TContext["config"]> & TContext, code: string, id: string) => MaybePromise<TransformResult>;
|
|
105
|
-
/**
|
|
106
|
-
* A hook that is called to load the source code.
|
|
107
|
-
*
|
|
108
|
-
* @param this - The build context, unplugin build context, and unplugin context.
|
|
109
|
-
* @param id - The identifier of the source code.
|
|
110
|
-
* @returns A promise that resolves when the hook is complete.
|
|
111
|
-
*/
|
|
112
|
-
load: (this: BuildPluginContext<TContext["config"]> & TContext, id: string) => MaybePromise<LoadResult>;
|
|
113
|
-
/**
|
|
114
|
-
* A hook that is called to resolve the identifier of the source code.
|
|
115
|
-
*
|
|
116
|
-
* @param this - The build context, unplugin build context, and unplugin context.
|
|
117
|
-
* @param id - The identifier of the source code.
|
|
118
|
-
* @param importer - The importer of the source code.
|
|
119
|
-
* @param options - The options for resolving the identifier.
|
|
120
|
-
* @returns A promise that resolves when the hook is complete.
|
|
121
|
-
*/
|
|
122
|
-
resolveId: (this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
|
|
123
|
-
isEntry: boolean;
|
|
124
|
-
}) => MaybePromise<string | ExternalIdResult | null | undefined>;
|
|
125
|
-
/**
|
|
126
|
-
* A hook that is called to write the bundle to disk.
|
|
127
|
-
*
|
|
128
|
-
* @param this - The build context.
|
|
129
|
-
* @returns A promise that resolves when the hook is complete.
|
|
130
|
-
*/
|
|
131
|
-
writeBundle: (this: TContext) => MaybePromise<void>;
|
|
132
|
-
};
|
|
133
|
-
type PluginHooks<TContext extends PluginContext> = { [TPluginHook in keyof PluginHookFunctions<TContext>]?: PluginHook<PluginHookFunctions<TContext>[TPluginHook]> } & {
|
|
134
|
-
transform: PluginHook<PluginHookFunctions<TContext>["transform"], "code" | "id">;
|
|
135
|
-
load: PluginHook<PluginHookFunctions<TContext>["load"], "id">;
|
|
136
|
-
resolveId: PluginHook<PluginHookFunctions<TContext>["resolveId"], "id">;
|
|
137
|
-
};
|
|
138
|
-
type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]> };
|
|
139
|
-
type Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> = Partial<PluginHooks<TContext>> & {
|
|
140
|
-
/**
|
|
141
|
-
* The name of the plugin, for use in deduplication, error messages and logs.
|
|
142
|
-
*/
|
|
143
|
-
name: string;
|
|
144
|
-
/**
|
|
145
|
-
* An API object that can be used for inter-plugin communication.
|
|
146
|
-
*
|
|
147
|
-
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
148
|
-
*/
|
|
149
|
-
api?: Record<string, any>;
|
|
150
|
-
/**
|
|
151
|
-
* Enforce plugin invocation tier similar to webpack loaders. Hooks ordering is still subject to the `order` property in the hook object.
|
|
152
|
-
*
|
|
153
|
-
* @remarks
|
|
154
|
-
* The Plugin invocation order is as follows:
|
|
155
|
-
* - `enforce: 'pre'` plugins
|
|
156
|
-
* - `order: 'pre'` plugin hooks
|
|
157
|
-
* - any other plugins (normal)
|
|
158
|
-
* - `order: 'post'` plugin hooks
|
|
159
|
-
* - `enforce: 'post'` plugins
|
|
160
|
-
*
|
|
161
|
-
* @see https://vitejs.dev/guide/api-plugin.html#plugin-ordering
|
|
162
|
-
* @see https://rollupjs.org/plugin-development/#build-hooks
|
|
163
|
-
* @see https://webpack.js.org/concepts/loaders/#enforce---pre-and-post
|
|
164
|
-
* @see https://esbuild.github.io/plugins/#concepts
|
|
165
|
-
*/
|
|
166
|
-
enforce?: "pre" | "post";
|
|
167
|
-
/**
|
|
168
|
-
* A function to determine if two plugins are the same and can be de-duplicated.
|
|
169
|
-
*
|
|
170
|
-
* @remarks
|
|
171
|
-
* If this is not provided, plugins are de-duplicated by comparing their names.
|
|
172
|
-
*
|
|
173
|
-
* @param other - The other plugin to compare against.
|
|
174
|
-
* @returns `true` if the two plugins are the same, `false` otherwise.
|
|
175
|
-
*/
|
|
176
|
-
dedupe?: false | ((other: Plugin<any>) => boolean);
|
|
177
|
-
/**
|
|
178
|
-
* A list of pre-requisite plugins that must be loaded before this plugin can be used.
|
|
179
|
-
*/
|
|
180
|
-
/**
|
|
181
|
-
* Define environments where this plugin should be active. By default, the plugin is active in all environments.
|
|
182
|
-
*
|
|
183
|
-
* @param environment - The environment to check.
|
|
184
|
-
* @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
|
|
185
|
-
*/
|
|
186
|
-
applyToEnvironment?: (environment: EnvironmentResolvedConfig) => boolean | PluginConfig<TContext>;
|
|
187
|
-
/**
|
|
188
|
-
* A function that returns configuration options to be merged with the build context's options.
|
|
189
|
-
*
|
|
190
|
-
* @remarks
|
|
191
|
-
* Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
|
|
192
|
-
*
|
|
193
|
-
* @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect. If you want to add plugins, consider doing so in the {@link Plugin.dependsOn} property instead.
|
|
194
|
-
*
|
|
195
|
-
* @see https://vitejs.dev/guide/api-plugin#config
|
|
196
|
-
*
|
|
197
|
-
* @param this - The build context.
|
|
198
|
-
* @param config - The partial configuration object to be modified.
|
|
199
|
-
* @returns A promise that resolves to a partial configuration object.
|
|
200
|
-
*/
|
|
201
|
-
config?: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial<TContext["config"]> & Record<string, any>>> | (DeepPartial<TContext["config"]> & Record<string, any>);
|
|
202
|
-
} & { [TBuilderVariant in BuilderVariant]?: InferUnpluginOptions<TContext, TBuilderVariant> };
|
|
203
|
-
type PluginHookFields<TContext extends PluginContext = PluginContext> = keyof PluginHookFunctions<TContext>;
|
|
204
|
-
//#endregion
|
|
205
|
-
export { Plugin, PluginHook, PluginHookFields, PluginHookFunctions };
|