@powerlines/plugin-env 0.13.64 → 0.13.65

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