@powerlines/plugin-tsdown 0.1.243 → 0.1.244

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 (117) hide show
  1. package/dist/core/src/lib/logger.mjs +40 -0
  2. package/dist/core/src/lib/logger.mjs.map +1 -0
  3. package/dist/core/src/lib/unplugin/helpers.mjs +19 -0
  4. package/dist/core/src/lib/unplugin/helpers.mjs.map +1 -0
  5. package/dist/core/src/lib/unplugin/index.mjs +5 -0
  6. package/dist/core/src/lib/unplugin/module-resolution.mjs +66 -0
  7. package/dist/core/src/lib/unplugin/module-resolution.mjs.map +1 -0
  8. package/dist/core/src/lib/unplugin/plugin.mjs +71 -0
  9. package/dist/core/src/lib/unplugin/plugin.mjs.map +1 -0
  10. package/dist/core/src/lib/utilities/format.mjs +29 -0
  11. package/dist/core/src/lib/utilities/format.mjs.map +1 -0
  12. package/dist/core/src/lib/utilities/source-file.mjs +21 -0
  13. package/dist/core/src/lib/utilities/source-file.mjs.map +1 -0
  14. package/dist/core/src/plugin-utils/build-helpers.mjs +35 -0
  15. package/dist/core/src/plugin-utils/build-helpers.mjs.map +1 -0
  16. package/dist/core/src/plugin-utils/context-helpers.mjs +4 -0
  17. package/dist/core/src/plugin-utils/extend.mjs +5 -0
  18. package/dist/core/src/plugin-utils/get-config-path.mjs +3 -0
  19. package/dist/core/src/plugin-utils/helpers.mjs +48 -0
  20. package/dist/core/src/plugin-utils/helpers.mjs.map +1 -0
  21. package/dist/core/src/plugin-utils/index.mjs +9 -0
  22. package/dist/core/src/plugin-utils/merge.mjs +47 -0
  23. package/dist/core/src/plugin-utils/merge.mjs.map +1 -0
  24. package/dist/core/src/plugin-utils/paths.mjs +4 -0
  25. package/dist/core/src/types/api.d.mts +103 -0
  26. package/dist/core/src/types/api.d.mts.map +1 -0
  27. package/dist/core/src/types/commands.d.mts +10 -0
  28. package/dist/core/src/types/commands.d.mts.map +1 -0
  29. package/dist/core/src/types/commands.mjs +16 -0
  30. package/dist/core/src/types/commands.mjs.map +1 -0
  31. package/dist/core/src/types/config.d.mts +551 -0
  32. package/dist/core/src/types/config.d.mts.map +1 -0
  33. package/dist/core/src/types/context.d.mts +511 -0
  34. package/dist/core/src/types/context.d.mts.map +1 -0
  35. package/dist/core/src/types/fs.d.mts +487 -0
  36. package/dist/core/src/types/fs.d.mts.map +1 -0
  37. package/dist/core/src/types/hooks.d.mts +99 -0
  38. package/dist/core/src/types/hooks.d.mts.map +1 -0
  39. package/dist/core/src/types/index.d.mts +9 -0
  40. package/dist/core/src/types/plugin.d.mts +204 -0
  41. package/dist/core/src/types/plugin.d.mts.map +1 -0
  42. package/dist/core/src/types/plugin.mjs +33 -0
  43. package/dist/core/src/types/plugin.mjs.map +1 -0
  44. package/dist/core/src/types/tsconfig.d.mts +70 -0
  45. package/dist/core/src/types/tsconfig.d.mts.map +1 -0
  46. package/dist/core/src/types/unplugin.d.mts +25 -0
  47. package/dist/core/src/types/unplugin.d.mts.map +1 -0
  48. package/dist/core/src/types/unplugin.mjs +22 -0
  49. package/dist/core/src/types/unplugin.mjs.map +1 -0
  50. package/dist/helpers/format-package-json.mjs +4 -4
  51. package/dist/helpers/format-package-json.mjs.map +1 -1
  52. package/dist/helpers/index.d.mts +3 -1
  53. package/dist/helpers/index.mjs +3 -1
  54. package/dist/helpers/resolve-options.d.mts +31 -0
  55. package/dist/helpers/resolve-options.d.mts.map +1 -0
  56. package/dist/helpers/resolve-options.mjs +124 -0
  57. package/dist/helpers/resolve-options.mjs.map +1 -0
  58. package/dist/helpers/unplugin.mjs +2 -1
  59. package/dist/helpers/unplugin.mjs.map +1 -1
  60. package/dist/index.d.mts +6 -2
  61. package/dist/index.d.mts.map +1 -1
  62. package/dist/index.mjs +6 -9
  63. package/dist/index.mjs.map +1 -1
  64. package/dist/types/build.d.mts +8 -0
  65. package/dist/types/build.d.mts.map +1 -0
  66. package/dist/types/build.mjs +1 -0
  67. package/dist/types/index.d.mts +2 -1
  68. package/dist/types/plugin.d.mts +11 -7
  69. package/dist/types/plugin.d.mts.map +1 -1
  70. package/package.json +28 -107
  71. package/dist/_virtual/rolldown_runtime.cjs +0 -29
  72. package/dist/helpers/format-package-json.cjs +0 -19
  73. package/dist/helpers/format-package-json.d.cts +0 -13
  74. package/dist/helpers/format-package-json.d.cts.map +0 -1
  75. package/dist/helpers/index.cjs +0 -3
  76. package/dist/helpers/index.d.cts +0 -2
  77. package/dist/helpers/unplugin.cjs +0 -11
  78. package/dist/helpers/unplugin.d.cts +0 -8
  79. package/dist/helpers/unplugin.d.cts.map +0 -1
  80. package/dist/index.cjs +0 -43
  81. package/dist/index.d.cts +0 -14
  82. package/dist/index.d.cts.map +0 -1
  83. package/dist/node_modules/.pnpm/@stryke_path@0.26.6/node_modules/@stryke/path/dist/is-type.cjs +0 -28
  84. package/dist/node_modules/.pnpm/@stryke_path@0.26.6/node_modules/@stryke/path/dist/is-type.mjs +0 -29
  85. package/dist/node_modules/.pnpm/@stryke_path@0.26.6/node_modules/@stryke/path/dist/is-type.mjs.map +0 -1
  86. package/dist/node_modules/.pnpm/@stryke_path@0.26.6/node_modules/@stryke/path/dist/join-paths.cjs +0 -122
  87. package/dist/node_modules/.pnpm/@stryke_path@0.26.6/node_modules/@stryke/path/dist/join-paths.mjs +0 -123
  88. package/dist/node_modules/.pnpm/@stryke_path@0.26.6/node_modules/@stryke/path/dist/join-paths.mjs.map +0 -1
  89. package/dist/node_modules/.pnpm/@stryke_path@0.26.6/node_modules/@stryke/path/dist/regex.cjs +0 -12
  90. package/dist/node_modules/.pnpm/@stryke_path@0.26.6/node_modules/@stryke/path/dist/regex.mjs +0 -9
  91. package/dist/node_modules/.pnpm/@stryke_path@0.26.6/node_modules/@stryke/path/dist/regex.mjs.map +0 -1
  92. package/dist/node_modules/.pnpm/@stryke_path@0.26.6/node_modules/@stryke/path/dist/slash.cjs +0 -15
  93. package/dist/node_modules/.pnpm/@stryke_path@0.26.6/node_modules/@stryke/path/dist/slash.mjs +0 -15
  94. package/dist/node_modules/.pnpm/@stryke_path@0.26.6/node_modules/@stryke/path/dist/slash.mjs.map +0 -1
  95. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-empty.cjs +0 -20
  96. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-empty.mjs +0 -21
  97. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-empty.mjs.map +0 -1
  98. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-null.cjs +0 -12
  99. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-null.mjs +0 -12
  100. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-null.mjs.map +0 -1
  101. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-set-string.cjs +0 -20
  102. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-set-string.mjs +0 -21
  103. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-set-string.mjs.map +0 -1
  104. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-set.cjs +0 -19
  105. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-set.mjs +0 -20
  106. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-set.mjs.map +0 -1
  107. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-string.cjs +0 -12
  108. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-string.mjs +0 -12
  109. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-string.mjs.map +0 -1
  110. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-undefined.cjs +0 -8
  111. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-undefined.mjs +0 -8
  112. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.25/node_modules/@stryke/type-checks/dist/is-undefined.mjs.map +0 -1
  113. package/dist/types/index.cjs +0 -0
  114. package/dist/types/index.d.cts +0 -2
  115. package/dist/types/plugin.cjs +0 -0
  116. package/dist/types/plugin.d.cts +0 -17
  117. package/dist/types/plugin.d.cts.map +0 -1
