@powerlines/plugin-vite 0.14.57 → 0.14.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +1 -0
  2. package/dist/helpers/index.cjs +1 -1
  3. package/dist/helpers/index.d.cts +1 -3
  4. package/dist/helpers/index.d.mts +1 -3
  5. package/dist/helpers/index.mjs +1 -1
  6. package/dist/helpers/unplugin.cjs +1 -1
  7. package/dist/helpers/unplugin.d.cts +6 -2
  8. package/dist/helpers/unplugin.d.mts +6 -2
  9. package/dist/helpers/unplugin.mjs +1 -1
  10. package/dist/index.cjs +1 -14
  11. package/dist/index.d.cts +3 -4
  12. package/dist/index.d.mts +5 -5
  13. package/dist/index.mjs +1 -14
  14. package/dist/powerlines/schemas/fs.cjs +1 -0
  15. package/dist/powerlines/schemas/fs.mjs +1 -0
  16. package/dist/powerlines/src/api.cjs +11 -0
  17. package/dist/powerlines/src/api.mjs +1 -0
  18. package/dist/powerlines/src/internal/babel/module-resolver-plugin.cjs +1 -0
  19. package/dist/powerlines/src/internal/babel/module-resolver-plugin.mjs +1 -0
  20. package/dist/powerlines/src/internal/helpers/environment.cjs +1 -0
  21. package/dist/powerlines/src/internal/helpers/environment.mjs +1 -0
  22. package/dist/powerlines/src/internal/helpers/generate-types.cjs +8 -0
  23. package/dist/powerlines/src/internal/helpers/generate-types.mjs +8 -0
  24. package/dist/powerlines/src/internal/helpers/hooks.cjs +1 -0
  25. package/dist/powerlines/src/internal/helpers/hooks.mjs +1 -0
  26. package/dist/powerlines/src/internal/helpers/install-dependencies.cjs +3 -0
  27. package/dist/powerlines/src/internal/helpers/install-dependencies.mjs +3 -0
  28. package/dist/powerlines/src/internal/helpers/install.cjs +1 -0
  29. package/dist/powerlines/src/internal/helpers/install.mjs +1 -0
  30. package/dist/powerlines/src/internal/helpers/resolve-tsconfig.cjs +8 -0
  31. package/dist/powerlines/src/internal/helpers/resolve-tsconfig.mjs +8 -0
  32. package/dist/powerlines/src/internal/helpers/resolver.cjs +1 -0
  33. package/dist/powerlines/src/internal/helpers/resolver.mjs +1 -0
  34. package/dist/powerlines/src/lib/build/esbuild.cjs +14 -0
  35. package/dist/powerlines/src/lib/build/esbuild.mjs +14 -0
  36. package/dist/powerlines/src/lib/build/vite.cjs +1 -0
  37. package/dist/powerlines/src/lib/build/vite.mjs +1 -0
  38. package/dist/powerlines/src/lib/config-file.cjs +1 -0
  39. package/dist/powerlines/src/lib/config-file.mjs +1 -0
  40. package/dist/powerlines/src/lib/contexts/api-context.cjs +1 -0
  41. package/dist/powerlines/src/lib/contexts/api-context.mjs +1 -0
  42. package/dist/powerlines/src/lib/contexts/context.cjs +1 -0
  43. package/dist/powerlines/src/lib/contexts/context.mjs +1 -0
  44. package/dist/powerlines/src/lib/contexts/environment-context.cjs +1 -0
  45. package/dist/powerlines/src/lib/contexts/environment-context.mjs +1 -0
  46. package/dist/powerlines/src/lib/contexts/plugin-context.cjs +1 -0
  47. package/dist/powerlines/src/lib/contexts/plugin-context.mjs +1 -0
  48. package/dist/powerlines/src/lib/entry.cjs +1 -0
  49. package/dist/powerlines/src/lib/entry.mjs +1 -0
  50. package/dist/powerlines/src/lib/fs/helpers.cjs +1 -0
  51. package/dist/powerlines/src/lib/fs/helpers.mjs +1 -0
  52. package/dist/powerlines/src/lib/fs/storage/base.cjs +1 -0
  53. package/dist/powerlines/src/lib/fs/storage/base.mjs +1 -0
  54. package/dist/powerlines/src/lib/fs/storage/file-system.cjs +1 -0
  55. package/dist/powerlines/src/lib/fs/storage/file-system.mjs +1 -0
  56. package/dist/powerlines/src/lib/fs/storage/virtual.cjs +1 -0
  57. package/dist/powerlines/src/lib/fs/storage/virtual.mjs +1 -0
  58. package/dist/powerlines/src/lib/fs/vfs.cjs +1 -0
  59. package/dist/powerlines/src/lib/fs/vfs.mjs +1 -0
  60. package/dist/powerlines/src/lib/logger.cjs +1 -0
  61. package/dist/powerlines/src/lib/logger.mjs +1 -0
  62. package/dist/powerlines/src/lib/typescript/ts-morph.cjs +1 -0
  63. package/dist/powerlines/src/lib/typescript/ts-morph.mjs +1 -0
  64. package/dist/powerlines/src/lib/typescript/tsconfig.cjs +4 -0
  65. package/dist/powerlines/src/lib/typescript/tsconfig.mjs +4 -0
  66. package/dist/powerlines/src/lib/unplugin/factory.cjs +1 -0
  67. package/dist/powerlines/src/lib/unplugin/factory.mjs +1 -0
  68. package/dist/powerlines/src/lib/unplugin/helpers.cjs +1 -0
  69. package/dist/powerlines/src/lib/unplugin/helpers.mjs +1 -0
  70. package/dist/powerlines/src/lib/unplugin/index.cjs +1 -0
  71. package/dist/powerlines/src/lib/unplugin/index.mjs +1 -0
  72. package/dist/powerlines/src/lib/unplugin/plugin.cjs +6 -0
  73. package/dist/powerlines/src/lib/unplugin/plugin.mjs +6 -0
  74. package/dist/powerlines/src/lib/utilities/file-header.cjs +10 -0
  75. package/dist/powerlines/src/lib/utilities/file-header.mjs +10 -0
  76. package/dist/powerlines/src/lib/utilities/meta.cjs +1 -0
  77. package/dist/powerlines/src/lib/utilities/meta.mjs +1 -0
  78. package/dist/powerlines/src/lib/utilities/source-file.cjs +1 -0
  79. package/dist/powerlines/src/lib/utilities/source-file.mjs +1 -0
  80. package/dist/powerlines/src/plugin-utils/helpers.cjs +1 -0
  81. package/dist/powerlines/src/plugin-utils/helpers.mjs +1 -0
  82. package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
  83. package/dist/powerlines/src/plugin-utils/paths.mjs +1 -0
  84. package/dist/powerlines/src/types/babel.d.mts +4 -0
  85. package/dist/powerlines/src/types/build.d.cts +143 -0
  86. package/dist/powerlines/src/types/build.d.mts +143 -0
  87. package/dist/powerlines/src/types/commands.cjs +1 -0
  88. package/dist/powerlines/src/types/commands.d.cts +8 -0
  89. package/dist/powerlines/src/types/commands.d.mts +9 -0
  90. package/dist/powerlines/src/types/commands.mjs +1 -0
  91. package/dist/powerlines/src/types/config.d.cts +346 -0
  92. package/dist/powerlines/src/types/config.d.mts +348 -0
  93. package/dist/powerlines/src/types/context.d.cts +347 -0
  94. package/dist/powerlines/src/types/context.d.mts +349 -0
  95. package/dist/powerlines/src/types/fs.d.cts +458 -0
  96. package/dist/powerlines/src/types/fs.d.mts +458 -0
  97. package/dist/powerlines/src/types/hooks.d.mts +2 -0
  98. package/dist/powerlines/src/types/plugin.cjs +1 -0
  99. package/dist/powerlines/src/types/plugin.d.cts +232 -0
  100. package/dist/powerlines/src/types/plugin.d.mts +232 -0
  101. package/dist/powerlines/src/types/plugin.mjs +1 -0
  102. package/dist/powerlines/src/types/resolved.d.cts +82 -0
  103. package/dist/powerlines/src/types/resolved.d.mts +82 -0
  104. package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
  105. package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
  106. package/dist/types/index.cjs +0 -1
  107. package/dist/types/index.d.cts +1 -2
  108. package/dist/types/index.d.mts +1 -2
  109. package/dist/types/index.mjs +1 -1
  110. package/dist/types/plugin.cjs +0 -1
  111. package/dist/types/plugin.d.cts +19 -1
  112. package/dist/types/plugin.d.mts +19 -1
  113. package/dist/types/plugin.mjs +1 -1
  114. package/package.json +10 -10
  115. package/dist/helpers-CRPRhztf.mjs +0 -1
  116. package/dist/helpers-LF26RHol.cjs +0 -0
  117. package/dist/index-9iG2qHLe.d.mts +0 -1
  118. package/dist/index-D4ELpJXS.d.cts +0 -1
  119. package/dist/index-D6CnpA_r.d.cts +0 -1
  120. package/dist/index-DL0uimUT.d.mts +0 -1
  121. package/dist/plugin-BjiGfRHE.mjs +0 -1
  122. package/dist/plugin-DNxw71zw.d.mts +0 -1661
  123. package/dist/plugin-KSQf40eU.d.cts +0 -1658
  124. package/dist/plugin-pBKbb5K9.cjs +0 -0
  125. package/dist/types-n6NgD0QK.mjs +0 -1
  126. package/dist/types-o3zWarRp.cjs +0 -0
  127. package/dist/unplugin-CAkRwblv.d.cts +0 -7
  128. package/dist/unplugin-D-Soc-G5.d.mts +0 -7
  129. package/dist/unplugin-DD1hF9r3.mjs +0 -6
  130. package/dist/unplugin-UTNYpV5r.cjs +0 -44
