@powerlines/plugin-env 0.15.135 → 0.15.136

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 (53) hide show
  1. package/dist/babel/plugin.cjs +3 -3
  2. package/dist/babel/plugin.d.cts +2 -2
  3. package/dist/babel/plugin.d.mts +2 -3
  4. package/dist/babel/plugin.mjs +1 -1
  5. package/dist/helpers/automd-generator.cjs +2 -2
  6. package/dist/helpers/automd-generator.d.cts +1 -1
  7. package/dist/helpers/automd-generator.d.mts +1 -1
  8. package/dist/helpers/automd-generator.mjs +1 -1
  9. package/dist/helpers/load.cjs +4 -4
  10. package/dist/helpers/load.mjs +2 -2
  11. package/dist/helpers/persistence.cjs +5 -5
  12. package/dist/helpers/persistence.d.cts +1 -1
  13. package/dist/helpers/persistence.d.mts +1 -1
  14. package/dist/helpers/persistence.mjs +1 -1
  15. package/dist/index.d.cts +1 -1
  16. package/dist/index.d.mts +1 -1
  17. package/dist/types/plugin.d.cts +1 -1
  18. package/package.json +7 -7
  19. package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
  20. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -49
  21. package/dist/powerlines/src/lib/constants/environments.cjs +0 -6
  22. package/dist/powerlines/src/lib/constants/environments.mjs +0 -5
  23. package/dist/powerlines/src/types/api.d.cts +0 -104
  24. package/dist/powerlines/src/types/api.d.mts +0 -104
  25. package/dist/powerlines/src/types/babel.cjs +0 -11
  26. package/dist/powerlines/src/types/babel.d.cts +0 -21
  27. package/dist/powerlines/src/types/babel.d.mts +0 -21
  28. package/dist/powerlines/src/types/babel.mjs +0 -10
  29. package/dist/powerlines/src/types/build.d.cts +0 -185
  30. package/dist/powerlines/src/types/build.d.mts +0 -185
  31. package/dist/powerlines/src/types/commands.d.cts +0 -8
  32. package/dist/powerlines/src/types/commands.d.mts +0 -9
  33. package/dist/powerlines/src/types/config.cjs +0 -30
  34. package/dist/powerlines/src/types/config.d.cts +0 -424
  35. package/dist/powerlines/src/types/config.d.mts +0 -426
  36. package/dist/powerlines/src/types/config.mjs +0 -29
  37. package/dist/powerlines/src/types/context.cjs +0 -285
  38. package/dist/powerlines/src/types/context.d.cts +0 -514
  39. package/dist/powerlines/src/types/context.d.mts +0 -514
  40. package/dist/powerlines/src/types/context.mjs +0 -283
  41. package/dist/powerlines/src/types/fs.d.cts +0 -486
  42. package/dist/powerlines/src/types/fs.d.mts +0 -486
  43. package/dist/powerlines/src/types/hooks.d.cts +0 -32
  44. package/dist/powerlines/src/types/hooks.d.mts +0 -32
  45. package/dist/powerlines/src/types/index.d.mts +0 -12
  46. package/dist/powerlines/src/types/plugin.d.cts +0 -205
  47. package/dist/powerlines/src/types/plugin.d.mts +0 -205
  48. package/dist/powerlines/src/types/resolved.d.cts +0 -93
  49. package/dist/powerlines/src/types/resolved.d.mts +0 -93
  50. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  51. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  52. package/dist/powerlines/src/types/unplugin.d.cts +0 -22
  53. package/dist/powerlines/src/types/unplugin.d.mts +0 -23
