@powerlines/core 0.0.8

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 (286) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +1 -0
  3. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  4. package/dist/index.cjs +65 -0
  5. package/dist/index.d.cts +23 -0
  6. package/dist/index.d.mts +25 -0
  7. package/dist/index.mjs +22 -0
  8. package/dist/lib/config.cjs +90 -0
  9. package/dist/lib/config.cjs.map +1 -0
  10. package/dist/lib/config.d.cts +40 -0
  11. package/dist/lib/config.d.cts.map +1 -0
  12. package/dist/lib/config.d.mts +40 -0
  13. package/dist/lib/config.d.mts.map +1 -0
  14. package/dist/lib/config.mjs +86 -0
  15. package/dist/lib/config.mjs.map +1 -0
  16. package/dist/lib/constants/environments.cjs +17 -0
  17. package/dist/lib/constants/environments.cjs.map +1 -0
  18. package/dist/lib/constants/environments.d.cts +10 -0
  19. package/dist/lib/constants/environments.d.cts.map +1 -0
  20. package/dist/lib/constants/environments.d.mts +10 -0
  21. package/dist/lib/constants/environments.d.mts.map +1 -0
  22. package/dist/lib/constants/environments.mjs +11 -0
  23. package/dist/lib/constants/environments.mjs.map +1 -0
  24. package/dist/lib/constants/index.cjs +11 -0
  25. package/dist/lib/constants/index.d.cts +3 -0
  26. package/dist/lib/constants/index.d.mts +3 -0
  27. package/dist/lib/constants/index.mjs +4 -0
  28. package/dist/lib/constants/meta.cjs +9 -0
  29. package/dist/lib/constants/meta.cjs.map +1 -0
  30. package/dist/lib/constants/meta.d.cts +6 -0
  31. package/dist/lib/constants/meta.d.cts.map +1 -0
  32. package/dist/lib/constants/meta.d.mts +6 -0
  33. package/dist/lib/constants/meta.d.mts.map +1 -0
  34. package/dist/lib/constants/meta.mjs +7 -0
  35. package/dist/lib/constants/meta.mjs.map +1 -0
  36. package/dist/lib/entry.cjs +127 -0
  37. package/dist/lib/entry.cjs.map +1 -0
  38. package/dist/lib/entry.d.cts +47 -0
  39. package/dist/lib/entry.d.cts.map +1 -0
  40. package/dist/lib/entry.d.mts +48 -0
  41. package/dist/lib/entry.d.mts.map +1 -0
  42. package/dist/lib/entry.mjs +120 -0
  43. package/dist/lib/entry.mjs.map +1 -0
  44. package/dist/lib/index.cjs +50 -0
  45. package/dist/lib/index.d.cts +14 -0
  46. package/dist/lib/index.d.mts +16 -0
  47. package/dist/lib/index.mjs +17 -0
  48. package/dist/lib/logger.cjs +59 -0
  49. package/dist/lib/logger.cjs.map +1 -0
  50. package/dist/lib/logger.d.cts +23 -0
  51. package/dist/lib/logger.d.cts.map +1 -0
  52. package/dist/lib/logger.d.mts +24 -0
  53. package/dist/lib/logger.d.mts.map +1 -0
  54. package/dist/lib/logger.mjs +56 -0
  55. package/dist/lib/logger.mjs.map +1 -0
  56. package/dist/lib/unplugin/helpers.cjs +30 -0
  57. package/dist/lib/unplugin/helpers.cjs.map +1 -0
  58. package/dist/lib/unplugin/helpers.d.cts +24 -0
  59. package/dist/lib/unplugin/helpers.d.cts.map +1 -0
  60. package/dist/lib/unplugin/helpers.d.mts +24 -0
  61. package/dist/lib/unplugin/helpers.d.mts.map +1 -0
  62. package/dist/lib/unplugin/helpers.mjs +28 -0
  63. package/dist/lib/unplugin/helpers.mjs.map +1 -0
  64. package/dist/lib/unplugin/index.cjs +9 -0
  65. package/dist/lib/unplugin/index.d.cts +4 -0
  66. package/dist/lib/unplugin/index.d.mts +4 -0
  67. package/dist/lib/unplugin/index.mjs +5 -0
  68. package/dist/lib/unplugin/module-resolution.cjs +67 -0
  69. package/dist/lib/unplugin/module-resolution.cjs.map +1 -0
  70. package/dist/lib/unplugin/module-resolution.d.cts +21 -0
  71. package/dist/lib/unplugin/module-resolution.d.cts.map +1 -0
  72. package/dist/lib/unplugin/module-resolution.d.mts +21 -0
  73. package/dist/lib/unplugin/module-resolution.d.mts.map +1 -0
  74. package/dist/lib/unplugin/module-resolution.mjs +66 -0
  75. package/dist/lib/unplugin/module-resolution.mjs.map +1 -0
  76. package/dist/lib/unplugin/plugin.cjs +105 -0
  77. package/dist/lib/unplugin/plugin.cjs.map +1 -0
  78. package/dist/lib/unplugin/plugin.d.cts +22 -0
  79. package/dist/lib/unplugin/plugin.d.cts.map +1 -0
  80. package/dist/lib/unplugin/plugin.d.mts +22 -0
  81. package/dist/lib/unplugin/plugin.d.mts.map +1 -0
  82. package/dist/lib/unplugin/plugin.mjs +103 -0
  83. package/dist/lib/unplugin/plugin.mjs.map +1 -0
  84. package/dist/lib/utilities/file-header.cjs +24 -0
  85. package/dist/lib/utilities/file-header.cjs.map +1 -0
  86. package/dist/lib/utilities/file-header.d.cts +13 -0
  87. package/dist/lib/utilities/file-header.d.cts.map +1 -0
  88. package/dist/lib/utilities/file-header.d.mts +13 -0
  89. package/dist/lib/utilities/file-header.d.mts.map +1 -0
  90. package/dist/lib/utilities/file-header.mjs +22 -0
  91. package/dist/lib/utilities/file-header.mjs.map +1 -0
  92. package/dist/lib/utilities/format.cjs +49 -0
  93. package/dist/lib/utilities/format.cjs.map +1 -0
  94. package/dist/lib/utilities/format.d.cts +25 -0
  95. package/dist/lib/utilities/format.d.cts.map +1 -0
  96. package/dist/lib/utilities/format.d.mts +25 -0
  97. package/dist/lib/utilities/format.d.mts.map +1 -0
  98. package/dist/lib/utilities/format.mjs +47 -0
  99. package/dist/lib/utilities/format.mjs.map +1 -0
  100. package/dist/lib/utilities/index.cjs +15 -0
  101. package/dist/lib/utilities/index.d.cts +6 -0
  102. package/dist/lib/utilities/index.d.mts +6 -0
  103. package/dist/lib/utilities/index.mjs +7 -0
  104. package/dist/lib/utilities/source-file.cjs +50 -0
  105. package/dist/lib/utilities/source-file.cjs.map +1 -0
  106. package/dist/lib/utilities/source-file.d.cts +31 -0
  107. package/dist/lib/utilities/source-file.d.cts.map +1 -0
  108. package/dist/lib/utilities/source-file.d.mts +31 -0
  109. package/dist/lib/utilities/source-file.d.mts.map +1 -0
  110. package/dist/lib/utilities/source-file.mjs +46 -0
  111. package/dist/lib/utilities/source-file.mjs.map +1 -0
  112. package/dist/lib/utilities/source-map.cjs +57 -0
  113. package/dist/lib/utilities/source-map.cjs.map +1 -0
  114. package/dist/lib/utilities/source-map.d.cts +17 -0
  115. package/dist/lib/utilities/source-map.d.cts.map +1 -0
  116. package/dist/lib/utilities/source-map.d.mts +17 -0
  117. package/dist/lib/utilities/source-map.d.mts.map +1 -0
  118. package/dist/lib/utilities/source-map.mjs +55 -0
  119. package/dist/lib/utilities/source-map.mjs.map +1 -0
  120. package/dist/lib/utilities/write-file.cjs +29 -0
  121. package/dist/lib/utilities/write-file.cjs.map +1 -0
  122. package/dist/lib/utilities/write-file.d.cts +16 -0
  123. package/dist/lib/utilities/write-file.d.cts.map +1 -0
  124. package/dist/lib/utilities/write-file.d.mts +16 -0
  125. package/dist/lib/utilities/write-file.d.mts.map +1 -0
  126. package/dist/lib/utilities/write-file.mjs +28 -0
  127. package/dist/lib/utilities/write-file.mjs.map +1 -0
  128. package/dist/plugin-base.cjs +73 -0
  129. package/dist/plugin-base.cjs.map +1 -0
  130. package/dist/plugin-base.d.cts +27 -0
  131. package/dist/plugin-base.d.cts.map +1 -0
  132. package/dist/plugin-base.d.mts +27 -0
  133. package/dist/plugin-base.d.mts.map +1 -0
  134. package/dist/plugin-base.mjs +70 -0
  135. package/dist/plugin-base.mjs.map +1 -0
  136. package/dist/plugin-utils/build-helpers.cjs +36 -0
  137. package/dist/plugin-utils/build-helpers.cjs.map +1 -0
  138. package/dist/plugin-utils/build-helpers.d.cts +19 -0
  139. package/dist/plugin-utils/build-helpers.d.cts.map +1 -0
  140. package/dist/plugin-utils/build-helpers.d.mts +19 -0
  141. package/dist/plugin-utils/build-helpers.d.mts.map +1 -0
  142. package/dist/plugin-utils/build-helpers.mjs +35 -0
  143. package/dist/plugin-utils/build-helpers.mjs.map +1 -0
  144. package/dist/plugin-utils/context-helpers.cjs +50 -0
  145. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  146. package/dist/plugin-utils/context-helpers.d.cts +21 -0
  147. package/dist/plugin-utils/context-helpers.d.cts.map +1 -0
  148. package/dist/plugin-utils/context-helpers.d.mts +21 -0
  149. package/dist/plugin-utils/context-helpers.d.mts.map +1 -0
  150. package/dist/plugin-utils/context-helpers.mjs +48 -0
  151. package/dist/plugin-utils/context-helpers.mjs.map +1 -0
  152. package/dist/plugin-utils/extend.cjs +25 -0
  153. package/dist/plugin-utils/extend.cjs.map +1 -0
  154. package/dist/plugin-utils/extend.d.cts +20 -0
  155. package/dist/plugin-utils/extend.d.cts.map +1 -0
  156. package/dist/plugin-utils/extend.d.mts +20 -0
  157. package/dist/plugin-utils/extend.d.mts.map +1 -0
  158. package/dist/plugin-utils/extend.mjs +24 -0
  159. package/dist/plugin-utils/extend.mjs.map +1 -0
  160. package/dist/plugin-utils/format-package-json.cjs +20 -0
  161. package/dist/plugin-utils/format-package-json.cjs.map +1 -0
  162. package/dist/plugin-utils/format-package-json.d.cts +13 -0
  163. package/dist/plugin-utils/format-package-json.d.cts.map +1 -0
  164. package/dist/plugin-utils/format-package-json.d.mts +13 -0
  165. package/dist/plugin-utils/format-package-json.d.mts.map +1 -0
  166. package/dist/plugin-utils/format-package-json.mjs +19 -0
  167. package/dist/plugin-utils/format-package-json.mjs.map +1 -0
  168. package/dist/plugin-utils/get-config-path.cjs +50 -0
  169. package/dist/plugin-utils/get-config-path.cjs.map +1 -0
  170. package/dist/plugin-utils/get-config-path.d.cts +15 -0
  171. package/dist/plugin-utils/get-config-path.d.cts.map +1 -0
  172. package/dist/plugin-utils/get-config-path.d.mts +15 -0
  173. package/dist/plugin-utils/get-config-path.d.mts.map +1 -0
  174. package/dist/plugin-utils/get-config-path.mjs +49 -0
  175. package/dist/plugin-utils/get-config-path.mjs.map +1 -0
  176. package/dist/plugin-utils/helpers.cjs +185 -0
  177. package/dist/plugin-utils/helpers.cjs.map +1 -0
  178. package/dist/plugin-utils/helpers.d.cts +144 -0
  179. package/dist/plugin-utils/helpers.d.cts.map +1 -0
  180. package/dist/plugin-utils/helpers.d.mts +144 -0
  181. package/dist/plugin-utils/helpers.d.mts.map +1 -0
  182. package/dist/plugin-utils/helpers.mjs +170 -0
  183. package/dist/plugin-utils/helpers.mjs.map +1 -0
  184. package/dist/plugin-utils/index.cjs +35 -0
  185. package/dist/plugin-utils/index.d.cts +10 -0
  186. package/dist/plugin-utils/index.d.mts +10 -0
  187. package/dist/plugin-utils/index.mjs +11 -0
  188. package/dist/plugin-utils/merge.cjs +60 -0
  189. package/dist/plugin-utils/merge.cjs.map +1 -0
  190. package/dist/plugin-utils/merge.d.cts +35 -0
  191. package/dist/plugin-utils/merge.d.cts.map +1 -0
  192. package/dist/plugin-utils/merge.d.mts +35 -0
  193. package/dist/plugin-utils/merge.d.mts.map +1 -0
  194. package/dist/plugin-utils/merge.mjs +57 -0
  195. package/dist/plugin-utils/merge.mjs.map +1 -0
  196. package/dist/plugin-utils/modules.cjs +17 -0
  197. package/dist/plugin-utils/modules.cjs.map +1 -0
  198. package/dist/plugin-utils/modules.d.cts +15 -0
  199. package/dist/plugin-utils/modules.d.cts.map +1 -0
  200. package/dist/plugin-utils/modules.d.mts +15 -0
  201. package/dist/plugin-utils/modules.d.mts.map +1 -0
  202. package/dist/plugin-utils/modules.mjs +16 -0
  203. package/dist/plugin-utils/modules.mjs.map +1 -0
  204. package/dist/plugin-utils/paths.cjs +38 -0
  205. package/dist/plugin-utils/paths.cjs.map +1 -0
  206. package/dist/plugin-utils/paths.d.cts +34 -0
  207. package/dist/plugin-utils/paths.d.cts.map +1 -0
  208. package/dist/plugin-utils/paths.d.mts +34 -0
  209. package/dist/plugin-utils/paths.d.mts.map +1 -0
  210. package/dist/plugin-utils/paths.mjs +37 -0
  211. package/dist/plugin-utils/paths.mjs.map +1 -0
  212. package/dist/types/_internal.cjs +0 -0
  213. package/dist/types/_internal.d.cts +107 -0
  214. package/dist/types/_internal.d.cts.map +1 -0
  215. package/dist/types/_internal.d.mts +107 -0
  216. package/dist/types/_internal.d.mts.map +1 -0
  217. package/dist/types/_internal.mjs +1 -0
  218. package/dist/types/api.cjs +0 -0
  219. package/dist/types/api.d.cts +104 -0
  220. package/dist/types/api.d.cts.map +1 -0
  221. package/dist/types/api.d.mts +104 -0
  222. package/dist/types/api.d.mts.map +1 -0
  223. package/dist/types/api.mjs +1 -0
  224. package/dist/types/commands.cjs +17 -0
  225. package/dist/types/commands.cjs.map +1 -0
  226. package/dist/types/commands.d.cts +13 -0
  227. package/dist/types/commands.d.cts.map +1 -0
  228. package/dist/types/commands.d.mts +13 -0
  229. package/dist/types/commands.d.mts.map +1 -0
  230. package/dist/types/commands.mjs +16 -0
  231. package/dist/types/commands.mjs.map +1 -0
  232. package/dist/types/config.cjs +0 -0
  233. package/dist/types/config.d.cts +617 -0
  234. package/dist/types/config.d.cts.map +1 -0
  235. package/dist/types/config.d.mts +617 -0
  236. package/dist/types/config.d.mts.map +1 -0
  237. package/dist/types/config.mjs +1 -0
  238. package/dist/types/context.cjs +0 -0
  239. package/dist/types/context.d.cts +564 -0
  240. package/dist/types/context.d.cts.map +1 -0
  241. package/dist/types/context.d.mts +564 -0
  242. package/dist/types/context.d.mts.map +1 -0
  243. package/dist/types/context.mjs +1 -0
  244. package/dist/types/fs.cjs +11 -0
  245. package/dist/types/fs.cjs.map +1 -0
  246. package/dist/types/fs.d.cts +502 -0
  247. package/dist/types/fs.d.cts.map +1 -0
  248. package/dist/types/fs.d.mts +502 -0
  249. package/dist/types/fs.d.mts.map +1 -0
  250. package/dist/types/fs.mjs +8 -0
  251. package/dist/types/fs.mjs.map +1 -0
  252. package/dist/types/hooks.cjs +13 -0
  253. package/dist/types/hooks.cjs.map +1 -0
  254. package/dist/types/hooks.d.cts +117 -0
  255. package/dist/types/hooks.d.cts.map +1 -0
  256. package/dist/types/hooks.d.mts +117 -0
  257. package/dist/types/hooks.d.mts.map +1 -0
  258. package/dist/types/hooks.mjs +12 -0
  259. package/dist/types/hooks.mjs.map +1 -0
  260. package/dist/types/index.cjs +16 -0
  261. package/dist/types/index.d.cts +10 -0
  262. package/dist/types/index.d.mts +10 -0
  263. package/dist/types/index.mjs +7 -0
  264. package/dist/types/plugin.cjs +35 -0
  265. package/dist/types/plugin.cjs.map +1 -0
  266. package/dist/types/plugin.d.cts +218 -0
  267. package/dist/types/plugin.d.cts.map +1 -0
  268. package/dist/types/plugin.d.mts +218 -0
  269. package/dist/types/plugin.d.mts.map +1 -0
  270. package/dist/types/plugin.mjs +33 -0
  271. package/dist/types/plugin.mjs.map +1 -0
  272. package/dist/types/tsconfig.cjs +0 -0
  273. package/dist/types/tsconfig.d.cts +77 -0
  274. package/dist/types/tsconfig.d.cts.map +1 -0
  275. package/dist/types/tsconfig.d.mts +77 -0
  276. package/dist/types/tsconfig.d.mts.map +1 -0
  277. package/dist/types/tsconfig.mjs +1 -0
  278. package/dist/types/unplugin.cjs +24 -0
  279. package/dist/types/unplugin.cjs.map +1 -0
  280. package/dist/types/unplugin.d.cts +41 -0
  281. package/dist/types/unplugin.d.cts.map +1 -0
  282. package/dist/types/unplugin.d.mts +41 -0
  283. package/dist/types/unplugin.d.mts.map +1 -0
  284. package/dist/types/unplugin.mjs +22 -0
  285. package/dist/types/unplugin.mjs.map +1 -0
  286. package/package.json +238 -0