@@ -0,0 +1,232 @@
1
+ import { UnpluginBuildVariant } from "./build.mjs";
2
+ import { CommandType } from "./commands.mjs";
3
+ import { EnvironmentResolvedConfig, ResolvedConfig } from "./resolved.mjs";
4
+ import { EnvironmentConfig, PluginConfig } from "./config.mjs";
5
+ import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.mjs";
6
+ import { ExternalIdResult, HookFilter, TransformResult, UnpluginOptions } from "unplugin";
7
+ import { FunctionLike, MaybePromise } from "@stryke/types/base";
8
+ import { ArrayValues } from "@stryke/types/array";
9
+
10
+ //#region ../powerlines/src/types/plugin.d.ts
11
+ interface PluginHookObject<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> {
12
+ /**
13
+ * The order in which the plugin should be applied.
14
+ */
15
+ order?: "pre" | "post" | null | undefined;
16
+ /**
17
+ * A filter to determine when the hook should be called.
18
+ */
19
+ filter?: Pick<HookFilter, TFilter>;
20
+ /**
21
+ * The hook function to be called.
22
+ */
23
+ handler: THookFunction;
24
+ }
25
+ type PluginHook<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> = THookFunction | PluginHookObject<THookFunction, TFilter>;
26
+ /**
27
+ * A result returned by the plugin from the `types` hook that describes the declaration types output file.
28
+ */
29
+ interface TypesResult {
30
+ directives?: string[];
31
+ code: string;
32
+ }
33
+ type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]> };
34
+ type ConfigResult<TContext extends PluginContext = PluginContext> = DeepPartial<TContext["config"]> & Record<string, any>;
35
+ interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext> extends Record<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. If you want to add plugins, consider doing so in the {@link Plugin.dependsOn} property instead.
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<ConfigResult<TContext>>;
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<TransformResult>;
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 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 PluginHooks<TContext extends PluginContext = PluginContext> = { [TKey in keyof BasePluginHookFunctions<TContext>]: PluginHook<BasePluginHookFunctions<TContext>[TKey]> } & {
135
+ /**
136
+ * A function that returns configuration options to be merged with the build context's options.
137
+ *
138
+ * @remarks
139
+ * 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.
140
+ *
141
+ * @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.
142
+ *
143
+ * @see https://vitejs.dev/guide/api-plugin#config
144
+ *
145
+ * @param this - The build context.
146
+ * @param config - The partial configuration object to be modified.
147
+ * @returns A promise that resolves to a partial configuration object.
148
+ */
149
+ config: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>> | ConfigResult<TContext>;
150
+ /**
151
+ * A hook that is called to transform the source code.
152
+ *
153
+ * @param this - The build context, unplugin build context, and unplugin context.
154
+ * @param code - The source code to transform.
155
+ * @param id - The identifier of the source code.
156
+ * @returns A promise that resolves when the hook is complete.
157
+ */
158
+ transform: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, code: string, id: string) => MaybePromise<TransformResult>, "code" | "id">;
159
+ /**
160
+ * A hook that is called to load the source code.
161
+ *
162
+ * @param this - The build context, unplugin build context, and unplugin context.
163
+ * @param id - The identifier of the source code.
164
+ * @returns A promise that resolves when the hook is complete.
165
+ */
166
+ load: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string) => MaybePromise<TransformResult>, "id">;
167
+ /**
168
+ * A hook that is called to resolve the identifier of the source code.
169
+ *
170
+ * @param this - The build context, unplugin build context, and unplugin context.
171
+ * @param id - The identifier of the source code.
172
+ * @param importer - The importer of the source code.
173
+ * @param options - The options for resolving the identifier.
174
+ * @returns A promise that resolves when the hook is complete.
175
+ */
176
+ resolveId: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
177
+ isEntry: boolean;
178
+ }) => MaybePromise<string | ExternalIdResult | null | undefined>, "id">;
179
+ };
180
+ type PluginBuildPlugins<TContext extends PluginContext = PluginContext> = { [TBuildVariant in UnpluginBuildVariant]?: BuildPlugin<TContext, TBuildVariant> };
181
+ interface Plugin<in out TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> extends Partial<PluginHooks<TContext>>, PluginBuildPlugins<TContext> {
182
+ /**
183
+ * The name of the plugin, for use in deduplication, error messages and logs.
184
+ */
185
+ name: string;
186
+ /**
187
+ * An API object that can be used for inter-plugin communication.
188
+ *
189
+ * @see https://rollupjs.org/plugin-development/#direct-plugin-communication
190
+ */
191
+ api?: Record<string, any>;
192
+ /**
193
+ * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering is still subject to the `order` property in the hook object.
194
+ *
195
+ * @remarks
196
+ * The Plugin invocation order is as follows:
197
+ * - `enforce: 'pre'` plugins
198
+ * - `order: 'pre'` plugin hooks
199
+ * - any other plugins (normal)
200
+ * - `order: 'post'` plugin hooks
201
+ * - `enforce: 'post'` plugins
202
+ *
203
+ * @see https://vitejs.dev/guide/api-plugin.html#plugin-ordering
204
+ * @see https://rollupjs.org/plugin-development/#build-hooks
205
+ * @see https://webpack.js.org/concepts/loaders/#enforce---pre-and-post
206
+ * @see https://esbuild.github.io/plugins/#concepts
207
+ */
208
+ enforce?: "pre" | "post";
209
+ /**
210
+ * A function to determine if two plugins are the same and can be de-duplicated.
211
+ *
212
+ * @remarks
213
+ * If this is not provided, plugins are de-duplicated by comparing their names.
214
+ *
215
+ * @param other - The other plugin to compare against.
216
+ * @returns `true` if the two plugins are the same, `false` otherwise.
217
+ */
218
+ dedupe?: false | ((other: Plugin<any>) => boolean);
219
+ /**
220
+ * A list of pre-requisite plugins that must be loaded before this plugin can be used.
221
+ */
222
+ dependsOn?: PluginConfig<any>[];
223
+ /**
224
+ * Define environments where this plugin should be active. By default, the plugin is active in all environments.
225
+ *
226
+ * @param environment - The environment to check.
227
+ * @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
228
+ */
229
+ applyToEnvironment?: (environment: EnvironmentResolvedConfig) => boolean | PluginConfig<any>;
230
+ }
231
+ //#endregion
232
+ export { Plugin };
@@ -0,0 +1 @@
1
+ const e=[`name`,`api`,`enforce`,`dedupe`,`dependsOn`,`applyToEnvironment`];export{e as PLUGIN_NON_HOOK_FIELDS};
@@ -0,0 +1,82 @@
1
+ import { EnvironmentConfig, InlineConfig, OutputConfig, UserConfig as UserConfig$1, ViteUserConfig } from "./config.cjs";
2
+ import { ResolvedPreviewOptions } from "vite";
3
+ import { NonUndefined } from "@stryke/types/base";
4
+ import { TypeDefinition } from "@stryke/types/configuration";
5
+ import { AssetGlob } from "@stryke/types/file";
6
+
7
+ //#region ../powerlines/src/types/resolved.d.ts
8
+ interface ResolvedEntryTypeDefinition extends TypeDefinition {
9
+ /**
10
+ * The user provided entry point in the source code
11
+ */
12
+ input: TypeDefinition;
13
+ /**
14
+ * An optional name to use in the package export during the build process
15
+ */
16
+ output?: string;
17
+ }
18
+ type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "ssr">> & {
19
+ /**
20
+ * The name of the environment
21
+ */
22
+ name: string;
23
+ /**
24
+ * Configuration options for the preview server
25
+ */
26
+ preview?: ResolvedPreviewOptions;
27
+ };
28
+ type ResolvedAssetGlob = AssetGlob & Required<Pick<AssetGlob, "input">>;
29
+ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> & {
30
+ assets: ResolvedAssetGlob[];
31
+ }> & Pick<OutputConfig, "storage">;
32
+ /**
33
+ * The resolved options for the Powerlines project configuration.
34
+ */
35
+ type ResolvedConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
36
+ /**
37
+ * The configuration options that were provided inline to the Powerlines CLI.
38
+ */
39
+ inlineConfig: InlineConfig<TUserConfig>;
40
+ /**
41
+ * The original configuration options that were provided by the user to the Powerlines process.
42
+ */
43
+ userConfig: TUserConfig;
44
+ /**
45
+ * A string identifier for the Powerlines command being executed.
46
+ */
47
+ command: NonUndefined<InlineConfig<TUserConfig>["command"]>;
48
+ /**
49
+ * The root directory of the project's source code
50
+ *
51
+ * @defaultValue "\{projectRoot\}/src"
52
+ */
53
+ sourceRoot: NonUndefined<TUserConfig["sourceRoot"]>;
54
+ /**
55
+ * The root directory of the project.
56
+ */
57
+ projectRoot: NonUndefined<TUserConfig["root"]>;
58
+ /**
59
+ * The type of project being built.
60
+ */
61
+ projectType: NonUndefined<TUserConfig["type"]>;
62
+ /**
63
+ * The output configuration options to use for the build process
64
+ */
65
+ output: OutputResolvedConfig;
66
+ /**
67
+ * Configuration provided to build processes
68
+ *
69
+ * @remarks
70
+ * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
71
+ */
72
+ build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
73
+ /**
74
+ * The log level to use for the Powerlines processes.
75
+ *
76
+ * @defaultValue "info"
77
+ */
78
+ logLevel: "error" | "warn" | "info" | "debug" | "trace" | null;
79
+ };
80
+ type ViteResolvedConfig = ResolvedConfig<ViteUserConfig>;
81
+ //#endregion
82
+ export { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition, ViteResolvedConfig };
@@ -0,0 +1,82 @@
1
+ import { EnvironmentConfig, InlineConfig, OutputConfig, UserConfig as UserConfig$1, ViteUserConfig } from "./config.mjs";
2
+ import { ResolvedPreviewOptions } from "vite";
3
+ import { NonUndefined } from "@stryke/types/base";
4
+ import { TypeDefinition } from "@stryke/types/configuration";
5
+ import { AssetGlob } from "@stryke/types/file";
6
+
7
+ //#region ../powerlines/src/types/resolved.d.ts
8
+ interface ResolvedEntryTypeDefinition extends TypeDefinition {
9
+ /**
10
+ * The user provided entry point in the source code
11
+ */
12
+ input: TypeDefinition;
13
+ /**
14
+ * An optional name to use in the package export during the build process
15
+ */
16
+ output?: string;
17
+ }
18
+ type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "ssr">> & {
19
+ /**
20
+ * The name of the environment
21
+ */
22
+ name: string;
23
+ /**
24
+ * Configuration options for the preview server
25
+ */
26
+ preview?: ResolvedPreviewOptions;
27
+ };
28
+ type ResolvedAssetGlob = AssetGlob & Required<Pick<AssetGlob, "input">>;
29
+ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> & {
30
+ assets: ResolvedAssetGlob[];
31
+ }> & Pick<OutputConfig, "storage">;
32
+ /**
33
+ * The resolved options for the Powerlines project configuration.
34
+ */
35
+ type ResolvedConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
36
+ /**
37
+ * The configuration options that were provided inline to the Powerlines CLI.
38
+ */
39
+ inlineConfig: InlineConfig<TUserConfig>;
40
+ /**
41
+ * The original configuration options that were provided by the user to the Powerlines process.
42
+ */
43
+ userConfig: TUserConfig;
44
+ /**
45
+ * A string identifier for the Powerlines command being executed.
46
+ */
47
+ command: NonUndefined<InlineConfig<TUserConfig>["command"]>;
48
+ /**
49
+ * The root directory of the project's source code
50
+ *
51
+ * @defaultValue "\{projectRoot\}/src"
52
+ */
53
+ sourceRoot: NonUndefined<TUserConfig["sourceRoot"]>;
54
+ /**
55
+ * The root directory of the project.
56
+ */
57
+ projectRoot: NonUndefined<TUserConfig["root"]>;
58
+ /**
59
+ * The type of project being built.
60
+ */
61
+ projectType: NonUndefined<TUserConfig["type"]>;
62
+ /**
63
+ * The output configuration options to use for the build process
64
+ */
65
+ output: OutputResolvedConfig;
66
+ /**
67
+ * Configuration provided to build processes
68
+ *
69
+ * @remarks
70
+ * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
71
+ */
72
+ build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
73
+ /**
74
+ * The log level to use for the Powerlines processes.
75
+ *
76
+ * @defaultValue "info"
77
+ */
78
+ logLevel: "error" | "warn" | "info" | "debug" | "trace" | null;
79
+ };
80
+ type ViteResolvedConfig = ResolvedConfig<ViteUserConfig>;
81
+ //#endregion
82
+ export { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition, ViteResolvedConfig };
@@ -0,0 +1,69 @@
1
+ import { CompilerOptions, TsConfigJson } from "@stryke/types/tsconfig";
2
+ import ts from "typescript";
3
+
4
+ //#region ../powerlines/src/types/tsconfig.d.ts
5
+ type ReflectionMode = "default" | "explicit" | "never";
6
+ type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
7
+ /**
8
+ * Defines the level of reflection to be used during the transpilation process.
9
+ *
10
+ * @remarks
11
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
12
+ * - `minimal` - Only the essential type information is captured.
13
+ * - `normal` - Additional type information is captured, including some contextual data.
14
+ * - `verbose` - All available type information is captured, including detailed contextual data.
15
+ */
16
+ type ReflectionLevel = "minimal" | "normal" | "verbose";
17
+ interface DeepkitOptions {
18
+ /**
19
+ * Either true to activate reflection for all files compiled using this tsconfig,
20
+ * or a list of globs/file paths relative to this tsconfig.json.
21
+ * Globs/file paths can be prefixed with a ! to exclude them.
22
+ */
23
+ reflection?: RawReflectionMode;
24
+ /**
25
+ * Defines the level of reflection to be used during the transpilation process.
26
+ *
27
+ * @remarks
28
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
29
+ * - `minimal` - Only the essential type information is captured.
30
+ * - `normal` - Additional type information is captured, including some contextual data.
31
+ * - `verbose` - All available type information is captured, including detailed contextual data.
32
+ */
33
+ reflectionLevel?: ReflectionLevel;
34
+ }
35
+ type TSCompilerOptions = CompilerOptions & DeepkitOptions;
36
+ /**
37
+ * The TypeScript compiler configuration.
38
+ *
39
+ * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
40
+ */
41
+ interface TSConfig extends Omit<TsConfigJson, "reflection"> {
42
+ /**
43
+ * Either true to activate reflection for all files compiled using this tsconfig,
44
+ * or a list of globs/file paths relative to this tsconfig.json.
45
+ * Globs/file paths can be prefixed with a ! to exclude them.
46
+ */
47
+ reflection?: RawReflectionMode;
48
+ /**
49
+ * Defines the level of reflection to be used during the transpilation process.
50
+ *
51
+ * @remarks
52
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
53
+ * - `minimal` - Only the essential type information is captured.
54
+ * - `normal` - Additional type information is captured, including some contextual data.
55
+ * - `verbose` - All available type information is captured, including detailed contextual data.
56
+ */
57
+ reflectionLevel?: ReflectionLevel;
58
+ /**
59
+ * Instructs the TypeScript compiler how to compile `.ts` files.
60
+ */
61
+ compilerOptions?: TSCompilerOptions;
62
+ }
63
+ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
64
+ originalTsconfigJson: TsConfigJson;
65
+ tsconfigJson: TSConfig;
66
+ tsconfigFilePath: string;
67
+ };
68
+ //#endregion
69
+ export { ParsedTypeScriptConfig, TSConfig };
@@ -0,0 +1,69 @@
1
+ import ts from "typescript";
2
+ import { CompilerOptions, TsConfigJson } from "@stryke/types/tsconfig";
3
+
4
+ //#region ../powerlines/src/types/tsconfig.d.ts
5
+ type ReflectionMode = "default" | "explicit" | "never";
6
+ type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
7
+ /**
8
+ * Defines the level of reflection to be used during the transpilation process.
9
+ *
10
+ * @remarks
11
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
12
+ * - `minimal` - Only the essential type information is captured.
13
+ * - `normal` - Additional type information is captured, including some contextual data.
14
+ * - `verbose` - All available type information is captured, including detailed contextual data.
15
+ */
16
+ type ReflectionLevel = "minimal" | "normal" | "verbose";
17
+ interface DeepkitOptions {
18
+ /**
19
+ * Either true to activate reflection for all files compiled using this tsconfig,
20
+ * or a list of globs/file paths relative to this tsconfig.json.
21
+ * Globs/file paths can be prefixed with a ! to exclude them.
22
+ */
23
+ reflection?: RawReflectionMode;
24
+ /**
25
+ * Defines the level of reflection to be used during the transpilation process.
26
+ *
27
+ * @remarks
28
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
29
+ * - `minimal` - Only the essential type information is captured.
30
+ * - `normal` - Additional type information is captured, including some contextual data.
31
+ * - `verbose` - All available type information is captured, including detailed contextual data.
32
+ */
33
+ reflectionLevel?: ReflectionLevel;
34
+ }
35
+ type TSCompilerOptions = CompilerOptions & DeepkitOptions;
36
+ /**
37
+ * The TypeScript compiler configuration.
38
+ *
39
+ * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
40
+ */
41
+ interface TSConfig extends Omit<TsConfigJson, "reflection"> {
42
+ /**
43
+ * Either true to activate reflection for all files compiled using this tsconfig,
44
+ * or a list of globs/file paths relative to this tsconfig.json.
45
+ * Globs/file paths can be prefixed with a ! to exclude them.
46
+ */
47
+ reflection?: RawReflectionMode;
48
+ /**
49
+ * Defines the level of reflection to be used during the transpilation process.
50
+ *
51
+ * @remarks
52
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
53
+ * - `minimal` - Only the essential type information is captured.
54
+ * - `normal` - Additional type information is captured, including some contextual data.
55
+ * - `verbose` - All available type information is captured, including detailed contextual data.
56
+ */
57
+ reflectionLevel?: ReflectionLevel;
58
+ /**
59
+ * Instructs the TypeScript compiler how to compile `.ts` files.
60
+ */
61
+ compilerOptions?: TSCompilerOptions;
62
+ }
63
+ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
64
+ originalTsconfigJson: TsConfigJson;
65
+ tsconfigJson: TSConfig;
66
+ tsconfigFilePath: string;
67
+ };
68
+ //#endregion
69
+ export { ParsedTypeScriptConfig, TSConfig };
@@ -1 +0,0 @@
1
- require(`../plugin-pBKbb5K9.cjs`),require(`../types-o3zWarRp.cjs`);
@@ -1,3 +1,2 @@
1
- import { a as __ΩVitePluginOptions, i as __ΩVitePluginContext, n as VitePluginOptions, o as __ΩVitePluginResolvedConfig, r as VitePluginResolvedConfig, t as VitePluginContext } from "../plugin-KSQf40eU.cjs";
2
- import "../index-D4ELpJXS.cjs";
1
+ import { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig } from "./plugin.cjs";
3
2
  export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig };
