@powerlines/engine 0.15.0 → 0.15.2

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 (195) hide show
  1. package/dist/api/build.cjs +66 -0
  2. package/dist/api/build.d.cts +14 -0
  3. package/dist/api/build.d.cts.map +1 -0
  4. package/dist/api/build.d.mts +14 -0
  5. package/dist/api/build.d.mts.map +1 -0
  6. package/dist/api/build.mjs +64 -0
  7. package/dist/api/build.mjs.map +1 -0
  8. package/dist/api/clean.cjs +29 -0
  9. package/dist/api/clean.d.cts +14 -0
  10. package/dist/api/clean.d.cts.map +1 -0
  11. package/dist/api/clean.d.mts +14 -0
  12. package/dist/api/clean.d.mts.map +1 -0
  13. package/dist/api/clean.mjs +28 -0
  14. package/dist/api/clean.mjs.map +1 -0
  15. package/dist/api/create.cjs +59 -0
  16. package/dist/api/create.d.cts +14 -0
  17. package/dist/api/create.d.cts.map +1 -0
  18. package/dist/api/create.d.mts +14 -0
  19. package/dist/api/create.d.mts.map +1 -0
  20. package/dist/api/create.mjs +57 -0
  21. package/dist/api/create.mjs.map +1 -0
  22. package/dist/api/deploy.cjs +25 -0
  23. package/dist/api/deploy.d.cts +17 -0
  24. package/dist/api/deploy.d.cts.map +1 -0
  25. package/dist/api/deploy.d.mts +17 -0
  26. package/dist/api/deploy.d.mts.map +1 -0
  27. package/dist/api/deploy.mjs +24 -0
  28. package/dist/api/deploy.mjs.map +1 -0
  29. package/dist/api/docs.cjs +25 -0
  30. package/dist/api/docs.d.cts +17 -0
  31. package/dist/api/docs.d.cts.map +1 -0
  32. package/dist/api/docs.d.mts +17 -0
  33. package/dist/api/docs.d.mts.map +1 -0
  34. package/dist/api/docs.mjs +24 -0
  35. package/dist/api/docs.mjs.map +1 -0
  36. package/dist/api/lint.cjs +28 -0
  37. package/dist/api/lint.d.cts +17 -0
  38. package/dist/api/lint.d.cts.map +1 -0
  39. package/dist/api/lint.d.mts +17 -0
  40. package/dist/api/lint.d.mts.map +1 -0
  41. package/dist/api/lint.mjs +27 -0
  42. package/dist/api/lint.mjs.map +1 -0
  43. package/dist/api/prepare.cjs +69 -0
  44. package/dist/api/prepare.d.cts +14 -0
  45. package/dist/api/prepare.d.cts.map +1 -0
  46. package/dist/api/prepare.d.mts +14 -0
  47. package/dist/api/prepare.d.mts.map +1 -0
  48. package/dist/api/prepare.mjs +68 -0
  49. package/dist/api/prepare.mjs.map +1 -0
  50. package/dist/api/test.cjs +28 -0
  51. package/dist/api/test.d.cts +17 -0
  52. package/dist/api/test.d.cts.map +1 -0
  53. package/dist/api/test.d.mts +17 -0
  54. package/dist/api/test.d.mts.map +1 -0
  55. package/dist/api/test.mjs +27 -0
  56. package/dist/api/test.mjs.map +1 -0
  57. package/dist/api/types.cjs +71 -0
  58. package/dist/api/types.d.cts +17 -0
  59. package/dist/api/types.d.cts.map +1 -0
  60. package/dist/api/types.d.mts +17 -0
  61. package/dist/api/types.d.mts.map +1 -0
  62. package/dist/api/types.mjs +70 -0
  63. package/dist/api/types.mjs.map +1 -0
  64. package/dist/api-6w4hZL6n.d.cts +135 -0
  65. package/dist/api-6w4hZL6n.d.cts.map +1 -0
  66. package/dist/api-Cdw4v0W4.d.mts +135 -0
  67. package/dist/api-Cdw4v0W4.d.mts.map +1 -0
  68. package/dist/config-BNe23XHx.d.mts +204 -0
  69. package/dist/config-BNe23XHx.d.mts.map +1 -0
  70. package/dist/config-D6xUniHh.d.cts +204 -0
  71. package/dist/config-D6xUniHh.d.cts.map +1 -0
  72. package/dist/context/engine-context.cjs +175 -0
  73. package/dist/context/engine-context.d.cts +2 -0
  74. package/dist/context/engine-context.d.mts +2 -0
  75. package/dist/context/engine-context.mjs +173 -0
  76. package/dist/context/engine-context.mjs.map +1 -0
  77. package/dist/context/index.cjs +2 -9
  78. package/dist/context/index.d.cts +2 -660
  79. package/dist/context/index.d.mts +2 -660
  80. package/dist/context/index.mjs +2 -4
  81. package/dist/context-DzgsMSWr.d.mts +149 -0
  82. package/dist/context-DzgsMSWr.d.mts.map +1 -0
  83. package/dist/context-epL7NPvL.d.cts +149 -0
  84. package/dist/context-epL7NPvL.d.cts.map +1 -0
  85. package/dist/engine-context-DEotmVzB.d.mts +54 -0
  86. package/dist/engine-context-DEotmVzB.d.mts.map +1 -0
  87. package/dist/engine-context-Dw8odBCo.d.cts +54 -0
  88. package/dist/engine-context-Dw8odBCo.d.cts.map +1 -0
  89. package/dist/engine.cjs +268 -0
  90. package/dist/engine.d.cts +143 -0
  91. package/dist/engine.d.cts.map +1 -0
  92. package/dist/engine.d.mts +143 -0
  93. package/dist/engine.d.mts.map +1 -0
  94. package/dist/engine.mjs +264 -0
  95. package/dist/engine.mjs.map +1 -0
  96. package/dist/execution-host.cjs +44 -0
  97. package/dist/execution-host.d.cts +14 -0
  98. package/dist/execution-host.d.cts.map +1 -0
  99. package/dist/execution-host.d.mts +14 -0
  100. package/dist/execution-host.d.mts.map +1 -0
  101. package/dist/execution-host.mjs +36 -0
  102. package/dist/execution-host.mjs.map +1 -0
  103. package/dist/helpers/create-execution-host.cjs +51 -0
  104. package/dist/helpers/create-execution-host.d.cts +21 -0
  105. package/dist/helpers/create-execution-host.d.cts.map +1 -0
  106. package/dist/helpers/create-execution-host.d.mts +21 -0
  107. package/dist/helpers/create-execution-host.d.mts.map +1 -0
  108. package/dist/helpers/create-execution-host.mjs +50 -0
  109. package/dist/helpers/create-execution-host.mjs.map +1 -0
  110. package/dist/helpers/execution-host-worker.cjs +308 -0
  111. package/dist/helpers/execution-host-worker.d.cts +68 -0
  112. package/dist/helpers/execution-host-worker.d.cts.map +1 -0
  113. package/dist/helpers/execution-host-worker.d.mts +68 -0
  114. package/dist/helpers/execution-host-worker.d.mts.map +1 -0
  115. package/dist/helpers/execution-host-worker.mjs +307 -0
  116. package/dist/helpers/execution-host-worker.mjs.map +1 -0
  117. package/dist/helpers/finalize.cjs +27 -0
  118. package/dist/helpers/finalize.d.cts +12 -0
  119. package/dist/helpers/finalize.d.cts.map +1 -0
  120. package/dist/helpers/finalize.d.mts +12 -0
  121. package/dist/helpers/finalize.d.mts.map +1 -0
  122. package/dist/helpers/finalize.mjs +26 -0
  123. package/dist/helpers/finalize.mjs.map +1 -0
  124. package/dist/helpers/rpc.cjs +140 -0
  125. package/dist/helpers/rpc.d.cts +7 -0
  126. package/dist/helpers/rpc.d.cts.map +1 -0
  127. package/dist/helpers/rpc.d.mts +7 -0
  128. package/dist/helpers/rpc.d.mts.map +1 -0
  129. package/dist/helpers/rpc.mjs +139 -0
  130. package/dist/helpers/rpc.mjs.map +1 -0
  131. package/dist/index-CNgSR_kt.d.mts +1 -0
  132. package/dist/index-D_TYgLX3.d.cts +1 -0
  133. package/dist/index.cjs +13 -567
  134. package/dist/index.d.cts +9 -126
  135. package/dist/index.d.mts +9 -126
  136. package/dist/index.mjs +7 -567
  137. package/package.json +101 -129
  138. package/dist/_internal/worker.cjs +0 -4843
  139. package/dist/_internal/worker.d.cts +0 -38
  140. package/dist/_internal/worker.d.cts.map +0 -1
  141. package/dist/_internal/worker.d.mts +0 -38
  142. package/dist/_internal/worker.d.mts.map +0 -1
  143. package/dist/_internal/worker.mjs +0 -4804
  144. package/dist/_internal/worker.mjs.map +0 -1
  145. package/dist/api.cjs +0 -1274
  146. package/dist/api.d.cts +0 -265
  147. package/dist/api.d.cts.map +0 -1
  148. package/dist/api.d.mts +0 -265
  149. package/dist/api.d.mts.map +0 -1
  150. package/dist/api.mjs +0 -1270
  151. package/dist/api.mjs.map +0 -1
  152. package/dist/base-context-BUnL_9z8.mjs +0 -241
  153. package/dist/base-context-BUnL_9z8.mjs.map +0 -1
  154. package/dist/base-context-CFvO2N9I.cjs +0 -248
  155. package/dist/context/index.d.cts.map +0 -1
  156. package/dist/context/index.d.mts.map +0 -1
  157. package/dist/engine-context-BuD9AGfd.mjs +0 -41
  158. package/dist/engine-context-BuD9AGfd.mjs.map +0 -1
  159. package/dist/engine-context-NO6enYev.cjs +0 -45
  160. package/dist/execution-context-BgGV4xyW.cjs +0 -2614
  161. package/dist/execution-context-D_CXpe9I.mjs +0 -2570
  162. package/dist/execution-context-D_CXpe9I.mjs.map +0 -1
  163. package/dist/fs-D1nIP45P.mjs +0 -226
  164. package/dist/fs-D1nIP45P.mjs.map +0 -1
  165. package/dist/fs-XogSgMqT.cjs +0 -262
  166. package/dist/index.d.cts.map +0 -1
  167. package/dist/index.d.mts.map +0 -1
  168. package/dist/index.mjs.map +0 -1
  169. package/dist/schemas.cjs +0 -9
  170. package/dist/schemas.d.cts +0 -127
  171. package/dist/schemas.d.cts.map +0 -1
  172. package/dist/schemas.d.mts +0 -127
  173. package/dist/schemas.d.mts.map +0 -1
  174. package/dist/schemas.mjs +0 -3
  175. package/dist/storage/index.cjs +0 -9
  176. package/dist/storage/index.d.cts +0 -419
  177. package/dist/storage/index.d.cts.map +0 -1
  178. package/dist/storage/index.d.mts +0 -419
  179. package/dist/storage/index.d.mts.map +0 -1
  180. package/dist/storage/index.mjs +0 -3
  181. package/dist/ts-morph-BaLPVAdB.cjs +0 -114
  182. package/dist/ts-morph-D0CaA37w.mjs +0 -102
  183. package/dist/ts-morph-D0CaA37w.mjs.map +0 -1
  184. package/dist/tsconfig-Cstsoprg.mjs +0 -155
  185. package/dist/tsconfig-Cstsoprg.mjs.map +0 -1
  186. package/dist/tsconfig-DeyWQC2N.cjs +0 -198
  187. package/dist/typescript/index.cjs +0 -13
  188. package/dist/typescript/index.d.cts +0 -106
  189. package/dist/typescript/index.d.cts.map +0 -1
  190. package/dist/typescript/index.d.mts +0 -106
  191. package/dist/typescript/index.d.mts.map +0 -1
  192. package/dist/typescript/index.mjs +0 -4
  193. package/dist/virtual-BNdKVkRw.cjs +0 -548
  194. package/dist/virtual-gIlTc3Lj.mjs +0 -513
  195. package/dist/virtual-gIlTc3Lj.mjs.map +0 -1