@@ -1,426 +0,0 @@
1
- import { BuildConfig, BuildResolvedConfig, ESBuildBuildConfig, ESBuildResolvedBuildConfig, FarmBuildConfig, FarmResolvedBuildConfig, RolldownBuildConfig, RolldownResolvedBuildConfig, RollupBuildConfig, RollupResolvedBuildConfig, RspackBuildConfig, RspackResolvedBuildConfig, TsdownBuildConfig, TsdownResolvedBuildConfig, TsupBuildConfig, TsupResolvedBuildConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, ViteBuildConfig, ViteResolvedBuildConfig, WebpackBuildConfig, WebpackResolvedBuildConfig } from "./build.mjs";
2
- import "./babel.mjs";
3
- import { StoragePort, StoragePreset } from "./fs.mjs";
4
- import { TSConfig } from "./tsconfig.mjs";
5
- import { PluginContext } from "./context.mjs";
6
- import { Plugin } from "./plugin.mjs";
7
- import "c12";
8
- import "@babel/core";
9
- import { LogLevelLabel } from "@storm-software/config-tools/types";
10
- import { MaybePromise } from "@stryke/types/base";
11
- import { PreviewOptions } from "vite";
12
- import { Format } from "@storm-software/build-tools/types";
13
- import { StormWorkspaceConfig } from "@storm-software/config/types";
14
- import { TypeDefinitionParameter } from "@stryke/types/configuration";
15
- import { AssetGlob } from "@stryke/types/file";
16
- import { DateString } from "compatx";
17
-
18
- //#region ../powerlines/src/types/config.d.ts
19
- type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
20
- type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
21
- /**
22
- * The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
23
- */
24
- type WorkspaceConfig = Partial<StormWorkspaceConfig> & Required<Pick<StormWorkspaceConfig, "workspaceRoot">>;
25
- type PluginFactory<in out TContext extends PluginContext = PluginContext, TOptions = any> = (options: TOptions) => MaybePromise<Plugin<TContext> | Plugin<TContext>[]>;
26
- /**
27
- * A configuration tuple for a Powerlines plugin.
28
- */
29
- type PluginConfigTuple<TContext extends PluginContext = PluginContext, TOptions = any> = [string | PluginFactory<TContext, TOptions>, TOptions] | [Plugin<TContext>];
30
- /**
31
- * A configuration object for a Powerlines plugin.
32
- */
33
- type PluginConfigObject<TContext extends PluginContext = PluginContext, TOptions = any> = {
34
- plugin: string | PluginFactory<TContext, TOptions>;
35
- options: TOptions;
36
- } | {
37
- plugin: Plugin<TContext>;
38
- options?: never;
39
- };
40
- /**
41
- * A configuration tuple for a Powerlines plugin.
42
- */
43
- type PluginConfig<TContext extends PluginContext = PluginContext> = string | PluginFactory<TContext, void> | Plugin<TContext> | PluginConfigTuple<TContext> | PluginConfigObject<TContext> | Promise<PluginConfig<TContext>> | PluginConfig<TContext>[];
44
- type ProjectType = "application" | "library";
45
- interface DeployConfig {
46
- /**
47
- * The deployment variant being used by the Powerlines engine.
48
- *
49
- * @example
50
- * ```ts
51
- * export default defineConfig({
52
- * deploy: {
53
- * variant: "cloudflare"
54
- * }
55
- * });
56
- *
57
- * ```
58
- */
59
- variant?: string;
60
- }
61
- interface OutputConfig {
62
- /**
63
- * The path to output the final compiled files to
64
- *
65
- * @remarks
66
- * If a value is not provided, Powerlines will attempt to:
67
- * 1. Use the `outDir` value in the `tsconfig.json` file.
68
- * 2. Use the `dist` directory in the project root directory.
69
- *
70
- * @defaultValue "dist/\{projectRoot\}"
71
- */
72
- outputPath?: string;
73
- /**
74
- * The output directory path for the project build.
75
- *
76
- * @remarks
77
- * This path is used to determine where the built files will be placed after the build process completes. This will be used in scenarios where the monorepo uses TSConfig paths to link packages together.
78
- *
79
- * @defaultValue "\{projectRoot\}/dist"
80
- */
81
- buildPath?: string;
82
- /**
83
- * The folder where the generated runtime artifacts will be located
84
- *
85
- * @remarks
86
- * This folder will contain all runtime artifacts and builtins generated during the "prepare" phase.
87
- *
88
- * @defaultValue "\{projectRoot\}/.powerlines"
89
- */
90
- artifactsPath?: string;
91
- /**
92
- * The path of the generated runtime declaration file relative to the workspace root.
93
- *
94
- * @defaultValue "\{projectRoot\}/powerlines.d.ts"
95
- */
96
- dts?: string | false;
97
- /**
98
- * The module format of the output files
99
- *
100
- * @remarks
101
- * This option can be a single format or an array of formats. If an array is provided, multiple builds will be generated for each format.
102
- *
103
- * @defaultValue "esm"
104
- */
105
- format?: Format | Format[];
106
- /**
107
- * A list of assets to copy to the output directory
108
- *
109
- * @remarks
110
- * The assets can be specified as a string (path to the asset) or as an object with a `glob` property (to match multiple files). The paths are relative to the project root directory.
111
- */
112
- assets?: Array<string | AssetGlob>;
113
- /**
114
- * A string preset or a custom {@link StoragePort} to provide fine-grained control over generated/output file storage.
115
- *
116
- * @remarks
117
- * If a string preset is provided, it must be one of the following values:
118
- * - `"virtual"`: Uses the local file system for storage.
119
- * - `"fs"`: Uses an in-memory virtual file system for storage.
120
- *
121
- * If a custom {@link StoragePort} is provided, it will be used for all file storage operations during the build process.
122
- *
123
- * @defaultValue "virtual"
124
- */
125
- storage?: StoragePort | StoragePreset;
126
- }
127
- interface BaseConfig {
128
- /**
129
- * The entry point(s) for the application
130
- */
131
- entry?: TypeDefinitionParameter | TypeDefinitionParameter[];
132
- /**
133
- * Configuration for the output of the build process
134
- */
135
- output?: OutputConfig;
136
- /**
137
- * Configuration for cleaning the build artifacts
138
- *
139
- * @remarks
140
- * If set to `false`, the cleaning process will be disabled.
141
- */
142
- clean?: Record<string, any> | false;
143
- /**
144
- * Configuration for linting the source code
145
- *
146
- * @remarks
147
- * If set to `false`, linting will be disabled.
148
- */
149
- lint?: Record<string, any> | false;
150
- /**
151
- * Configuration for testing the source code
152
- *
153
- * @remarks
154
- * If set to `false`, testing will be disabled.
155
- */
156
- test?: Record<string, any> | false;
157
- /**
158
- * Configuration for the transformation of the source code
159
- */
160
- transform?: Record<string, any>;
161
- /**
162
- * Configuration provided to build processes
163
- *
164
- * @remarks
165
- * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
166
- */
167
- build?: BuildConfig;
168
- /**
169
- * Configuration for documentation generation
170
- *
171
- * @remarks
172
- * This configuration will be used by the documentation generation plugins during the `docs` command.
173
- */
174
- docs?: Record<string, any>;
175
- /**
176
- * Configuration for deploying the source code
177
- *
178
- * @remarks
179
- * If set to `false`, the deployment will be disabled.
180
- */
181
- deploy?: DeployConfig | false;
182
- /**
183
- * The path to the tsconfig file to be used by the compiler
184
- *
185
- * @remarks
186
- * If a value is not provided, the plugin will attempt to find the `tsconfig.json` file in the project root directory. The parsed tsconfig compiler options will be merged with the {@link Options.tsconfigRaw} value (if provided).
187
- *
188
- * @defaultValue "\{projectRoot\}/tsconfig.json"
189
- */
190
- tsconfig?: string;
191
- /**
192
- * The raw {@link TSConfig} object to be used by the compiler. This object will be merged with the `tsconfig.json` file.
193
- *
194
- * @see https://www.typescriptlang.org/tsconfig
195
- *
196
- * @remarks
197
- * If populated, this option takes higher priority than `tsconfig`
198
- */
199
- tsconfigRaw?: TSConfig;
200
- }
201
- interface EnvironmentConfig extends BaseConfig {
202
- /**
203
- * Configuration options for the preview server
204
- */
205
- preview?: PreviewOptions;
206
- /**
207
- * A flag indicating whether the build is for a Server-Side Rendering environment.
208
- */
209
- ssr?: boolean;
210
- /**
211
- * Define if this environment is used for Server-Side Rendering
212
- *
213
- * @defaultValue "server" (if it isn't the client environment)
214
- */
215
- consumer?: "client" | "server";
216
- }
217
- interface CommonUserConfig extends BaseConfig {
218
- /**
219
- * The name of the project
220
- */
221
- name?: string;
222
- /**
223
- * The project display title
224
- *
225
- * @remarks
226
- * This option is used in documentation generation and other places where a human-readable title is needed.
227
- */
228
- title?: string;
229
- /**
230
- * A description of the project
231
- *
232
- * @remarks
233
- * If this option is not provided, the build process will try to use the \`description\` value from the `\package.json\` file.
234
- */
235
- description?: string;
236
- /**
237
- * The organization or author of the project
238
- *
239
- * @remarks
240
- * If this option is not provided, the build process will try to use the \`author\` value from the \`package.json\` file. If the \`author\` value cannot be determined, the {@link name | name configuration} will be used.
241
- */
242
- organization?: string;
243
- /**
244
- * The date to use for compatibility checks
245
- *
246
- * @remarks
247
- * This date can be used by plugins and build processes to determine compatibility with certain features or APIs. It is recommended to set this date to the date when the project was last known to be compatible with the desired features or APIs.
248
- *
249
- * @see https://developers.cloudflare.com/pages/platform/compatibility-dates/
250
- * @see https://docs.netlify.com/configure-builds/get-started/#set-a-compatibility-date
251
- * @see https://github.com/unjs/compatx
252
- */
253
- compatibilityDate?: DateString;
254
- /**
255
- * The log level to use for the Powerlines processes.
256
- *
257
- * @defaultValue "info"
258
- */
259
- logLevel?: LogLevel | null;
260
- /**
261
- * A custom logger function to use for logging messages
262
- */
263
- customLogger?: LogFn;
264
- /**
265
- * Explicitly set a mode to run in. This mode will be used at various points throughout the Powerlines processes, such as when compiling the source code.
266
- *
267
- * @defaultValue "production"
268
- */
269
- mode?: "development" | "test" | "production";
270
- /**
271
- * The type of project being built
272
- *
273
- * @defaultValue "application"
274
- */
275
- type?: ProjectType;
276
- /**
277
- * The root directory of the project
278
- */
279
- root: string;
280
- /**
281
- * The root directory of the project's source code
282
- *
283
- * @defaultValue "\{root\}/src"
284
- */
285
- sourceRoot?: string;
286
- /**
287
- * A path to a custom configuration file to be used instead of the default `storm.json`, `powerlines.config.js`, or `powerlines.config.ts` files.
288
- *
289
- * @remarks
290
- * This option is useful for running Powerlines commands with different configuration files, such as in CI/CD environments or when testing different configurations.
291
- */
292
- configFile?: string;
293
- /**
294
- * Should the Powerlines processes automatically install missing package dependencies?
295
- *
296
- * @remarks
297
- * When set to `true`, Powerlines will attempt to install any missing dependencies using the package manager detected in the project (e.g., npm, yarn, pnpm). This can be useful for ensuring that all required packages are available during the build and preparation phases.
298
- *
299
- * @defaultValue false
300
- */
301
- autoInstall?: boolean;
302
- /**
303
- * Should the compiler processes skip any improvements that make use of cache?
304
- *
305
- * @defaultValue false
306
- */
307
- skipCache?: boolean;
308
- /**
309
- * A list of resolvable paths to plugins used during the build process
310
- */
311
- plugins?: PluginConfig<any>[];
312
- /**
313
- * Environment-specific configurations
314
- */
315
- environments?: Record<string, EnvironmentConfig>;
316
- /**
317
- * Should a single `build` process be ran for each environment?
318
- *
319
- * @remarks
320
- * This option determines how environments are managed during the `build` process. The available options are:
321
- *
322
- * - `false`: A separate build is ran for each environment.
323
- * - `true`: A single build is ran for all environments.
324
- *
325
- * @defaultValue false
326
- */
327
- singleBuild?: boolean;
328
- /**
329
- * A string identifier that allows a child framework or tool to identify itself when using Powerlines.
330
- *
331
- * @remarks
332
- * If no values are provided for {@link OutputConfig.dts | output.dts} or {@link OutputConfig.artifactsPath | output.artifactsFolder}, this value will be used as the default.
333
- *
334
- * @defaultValue "powerlines"
335
- */
336
- framework?: string;
337
- }
338
- interface UserConfig$1<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> extends Omit<CommonUserConfig, "build"> {
339
- /**
340
- * Configuration provided to build processes
341
- *
342
- * @remarks
343
- * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
344
- */
345
- build: Omit<TBuildConfig, "override"> & {
346
- /**
347
- * The build variant being used by the Powerlines engine.
348
- */
349
- variant?: TBuildVariant;
350
- /**
351
- * An optional set of override options to apply to the selected build variant.
352
- *
353
- * @remarks
354
- * This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
355
- */
356
- override?: Partial<TBuildResolvedConfig>;
357
- };
358
- }
359
- type WebpackUserConfig = UserConfig$1<WebpackBuildConfig, WebpackResolvedBuildConfig, "webpack">;
360
- type RspackUserConfig = UserConfig$1<RspackBuildConfig, RspackResolvedBuildConfig, "rspack">;
361
- type RollupUserConfig = UserConfig$1<RollupBuildConfig, RollupResolvedBuildConfig, "rollup">;
362
- type RolldownUserConfig = UserConfig$1<RolldownBuildConfig, RolldownResolvedBuildConfig, "rolldown">;
363
- type ViteUserConfig = UserConfig$1<ViteBuildConfig, ViteResolvedBuildConfig, "vite">;
364
- type ESBuildUserConfig = UserConfig$1<ESBuildBuildConfig, ESBuildResolvedBuildConfig, "esbuild">;
365
- type UnbuildUserConfig = UserConfig$1<UnbuildBuildConfig, UnbuildResolvedBuildConfig, "unbuild">;
366
- type TsupUserConfig = UserConfig$1<TsupBuildConfig, TsupResolvedBuildConfig, "tsup">;
367
- type TsdownUserConfig = UserConfig$1<TsdownBuildConfig, TsdownResolvedBuildConfig, "tsdown">;
368
- type FarmUserConfig = UserConfig$1<FarmBuildConfig, FarmResolvedBuildConfig, "farm">;
369
- type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
370
- /**
371
- * The configuration provided while executing Powerlines commands.
372
- */
373
- type InlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Partial<TUserConfig> & {
374
- /**
375
- * A string identifier for the Powerlines command being executed
376
- */
377
- command: PowerlinesCommand;
378
- };
379
- type NewInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & Required<Pick<InlineConfig<TUserConfig>, "root">> & {
380
- /**
381
- * A string identifier for the Powerlines command being executed
382
- */
383
- command: "new";
384
- /**
385
- * The package name (from the \`package.json\`) for the project that will be used in the \`new\` command to create a new project based on this configuration
386
- */
387
- packageName?: string;
388
- };
389
- type CleanInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & {
390
- /**
391
- * A string identifier for the Powerlines command being executed
392
- */
393
- command: "clean";
394
- };
395
- type PrepareInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & {
396
- /**
397
- * A string identifier for the Powerlines command being executed
398
- */
399
- command: "prepare";
400
- };
401
- type BuildInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & {
402
- /**
403
- * A string identifier for the Powerlines command being executed
404
- */
405
- command: "build";
406
- };
407
- type LintInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & {
408
- /**
409
- * A string identifier for the Powerlines command being executed
410
- */
411
- command: "lint";
412
- };
413
- type DocsInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & {
414
- /**
415
- * A string identifier for the Powerlines command being executed
416
- */
417
- command: "docs";
418
- };
419
- type DeployInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & {
420
- /**
421
- * A string identifier for the Powerlines command being executed
422
- */
423
- command: "deploy";
424
- };
425
- //#endregion
426
- export { 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$1 as UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig };
@@ -1,29 +0,0 @@
1
- //#region ../powerlines/src/types/config.ts
2
- const __ΩPartial = [
3
- "T",
4
- "Partial",
5
- "l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
6
- ];
7
- const __ΩRequired = [
8
- "T",
9
- "Required",
10
- "l+e#!e\"!fRb!Pde\"!gN##w\"y"
11
- ];
12
- const __ΩPick = [
13
- "T",
14
- "K",
15
- "Pick",
16
- "l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
17
- ];
18
- const __ΩWorkspaceConfig = [
19
- () => __ΩPartial,
20
- "StormWorkspaceConfig",
21
- () => __ΩRequired,
22
- () => __ΩPick,
23
- "workspaceRoot",
24
- "WorkspaceConfig",
25
- "P\"w\"o!\"\"w\".%o$#o#\"Kw&y"
26
- ];
27
-
28
- //#endregion
29
- export { __ΩWorkspaceConfig };