@@ -1,3 +1,2 @@
1
- import { a as __ΩVitePluginOptions, i as __ΩVitePluginContext, n as VitePluginOptions, o as __ΩVitePluginResolvedConfig, r as VitePluginResolvedConfig, t as VitePluginContext } from "../plugin-DNxw71zw.mjs";
2
- import "../index-9iG2qHLe.mjs";
1
+ import { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig } from "./plugin.mjs";
3
2
  export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig };
@@ -1 +1 @@
1
- import"../plugin-BjiGfRHE.mjs";import"../types-n6NgD0QK.mjs";export{};
1
+ export{};
@@ -1 +0,0 @@
1
- require(`../plugin-pBKbb5K9.cjs`);
@@ -1,2 +1,20 @@
1
- import { a as __ΩVitePluginOptions, i as __ΩVitePluginContext, n as VitePluginOptions, o as __ΩVitePluginResolvedConfig, r as VitePluginResolvedConfig, t as VitePluginContext } from "../plugin-KSQf40eU.cjs";
1
+ import { ViteBuildConfig } from "../powerlines/src/types/build.cjs";
2
+ import { ViteResolvedConfig } from "../powerlines/src/types/resolved.cjs";
3
+ import { PluginContext } from "../powerlines/src/types/context.cjs";
4
+
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
+ };
14
+ type VitePluginResolvedConfig = ViteResolvedConfig;
15
+ type VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePluginResolvedConfig> = PluginContext<TResolvedConfig>;
16
+ declare type __ΩVitePluginOptions = any[];
17
+ declare type __ΩVitePluginResolvedConfig = any[];
18
+ declare type __ΩVitePluginContext = any[];
19
+ //#endregion
2
20
  export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig };
