@powerlines/plugin-date 0.12.140 → 0.12.142

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