@powerlines/plugin-env 0.14.4 → 0.14.5

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 (230) hide show
  1. package/dist/{_virtual/rolldown_runtime.mjs → chunk-D1UamjDs.mjs} +1 -1
  2. package/dist/components/docs.cjs +1 -1
  3. package/dist/components/docs.d.cts +1 -8
  4. package/dist/components/docs.d.mts +1 -8
  5. package/dist/components/docs.mjs +1 -1
  6. package/dist/components/env.cjs +1 -34
  7. package/dist/components/env.d.cts +1 -19
  8. package/dist/components/env.d.mts +1 -19
  9. package/dist/components/env.mjs +1 -31
  10. package/dist/components/index.cjs +1 -1
  11. package/dist/components/index.d.cts +3 -2
  12. package/dist/components/index.d.mts +3 -2
  13. package/dist/components/index.mjs +1 -1
  14. package/dist/components-ByVHjWXF.mjs +1 -0
  15. package/dist/components-C9bYrQVK.cjs +0 -0
  16. package/dist/create-reflection-resource-D6mTRo2f.mjs +17 -0
  17. package/dist/create-reflection-resource-I684bqD1.cjs +17 -0
  18. package/dist/docs-BEsuuE9f.mjs +1 -0
  19. package/dist/docs-CKCRAUnO.d.mts +9 -0
  20. package/dist/docs-CdtUw4WA.d.cts +9 -0
  21. package/dist/docs-qvDyetF0.cjs +1 -0
  22. package/dist/env-CHnpBV7X.mjs +31 -0
  23. package/dist/env-COWzTupf.d.cts +20 -0
  24. package/dist/env-CgSzbXBL.cjs +34 -0
  25. package/dist/env-DqPOEUEu.d.mts +20 -0
  26. package/dist/index-B_e8BwCm.d.cts +1 -0
  27. package/dist/index-CW2WHUXP.d.mts +1 -0
  28. package/dist/index-DCQ5Y2ED.d.mts +1 -0
  29. package/dist/index-DWPDThxu.d.cts +1 -0
  30. package/dist/index.cjs +8 -4
  31. package/dist/index.d.cts +185 -12
  32. package/dist/index.d.mts +185 -17
  33. package/dist/index.mjs +8 -4
  34. package/dist/{deepkit/schemas/reflection.d.cts → plugin-CPy0CKXL.d.cts} +237 -1
  35. package/dist/plugin-CyRU_Pln.mjs +1 -0
  36. package/dist/{deepkit/schemas/reflection.d.mts → plugin-Cz3MZ6FL.d.mts} +239 -1
  37. package/dist/plugin-D5qyQPqC.cjs +0 -0
  38. package/dist/runtime-B7kcxFAf.d.mts +2499 -0
  39. package/dist/runtime-Bisl_1Ja.cjs +0 -0
  40. package/dist/runtime-Bo02eIQ-.d.cts +2497 -0
  41. package/dist/runtime-g_eXGBBi.mjs +1 -0
  42. package/dist/types/index.cjs +1 -0
  43. package/dist/types/index.d.cts +3 -2
  44. package/dist/types/index.d.mts +3 -2
  45. package/dist/types/index.mjs +1 -1
  46. package/dist/types/plugin.cjs +1 -0
  47. package/dist/types/plugin.d.cts +2 -148
  48. package/dist/types/plugin.d.mts +2 -149
  49. package/dist/types/plugin.mjs +1 -1
  50. package/dist/types/runtime.cjs +1 -0
  51. package/dist/types/runtime.d.cts +1 -793
  52. package/dist/types/runtime.d.mts +1 -793
  53. package/dist/types/runtime.mjs +1 -1
  54. package/dist/types-DMh7K7VC.mjs +1 -0
  55. package/dist/types-MYBaygjr.cjs +0 -0
  56. package/package.json +10 -8
  57. package/dist/_virtual/rolldown_runtime.cjs +0 -1
  58. package/dist/alloy/src/core/components/output.cjs +0 -1
  59. package/dist/alloy/src/core/components/output.mjs +0 -1
  60. package/dist/alloy/src/core/components/single-line-comment.cjs +0 -1
  61. package/dist/alloy/src/core/components/single-line-comment.mjs +0 -1
  62. package/dist/alloy/src/core/components/source-file.cjs +0 -1
  63. package/dist/alloy/src/core/components/source-file.d.cts +0 -22
  64. package/dist/alloy/src/core/components/source-file.d.mts +0 -22
  65. package/dist/alloy/src/core/components/source-file.mjs +0 -1
  66. package/dist/alloy/src/core/contexts/context.cjs +0 -1
  67. package/dist/alloy/src/core/contexts/context.mjs +0 -1
  68. package/dist/alloy/src/core/contexts/reflection.cjs +0 -1
  69. package/dist/alloy/src/core/contexts/reflection.mjs +0 -1
  70. package/dist/alloy/src/create-plugin.cjs +0 -2
  71. package/dist/alloy/src/create-plugin.mjs +0 -2
  72. package/dist/alloy/src/helpers/refkey.cjs +0 -1
  73. package/dist/alloy/src/helpers/refkey.mjs +0 -1
  74. package/dist/alloy/src/markdown/components/markdown-file.cjs +0 -1
  75. package/dist/alloy/src/markdown/components/markdown-file.mjs +0 -1
  76. package/dist/alloy/src/markdown/components/markdown-table.cjs +0 -1
  77. package/dist/alloy/src/markdown/components/markdown-table.mjs +0 -1
  78. package/dist/alloy/src/markdown/contexts/markdown-table.cjs +0 -1
  79. package/dist/alloy/src/markdown/contexts/markdown-table.mjs +0 -1
  80. package/dist/alloy/src/types/components.d.cts +0 -19
  81. package/dist/alloy/src/types/components.d.mts +0 -23
  82. package/dist/alloy/src/typescript/components/builtin-file.cjs +0 -1
  83. package/dist/alloy/src/typescript/components/builtin-file.d.cts +0 -25
  84. package/dist/alloy/src/typescript/components/builtin-file.d.mts +0 -26
  85. package/dist/alloy/src/typescript/components/builtin-file.mjs +0 -1
  86. package/dist/alloy/src/typescript/components/tsdoc-reflection.cjs +0 -1
  87. package/dist/alloy/src/typescript/components/tsdoc-reflection.mjs +0 -1
  88. package/dist/alloy/src/typescript/components/tsdoc.cjs +0 -1
  89. package/dist/alloy/src/typescript/components/tsdoc.d.cts +0 -27
  90. package/dist/alloy/src/typescript/components/tsdoc.d.mts +0 -28
  91. package/dist/alloy/src/typescript/components/tsdoc.mjs +0 -1
  92. package/dist/alloy/src/typescript/components/typescript-file.cjs +0 -1
  93. package/dist/alloy/src/typescript/components/typescript-file.d.cts +0 -14
  94. package/dist/alloy/src/typescript/components/typescript-file.d.mts +0 -15
  95. package/dist/alloy/src/typescript/components/typescript-file.mjs +0 -1
  96. package/dist/alloy/src/typescript/components/typescript-interface.cjs +0 -1
  97. package/dist/alloy/src/typescript/components/typescript-interface.d.cts +0 -11
  98. package/dist/alloy/src/typescript/components/typescript-interface.d.mts +0 -12
  99. package/dist/alloy/src/typescript/components/typescript-interface.mjs +0 -1
  100. package/dist/alloy/src/typescript/components/typescript-object.cjs +0 -1
  101. package/dist/alloy/src/typescript/components/typescript-object.mjs +0 -1
  102. package/dist/babel/index.cjs +0 -1
  103. package/dist/babel/index.d.cts +0 -2
  104. package/dist/babel/index.d.mts +0 -2
  105. package/dist/babel/index.mjs +0 -1
  106. package/dist/babel/plugin.cjs +0 -5
  107. package/dist/babel/plugin.d.cts +0 -7
  108. package/dist/babel/plugin.d.mts +0 -9
  109. package/dist/babel/plugin.mjs +0 -5
  110. package/dist/deepkit/schemas/reflection.cjs +0 -1
  111. package/dist/deepkit/schemas/reflection.mjs +0 -1
  112. package/dist/deepkit/schemas/reflection2.cjs +0 -1
  113. package/dist/deepkit/schemas/reflection2.mjs +0 -1
  114. package/dist/deepkit/src/capnp.cjs +0 -1
  115. package/dist/deepkit/src/capnp.mjs +0 -1
  116. package/dist/deepkit/src/esbuild-plugin.cjs +0 -4
  117. package/dist/deepkit/src/esbuild-plugin.mjs +0 -4
  118. package/dist/deepkit/src/reflect-type.cjs +0 -1
  119. package/dist/deepkit/src/reflect-type.mjs +0 -1
  120. package/dist/deepkit/src/resolve-reflections.cjs +0 -1
  121. package/dist/deepkit/src/resolve-reflections.mjs +0 -1
  122. package/dist/deepkit/src/transformer.cjs +0 -1
  123. package/dist/deepkit/src/transformer.mjs +0 -1
  124. package/dist/deepkit/src/transpile.cjs +0 -1
  125. package/dist/deepkit/src/transpile.mjs +0 -1
  126. package/dist/deepkit/src/types.d.cts +0 -10
  127. package/dist/deepkit/src/types.d.mts +0 -10
  128. package/dist/deepkit/src/utilities.cjs +0 -1
  129. package/dist/deepkit/src/utilities.mjs +0 -1
  130. package/dist/deepkit/src/vendor/type-compiler/index.cjs +0 -1
  131. package/dist/deepkit/src/vendor/type-compiler/index.mjs +0 -1
  132. package/dist/deepkit/src/vendor/type.cjs +0 -1
  133. package/dist/deepkit/src/vendor/type.d.cts +0 -7
  134. package/dist/deepkit/src/vendor/type.d.mts +0 -7
  135. package/dist/deepkit/src/vendor/type.mjs +0 -1
  136. package/dist/helpers/automd-generator.cjs +0 -1
  137. package/dist/helpers/automd-generator.d.cts +0 -14
  138. package/dist/helpers/automd-generator.d.mts +0 -14
  139. package/dist/helpers/automd-generator.mjs +0 -1
  140. package/dist/helpers/create-reflection-resource.cjs +0 -1
  141. package/dist/helpers/create-reflection-resource.d.cts +0 -15
  142. package/dist/helpers/create-reflection-resource.d.mts +0 -15
  143. package/dist/helpers/create-reflection-resource.mjs +0 -1
  144. package/dist/helpers/index.cjs +0 -1
  145. package/dist/helpers/index.d.cts +0 -7
  146. package/dist/helpers/index.d.mts +0 -7
  147. package/dist/helpers/index.mjs +0 -1
  148. package/dist/helpers/load.cjs +0 -1
  149. package/dist/helpers/load.d.cts +0 -35
  150. package/dist/helpers/load.d.mts +0 -36
  151. package/dist/helpers/load.mjs +0 -1
  152. package/dist/helpers/persistence.cjs +0 -1
  153. package/dist/helpers/persistence.d.cts +0 -84
  154. package/dist/helpers/persistence.d.mts +0 -84
  155. package/dist/helpers/persistence.mjs +0 -1
  156. package/dist/helpers/reflect.cjs +0 -1
  157. package/dist/helpers/reflect.d.cts +0 -46
  158. package/dist/helpers/reflect.d.mts +0 -46
  159. package/dist/helpers/reflect.mjs +0 -1
  160. package/dist/helpers/source-file-env.cjs +0 -1
  161. package/dist/helpers/source-file-env.d.cts +0 -8
  162. package/dist/helpers/source-file-env.d.mts +0 -8
  163. package/dist/helpers/source-file-env.mjs +0 -1
  164. package/dist/helpers/template-helpers.cjs +0 -1
  165. package/dist/helpers/template-helpers.d.cts +0 -15
  166. package/dist/helpers/template-helpers.d.mts +0 -15
  167. package/dist/helpers/template-helpers.mjs +0 -1
  168. package/dist/plugin-automd/src/index.cjs +0 -1
  169. package/dist/plugin-automd/src/index.mjs +0 -1
  170. package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
  171. package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
  172. package/dist/plugin-automd/src/types/toc.d.cts +0 -33
  173. package/dist/plugin-automd/src/types/toc.d.mts +0 -33
  174. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -1
  175. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -1
  176. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -1
  177. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -1
  178. package/dist/plugin-babel/src/helpers/filters.cjs +0 -1
  179. package/dist/plugin-babel/src/helpers/filters.mjs +0 -1
  180. package/dist/plugin-babel/src/helpers/index.cjs +0 -1
  181. package/dist/plugin-babel/src/helpers/index.mjs +0 -1
  182. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -1
  183. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -1
  184. package/dist/plugin-babel/src/helpers/options.cjs +0 -1
  185. package/dist/plugin-babel/src/helpers/options.mjs +0 -1
  186. package/dist/plugin-babel/src/index.cjs +0 -1
  187. package/dist/plugin-babel/src/index.mjs +0 -1
  188. package/dist/plugin-babel/src/types/index.d.mts +0 -1
  189. package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
  190. package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
  191. package/dist/powerlines/schemas/fs.d.mts +0 -1
  192. package/dist/powerlines/src/api.d.mts +0 -7
  193. package/dist/powerlines/src/index.d.mts +0 -12
  194. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -5
  195. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -14
  196. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -14
  197. package/dist/powerlines/src/lib/entry.cjs +0 -1
  198. package/dist/powerlines/src/lib/entry.mjs +0 -1
  199. package/dist/powerlines/src/lib/logger.cjs +0 -1
  200. package/dist/powerlines/src/lib/logger.mjs +0 -1
  201. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -1
  202. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -1
  203. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -1
  204. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -1
  205. package/dist/powerlines/src/plugin-utils/helpers.cjs +0 -1
  206. package/dist/powerlines/src/plugin-utils/helpers.mjs +0 -1
  207. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
  208. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -1
  209. package/dist/powerlines/src/types/api.d.mts +0 -5
  210. package/dist/powerlines/src/types/babel.d.cts +0 -23
  211. package/dist/powerlines/src/types/babel.d.mts +0 -23
  212. package/dist/powerlines/src/types/build.d.cts +0 -145
  213. package/dist/powerlines/src/types/build.d.mts +0 -147
  214. package/dist/powerlines/src/types/commands.d.cts +0 -8
  215. package/dist/powerlines/src/types/commands.d.mts +0 -9
  216. package/dist/powerlines/src/types/config.d.cts +0 -368
  217. package/dist/powerlines/src/types/config.d.mts +0 -369
  218. package/dist/powerlines/src/types/context.d.cts +0 -373
  219. package/dist/powerlines/src/types/context.d.mts +0 -375
  220. package/dist/powerlines/src/types/fs.d.cts +0 -458
  221. package/dist/powerlines/src/types/fs.d.mts +0 -458
  222. package/dist/powerlines/src/types/hooks.d.mts +0 -2
  223. package/dist/powerlines/src/types/index.d.mts +0 -12
  224. package/dist/powerlines/src/types/plugin.d.cts +0 -232
  225. package/dist/powerlines/src/types/plugin.d.mts +0 -232
  226. package/dist/powerlines/src/types/resolved.d.cts +0 -82
  227. package/dist/powerlines/src/types/resolved.d.mts +0 -83
  228. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  229. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  230. package/dist/powerlines/src/types/unplugin.d.mts +0 -7