@@ -1,660 +1,2 @@
1
- import { BaseContext, Context, EmitEntryOptions, EmitOptions, EngineContext, EngineOptions, EnvironmentContext, EnvironmentContextPlugin, EnvironmentResolvedConfig, ExecutionContext, ExecutionOptions, FetchOptions, HooksList, InlineConfig, LogFn, LogLevel, Logger, MetaInfo, ParseOptions, ParsedTypeScriptConfig, ParsedUserConfig, Plugin, PluginContext, ResolveOptions, ResolveResult, ResolvedConfig, ResolvedEngineOptions, ResolvedEntryTypeDefinition, ResolvedExecutionOptions, Resolver, SelectHookResult, SelectHooksOptions, TransformResult, VirtualFile, VirtualFileSystemInterface } from "@powerlines/core";
2
- import { EnvPaths } from "@stryke/env/get-env-paths";
3
- import { UnpluginMessage } from "unplugin";
4
- import { Unstable_ContextInternal, Unstable_EnvironmentContext, Unstable_PluginContext } from "@powerlines/core/types/_internal";
5
- import { PackageJson } from "@stryke/types/package-json";
6
- import { FlatCache } from "flat-cache";
7
- import { ParseResult } from "oxc-parser";
8
- import { Range } from "semver";
9
- import { RequestInfo, Response } from "undici";
10
-
11
- //#region src/context/base-context.d.ts
12
- declare class PowerlinesBaseContext implements BaseContext {
13
- #private;
14
- /**
15
- * The path to the Powerlines package
16
- */
17
- powerlinesPath: string;
18
- /**
19
- * The module resolver for the project
20
- */
21
- resolver: Resolver;
22
- /**
23
- * The options provided to the Powerlines process
24
- */
25
- options: ResolvedEngineOptions;
26
- /**
27
- * The parsed configuration file for the project
28
- */
29
- configFile: ParsedUserConfig;
30
- /**
31
- * A timestamp representing when the context was initialized
32
- */
33
- get timestamp(): Date;
34
- get logLevel(): LogLevel | null;
35
- set logLevel(level: LogLevel | null);
36
- /**
37
- * The logger function
38
- */
39
- get log(): LogFn;
40
- /**
41
- * The environment paths for the project
42
- */
43
- get envPaths(): EnvPaths;
44
- /**
45
- * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
46
- *
47
- * @remarks
48
- * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
49
- *
50
- * @returns A promise that resolves to the cloned context.
51
- */
52
- clone(): Promise<BaseContext>;
53
- /**
54
- * A logging function for fatal messages
55
- *
56
- * @param message - The message to log.
57
- */
58
- fatal(message: string | UnpluginMessage): void;
59
- /**
60
- * A logging function for error messages
61
- *
62
- * @param message - The message to log.
63
- */
64
- error(message: string | UnpluginMessage): void;
65
- /**
66
- * A logging function for warning messages
67
- *
68
- * @param message - The message to log.
69
- */
70
- warn(message: string | UnpluginMessage): void;
71
- /**
72
- * A logging function for informational messages
73
- *
74
- * @param message - The message to log.
75
- */
76
- info(message: string | UnpluginMessage): void;
77
- /**
78
- * A logging function for debug messages
79
- *
80
- * @param message - The message to log.
81
- */
82
- debug(message: string | UnpluginMessage): void;
83
- /**
84
- * A logging function for trace messages
85
- *
86
- * @param message - The message to log.
87
- */
88
- trace(message: string | UnpluginMessage): void;
89
- /**
90
- * A function to create a timer for measuring the duration of asynchronous operations
91
- *
92
- * @example
93
- * ```ts
94
- * const stopTimer = context.timer("Your Async Operation");
95
- * await performAsyncOperation();
96
- * stopTimer(); // "Your Async Operation completed in 123.45 milliseconds"
97
- * ```
98
- *
99
- * @param name - The name of the timer.
100
- * @returns A function that, when called, stops the timer and logs the duration.
101
- */
102
- timer(name: string): () => void;
103
- /**
104
- * Create a new logger instance
105
- *
106
- * @param name - The name to use for the logger instance
107
- * @returns A logger function
108
- */
109
- createLog(name?: string | null): LogFn;
110
- /**
111
- * Extend the current logger instance with a new name
112
- *
113
- * @param name - The name to use for the extended logger instance
114
- * @returns A logger function
115
- */
116
- extendLog(name: string): LogFn;
117
- /**
118
- * A logger function specific to this context
119
- */
120
- protected logger: Logger;
121
- /**
122
- * Initialize the context with the provided configuration options
123
- *
124
- * @remarks
125
- * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.
126
- *
127
- * @param options - The configuration options to initialize the context with
128
- */
129
- protected init(options?: Partial<EngineOptions>): Promise<void>;
130
- }
131
- //#endregion
132
- //#region src/context/context.d.ts
133
- declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PowerlinesBaseContext implements Context<TResolvedConfig> {
134
- #private;
135
- /**
136
- * Create a new Storm context from the workspace root and user config.
137
- *
138
- * @param options - The options for resolving the context.
139
- * @returns A promise that resolves to the new context.
140
- */
141
- static fromOptions<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(options: ResolvedExecutionOptions): Promise<Context<TResolvedConfig>>;
142
- /**
143
- * The options provided to the Powerlines process
144
- */
145
- options: ResolvedExecutionOptions;
146
- /**
147
- * An object containing the dependencies that should be installed for the project
148
- */
149
- dependencies: Record<string, string | Range>;
150
- /**
151
- * An object containing the development dependencies that should be installed for the project
152
- */
153
- devDependencies: Record<string, string | Range>;
154
- /**
155
- * The persisted meta information about the current build
156
- */
157
- persistedMeta: MetaInfo | undefined;
158
- /**
159
- * The parsed `package.json` file for the project
160
- */
161
- packageJson: PackageJson;
162
- /**
163
- * The parsed `project.json` file for the project
164
- */
165
- projectJson: Record<string, any> | undefined;
166
- /**
167
- * The resolved tsconfig file paths for the project
168
- */
169
- resolvePatterns: RegExp[];
170
- /**
171
- * Internal context fields and methods
172
- *
173
- * @danger
174
- * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
175
- *
176
- * @internal
177
- */
178
- get $$internal(): Unstable_ContextInternal<TResolvedConfig>;
179
- /**
180
- * Internal context fields and methods
181
- *
182
- * @danger
183
- * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
184
- *
185
- * @internal
186
- */
187
- set $$internal(value: Unstable_ContextInternal<TResolvedConfig>);
188
- /**
189
- * The resolved entry type definitions for the project
190
- */
191
- get entry(): ResolvedEntryTypeDefinition[];
192
- /**
193
- * The TypeScript configuration parsed from the tsconfig file
194
- */
195
- get tsconfig(): ParsedTypeScriptConfig;
196
- /**
197
- * Sets the TypeScript configuration parsed from the tsconfig file
198
- */
199
- set tsconfig(value: ParsedTypeScriptConfig);
200
- /**
201
- * The virtual file system interface for the project
202
- */
203
- get fs(): VirtualFileSystemInterface;
204
- /**
205
- * Get the checksum of the project's current state
206
- */
207
- get checksum(): string | null;
208
- /**
209
- * The meta information about the current build
210
- */
211
- get meta(): MetaInfo;
212
- /**
213
- * The resolved configuration options
214
- */
215
- get config(): TResolvedConfig;
216
- /**
217
- * Get the path to the artifacts directory for the project
218
- */
219
- get artifactsPath(): string;
220
- /**
221
- * Get the path to the builtin modules used by the project
222
- */
223
- get builtinsPath(): string;
224
- /**
225
- * Get the path to the entry directory for the project
226
- */
227
- get entryPath(): string;
228
- /**
229
- * Get the path to the infrastructure modules used by the project
230
- */
231
- get infrastructurePath(): string;
232
- /**
233
- * Get the path to the data directory for the project
234
- */
235
- get dataPath(): string;
236
- /**
237
- * Get the path to the cache directory for the project
238
- */
239
- get cachePath(): string;
240
- /**
241
- * Get the path to the generated declaration file for the project
242
- */
243
- get typesPath(): string;
244
- /**
245
- * Get the project root relative to the workspace root
246
- */
247
- get relativeToWorkspaceRoot(): string;
248
- /**
249
- * The builtin module id that exist in the Powerlines virtual file system
250
- */
251
- get builtins(): string[];
252
- /**
253
- * Additional arguments provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed.
254
- */
255
- get additionalArgs(): Record<string, string | string[]>;
256
- /**
257
- * The alias mappings for the project used during module resolution
258
- *
259
- * @remarks
260
- * This includes both the built-in module aliases as well as any custom aliases defined in the build configuration.
261
- */
262
- get alias(): Record<string, string>;
263
- /**
264
- * Gets the parser cache.
265
- */
266
- protected get parserCache(): FlatCache;
267
- /**
268
- * Gets the request cache.
269
- */
270
- protected get requestCache(): FlatCache;
271
- /**
272
- * The entry points that exist in the Powerlines virtual file system
273
- */
274
- protected get resolvedEntry(): ResolvedEntryTypeDefinition[];
275
- /**
276
- * Creates a new StormContext instance.
277
- *
278
- * @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
279
- */
280
- protected constructor(options: ResolvedExecutionOptions);
281
- /**
282
- * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
283
- *
284
- * @remarks
285
- * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
286
- *
287
- * @returns A promise that resolves to the cloned context.
288
- */
289
- clone(): Promise<Context<TResolvedConfig>>;
290
- /**
291
- * Create a new logger instance
292
- *
293
- * @param name - The name to use for the logger instance
294
- * @returns A logger function
295
- */
296
- createLog(name?: string | null): LogFn;
297
- /**
298
- * A function to perform HTTP fetch requests
299
- *
300
- * @remarks
301
- * This function uses a caching layer to avoid duplicate requests during the Powerlines process.
302
- *
303
- * @example
304
- * ```ts
305
- * const response = await context.fetch("https://api.example.com/data");
306
- * const data = await response.json();
307
- * ```
308
- *
309
- * @see https://github.com/nodejs/undici
310
- *
311
- * @param input - The URL to fetch.
312
- * @param options - The fetch request options.
313
- * @returns A promise that resolves to a response returned by the fetch.
314
- */
315
- fetch(input: RequestInfo, options?: FetchOptions): Promise<Response>;
316
- /**
317
- * Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
318
- *
319
- * @remarks
320
- * This function can be used to parse TypeScript code into an AST for further analysis or transformation.
321
- *
322
- * @example
323
- * ```ts
324
- * const ast = context.parse("const x: number = 42;");
325
- * ```
326
- *
327
- * @see https://rollupjs.org/plugin-development/#this-parse
328
- * @see https://github.com/oxc/oxc
329
- *
330
- * @param code - The source code to parse.
331
- * @param options - The options to pass to the parser.
332
- * @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
333
- */
334
- parse(code: string, options?: ParseOptions): Promise<ParseResult>;
335
- /**
336
- * A helper function to resolve modules in the Virtual File System
337
- *
338
- * @remarks
339
- * This function can be used to resolve modules relative to the project root directory.
340
- *
341
- * @example
342
- * ```ts
343
- * const resolved = await context.resolve("some-module", "/path/to/importer");
344
- * ```
345
- *
346
- * @param id - The module to resolve.
347
- * @param importer - An optional path to the importer module.
348
- * @param options - Additional resolution options.
349
- * @returns A promise that resolves to the resolved module path.
350
- */
351
- resolve(id: string, importer?: string, options?: ResolveOptions): Promise<ResolveResult | undefined>;
352
- /**
353
- * A helper function to load modules from the Virtual File System
354
- *
355
- * @remarks
356
- * This function can be used to load modules relative to the project root directory.
357
- *
358
- * @example
359
- * ```ts
360
- * const module = await context.load("some-module", "/path/to/importer");
361
- * ```
362
- *
363
- * @param id - The module to load.
364
- * @returns A promise that resolves to the loaded module.
365
- */
366
- load(id: string): Promise<TransformResult | undefined>;
367
- /**
368
- * Get the builtin virtual files that exist in the Powerlines virtual file system
369
- */
370
- getBuiltins(): Promise<VirtualFile[]>;
371
- /**
372
- * Resolves a file and writes it to the VFS if it does not already exist
373
- *
374
- * @param code - The source code of the file
375
- * @param path - The path to write the file to
376
- * @param options - Additional options for writing the file
377
- */
378
- emit(code: string, path: string, options?: EmitOptions): Promise<void>;
379
- /**
380
- * Synchronously resolves a file and writes it to the VFS if it does not already exist
381
- *
382
- * @param code - The source code of the file
383
- * @param path - The path to write the file to
384
- * @param options - Additional options for writing the file
385
- */
386
- emitSync(code: string, path: string, options?: EmitOptions): void;
387
- /**
388
- * Resolves a entry virtual file and writes it to the VFS if it does not already exist
389
- *
390
- * @param code - The source code of the entry file
391
- * @param path - A path to write the entry file to
392
- * @param options - Optional write file options
393
- */
394
- emitEntry(code: string, path: string, options?: EmitEntryOptions): Promise<void>;
395
- /**
396
- * Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist
397
- *
398
- * @param code - The source code of the entry file
399
- * @param path - A path to write the entry file to
400
- * @param options - Optional write file options
401
- */
402
- emitEntrySync(code: string, path: string, options?: EmitEntryOptions): void;
403
- /**
404
- * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
405
- *
406
- * @param code - The source code of the builtin file
407
- * @param id - The unique identifier of the builtin file
408
- * @param options - Optional write file options
409
- */
410
- emitBuiltin(code: string, id: string, options?: EmitOptions): Promise<void>;
411
- /**
412
- * Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
413
- *
414
- * @param code - The source code of the builtin file
415
- * @param id - The unique identifier of the builtin file
416
- * @param options - Optional write file options
417
- */
418
- emitBuiltinSync(code: string, id: string, options?: EmitOptions): void;
419
- /**
420
- * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
421
- *
422
- * @param code - The source code of the builtin file
423
- * @param id - The unique identifier of the builtin file
424
- * @param options - Optional write file options
425
- */
426
- emitInfrastructure(code: string, id: string, options?: EmitOptions): Promise<void>;
427
- /**
428
- * Synchronously resolves an infrastructure virtual file and writes it to the VFS if it does not already exist
429
- *
430
- * @param code - The source code of the infrastructure file
431
- * @param id - The unique identifier of the infrastructure file
432
- * @param options - Optional write file options
433
- */
434
- emitInfrastructureSync(code: string, id: string, options?: EmitOptions): void;
435
- /**
436
- * Generates a checksum representing the current context state
437
- *
438
- * @param root - The root directory of the project to generate the checksum for
439
- * @returns A promise that resolves to a string representing the checksum
440
- */
441
- generateChecksum(root?: string): Promise<string>;
442
- /**
443
- * Initialize the context with the provided configuration options
444
- */
445
- setup(): Promise<void>;
446
- /**
447
- * The resolved configuration for this context
448
- */
449
- protected resolvedConfig: TResolvedConfig;
450
- /**
451
- * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
452
- *
453
- * @remarks
454
- * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
455
- *
456
- * @returns The cloned context.
457
- */
458
- protected copyTo(context: Context<TResolvedConfig>): Context<TResolvedConfig>;
459
- /**
460
- * Initialize the context with the provided configuration options
461
- *
462
- * @remarks
463
- * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.
464
- *
465
- * @param options - The configuration options to initialize the context with
466
- */
467
- protected init(options?: Partial<ExecutionOptions>): Promise<void>;
468
- /**
469
- * Initialize the context with the provided configuration options
470
- */
471
- protected innerSetup(): Promise<void>;
472
- }
473
- //#endregion
474
- //#region src/context/engine-context.d.ts
475
- declare class PowerlinesEngineContext extends PowerlinesBaseContext implements EngineContext {
476
- #private;
477
- /**
478
- * Creates a new instance of the PowerlinesEngineContext class.
479
- *
480
- * @param options - The options to initialize the context with.
481
- * @returns A promise that resolves to an instance of the PowerlinesEngineContext class.
482
- */
483
- static fromOptions(options: EngineOptions): Promise<PowerlinesEngineContext>;
484
- /**
485
- * A list of all command executions that will be run during the lifecycle of the engine
486
- *
487
- * @returns An array of ResolvedExecutionOptions representing each execution context for the engine.
488
- */
489
- get executions(): ResolvedExecutionOptions[];
490
- }
491
- //#endregion
492
- //#region src/context/environment-context.d.ts
493
- declare class PowerlinesEnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PowerlinesContext<TResolvedConfig> implements EnvironmentContext<TResolvedConfig> {
494
- #private;
495
- /**
496
- * Create a new context from the config.
497
- *
498
- * @param options - The resolved execution options.
499
- * @param config - The user configuration options.
500
- * @returns A promise that resolves to the new context.
501
- */
502
- static fromConfig<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(options: ResolvedExecutionOptions, config: TResolvedConfig, environment: EnvironmentResolvedConfig): Promise<PowerlinesEnvironmentContext<TResolvedConfig>>;
503
- /**
504
- * The resolved environment configuration
505
- */
506
- environment: EnvironmentResolvedConfig;
507
- /**
508
- * The list of plugins applied to this environment
509
- */
510
- plugins: EnvironmentContextPlugin<TResolvedConfig>[];
511
- /**
512
- * Create a new logger instance
513
- *
514
- * @param name - The name to use for the logger instance
515
- * @returns A logger function
516
- */
517
- createLog(name?: string | null): LogFn;
518
- /**
519
- * The hooks registered by plugins in this environment
520
- */
521
- get hooks(): Record<string, HooksList<PluginContext<TResolvedConfig>>>;
522
- /**
523
- * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
524
- *
525
- * @remarks
526
- * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
527
- *
528
- * @returns A promise that resolves to the cloned context.
529
- */
530
- clone(): Promise<EnvironmentContext<TResolvedConfig>>;
531
- /**
532
- * Initialize the context with the provided configuration options
533
- */
534
- setup(): Promise<void>;
535
- addPlugin(plugin: Plugin<PluginContext<TResolvedConfig>>): Promise<void>;
536
- /**
537
- * Retrieves the hook handlers for a specific hook name
538
- */
539
- selectHooks<TKey extends string>(key: TKey, options?: SelectHooksOptions): SelectHookResult<PluginContext<TResolvedConfig>, TKey>;
540
- protected constructor(options: ResolvedExecutionOptions, config: TResolvedConfig, environment: EnvironmentResolvedConfig);
541
- /**
542
- * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
543
- *
544
- * @remarks
545
- * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
546
- *
547
- * @returns The cloned context.
548
- */
549
- protected copyTo(context: EnvironmentContext<TResolvedConfig>): EnvironmentContext<TResolvedConfig>;
550
- }
551
- //#endregion
552
- //#region src/context/execution-context.d.ts
553
- declare class PowerlinesExecutionContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PowerlinesContext<TResolvedConfig> implements ExecutionContext<TResolvedConfig> {
554
- #private;
555
- /**
556
- * Create a new Storm context from the workspace root and user config.
557
- *
558
- * @param options - The options for resolving the context.
559
- * @returns A promise that resolves to the new context.
560
- */
561
- static fromOptions<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(options: ResolvedExecutionOptions): Promise<ExecutionContext<TResolvedConfig>>;
562
- /**
563
- * Create a new Storm context from the workspace root and user config.
564
- *
565
- * @param options - The options for resolving the context.
566
- * @returns A promise that resolves to the new context.
567
- */
568
- static fromConfig<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(options: ResolvedExecutionOptions, config: InlineConfig): Promise<ExecutionContext<TResolvedConfig>>;
569
- /**
570
- * Internal context fields and methods
571
- *
572
- * @danger
573
- * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
574
- *
575
- * @internal
576
- */
577
- get $$internal(): Unstable_ContextInternal<TResolvedConfig>;
578
- /**
579
- * Internal context fields and methods
580
- *
581
- * @danger
582
- * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
583
- *
584
- * @internal
585
- */
586
- set $$internal(value: Unstable_ContextInternal<TResolvedConfig>);
587
- /**
588
- * A record of all environments by name
589
- */
590
- get environments(): Record<string, Unstable_EnvironmentContext<TResolvedConfig>>;
591
- get plugins(): Array<Plugin<PluginContext<TResolvedConfig>>>;
592
- /**
593
- * Creates a new instance.
594
- *
595
- * @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
596
- */
597
- protected constructor(options: ResolvedExecutionOptions);
598
- /**
599
- * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
600
- *
601
- * @remarks
602
- * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
603
- *
604
- * @returns A promise that resolves to the cloned context.
605
- */
606
- clone(): Promise<ExecutionContext<TResolvedConfig>>;
607
- /**
608
- * A function to copy the context and update the fields for a specific environment
609
- *
610
- * @param environment - The environment configuration to use.
611
- * @returns A new context instance with the updated environment.
612
- */
613
- in(environment: EnvironmentResolvedConfig): Promise<Unstable_EnvironmentContext<TResolvedConfig>>;
614
- /**
615
- * Update the context using a new inline configuration options
616
- */
617
- setup(): Promise<void>;
618
- /**
619
- * Add a plugin to the API context and all environments
620
- *
621
- * @param plugin - The plugin to add.
622
- */
623
- addPlugin(plugin: Plugin<PluginContext<TResolvedConfig>>): Promise<void>;
624
- /**
625
- * Get an environment by name, or the default environment if no name is provided
626
- *
627
- * @param name - The name of the environment to retrieve.
628
- * @returns The requested environment context.
629
- */
630
- getEnvironment(name?: string): Promise<EnvironmentContext<TResolvedConfig>>;
631
- /**
632
- * A safe version of `getEnvironment` that returns `undefined` if the environment is not found
633
- *
634
- * @param name - The name of the environment to retrieve.
635
- * @returns The requested environment context or `undefined` if not found.
636
- */
637
- getEnvironmentSafe(name?: string): Promise<EnvironmentContext<TResolvedConfig> | undefined>;
638
- /**
639
- * A function to merge all configured environments into a single context.
640
- *
641
- * @remarks
642
- * If only one environment is configured, that environment will be returned directly.
643
- *
644
- * @returns A promise that resolves to a merged/global environment context.
645
- */
646
- toEnvironment(): Promise<EnvironmentContext<TResolvedConfig>>;
647
- }
648
- //#endregion
649
- //#region src/context/plugin-context.d.ts
650
- /**
651
- * Create a Proxy-based PluginContext
652
- *
653
- * @param plugin - The plugin instance
654
- * @param environment - The environment context
655
- * @returns The proxied plugin context
656
- */
657
- declare function createPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(plugin: Plugin<PluginContext<TResolvedConfig>>, environment: Unstable_EnvironmentContext<TResolvedConfig>): Unstable_PluginContext<TResolvedConfig>;
658
- //#endregion
659
- export { PowerlinesBaseContext, PowerlinesContext, PowerlinesEngineContext, PowerlinesEnvironmentContext, PowerlinesExecutionContext, createPluginContext };
660
- //# sourceMappingURL=index.d.cts.map
1
+ import { t as PowerlinesEngineContext } from "../engine-context-Dw8odBCo.cjs";
2
+ export { PowerlinesEngineContext };