@@ -0,0 +1,218 @@
1
+ import { CommandType } from "./commands.cjs";
2
+ import { BuilderVariant, InferUnpluginOptions, UnpluginBuilderVariant } from "./unplugin.cjs";
3
+ import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.cjs";
4
+ import { EnvironmentConfig, EnvironmentResolvedConfig, PluginConfig, ResolvedConfig } from "./config.cjs";
5
+ import { AnyFunction, MaybePromise } from "@stryke/types/base";
6
+ import { ExternalIdResult, HookFilter, TransformResult } from "unplugin";
7
+ import { ArrayValues } from "@stryke/types/array";
8
+ import { LoadResult } from "rollup";
9
+
10
+ //#region src/types/plugin.d.ts
11
+ interface PluginHookObject<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> {
12
+ /**
13
+ * The order in which the plugin should be applied.
14
+ */
15
+ order?: "pre" | "post" | null | undefined;
16
+ /**
17
+ * A filter to determine when the hook should be called.
18
+ */
19
+ filter?: Pick<HookFilter, TFilter>;
20
+ /**
21
+ * The hook function to be called.
22
+ */
23
+ handler: THookFunction;
24
+ }
25
+ type PluginHook<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> = THookFunction | PluginHookObject<THookFunction, TFilter>;
26
+ /**
27
+ * A result returned by the plugin from the `types` hook that describes the declaration types output file.
28
+ */
29
+ interface TypesResult {
30
+ directives?: string[];
31
+ code: string;
32
+ }
33
+ type PluginHookFunctions<TContext extends PluginContext> = { [TCommandType in CommandType]: (this: TContext) => MaybePromise<void> } & {
34
+ /**
35
+ * A function that returns configuration options to be merged with the build context's options.
36
+ *
37
+ * @remarks
38
+ * Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
39
+ *
40
+ * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect.
41
+ *
42
+ * @see https://vitejs.dev/guide/api-plugin#config
43
+ *
44
+ * @param this - The build context.
45
+ * @param config - The partial configuration object to be modified.
46
+ * @returns A promise that resolves to a partial configuration object.
47
+ */
48
+ config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>;
49
+ /**
50
+ * Modify environment configs before it's resolved. The hook can either mutate the passed-in environment config directly, or return a partial config object that will be deeply merged into existing config.
51
+ *
52
+ * @remarks
53
+ * This hook is called for each environment with a partially resolved environment config that already accounts for the default environment config values set at the root level. If plugins need to modify the config of a given environment, they should do it in this hook instead of the config hook. Leaving the config hook only for modifying the root default environment config.
54
+ *
55
+ * @see https://vitejs.dev/guide/api-plugin#configenvironment
56
+ *
57
+ * @param this - The build context.
58
+ * @param name - The name of the environment being configured.
59
+ * @param environment - The Vite-like environment object containing information about the current build environment.
60
+ * @returns A promise that resolves when the hook is complete.
61
+ */
62
+ configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>;
63
+ /**
64
+ * A hook that is called when the plugin is resolved.
65
+ *
66
+ * @see https://vitejs.dev/guide/api-plugin#configresolved
67
+ *
68
+ * @param this - The build context.
69
+ * @returns A promise that resolves when the hook is complete.
70
+ */
71
+ configResolved: (this: TContext) => MaybePromise<void>;
72
+ /**
73
+ * A hook that is called to overwrite the generated declaration types file (.d.ts). The generated type definitions should describe the built-in modules/logic added during the `prepare` task.
74
+ *
75
+ * @param this - The build context.
76
+ * @param code - The source code to generate types for.
77
+ * @returns A promise that resolves when the hook is complete.
78
+ */
79
+ types: (this: TContext, code: string) => MaybePromise<TypesResult | string | undefined | null>;
80
+ /**
81
+ * A hook that is called at the start of the build process.
82
+ *
83
+ * @param this - The build context and unplugin build context.
84
+ * @returns A promise that resolves when the hook is complete.
85
+ */
86
+ buildStart: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
87
+ /**
88
+ * A hook that is called at the end of the build process.
89
+ *
90
+ * @param this - The build context and unplugin build context.
91
+ * @returns A promise that resolves when the hook is complete.
92
+ */
93
+ buildEnd: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
94
+ /**
95
+ * A hook that is called to transform the source code.
96
+ *
97
+ * @param this - The build context, unplugin build context, and unplugin context.
98
+ * @param code - The source code to transform.
99
+ * @param id - The identifier of the source code.
100
+ * @returns A promise that resolves when the hook is complete.
101
+ */
102
+ transform: (this: BuildPluginContext<TContext["config"]> & TContext, code: string, id: string) => MaybePromise<TransformResult>;
103
+ /**
104
+ * A hook that is called to load the source code.
105
+ *
106
+ * @param this - The build context, unplugin build context, and unplugin context.
107
+ * @param id - The identifier of the source code.
108
+ * @returns A promise that resolves when the hook is complete.
109
+ */
110
+ load: (this: BuildPluginContext<TContext["config"]> & TContext, id: string) => MaybePromise<LoadResult>;
111
+ /**
112
+ * A hook that is called to resolve the identifier of the source code.
113
+ *
114
+ * @param this - The build context, unplugin build context, and unplugin context.
115
+ * @param id - The identifier of the source code.
116
+ * @param importer - The importer of the source code.
117
+ * @param options - The options for resolving the identifier.
118
+ * @returns A promise that resolves when the hook is complete.
119
+ */
120
+ resolveId: (this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
121
+ isEntry: boolean;
122
+ }) => MaybePromise<string | ExternalIdResult | null | undefined>;
123
+ /**
124
+ * A hook that is called to write the bundle to disk.
125
+ *
126
+ * @param this - The build context.
127
+ * @returns A promise that resolves when the hook is complete.
128
+ */
129
+ writeBundle: (this: TContext) => MaybePromise<void>;
130
+ };
131
+ type PluginHooks<TContext extends PluginContext> = { [TPluginHook in keyof PluginHookFunctions<TContext>]?: PluginHook<PluginHookFunctions<TContext>[TPluginHook]> } & {
132
+ transform: PluginHook<PluginHookFunctions<TContext>["transform"], "code" | "id">;
133
+ load: PluginHook<PluginHookFunctions<TContext>["load"], "id">;
134
+ resolveId: PluginHook<PluginHookFunctions<TContext>["resolveId"], "id">;
135
+ };
136
+ type DeepPartial$1<T> = { [K in keyof T]?: DeepPartial$1<T[K]> };
137
+ type Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> = Partial<PluginHooks<TContext>> & {
138
+ /**
139
+ * The name of the plugin, for use in deduplication, error messages and logs.
140
+ */
141
+ name: string;
142
+ /**
143
+ * An API object that can be used for inter-plugin communication.
144
+ *
145
+ * @see https://rollupjs.org/plugin-development/#direct-plugin-communication
146
+ */
147
+ api?: Record<string, any>;
148
+ /**
149
+ * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering is still subject to the `order` property in the hook object.
150
+ *
151
+ * @remarks
152
+ * The Plugin invocation order is as follows:
153
+ * - `enforce: 'pre'` plugins
154
+ * - `order: 'pre'` plugin hooks
155
+ * - any other plugins (normal)
156
+ * - `order: 'post'` plugin hooks
157
+ * - `enforce: 'post'` plugins
158
+ *
159
+ * @see https://vitejs.dev/guide/api-plugin.html#plugin-ordering
160
+ * @see https://rollupjs.org/plugin-development/#build-hooks
161
+ * @see https://webpack.js.org/concepts/loaders/#enforce---pre-and-post
162
+ * @see https://esbuild.github.io/plugins/#concepts
163
+ */
164
+ enforce?: "pre" | "post";
165
+ /**
166
+ * A function to determine if two plugins are the same and can be de-duplicated.
167
+ *
168
+ * @remarks
169
+ * If this is not provided, plugins are de-duplicated by comparing their names.
170
+ *
171
+ * @param other - The other plugin to compare against.
172
+ * @returns `true` if the two plugins are the same, `false` otherwise.
173
+ */
174
+ dedupe?: false | ((other: Plugin<any>) => boolean);
175
+ /**
176
+ * A list of pre-requisite plugins that must be loaded before this plugin can be used.
177
+ */
178
+ /**
179
+ * Define environments where this plugin should be active. By default, the plugin is active in all environments.
180
+ *
181
+ * @param environment - The environment to check.
182
+ * @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
183
+ */
184
+ applyToEnvironment?: (environment: EnvironmentResolvedConfig) => boolean | PluginConfig<TContext>;
185
+ /**
186
+ * A function that returns configuration options to be merged with the build context's options.
187
+ *
188
+ * @remarks
189
+ * Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
190
+ *
191
+ * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect. If you want to add plugins, consider doing so in the {@link Plugin.dependsOn} property instead.
192
+ *
193
+ * @see https://vitejs.dev/guide/api-plugin#config
194
+ *
195
+ * @param this - The build context.
196
+ * @param config - The partial configuration object to be modified.
197
+ * @returns A promise that resolves to a partial configuration object.
198
+ */
199
+ config?: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>> | (DeepPartial$1<TContext["config"]> & Record<string, any>);
200
+ } & { [TBuilderVariant in BuilderVariant]?: InferUnpluginOptions<TContext, TBuilderVariant> };
201
+ declare const PLUGIN_NON_HOOK_FIELDS: readonly ["name", "api", "enforce", "dedupe", "applyToEnvironment"];
202
+ type PluginNonHookFields = ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS> | UnpluginBuilderVariant;
203
+ declare const PLUGIN_HOOKS_FIELDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize", "config", "configEnvironment", "configResolved", "types", "buildStart", "buildEnd", "transform", "load", "resolveId", "writeBundle"];
204
+ type PluginHookFields<TContext extends PluginContext = PluginContext> = keyof PluginHookFunctions<TContext>;
205
+ declare const KNOWN_PLUGIN_FIELDS: readonly ["name", "api", "enforce", "dedupe", "applyToEnvironment", "new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize", "config", "configEnvironment", "configResolved", "types", "buildStart", "buildEnd", "transform", "load", "resolveId", "writeBundle", ...BuilderVariant[]];
206
+ type PluginFields = ArrayValues<typeof KNOWN_PLUGIN_FIELDS>;
207
+ declare type __ΩPluginHookObject = any[];
208
+ declare type __ΩPluginHook = any[];
209
+ declare type __ΩTypesResult = any[];
210
+ declare type __ΩPluginHookFunctions = any[];
211
+ declare type __ΩPluginHooks = any[];
212
+ declare type __ΩPlugin = any[];
213
+ declare type __ΩPluginNonHookFields = any[];
214
+ declare type __ΩPluginHookFields = any[];
215
+ declare type __ΩPluginFields = any[];
216
+ //#endregion
217
+ export { KNOWN_PLUGIN_FIELDS, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, Plugin, PluginFields, PluginHook, PluginHookFields, PluginHookFunctions, PluginHookObject, PluginHooks, PluginNonHookFields, TypesResult, __ΩPlugin, __ΩPluginFields, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookFunctions, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩTypesResult };
218
+ //# sourceMappingURL=plugin.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;UAsCiB,uCACO,mCACA;EAFP;;;EAYD,KAAA,CAAA,EAAA,KAAA,GAAA,MAAA,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lC,CAAA,IA/H+C,UA+H/C,CA9HN,mBA8HM,CA9Hc,QA8Hd,CAAA,CA9HwB,WA8HxB,CAAA,CAAA,EAEV,GAAY;EAAkC,SAAA,EA7HjC,UA6HiC,CA5H1C,mBA4H0C,CA5HtB,QA4HsB,CAAA,CAAA,WAAA,CAAA,EAAA,MAAA,GAAA,IAAA,CAAA;EAAgB,IAAA,EAzHtD,UAyHsD,CAzH3C,mBAyH2C,CAzHvB,QAyHuB,CAAA,CAAA,MAAA,CAAA,EAAA,IAAA,CAAA;EAClC,SAAA,EAzHf,UAyHe,CAzHJ,mBAyHI,CAzHgB,QAyHhB,CAAA,CAAA,WAAA,CAAA,EAAA,IAAA,CAAA;CAApB;KAtHH,aAsHsB,CAAA,CAAA,CAAA,GAAA,QAEd,MAvHC,CAuHD,IAvHM,aA2HT,CA3HqB,CA2HrB,CA3HuB,CA2HvB,CAAA,CAAA,EAEV;KA1HY,wBACO,cAAc,kBAAkB,cAAc,mBAC7D,QAAQ,YAAY;;;;;;;;;;QAWhB;;;;;;;;;;;;;;;;;;;;;;;;;;;4BA6BoB;;;;;;;;;;qCAcX,wCACA,aAAa;;;;;;;;;;;;;;;WAiBxB,kBAEU,kBAAkB,wBACrB,aAAa,cAAY,sBAAsB,yBAErD,cAAY,sBAAsB;0BAEnB,kBAAkB,qBACpC,UACA;cAIS;KAQD,mBAAA,GACR,mBAAmB,0BACnB;cAES;KAcD,kCAAkC,gBAAgB,uBACtD,oBAAoB;cAEf,mTAAmB;KAMpB,YAAA,GAAe,mBAAmB"}
@@ -0,0 +1,218 @@
1
+ import { CommandType } from "./commands.mjs";
2
+ import { BuilderVariant, InferUnpluginOptions, UnpluginBuilderVariant } from "./unplugin.mjs";
3
+ import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.mjs";
4
+ import { EnvironmentConfig, EnvironmentResolvedConfig, PluginConfig, ResolvedConfig } from "./config.mjs";
5
+ import { ExternalIdResult, HookFilter, TransformResult } from "unplugin";
6
+ import { AnyFunction, MaybePromise } from "@stryke/types/base";
7
+ import { ArrayValues } from "@stryke/types/array";
8
+ import { LoadResult } from "rollup";
9
+
10
+ //#region src/types/plugin.d.ts
11
+ interface PluginHookObject<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> {
12
+ /**
13
+ * The order in which the plugin should be applied.
14
+ */
15
+ order?: "pre" | "post" | null | undefined;
16
+ /**
17
+ * A filter to determine when the hook should be called.
18
+ */
19
+ filter?: Pick<HookFilter, TFilter>;
20
+ /**
21
+ * The hook function to be called.
22
+ */
23
+ handler: THookFunction;
24
+ }
25
+ type PluginHook<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> = THookFunction | PluginHookObject<THookFunction, TFilter>;
26
+ /**
27
+ * A result returned by the plugin from the `types` hook that describes the declaration types output file.
28
+ */
29
+ interface TypesResult {
30
+ directives?: string[];
31
+ code: string;
32
+ }
33
+ type PluginHookFunctions<TContext extends PluginContext> = { [TCommandType in CommandType]: (this: TContext) => MaybePromise<void> } & {
34
+ /**
35
+ * A function that returns configuration options to be merged with the build context's options.
36
+ *
37
+ * @remarks
38
+ * Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
39
+ *
40
+ * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect.
41
+ *
42
+ * @see https://vitejs.dev/guide/api-plugin#config
43
+ *
44
+ * @param this - The build context.
45
+ * @param config - The partial configuration object to be modified.
46
+ * @returns A promise that resolves to a partial configuration object.
47
+ */
48
+ config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>;
49
+ /**
50
+ * Modify environment configs before it's resolved. The hook can either mutate the passed-in environment config directly, or return a partial config object that will be deeply merged into existing config.
51
+ *
52
+ * @remarks
53
+ * This hook is called for each environment with a partially resolved environment config that already accounts for the default environment config values set at the root level. If plugins need to modify the config of a given environment, they should do it in this hook instead of the config hook. Leaving the config hook only for modifying the root default environment config.
54
+ *
55
+ * @see https://vitejs.dev/guide/api-plugin#configenvironment
56
+ *
57
+ * @param this - The build context.
58
+ * @param name - The name of the environment being configured.
59
+ * @param environment - The Vite-like environment object containing information about the current build environment.
60
+ * @returns A promise that resolves when the hook is complete.
61
+ */
62
+ configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>;
63
+ /**
64
+ * A hook that is called when the plugin is resolved.
65
+ *
66
+ * @see https://vitejs.dev/guide/api-plugin#configresolved
67
+ *
68
+ * @param this - The build context.
69
+ * @returns A promise that resolves when the hook is complete.
70
+ */
71
+ configResolved: (this: TContext) => MaybePromise<void>;
72
+ /**
73
+ * A hook that is called to overwrite the generated declaration types file (.d.ts). The generated type definitions should describe the built-in modules/logic added during the `prepare` task.
74
+ *
75
+ * @param this - The build context.
76
+ * @param code - The source code to generate types for.
77
+ * @returns A promise that resolves when the hook is complete.
78
+ */
79
+ types: (this: TContext, code: string) => MaybePromise<TypesResult | string | undefined | null>;
80
+ /**
81
+ * A hook that is called at the start of the build process.
82
+ *
83
+ * @param this - The build context and unplugin build context.
84
+ * @returns A promise that resolves when the hook is complete.
85
+ */
86
+ buildStart: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
87
+ /**
88
+ * A hook that is called at the end of the build process.
89
+ *
90
+ * @param this - The build context and unplugin build context.
91
+ * @returns A promise that resolves when the hook is complete.
92
+ */
93
+ buildEnd: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
94
+ /**
95
+ * A hook that is called to transform the source code.
96
+ *
97
+ * @param this - The build context, unplugin build context, and unplugin context.
98
+ * @param code - The source code to transform.
99
+ * @param id - The identifier of the source code.
100
+ * @returns A promise that resolves when the hook is complete.
101
+ */
102
+ transform: (this: BuildPluginContext<TContext["config"]> & TContext, code: string, id: string) => MaybePromise<TransformResult>;
103
+ /**
104
+ * A hook that is called to load the source code.
105
+ *
106
+ * @param this - The build context, unplugin build context, and unplugin context.
107
+ * @param id - The identifier of the source code.
108
+ * @returns A promise that resolves when the hook is complete.
109
+ */
110
+ load: (this: BuildPluginContext<TContext["config"]> & TContext, id: string) => MaybePromise<LoadResult>;
111
+ /**
112
+ * A hook that is called to resolve the identifier of the source code.
113
+ *
114
+ * @param this - The build context, unplugin build context, and unplugin context.
115
+ * @param id - The identifier of the source code.
116
+ * @param importer - The importer of the source code.
117
+ * @param options - The options for resolving the identifier.
118
+ * @returns A promise that resolves when the hook is complete.
119
+ */
120
+ resolveId: (this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
121
+ isEntry: boolean;
122
+ }) => MaybePromise<string | ExternalIdResult | null | undefined>;
123
+ /**
124
+ * A hook that is called to write the bundle to disk.
125
+ *
126
+ * @param this - The build context.
127
+ * @returns A promise that resolves when the hook is complete.
128
+ */
129
+ writeBundle: (this: TContext) => MaybePromise<void>;
130
+ };
131
+ type PluginHooks<TContext extends PluginContext> = { [TPluginHook in keyof PluginHookFunctions<TContext>]?: PluginHook<PluginHookFunctions<TContext>[TPluginHook]> } & {
132
+ transform: PluginHook<PluginHookFunctions<TContext>["transform"], "code" | "id">;
133
+ load: PluginHook<PluginHookFunctions<TContext>["load"], "id">;
134
+ resolveId: PluginHook<PluginHookFunctions<TContext>["resolveId"], "id">;
135
+ };
136
+ type DeepPartial$1<T> = { [K in keyof T]?: DeepPartial$1<T[K]> };
137
+ type Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> = Partial<PluginHooks<TContext>> & {
138
+ /**
139
+ * The name of the plugin, for use in deduplication, error messages and logs.
140
+ */
141
+ name: string;
142
+ /**
143
+ * An API object that can be used for inter-plugin communication.
144
+ *
145
+ * @see https://rollupjs.org/plugin-development/#direct-plugin-communication
146
+ */
147
+ api?: Record<string, any>;
148
+ /**
149
+ * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering is still subject to the `order` property in the hook object.
150
+ *
151
+ * @remarks
152
+ * The Plugin invocation order is as follows:
153
+ * - `enforce: 'pre'` plugins
154
+ * - `order: 'pre'` plugin hooks
155
+ * - any other plugins (normal)
156
+ * - `order: 'post'` plugin hooks
157
+ * - `enforce: 'post'` plugins
158
+ *
159
+ * @see https://vitejs.dev/guide/api-plugin.html#plugin-ordering
160
+ * @see https://rollupjs.org/plugin-development/#build-hooks
161
+ * @see https://webpack.js.org/concepts/loaders/#enforce---pre-and-post
162
+ * @see https://esbuild.github.io/plugins/#concepts
163
+ */
164
+ enforce?: "pre" | "post";
165
+ /**
166
+ * A function to determine if two plugins are the same and can be de-duplicated.
167
+ *
168
+ * @remarks
169
+ * If this is not provided, plugins are de-duplicated by comparing their names.
170
+ *
171
+ * @param other - The other plugin to compare against.
172
+ * @returns `true` if the two plugins are the same, `false` otherwise.
173
+ */
174
+ dedupe?: false | ((other: Plugin<any>) => boolean);
175
+ /**
176
+ * A list of pre-requisite plugins that must be loaded before this plugin can be used.
177
+ */
178
+ /**
179
+ * Define environments where this plugin should be active. By default, the plugin is active in all environments.
180
+ *
181
+ * @param environment - The environment to check.
182
+ * @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
183
+ */
184
+ applyToEnvironment?: (environment: EnvironmentResolvedConfig) => boolean | PluginConfig<TContext>;
185
+ /**
186
+ * A function that returns configuration options to be merged with the build context's options.
187
+ *
188
+ * @remarks
189
+ * Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
190
+ *
191
+ * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect. If you want to add plugins, consider doing so in the {@link Plugin.dependsOn} property instead.
192
+ *
193
+ * @see https://vitejs.dev/guide/api-plugin#config
194
+ *
195
+ * @param this - The build context.
196
+ * @param config - The partial configuration object to be modified.
197
+ * @returns A promise that resolves to a partial configuration object.
198
+ */
199
+ config?: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>> | (DeepPartial$1<TContext["config"]> & Record<string, any>);
200
+ } & { [TBuilderVariant in BuilderVariant]?: InferUnpluginOptions<TContext, TBuilderVariant> };
201
+ declare const PLUGIN_NON_HOOK_FIELDS: readonly ["name", "api", "enforce", "dedupe", "applyToEnvironment"];
202
+ type PluginNonHookFields = ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS> | UnpluginBuilderVariant;
203
+ declare const PLUGIN_HOOKS_FIELDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize", "config", "configEnvironment", "configResolved", "types", "buildStart", "buildEnd", "transform", "load", "resolveId", "writeBundle"];
204
+ type PluginHookFields<TContext extends PluginContext = PluginContext> = keyof PluginHookFunctions<TContext>;
205
+ declare const KNOWN_PLUGIN_FIELDS: readonly ["name", "api", "enforce", "dedupe", "applyToEnvironment", "new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize", "config", "configEnvironment", "configResolved", "types", "buildStart", "buildEnd", "transform", "load", "resolveId", "writeBundle", ...BuilderVariant[]];
206
+ type PluginFields = ArrayValues<typeof KNOWN_PLUGIN_FIELDS>;
207
+ declare type __ΩPluginHookObject = any[];
208
+ declare type __ΩPluginHook = any[];
209
+ declare type __ΩTypesResult = any[];
210
+ declare type __ΩPluginHookFunctions = any[];
211
+ declare type __ΩPluginHooks = any[];
212
+ declare type __ΩPlugin = any[];
213
+ declare type __ΩPluginNonHookFields = any[];
214
+ declare type __ΩPluginHookFields = any[];
215
+ declare type __ΩPluginFields = any[];
216
+ //#endregion
217
+ export { KNOWN_PLUGIN_FIELDS, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, Plugin, PluginFields, PluginHook, PluginHookFields, PluginHookFunctions, PluginHookObject, PluginHooks, PluginNonHookFields, TypesResult, __ΩPlugin, __ΩPluginFields, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookFunctions, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩTypesResult };
218
+ //# sourceMappingURL=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ands.mjs";
3
+
4
+ //#region src/types/plugin.ts
5
+ const PLUGIN_NON_HOOK_FIELDS = [
6
+ "name",
7
+ "api",
8
+ "enforce",
9
+ "dedupe",
10
+ "applyToEnvironment"
11
+ ];
12
+ const PLUGIN_HOOKS_FIELDS = [
13
+ ...SUPPORTED_COMMANDS,
14
+ "config",
15
+ "configEnvironment",
16
+ "configResolved",
17
+ "types",
18
+ "buildStart",
19
+ "buildEnd",
20
+ "transform",
21
+ "load",
22
+ "resolveId",
23
+ "writeBundle"
24
+ ];
25
+ const KNOWN_PLUGIN_FIELDS = [
26
+ ...PLUGIN_NON_HOOK_FIELDS,
27
+ ...PLUGIN_HOOKS_FIELDS,
28
+ ...BUILDER_VARIANTS
29
+ ];
30
+
31
+ //#endregion
32
+ export { KNOWN_PLUGIN_FIELDS, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS };
33
+ //# sourceMappingURL=plugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ArrayValues } from \"@stryke/types/array\";\nimport type { AnyFunction, MaybePromise } from \"@stryke/types/base\";\nimport { LoadResult } from \"rollup\";\nimport type { ExternalIdResult, HookFilter, TransformResult } from \"unplugin\";\nimport type { CommandType } from \"./commands\";\nimport { SUPPORTED_COMMANDS } from \"./commands\";\nimport type {\n EnvironmentConfig,\n EnvironmentResolvedConfig,\n PluginConfig,\n ResolvedConfig\n} from \"./config\";\nimport type {\n BuildPluginContext,\n PluginContext,\n UnresolvedContext\n} from \"./context\";\nimport type { BuilderVariant, UnpluginBuilderVariant } from \"./unplugin\";\nimport { BUILDER_VARIANTS, InferUnpluginOptions } from \"./unplugin\";\n\nexport interface PluginHookObject<\n THookFunction extends AnyFunction,\n TFilter extends keyof HookFilter = never\n> {\n /**\n * The order in which the plugin should be applied.\n */\n order?: \"pre\" | \"post\" | null | undefined;\n\n /**\n * A filter to determine when the hook should be called.\n */\n filter?: Pick<HookFilter, TFilter>;\n\n /**\n * The hook function to be called.\n */\n handler: THookFunction;\n}\n\nexport type PluginHook<\n THookFunction extends AnyFunction,\n TFilter extends keyof HookFilter = never\n> = THookFunction | PluginHookObject<THookFunction, TFilter>;\n\n/**\n * A result returned by the plugin from the `types` hook that describes the declaration types output file.\n */\nexport interface TypesResult {\n directives?: string[];\n code: string;\n}\n\nexport type PluginHookFunctions<TContext extends PluginContext> = {\n [TCommandType in CommandType]: (this: TContext) => MaybePromise<void>;\n} & {\n /**\n * A function that returns configuration options to be merged with the build context's options.\n *\n * @remarks\n * Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.\n *\n * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect.\n *\n * @see https://vitejs.dev/guide/api-plugin#config\n *\n * @param this - The build context.\n * @param config - The partial configuration object to be modified.\n * @returns A promise that resolves to a partial configuration object.\n */\n config: (\n this: UnresolvedContext<TContext[\"config\"]>\n ) => MaybePromise<DeepPartial<TContext[\"config\"]> & Record<string, any>>;\n\n /**\n * Modify environment configs before it's resolved. The hook can either mutate the passed-in environment config directly, or return a partial config object that will be deeply merged into existing config.\n *\n * @remarks\n * This hook is called for each environment with a partially resolved environment config that already accounts for the default environment config values set at the root level. If plugins need to modify the config of a given environment, they should do it in this hook instead of the config hook. Leaving the config hook only for modifying the root default environment config.\n *\n * @see https://vitejs.dev/guide/api-plugin#configenvironment\n *\n * @param this - The build context.\n * @param name - The name of the environment being configured.\n * @param environment - The Vite-like environment object containing information about the current build environment.\n * @returns A promise that resolves when the hook is complete.\n */\n configEnvironment: (\n this: TContext,\n name: string,\n environment: EnvironmentConfig\n ) => MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>;\n\n /**\n * A hook that is called when the plugin is resolved.\n *\n * @see https://vitejs.dev/guide/api-plugin#configresolved\n *\n * @param this - The build context.\n * @returns A promise that resolves when the hook is complete.\n */\n configResolved: (this: TContext) => MaybePromise<void>;\n\n /**\n * A hook that is called to overwrite the generated declaration types file (.d.ts). The generated type definitions should describe the built-in modules/logic added during the `prepare` task.\n *\n * @param this - The build context.\n * @param code - The source code to generate types for.\n * @returns A promise that resolves when the hook is complete.\n */\n types: (\n this: TContext,\n code: string\n ) => MaybePromise<TypesResult | string | undefined | null>;\n\n /**\n * A hook that is called at the start of the build process.\n *\n * @param this - The build context and unplugin build context.\n * @returns A promise that resolves when the hook is complete.\n */\n buildStart: (\n this: BuildPluginContext<TContext[\"config\"]> & TContext\n ) => MaybePromise<void>;\n\n /**\n * A hook that is called at the end of the build process.\n *\n * @param this - The build context and unplugin build context.\n * @returns A promise that resolves when the hook is complete.\n */\n buildEnd: (\n this: BuildPluginContext<TContext[\"config\"]> & TContext\n ) => MaybePromise<void>;\n\n /**\n * A hook that is called to transform the source code.\n *\n * @param this - The build context, unplugin build context, and unplugin context.\n * @param code - The source code to transform.\n * @param id - The identifier of the source code.\n * @returns A promise that resolves when the hook is complete.\n */\n transform: (\n this: BuildPluginContext<TContext[\"config\"]> & TContext,\n code: string,\n id: string\n ) => MaybePromise<TransformResult>;\n\n /**\n * A hook that is called to load the source code.\n *\n * @param this - The build context, unplugin build context, and unplugin context.\n * @param id - The identifier of the source code.\n * @returns A promise that resolves when the hook is complete.\n */\n load: (\n this: BuildPluginContext<TContext[\"config\"]> & TContext,\n id: string\n ) => MaybePromise<LoadResult>;\n\n /**\n * A hook that is called to resolve the identifier of the source code.\n *\n * @param this - The build context, unplugin build context, and unplugin context.\n * @param id - The identifier of the source code.\n * @param importer - The importer of the source code.\n * @param options - The options for resolving the identifier.\n * @returns A promise that resolves when the hook is complete.\n */\n resolveId: (\n this: BuildPluginContext<TContext[\"config\"]> & TContext,\n id: string,\n importer: string | undefined,\n options: { isEntry: boolean }\n ) => MaybePromise<string | ExternalIdResult | null | undefined>;\n\n /**\n * A hook that is called to write the bundle to disk.\n *\n * @param this - The build context.\n * @returns A promise that resolves when the hook is complete.\n */\n writeBundle: (this: TContext) => MaybePromise<void>;\n};\n\nexport type PluginHooks<TContext extends PluginContext> = {\n [TPluginHook in keyof PluginHookFunctions<TContext>]?: PluginHook<\n PluginHookFunctions<TContext>[TPluginHook]\n >;\n} & {\n transform: PluginHook<\n PluginHookFunctions<TContext>[\"transform\"],\n \"code\" | \"id\"\n >;\n load: PluginHook<PluginHookFunctions<TContext>[\"load\"], \"id\">;\n resolveId: PluginHook<PluginHookFunctions<TContext>[\"resolveId\"], \"id\">;\n};\n\ntype DeepPartial<T> = {\n [K in keyof T]?: DeepPartial<T[K]>;\n};\n\nexport type Plugin<\n TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>\n> = Partial<PluginHooks<TContext>> & {\n /**\n * The name of the plugin, for use in deduplication, error messages and logs.\n */\n name: string;\n\n /**\n * An API object that can be used for inter-plugin communication.\n *\n * @see https://rollupjs.org/plugin-development/#direct-plugin-communication\n */\n api?: Record<string, any>;\n\n /**\n * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering is still subject to the `order` property in the hook object.\n *\n * @remarks\n * The Plugin invocation order is as follows:\n * - `enforce: 'pre'` plugins\n * - `order: 'pre'` plugin hooks\n * - any other plugins (normal)\n * - `order: 'post'` plugin hooks\n * - `enforce: 'post'` plugins\n *\n * @see https://vitejs.dev/guide/api-plugin.html#plugin-ordering\n * @see https://rollupjs.org/plugin-development/#build-hooks\n * @see https://webpack.js.org/concepts/loaders/#enforce---pre-and-post\n * @see https://esbuild.github.io/plugins/#concepts\n */\n enforce?: \"pre\" | \"post\";\n\n /**\n * A function to determine if two plugins are the same and can be de-duplicated.\n *\n * @remarks\n * If this is not provided, plugins are de-duplicated by comparing their names.\n *\n * @param other - The other plugin to compare against.\n * @returns `true` if the two plugins are the same, `false` otherwise.\n */\n dedupe?: false | ((other: Plugin<any>) => boolean);\n\n /**\n * A list of pre-requisite plugins that must be loaded before this plugin can be used.\n */\n // dependsOn?: PluginConfig<TContext>[];\n\n /**\n * Define environments where this plugin should be active. By default, the plugin is active in all environments.\n *\n * @param environment - The environment to check.\n * @returns `true` if the plugin should be active in the specified environment, `false` otherwise.\n */\n applyToEnvironment?: (\n environment: EnvironmentResolvedConfig\n ) => boolean | PluginConfig<TContext>;\n\n /**\n * A function that returns configuration options to be merged with the build context's options.\n *\n * @remarks\n * Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.\n *\n * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect. If you want to add plugins, consider doing so in the {@link Plugin.dependsOn} property instead.\n *\n * @see https://vitejs.dev/guide/api-plugin#config\n *\n * @param this - The build context.\n * @param config - The partial configuration object to be modified.\n * @returns A promise that resolves to a partial configuration object.\n */\n config?:\n | PluginHook<\n (\n this: UnresolvedContext<TContext[\"config\"]>\n ) => MaybePromise<DeepPartial<TContext[\"config\"]> & Record<string, any>>\n >\n | (DeepPartial<TContext[\"config\"]> & Record<string, any>);\n} & {\n [TBuilderVariant in BuilderVariant]?: InferUnpluginOptions<\n TContext,\n TBuilderVariant\n >;\n};\n\nexport const PLUGIN_NON_HOOK_FIELDS = [\n \"name\",\n \"api\",\n \"enforce\",\n \"dedupe\",\n \"applyToEnvironment\"\n] as const;\n\nexport type PluginNonHookFields =\n | ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS>\n | UnpluginBuilderVariant;\n\nexport const PLUGIN_HOOKS_FIELDS = [\n ...SUPPORTED_COMMANDS,\n \"config\",\n \"configEnvironment\",\n \"configResolved\",\n \"types\",\n \"buildStart\",\n \"buildEnd\",\n \"transform\",\n \"load\",\n \"resolveId\",\n \"writeBundle\"\n] as const;\n\nexport type PluginHookFields<TContext extends PluginContext = PluginContext> =\n keyof PluginHookFunctions<TContext>;\n\nexport const KNOWN_PLUGIN_FIELDS = [\n ...PLUGIN_NON_HOOK_FIELDS,\n ...PLUGIN_HOOKS_FIELDS,\n ...BUILDER_VARIANTS\n] as const;\n\nexport type PluginFields = ArrayValues<typeof KNOWN_PLUGIN_FIELDS>;\n"],"mappings":";;;;AAoTA,MAAa,yBAAyB;CACpC;CACA;CACA;CACA;CACA;CACD;AAMD,MAAa,sBAAsB;CACjC,GAAG;CACH;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAKD,MAAa,sBAAsB;CACjC,GAAG;CACH,GAAG;CACH,GAAG;CACJ"}
File without changes
@@ -0,0 +1,77 @@
1
+ import { CompilerOptions, TsConfigJson } from "@stryke/types/tsconfig";
2
+ import ts from "typescript";
3
+
4
+ //#region src/types/tsconfig.d.ts
5
+ type ReflectionMode = "default" | "explicit" | "never";
6
+ type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
7
+ /**
8
+ * Defines the level of reflection to be used during the transpilation process.
9
+ *
10
+ * @remarks
11
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
12
+ * - `minimal` - Only the essential type information is captured.
13
+ * - `normal` - Additional type information is captured, including some contextual data.
14
+ * - `verbose` - All available type information is captured, including detailed contextual data.
15
+ */
16
+ type ReflectionLevel = "minimal" | "normal" | "verbose";
17
+ interface DeepkitOptions {
18
+ /**
19
+ * Either true to activate reflection for all files compiled using this tsconfig,
20
+ * or a list of globs/file paths relative to this tsconfig.json.
21
+ * Globs/file paths can be prefixed with a ! to exclude them.
22
+ */
23
+ reflection?: RawReflectionMode;
24
+ /**
25
+ * Defines the level of reflection to be used during the transpilation process.
26
+ *
27
+ * @remarks
28
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
29
+ * - `minimal` - Only the essential type information is captured.
30
+ * - `normal` - Additional type information is captured, including some contextual data.
31
+ * - `verbose` - All available type information is captured, including detailed contextual data.
32
+ */
33
+ reflectionLevel?: ReflectionLevel;
34
+ }
35
+ type TSCompilerOptions = CompilerOptions & DeepkitOptions;
36
+ /**
37
+ * The TypeScript compiler configuration.
38
+ *
39
+ * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
40
+ */
41
+ interface TSConfig extends Omit<TsConfigJson, "reflection"> {
42
+ /**
43
+ * Either true to activate reflection for all files compiled using this tsconfig,
44
+ * or a list of globs/file paths relative to this tsconfig.json.
45
+ * Globs/file paths can be prefixed with a ! to exclude them.
46
+ */
47
+ reflection?: RawReflectionMode;
48
+ /**
49
+ * Defines the level of reflection to be used during the transpilation process.
50
+ *
51
+ * @remarks
52
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
53
+ * - `minimal` - Only the essential type information is captured.
54
+ * - `normal` - Additional type information is captured, including some contextual data.
55
+ * - `verbose` - All available type information is captured, including detailed contextual data.
56
+ */
57
+ reflectionLevel?: ReflectionLevel;
58
+ /**
59
+ * Instructs the TypeScript compiler how to compile `.ts` files.
60
+ */
61
+ compilerOptions?: TSCompilerOptions;
62
+ }
63
+ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
64
+ originalTsconfigJson: TsConfigJson;
65
+ tsconfigJson: TSConfig;
66
+ tsconfigFilePath: string;
67
+ };
68
+ declare type __ΩReflectionMode = any[];
69
+ declare type __ΩRawReflectionMode = any[];
70
+ declare type __ΩReflectionLevel = any[];
71
+ declare type __ΩDeepkitOptions = any[];
72
+ declare type __ΩTSCompilerOptions = any[];
73
+ declare type __ΩTSConfig = any[];
74
+ declare type __ΩParsedTypeScriptConfig = any[];
75
+ //#endregion
76
+ export { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig, __ΩDeepkitOptions, __ΩParsedTypeScriptConfig, __ΩRawReflectionMode, __ΩReflectionLevel, __ΩReflectionMode, __ΩTSCompilerOptions, __ΩTSConfig };
77
+ //# sourceMappingURL=tsconfig.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tsconfig.d.cts","names":[],"sources":["../../src/types/tsconfig.ts"],"sourcesContent":[],"mappings":";;;;KAqBY,cAAA;KACA,iBAAA,GACR;AAFJ;AACA;AAiBA;AAEA;AAoBA;AAOA;;;;AAsBoB,KAnDR,eAAA,GAmDQ,SAAA,GAAA,QAAA,GAAA,SAAA;AAtBc,UA3BjB,cAAA,CA2BiB;EAAI;AAyBtC;;;;EAEwB,UAAA,CAAA,EAhDT,iBAgDS;;;;;;;;;;oBArCJ;;KAGR,iBAAA,GAAoB,kBAAkB;;;;;;UAOjC,QAAA,SAAiB,KAAK;;;;;;eAMxB;;;;;;;;;;oBAWK;;;;oBAKA;;KAGR,sBAAA,GAAyB,EAAA,CAAG;wBAChB;gBACR"}