@@ -0,0 +1,551 @@
1
+ import { StoragePort, StoragePreset } from "./fs.mjs";
2
+ import { Plugin } from "./plugin.mjs";
3
+ import { TSConfig } from "./tsconfig.mjs";
4
+ import { PluginContext } from "./context.mjs";
5
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
6
+ import { Format } from "@storm-software/build-tools/types";
7
+ import { StormWorkspaceConfig } from "@storm-software/config/types";
8
+ import { MaybePromise, NonUndefined } from "@stryke/types/base";
9
+ import { TypeDefinition } from "@stryke/types/configuration";
10
+ import { AssetGlob } from "@stryke/types/file";
11
+ import { CompatibilityDateSpec, CompatibilityDates } from "compatx";
12
+ import { PreviewOptions, ResolvedPreviewOptions } from "vite";
13
+
14
+ //#region ../core/src/types/config.d.ts
15
+ type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
16
+ type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
17
+ /**
18
+ * The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
19
+ */
20
+ type WorkspaceConfig = Partial<StormWorkspaceConfig> & Required<Pick<StormWorkspaceConfig, "workspaceRoot">>;
21
+ type PluginFactory<in out TContext extends PluginContext = PluginContext, TOptions = any> = (options: TOptions) => MaybePromise<Plugin<TContext> | Plugin<TContext>[]>;
22
+ /**
23
+ * A configuration tuple for a Powerlines plugin.
24
+ */
25
+ type PluginConfigTuple<TContext extends PluginContext = PluginContext, TOptions = any> = [string | PluginFactory<TContext, TOptions>, TOptions] | [Plugin<TContext>];
26
+ /**
27
+ * A configuration object for a Powerlines plugin.
28
+ */
29
+ type PluginConfigObject<TContext extends PluginContext = PluginContext, TOptions = any> = {
30
+ plugin: string | PluginFactory<TContext, TOptions>;
31
+ options: TOptions;
32
+ } | {
33
+ plugin: Plugin<TContext>;
34
+ options?: never;
35
+ };
36
+ /**
37
+ * A configuration tuple for a Powerlines plugin.
38
+ */
39
+ type PluginConfig<TContext extends PluginContext = PluginContext> = string | PluginFactory<TContext, void> | Plugin<TContext> | PluginConfigTuple<TContext> | PluginConfigObject<TContext> | Promise<PluginConfig<TContext>> | PluginConfig<TContext>[];
40
+ type ProjectType = "application" | "library";
41
+ /**
42
+ * The configuration options for resolving modules in a Powerlines project.
43
+ */
44
+ interface ResolveConfig {
45
+ /**
46
+ * List of fields in `package.json` to try when resolving a package's entry point. Note this takes lower precedence than conditional exports resolved from the exports field: if an entry point is successfully resolved from exports, the main field will be ignored.
47
+ *
48
+ * @defaultValue `["browser", "module", "jsnext:main", "jsnext"]`
49
+ *
50
+ * @see https://vite.dev/config/shared-options#resolve-mainfields
51
+ */
52
+ mainFields?: string[];
53
+ /**
54
+ * Array of strings indicating what conditions should be allowed when resolving [conditional exports](https://nodejs.org/api/packages.html#packages_conditional_exports) from a package.
55
+ *
56
+ * @defaultValue `["import", "require", "default"]`
57
+ *
58
+ * @see https://vite.dev/config/shared-options#resolve-conditions
59
+ */
60
+ conditions?: string[];
61
+ /**
62
+ * List of file extensions to try for imports that omit extensions. Note it is NOT recommended to omit extensions for custom import types (e.g. .vue) since it can interfere with IDE and type support.
63
+ *
64
+ * @defaultValue `[".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"]`
65
+ *
66
+ * @see https://vite.dev/config/shared-options#resolve-extensions
67
+ */
68
+ extensions?: string[];
69
+ /**
70
+ * Array of strings indicating what modules should be deduplicated to a single version in the build.
71
+ *
72
+ * @remarks
73
+ * This option is useful for ensuring that only one version of a module is included in the bundle, which can help reduce bundle size and avoid conflicts. If you have duplicated copies of the same dependency in your app (likely due to hoisting or linked packages in monorepos), use this option to force Powerlines to always resolve listed dependencies to the same copy (from project root).
74
+ *
75
+ * @see https://vite.dev/config/shared-options#resolve-dedupe
76
+ */
77
+ dedupe?: string[];
78
+ /**
79
+ * The alias mappings to use for module resolution during the build process.
80
+ *
81
+ * @remarks
82
+ * This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * {
87
+ * alias: {
88
+ * "@utils": "./src/utils",
89
+ * "@components": "./src/components"
90
+ * }
91
+ * }
92
+ * ```
93
+ *
94
+ * @see https://vite.dev/config/shared-options#resolve-alias
95
+ * @see https://github.com/rollup/plugins/tree/master/packages/alias
96
+ */
97
+ alias?: Record<string, string> | Array<{
98
+ find: string | RegExp;
99
+ replacement: string;
100
+ }>;
101
+ /**
102
+ * Enabling this setting causes Powerlines to determine file identity by the original file path (i.e. the path without following symlinks) instead of the real file path (i.e. the path after following symlinks).
103
+ *
104
+ * @defaultValue false
105
+ *
106
+ * @see https://esbuild.github.io/api/#preserve-symlinks
107
+ * @see https://rollupjs.org/configuration-options/#preservesymlinks
108
+ * @see https://webpack.js.org/configuration/resolve/#resolvesymlinks
109
+ * @see https://rolldown.rs/reference/InputOptions.resolve#symlinks
110
+ * @see https://vite.dev/config/shared-options#resolve-preservesymlinks
111
+ */
112
+ preserveSymlinks?: boolean;
113
+ /**
114
+ * A list of modules that should not be bundled, even if they are external dependencies.
115
+ *
116
+ * @remarks
117
+ * This option is useful for excluding specific modules from the bundle, such as Node.js built-in modules or other libraries that should not be bundled.
118
+ */
119
+ external?: (string | RegExp)[];
120
+ /**
121
+ * A list of modules that should always be bundled, even if they are external dependencies.
122
+ */
123
+ noExternal?: (string | RegExp)[];
124
+ /**
125
+ * Should the Powerlines CLI processes skip bundling the `node_modules` directory?
126
+ */
127
+ skipNodeModulesBundle?: boolean;
128
+ }
129
+ interface OutputConfig {
130
+ /**
131
+ * The path to output the final compiled files to
132
+ *
133
+ * @remarks
134
+ * If a value is not provided, Powerlines will attempt to:
135
+ * 1. Use the `outDir` value in the `tsconfig.json` file.
136
+ * 2. Use the `dist` directory in the project root directory.
137
+ *
138
+ * @defaultValue "dist/\{projectRoot\}"
139
+ */
140
+ outputPath?: string;
141
+ /**
142
+ * The output directory path for the project build.
143
+ *
144
+ * @remarks
145
+ * 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.
146
+ *
147
+ * @defaultValue "\{projectRoot\}/dist"
148
+ */
149
+ buildPath?: string;
150
+ /**
151
+ * The folder where the generated runtime artifacts will be located
152
+ *
153
+ * @remarks
154
+ * This folder will contain all runtime artifacts and builtins generated during the "prepare" phase.
155
+ *
156
+ * @defaultValue "\{projectRoot\}/.powerlines"
157
+ */
158
+ artifactsPath?: string;
159
+ /**
160
+ * The path of the generated runtime declaration file relative to the workspace root.
161
+ *
162
+ * @defaultValue "\{projectRoot\}/powerlines.d.ts"
163
+ */
164
+ dts?: string | false;
165
+ /**
166
+ * The module format of the output files
167
+ *
168
+ * @remarks
169
+ * 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.
170
+ *
171
+ * @defaultValue "esm"
172
+ */
173
+ format?: Format | Format[];
174
+ /**
175
+ * Generate source maps for the output files
176
+ *
177
+ * @remarks
178
+ * This option can be a boolean or a string specifying the type of source map to generate. If set to `true`, external source maps will be generated. If set to `"inline"`, source maps will be included in the output files as data URIs. If set to `"hidden"`, external source maps will be generated but not referenced in the output files.
179
+ */
180
+ sourceMap?: boolean | "inline" | "hidden";
181
+ /**
182
+ * A list of assets to copy to the output directory
183
+ *
184
+ * @remarks
185
+ * 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.
186
+ */
187
+ assets?: Array<string | AssetGlob>;
188
+ /**
189
+ * A string preset or a custom {@link StoragePort} to provide fine-grained control over generated/output file storage.
190
+ *
191
+ * @remarks
192
+ * If a string preset is provided, it must be one of the following values:
193
+ * - `"virtual"`: Uses the local file system for storage.
194
+ * - `"fs"`: Uses an in-memory virtual file system for storage.
195
+ *
196
+ * If a custom {@link StoragePort} is provided, it will be used for all file storage operations during the build process.
197
+ *
198
+ * @defaultValue "virtual"
199
+ */
200
+ storage?: StoragePort | StoragePreset;
201
+ }
202
+ interface BaseConfig {
203
+ /**
204
+ * Defines entries and location(s) of entry modules for the bundle. Relative paths are resolved based on the `root` option.
205
+ */
206
+ input: string | RegExp | TypeDefinition | (string | RegExp | TypeDefinition)[] | Record<string, string | RegExp | TypeDefinition | (string | RegExp | TypeDefinition)[]>;
207
+ /**
208
+ * Configuration for the output files generated by processing the source code
209
+ */
210
+ output?: OutputConfig;
211
+ /**
212
+ * Configuration for module resolution during processing of the source code
213
+ */
214
+ resolve?: ResolveConfig;
215
+ /**
216
+ * The platform to build the project for
217
+ *
218
+ * @defaultValue "neutral"
219
+ */
220
+ platform?: "node" | "browser" | "neutral";
221
+ /**
222
+ * Define global constant replacements. Entries will be defined as globals during dev and statically replaced during build.
223
+ *
224
+ * @remarks
225
+ * This option allows you to specify global constants that will be replaced in the code during the build process. It is similar to the `define` option in esbuild and Vite, enabling you to replace specific identifiers with constant expressions at build time.
226
+ *
227
+ * @example
228
+ * ```ts
229
+ * {
230
+ * define: {
231
+ * __VERSION__: '"1.0.0"',
232
+ * __DEV__: 'process.env.NODE_ENV !== "production"'
233
+ * }
234
+ * }
235
+ * ```
236
+ *
237
+ * @see https://esbuild.github.io/api/#define
238
+ * @see https://vitejs.dev/config/build-options.html#define
239
+ * @see https://github.com/rollup/plugins/tree/master/packages/replace
240
+ */
241
+ define?: Record<string, any>;
242
+ /**
243
+ * Global variables that will have import statements injected where necessary
244
+ *
245
+ * @remarks
246
+ * This option allows you to specify global variables that should be automatically imported from specified modules whenever they are used in the code. This is particularly useful for polyfilling Node.js globals in a browser environment.
247
+ *
248
+ * @example
249
+ * ```ts
250
+ * {
251
+ * inject: {
252
+ * process: 'process/browser',
253
+ * Buffer: ['buffer', 'Buffer'],
254
+ * }
255
+ * }
256
+ * ```
257
+ *
258
+ * @see https://github.com/rollup/plugins/tree/master/packages/inject
259
+ */
260
+ inject?: Record<string, string | string[]>;
261
+ /**
262
+ * The path to the tsconfig file to be used by the compiler
263
+ *
264
+ * @remarks
265
+ * 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).
266
+ *
267
+ * @defaultValue "\{projectRoot\}/tsconfig.json"
268
+ */
269
+ tsconfig?: string;
270
+ /**
271
+ * The raw {@link TSConfig} object to be used by the compiler. This object will be merged with the `tsconfig.json` file.
272
+ *
273
+ * @see https://www.typescriptlang.org/tsconfig
274
+ *
275
+ * @remarks
276
+ * If populated, this option takes higher priority than `tsconfig`
277
+ */
278
+ tsconfigRaw?: TSConfig;
279
+ }
280
+ interface EnvironmentConfig extends BaseConfig {
281
+ /**
282
+ * Configuration options for the preview server
283
+ */
284
+ preview?: PreviewOptions;
285
+ /**
286
+ * A flag indicating whether the build is for a Server-Side Rendering environment.
287
+ */
288
+ ssr?: boolean;
289
+ /**
290
+ * Define if this environment is used for Server-Side Rendering
291
+ *
292
+ * @defaultValue "server" (if it isn't the client environment)
293
+ */
294
+ consumer?: "client" | "server";
295
+ }
296
+ interface UserConfig extends BaseConfig {
297
+ /**
298
+ * The root directory of the project
299
+ */
300
+ root: string;
301
+ /**
302
+ * The name of the project
303
+ */
304
+ name?: string;
305
+ /**
306
+ * The project display title
307
+ *
308
+ * @remarks
309
+ * This option is used in documentation generation and other places where a human-readable title is needed.
310
+ */
311
+ title?: string;
312
+ /**
313
+ * A description of the project
314
+ *
315
+ * @remarks
316
+ * If this option is not provided, the build process will try to use the \`description\` value from the `\package.json\` file.
317
+ */
318
+ description?: string;
319
+ /**
320
+ * The organization or author of the project
321
+ *
322
+ * @remarks
323
+ * 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.
324
+ */
325
+ organization?: string;
326
+ /**
327
+ * The date to use for compatibility checks
328
+ *
329
+ * @remarks
330
+ * 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. If no value is provided, the latest compatibility date will be used.
331
+ *
332
+ * @see https://developers.cloudflare.com/pages/platform/compatibility-dates/
333
+ * @see https://docs.netlify.com/configure-builds/get-started/#set-a-compatibility-date
334
+ * @see https://github.com/unjs/compatx
335
+ */
336
+ compatibilityDate?: CompatibilityDateSpec;
337
+ /**
338
+ * The log level to use for the Powerlines processes.
339
+ *
340
+ * @defaultValue "info"
341
+ */
342
+ logLevel?: LogLevel | null;
343
+ /**
344
+ * A custom logger function to use for logging messages
345
+ */
346
+ customLogger?: LogFn;
347
+ /**
348
+ * 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.
349
+ *
350
+ * @defaultValue "production"
351
+ */
352
+ mode?: "development" | "test" | "production";
353
+ /**
354
+ * The type of project being built
355
+ *
356
+ * @defaultValue "application"
357
+ */
358
+ projectType?: ProjectType;
359
+ /**
360
+ * A path to a custom configuration file to be used instead of the default `storm.json`, `powerlines.config.js`, or `powerlines.config.ts` files.
361
+ *
362
+ * @remarks
363
+ * This option is useful for running Powerlines commands with different configuration files, such as in CI/CD environments or when testing different configurations.
364
+ */
365
+ configFile?: string;
366
+ /**
367
+ * Should the Powerlines processes automatically install missing package dependencies?
368
+ *
369
+ * @remarks
370
+ * 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.
371
+ *
372
+ * @defaultValue false
373
+ */
374
+ autoInstall?: boolean;
375
+ /**
376
+ * Should the compiler processes skip any improvements that make use of cache?
377
+ *
378
+ * @defaultValue false
379
+ */
380
+ skipCache?: boolean;
381
+ /**
382
+ * A list of resolvable paths to plugins used during the build process
383
+ */
384
+ plugins?: PluginConfig<any>[];
385
+ /**
386
+ * Environment-specific configurations
387
+ */
388
+ environments?: Record<string, EnvironmentConfig>;
389
+ /**
390
+ * Should a single `build` process be ran for each environment?
391
+ *
392
+ * @remarks
393
+ * This option determines how environments are managed during the `build` process. The available options are:
394
+ *
395
+ * - `false`: A separate build is ran for each environment.
396
+ * - `true`: A single build is ran for all environments.
397
+ *
398
+ * @defaultValue false
399
+ */
400
+ singleBuild?: boolean;
401
+ /**
402
+ * A string identifier that allows a child framework or tool to identify itself when using Powerlines.
403
+ *
404
+ * @remarks
405
+ * 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.
406
+ *
407
+ * @defaultValue "powerlines"
408
+ */
409
+ framework?: string;
410
+ }
411
+ type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
412
+ /**
413
+ * The configuration provided while executing Powerlines commands.
414
+ */
415
+ type InlineConfig<TUserConfig extends UserConfig = UserConfig> = Partial<TUserConfig> & {
416
+ /**
417
+ * A string identifier for the Powerlines command being executed
418
+ */
419
+ command: PowerlinesCommand;
420
+ };
421
+ type NewInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig> & Required<Pick<InlineConfig<TUserConfig>, "root">> & {
422
+ /**
423
+ * A string identifier for the Powerlines command being executed
424
+ */
425
+ command: "new";
426
+ /**
427
+ * 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
428
+ */
429
+ packageName?: string;
430
+ };
431
+ type CleanInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig> & {
432
+ /**
433
+ * A string identifier for the Powerlines command being executed
434
+ */
435
+ command: "clean";
436
+ };
437
+ type PrepareInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig> & {
438
+ /**
439
+ * A string identifier for the Powerlines command being executed
440
+ */
441
+ command: "prepare";
442
+ };
443
+ type BuildInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig> & {
444
+ /**
445
+ * A string identifier for the Powerlines command being executed
446
+ */
447
+ command: "build";
448
+ };
449
+ type LintInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig> & {
450
+ /**
451
+ * A string identifier for the Powerlines command being executed
452
+ */
453
+ command: "lint";
454
+ };
455
+ type DocsInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig> & {
456
+ /**
457
+ * A string identifier for the Powerlines command being executed
458
+ */
459
+ command: "docs";
460
+ };
461
+ type DeployInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig> & {
462
+ /**
463
+ * A string identifier for the Powerlines command being executed
464
+ */
465
+ command: "deploy";
466
+ };
467
+ interface ResolvedEntryTypeDefinition extends TypeDefinition {
468
+ /**
469
+ * The user provided entry point in the source code
470
+ */
471
+ input?: TypeDefinition;
472
+ /**
473
+ * An optional name to use in the package export during the build process
474
+ */
475
+ output?: string;
476
+ }
477
+ type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "ssr">> & {
478
+ /**
479
+ * The name of the environment
480
+ */
481
+ name: string;
482
+ /**
483
+ * Configuration options for the preview server
484
+ */
485
+ preview?: ResolvedPreviewOptions;
486
+ };
487
+ /**
488
+ * The configuration options for resolving modules in a Powerlines project.
489
+ */
490
+ type ResolveResolvedConfig = Required<Omit<ResolveConfig, "external" | "noExternal">> & {
491
+ /**
492
+ * A list of modules that should not be bundled, even if they are external dependencies.
493
+ *
494
+ * @remarks
495
+ * This option is useful for excluding specific modules from the bundle, such as Node.js built-in modules or other libraries that should not be bundled.
496
+ */
497
+ external?: string[];
498
+ /**
499
+ * A list of modules that should always be bundled, even if they are external dependencies.
500
+ */
501
+ noExternal?: string[];
502
+ };
503
+ type ResolvedAssetGlob = AssetGlob & Required<Pick<AssetGlob, "input">>;
504
+ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> & {
505
+ assets: ResolvedAssetGlob[];
506
+ }> & Pick<OutputConfig, "storage">;
507
+ /**
508
+ * The resolved options for the Powerlines project configuration.
509
+ */
510
+ type ResolvedConfig$1<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "root" | "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "tsconfig" | "platform" | "projectType" | "input" | "output" | "resolve" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "root" | "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "input" | "tsconfig" | "platform" | "projectType" | "framework">> & {
511
+ /**
512
+ * The output configuration options to use for the build process
513
+ */
514
+ output: OutputResolvedConfig;
515
+ /**
516
+ * Configuration for module resolution during processing of the source code
517
+ */
518
+ resolve: ResolveResolvedConfig;
519
+ /**
520
+ * The date to use for compatibility checks
521
+ *
522
+ * @remarks
523
+ * 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.
524
+ *
525
+ * @see https://developers.cloudflare.com/pages/platform/compatibility-dates/
526
+ * @see https://docs.netlify.com/configure-builds/get-started/#set-a-compatibility-date
527
+ * @see https://github.com/unjs/compatx
528
+ */
529
+ compatibilityDate: CompatibilityDates;
530
+ /**
531
+ * The configuration options that were provided inline to the Powerlines CLI.
532
+ */
533
+ inlineConfig: InlineConfig<TUserConfig>;
534
+ /**
535
+ * The original configuration options that were provided by the user to the Powerlines process.
536
+ */
537
+ userConfig: TUserConfig;
538
+ /**
539
+ * A string identifier for the Powerlines command being executed.
540
+ */
541
+ command: NonUndefined<InlineConfig<TUserConfig>["command"]>;
542
+ /**
543
+ * The log level to use for the Powerlines processes.
544
+ *
545
+ * @defaultValue "info"
546
+ */
547
+ logLevel: LogLevel | null;
548
+ };
549
+ //#endregion
550
+ export { BaseConfig, BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, NewInlineConfig, OutputConfig, OutputResolvedConfig, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig$1 as ResolvedConfig, ResolvedEntryTypeDefinition, UserConfig, WorkspaceConfig };
551
+ //# sourceMappingURL=config.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.mts","names":[],"sources":["../../../../../core/src/types/config.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;KAyCY,QAAA;AAAA,KAEA,KAAA,GAFQ,CAAA,IAAA,EAEO,aAFP,EAAA,GAAA,IAAA,EAAA,MAAA,EAAA,EAAA,GAAA,IAAA;AAEpB;AAKA;;AAA8B,KAAlB,eAAA,GAAkB,OAAA,CAAQ,oBAAR,CAAA,GAC5B,QAD4B,CACnB,IADmB,CACd,oBADc,EAAA,eAAA,CAAA,CAAA;AACd,KAEJ,aAFI,CAAA,wBAGU,aAHV,GAG0B,aAH1B,EAAA,WAAA,GAAA,CAAA,GAAA,CAAA,OAAA,EAKF,QALE,EAAA,GAKW,YALX,CAKwB,MALxB,CAK+B,QAL/B,CAAA,GAK2C,MAL3C,CAKkD,QALlD,CAAA,EAAA,CAAA;;;;AAEJ,KAQA,iBARa,CAAA,iBASN,aATM,GASU,aATV,EAAA,WAAA,GAAA,CAAA,GAAA,CAAA,MAAA,GAWX,aAXW,CAWG,QAXH,EAWa,QAXb,CAAA,EAWwB,QAXxB,CAAA,GAAA,CAWqC,MAXrC,CAW4C,QAX5C,CAAA,CAAA;;;;AAGsB,KAanC,kBAbmC,CAAA,iBAc5B,aAd4B,GAcZ,aA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