@@ -1,375 +0,0 @@
1
- import { ResolveOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
2
- import { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.mjs";
3
- import "./plugin.mjs";
4
- import { ParsedTypeScriptConfig } from "./tsconfig.mjs";
5
- import { InlineConfig, LogFn, UserConfig, WorkspaceConfig } from "./config.mjs";
6
- import "./hooks.mjs";
7
- import { NonUndefined } from "@stryke/types/base";
8
- import { EnvPaths } from "@stryke/env/get-env-paths";
9
- import { FetchRequestOptions } from "@stryke/http/fetch";
10
- import { PackageJson } from "@stryke/types/package-json";
11
- import { Jiti } from "jiti";
12
- import { SourceMap } from "magic-string";
13
- import { ParseResult, ParserOptions } from "oxc-parser";
14
- import { Range } from "semver";
15
- import { Project } from "ts-morph";
16
- import { RequestInfo, Response } from "undici";
17
- import { ExternalIdResult, UnpluginBuildContext, UnpluginContext, UnpluginMessage } from "unplugin";
18
-
19
- //#region ../powerlines/src/types/context.d.ts
20
-
21
- /**
22
- * The severity level of a {@link LogRecord}.
23
- */
24
- type LogLevel = "debug" | "info" | "warning" | "error" | "fatal";
25
- declare const LogLevel: {
26
- DEBUG: LogLevel;
27
- INFO: LogLevel;
28
- WARNING: LogLevel;
29
- ERROR: LogLevel;
30
- FATAL: LogLevel;
31
- };
32
- interface MetaInfo {
33
- /**
34
- * The checksum generated from the resolved options
35
- */
36
- checksum: string;
37
- /**
38
- * The build id
39
- */
40
- buildId: string;
41
- /**
42
- * The release id
43
- */
44
- releaseId: string;
45
- /**
46
- * The build timestamp
47
- */
48
- timestamp: number;
49
- /**
50
- * A hash that represents the path to the project root directory
51
- */
52
- projectRootHash: string;
53
- /**
54
- * A hash that represents the path to the project root directory
55
- */
56
- configHash: string;
57
- }
58
- interface Resolver extends Jiti {
59
- plugin: Jiti;
60
- }
61
- interface TransformResult$1 {
62
- code: string;
63
- map: SourceMap | null;
64
- }
65
- /**
66
- * Options for initializing or updating the context with new configuration values
67
- */
68
- interface InitContextOptions {
69
- /**
70
- * If false, the plugin will be loaded after all other plugins.
71
- *
72
- * @defaultValue true
73
- */
74
- isHighPriority: boolean;
75
- }
76
- /**
77
- * Options for fetch requests made via the context's {@link Context.fetch} method
78
- */
79
- interface FetchOptions extends FetchRequestOptions {
80
- /**
81
- * An indicator specifying that the request should bypass any caching
82
- */
83
- skipCache?: boolean;
84
- }
85
- /**
86
- * Options for parsing code using [Oxc-Parser](https://github.com/oxc/oxc)
87
- */
88
- interface ParseOptions extends ParserOptions {
89
- /**
90
- * When true this allows return statements to be outside functions to e.g. support parsing CommonJS code.
91
- */
92
- allowReturnOutsideFunction?: boolean;
93
- }
94
- /**
95
- * Options for emitting entry virtual files
96
- */
97
- type EmitEntryOptions = WriteOptions & Omit<ResolvedEntryTypeDefinition, "file">;
98
- /**
99
- * The unresolved Powerlines context.
100
- *
101
- * @remarks
102
- * This context is used before the user configuration has been fully resolved after the `config`.
103
- */
104
- interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
105
- /**
106
- * The Storm workspace configuration
107
- */
108
- workspaceConfig: WorkspaceConfig;
109
- /**
110
- * An object containing the options provided to Powerlines
111
- */
112
- config: Omit<TResolvedConfig["userConfig"], "build" | "output"> & Required<Pick<TResolvedConfig["userConfig"], "build" | "output">> & {
113
- projectRoot: NonUndefined<TResolvedConfig["userConfig"]["root"]>;
114
- sourceRoot: NonUndefined<TResolvedConfig["userConfig"]["sourceRoot"]>;
115
- output: TResolvedConfig["output"];
116
- };
117
- /**
118
- * A logging function for the Powerlines engine
119
- */
120
- log: LogFn;
121
- /**
122
- * A logging function for fatal messages
123
- */
124
- fatal: (message: string | UnpluginMessage) => void;
125
- /**
126
- * A logging function for error messages
127
- */
128
- error: (message: string | UnpluginMessage) => void;
129
- /**
130
- * A logging function for warning messages
131
- */
132
- warn: (message: string | UnpluginMessage) => void;
133
- /**
134
- * A logging function for informational messages
135
- */
136
- info: (message: string | UnpluginMessage) => void;
137
- /**
138
- * A logging function for debug messages
139
- */
140
- debug: (message: string | UnpluginMessage) => void;
141
- /**
142
- * A logging function for trace messages
143
- */
144
- trace: (message: string | UnpluginMessage) => void;
145
- /**
146
- * The metadata information
147
- */
148
- meta: MetaInfo;
149
- /**
150
- * The metadata information currently written to disk
151
- */
152
- persistedMeta?: MetaInfo;
153
- /**
154
- * The Powerlines artifacts directory
155
- */
156
- artifactsPath: string;
157
- /**
158
- * The path to the Powerlines builtin runtime modules directory
159
- */
160
- builtinsPath: string;
161
- /**
162
- * The path to the Powerlines entry modules directory
163
- */
164
- entryPath: string;
165
- /**
166
- * The path to the Powerlines TypeScript declaration files directory
167
- */
168
- dtsPath: string;
169
- /**
170
- * The path to a directory where the reflection data buffers (used by the build processes) are stored
171
- */
172
- dataPath: string;
173
- /**
174
- * The path to a directory where the project cache (used by the build processes) is stored
175
- */
176
- cachePath: string;
177
- /**
178
- * The Powerlines environment paths
179
- */
180
- envPaths: EnvPaths;
181
- /**
182
- * The file system path to the Powerlines package installation
183
- */
184
- powerlinesPath: string;
185
- /**
186
- * The relative path to the Powerlines workspace root directory
187
- */
188
- relativeToWorkspaceRoot: string;
189
- /**
190
- * The project's `package.json` file content
191
- */
192
- packageJson: PackageJson & Record<string, any>;
193
- /**
194
- * The project's `project.json` file content
195
- */
196
- projectJson?: Record<string, any>;
197
- /**
198
- * The dependency installations required by the project
199
- */
200
- dependencies: Record<string, string | Range>;
201
- /**
202
- * The development dependency installations required by the project
203
- */
204
- devDependencies: Record<string, string | Range>;
205
- /**
206
- * The parsed TypeScript configuration from the `tsconfig.json` file
207
- */
208
- tsconfig: ParsedTypeScriptConfig;
209
- /**
210
- * The entry points of the source code
211
- */
212
- entry: ResolvedEntryTypeDefinition[];
213
- /**
214
- * The virtual file system manager used during the build process to reference generated runtime files
215
- */
216
- fs: VirtualFileSystemInterface;
217
- /**
218
- * The Jiti module resolver
219
- */
220
- resolver: Resolver;
221
- /**
222
- * The builtin module id that exist in the Powerlines virtual file system
223
- */
224
- builtins: string[];
225
- /**
226
- * The {@link Project} instance used for type reflection and module manipulation
227
- *
228
- * @see https://ts-morph.com/
229
- *
230
- * @remarks
231
- * This instance is created lazily on first access.
232
- */
233
- program: Project;
234
- /**
235
- * A function to perform HTTP fetch requests
236
- *
237
- * @remarks
238
- * This function uses a caching layer to avoid duplicate requests during the Powerlines process.
239
- *
240
- * @example
241
- * ```ts
242
- * const response = await context.fetch("https://api.example.com/data");
243
- * const data = await response.json();
244
- * ```
245
- *
246
- * @see https://github.com/nodejs/undici
247
- *
248
- * @param input - The URL to fetch.
249
- * @param options - The fetch request options.
250
- * @returns A promise that resolves to a response returned by the fetch.
251
- */
252
- fetch: (input: RequestInfo, options?: FetchOptions) => Promise<Response>;
253
- /**
254
- * Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
255
- *
256
- * @remarks
257
- * This function can be used to parse TypeScript code into an AST for further analysis or transformation.
258
- *
259
- * @example
260
- * ```ts
261
- * const ast = context.parse("const x: number = 42;");
262
- * ```
263
- *
264
- * @see https://rollupjs.org/plugin-development/#this-parse
265
- * @see https://github.com/oxc/oxc
266
- *
267
- * @param code - The source code to parse.
268
- * @param options - The options to pass to the parser.
269
- * @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
270
- */
271
- parse: (code: string, options?: ParseOptions) => Promise<ParseResult>;
272
- /**
273
- * A helper function to resolve modules using the Jiti resolver
274
- *
275
- * @remarks
276
- * This function can be used to resolve modules relative to the project root directory.
277
- *
278
- * @example
279
- * ```ts
280
- * const resolvedPath = await context.resolve("some-module", "/path/to/importer");
281
- * ```
282
- *
283
- * @param id - The module to resolve.
284
- * @param importer - An optional path to the importer module.
285
- * @param options - Additional resolution options.
286
- * @returns A promise that resolves to the resolved module path.
287
- */
288
- resolve: (id: string, importer?: string, options?: ResolveOptions) => Promise<ExternalIdResult | undefined>;
289
- /**
290
- * A helper function to load modules using the Jiti resolver
291
- *
292
- * @remarks
293
- * This function can be used to load modules relative to the project root directory.
294
- *
295
- * @example
296
- * ```ts
297
- * const module = await context.load("some-module", "/path/to/importer");
298
- * ```
299
- *
300
- * @param id - The module to load.
301
- * @returns A promise that resolves to the loaded module.
302
- */
303
- load: (id: string) => Promise<TransformResult$1 | undefined>;
304
- /**
305
- * The Powerlines builtin virtual files
306
- */
307
- getBuiltins: () => Promise<VirtualFile[]>;
308
- /**
309
- * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
310
- *
311
- * @param code - The source code of the builtin file
312
- * @param id - The unique identifier of the builtin file
313
- * @param path - An optional path to write the builtin file to
314
- * @param options - Additional options for writing the builtin file
315
- */
316
- emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
317
- /**
318
- * Resolves a entry virtual file and writes it to the VFS if it does not already exist
319
- *
320
- * @param code - The source code of the entry file
321
- * @param path - An optional path to write the entry file to
322
- * @param options - Additional options for writing the entry file
323
- */
324
- emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
325
- /**
326
- * A function to update the context fields using a new user configuration options
327
- */
328
- withUserConfig: (userConfig: UserConfig, options?: InitContextOptions) => Promise<void>;
329
- /**
330
- * A function to update the context fields using inline configuration options
331
- */
332
- withInlineConfig: (inlineConfig: InlineConfig, options?: InitContextOptions) => Promise<void>;
333
- /**
334
- * Create a new logger instance
335
- *
336
- * @param name - The name to use for the logger instance
337
- * @returns A logger function
338
- */
339
- createLog: (name: string | null) => LogFn;
340
- /**
341
- * Extend the current logger instance with a new name
342
- *
343
- * @param name - The name to use for the extended logger instance
344
- * @returns A logger function
345
- */
346
- extendLog: (name: string) => LogFn;
347
- /**
348
- * Generates a checksum representing the current context state
349
- *
350
- * @returns A promise that resolves to a string representing the checksum
351
- */
352
- generateChecksum: () => Promise<string>;
353
- }
354
- type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = Omit<UnresolvedContext<TResolvedConfig>, "config"> & {
355
- /**
356
- * The fully resolved Powerlines configuration
357
- */
358
- config: TResolvedConfig;
359
- };
360
- interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig>, UnpluginContext {
361
- /**
362
- * The environment specific resolved configuration
363
- */
364
- environment: EnvironmentResolvedConfig;
365
- /**
366
- * An alternative property name for the {@link log} property
367
- *
368
- * @remarks
369
- * This is provided for compatibility with other logging libraries that expect a `logger` property.
370
- */
371
- logger: LogFn;
372
- }
373
- type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = UnpluginBuildContext & PluginContext<TResolvedConfig>;
374
- //#endregion
375
- export { BuildPluginContext, Context, EmitEntryOptions, FetchOptions, InitContextOptions, LogLevel, MetaInfo, ParseOptions, PluginContext, Resolver, TransformResult$1 as TransformResult, UnresolvedContext };