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