@@ -1,2 +1,20 @@
1
- import { a as __ΩVitePluginOptions, i as __ΩVitePluginContext, n as VitePluginOptions, o as __ΩVitePluginResolvedConfig, r as VitePluginResolvedConfig, t as VitePluginContext } from "../plugin-DNxw71zw.mjs";
1
+ import { ViteBuildConfig } from "../powerlines/src/types/build.mjs";
2
+ import { ViteResolvedConfig } from "../powerlines/src/types/resolved.mjs";
3
+ import { PluginContext } from "../powerlines/src/types/context.mjs";
4
+
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
+ };
14
+ type VitePluginResolvedConfig = ViteResolvedConfig;
15
+ type VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePluginResolvedConfig> = PluginContext<TResolvedConfig>;
16
+ declare type __ΩVitePluginOptions = any[];
17
+ declare type __ΩVitePluginResolvedConfig = any[];
18
+ declare type __ΩVitePluginContext = any[];
19
+ //#endregion
2
20
  export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig };
@@ -1 +1 @@
1
- import"../plugin-BjiGfRHE.mjs";export{};
1
+ export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-vite",
3
- "version": "0.14.57",
3
+ "version": "0.14.59",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "repository": {
@@ -150,21 +150,21 @@
150
150
  "rolldown-vite": { "optional": true }
151
151
  },
