@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,120 @@
1
+ import { replacePathTokens } from "../plugin-utils/paths.mjs";
2
+ import { appendPath } from "@stryke/path/append";
3
+ import { joinPaths } from "@stryke/path/join-paths";
4
+ import { replaceExtension, replacePath } from "@stryke/path/replace";
5
+ import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
6
+ import { toArray } from "@stryke/convert/to-array";
7
+ import { murmurhash } from "@stryke/hash/murmurhash";
8
+ import { getUniqueBy } from "@stryke/helpers/get-unique";
9
+ import { isAbsolutePath } from "@stryke/path/is-type";
10
+ import { isObject } from "@stryke/type-checks/is-object";
11
+ import { isRegExp } from "@stryke/type-checks/is-regexp";
12
+ import { isSetString } from "@stryke/type-checks/is-set-string";
13
+ import { isString } from "@stryke/type-checks/is-string";
14
+
15
+ //#region src/lib/entry.ts
16
+ function resolveEntryOutput(context, typeDefinition) {
17
+ return replaceExtension(replacePath(replacePath(replacePath(replacePath(replacePath(typeDefinition.file, joinPaths(context.workspaceConfig.workspaceRoot, context.config.root, "src")), joinPaths(context.workspaceConfig.workspaceRoot, context.config.root)), joinPaths(context.config.root, "src")), context.config.root), "src"));
18
+ }
19
+ function resolveInput(context, typeDefinition, input, output) {
20
+ return {
21
+ ...typeDefinition,
22
+ input: isSetString(input) || isRegExp(input) ? { file: String(input) } : typeDefinition,
23
+ output: output || resolveEntryOutput(context, typeDefinition)
24
+ };
25
+ }
26
+ /**
27
+ * Resolves multiple type definitions into their corresponding resolved entry type definitions.
28
+ *
29
+ * @param context - The current context
30
+ * @param typeDefinitions - The type definitions to resolve.
31
+ * @returns A promise that resolves to an array of resolved entry type definitions.
32
+ */
33
+ async function resolveInputs(context, typeDefinitions) {
34
+ return (await Promise.all((isObject(typeDefinitions) ? Object.values(typeDefinitions).flat() : toArray(typeDefinitions)).map(async (entry) => {
35
+ if (isResolvedEntryTypeDefinition(entry)) return {
36
+ ...entry,
37
+ output: entry.output ? replacePathTokens(context, entry.output) : void 0,
38
+ file: replacePathTokens(context, entry.file)
39
+ };
40
+ let typeDefinition;
41
+ if (isString(entry)) typeDefinition = parseTypeDefinition(replacePathTokens(context, entry));
42
+ else if (isRegExp(entry)) typeDefinition = { file: replacePathTokens(context, entry.source) };
43
+ else {
44
+ typeDefinition = entry;
45
+ typeDefinition.file = replacePathTokens(context, typeDefinition.file);
46
+ }
47
+ const filePath = isAbsolutePath(typeDefinition.file) ? typeDefinition.file : appendPath(typeDefinition.file, context.config.root);
48
+ if (await context.fs.isFile(filePath)) return resolveInput(context, {
49
+ file: replacePath(filePath, context.config.root),
50
+ name: typeDefinition.name
51
+ }, entry.input, entry.output);
52
+ return (await context.fs.glob(appendPath(filePath, context.workspaceConfig.workspaceRoot))).map((file) => resolveInput(context, {
53
+ file: replacePath(file, context.config.root),
54
+ name: typeDefinition.name
55
+ }, entry.input, entry.output));
56
+ }).flat().filter(Boolean))).flat();
57
+ }
58
+ /**
59
+ * Checks if the provided entry is a type definition.
60
+ *
61
+ * @param entry - The entry to check.
62
+ * @returns True if the entry is a type definition, false otherwise.
63
+ */
64
+ function isTypeDefinition(entry) {
65
+ return !isString(entry) && entry.file !== void 0;
66
+ }
67
+ /**
68
+ * Checks if the provided entry is a resolved entry type definition.
69
+ *
70
+ * @param entry - The entry to check.
71
+ * @returns True if the entry is a resolved entry type definition, false otherwise.
72
+ */
73
+ function isResolvedEntryTypeDefinition(entry) {
74
+ return !isRegExp(entry) && isTypeDefinition(entry) && entry.output !== void 0;
75
+ }
76
+ /**
77
+ * Resolves multiple type definitions into their corresponding resolved entry type definitions.
78
+ *
79
+ * @param context - The current context
80
+ * @param typeDefinitions - The type definitions to resolve.
81
+ * @returns A promise that resolves to an array of resolved entry type definitions.
82
+ */
83
+ function resolveInputsSync(context, typeDefinitions) {
84
+ return (isObject(typeDefinitions) ? Object.values(typeDefinitions).flat() : toArray(typeDefinitions)).map((entry) => {
85
+ if (isResolvedEntryTypeDefinition(entry)) return {
86
+ ...entry,
87
+ output: entry.output ? replacePathTokens(context, entry.output) : void 0,
88
+ file: replacePathTokens(context, entry.file)
89
+ };
90
+ let typeDefinition;
91
+ if (isString(entry)) typeDefinition = parseTypeDefinition(replacePathTokens(context, entry));
92
+ else if (isRegExp(entry)) typeDefinition = { file: replacePathTokens(context, entry.source) };
93
+ else {
94
+ typeDefinition = entry;
95
+ typeDefinition.file = replacePathTokens(context, typeDefinition.file);
96
+ }
97
+ const filePath = isAbsolutePath(typeDefinition.file) ? typeDefinition.file : appendPath(typeDefinition.file, context.config.root);
98
+ if (context.fs.isFileSync(filePath)) return resolveInput(context, {
99
+ file: appendPath(filePath, context.workspaceConfig.workspaceRoot),
100
+ name: typeDefinition.name
101
+ });
102
+ return context.fs.globSync(appendPath(filePath, context.workspaceConfig.workspaceRoot)).map((file) => resolveInput(context, {
103
+ file,
104
+ name: typeDefinition.name
105
+ }));
106
+ }).flat().filter(Boolean);
107
+ }
108
+ /**
109
+ * Get unique inputs from the provided list.
110
+ *
111
+ * @param inputs - The entry points to process.
112
+ * @returns An array of unique inputs (by file path or content hash).
113
+ */
114
+ function getUniqueInputs(inputs = []) {
115
+ return isObject(inputs) ? inputs : getUniqueBy(toArray(inputs), (item) => isSetString(item) ? item : murmurhash(item ?? {}, { maxLength: 24 }));
116
+ }
117
+
118
+ //#endregion
119
+ export { getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync };
120
+ //# sourceMappingURL=entry.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry.mjs","names":["typeDefinition: TypeDefinition"],"sources":["../../src/lib/entry.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 { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { murmurhash } from \"@stryke/hash/murmurhash\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { isAbsolutePath } from \"@stryke/path/is-type\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isRegExp } from \"@stryke/type-checks/is-regexp\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport type {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport { replacePathTokens } from \"../plugin-utils/paths\";\nimport { BaseConfig } from \"../types\";\nimport { ResolvedEntryTypeDefinition } from \"../types/config\";\nimport type { Context } from \"../types/context\";\n\nexport function resolveEntryOutput(\n context: Context,\n typeDefinition: TypeDefinition\n): string {\n return replaceExtension(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n typeDefinition.file,\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n \"src\"\n )\n ),\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root\n )\n ),\n joinPaths(context.config.root, \"src\")\n ),\n context.config.root\n ),\n \"src\"\n )\n );\n}\n\nexport function resolveInput(\n context: Context,\n typeDefinition: TypeDefinition,\n input?: string | RegExp | TypeDefinition | undefined,\n output?: string\n): ResolvedEntryTypeDefinition {\n return {\n ...typeDefinition,\n input:\n isSetString(input) || isRegExp(input)\n ? { file: String(input) }\n : typeDefinition,\n output: output || resolveEntryOutput(context, typeDefinition)\n };\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport async function resolveInputs(\n context: Context,\n typeDefinitions:\n | TypeDefinition\n | ResolvedEntryTypeDefinition\n | string\n | RegExp\n | (string | RegExp | TypeDefinition | ResolvedEntryTypeDefinition)[]\n | Record<\n string,\n string | RegExp | TypeDefinition | (string | RegExp | TypeDefinition)[]\n >\n): Promise<ResolvedEntryTypeDefinition[]> {\n return (\n await Promise.all(\n (isObject(typeDefinitions)\n ? Object.values(typeDefinitions).flat()\n : toArray(typeDefinitions)\n )\n .map(async entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return {\n ...entry,\n output: entry.output\n ? replacePathTokens(context, entry.output)\n : undefined,\n file: replacePathTokens(context, entry.file)\n };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else if (isRegExp(entry)) {\n typeDefinition = { file: replacePathTokens(context, entry.source) };\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(\n context,\n typeDefinition.file\n );\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.root);\n if (await context.fs.isFile(filePath)) {\n return resolveInput(\n context,\n {\n file: replacePath(filePath, context.config.root),\n name: typeDefinition.name\n },\n (entry as ResolvedEntryTypeDefinition).input,\n (entry as ResolvedEntryTypeDefinition).output\n );\n }\n\n return (\n await context.fs.glob(\n appendPath(filePath, context.workspaceConfig.workspaceRoot)\n )\n ).map(file =>\n resolveInput(\n context,\n {\n file: replacePath(file, context.config.root),\n name: typeDefinition.name\n },\n (entry as ResolvedEntryTypeDefinition).input,\n (entry as ResolvedEntryTypeDefinition).output\n )\n );\n })\n .flat()\n .filter(Boolean)\n )\n ).flat();\n}\n\n/**\n * Checks if the provided entry is a type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a type definition, false otherwise.\n */\nexport function isTypeDefinition(\n entry: TypeDefinitionParameter\n): entry is TypeDefinition {\n return !isString(entry) && entry.file !== undefined;\n}\n\n/**\n * Checks if the provided entry is a resolved entry type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a resolved entry type definition, false otherwise.\n */\nexport function isResolvedEntryTypeDefinition(\n entry: TypeDefinitionParameter | ResolvedEntryTypeDefinition | RegExp\n): entry is ResolvedEntryTypeDefinition {\n return (\n !isRegExp(entry) &&\n isTypeDefinition(entry) &&\n (entry as ResolvedEntryTypeDefinition).output !== undefined\n );\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport function resolveInputsSync(\n context: Context,\n typeDefinitions:\n | TypeDefinition\n | ResolvedEntryTypeDefinition\n | string\n | RegExp\n | (string | RegExp | TypeDefinition | ResolvedEntryTypeDefinition)[]\n | Record<\n string,\n string | RegExp | TypeDefinition | (string | RegExp | TypeDefinition)[]\n >\n): ResolvedEntryTypeDefinition[] {\n return (\n isObject(typeDefinitions)\n ? Object.values(typeDefinitions).flat()\n : toArray(typeDefinitions)\n )\n .map(entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return {\n ...entry,\n output: entry.output\n ? replacePathTokens(context, entry.output)\n : undefined,\n file: replacePathTokens(context, entry.file)\n };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else if (isRegExp(entry)) {\n typeDefinition = { file: replacePathTokens(context, entry.source) };\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(context, typeDefinition.file);\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.root);\n if (context.fs.isFileSync(filePath)) {\n return resolveInput(context, {\n file: appendPath(filePath, context.workspaceConfig.workspaceRoot),\n name: typeDefinition.name\n });\n }\n\n return context.fs\n .globSync(appendPath(filePath, context.workspaceConfig.workspaceRoot))\n .map(file =>\n resolveInput(context, {\n file,\n name: typeDefinition.name\n })\n );\n })\n .flat()\n .filter(Boolean);\n}\n\n/**\n * Get unique inputs from the provided list.\n *\n * @param inputs - The entry points to process.\n * @returns An array of unique inputs (by file path or content hash).\n */\nexport function getUniqueInputs(\n inputs: BaseConfig[\"input\"] = []\n): BaseConfig[\"input\"] {\n return isObject(inputs)\n ? inputs\n : getUniqueBy(toArray(inputs), (item: TypeDefinitionParameter) =>\n isSetString(item) ? item : murmurhash(item ?? {}, { maxLength: 24 })\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAuCA,SAAgB,mBACd,SACA,gBACQ;AACR,QAAO,iBACL,YACE,YACE,YACE,YACE,YACE,eAAe,MACf,UACE,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,MACf,MACD,CACF,EACD,UACE,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,KAChB,CACF,EACD,UAAU,QAAQ,OAAO,MAAM,MAAM,CACtC,EACD,QAAQ,OAAO,KAChB,EACD,MACD,CACF;;AAGH,SAAgB,aACd,SACA,gBACA,OACA,QAC6B;AAC7B,QAAO;EACL,GAAG;EACH,OACE,YAAY,MAAM,IAAI,SAAS,MAAM,GACjC,EAAE,MAAM,OAAO,MAAM,EAAE,GACvB;EACN,QAAQ,UAAU,mBAAmB,SAAS,eAAe;EAC9D;;;;;;;;;AAUH,eAAsB,cACpB,SACA,iBAUwC;AACxC,SACE,MAAM,QAAQ,KACX,SAAS,gBAAgB,GACtB,OAAO,OAAO,gBAAgB,CAAC,MAAM,GACrC,QAAQ,gBAAgB,EAEzB,IAAI,OAAM,UAAS;AAClB,MAAI,8BAA8B,MAAM,CACtC,QAAO;GACL,GAAG;GACH,QAAQ,MAAM,SACV,kBAAkB,SAAS,MAAM,OAAO,GACxC;GACJ,MAAM,kBAAkB,SAAS,MAAM,KAAK;GAC7C;EAGH,IAAIA;AACJ,MAAI,SAAS,MAAM,CACjB,kBAAiB,oBACf,kBAAkB,SAAS,MAAM,CAClC;WACQ,SAAS,MAAM,CACxB,kBAAiB,EAAE,MAAM,kBAAkB,SAAS,MAAM,OAAO,EAAE;OAC9D;AACL,oBAAiB;AACjB,kBAAe,OAAO,kBACpB,SACA,eAAe,KAChB;;EAGH,MAAM,WAAW,eAAe,eAAe,KAAK,GAChD,eAAe,OACf,WAAW,eAAe,MAAM,QAAQ,OAAO,KAAK;AACxD,MAAI,MAAM,QAAQ,GAAG,OAAO,SAAS,CACnC,QAAO,aACL,SACA;GACE,MAAM,YAAY,UAAU,QAAQ,OAAO,KAAK;GAChD,MAAM,eAAe;GACtB,EACA,MAAsC,OACtC,MAAsC,OACxC;AAGH,UACE,MAAM,QAAQ,GAAG,KACf,WAAW,UAAU,QAAQ,gBAAgB,cAAc,CAC5D,EACD,KAAI,SACJ,aACE,SACA;GACE,MAAM,YAAY,MAAM,QAAQ,OAAO,KAAK;GAC5C,MAAM,eAAe;GACtB,EACA,MAAsC,OACtC,MAAsC,OACxC,CACF;GACD,CACD,MAAM,CACN,OAAO,QAAQ,CACnB,EACD,MAAM;;;;;;;;AASV,SAAgB,iBACd,OACyB;AACzB,QAAO,CAAC,SAAS,MAAM,IAAI,MAAM,SAAS;;;;;;;;AAS5C,SAAgB,8BACd,OACsC;AACtC,QACE,CAAC,SAAS,MAAM,IAChB,iBAAiB,MAAM,IACtB,MAAsC,WAAW;;;;;;;;;AAWtD,SAAgB,kBACd,SACA,iBAU+B;AAC/B,SACE,SAAS,gBAAgB,GACrB,OAAO,OAAO,gBAAgB,CAAC,MAAM,GACrC,QAAQ,gBAAgB,EAE3B,KAAI,UAAS;AACZ,MAAI,8BAA8B,MAAM,CACtC,QAAO;GACL,GAAG;GACH,QAAQ,MAAM,SACV,kBAAkB,SAAS,MAAM,OAAO,GACxC;GACJ,MAAM,kBAAkB,SAAS,MAAM,KAAK;GAC7C;EAGH,IAAIA;AACJ,MAAI,SAAS,MAAM,CACjB,kBAAiB,oBACf,kBAAkB,SAAS,MAAM,CAClC;WACQ,SAAS,MAAM,CACxB,kBAAiB,EAAE,MAAM,kBAAkB,SAAS,MAAM,OAAO,EAAE;OAC9D;AACL,oBAAiB;AACjB,kBAAe,OAAO,kBAAkB,SAAS,eAAe,KAAK;;EAGvE,MAAM,WAAW,eAAe,eAAe,KAAK,GAChD,eAAe,OACf,WAAW,eAAe,MAAM,QAAQ,OAAO,KAAK;AACxD,MAAI,QAAQ,GAAG,WAAW,SAAS,CACjC,QAAO,aAAa,SAAS;GAC3B,MAAM,WAAW,UAAU,QAAQ,gBAAgB,cAAc;GACjE,MAAM,eAAe;GACtB,CAAC;AAGJ,SAAO,QAAQ,GACZ,SAAS,WAAW,UAAU,QAAQ,gBAAgB,cAAc,CAAC,CACrE,KAAI,SACH,aAAa,SAAS;GACpB;GACA,MAAM,eAAe;GACtB,CAAC,CACH;GACH,CACD,MAAM,CACN,OAAO,QAAQ;;;;;;;;AASpB,SAAgB,gBACd,SAA8B,EAAE,EACX;AACrB,QAAO,SAAS,OAAO,GACnB,SACA,YAAY,QAAQ,OAAO,GAAG,SAC5B,YAAY,KAAK,GAAG,OAAO,WAAW,QAAQ,EAAE,EAAE,EAAE,WAAW,IAAI,CAAC,CACrE"}
@@ -0,0 +1,50 @@
1
+ const require_lib_config = require('./config.cjs');
2
+ const require_lib_constants_environments = require('./constants/environments.cjs');
3
+ const require_lib_constants_meta = require('./constants/meta.cjs');
4
+ const require_lib_entry = require('./entry.cjs');
5
+ const require_lib_logger = require('./logger.cjs');
6
+ const require_lib_unplugin_helpers = require('./unplugin/helpers.cjs');
7
+ const require_lib_unplugin_module_resolution = require('./unplugin/module-resolution.cjs');
8
+ const require_lib_utilities_source_file = require('./utilities/source-file.cjs');
9
+ const require_lib_unplugin_plugin = require('./unplugin/plugin.cjs');
10
+ require('./unplugin/index.cjs');
11
+ const require_lib_utilities_file_header = require('./utilities/file-header.cjs');
12
+ const require_lib_utilities_format = require('./utilities/format.cjs');
13
+ const require_lib_utilities_source_map = require('./utilities/source-map.cjs');
14
+ const require_lib_utilities_write_file = require('./utilities/write-file.cjs');
15
+ require('./utilities/index.cjs');
16
+
17
+ exports.CACHE_HASH_LENGTH = require_lib_constants_meta.CACHE_HASH_LENGTH;
18
+ exports.CLIENT_ENVIRONMENT = require_lib_constants_environments.CLIENT_ENVIRONMENT;
19
+ exports.DEFAULT_ENVIRONMENT = require_lib_constants_environments.DEFAULT_ENVIRONMENT;
20
+ exports.GLOBAL_ENVIRONMENT = require_lib_constants_environments.GLOBAL_ENVIRONMENT;
21
+ exports.ROOT_HASH_LENGTH = require_lib_constants_meta.ROOT_HASH_LENGTH;
22
+ exports.RSC_ENVIRONMENT = require_lib_constants_environments.RSC_ENVIRONMENT;
23
+ exports.SERVER_ENVIRONMENT = require_lib_constants_environments.SERVER_ENVIRONMENT;
24
+ exports.SSR_ENVIRONMENT = require_lib_constants_environments.SSR_ENVIRONMENT;
25
+ exports.combineContexts = require_lib_unplugin_helpers.combineContexts;
26
+ exports.createLog = require_lib_logger.createLog;
27
+ exports.createUnplugin = require_lib_unplugin_plugin.createUnplugin;
28
+ exports.createUnpluginModuleResolutionFunctions = require_lib_unplugin_module_resolution.createUnpluginModuleResolutionFunctions;
29
+ exports.createUnpluginResolver = require_lib_unplugin_plugin.createUnpluginResolver;
30
+ exports.defineConfig = require_lib_config.defineConfig;
31
+ exports.extendLog = require_lib_logger.extendLog;
32
+ exports.format = require_lib_utilities_format.format;
33
+ exports.formatFolder = require_lib_utilities_format.formatFolder;
34
+ exports.generateSourceMap = require_lib_utilities_source_map.generateSourceMap;
35
+ exports.getBaseFileHeader = require_lib_utilities_file_header.getBaseFileHeader;
36
+ exports.getFileHeader = require_lib_utilities_file_header.getFileHeader;
37
+ exports.getMagicString = require_lib_utilities_source_file.getMagicString;
38
+ exports.getSourceFile = require_lib_utilities_source_file.getSourceFile;
39
+ exports.getString = require_lib_utilities_source_file.getString;
40
+ exports.getUniqueInputs = require_lib_entry.getUniqueInputs;
41
+ exports.isResolvedEntryTypeDefinition = require_lib_entry.isResolvedEntryTypeDefinition;
42
+ exports.isTypeDefinition = require_lib_entry.isTypeDefinition;
43
+ exports.isUnpluginBuilderVariant = require_lib_unplugin_helpers.isUnpluginBuilderVariant;
44
+ exports.loadUserConfigFile = require_lib_config.loadUserConfigFile;
45
+ exports.loadWorkspaceConfig = require_lib_config.loadWorkspaceConfig;
46
+ exports.resolveEntryOutput = require_lib_entry.resolveEntryOutput;
47
+ exports.resolveInput = require_lib_entry.resolveInput;
48
+ exports.resolveInputs = require_lib_entry.resolveInputs;
49
+ exports.resolveInputsSync = require_lib_entry.resolveInputsSync;
50
+ exports.writeFile = require_lib_utilities_write_file.writeFile;
@@ -0,0 +1,14 @@
1
+ import { PartiallyResolvedContext, __ΩPartiallyResolvedContext, defineConfig, loadUserConfigFile, loadWorkspaceConfig } from "./config.cjs";
2
+ import { CLIENT_ENVIRONMENT, DEFAULT_ENVIRONMENT, GLOBAL_ENVIRONMENT, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT } from "./constants/environments.cjs";
3
+ import { CACHE_HASH_LENGTH, ROOT_HASH_LENGTH } from "./constants/meta.cjs";
4
+ import { getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync } from "./entry.cjs";
5
+ import { CreateLogOptions, __ΩCreateLogOptions, createLog, extendLog } from "./logger.cjs";
6
+ import { combineContexts, isUnpluginBuilderVariant } from "./unplugin/helpers.cjs";
7
+ import { createUnpluginModuleResolutionFunctions } from "./unplugin/module-resolution.cjs";
8
+ import { createUnplugin, createUnpluginResolver } from "./unplugin/plugin.cjs";
9
+ import { FileHeaderOptions, __ΩFileHeaderOptions, getBaseFileHeader, getFileHeader } from "./utilities/file-header.cjs";
10
+ import { format, formatFolder } from "./utilities/format.cjs";
11
+ import { getMagicString, getSourceFile, getString } from "./utilities/source-file.cjs";
12
+ import { generateSourceMap } from "./utilities/source-map.cjs";
13
+ import { writeFile } from "./utilities/write-file.cjs";
14
+ export { CACHE_HASH_LENGTH, CLIENT_ENVIRONMENT, CreateLogOptions, DEFAULT_ENVIRONMENT, FileHeaderOptions, GLOBAL_ENVIRONMENT, PartiallyResolvedContext, ROOT_HASH_LENGTH, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT, __ΩCreateLogOptions, __ΩFileHeaderOptions, __ΩPartiallyResolvedContext, combineContexts, createLog, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, defineConfig, extendLog, format, formatFolder, generateSourceMap, getBaseFileHeader, getFileHeader, getMagicString, getSourceFile, getString, getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, isUnpluginBuilderVariant, loadUserConfigFile, loadWorkspaceConfig, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync, writeFile };
@@ -0,0 +1,16 @@
1
+ import { PartiallyResolvedContext, __ΩPartiallyResolvedContext, defineConfig, loadUserConfigFile, loadWorkspaceConfig } from "./config.mjs";
2
+ import { CLIENT_ENVIRONMENT, DEFAULT_ENVIRONMENT, GLOBAL_ENVIRONMENT, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT } from "./constants/environments.mjs";
3
+ import { CACHE_HASH_LENGTH, ROOT_HASH_LENGTH } from "./constants/meta.mjs";
4
+ import { getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync } from "./entry.mjs";
5
+ import { CreateLogOptions, __ΩCreateLogOptions, createLog, extendLog } from "./logger.mjs";
6
+ import { combineContexts, isUnpluginBuilderVariant } from "./unplugin/helpers.mjs";
7
+ import { createUnpluginModuleResolutionFunctions } from "./unplugin/module-resolution.mjs";
8
+ import { createUnplugin, createUnpluginResolver } from "./unplugin/plugin.mjs";
9
+ import "./unplugin/index.mjs";
10
+ import { FileHeaderOptions, __ΩFileHeaderOptions, getBaseFileHeader, getFileHeader } from "./utilities/file-header.mjs";
11
+ import { format, formatFolder } from "./utilities/format.mjs";
12
+ import { getMagicString, getSourceFile, getString } from "./utilities/source-file.mjs";
13
+ import { generateSourceMap } from "./utilities/source-map.mjs";
14
+ import { writeFile } from "./utilities/write-file.mjs";
15
+ import "./utilities/index.mjs";
16
+ export { CACHE_HASH_LENGTH, CLIENT_ENVIRONMENT, CreateLogOptions, DEFAULT_ENVIRONMENT, FileHeaderOptions, GLOBAL_ENVIRONMENT, PartiallyResolvedContext, ROOT_HASH_LENGTH, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT, __ΩCreateLogOptions, __ΩFileHeaderOptions, __ΩPartiallyResolvedContext, combineContexts, createLog, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, defineConfig, extendLog, format, formatFolder, generateSourceMap, getBaseFileHeader, getFileHeader, getMagicString, getSourceFile, getString, getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, isUnpluginBuilderVariant, loadUserConfigFile, loadWorkspaceConfig, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync, writeFile };
@@ -0,0 +1,17 @@
1
+ import { defineConfig, loadUserConfigFile, loadWorkspaceConfig } from "./config.mjs";
2
+ import { CLIENT_ENVIRONMENT, DEFAULT_ENVIRONMENT, GLOBAL_ENVIRONMENT, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT } from "./constants/environments.mjs";
3
+ import { CACHE_HASH_LENGTH, ROOT_HASH_LENGTH } from "./constants/meta.mjs";
4
+ import { getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync } from "./entry.mjs";
5
+ import { createLog, extendLog } from "./logger.mjs";
6
+ import { combineContexts, isUnpluginBuilderVariant } from "./unplugin/helpers.mjs";
7
+ import { createUnpluginModuleResolutionFunctions } from "./unplugin/module-resolution.mjs";
8
+ import { getMagicString, getSourceFile, getString } from "./utilities/source-file.mjs";
9
+ import { createUnplugin, createUnpluginResolver } from "./unplugin/plugin.mjs";
10
+ import "./unplugin/index.mjs";
11
+ import { getBaseFileHeader, getFileHeader } from "./utilities/file-header.mjs";
12
+ import { format, formatFolder } from "./utilities/format.mjs";
13
+ import { generateSourceMap } from "./utilities/source-map.mjs";
14
+ import { writeFile } from "./utilities/write-file.mjs";
15
+ import "./utilities/index.mjs";
16
+
17
+ export { CACHE_HASH_LENGTH, CLIENT_ENVIRONMENT, DEFAULT_ENVIRONMENT, GLOBAL_ENVIRONMENT, ROOT_HASH_LENGTH, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT, combineContexts, createLog, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, defineConfig, extendLog, format, formatFolder, generateSourceMap, getBaseFileHeader, getFileHeader, getMagicString, getSourceFile, getString, getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, isUnpluginBuilderVariant, loadUserConfigFile, loadWorkspaceConfig, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync, writeFile };
@@ -0,0 +1,59 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ let __storm_software_config_tools_logger = require("@storm-software/config-tools/logger");
3
+ let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
4
+ let __storm_software_config_tools_utilities_colors = require("@storm-software/config-tools/utilities/colors");
5
+ let __stryke_helpers_noop = require("@stryke/helpers/noop");
6
+ let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
7
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
8
+ let chalk = require("chalk");
9
+ chalk = require_rolldown_runtime.__toESM(chalk);
10
+
11
+ //#region src/lib/logger.ts
12
+ /**
13
+ * Create a logging function with a specific name and options.
14
+ *
15
+ * @param name - The name of the logging function.
16
+ * @param options - The options to configure the logging function.
17
+ * @returns A logging function.
18
+ */
19
+ const createLog = (name, options = {}) => {
20
+ const logLevel = options.logLevel === null ? __storm_software_config_tools_types.LogLevelLabel.SILENT : options.logLevel || __storm_software_config_tools_types.LogLevelLabel.INFO;
21
+ if (logLevel === __storm_software_config_tools_types.LogLevelLabel.SILENT) return __stryke_helpers_noop.noop;
22
+ if (options.customLogger) return options.customLogger;
23
+ return (type, ...args) => (0, __storm_software_config_tools_logger.getLogFn)((0, __storm_software_config_tools_logger.getLogLevel)(type), {
24
+ ...options,
25
+ logLevel
26
+ })(`${chalk.default.bold.hex((0, __storm_software_config_tools_utilities_colors.getColor)("brand", options))(`${name ? (0, __stryke_string_format_kebab_case.kebabCase)(name) : ""}${options.name ? `${name ? chalk.default.gray(" > ") : ""}${(0, __stryke_string_format_kebab_case.kebabCase)(options.name)}` : ""}${chalk.default.gray(" > ")}`)}${args.join(" ")} `.trim());
27
+ };
28
+ const BADGE_COLORS = [
29
+ "#00A0DD",
30
+ "#6FCE4E",
31
+ "#FBBF24",
32
+ "#F43F5E",
33
+ "#3B82F6",
34
+ "#A855F7",
35
+ "#469592",
36
+ "#288EDF",
37
+ "#D8B4FE",
38
+ "#10B981",
39
+ "#EF4444",
40
+ "#F0EC56",
41
+ "#F472B6",
42
+ "#22D3EE",
43
+ "#EAB308",
44
+ "#84CC16",
45
+ "#F87171",
46
+ "#0EA5E9",
47
+ "#D946EF",
48
+ "#FACC15",
49
+ "#34D399",
50
+ "#8B5CF6"
51
+ ];
52
+ const extendLog = (logFn, name) => {
53
+ return (type, ...args) => logFn(type, ` ${chalk.default.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${(0, __stryke_string_format_title_case.titleCase)(name)} `)} ${args.join(" ")} `);
54
+ };
55
+
56
+ //#endregion
57
+ exports.createLog = createLog;
58
+ exports.extendLog = extendLog;
59
+ //# sourceMappingURL=logger.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.cjs","names":["LogLevelLabel","noop"],"sources":["../../src/lib/logger.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 { getLogFn, getLogLevel } from \"@storm-software/config-tools/logger\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { getColor } from \"@storm-software/config-tools/utilities/colors\";\nimport { noop } from \"@stryke/helpers/noop\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport chalk from \"chalk\";\nimport type { LogFn, WorkspaceConfig } from \"../types\";\n\nexport interface CreateLogOptions {\n name?: string;\n logLevel?: LogLevelLabel | null;\n customLogger?: LogFn;\n colors?: WorkspaceConfig[\"colors\"];\n}\n\n/**\n * Create a logging function with a specific name and options.\n *\n * @param name - The name of the logging function.\n * @param options - The options to configure the logging function.\n * @returns A logging function.\n */\nexport const createLog = (\n name: string | null,\n options: CreateLogOptions = {}\n): LogFn => {\n const logLevel =\n options.logLevel === null\n ? LogLevelLabel.SILENT\n : options.logLevel || LogLevelLabel.INFO;\n if (logLevel === LogLevelLabel.SILENT) {\n return noop;\n }\n\n if (options.customLogger) {\n return options.customLogger;\n }\n\n return (type: LogLevelLabel, ...args: string[]) =>\n getLogFn(getLogLevel(type), {\n ...options,\n logLevel\n })(\n `${chalk.bold.hex(\n getColor(\"brand\", options as Parameters<typeof getColor>[1])\n )(\n `${name ? kebabCase(name) : \"\"}${options.name ? `${name ? chalk.gray(\" > \") : \"\"}${kebabCase(options.name)}` : \"\"}${chalk.gray(\" > \")}`\n )}${args.join(\" \")} `.trim()\n );\n};\n\nconst BADGE_COLORS = [\n \"#00A0DD\",\n \"#6FCE4E\",\n \"#FBBF24\",\n \"#F43F5E\",\n \"#3B82F6\",\n \"#A855F7\",\n \"#469592\",\n \"#288EDF\",\n \"#D8B4FE\",\n \"#10B981\",\n \"#EF4444\",\n \"#F0EC56\",\n \"#F472B6\",\n \"#22D3EE\",\n \"#EAB308\",\n \"#84CC16\",\n \"#F87171\",\n \"#0EA5E9\",\n \"#D946EF\",\n \"#FACC15\",\n \"#34D399\",\n \"#8B5CF6\"\n] as const;\n\nexport const extendLog = (logFn: LogFn, name: string): LogFn => {\n return (type: LogLevelLabel, ...args: string[]) =>\n logFn(\n type,\n ` ${chalk.inverse.hex(\n BADGE_COLORS[\n name\n .split(\"\")\n .map(char => char.charCodeAt(0))\n .reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length\n ] || BADGE_COLORS[0]\n )(` ${titleCase(name)} `)} ${args.join(\" \")} `\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyCA,MAAa,aACX,MACA,UAA4B,EAAE,KACpB;CACV,MAAM,WACJ,QAAQ,aAAa,OACjBA,kDAAc,SACd,QAAQ,YAAYA,kDAAc;AACxC,KAAI,aAAaA,kDAAc,OAC7B,QAAOC;AAGT,KAAI,QAAQ,aACV,QAAO,QAAQ;AAGjB,SAAQ,MAAqB,GAAG,kHACT,KAAK,EAAE;EAC1B,GAAG;EACH;EACD,CAAC,CACA,GAAG,cAAM,KAAK,iEACH,SAAS,QAA0C,CAC7D,CACC,GAAG,wDAAiB,KAAK,GAAG,KAAK,QAAQ,OAAO,GAAG,OAAO,cAAM,KAAK,MAAM,GAAG,sDAAe,QAAQ,KAAK,KAAK,KAAK,cAAM,KAAK,MAAM,GACtI,GAAG,KAAK,KAAK,IAAI,CAAC,GAAG,MAAM,CAC7B;;AAGL,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,aAAa,OAAc,SAAwB;AAC9D,SAAQ,MAAqB,GAAG,SAC9B,MACE,MACA,IAAI,cAAM,QAAQ,IAChB,aACE,KACG,MAAM,GAAG,CACT,KAAI,SAAQ,KAAK,WAAW,EAAE,CAAC,CAC/B,QAAQ,KAAK,aAAa,MAAM,UAAU,EAAE,GAAG,aAAa,WAC5D,aAAa,GACnB,CAAC,qDAAc,KAAK,CAAC,GAAG,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,GAC9C"}
@@ -0,0 +1,23 @@
1
+ import { LogFn, WorkspaceConfig } from "../types/config.cjs";
2
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
3
+
4
+ //#region src/lib/logger.d.ts
5
+ interface CreateLogOptions {
6
+ name?: string;
7
+ logLevel?: LogLevelLabel | null;
8
+ customLogger?: LogFn;
9
+ colors?: WorkspaceConfig["colors"];
10
+ }
11
+ /**
12
+ * Create a logging function with a specific name and options.
13
+ *
14
+ * @param name - The name of the logging function.
15
+ * @param options - The options to configure the logging function.
16
+ * @returns A logging function.
17
+ */
18
+ declare const createLog: (name: string | null, options?: CreateLogOptions) => LogFn;
19
+ declare const extendLog: (logFn: LogFn, name: string) => LogFn;
20
+ declare type __ΩCreateLogOptions = any[];
21
+ //#endregion
22
+ export { CreateLogOptions, __ΩCreateLogOptions, createLog, extendLog };
23
+ //# sourceMappingURL=logger.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.cts","names":[],"sources":["../../src/lib/logger.ts"],"sourcesContent":[],"mappings":";;;;UA2BiB,gBAAA;;EAAA,QAAA,CAAA,EAEJ,aAFoB,GAAA,IAAA;EAEpB,YAAA,CAAA,EACI,KADJ;EACI,MAAA,CAAA,EACN,eADM,CAAA,QAAA,CAAA;;;AAWjB;AAsDA;;;;;cAtDa,2CAEF,qBACR;cAmDU,mBAAoB,wBAAsB"}
@@ -0,0 +1,24 @@
1
+ import { LogFn, WorkspaceConfig } from "../types/config.mjs";
2
+ import "../types/index.mjs";
3
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
4
+
5
+ //#region src/lib/logger.d.ts
6
+ interface CreateLogOptions {
7
+ name?: string;
8
+ logLevel?: LogLevelLabel | null;
9
+ customLogger?: LogFn;
10
+ colors?: WorkspaceConfig["colors"];
11
+ }
12
+ /**
13
+ * Create a logging function with a specific name and options.
14
+ *
15
+ * @param name - The name of the logging function.
16
+ * @param options - The options to configure the logging function.
17
+ * @returns A logging function.
18
+ */
19
+ declare const createLog: (name: string | null, options?: CreateLogOptions) => LogFn;
20
+ declare const extendLog: (logFn: LogFn, name: string) => LogFn;
21
+ declare type __ΩCreateLogOptions = any[];
22
+ //#endregion
23
+ export { CreateLogOptions, __ΩCreateLogOptions, createLog, extendLog };
24
+ //# sourceMappingURL=logger.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.mts","names":[],"sources":["../../src/lib/logger.ts"],"sourcesContent":[],"mappings":";;;;;UA2BiB,gBAAA;;aAEJ;EAFI,YAAA,CAAA,EAGA,KAHgB;EAEpB,MAAA,CAAA,EAEF,eAFE,CAAA,QAAA,CAAA;;;;AAYb;AAsDA;;;;cAtDa,2CAEF,qBACR;cAmDU,mBAAoB,wBAAsB"}
@@ -0,0 +1,56 @@
1
+ import { getLogFn, getLogLevel } from "@storm-software/config-tools/logger";
2
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
3
+ import { getColor } from "@storm-software/config-tools/utilities/colors";
4
+ import { noop } from "@stryke/helpers/noop";
5
+ import { kebabCase } from "@stryke/string-format/kebab-case";
6
+ import { titleCase } from "@stryke/string-format/title-case";
7
+ import chalk from "chalk";
8
+
9
+ //#region src/lib/logger.ts
10
+ /**
11
+ * Create a logging function with a specific name and options.
12
+ *
13
+ * @param name - The name of the logging function.
14
+ * @param options - The options to configure the logging function.
15
+ * @returns A logging function.
16
+ */
17
+ const createLog = (name, options = {}) => {
18
+ const logLevel = options.logLevel === null ? LogLevelLabel.SILENT : options.logLevel || LogLevelLabel.INFO;
19
+ if (logLevel === LogLevelLabel.SILENT) return noop;
20
+ if (options.customLogger) return options.customLogger;
21
+ return (type, ...args) => getLogFn(getLogLevel(type), {
22
+ ...options,
23
+ logLevel
24
+ })(`${chalk.bold.hex(getColor("brand", options))(`${name ? kebabCase(name) : ""}${options.name ? `${name ? chalk.gray(" > ") : ""}${kebabCase(options.name)}` : ""}${chalk.gray(" > ")}`)}${args.join(" ")} `.trim());
25
+ };
26
+ const BADGE_COLORS = [
27
+ "#00A0DD",
28
+ "#6FCE4E",
29
+ "#FBBF24",
30
+ "#F43F5E",
31
+ "#3B82F6",
32
+ "#A855F7",
33
+ "#469592",
34
+ "#288EDF",
35
+ "#D8B4FE",
36
+ "#10B981",
37
+ "#EF4444",
38
+ "#F0EC56",
39
+ "#F472B6",
40
+ "#22D3EE",
41
+ "#EAB308",
42
+ "#84CC16",
43
+ "#F87171",
44
+ "#0EA5E9",
45
+ "#D946EF",
46
+ "#FACC15",
47
+ "#34D399",
48
+ "#8B5CF6"
49
+ ];
50
+ const extendLog = (logFn, name) => {
51
+ return (type, ...args) => logFn(type, ` ${chalk.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${titleCase(name)} `)} ${args.join(" ")} `);
52
+ };
53
+
54
+ //#endregion
55
+ export { createLog, extendLog };
56
+ //# sourceMappingURL=logger.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.mjs","names":[],"sources":["../../src/lib/logger.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 { getLogFn, getLogLevel } from \"@storm-software/config-tools/logger\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { getColor } from \"@storm-software/config-tools/utilities/colors\";\nimport { noop } from \"@stryke/helpers/noop\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport chalk from \"chalk\";\nimport type { LogFn, WorkspaceConfig } from \"../types\";\n\nexport interface CreateLogOptions {\n name?: string;\n logLevel?: LogLevelLabel | null;\n customLogger?: LogFn;\n colors?: WorkspaceConfig[\"colors\"];\n}\n\n/**\n * Create a logging function with a specific name and options.\n *\n * @param name - The name of the logging function.\n * @param options - The options to configure the logging function.\n * @returns A logging function.\n */\nexport const createLog = (\n name: string | null,\n options: CreateLogOptions = {}\n): LogFn => {\n const logLevel =\n options.logLevel === null\n ? LogLevelLabel.SILENT\n : options.logLevel || LogLevelLabel.INFO;\n if (logLevel === LogLevelLabel.SILENT) {\n return noop;\n }\n\n if (options.customLogger) {\n return options.customLogger;\n }\n\n return (type: LogLevelLabel, ...args: string[]) =>\n getLogFn(getLogLevel(type), {\n ...options,\n logLevel\n })(\n `${chalk.bold.hex(\n getColor(\"brand\", options as Parameters<typeof getColor>[1])\n )(\n `${name ? kebabCase(name) : \"\"}${options.name ? `${name ? chalk.gray(\" > \") : \"\"}${kebabCase(options.name)}` : \"\"}${chalk.gray(\" > \")}`\n )}${args.join(\" \")} `.trim()\n );\n};\n\nconst BADGE_COLORS = [\n \"#00A0DD\",\n \"#6FCE4E\",\n \"#FBBF24\",\n \"#F43F5E\",\n \"#3B82F6\",\n \"#A855F7\",\n \"#469592\",\n \"#288EDF\",\n \"#D8B4FE\",\n \"#10B981\",\n \"#EF4444\",\n \"#F0EC56\",\n \"#F472B6\",\n \"#22D3EE\",\n \"#EAB308\",\n \"#84CC16\",\n \"#F87171\",\n \"#0EA5E9\",\n \"#D946EF\",\n \"#FACC15\",\n \"#34D399\",\n \"#8B5CF6\"\n] as const;\n\nexport const extendLog = (logFn: LogFn, name: string): LogFn => {\n return (type: LogLevelLabel, ...args: string[]) =>\n logFn(\n type,\n ` ${chalk.inverse.hex(\n BADGE_COLORS[\n name\n .split(\"\")\n .map(char => char.charCodeAt(0))\n .reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length\n ] || BADGE_COLORS[0]\n )(` ${titleCase(name)} `)} ${args.join(\" \")} `\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAyCA,MAAa,aACX,MACA,UAA4B,EAAE,KACpB;CACV,MAAM,WACJ,QAAQ,aAAa,OACjB,cAAc,SACd,QAAQ,YAAY,cAAc;AACxC,KAAI,aAAa,cAAc,OAC7B,QAAO;AAGT,KAAI,QAAQ,aACV,QAAO,QAAQ;AAGjB,SAAQ,MAAqB,GAAG,SAC9B,SAAS,YAAY,KAAK,EAAE;EAC1B,GAAG;EACH;EACD,CAAC,CACA,GAAG,MAAM,KAAK,IACZ,SAAS,SAAS,QAA0C,CAC7D,CACC,GAAG,OAAO,UAAU,KAAK,GAAG,KAAK,QAAQ,OAAO,GAAG,OAAO,MAAM,KAAK,MAAM,GAAG,KAAK,UAAU,QAAQ,KAAK,KAAK,KAAK,MAAM,KAAK,MAAM,GACtI,GAAG,KAAK,KAAK,IAAI,CAAC,GAAG,MAAM,CAC7B;;AAGL,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,aAAa,OAAc,SAAwB;AAC9D,SAAQ,MAAqB,GAAG,SAC9B,MACE,MACA,IAAI,MAAM,QAAQ,IAChB,aACE,KACG,MAAM,GAAG,CACT,KAAI,SAAQ,KAAK,WAAW,EAAE,CAAC,CAC/B,QAAQ,KAAK,aAAa,MAAM,UAAU,EAAE,GAAG,aAAa,WAC5D,aAAa,GACnB,CAAC,IAAI,UAAU,KAAK,CAAC,GAAG,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,GAC9C"}
@@ -0,0 +1,30 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_types_unplugin = require('../../types/unplugin.cjs');
3
+ let defu = require("defu");
4
+ let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
5
+
6
+ //#region src/lib/unplugin/helpers.ts
7
+ /**
8
+ * Merges a base plugin context with an unplugin context, combining their properties.
9
+ *
10
+ * @param contextA - The base plugin context to merge into.
11
+ * @param contextB - The unplugin context to merge from.
12
+ * @returns The merged context.
13
+ */
14
+ function combineContexts(contextA, contextB) {
15
+ return (0, defu.defu)(contextA, contextB);
16
+ }
17
+ /**
18
+ * Checks if a value is a valid UnpluginBuilderVariant.
19
+ *
20
+ * @param str - The value to check.
21
+ * @returns True if the value is a UnpluginBuilderVariant, false otherwise.
22
+ */
23
+ function isUnpluginBuilderVariant(str) {
24
+ return (0, __stryke_type_checks_is_set_string.isSetString)(str) && require_types_unplugin.UNPLUGIN_BUILDER_VARIANTS.includes(str);
25
+ }
26
+
27
+ //#endregion
28
+ exports.combineContexts = combineContexts;
29
+ exports.isUnpluginBuilderVariant = isUnpluginBuilderVariant;
30
+ //# sourceMappingURL=helpers.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.cjs","names":["UNPLUGIN_BUILDER_VARIANTS"],"sources":["../../../src/lib/unplugin/helpers.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 { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { defu } from \"defu\";\nimport { UnpluginBuildContext } from \"unplugin\";\nimport { UnresolvedContext } from \"../../types/context\";\nimport {\n UNPLUGIN_BUILDER_VARIANTS,\n UnpluginBuilderVariant\n} from \"../../types/unplugin\";\n\n/**\n * Merges a base plugin context with an unplugin context, combining their properties.\n *\n * @param contextA - The base plugin context to merge into.\n * @param contextB - The unplugin context to merge from.\n * @returns The merged context.\n */\nexport function combineContexts<\n TContextA extends UnresolvedContext | UnpluginBuildContext,\n TContextB extends UnresolvedContext | UnpluginBuildContext\n>(contextA: TContextA, contextB: TContextB): TContextA & TContextB {\n return defu(contextA, contextB) as TContextA & TContextB;\n}\n\n/**\n * Checks if a value is a valid UnpluginBuilderVariant.\n *\n * @param str - The value to check.\n * @returns True if the value is a UnpluginBuilderVariant, false otherwise.\n */\nexport function isUnpluginBuilderVariant(\n str: unknown\n): str is UnpluginBuilderVariant {\n return (\n isSetString(str) &&\n UNPLUGIN_BUILDER_VARIANTS.includes(str as UnpluginBuilderVariant)\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,SAAgB,gBAGd,UAAqB,UAA4C;AACjE,uBAAY,UAAU,SAAS;;;;;;;;AASjC,SAAgB,yBACd,KAC+B;AAC/B,4DACc,IAAI,IAChBA,iDAA0B,SAAS,IAA8B"}
@@ -0,0 +1,24 @@
1
+ import { UnpluginBuilderVariant } from "../../types/unplugin.cjs";
2
+ import { UnresolvedContext } from "../../types/context.cjs";
3
+ import { UnpluginBuildContext } from "unplugin";
4
+
5
+ //#region src/lib/unplugin/helpers.d.ts
6
+
7
+ /**
8
+ * Merges a base plugin context with an unplugin context, combining their properties.
9
+ *
10
+ * @param contextA - The base plugin context to merge into.
11
+ * @param contextB - The unplugin context to merge from.
12
+ * @returns The merged context.
13
+ */
14
+ declare function combineContexts<TContextA extends UnresolvedContext | UnpluginBuildContext, TContextB extends UnresolvedContext | UnpluginBuildContext>(contextA: TContextA, contextB: TContextB): TContextA & TContextB;
15
+ /**
16
+ * Checks if a value is a valid UnpluginBuilderVariant.
17
+ *
18
+ * @param str - The value to check.
19
+ * @returns True if the value is a UnpluginBuilderVariant, false otherwise.
20
+ */
21
+ declare function isUnpluginBuilderVariant(str: unknown): str is UnpluginBuilderVariant;
22
+ //#endregion
23
+ export { combineContexts, isUnpluginBuilderVariant };
24
+ //# sourceMappingURL=helpers.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.cts","names":[],"sources":["../../../src/lib/unplugin/helpers.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAkCA;;;;;AAGY,iBAHI,eAGJ,CAAA,kBAFQ,iBAER,GAF4B,oBAE5B,EAAA,kBADQ,iBACR,GAD4B,oBAC5B,CAAA,CAAA,QAAA,EAAA,SAAA,EAAA,QAAA,EAAqB,SAArB,CAAA,EAAiC,SAAjC,GAA6C,SAA7C;;;;;AAUZ;;iBAAgB,wBAAA,uBAEN"}
@@ -0,0 +1,24 @@
1
+ import { UnpluginBuilderVariant } from "../../types/unplugin.mjs";
2
+ import { UnresolvedContext } from "../../types/context.mjs";
3
+ import { UnpluginBuildContext } from "unplugin";
4
+
5
+ //#region src/lib/unplugin/helpers.d.ts
6
+
7
+ /**
8
+ * Merges a base plugin context with an unplugin context, combining their properties.
9
+ *
10
+ * @param contextA - The base plugin context to merge into.
11
+ * @param contextB - The unplugin context to merge from.
12
+ * @returns The merged context.
13
+ */
14
+ declare function combineContexts<TContextA extends UnresolvedContext | UnpluginBuildContext, TContextB extends UnresolvedContext | UnpluginBuildContext>(contextA: TContextA, contextB: TContextB): TContextA & TContextB;
15
+ /**
16
+ * Checks if a value is a valid UnpluginBuilderVariant.
17
+ *
18
+ * @param str - The value to check.
19
+ * @returns True if the value is a UnpluginBuilderVariant, false otherwise.
20
+ */
21
+ declare function isUnpluginBuilderVariant(str: unknown): str is UnpluginBuilderVariant;
22
+ //#endregion
23
+ export { combineContexts, isUnpluginBuilderVariant };
24
+ //# sourceMappingURL=helpers.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.mts","names":[],"sources":["../../../src/lib/unplugin/helpers.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAkCA;;;;;AAGY,iBAHI,eAGJ,CAAA,kBAFQ,iBAER,GAF4B,oBAE5B,EAAA,kBADQ,iBACR,GAD4B,oBAC5B,CAAA,CAAA,QAAA,EAAA,SAAA,EAAA,QAAA,EAAqB,SAArB,CAAA,EAAiC,SAAjC,GAA6C,SAA7C;;;;;AAUZ;;iBAAgB,wBAAA,uBAEN"}
@@ -0,0 +1,28 @@
1
+ import { UNPLUGIN_BUILDER_VARIANTS } from "../../types/unplugin.mjs";
2
+ import { defu } from "defu";
3
+ import { isSetString } from "@stryke/type-checks/is-set-string";
4
+
5
+ //#region src/lib/unplugin/helpers.ts
6
+ /**
7
+ * Merges a base plugin context with an unplugin context, combining their properties.
8
+ *
9
+ * @param contextA - The base plugin context to merge into.
10
+ * @param contextB - The unplugin context to merge from.
11
+ * @returns The merged context.
12
+ */
13
+ function combineContexts(contextA, contextB) {
14
+ return defu(contextA, contextB);
15
+ }
16
+ /**
17
+ * Checks if a value is a valid UnpluginBuilderVariant.
18
+ *
19
+ * @param str - The value to check.
20
+ * @returns True if the value is a UnpluginBuilderVariant, false otherwise.
21
+ */
22
+ function isUnpluginBuilderVariant(str) {
23
+ return isSetString(str) && UNPLUGIN_BUILDER_VARIANTS.includes(str);
24
+ }
25
+
26
+ //#endregion
27
+ export { combineContexts, isUnpluginBuilderVariant };
28
+ //# sourceMappingURL=helpers.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.mjs","names":[],"sources":["../../../src/lib/unplugin/helpers.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 { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { defu } from \"defu\";\nimport { UnpluginBuildContext } from \"unplugin\";\nimport { UnresolvedContext } from \"../../types/context\";\nimport {\n UNPLUGIN_BUILDER_VARIANTS,\n UnpluginBuilderVariant\n} from \"../../types/unplugin\";\n\n/**\n * Merges a base plugin context with an unplugin context, combining their properties.\n *\n * @param contextA - The base plugin context to merge into.\n * @param contextB - The unplugin context to merge from.\n * @returns The merged context.\n */\nexport function combineContexts<\n TContextA extends UnresolvedContext | UnpluginBuildContext,\n TContextB extends UnresolvedContext | UnpluginBuildContext\n>(contextA: TContextA, contextB: TContextB): TContextA & TContextB {\n return defu(contextA, contextB) as TContextA & TContextB;\n}\n\n/**\n * Checks if a value is a valid UnpluginBuilderVariant.\n *\n * @param str - The value to check.\n * @returns True if the value is a UnpluginBuilderVariant, false otherwise.\n */\nexport function isUnpluginBuilderVariant(\n str: unknown\n): str is UnpluginBuilderVariant {\n return (\n isSetString(str) &&\n UNPLUGIN_BUILDER_VARIANTS.includes(str as UnpluginBuilderVariant)\n );\n}\n"],"mappings":";;;;;;;;;;;;AAkCA,SAAgB,gBAGd,UAAqB,UAA4C;AACjE,QAAO,KAAK,UAAU,SAAS;;;;;;;;AASjC,SAAgB,yBACd,KAC+B;AAC/B,QACE,YAAY,IAAI,IAChB,0BAA0B,SAAS,IAA8B"}
@@ -0,0 +1,9 @@
1
+ const require_lib_unplugin_helpers = require('./helpers.cjs');
2
+ const require_lib_unplugin_module_resolution = require('./module-resolution.cjs');
3
+ const require_lib_unplugin_plugin = require('./plugin.cjs');
4
+
5
+ exports.combineContexts = require_lib_unplugin_helpers.combineContexts;
6
+ exports.createUnplugin = require_lib_unplugin_plugin.createUnplugin;
7
+ exports.createUnpluginModuleResolutionFunctions = require_lib_unplugin_module_resolution.createUnpluginModuleResolutionFunctions;
8
+ exports.createUnpluginResolver = require_lib_unplugin_plugin.createUnpluginResolver;
9
+ exports.isUnpluginBuilderVariant = require_lib_unplugin_helpers.isUnpluginBuilderVariant;
@@ -0,0 +1,4 @@
1
+ import { combineContexts, isUnpluginBuilderVariant } from "./helpers.cjs";
2
+ import { createUnpluginModuleResolutionFunctions } from "./module-resolution.cjs";
3
+ import { createUnplugin, createUnpluginResolver } from "./plugin.cjs";
4
+ export { combineContexts, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, isUnpluginBuilderVariant };
@@ -0,0 +1,4 @@
1
+ import { combineContexts, isUnpluginBuilderVariant } from "./helpers.mjs";
2
+ import { createUnpluginModuleResolutionFunctions } from "./module-resolution.mjs";
3
+ import { createUnplugin, createUnpluginResolver } from "./plugin.mjs";
4
+ export { combineContexts, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, isUnpluginBuilderVariant };
@@ -0,0 +1,5 @@
1
+ import { combineContexts, isUnpluginBuilderVariant } from "./helpers.mjs";
2
+ import { createUnpluginModuleResolutionFunctions } from "./module-resolution.mjs";
3
+ import { createUnplugin, createUnpluginResolver } from "./plugin.mjs";
4
+
5
+ export { combineContexts, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, isUnpluginBuilderVariant };