152
152
  "dependencies": {
153
- "@stryke/fs": "^0.33.9",
154
- "@stryke/path": "^0.22.0",
155
- "@stryke/type-checks": "^0.4.4",
156
- "@stryke/types": "^0.10.13",
153
+ "@stryke/fs": "^0.33.20",
154
+ "@stryke/path": "^0.22.11",
155
+ "@stryke/type-checks": "^0.5.9",
156
+ "@stryke/types": "^0.10.23",
157
157
  "defu": "^6.1.4",
158
158
  "jiti": "^2.6.1",
159
- "powerlines": "^0.30.8"
159
+ "powerlines": "^0.30.10"
160
160
  },
161
161
  "devDependencies": {
162
- "vite": "^7.2.6",
162
+ "vite": "^7.2.7",
163
163
  "rolldown-vite": "^7.2.10",
164
- "@powerlines/nx": "^0.10.57",
165
- "@powerlines/plugin-plugin": "^0.12.9",
164
+ "@powerlines/nx": "^0.10.59",
165
+ "@powerlines/plugin-plugin": "^0.12.11",
166
166
  "@types/node": "^24.10.1"
167
167
  },
168
168
  "publishConfig": { "access": "public" },
169
- "gitHead": "b6cd904eada6483fffd8791e64febb309d73f399"
169
+ "gitHead": "1fa17406f69248e0a35ca56c09b1f4589e4d49d7"
170
170
  }
@@ -1 +0,0 @@
1
- export{};
File without changes