@powerlines/core 0.48.22 → 0.48.25

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 (360) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +8 -0
  2. package/dist/constants/api.cjs +8 -0
  3. package/dist/constants/api.d.mts +2 -0
  4. package/dist/constants/api.d.mts.map +1 -1
  5. package/dist/constants/api.mjs +8 -0
  6. package/dist/constants/api.mjs.map +1 -1
  7. package/dist/constants/commands.cjs +8 -0
  8. package/dist/constants/commands.d.mts +2 -0
  9. package/dist/constants/commands.d.mts.map +1 -1
  10. package/dist/constants/commands.mjs +8 -0
  11. package/dist/constants/commands.mjs.map +1 -1
  12. package/dist/constants/devtools.cjs +8 -0
  13. package/dist/constants/devtools.d.mts +2 -0
  14. package/dist/constants/devtools.d.mts.map +1 -1
  15. package/dist/constants/devtools.mjs +8 -0
  16. package/dist/constants/devtools.mjs.map +1 -1
  17. package/dist/constants/environments.cjs +8 -0
  18. package/dist/constants/environments.d.mts +2 -0
  19. package/dist/constants/environments.d.mts.map +1 -1
  20. package/dist/constants/environments.mjs +8 -0
  21. package/dist/constants/environments.mjs.map +1 -1
  22. package/dist/constants/extensions.cjs +8 -0
  23. package/dist/constants/extensions.d.mts +2 -0
  24. package/dist/constants/extensions.d.mts.map +1 -1
  25. package/dist/constants/extensions.mjs +8 -0
  26. package/dist/constants/extensions.mjs.map +1 -1
  27. package/dist/constants/fs.cjs +8 -0
  28. package/dist/constants/fs.d.mts +2 -0
  29. package/dist/constants/fs.d.mts.map +1 -1
  30. package/dist/constants/fs.mjs +8 -0
  31. package/dist/constants/fs.mjs.map +1 -1
  32. package/dist/constants/hooks.cjs +8 -0
  33. package/dist/constants/hooks.d.mts +2 -0
  34. package/dist/constants/hooks.d.mts.map +1 -1
  35. package/dist/constants/hooks.mjs +8 -0
  36. package/dist/constants/hooks.mjs.map +1 -1
  37. package/dist/constants/index.cjs +8 -0
  38. package/dist/constants/index.d.mts +2 -0
  39. package/dist/constants/index.mjs +8 -0
  40. package/dist/constants/log-level.cjs +8 -0
  41. package/dist/constants/log-level.d.mts +2 -0
  42. package/dist/constants/log-level.d.mts.map +1 -1
  43. package/dist/constants/log-level.mjs +8 -0
  44. package/dist/constants/log-level.mjs.map +1 -1
  45. package/dist/constants/meta.cjs +8 -0
  46. package/dist/constants/meta.d.mts +2 -0
  47. package/dist/constants/meta.d.mts.map +1 -1
  48. package/dist/constants/meta.mjs +8 -0
  49. package/dist/constants/meta.mjs.map +1 -1
  50. package/dist/constants/plugin.cjs +8 -0
  51. package/dist/constants/plugin.d.mts +2 -0
  52. package/dist/constants/plugin.d.mts.map +1 -1
  53. package/dist/constants/plugin.mjs +8 -0
  54. package/dist/constants/plugin.mjs.map +1 -1
  55. package/dist/context/base-context.cjs +8 -0
  56. package/dist/context/base-context.d.mts +2 -0
  57. package/dist/context/base-context.d.mts.map +1 -1
  58. package/dist/context/base-context.mjs +8 -0
  59. package/dist/context/base-context.mjs.map +1 -1
  60. package/dist/context/context.cjs +8 -0
  61. package/dist/context/context.d.mts +2 -0
  62. package/dist/context/context.d.mts.map +1 -1
  63. package/dist/context/context.mjs +8 -0
  64. package/dist/context/context.mjs.map +1 -1
  65. package/dist/context/environment-context.cjs +8 -0
  66. package/dist/context/environment-context.d.mts +2 -0
  67. package/dist/context/environment-context.d.mts.map +1 -1
  68. package/dist/context/environment-context.mjs +8 -0
  69. package/dist/context/environment-context.mjs.map +1 -1
  70. package/dist/context/execution-context.cjs +8 -0
  71. package/dist/context/execution-context.d.mts +2 -0
  72. package/dist/context/execution-context.d.mts.map +1 -1
  73. package/dist/context/execution-context.mjs +8 -0
  74. package/dist/context/execution-context.mjs.map +1 -1
  75. package/dist/context/index.cjs +8 -0
  76. package/dist/context/index.d.mts +2 -0
  77. package/dist/context/index.mjs +8 -0
  78. package/dist/context/plugin-context.cjs +8 -0
  79. package/dist/context/plugin-context.d.mts +2 -0
  80. package/dist/context/plugin-context.d.mts.map +1 -1
  81. package/dist/context/plugin-context.mjs +8 -0
  82. package/dist/context/plugin-context.mjs.map +1 -1
  83. package/dist/index.cjs +8 -0
  84. package/dist/index.d.cts +2 -2
  85. package/dist/index.d.mts +4 -2
  86. package/dist/index.mjs +8 -0
  87. package/dist/lib/config.cjs +8 -0
  88. package/dist/lib/config.d.mts +2 -0
  89. package/dist/lib/config.d.mts.map +1 -1
  90. package/dist/lib/config.mjs +8 -0
  91. package/dist/lib/config.mjs.map +1 -1
  92. package/dist/lib/context-helpers.cjs +8 -0
  93. package/dist/lib/context-helpers.d.mts +2 -0
  94. package/dist/lib/context-helpers.d.mts.map +1 -1
  95. package/dist/lib/context-helpers.mjs +8 -0
  96. package/dist/lib/context-helpers.mjs.map +1 -1
  97. package/dist/lib/entry.cjs +8 -0
  98. package/dist/lib/entry.d.mts +2 -0
  99. package/dist/lib/entry.d.mts.map +1 -1
  100. package/dist/lib/entry.mjs +8 -0
  101. package/dist/lib/entry.mjs.map +1 -1
  102. package/dist/lib/environment.cjs +8 -0
  103. package/dist/lib/environment.d.mts +2 -0
  104. package/dist/lib/environment.d.mts.map +1 -1
  105. package/dist/lib/environment.mjs +8 -0
  106. package/dist/lib/environment.mjs.map +1 -1
  107. package/dist/lib/events.cjs +8 -0
  108. package/dist/lib/events.d.mts +2 -0
  109. package/dist/lib/events.d.mts.map +1 -1
  110. package/dist/lib/events.mjs +8 -0
  111. package/dist/lib/events.mjs.map +1 -1
  112. package/dist/lib/generate-types.cjs +8 -0
  113. package/dist/lib/generate-types.d.mts +2 -0
  114. package/dist/lib/generate-types.d.mts.map +1 -1
  115. package/dist/lib/generate-types.mjs +8 -0
  116. package/dist/lib/generate-types.mjs.map +1 -1
  117. package/dist/lib/hooks.cjs +8 -0
  118. package/dist/lib/hooks.d.mts +2 -0
  119. package/dist/lib/hooks.d.mts.map +1 -1
  120. package/dist/lib/hooks.mjs +8 -0
  121. package/dist/lib/hooks.mjs.map +1 -1
  122. package/dist/lib/index.cjs +8 -0
  123. package/dist/lib/index.d.mts +2 -0
  124. package/dist/lib/index.mjs +8 -0
  125. package/dist/lib/install-dependencies.cjs +8 -0
  126. package/dist/lib/install-dependencies.d.mts +2 -0
  127. package/dist/lib/install-dependencies.d.mts.map +1 -1
  128. package/dist/lib/install-dependencies.mjs +8 -0
  129. package/dist/lib/install-dependencies.mjs.map +1 -1
  130. package/dist/lib/meta.cjs +8 -0
  131. package/dist/lib/meta.d.mts +2 -0
  132. package/dist/lib/meta.d.mts.map +1 -1
  133. package/dist/lib/meta.mjs +8 -0
  134. package/dist/lib/meta.mjs.map +1 -1
  135. package/dist/lib/plugins.cjs +8 -0
  136. package/dist/lib/plugins.d.mts +2 -0
  137. package/dist/lib/plugins.d.mts.map +1 -1
  138. package/dist/lib/plugins.mjs +8 -0
  139. package/dist/lib/plugins.mjs.map +1 -1
  140. package/dist/lib/resolver.cjs +8 -0
  141. package/dist/lib/resolver.d.mts +2 -0
  142. package/dist/lib/resolver.d.mts.map +1 -1
  143. package/dist/lib/resolver.mjs +8 -0
  144. package/dist/lib/resolver.mjs.map +1 -1
  145. package/dist/lib/schemas.cjs +8 -0
  146. package/dist/lib/schemas.d.mts +2 -0
  147. package/dist/lib/schemas.mjs +8 -0
  148. package/dist/lib/streaming-channel.cjs +8 -0
  149. package/dist/lib/streaming-channel.d.mts +2 -0
  150. package/dist/lib/streaming-channel.d.mts.map +1 -1
  151. package/dist/lib/streaming-channel.mjs +8 -0
  152. package/dist/lib/streaming-channel.mjs.map +1 -1
  153. package/dist/lib/typescript/index.cjs +8 -0
  154. package/dist/lib/typescript/index.d.mts +2 -0
  155. package/dist/lib/typescript/index.mjs +8 -0
  156. package/dist/lib/typescript/ts-morph.cjs +8 -0
  157. package/dist/lib/typescript/ts-morph.d.mts +2 -0
  158. package/dist/lib/typescript/ts-morph.d.mts.map +1 -1
  159. package/dist/lib/typescript/ts-morph.mjs +8 -0
  160. package/dist/lib/typescript/ts-morph.mjs.map +1 -1
  161. package/dist/lib/typescript/tsconfig.cjs +8 -0
  162. package/dist/lib/typescript/tsconfig.d.mts +2 -0
  163. package/dist/lib/typescript/tsconfig.d.mts.map +1 -1
  164. package/dist/lib/typescript/tsconfig.mjs +8 -0
  165. package/dist/lib/typescript/tsconfig.mjs.map +1 -1
  166. package/dist/lib/unplugin/helpers.cjs +8 -0
  167. package/dist/lib/unplugin/helpers.d.mts +2 -0
  168. package/dist/lib/unplugin/helpers.d.mts.map +1 -1
  169. package/dist/lib/unplugin/helpers.mjs +8 -0
  170. package/dist/lib/unplugin/helpers.mjs.map +1 -1
  171. package/dist/lib/unplugin/index.cjs +8 -0
  172. package/dist/lib/unplugin/index.d.mts +2 -0
  173. package/dist/lib/unplugin/index.mjs +8 -0
  174. package/dist/lib/unplugin/module-resolution.cjs +8 -0
  175. package/dist/lib/unplugin/module-resolution.d.mts +2 -0
  176. package/dist/lib/unplugin/module-resolution.d.mts.map +1 -1
  177. package/dist/lib/unplugin/module-resolution.mjs +8 -0
  178. package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
  179. package/dist/lib/unplugin/plugin.cjs +8 -0
  180. package/dist/lib/unplugin/plugin.d.mts +2 -0
  181. package/dist/lib/unplugin/plugin.d.mts.map +1 -1
  182. package/dist/lib/unplugin/plugin.mjs +8 -0
  183. package/dist/lib/unplugin/plugin.mjs.map +1 -1
  184. package/dist/lib/utilities/file-header.cjs +8 -0
  185. package/dist/lib/utilities/file-header.d.mts +2 -0
  186. package/dist/lib/utilities/file-header.d.mts.map +1 -1
  187. package/dist/lib/utilities/file-header.mjs +8 -0
  188. package/dist/lib/utilities/file-header.mjs.map +1 -1
  189. package/dist/lib/utilities/format.cjs +8 -0
  190. package/dist/lib/utilities/format.d.mts +2 -0
  191. package/dist/lib/utilities/format.d.mts.map +1 -1
  192. package/dist/lib/utilities/format.mjs +8 -0
  193. package/dist/lib/utilities/format.mjs.map +1 -1
  194. package/dist/lib/utilities/index.cjs +8 -0
  195. package/dist/lib/utilities/index.d.mts +2 -0
  196. package/dist/lib/utilities/index.mjs +8 -0
  197. package/dist/lib/utilities/source-file.cjs +8 -0
  198. package/dist/lib/utilities/source-file.d.mts +2 -0
  199. package/dist/lib/utilities/source-file.d.mts.map +1 -1
  200. package/dist/lib/utilities/source-file.mjs +8 -0
  201. package/dist/lib/utilities/source-file.mjs.map +1 -1
  202. package/dist/lib/utilities/source-map.cjs +8 -0
  203. package/dist/lib/utilities/source-map.d.mts +2 -0
  204. package/dist/lib/utilities/source-map.d.mts.map +1 -1
  205. package/dist/lib/utilities/source-map.mjs +8 -0
  206. package/dist/lib/utilities/source-map.mjs.map +1 -1
  207. package/dist/lib/utilities/write-file.cjs +8 -0
  208. package/dist/lib/utilities/write-file.d.mts +2 -0
  209. package/dist/lib/utilities/write-file.d.mts.map +1 -1
  210. package/dist/lib/utilities/write-file.mjs +8 -0
  211. package/dist/lib/utilities/write-file.mjs.map +1 -1
  212. package/dist/lib/vfs.cjs +8 -0
  213. package/dist/lib/vfs.d.mts +2 -0
  214. package/dist/lib/vfs.d.mts.map +1 -1
  215. package/dist/lib/vfs.mjs +8 -0
  216. package/dist/lib/vfs.mjs.map +1 -1
  217. package/dist/plugin-base.cjs +8 -0
  218. package/dist/plugin-base.d.mts +2 -0
  219. package/dist/plugin-base.d.mts.map +1 -1
  220. package/dist/plugin-base.mjs +8 -0
  221. package/dist/plugin-base.mjs.map +1 -1
  222. package/dist/plugin-utils/build-helpers.cjs +8 -0
  223. package/dist/plugin-utils/build-helpers.d.mts +2 -0
  224. package/dist/plugin-utils/build-helpers.d.mts.map +1 -1
  225. package/dist/plugin-utils/build-helpers.mjs +8 -0
  226. package/dist/plugin-utils/build-helpers.mjs.map +1 -1
  227. package/dist/plugin-utils/combine-plugins.cjs +8 -0
  228. package/dist/plugin-utils/combine-plugins.d.mts +2 -0
  229. package/dist/plugin-utils/combine-plugins.d.mts.map +1 -1
  230. package/dist/plugin-utils/combine-plugins.mjs +8 -0
  231. package/dist/plugin-utils/combine-plugins.mjs.map +1 -1
  232. package/dist/plugin-utils/context-helpers.cjs +8 -0
  233. package/dist/plugin-utils/context-helpers.d.mts +2 -0
  234. package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
  235. package/dist/plugin-utils/context-helpers.mjs +8 -0
  236. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  237. package/dist/plugin-utils/docs-helper.cjs +8 -0
  238. package/dist/plugin-utils/docs-helper.d.mts +2 -0
  239. package/dist/plugin-utils/docs-helper.d.mts.map +1 -1
  240. package/dist/plugin-utils/docs-helper.mjs +8 -0
  241. package/dist/plugin-utils/docs-helper.mjs.map +1 -1
  242. package/dist/plugin-utils/enable-plugin.cjs +8 -0
  243. package/dist/plugin-utils/enable-plugin.d.mts +2 -0
  244. package/dist/plugin-utils/enable-plugin.d.mts.map +1 -1
  245. package/dist/plugin-utils/enable-plugin.mjs +8 -0
  246. package/dist/plugin-utils/enable-plugin.mjs.map +1 -1
  247. package/dist/plugin-utils/extend.cjs +8 -0
  248. package/dist/plugin-utils/extend.d.mts +2 -0
  249. package/dist/plugin-utils/extend.d.mts.map +1 -1
  250. package/dist/plugin-utils/extend.mjs +8 -0
  251. package/dist/plugin-utils/extend.mjs.map +1 -1
  252. package/dist/plugin-utils/filter.cjs +8 -0
  253. package/dist/plugin-utils/filter.d.mts +2 -0
  254. package/dist/plugin-utils/filter.d.mts.map +1 -1
  255. package/dist/plugin-utils/filter.mjs +8 -0
  256. package/dist/plugin-utils/filter.mjs.map +1 -1
  257. package/dist/plugin-utils/format-package-json.cjs +8 -0
  258. package/dist/plugin-utils/format-package-json.d.mts +2 -0
  259. package/dist/plugin-utils/format-package-json.d.mts.map +1 -1
  260. package/dist/plugin-utils/format-package-json.mjs +8 -0
  261. package/dist/plugin-utils/format-package-json.mjs.map +1 -1
  262. package/dist/plugin-utils/format.cjs +8 -0
  263. package/dist/plugin-utils/format.d.mts +2 -0
  264. package/dist/plugin-utils/format.d.mts.map +1 -1
  265. package/dist/plugin-utils/format.mjs +8 -0
  266. package/dist/plugin-utils/format.mjs.map +1 -1
  267. package/dist/plugin-utils/get-config-path.cjs +8 -0
  268. package/dist/plugin-utils/get-config-path.d.mts +2 -0
  269. package/dist/plugin-utils/get-config-path.d.mts.map +1 -1
  270. package/dist/plugin-utils/get-config-path.mjs +8 -0
  271. package/dist/plugin-utils/get-config-path.mjs.map +1 -1
  272. package/dist/plugin-utils/helpers.cjs +8 -0
  273. package/dist/plugin-utils/helpers.d.mts +2 -0
  274. package/dist/plugin-utils/helpers.d.mts.map +1 -1
  275. package/dist/plugin-utils/helpers.mjs +8 -0
  276. package/dist/plugin-utils/helpers.mjs.map +1 -1
  277. package/dist/plugin-utils/index.cjs +8 -0
  278. package/dist/plugin-utils/index.d.mts +2 -0
  279. package/dist/plugin-utils/index.mjs +8 -0
  280. package/dist/plugin-utils/install.cjs +8 -0
  281. package/dist/plugin-utils/install.d.mts +2 -0
  282. package/dist/plugin-utils/install.d.mts.map +1 -1
  283. package/dist/plugin-utils/install.mjs +8 -0
  284. package/dist/plugin-utils/install.mjs.map +1 -1
  285. package/dist/plugin-utils/logging.cjs +8 -0
  286. package/dist/plugin-utils/logging.d.mts +2 -0
  287. package/dist/plugin-utils/logging.d.mts.map +1 -1
  288. package/dist/plugin-utils/logging.mjs +8 -0
  289. package/dist/plugin-utils/logging.mjs.map +1 -1
  290. package/dist/plugin-utils/merge.cjs +8 -0
  291. package/dist/plugin-utils/merge.d.mts +2 -0
  292. package/dist/plugin-utils/merge.d.mts.map +1 -1
  293. package/dist/plugin-utils/merge.mjs +8 -0
  294. package/dist/plugin-utils/merge.mjs.map +1 -1
  295. package/dist/plugin-utils/modules.cjs +8 -0
  296. package/dist/plugin-utils/modules.d.mts +2 -0
  297. package/dist/plugin-utils/modules.d.mts.map +1 -1
  298. package/dist/plugin-utils/modules.mjs +8 -0
  299. package/dist/plugin-utils/modules.mjs.map +1 -1
  300. package/dist/plugin-utils/paths.cjs +8 -0
  301. package/dist/plugin-utils/paths.d.mts +2 -0
  302. package/dist/plugin-utils/paths.d.mts.map +1 -1
  303. package/dist/plugin-utils/paths.mjs +8 -0
  304. package/dist/plugin-utils/paths.mjs.map +1 -1
  305. package/dist/plugin-utils/virtual.cjs +8 -0
  306. package/dist/plugin-utils/virtual.d.mts +2 -0
  307. package/dist/plugin-utils/virtual.d.mts.map +1 -1
  308. package/dist/plugin-utils/virtual.mjs +8 -0
  309. package/dist/plugin-utils/virtual.mjs.map +1 -1
  310. package/dist/schemas/fs.cjs +8 -0
  311. package/dist/schemas/fs.d.mts +2 -0
  312. package/dist/schemas/fs.d.mts.map +1 -1
  313. package/dist/schemas/fs.mjs +8 -0
  314. package/dist/schemas/fs.mjs.map +1 -1
  315. package/dist/storage/base.cjs +8 -0
  316. package/dist/storage/base.d.mts +2 -0
  317. package/dist/storage/base.d.mts.map +1 -1
  318. package/dist/storage/base.mjs +8 -0
  319. package/dist/storage/base.mjs.map +1 -1
  320. package/dist/storage/file-system.cjs +8 -0
  321. package/dist/storage/file-system.d.mts +2 -0
  322. package/dist/storage/file-system.d.mts.map +1 -1
  323. package/dist/storage/file-system.mjs +8 -0
  324. package/dist/storage/file-system.mjs.map +1 -1
  325. package/dist/storage/helpers.cjs +8 -0
  326. package/dist/storage/helpers.d.mts +2 -0
  327. package/dist/storage/helpers.d.mts.map +1 -1
  328. package/dist/storage/helpers.mjs +8 -0
  329. package/dist/storage/helpers.mjs.map +1 -1
  330. package/dist/storage/index.cjs +8 -0
  331. package/dist/storage/index.d.mts +2 -0
  332. package/dist/storage/index.mjs +8 -0
  333. package/dist/storage/virtual.cjs +8 -0
  334. package/dist/storage/virtual.d.mts +2 -0
  335. package/dist/storage/virtual.d.mts.map +1 -1
  336. package/dist/storage/virtual.mjs +8 -0
  337. package/dist/storage/virtual.mjs.map +1 -1
  338. package/dist/types/api.d.cts +3 -3
  339. package/dist/types/api.d.cts.map +1 -1
  340. package/dist/types/api.d.mts +5 -3
  341. package/dist/types/api.d.mts.map +1 -1
  342. package/dist/types/config.d.mts +2 -0
  343. package/dist/types/config.d.mts.map +1 -1
  344. package/dist/types/context.d.mts +2 -0
  345. package/dist/types/context.d.mts.map +1 -1
  346. package/dist/types/fs.d.mts +2 -0
  347. package/dist/types/fs.d.mts.map +1 -1
  348. package/dist/types/hooks.d.mts +2 -0
  349. package/dist/types/hooks.d.mts.map +1 -1
  350. package/dist/types/index.d.cts +1 -1
  351. package/dist/types/index.d.mts +3 -1
  352. package/dist/types/logging.d.mts +2 -0
  353. package/dist/types/logging.d.mts.map +1 -1
  354. package/dist/types/plugin.d.mts +2 -0
  355. package/dist/types/plugin.d.mts.map +1 -1
  356. package/dist/types/tsconfig.d.mts +2 -0
  357. package/dist/types/tsconfig.d.mts.map +1 -1
  358. package/dist/types/unplugin.d.mts +2 -0
  359. package/dist/types/unplugin.d.mts.map +1 -1
  360. package/package.json +7 -7
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  //#region src/plugin-utils/modules.ts
2
10
  /**
3
11
  * Determine if a module ID is a built-in Powerlines module ID.
@@ -1 +1 @@
1
- {"version":3,"file":"modules.mjs","names":[],"sources":["../../src/plugin-utils/modules.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 { Context } from \"../types/context\";\n\n/**\n * Determine if a module ID is a built-in Powerlines module ID.\n *\n * @param context - The Powerlines context.\n * @param moduleName - The name of the module to check.\n * @returns `true` if the module is a built-in module, otherwise `false`.\n */\nexport function isBuiltinModule(context: Context, moduleName: string): boolean {\n const prefix: string = context.config?.framework?.name || \"powerlines\";\n\n return (\n moduleName.startsWith(`${prefix.replace(/:$/, \"\")}:`) ||\n Object.keys(context.fs.metadata)\n .filter(key => context.fs.metadata[key]?.type === \"builtin\")\n .includes(moduleName)\n );\n}\n"],"mappings":";;;;;;;;AA2BA,SAAgB,gBAAgB,SAAkB,YAA6B;CAC7E,MAAM,SAAiB,QAAQ,QAAQ,WAAW,QAAQ;CAE1D,OACE,WAAW,WAAW,GAAG,OAAO,QAAQ,MAAM,EAAE,EAAE,EAAE,KACpD,OAAO,KAAK,QAAQ,GAAG,QAAQ,EAC5B,QAAO,QAAO,QAAQ,GAAG,SAAS,MAAM,SAAS,SAAS,EAC1D,SAAS,UAAU;AAE1B"}
1
+ {"version":3,"file":"modules.mjs","names":[],"sources":["../../src/plugin-utils/modules.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 { Context } from \"../types/context\";\n\n/**\n * Determine if a module ID is a built-in Powerlines module ID.\n *\n * @param context - The Powerlines context.\n * @param moduleName - The name of the module to check.\n * @returns `true` if the module is a built-in module, otherwise `false`.\n */\nexport function isBuiltinModule(context: Context, moduleName: string): boolean {\n const prefix: string = context.config?.framework?.name || \"powerlines\";\n\n return (\n moduleName.startsWith(`${prefix.replace(/:$/, \"\")}:`) ||\n Object.keys(context.fs.metadata)\n .filter(key => context.fs.metadata[key]?.type === \"builtin\")\n .includes(moduleName)\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,SAAgB,gBAAgB,SAAkB,YAA6B;CAC7E,MAAM,SAAiB,QAAQ,QAAQ,WAAW,QAAQ;CAE1D,OACE,WAAW,WAAW,GAAG,OAAO,QAAQ,MAAM,EAAE,EAAE,EAAE,KACpD,OAAO,KAAK,QAAQ,GAAG,QAAQ,EAC5B,QAAO,QAAO,QAAQ,GAAG,SAAS,MAAM,SAAS,SAAS,EAC1D,SAAS,UAAU;AAE1B"}
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
10
  let _stryke_path_replace = require("@stryke/path/replace");
3
11
  let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
@@ -1,3 +1,5 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
1
3
  import { UnresolvedContext } from "../types/context.mjs";
2
4
  import { IsUndefined } from "@stryke/types/base";
3
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.mts","names":[],"sources":["../../src/plugin-utils/paths.ts"],"mappings":";;;;;;AA6DA;;;;;;;;;;;;;;AAG0B;;;;;;;;;;;;;;;;;;;;;iBAHV,iBAAA,CACd,OAAA,EAAS,iBAAA,EACT,IAAA,YACC,WAAA,QAAmB,IAAA"}
1
+ {"version":3,"file":"paths.d.mts","names":[],"sources":["../../src/plugin-utils/paths.ts"],"mappings":";;;;;;;;;;;;;;;;AA6DA;;;;;;;;;;;;;;AAG0B;;;;;;;;;;;;;iBAHV,iBAAA,CACd,OAAA,EAAS,iBAAA,EACT,IAAA,YACC,WAAA,QAAmB,IAAA"}
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  import { replacePath } from "@stryke/path/replace";
2
10
  import { isSetString } from "@stryke/type-checks/is-set-string";
3
11
  import { joinPaths } from "@stryke/path/join";
@@ -1 +1 @@
1
- {"version":3,"file":"paths.mjs","names":[],"sources":["../../src/plugin-utils/paths.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 { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { IsUndefined } from \"@stryke/types/base\";\nimport { UnresolvedContext } from \"../types/context\";\n\n/**\n * Replaces tokens in the given path string with their corresponding values from the context.\n *\n * @remarks\n * The following tokens are supported:\n * - `{cwd}` - The current working directory.\n * - `{workspaceRoot}` - The current working directory (same as `{cwd}`).\n * - `{root}` - The root directory of the project (same as `{projectRoot}`).\n * - `{projectRoot}` - The root directory of the project (same as `{root}`).\n * - `{sourceRoot}` - The source root directory of the project (usually `{root}/src`).\n * - `{powerlinesPath}` - The directory where Powerlines is installed.\n * - `{cachePath}` - The environment's directory for cached files.\n * - `{dataPath}` - The environment's directory for data files.\n * - `{logPath}` - The environment's directory for log files.\n * - `{tempPath}` - The environment's directory for temporary files.\n * - `{configPath}` - The environment's directory for configuration files.\n * - `{output}` - The configured output directory for the project.\n * - `{outputPath}` - The configured output directory for the project.\n * - `{copy}` - The configured final/copied distribution directory for the project.\n * - `{copyPath}` - The configured final/copied distribution directory for the project.\n * - `{artifactsPath}` - The configured directory for build artifacts.\n * - `{builtinPath}` - The configured directory for generated built-in plugins.\n * - `{entryPath}` - The configured directory for generated entry files.\n *\n * @example\n * ```ts\n * const path = replacePathTokens(context, \"{root}/dist\");\n * // If context.config.root is \"/home/user/project\", this will return \"/home/user/project/dist\"\n *\n * const pathWithCopy = replacePathTokens(context, \"{copy}\");\n * // If context.config.output.copy.path is \"/home/user/project/dist-copy\", this will return \"/home/user/project/dist-copy\"\n * ```\n *\n * @param context - The context containing the values for the path tokens.\n * @param path - The path string with tokens to replace.\n * @returns The path string with tokens replaced by their corresponding values from the context.\n */\nexport function replacePathTokens(\n context: UnresolvedContext,\n path?: string\n): IsUndefined<typeof path> extends true ? undefined : string {\n if (!path) {\n return path as IsUndefined<typeof path> extends true ? undefined : string;\n }\n\n let result = path\n .replaceAll(\"{cwd}\", context.config.cwd || process.cwd())\n .replaceAll(\"{workspaceRoot}\", context.config.cwd || process.cwd())\n .replaceAll(\"{root}\", context.config.root)\n .replaceAll(\"{projectRoot}\", context.config.root)\n .replaceAll(\"{sourceRoot}\", joinPaths(context.config.root, \"src\"))\n // .replaceAll(\"{powerlinesPath}\", context.powerlinesPath)\n .replaceAll(\"{cachePath}\", context.cachePath)\n .replaceAll(\"{dataPath}\", context.dataPath)\n .replaceAll(\"{logPath}\", context.envPaths.log)\n .replaceAll(\"{tempPath}\", context.envPaths.temp)\n .replaceAll(\"{configPath}\", context.envPaths.config)\n .replaceAll(\n \"{artifactsPath}\",\n replacePath(context.artifactsPath, context.config.cwd)\n )\n .replaceAll(\n \"{builtinPath}\",\n replacePath(context.builtinsPath, context.config.cwd)\n )\n .replaceAll(\n \"{builtinsPath}\",\n replacePath(context.builtinsPath, context.config.cwd)\n )\n .replaceAll(\n \"{entryPath}\",\n replacePath(context.entryPath, context.config.cwd)\n );\n\n if (context.config.output) {\n if (isSetString(context.config.output.path)) {\n result = result\n .replaceAll(\"{outputPath}\", context.config.output.path)\n .replaceAll(\"{output}\", context.config.output.path);\n }\n if (\n context.config.output.copy &&\n isSetString(context.config.output.copy?.path)\n ) {\n result = result\n .replaceAll(\"{copyPath}\", context.config.output.copy.path)\n .replaceAll(\"{copy}\", context.config.output.copy.path);\n }\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,SAAgB,kBACd,SACA,MAC4D;CAC5D,IAAI,CAAC,MACH,OAAO;CAGT,IAAI,SAAS,KACV,WAAW,SAAS,QAAQ,OAAO,OAAO,QAAQ,IAAI,CAAC,EACvD,WAAW,mBAAmB,QAAQ,OAAO,OAAO,QAAQ,IAAI,CAAC,EACjE,WAAW,UAAU,QAAQ,OAAO,IAAI,EACxC,WAAW,iBAAiB,QAAQ,OAAO,IAAI,EAC/C,WAAW,gBAAgB,UAAU,QAAQ,OAAO,MAAM,KAAK,CAAC,EAEhE,WAAW,eAAe,QAAQ,SAAS,EAC3C,WAAW,cAAc,QAAQ,QAAQ,EACzC,WAAW,aAAa,QAAQ,SAAS,GAAG,EAC5C,WAAW,cAAc,QAAQ,SAAS,IAAI,EAC9C,WAAW,gBAAgB,QAAQ,SAAS,MAAM,EAClD,WACC,mBACA,YAAY,QAAQ,eAAe,QAAQ,OAAO,GAAG,CACvD,EACC,WACC,iBACA,YAAY,QAAQ,cAAc,QAAQ,OAAO,GAAG,CACtD,EACC,WACC,kBACA,YAAY,QAAQ,cAAc,QAAQ,OAAO,GAAG,CACtD,EACC,WACC,eACA,YAAY,QAAQ,WAAW,QAAQ,OAAO,GAAG,CACnD;CAEF,IAAI,QAAQ,OAAO,QAAQ;EACzB,IAAI,YAAY,QAAQ,OAAO,OAAO,IAAI,GACxC,SAAS,OACN,WAAW,gBAAgB,QAAQ,OAAO,OAAO,IAAI,EACrD,WAAW,YAAY,QAAQ,OAAO,OAAO,IAAI;EAEtD,IACE,QAAQ,OAAO,OAAO,QACtB,YAAY,QAAQ,OAAO,OAAO,MAAM,IAAI,GAE5C,SAAS,OACN,WAAW,cAAc,QAAQ,OAAO,OAAO,KAAK,IAAI,EACxD,WAAW,UAAU,QAAQ,OAAO,OAAO,KAAK,IAAI;CAE3D;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"paths.mjs","names":[],"sources":["../../src/plugin-utils/paths.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 { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { IsUndefined } from \"@stryke/types/base\";\nimport { UnresolvedContext } from \"../types/context\";\n\n/**\n * Replaces tokens in the given path string with their corresponding values from the context.\n *\n * @remarks\n * The following tokens are supported:\n * - `{cwd}` - The current working directory.\n * - `{workspaceRoot}` - The current working directory (same as `{cwd}`).\n * - `{root}` - The root directory of the project (same as `{projectRoot}`).\n * - `{projectRoot}` - The root directory of the project (same as `{root}`).\n * - `{sourceRoot}` - The source root directory of the project (usually `{root}/src`).\n * - `{powerlinesPath}` - The directory where Powerlines is installed.\n * - `{cachePath}` - The environment's directory for cached files.\n * - `{dataPath}` - The environment's directory for data files.\n * - `{logPath}` - The environment's directory for log files.\n * - `{tempPath}` - The environment's directory for temporary files.\n * - `{configPath}` - The environment's directory for configuration files.\n * - `{output}` - The configured output directory for the project.\n * - `{outputPath}` - The configured output directory for the project.\n * - `{copy}` - The configured final/copied distribution directory for the project.\n * - `{copyPath}` - The configured final/copied distribution directory for the project.\n * - `{artifactsPath}` - The configured directory for build artifacts.\n * - `{builtinPath}` - The configured directory for generated built-in plugins.\n * - `{entryPath}` - The configured directory for generated entry files.\n *\n * @example\n * ```ts\n * const path = replacePathTokens(context, \"{root}/dist\");\n * // If context.config.root is \"/home/user/project\", this will return \"/home/user/project/dist\"\n *\n * const pathWithCopy = replacePathTokens(context, \"{copy}\");\n * // If context.config.output.copy.path is \"/home/user/project/dist-copy\", this will return \"/home/user/project/dist-copy\"\n * ```\n *\n * @param context - The context containing the values for the path tokens.\n * @param path - The path string with tokens to replace.\n * @returns The path string with tokens replaced by their corresponding values from the context.\n */\nexport function replacePathTokens(\n context: UnresolvedContext,\n path?: string\n): IsUndefined<typeof path> extends true ? undefined : string {\n if (!path) {\n return path as IsUndefined<typeof path> extends true ? undefined : string;\n }\n\n let result = path\n .replaceAll(\"{cwd}\", context.config.cwd || process.cwd())\n .replaceAll(\"{workspaceRoot}\", context.config.cwd || process.cwd())\n .replaceAll(\"{root}\", context.config.root)\n .replaceAll(\"{projectRoot}\", context.config.root)\n .replaceAll(\"{sourceRoot}\", joinPaths(context.config.root, \"src\"))\n // .replaceAll(\"{powerlinesPath}\", context.powerlinesPath)\n .replaceAll(\"{cachePath}\", context.cachePath)\n .replaceAll(\"{dataPath}\", context.dataPath)\n .replaceAll(\"{logPath}\", context.envPaths.log)\n .replaceAll(\"{tempPath}\", context.envPaths.temp)\n .replaceAll(\"{configPath}\", context.envPaths.config)\n .replaceAll(\n \"{artifactsPath}\",\n replacePath(context.artifactsPath, context.config.cwd)\n )\n .replaceAll(\n \"{builtinPath}\",\n replacePath(context.builtinsPath, context.config.cwd)\n )\n .replaceAll(\n \"{builtinsPath}\",\n replacePath(context.builtinsPath, context.config.cwd)\n )\n .replaceAll(\n \"{entryPath}\",\n replacePath(context.entryPath, context.config.cwd)\n );\n\n if (context.config.output) {\n if (isSetString(context.config.output.path)) {\n result = result\n .replaceAll(\"{outputPath}\", context.config.output.path)\n .replaceAll(\"{output}\", context.config.output.path);\n }\n if (\n context.config.output.copy &&\n isSetString(context.config.output.copy?.path)\n ) {\n result = result\n .replaceAll(\"{copyPath}\", context.config.output.copy.path)\n .replaceAll(\"{copy}\", context.config.output.copy.path);\n }\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,SAAgB,kBACd,SACA,MAC4D;CAC5D,IAAI,CAAC,MACH,OAAO;CAGT,IAAI,SAAS,KACV,WAAW,SAAS,QAAQ,OAAO,OAAO,QAAQ,IAAI,CAAC,EACvD,WAAW,mBAAmB,QAAQ,OAAO,OAAO,QAAQ,IAAI,CAAC,EACjE,WAAW,UAAU,QAAQ,OAAO,IAAI,EACxC,WAAW,iBAAiB,QAAQ,OAAO,IAAI,EAC/C,WAAW,gBAAgB,UAAU,QAAQ,OAAO,MAAM,KAAK,CAAC,EAEhE,WAAW,eAAe,QAAQ,SAAS,EAC3C,WAAW,cAAc,QAAQ,QAAQ,EACzC,WAAW,aAAa,QAAQ,SAAS,GAAG,EAC5C,WAAW,cAAc,QAAQ,SAAS,IAAI,EAC9C,WAAW,gBAAgB,QAAQ,SAAS,MAAM,EAClD,WACC,mBACA,YAAY,QAAQ,eAAe,QAAQ,OAAO,GAAG,CACvD,EACC,WACC,iBACA,YAAY,QAAQ,cAAc,QAAQ,OAAO,GAAG,CACtD,EACC,WACC,kBACA,YAAY,QAAQ,cAAc,QAAQ,OAAO,GAAG,CACtD,EACC,WACC,eACA,YAAY,QAAQ,WAAW,QAAQ,OAAO,GAAG,CACnD;CAEF,IAAI,QAAQ,OAAO,QAAQ;EACzB,IAAI,YAAY,QAAQ,OAAO,OAAO,IAAI,GACxC,SAAS,OACN,WAAW,gBAAgB,QAAQ,OAAO,OAAO,IAAI,EACrD,WAAW,YAAY,QAAQ,OAAO,OAAO,IAAI;EAEtD,IACE,QAAQ,OAAO,OAAO,QACtB,YAAY,QAAQ,OAAO,OAAO,MAAM,IAAI,GAE5C,SAAS,OACN,WAAW,cAAc,QAAQ,OAAO,OAAO,KAAK,IAAI,EACxD,WAAW,UAAU,QAAQ,OAAO,OAAO,KAAK,IAAI;CAE3D;CAEA,OAAO;AACT"}
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
10
 
3
11
  //#region src/plugin-utils/virtual.ts
@@ -1,3 +1,5 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
1
3
  //#region src/plugin-utils/virtual.d.ts
2
4
  declare const VIRTUAL_MODULE_PREFIX = "\0";
3
5
  declare const VIRTUAL_MODULE_PREFIX_REGEX: RegExp;
@@ -1 +1 @@
1
- {"version":3,"file":"virtual.d.mts","names":[],"sources":["../../src/plugin-utils/virtual.ts"],"mappings":";cAuBa,qBAAA;AAAA,cACA,2BAAA,EAA2B,MAAoB;AAAA,UAE3C,kBAAA;;;AAHiB;EAOhC,KAAA;EAN0D;;;EAW1D,MAAA;EATe;;;EAcf,gBAAA;AAAA;;;;AAAgB;AAsBlB;;;;;;;;;AAGS;AAqBT;;;;AAA2C;iBAxB3B,WAAA,CACd,GAAA,UACA,OAAA,GAAS,kBAAA,GACR,MAAM;;;;AA+BqC;AAU9C;;iBApBgB,gBAAA,CAAiB,EAAU;;AAoBD;AAU1C;;;;iBApBgB,mBAAA,CAAoB,EAAU;;;;;;;iBAU9B,eAAA,CAAgB,EAAU;;;;;;;iBAU1B,wBAAA,CAAyB,EAAA,WAAa,MAAM"}
1
+ {"version":3,"file":"virtual.d.mts","names":[],"sources":["../../src/plugin-utils/virtual.ts"],"mappings":";;;cAuBa,qBAAA;AAAA,cACA,2BAAA,EAA2B,MAAoB;AAAA,UAE3C,kBAAA;;;;EAIf,KAAA;;;AAPF;EAYE,MAAA;;;AAZgC;EAiBhC,gBAAA;AAAA;;;AAhB0D;AAE5D;;;;;;;;AAckB;AAsBlB;;;;;;;iBAAgB,WAAA,CACd,GAAA,UACA,OAAA,GAAS,kBAAA,GACR,MAAM;;AAAA;AAqBT;;;;iBAAgB,gBAAA,CAAiB,EAAU;AAU3C;;;;AAA8C;AAU9C;AAVA,iBAAgB,mBAAA,CAAoB,EAAU;;;AAUJ;AAU1C;;;iBAVgB,eAAA,CAAgB,EAAU;AAUkB;;;;;;AAAA,iBAA5C,wBAAA,CAAyB,EAAA,WAAa,MAAM"}
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  //#region src/plugin-utils/virtual.ts
2
10
  const ESCAPE_REGEX = /[-/\\^$*+?.()|[\]{}]/g;
3
11
  function escapeRegex(str) {
@@ -1 +1 @@
1
- {"version":3,"file":"virtual.mjs","names":[],"sources":["../../src/plugin-utils/virtual.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\nconst ESCAPE_REGEX = /[-/\\\\^$*+?.()|[\\]{}]/g;\nfunction escapeRegex(str: string): string {\n return str.replace(ESCAPE_REGEX, \"\\\\$&\");\n}\n\nexport const VIRTUAL_MODULE_PREFIX = \"\\0\";\nexport const VIRTUAL_MODULE_PREFIX_REGEX = prefixRegex(\"\\0\");\n\nexport interface PrefixRegexOptions {\n /**\n * Flags for the RegExp.\n */\n flags?: string;\n\n /**\n * The prefix to match. This will be escaped and used as the prefix in the generated RegExp.\n */\n prefix?: string;\n\n /**\n * Whether the prefix is optional. If true, the generated RegExp will match both strings that start with the prefix and strings that do not start with the prefix. Default is false.\n */\n isPrefixOptional?: boolean;\n}\n\n/**\n * Constructs a RegExp that matches a value that has the specified prefix. This is useful for plugin hook filters.\n *\n * @example\n * ```ts\n * import { prefixRegex } from '@rolldown/pluginutils';\n * const plugin = {\n * name: 'plugin',\n * resolveId: {\n * filter: { id: prefixRegex('foo') },\n * handler(id) {} // will only be called for IDs starting with `foo`\n * }\n * }\n * ```\n *\n * @param str - the string to match.\n * @param options - options for the RegExp.\n * @return a RegExp that matches the specified string with the specified prefix.\n */\nexport function prefixRegex(\n str: string,\n options: PrefixRegexOptions = {}\n): RegExp {\n const { flags, prefix, isPrefixOptional = false } = options;\n\n return new RegExp(\n `^${\n prefix\n ? isPrefixOptional\n ? `(${escapeRegex(prefix)})?`\n : `${escapeRegex(prefix)}`\n : \"\"\n }${escapeRegex(str)}`,\n flags\n );\n}\n\n/**\n * Adds the virtual module prefix to the given ID.\n *\n * @param id - The ID to add the virtual module prefix to.\n * @returns The ID with the virtual module prefix added.\n */\nexport function addVirtualPrefix(id: string): string {\n return `${VIRTUAL_MODULE_PREFIX}${id}`;\n}\n\n/**\n * Removes the virtual module prefix from the given ID, if it exists.\n *\n * @param id - The ID to remove the virtual module prefix from.\n * @returns The ID without the virtual module prefix.\n */\nexport function removeVirtualPrefix(id: string): string {\n return id.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\");\n}\n\n/**\n * Checks if the given ID is a virtual module by checking if it starts with the virtual module prefix.\n *\n * @param id - The ID to check.\n * @returns True if the ID is a virtual module, false otherwise.\n */\nexport function isVirtualModule(id: string): boolean {\n return id.startsWith(VIRTUAL_MODULE_PREFIX);\n}\n\n/**\n * Creates a regular expression that matches the given ID with the virtual module prefix.\n *\n * @param id - The ID to create a regular expression for.\n * @returns A regular expression that matches the given ID with the virtual module prefix.\n */\nexport function createVirtualPrefixRegex(id: string): RegExp {\n return prefixRegex(removeVirtualPrefix(id), {\n prefix: VIRTUAL_MODULE_PREFIX,\n isPrefixOptional: true\n });\n}\n"],"mappings":";AAkBA,MAAM,eAAe;AACrB,SAAS,YAAY,KAAqB;CACxC,OAAO,IAAI,QAAQ,cAAc,MAAM;AACzC;AAEA,MAAa,wBAAwB;AACrC,MAAa,8BAA8B,YAAY,IAAI;;;;;;;;;;;;;;;;;;;;AAsC3D,SAAgB,YACd,KACA,UAA8B,CAAC,GACvB;CACR,MAAM,EAAE,OAAO,QAAQ,mBAAmB,UAAU;CAEpD,OAAO,IAAI,OACT,IACE,SACI,mBACE,IAAI,YAAY,MAAM,EAAE,MACxB,GAAG,YAAY,MAAM,MACvB,KACH,YAAY,GAAG,KAClB,KACF;AACF;;;;;;;AAQA,SAAgB,iBAAiB,IAAoB;CACnD,OAAO,UAA2B;AACpC;;;;;;;AAQA,SAAgB,oBAAoB,IAAoB;CACtD,OAAO,GAAG,QAAQ,6BAA6B,EAAE;AACnD;;;;;;;AAQA,SAAgB,gBAAgB,IAAqB;CACnD,OAAO,GAAG,eAAgC;AAC5C;;;;;;;AAQA,SAAgB,yBAAyB,IAAoB;CAC3D,OAAO,YAAY,oBAAoB,EAAE,GAAG;EAC1C;EACA,kBAAkB;CACpB,CAAC;AACH"}
1
+ {"version":3,"file":"virtual.mjs","names":[],"sources":["../../src/plugin-utils/virtual.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\nconst ESCAPE_REGEX = /[-/\\\\^$*+?.()|[\\]{}]/g;\nfunction escapeRegex(str: string): string {\n return str.replace(ESCAPE_REGEX, \"\\\\$&\");\n}\n\nexport const VIRTUAL_MODULE_PREFIX = \"\\0\";\nexport const VIRTUAL_MODULE_PREFIX_REGEX = prefixRegex(\"\\0\");\n\nexport interface PrefixRegexOptions {\n /**\n * Flags for the RegExp.\n */\n flags?: string;\n\n /**\n * The prefix to match. This will be escaped and used as the prefix in the generated RegExp.\n */\n prefix?: string;\n\n /**\n * Whether the prefix is optional. If true, the generated RegExp will match both strings that start with the prefix and strings that do not start with the prefix. Default is false.\n */\n isPrefixOptional?: boolean;\n}\n\n/**\n * Constructs a RegExp that matches a value that has the specified prefix. This is useful for plugin hook filters.\n *\n * @example\n * ```ts\n * import { prefixRegex } from '@rolldown/pluginutils';\n * const plugin = {\n * name: 'plugin',\n * resolveId: {\n * filter: { id: prefixRegex('foo') },\n * handler(id) {} // will only be called for IDs starting with `foo`\n * }\n * }\n * ```\n *\n * @param str - the string to match.\n * @param options - options for the RegExp.\n * @return a RegExp that matches the specified string with the specified prefix.\n */\nexport function prefixRegex(\n str: string,\n options: PrefixRegexOptions = {}\n): RegExp {\n const { flags, prefix, isPrefixOptional = false } = options;\n\n return new RegExp(\n `^${\n prefix\n ? isPrefixOptional\n ? `(${escapeRegex(prefix)})?`\n : `${escapeRegex(prefix)}`\n : \"\"\n }${escapeRegex(str)}`,\n flags\n );\n}\n\n/**\n * Adds the virtual module prefix to the given ID.\n *\n * @param id - The ID to add the virtual module prefix to.\n * @returns The ID with the virtual module prefix added.\n */\nexport function addVirtualPrefix(id: string): string {\n return `${VIRTUAL_MODULE_PREFIX}${id}`;\n}\n\n/**\n * Removes the virtual module prefix from the given ID, if it exists.\n *\n * @param id - The ID to remove the virtual module prefix from.\n * @returns The ID without the virtual module prefix.\n */\nexport function removeVirtualPrefix(id: string): string {\n return id.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\");\n}\n\n/**\n * Checks if the given ID is a virtual module by checking if it starts with the virtual module prefix.\n *\n * @param id - The ID to check.\n * @returns True if the ID is a virtual module, false otherwise.\n */\nexport function isVirtualModule(id: string): boolean {\n return id.startsWith(VIRTUAL_MODULE_PREFIX);\n}\n\n/**\n * Creates a regular expression that matches the given ID with the virtual module prefix.\n *\n * @param id - The ID to create a regular expression for.\n * @returns A regular expression that matches the given ID with the virtual module prefix.\n */\nexport function createVirtualPrefixRegex(id: string): RegExp {\n return prefixRegex(removeVirtualPrefix(id), {\n prefix: VIRTUAL_MODULE_PREFIX,\n isPrefixOptional: true\n });\n}\n"],"mappings":";;;;;;;;;AAkBA,MAAM,eAAe;AACrB,SAAS,YAAY,KAAqB;CACxC,OAAO,IAAI,QAAQ,cAAc,MAAM;AACzC;AAEA,MAAa,wBAAwB;AACrC,MAAa,8BAA8B,YAAY,IAAI;;;;;;;;;;;;;;;;;;;;AAsC3D,SAAgB,YACd,KACA,UAA8B,CAAC,GACvB;CACR,MAAM,EAAE,OAAO,QAAQ,mBAAmB,UAAU;CAEpD,OAAO,IAAI,OACT,IACE,SACI,mBACE,IAAI,YAAY,MAAM,EAAE,MACxB,GAAG,YAAY,MAAM,MACvB,KACH,YAAY,GAAG,KAClB,KACF;AACF;;;;;;;AAQA,SAAgB,iBAAiB,IAAoB;CACnD,OAAO,UAA2B;AACpC;;;;;;;AAQA,SAAgB,oBAAoB,IAAoB;CACtD,OAAO,GAAG,QAAQ,6BAA6B,EAAE;AACnD;;;;;;;AAQA,SAAgB,gBAAgB,IAAqB;CACnD,OAAO,GAAG,eAAgC;AAC5C;;;;;;;AAQA,SAAgB,yBAAyB,IAAoB;CAC3D,OAAO,YAAY,oBAAoB,EAAE,GAAG;EAC1C;EACA,kBAAkB;CACpB,CAAC;AACH"}
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
10
  let _stryke_capnp = require("@stryke/capnp");
3
11
  _stryke_capnp = require_runtime.__toESM(_stryke_capnp, 1);
@@ -1,3 +1,5 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
1
3
  import * as $ from "@stryke/capnp";
2
4
 
3
5
  //#region schemas/fs.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"fs.d.mts","names":[],"sources":["../../schemas/fs.ts"],"mappings":";;;cAKa,YAAA;AAAA,cACA,yBAAA,SAAkC,CAAA,CAAE,MAAM;EAAA,gBACrB,MAAA;;;UADK,CAAA,CAAA,UAAA;EAAA;EAAA,IAMjC,GAAA,CAAA;EAAA,IAGA,GAAA,CAAI,KAAA;EAAA,IAGJ,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AAA,CAAE,IAAA,CAAK,WAAA;EAAA,IAG9B,OAAA,CAAA,GAAW,CAAA,CAAE,IAAA,CAAK,WAAA;EAGtB,WAAA,CAAA;EAGA,YAAA,CAAa,MAAA,WAAiB,CAAA,CAAE,IAAA,CAAK,WAAA;EAAA,IAGjC,OAAA,CAAQ,KAAA,EAAO,CAAA,CAAE,IAAA,CAAK,WAAA;EAG1B,cAAA,CAAe,KAAA,EAAO,CAAA,CAAE,MAAA,CAAO,CAAA,CAAE,IAAA,CAAK,YAAA;EAGtC,eAAA,CAAA,GAAmB,CAAA,CAAE,MAAA,CAAO,CAAA,CAAE,IAAA,CAAK,YAAA;EAAA,IAG/B,QAAA,CAAA,GAAY,CAAA,CAAE,IAAA,CAAK,YAAA;EAGvB,YAAA,CAAA;EAGA,aAAA,CAAc,MAAA,WAAiB,CAAA,CAAE,IAAA,CAAK,YAAA;EAAA,IAGlC,QAAA,CAAS,KAAA,EAAO,CAAA,CAAE,IAAA,CAAK,YAAA;EAGX,QAAA,CAAA;AAAA"}
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  import * as $ from "@stryke/capnp";
2
10
 
3
11
  //#region schemas/fs.ts
@@ -1 +1 @@
1
- {"version":3,"file":"fs.mjs","names":[],"sources":["../../schemas/fs.ts"],"sourcesContent":["/* eslint-disable */\n// biome-ignore lint: disable\n// Generated by storm-capnpc\n// Note: Do not edit this file manually - it will be overwritten automatically\nimport * as $ from \"@stryke/capnp\";\nexport const _capnpFileId = BigInt(\"0xa56c61324b9d6e49\");\nexport class FileMetadata_KeyValuePair extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"KeyValuePair\",\n id: \"eabb26cf58b2a14c\",\n size: new $.ObjectSize(0, 2),\n };\n get key(): string {\n return $.utils.getText(0, this);\n }\n set key(value: string) {\n $.utils.setText(0, value, this);\n }\n get value(): string {\n return $.utils.getText(1, this);\n }\n set value(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileMetadata_KeyValuePair_\" + super.toString(); }\n}\n/**\n* The identifier for the file data.\n*\n*/\nexport class FileMetadata extends $.Struct {\n static readonly KeyValuePair = FileMetadata_KeyValuePair;\n public static override readonly _capnp = {\n displayName: \"FileMetadata\",\n id: \"8e2cab5d7e28c7b3\",\n size: new $.ObjectSize(8, 3),\n defaultType: \"normal\"\n };\n static _Properties: $.ListCtor<FileMetadata_KeyValuePair>;\n /**\n* The type of the file.\n*\n*/\n get id(): string {\n return $.utils.getText(0, this);\n }\n set id(value: string) {\n $.utils.setText(0, value, this);\n }\n /**\n* The timestamp representing the file's creation date.\n*\n*/\n get type(): string {\n return $.utils.getText(1, this, FileMetadata._capnp.defaultType);\n }\n set type(value: string) {\n $.utils.setText(1, value, this);\n }\n /**\n* Additional metadata associated with the file.\n*\n*/\n get timestamp(): number {\n return $.utils.getUint32(0, this);\n }\n set timestamp(value: number) {\n $.utils.setUint32(0, value, this);\n }\n _adoptProperties(value: $.Orphan<$.List<FileMetadata_KeyValuePair>>): void {\n $.utils.adopt(value, $.utils.getPointer(2, this));\n }\n _disownProperties(): $.Orphan<$.List<FileMetadata_KeyValuePair>> {\n return $.utils.disown(this.properties);\n }\n get properties(): $.List<FileMetadata_KeyValuePair> {\n return $.utils.getList(2, FileMetadata._Properties, this);\n }\n _hasProperties(): boolean {\n return !$.utils.isNull($.utils.getPointer(2, this));\n }\n _initProperties(length: number): $.List<FileMetadata_KeyValuePair> {\n return $.utils.initList(2, FileMetadata._Properties, length, this);\n }\n set properties(value: $.List<FileMetadata_KeyValuePair>) {\n $.utils.copyFrom(value, $.utils.getPointer(2, this));\n }\n public override toString(): string { return \"FileMetadata_\" + super.toString(); }\n}\n/**\n* An identifier for the file.\n*\n*/\nexport class FileId extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileId\",\n id: \"990d6a471072f997\",\n size: new $.ObjectSize(0, 2),\n };\n /**\n* A virtual (or actual) path to the file in the file system.\n*\n*/\n get id(): string {\n return $.utils.getText(0, this);\n }\n set id(value: string) {\n $.utils.setText(0, value, this);\n }\n get path(): string {\n return $.utils.getText(1, this);\n }\n set path(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileId_\" + super.toString(); }\n}\n/**\n* An identifier for the file.\n*\n*/\nexport class FileStorage extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileStorage\",\n id: \"9dca66ac858c9ebe\",\n size: new $.ObjectSize(0, 2),\n };\n /**\n* A virtual (or actual) path to the file in the file system.\n*\n*/\n get path(): string {\n return $.utils.getText(0, this);\n }\n set path(value: string) {\n $.utils.setText(0, value, this);\n }\n get code(): string {\n return $.utils.getText(1, this);\n }\n set code(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileStorage_\" + super.toString(); }\n}\nexport class FileSystem extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileSystem\",\n id: \"ae0c23d43e56abcf\",\n size: new $.ObjectSize(0, 3),\n };\n static _Ids: $.ListCtor<FileId>;\n static _Storage: $.ListCtor<FileStorage>;\n static _Metadata: $.ListCtor<FileMetadata>;\n _adoptIds(value: $.Orphan<$.List<FileId>>): void {\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownIds(): $.Orphan<$.List<FileId>> {\n return $.utils.disown(this.ids);\n }\n get ids(): $.List<FileId> {\n return $.utils.getList(0, FileSystem._Ids, this);\n }\n _hasIds(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initIds(length: number): $.List<FileId> {\n return $.utils.initList(0, FileSystem._Ids, length, this);\n }\n set ids(value: $.List<FileId>) {\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptStorage(value: $.Orphan<$.List<FileStorage>>): void {\n $.utils.adopt(value, $.utils.getPointer(1, this));\n }\n _disownStorage(): $.Orphan<$.List<FileStorage>> {\n return $.utils.disown(this.storage);\n }\n get storage(): $.List<FileStorage> {\n return $.utils.getList(1, FileSystem._Storage, this);\n }\n _hasStorage(): boolean {\n return !$.utils.isNull($.utils.getPointer(1, this));\n }\n _initStorage(length: number): $.List<FileStorage> {\n return $.utils.initList(1, FileSystem._Storage, length, this);\n }\n set storage(value: $.List<FileStorage>) {\n $.utils.copyFrom(value, $.utils.getPointer(1, this));\n }\n _adoptMetadata(value: $.Orphan<$.List<FileMetadata>>): void {\n $.utils.adopt(value, $.utils.getPointer(2, this));\n }\n _disownMetadata(): $.Orphan<$.List<FileMetadata>> {\n return $.utils.disown(this.metadata);\n }\n get metadata(): $.List<FileMetadata> {\n return $.utils.getList(2, FileSystem._Metadata, this);\n }\n _hasMetadata(): boolean {\n return !$.utils.isNull($.utils.getPointer(2, this));\n }\n _initMetadata(length: number): $.List<FileMetadata> {\n return $.utils.initList(2, FileSystem._Metadata, length, this);\n }\n set metadata(value: $.List<FileMetadata>) {\n $.utils.copyFrom(value, $.utils.getPointer(2, this));\n }\n public override toString(): string { return \"FileSystem_\" + super.toString(); }\n}\nFileMetadata._Properties = $.CompositeList(FileMetadata_KeyValuePair);\nFileSystem._Ids = $.CompositeList(FileId);\nFileSystem._Storage = $.CompositeList(FileStorage);\nFileSystem._Metadata = $.CompositeList(FileMetadata);\n"],"mappings":";;;AAKA,MAAa,eAAe,OAAO,oBAAoB;AACvD,IAAa,4BAAb,cAA+C,EAAE,OAAO;CACtD,OAAgC,SAAS;EACvC,aAAa;EACb,IAAI;EACJ,MAAM,IAAI,EAAE,WAAW,GAAG,CAAC;CAC7B;CACA,IAAI,MAAc;EAChB,OAAO,EAAE,MAAM,QAAQ,GAAG,IAAI;CAChC;CACA,IAAI,IAAI,OAAe;EACrB,EAAE,MAAM,QAAQ,GAAG,OA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AO,KAAK,QAAQ;CACrC;CACA,IAAI,WAAiC;EACnC,OAAO,EAAE,MAAM,QAAQ,GAAG,WAAW,WAAW,IAAI;CACtD;CACA,eAAwB;EACtB,OAAO,CAAC,EAAE,MAAM,OAAO,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;CACpD;CACA,cAAc,QAAsC;EAClD,OAAO,EAAE,MAAM,SAAS,GAAG,WAAW,WAAW,QAAQ,IAAI;CAC/D;CACA,IAAI,SAAS,OAA6B;EACxC,EAAE,MAAM,SAAS,OAAO,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;CACrD;CACA,AAAgB,WAAmB;EAAE,OAAO,gBAAgB,MAAM,SAAS;CAAG;AAChF;AACA,aAAa,cAAc,EAAE,cAAc,yBAAyB;AACpE,WAAW,OAAO,EAAE,cAAc,MAAM;AACxC,WAAW,WAAW,EAAE,cAAc,WAAW;AACjD,WAAW,YAAY,EAAE,cAAc,YAAY"}
1
+ {"version":3,"file":"fs.mjs","names":[],"sources":["../../schemas/fs.ts"],"sourcesContent":["/* eslint-disable */\n// biome-ignore lint: disable\n// Generated by storm-capnpc\n// Note: Do not edit this file manually - it will be overwritten automatically\nimport * as $ from \"@stryke/capnp\";\nexport const _capnpFileId = BigInt(\"0xa56c61324b9d6e49\");\nexport class FileMetadata_KeyValuePair extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"KeyValuePair\",\n id: \"eabb26cf58b2a14c\",\n size: new $.ObjectSize(0, 2),\n };\n get key(): string {\n return $.utils.getText(0, this);\n }\n set key(value: string) {\n $.utils.setText(0, value, this);\n }\n get value(): string {\n return $.utils.getText(1, this);\n }\n set value(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileMetadata_KeyValuePair_\" + super.toString(); }\n}\n/**\n* The identifier for the file data.\n*\n*/\nexport class FileMetadata extends $.Struct {\n static readonly KeyValuePair = FileMetadata_KeyValuePair;\n public static override readonly _capnp = {\n displayName: \"FileMetadata\",\n id: \"8e2cab5d7e28c7b3\",\n size: new $.ObjectSize(8, 3),\n defaultType: \"normal\"\n };\n static _Properties: $.ListCtor<FileMetadata_KeyValuePair>;\n /**\n* The type of the file.\n*\n*/\n get id(): string {\n return $.utils.getText(0, this);\n }\n set id(value: string) {\n $.utils.setText(0, value, this);\n }\n /**\n* The timestamp representing the file's creation date.\n*\n*/\n get type(): string {\n return $.utils.getText(1, this, FileMetadata._capnp.defaultType);\n }\n set type(value: string) {\n $.utils.setText(1, value, this);\n }\n /**\n* Additional metadata associated with the file.\n*\n*/\n get timestamp(): number {\n return $.utils.getUint32(0, this);\n }\n set timestamp(value: number) {\n $.utils.setUint32(0, value, this);\n }\n _adoptProperties(value: $.Orphan<$.List<FileMetadata_KeyValuePair>>): void {\n $.utils.adopt(value, $.utils.getPointer(2, this));\n }\n _disownProperties(): $.Orphan<$.List<FileMetadata_KeyValuePair>> {\n return $.utils.disown(this.properties);\n }\n get properties(): $.List<FileMetadata_KeyValuePair> {\n return $.utils.getList(2, FileMetadata._Properties, this);\n }\n _hasProperties(): boolean {\n return !$.utils.isNull($.utils.getPointer(2, this));\n }\n _initProperties(length: number): $.List<FileMetadata_KeyValuePair> {\n return $.utils.initList(2, FileMetadata._Properties, length, this);\n }\n set properties(value: $.List<FileMetadata_KeyValuePair>) {\n $.utils.copyFrom(value, $.utils.getPointer(2, this));\n }\n public override toString(): string { return \"FileMetadata_\" + super.toString(); }\n}\n/**\n* An identifier for the file.\n*\n*/\nexport class FileId extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileId\",\n id: \"990d6a471072f997\",\n size: new $.ObjectSize(0, 2),\n };\n /**\n* A virtual (or actual) path to the file in the file system.\n*\n*/\n get id(): string {\n return $.utils.getText(0, this);\n }\n set id(value: string) {\n $.utils.setText(0, value, this);\n }\n get path(): string {\n return $.utils.getText(1, this);\n }\n set path(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileId_\" + super.toString(); }\n}\n/**\n* An identifier for the file.\n*\n*/\nexport class FileStorage extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileStorage\",\n id: \"9dca66ac858c9ebe\",\n size: new $.ObjectSize(0, 2),\n };\n /**\n* A virtual (or actual) path to the file in the file system.\n*\n*/\n get path(): string {\n return $.utils.getText(0, this);\n }\n set path(value: string) {\n $.utils.setText(0, value, this);\n }\n get code(): string {\n return $.utils.getText(1, this);\n }\n set code(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileStorage_\" + super.toString(); }\n}\nexport class FileSystem extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileSystem\",\n id: \"ae0c23d43e56abcf\",\n size: new $.ObjectSize(0, 3),\n };\n static _Ids: $.ListCtor<FileId>;\n static _Storage: $.ListCtor<FileStorage>;\n static _Metadata: $.ListCtor<FileMetadata>;\n _adoptIds(value: $.Orphan<$.List<FileId>>): void {\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownIds(): $.Orphan<$.List<FileId>> {\n return $.utils.disown(this.ids);\n }\n get ids(): $.List<FileId> {\n return $.utils.getList(0, FileSystem._Ids, this);\n }\n _hasIds(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initIds(length: number): $.List<FileId> {\n return $.utils.initList(0, FileSystem._Ids, length, this);\n }\n set ids(value: $.List<FileId>) {\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptStorage(value: $.Orphan<$.List<FileStorage>>): void {\n $.utils.adopt(value, $.utils.getPointer(1, this));\n }\n _disownStorage(): $.Orphan<$.List<FileStorage>> {\n return $.utils.disown(this.storage);\n }\n get storage(): $.List<FileStorage> {\n return $.utils.getList(1, FileSystem._Storage, this);\n }\n _hasStorage(): boolean {\n return !$.utils.isNull($.utils.getPointer(1, this));\n }\n _initStorage(length: number): $.List<FileStorage> {\n return $.utils.initList(1, FileSystem._Storage, length, this);\n }\n set storage(value: $.List<FileStorage>) {\n $.utils.copyFrom(value, $.utils.getPointer(1, this));\n }\n _adoptMetadata(value: $.Orphan<$.List<FileMetadata>>): void {\n $.utils.adopt(value, $.utils.getPointer(2, this));\n }\n _disownMetadata(): $.Orphan<$.List<FileMetadata>> {\n return $.utils.disown(this.metadata);\n }\n get metadata(): $.List<FileMetadata> {\n return $.utils.getList(2, FileSystem._Metadata, this);\n }\n _hasMetadata(): boolean {\n return !$.utils.isNull($.utils.getPointer(2, this));\n }\n _initMetadata(length: number): $.List<FileMetadata> {\n return $.utils.initList(2, FileSystem._Metadata, length, this);\n }\n set metadata(value: $.List<FileMetadata>) {\n $.utils.copyFrom(value, $.utils.getPointer(2, this));\n }\n public override toString(): string { return \"FileSystem_\" + super.toString(); }\n}\nFileMetadata._Properties = $.CompositeList(FileMetadata_KeyValuePair);\nFileSystem._Ids = $.CompositeList(FileId);\nFileSystem._Storage = $.CompositeList(FileStorage);\nFileSystem._Metadata = $.CompositeList(FileMetadata);\n"],"mappings":";;;;;;;;;;;AAKA,MAAa,eAAe,OAAO,oBAAoB;AACvD,IAAa,4BAAb,cAA+C,EAAE,OAAO;CACtD,OAAgC,SAAS;EACvC,aAAa;EACb,IAAI;EACJ,MAAM,IAAI,EAAE,WAAW,GAAG,CAAC;CAC7B;CACA,IAAI,MAAc;EAChB,OAAO,EAAE,MAAM,QAAQ,GAAG,IAAI;CAChC;CACA,IAAI,IAAI,OAAe;EACrB,EAAE,MAAM,QAAQ,GAAG,OAAO,IAAI;CAChC;CACA,IAAI,QAAgB;EAClB,OAAO,EAAE,MAAM,QAAQ,GAAG,IAAI;CAChC;CACA,IAAI,MAAM,OAAe;EACvB,EAAE,MAAM,QAAQ,GAAG,OAAO,IAAI;CAChC;CACA,AAAgB,WAAmB;EAAE,OAAO,+BAA+B,MAAM,SAAS;CAAG;AAC/F;;;;;AAKA,IAAa,eAAb,MAAa,qBAAqB,EAAE,OAAO;CACzC,OAAgB,eAAe;CAC/B,OAAgC,SAAS;EACvC,aAAa;EACb,IAAI;EACJ,MAAM,IAAI,EAAE,WAAW,GAAG,CAAC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D;CACA,AAAgB,WAAmB;EAAE,OAAO,gBAAgB,MAAM,SAAS;CAAG;AAChF;AACA,aAAa,cAAc,EAAE,cAAc,yBAAyB;AACpE,WAAW,OAAO,EAAE,cAAc,MAAM;AACxC,WAAW,WAAW,EAAE,cAAc,WAAW;AACjD,WAAW,YAAY,EAAE,cAAc,YAAY"}
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
10
  let _stryke_path_append = require("@stryke/path/append");
3
11
  let _stryke_path_join = require("@stryke/path/join");
@@ -1,3 +1,5 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
1
3
  import { StorageAdapter, StoragePreset } from "../types/fs.mjs";
2
4
  import { Context } from "../types/context.mjs";
3
5
  import { MaybePromise } from "@stryke/types/base";
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.mts","names":[],"sources":["../../src/storage/base.ts"],"mappings":";;;;;UA0BiB,qBAAA;EACf,IAAA;EACA,UAAA;EACA,MAAA;AAAA;;;;uBAMoB,kBAAA,kBACH,qBAAA,GAAwB,qBAAA,aAC9B,cAAA;EAAA;YA+BC,OAAA,EAAS,OAAA;EAjCD;;;EAAA,SAWJ,IAAA;EAVyB;;;EAelC,OAAA,EAAS,QAAA;EAiBK;;;;;;EAAA,SATL,MAAA,GAAS,aAAA;EAqIU;;;;;;cA5HvB,OAAA,EAAS,OAAA,EACnB,OAAA,GAAS,QAAA;EAmQiB;;;;;;EAAA,SAtPZ,UAAA,CAAW,GAAA;EA7ChB;;;;;;EAqDE,MAAA,CAAO,G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__tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  import { appendPath } from "@stryke/path/append";
2
10
  import { joinPaths } from "@stryke/path/join";
3
11
  import { resolve } from "node:path";
@@ -1 +1 @@
1
- {"version":3,"file":"base.mjs","names":["#isDisposed"],"sources":["../../src/storage/base.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 { appendPath } from \"@stryke/path/append\";\nimport { correctPath } from \"@stryke/path/correct-path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { MaybePromise } from \"@stryke/types/base\";\nimport { resolve } from \"node:path\";\nimport { Context } from \"../types/context\";\nimport { StorageAdapter, StoragePreset } from \"../types/fs\";\n\nexport interface StorageAdapterOptions {\n base: string;\n isReadOnly?: boolean;\n ignore?: string | string[];\n}\n\n/**\n * Abstract base class for storage adapters, providing a template for storage operations.\n */\nexport abstract class BaseStorageAdapter<\n TOptions extends StorageAdapterOptions = StorageAdapterOptions\n> implements StorageAdapter {\n /**\n * Indicates whether the storage adapter has been disposed.\n */\n #isDisposed = false;\n\n /**\n * A name identifying the storage adapter type.\n */\n public abstract name: string;\n\n /**\n * Configuration options for the storage adapter.\n */\n public options: TOptions;\n\n /**\n * The storage preset for the adapter.\n *\n * @remarks\n * This can be used as an alternate way to identify the type of storage being used.\n */\n public readonly preset?: StoragePreset | null = null;\n\n /**\n * Constructor for the BaseStorageAdapter.\n *\n * @param context - The Powerlines context.\n * @param options - Configuration options for the storage adapter.\n */\n public constructor(\n protected context: Context,\n options: TOptions = { base: \"/\" } as TOptions\n ) {\n this.options = options;\n this.options.base = resolve(options.base);\n this.options.isReadOnly = !!options.isReadOnly;\n }\n\n /**\n * Synchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns Returns `true` if the key exists, otherwise `false`.\n */\n public abstract existsSync(key: string): boolean;\n\n /**\n * Asynchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns A promise that resolves to `true` if the key exists, otherwise `false`.\n */\n public async exists(key: string): Promise<boolean> {\n return this.existsSync(key);\n }\n\n /**\n * Synchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns The value associated with the key, or `null` if the key does not exist.\n */\n public abstract getSync(key: string): string | null;\n\n /**\n * Asynchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns A promise that resolves to the value associated with the key, or `null` if the key does not exist.\n */\n public async get(key: string): Promise<string | null> {\n return this.getSync(key);\n }\n\n /**\n * Synchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public abstract setSync(key: string, value: string): void;\n\n /**\n * Asynchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public async set(key: string, value: string): Promise<void> {\n if (!this.isReadOnly && (!this.existsSync(key) || this.overwrite)) {\n this.setSync(key, value);\n }\n }\n\n /**\n * Synchronously creates a directory at the specified path.\n *\n * @param _ - The path of the directory to create.\n */\n public mkdirSync(_: string) {}\n\n /**\n * Creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public async mkdir(dirPath: string): Promise<void> {\n return Promise.resolve(this.mkdirSync(dirPath));\n }\n\n /**\n * Synchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public abstract removeSync(key: string): void;\n\n /**\n * Asynchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public async remove(key: string): Promise<void> {\n if (!this.isReadOnly && this.overwrite) {\n this.removeSync(key);\n }\n }\n\n /**\n * Synchronously removes all entries from the storage that match the provided base path.\n *\n * @param base - The base path to clear keys from.\n */\n public clearSync(base?: string) {\n if (!this.isReadOnly && this.overwrite) {\n const keys = this.listSync(base || this.options.base);\n if (!keys.length) {\n return;\n }\n\n keys.map(key =>\n this.removeSync(\n base && !key.startsWith(base) ? joinPaths(base, key) : key\n )\n );\n }\n }\n\n /**\n * Asynchronously removes all entries from the storage that match the provided base path.\n *\n * @param base - The base path to clear keys from.\n * @returns A promise that resolves when the operation is complete.\n */\n public async clear(base?: string): Promise<void> {\n if (!this.isReadOnly && this.overwrite) {\n const keys = await this.list(base || this.options.base);\n if (!keys.length) {\n return;\n }\n\n await Promise.all(\n keys.map(async key =>\n this.remove(\n base && !key.startsWith(base) ? joinPaths(base, key) : key\n )\n )\n );\n }\n }\n\n /**\n * Lists all keys under a given base path synchronously.\n *\n * @param base - The base path to list keys from.\n * @returns An array of keys under the specified base path.\n */\n public abstract listSync(base?: string): string[];\n\n /**\n * Asynchronously lists all keys under a given base path.\n *\n * @param base - The base path to list keys from.\n * @returns A promise that resolves to an array of keys under the specified base path.\n */\n public async list(base?: string): Promise<string[]> {\n return this.listSync(base);\n }\n\n /**\n * Synchronously checks if the given key is a directory.\n *\n * @param _ - The key to check.\n * @returns `true` if the key is a directory, otherwise `false`.\n */\n public isDirectorySync(_: string): boolean {\n return false;\n }\n\n /**\n * Checks if the given key is a directory.\n *\n * @param key - The key to check.\n * @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.\n */\n public async isDirectory(key: string) {\n return Promise.resolve(this.isDirectorySync(key));\n }\n\n /**\n * Synchronously checks if the given key is a file.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a file, otherwise `false`.\n */\n public isFileSync(key: string): boolean {\n return this.existsSync(key) && !this.isDirectorySync(key);\n }\n\n /**\n * Checks if the given key is a file.\n *\n * @param key - The key to check.\n * @returns A promise that resolves to `true` if the key is a file, otherwise `false`.\n */\n public async isFile(key: string) {\n return Promise.resolve(this.isFileSync(key));\n }\n\n /**\n * Disposes of the storage adapter, releasing any held resources.\n *\n * @returns A promise that resolves when the disposal is complete.\n */\n public dispose(): MaybePromise<void> {\n return Promise.resolve();\n }\n\n /**\n * Async dispose method to clean up resources.\n *\n * @returns A promise that resolves when disposal is complete.\n */\n public async [Symbol.asyncDispose]() {\n return this._dispose();\n }\n\n /**\n * Determines if the storage adapter is read-only based on the provided options.\n *\n * @returns `true` if the storage adapter is read-only, otherwise `false`.\n */\n protected get isReadOnly() {\n return !!this.options.isReadOnly;\n }\n\n /**\n * Determines if the storage adapter should overwrite existing keys based on the provided options and context configuration.\n *\n * @returns `true` if the storage adapter should overwrite existing keys, otherwise `false`.\n */\n protected get overwrite() {\n return !this.isReadOnly && this.context.config.output.overwrite !== false;\n }\n\n /**\n * Resolves a given key to its full path within the storage adapter.\n *\n * @param key - The key to resolve.\n * @returns The resolved full path for the key.\n */\n protected resolve(key?: string) {\n if (!key) {\n return this.options.base;\n }\n\n if (/\\.\\.:|\\.\\.$/.test(key)) {\n throw new Error(\n `[${this.name}]: Invalid key: ${JSON.stringify(key)} provided to storage adapter.`\n );\n }\n\n return appendPath(correctPath(key).replace(/:/g, \"/\"), this.options.base);\n }\n\n /**\n * Disposes of the storage adapter, releasing any held resources.\n *\n * @returns A promise that resolves when the disposal is complete.\n */\n protected async _dispose(): Promise<void> {\n if (!this.#isDisposed) {\n await Promise.resolve(this.dispose());\n this.#isDisposed = true;\n }\n }\n}\n"],"mappings":";;;;;;;;;AAmCA,IAAsB,qBAAtB,MAE4B;CA+Bd;;;;CA3BZ,cAAc;;;;CAUd,AAAO;;;;;;;CAQP,AAAgB,SAAgC;;;;;;;CAQhD,AAAO,YACL,AAAU,SACV,UAAoB,EAAE,MAAM,IA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;;;;CAgBA,MAAa,KAAK,MAAkC;EAClD,OAAO,KAAK,SAAS,IAAI;CAC3B;;;;;;;CAQA,AAAO,gBAAgB,GAAoB;EACzC,OAAO;CACT;;;;;;;CAQA,MAAa,YAAY,KAAa;EACpC,OAAO,QAAQ,QAAQ,KAAK,gBAAgB,GAAG,CAAC;CAClD;;;;;;;CAQA,AAAO,WAAW,KAAsB;EACtC,OAAO,KAAK,WAAW,GAAG,KAAK,CAAC,KAAK,gBAAgB,GAAG;CAC1D;;;;;;;CAQA,MAAa,OAAO,KAAa;EAC/B,OAAO,QAAQ,QAAQ,KAAK,WAAW,GAAG,CAAC;CAC7C;;;;;;CAOA,AAAO,UAA8B;EACnC,OAAO,QAAQ,QAAQ;CACzB;;;;;;CAOA,OAAc,OAAO,gBAAgB;EACnC,OAAO,KAAK,SAAS;CACvB;;;;;;CAOA,IAAc,aAAa;EACzB,OAAO,CAAC,CAAC,KAAK,QAAQ;CACxB;;;;;;CAOA,IAAc,YAAY;EACxB,OAAO,CAAC,KAAK,cAAc,KAAK,QAAQ,OAAO,OAAO,cAAc;CACtE;;;;;;;CAQA,AAAU,QAAQ,KAAc;EAC9B,IAAI,CAAC,KACH,OAAO,KAAK,QAAQ;EAGtB,IAAI,cAAc,KAAK,GAAG,GACxB,MAAM,IAAI,MACR,IAAI,KAAK,KAAK,kBAAkB,KAAK,UAAU,GAAG,EAAE,8BACtD;EAGF,OAAO,WAAW,YAAY,GAAG,EAAE,QAAQ,MAAM,GAAG,GAAG,KAAK,QAAQ,IAAI;CAC1E;;;;;;CAOA,MAAgB,WAA0B;EACxC,IAAI,CAAC,KAAKA,aAAa;GACrB,MAAM,QAAQ,QAAQ,KAAK,QAAQ,CAAC;GACpC,KAAKA,cAAc;EACrB;CACF;AACF"}
1
+ {"version":3,"file":"base.mjs","names":["#isDisposed"],"sources":["../../src/storage/base.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 { appendPath } from \"@stryke/path/append\";\nimport { correctPath } from \"@stryke/path/correct-path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { MaybePromise } from \"@stryke/types/base\";\nimport { resolve } from \"node:path\";\nimport { Context } from \"../types/context\";\nimport { StorageAdapter, StoragePreset } from \"../types/fs\";\n\nexport interface StorageAdapterOptions {\n base: string;\n isReadOnly?: boolean;\n ignore?: string | string[];\n}\n\n/**\n * Abstract base class for storage adapters, providing a template for storage operations.\n */\nexport abstract class BaseStorageAdapter<\n TOptions extends StorageAdapterOptions = StorageAdapterOptions\n> implements StorageAdapter {\n /**\n * Indicates whether the storage adapter has been disposed.\n */\n #isDisposed = false;\n\n /**\n * A name identifying the storage adapter type.\n */\n public abstract name: string;\n\n /**\n * Configuration options for the storage adapter.\n */\n public options: TOptions;\n\n /**\n * The storage preset for the adapter.\n *\n * @remarks\n * This can be used as an alternate way to identify the type of storage being used.\n */\n public readonly preset?: StoragePreset | null = null;\n\n /**\n * Constructor for the BaseStorageAdapter.\n *\n * @param context - The Powerlines context.\n * @param options - Configuration options for the storage adapter.\n */\n public constructor(\n protected context: Context,\n options: TOptions = { base: \"/\" } as TOptions\n ) {\n this.options = options;\n this.options.base = resolve(options.base);\n this.options.isReadOnly = !!options.isReadOnly;\n }\n\n /**\n * Synchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns Returns `true` if the key exists, otherwise `false`.\n */\n public abstract existsSync(key: string): boolean;\n\n /**\n * Asynchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns A promise that resolves to `true` if the key exists, otherwise `false`.\n */\n public async exists(key: string): Promise<boolean> {\n return this.existsSync(key);\n }\n\n /**\n * Synchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns The value associated with the key, or `null` if the key does not exist.\n */\n public abstract getSync(key: string): string | null;\n\n /**\n * Asynchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns A promise that resolves to the value associated with the key, or `null` if the key does not exist.\n */\n public async get(key: string): Promise<string | null> {\n return this.getSync(key);\n }\n\n /**\n * Synchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public abstract setSync(key: string, value: string): void;\n\n /**\n * Asynchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public async set(key: string, value: string): Promise<void> {\n if (!this.isReadOnly && (!this.existsSync(key) || this.overwrite)) {\n this.setSync(key, value);\n }\n }\n\n /**\n * Synchronously creates a directory at the specified path.\n *\n * @param _ - The path of the directory to create.\n */\n public mkdirSync(_: string) {}\n\n /**\n * Creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public async mkdir(dirPath: string): Promise<void> {\n return Promise.resolve(this.mkdirSync(dirPath));\n }\n\n /**\n * Synchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public abstract removeSync(key: string): void;\n\n /**\n * Asynchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public async remove(key: string): Promise<void> {\n if (!this.isReadOnly && this.overwrite) {\n this.removeSync(key);\n }\n }\n\n /**\n * Synchronously removes all entries from the storage that match the provided base path.\n *\n * @param base - The base path to clear keys from.\n */\n public clearSync(base?: string) {\n if (!this.isReadOnly && this.overwrite) {\n const keys = this.listSync(base || this.options.base);\n if (!keys.length) {\n return;\n }\n\n keys.map(key =>\n this.removeSync(\n base && !key.startsWith(base) ? joinPaths(base, key) : key\n )\n );\n }\n }\n\n /**\n * Asynchronously removes all entries from the storage that match the provided base path.\n *\n * @param base - The base path to clear keys from.\n * @returns A promise that resolves when the operation is complete.\n */\n public async clear(base?: string): Promise<void> {\n if (!this.isReadOnly && this.overwrite) {\n const keys = await this.list(base || this.options.base);\n if (!keys.length) {\n return;\n }\n\n await Promise.all(\n keys.map(async key =>\n this.remove(\n base && !key.startsWith(base) ? joinPaths(base, key) : key\n )\n )\n );\n }\n }\n\n /**\n * Lists all keys under a given base path synchronously.\n *\n * @param base - The base path to list keys from.\n * @returns An array of keys under the specified base path.\n */\n public abstract listSync(base?: string): string[];\n\n /**\n * Asynchronously lists all keys under a given base path.\n *\n * @param base - The base path to list keys from.\n * @returns A promise that resolves to an array of keys under the specified base path.\n */\n public async list(base?: string): Promise<string[]> {\n return this.listSync(base);\n }\n\n /**\n * Synchronously checks if the given key is a directory.\n *\n * @param _ - The key to check.\n * @returns `true` if the key is a directory, otherwise `false`.\n */\n public isDirectorySync(_: string): boolean {\n return false;\n }\n\n /**\n * Checks if the given key is a directory.\n *\n * @param key - The key to check.\n * @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.\n */\n public async isDirectory(key: string) {\n return Promise.resolve(this.isDirectorySync(key));\n }\n\n /**\n * Synchronously checks if the given key is a file.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a file, otherwise `false`.\n */\n public isFileSync(key: string): boolean {\n return this.existsSync(key) && !this.isDirectorySync(key);\n }\n\n /**\n * Checks if the given key is a file.\n *\n * @param key - The key to check.\n * @returns A promise that resolves to `true` if the key is a file, otherwise `false`.\n */\n public async isFile(key: string) {\n return Promise.resolve(this.isFileSync(key));\n }\n\n /**\n * Disposes of the storage adapter, releasing any held resources.\n *\n * @returns A promise that resolves when the disposal is complete.\n */\n public dispose(): MaybePromise<void> {\n return Promise.resolve();\n }\n\n /**\n * Async dispose method to clean up resources.\n *\n * @returns A promise that resolves when disposal is complete.\n */\n public async [Symbol.asyncDispose]() {\n return this._dispose();\n }\n\n /**\n * Determines if the storage adapter is read-only based on the provided options.\n *\n * @returns `true` if the storage adapter is read-only, otherwise `false`.\n */\n protected get isReadOnly() {\n return !!this.options.isReadOnly;\n }\n\n /**\n * Determines if the storage adapter should overwrite existing keys based on the provided options and context configuration.\n *\n * @returns `true` if the storage adapter should overwrite existing keys, otherwise `false`.\n */\n protected get overwrite() {\n return !this.isReadOnly && this.context.config.output.overwrite !== false;\n }\n\n /**\n * Resolves a given key to its full path within the storage adapter.\n *\n * @param key - The key to resolve.\n * @returns The resolved full path for the key.\n */\n protected resolve(key?: string) {\n if (!key) {\n return this.options.base;\n }\n\n if (/\\.\\.:|\\.\\.$/.test(key)) {\n throw new Error(\n `[${this.name}]: Invalid key: ${JSON.stringify(key)} provided to storage adapter.`\n );\n }\n\n return appendPath(correctPath(key).replace(/:/g, \"/\"), this.options.base);\n }\n\n /**\n * Disposes of the storage adapter, releasing any held resources.\n *\n * @returns A promise that resolves when the disposal is complete.\n */\n protected async _dispose(): Promise<void> {\n if (!this.#isDisposed) {\n await Promise.resolve(this.dispose());\n this.#isDisposed = true;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,IAAsB,qBAAtB,MAE4B;CA+Bd;;;;CA3BZ,cAAc;;;;CAUd,AAAO;;;;;;;CAQP,AAAgB,SAAgC;;;;;;;CAQhD,AAAO,YACL,AAAU,SACV,UAAoB,EAAE,MAAM,IAAI,GAChC;EAFU;EAGV,KAAK,UAAU;EACf,KAAK,QAAQ,OAAO,QAAQ,QAAQ,IAAI;EACxC,KAAK,QAAQ,aAAa,CAAC,CAAC,QAAQ;CACtC;;;;;;;CAgBA,MAAa,OAAO,KAA+B;EACjD,OAAO,KAAK,WAAW,GAAG;CAC5B;;;;;;;CAgBA,MAAa,IAAI,KAAqC;EACpD,OAAO,KAAK,QAAQ,GAAG;CACzB;;;;;;;CAgBA,MAAa,IAAI,KAAa,OAA8B;EAC1D,IAAI,CAAC,KAAK,eAAe,CAAC,KAAK,WAAW,GAAG,KAAK,KAAK,YACrD,KAAK,QAAQ,KAAK,KAAK;CAE3B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AAAO,UAA8B;EACnC,OAAO,QAAQ,QAAQ;CACzB;;;;;;CAOA,OAAc,OAAO,gBAAgB;EACnC,OAAO,KAAK,SAAS;CACvB;;;;;;CAOA,IAAc,aAAa;EACzB,OAAO,CAAC,CAAC,KAAK,QAAQ;CACxB;;;;;;CAOA,IAAc,YAAY;EACxB,OAAO,CAAC,KAAK,cAAc,KAAK,QAAQ,OAAO,OAAO,cAAc;CACtE;;;;;;;CAQA,AAAU,QAAQ,KAAc;EAC9B,IAAI,CAAC,KACH,OAAO,KAAK,QAAQ;EAGtB,IAAI,cAAc,KAAK,GAAG,GACxB,MAAM,IAAI,MACR,IAAI,KAAK,KAAK,kBAAkB,KAAK,UAAU,GAAG,EAAE,8BACtD;EAGF,OAAO,WAAW,YAAY,GAAG,EAAE,QAAQ,MAAM,GAAG,GAAG,KAAK,QAAQ,IAAI;CAC1E;;;;;;CAOA,MAAgB,WAA0B;EACxC,IAAI,CAAC,KAAKA,aAAa;GACrB,MAAM,QAAQ,QAAQ,KAAK,QAAQ,CAAC;GACpC,KAAKA,cAAc;EACrB;CACF;AACF"}
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
10
  const require_lib_utilities_file_header = require('../lib/utilities/file-header.cjs');
3
11
  const require_storage_base = require('./base.cjs');
@@ -1,3 +1,5 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
1
3
  import { Context } from "../types/context.mjs";
2
4
  import { BaseStorageAdapter, StorageAdapterOptions } from "./base.mjs";
3
5
  import { writeFile, writeFileSync } from "@stryke/fs/write-file";
@@ -1 +1 @@
1
- {"version":3,"file":"file-system.d.mts","names":[],"sources":["../../src/storage/file-system.ts"],"mappings":";;;;;KAgCY,cAAA,GAAiB,UAAU,QAAQ,aAAA;AAAA,KACnC,UAAA,GAAa,UAAU,QAAQ,SAAA;AAD3C;;;AAAA,cAMa,wBAAA,SAAiC,kBAAA;EANc;AAC5D;;EASS,IAAA;EATgB;AAA2B;AAKpD;;;;EALyB,SAiBE,MAAA;EA4BkB;;;;;;cApBxB,OAAA,EAAS,OAAA,EAAS,OAAA,GAAU,qBAAA;EApBe;;;;;;EA8BvD,UAAA,CAAW,GAAA;EAVC;;;;;;EAoBG,MAAA,CAAO,GAAA,WAAc,OAAA;EAAA;;;;;;EAUpC,OAAA,CAAQ,GAAA;EAoBA;;;;;;EAVO,GAAA,CAAI,GAAA,WAAc,OAAA;EAuFtB;;;;;;EA7EX,OAAA,CAAQ,GAAA,UAAa,KAAA;EAgHA;;;;;;EAzEN,GAAA,CAAI,GAAA,UAAa,KAAA,WAAgB,OAAA;EAiHvC;;;;;EA3ET,UAAA,CAAW,GAAA;;;;;;EAeI,MAAA,CAAO,GAAA,WAAc,OAAA;;;;;;EAW3B,SAAA,CAAU,OAAA;;;;;;EASJ,KAAA,CAAM,OAAA,WAAkB,OAAA;;;;;;;EAUvC,QAAA,CAAS,IAAA;;;;;;;EAgBM,IAAA,CAAK,IAAA,YAAgB,OAAA;;;;;;;EAc3B,eAAA,CAAgB,GAAA;;;;;;;EAUhB,UAAA,CAAW,GAAA;AAAA"}
1
+ {"version":3,"file":"file-system.d.mts","names":[],"sources":["../../src/storage/file-system.ts"],"mappings":";;;;;;;KAgCY,cAAA,GAAiB,UAAU,QAAQ,aAAA;AAAA,KACnC,UAAA,GAAa,UAAU,QAAQ,SAAA;;;;cAK9B,wBAAA,SAAiC,kBAAA;;;;EAIrC,IAAA;EAVG;;;;AAAgD;AAC5D;EADY,SAkBe,MAAA;;;AAjByB;AAKpD;;;cAoBqB,OAAA,EAAS,OAAA,EAAS,OAAA,GAAU,qBAAA;EAAA;;;;;;EAUxC,UAAA,CAAW,GAAA;EA9B0B;;;;;;EAwCtB,MAAA,CAAO,GAAA,WAAc,OAAA;EApBf;;;;;;EA8BrB,OAAA,CAAQ,GAAA;EAVc;;;;;;EAoBP,GAAA,CAAI,GAAA,WAAc,OAAA;EAUjC;;;;;;EAAA,OAAA,CAAQ,GAAA,UAAa,KAAA;EA6ErB;;;;;;EAtCe,GAAA,CAAI,GAAA,UAAa,KAAA,WAAgB,OAAA;EAyEjC;;;;;EAnCf,UAAA,CAAW,GAAA;EA6DS;;;;;EA9CL,MAAA,CAAO,GAAA,WAAc,OAAA;EAsEL;AAAA;;;;EA3DtB,SAAA,CAAU,OAAA;;;;;;EASJ,KAAA,CAAM,OAAA,WAAkB,OAAA;;;;;;;EAUvC,QAAA,CAAS,IAAA;;;;;;;EAgBM,IAAA,CAAK,IAAA,YAAgB,OAAA;;;;;;;EAc3B,eAAA,CAAgB,GAAA;;;;;;;EAUhB,UAAA,CAAW,GAAA;AAAA"}
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  import { getFileHeaderWarningText } from "../lib/utilities/file-header.mjs";
2
10
  import { BaseStorageAdapter } from "./base.mjs";
3
11
  import { ignoreNotfound } from "./helpers.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"file-system.mjs","names":[],"sources":["../../src/storage/file-system.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 { exists, existsSync } from \"@stryke/fs/exists\";\nimport { createDirectory, createDirectorySync } from \"@stryke/fs/helpers\";\nimport { isDirectory, isFile } from \"@stryke/fs/is-file\";\nimport { listFiles, listFilesSync } from \"@stryke/fs/list-files\";\nimport { readFile, readFileSync } from \"@stryke/fs/read-file\";\nimport { writeFile, writeFileSync } from \"@stryke/fs/write-file\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { unlinkSync } from \"node:fs\";\nimport { unlink } from \"node:fs/promises\";\nimport { getFileHeaderWarningText } from \"../lib/utilities/file-header\";\nimport type { Context } from \"../types/context\";\nimport { BaseStorageAdapter, StorageAdapterOptions } from \"./base\";\nimport { ignoreNotfound } from \"./helpers\";\n\nexport type SetSyncOptions = Parameters<typeof writeFileSync>[2];\nexport type SetOptions = Parameters<typeof writeFile>[2];\n\n/**\n * File system storage adapter implementation.\n */\nexport class FileSystemStorageAdapter extends BaseStorageAdapter {\n /**\n * A name identifying the storage adapter type.\n */\n public name = \"file-system\";\n\n /**\n * The storage preset for the adapter.\n *\n * @remarks\n * This can be used as an alternate way to identify the type of storage being used.\n */\n public override readonly preset = \"fs\";\n\n /**\n * Constructor for the FileSystemStorageAdapter.\n *\n * @param context - The Powerlines context.\n * @param options - Configuration options for the storage adapter.\n */\n public constructor(context: Context, options?: StorageAdapterOptions) {\n super(context, options);\n }\n\n /**\n * Synchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns Returns `true` if the key exists, otherwise `false`.\n */\n public existsSync(key: string): boolean {\n return existsSync(this.resolve(key));\n }\n\n /**\n * Asynchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns A promise that resolves to `true` if the key exists, otherwise `false`.\n */\n public override async exists(key: string): Promise<boolean> {\n return exists(this.resolve(key));\n }\n\n /**\n * Synchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns The value associated with the key, or `null` if the key does not exist.\n */\n public getSync(key: string): string | null {\n return readFileSync(this.resolve(key));\n }\n\n /**\n * Asynchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns A promise that resolves to the value associated with the key, or `null` if the key does not exist.\n */\n public override async get(key: string): Promise<string | null> {\n return readFile(this.resolve(key));\n }\n\n /**\n * Synchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public setSync(key: string, value: string) {\n if (!this.isReadOnly) {\n if (this.existsSync(this.resolve(key)) && !this.overwrite) {\n const existingValue = this.getSync(this.resolve(key));\n if (\n isSetString(existingValue) &&\n existingValue.includes(\n getFileHeaderWarningText(\n true,\n this.context.config.framework?.name || \"powerlines\"\n )\n )\n ) {\n return writeFileSync(\n this.resolve(key),\n existingValue.replace(\n getFileHeaderWarningText(\n true,\n this.context.config.framework?.name || \"powerlines\"\n ),\n getFileHeaderWarningText(\n false,\n this.context.config.framework?.name || \"powerlines\"\n )\n )\n );\n }\n } else {\n return writeFileSync(this.resolve(key), value);\n }\n }\n }\n\n /**\n * Asynchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public override async set(key: string, value: string): Promise<void> {\n if (!this.isReadOnly) {\n if (this.existsSync(this.resolve(key)) && !this.overwrite) {\n const existingValue = await this.get(this.resolve(key));\n if (\n isSetString(existingValue) &&\n existingValue.includes(\n getFileHeaderWarningText(\n true,\n this.context.config.framework?.name || \"powerlines\"\n )\n )\n ) {\n return writeFile(\n this.resolve(key),\n existingValue.replace(\n getFileHeaderWarningText(\n true,\n this.context.config.framework?.name || \"powerlines\"\n ),\n getFileHeaderWarningText(\n false,\n this.context.config.framework?.name || \"powerlines\"\n )\n )\n );\n }\n } else {\n return writeFile(this.resolve(key), value);\n }\n }\n }\n\n /**\n * Synchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public removeSync(key: string) {\n if (!this.isReadOnly && this.overwrite) {\n try {\n return unlinkSync(this.resolve(key));\n } catch (err) {\n return ignoreNotfound(err);\n }\n }\n }\n\n /**\n * Asynchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public override async remove(key: string): Promise<void> {\n if (!this.isReadOnly && this.overwrite) {\n return unlink(this.resolve(key)).catch(ignoreNotfound);\n }\n }\n\n /**\n * Synchronously creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public override mkdirSync(dirPath: string) {\n createDirectorySync(this.resolve(dirPath));\n }\n\n /**\n * Creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public override async mkdir(dirPath: string): Promise<void> {\n await createDirectory(this.resolve(dirPath));\n }\n\n /**\n * Lists all keys under a given base path synchronously.\n *\n * @param base - The base path to list keys from.\n * @returns An array of keys under the specified base path.\n */\n public listSync(base?: string): string[] {\n try {\n return listFilesSync(this.resolve(base), {\n ignore: this.options.ignore\n });\n } catch (err) {\n return ignoreNotfound(err) ?? [];\n }\n }\n\n /**\n * Asynchronously lists all keys under a given base path.\n *\n * @param base - The base path to list keys from.\n * @returns A promise that resolves to an array of keys under the specified base path.\n */\n public override async list(base?: string): Promise<string[]> {\n return listFiles(this.resolve(base), {\n ignore: this.options.ignore\n })\n .catch(ignoreNotfound)\n .then(r => r || []);\n }\n\n /**\n * Synchronously checks if the given key is a directory.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a directory, otherwise `false`.\n */\n public override isDirectorySync(key: string): boolean {\n return isDirectory(this.resolve(key));\n }\n\n /**\n * Synchronously checks if the given key is a file.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a file, otherwise `false`.\n */\n public override isFileSync(key: string): boolean {\n return isFile(this.resolve(key));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;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CACtC;;;;;;;CAQA,AAAgB,WAAW,KAAsB;EAC/C,OAAO,OAAO,KAAK,QAAQ,GAAG,CAAC;CACjC;AACF"}
1
+ {"version":3,"file":"file-system.mjs","names":[],"sources":["../../src/storage/file-system.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 { exists, existsSync } from \"@stryke/fs/exists\";\nimport { createDirectory, createDirectorySync } from \"@stryke/fs/helpers\";\nimport { isDirectory, isFile } from \"@stryke/fs/is-file\";\nimport { listFiles, listFilesSync } from \"@stryke/fs/list-files\";\nimport { readFile, readFileSync } from \"@stryke/fs/read-file\";\nimport { writeFile, writeFileSync } from \"@stryke/fs/write-file\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { unlinkSync } from \"node:fs\";\nimport { unlink } from \"node:fs/promises\";\nimport { getFileHeaderWarningText } from \"../lib/utilities/file-header\";\nimport type { Context } from \"../types/context\";\nimport { BaseStorageAdapter, StorageAdapterOptions } from \"./base\";\nimport { ignoreNotfound } from \"./helpers\";\n\nexport type SetSyncOptions = Parameters<typeof writeFileSync>[2];\nexport type SetOptions = Parameters<typeof writeFile>[2];\n\n/**\n * File system storage adapter implementation.\n */\nexport class FileSystemStorageAdapter extends BaseStorageAdapter {\n /**\n * A name identifying the storage adapter type.\n */\n public name = \"file-system\";\n\n /**\n * The storage preset for the adapter.\n *\n * @remarks\n * This can be used as an alternate way to identify the type of storage being used.\n */\n public override readonly preset = \"fs\";\n\n /**\n * Constructor for the FileSystemStorageAdapter.\n *\n * @param context - The Powerlines context.\n * @param options - Configuration options for the storage adapter.\n */\n public constructor(context: Context, options?: StorageAdapterOptions) {\n super(context, options);\n }\n\n /**\n * Synchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns Returns `true` if the key exists, otherwise `false`.\n */\n public existsSync(key: string): boolean {\n return existsSync(this.resolve(key));\n }\n\n /**\n * Asynchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns A promise that resolves to `true` if the key exists, otherwise `false`.\n */\n public override async exists(key: string): Promise<boolean> {\n return exists(this.resolve(key));\n }\n\n /**\n * Synchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns The value associated with the key, or `null` if the key does not exist.\n */\n public getSync(key: string): string | null {\n return readFileSync(this.resolve(key));\n }\n\n /**\n * Asynchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns A promise that resolves to the value associated with the key, or `null` if the key does not exist.\n */\n public override async get(key: string): Promise<string | null> {\n return readFile(this.resolve(key));\n }\n\n /**\n * Synchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public setSync(key: string, value: string) {\n if (!this.isReadOnly) {\n if (this.existsSync(this.resolve(key)) && !this.overwrite) {\n const existingValue = this.getSync(this.resolve(key));\n if (\n isSetString(existingValue) &&\n existingValue.includes(\n getFileHeaderWarningText(\n true,\n this.context.config.framework?.name || \"powerlines\"\n )\n )\n ) {\n return writeFileSync(\n this.resolve(key),\n existingValue.replace(\n getFileHeaderWarningText(\n true,\n this.context.config.framework?.name || \"powerlines\"\n ),\n getFileHeaderWarningText(\n false,\n this.context.config.framework?.name || \"powerlines\"\n )\n )\n );\n }\n } else {\n return writeFileSync(this.resolve(key), value);\n }\n }\n }\n\n /**\n * Asynchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public override async set(key: string, value: string): Promise<void> {\n if (!this.isReadOnly) {\n if (this.existsSync(this.resolve(key)) && !this.overwrite) {\n const existingValue = await this.get(this.resolve(key));\n if (\n isSetString(existingValue) &&\n existingValue.includes(\n getFileHeaderWarningText(\n true,\n this.context.config.framework?.name || \"powerlines\"\n )\n )\n ) {\n return writeFile(\n this.resolve(key),\n existingValue.replace(\n getFileHeaderWarningText(\n true,\n this.context.config.framework?.name || \"powerlines\"\n ),\n getFileHeaderWarningText(\n false,\n this.context.config.framework?.name || \"powerlines\"\n )\n )\n );\n }\n } else {\n return writeFile(this.resolve(key), value);\n }\n }\n }\n\n /**\n * Synchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public removeSync(key: string) {\n if (!this.isReadOnly && this.overwrite) {\n try {\n return unlinkSync(this.resolve(key));\n } catch (err) {\n return ignoreNotfound(err);\n }\n }\n }\n\n /**\n * Asynchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public override async remove(key: string): Promise<void> {\n if (!this.isReadOnly && this.overwrite) {\n return unlink(this.resolve(key)).catch(ignoreNotfound);\n }\n }\n\n /**\n * Synchronously creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public override mkdirSync(dirPath: string) {\n createDirectorySync(this.resolve(dirPath));\n }\n\n /**\n * Creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public override async mkdir(dirPath: string): Promise<void> {\n await createDirectory(this.resolve(dirPath));\n }\n\n /**\n * Lists all keys under a given base path synchronously.\n *\n * @param base - The base path to list keys from.\n * @returns An array of keys under the specified base path.\n */\n public listSync(base?: string): string[] {\n try {\n return listFilesSync(this.resolve(base), {\n ignore: this.options.ignore\n });\n } catch (err) {\n return ignoreNotfound(err) ?? [];\n }\n }\n\n /**\n * Asynchronously lists all keys under a given base path.\n *\n * @param base - The base path to list keys from.\n * @returns A promise that resolves to an array of keys under the specified base path.\n */\n public override async list(base?: string): Promise<string[]> {\n return listFiles(this.resolve(base), {\n ignore: this.options.ignore\n })\n .catch(ignoreNotfound)\n .then(r => r || []);\n }\n\n /**\n * Synchronously checks if the given key is a directory.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a directory, otherwise `false`.\n */\n public override isDirectorySync(key: string): boolean {\n return isDirectory(this.resolve(key));\n }\n\n /**\n * Synchronously checks if the given key is a file.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a file, otherwise `false`.\n */\n public override isFileSync(key: string): boolean {\n return isFile(this.resolve(key));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,IAAa,2BAAb,cAA8C,mBAAmB;;;;CAI/D,AAAO,OAAO;;;;;;;CAQd,AAAyB,SAAS;;;;;;;CAQlC,AAAO,YAAY,SAAkB,SAAiC;EACpE,MAAM,SAAS,OAAO;CACxB;;;;;;;CAQA,AAAO,WAAW,KAAsB;EACtC,OAAO,WAAW,KAAK,QAAQ,GAAG,CAAC;CACrC;;;;;;;CAQA,MAAsB,OAAO,KAA+B;EAC1D,OAAO,OAAO,KAAK,QAAQ,GAAG,CAAC;CACjC;;;;;;;CAQA,AAAO,QAAQ,KAA4B;EACzC,OAAO,aAAa,KAAK,QAAQ,GAAG,CAAC;CACvC;;;;;;;CAQA,MAAsB,IAAI,KAAqC;EAC7D,OAAO,SAAS,KAAK,QAAQ,GAAG,CAAC;CACnC;;;;;;;CAQA,AAAO,QAAQ,KAAa,OAAe;EACzC,IAAI,CAAC,KAAK,YACR,IAAI,KAAK,WAAW,KAAK,QAAQ,GAAG,CAAC,KAAK,CAAC,KAAK,WAAW;GACzD,MAAM,gBAAgB,KAAK,QAAQ,KAAK,QAAQ,GAAG,CAAC;GACpD,IACE,YAAY,aAAa,KACzB,cAAc,SACZ,yBACE,MACA,KAAK,QAAQ,OAAO,WAAW,QAAQ,YACzC,CACF,GAEA,OAAO,cACL,KAAK,QAAQ,GAAG,GAChB,cAAc,QACZ,yBACE,MACA,KAAK,QAAQ,OAAO,WAAW,QAAQ,YACzC,GACA,yBACE,OACA,KAAK,QAAQ,OAAO,WAAW,QAAQ,YACzC,CACF,C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e,GAAG,KAAK,CAAC;EACjC;CACF;;;;;;;CAQA,MAAsB,KAAK,MAAkC;EAC3D,OAAO,UAAU,KAAK,QAAQ,IAAI,GAAG,EACnC,QAAQ,KAAK,QAAQ,OACvB,CAAC,EACE,MAAM,cAAc,EACpB,MAAK,MAAK,KAAK,CAAC,CAAC;CACtB;;;;;;;CAQA,AAAgB,gBAAgB,KAAsB;EACpD,OAAO,YAAY,KAAK,QAAQ,GAAG,CAAC;CACtC;;;;;;;CAQA,AAAgB,WAAW,KAAsB;EAC/C,OAAO,OAAO,KAAK,QAAQ,GAAG,CAAC;CACjC;AACF"}
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
10
  let _stryke_type_checks_is_error = require("@stryke/type-checks/is-error");
3
11
 
@@ -1,3 +1,5 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
1
3
  //#region src/storage/helpers.d.ts
2
4
  /**
3
5
  * Checks if an error is a file system error.
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.mts","names":[],"sources":["../../src/storage/helpers.ts"],"mappings":";;AA0BA;;;;AAAoC;iBAApB,WAAA,CAAY,GAAQ;;;;AAUG;AAavC;;iBAbgB,cAAA,CAAe,GAAQ;;AAaF;;;;;iBAArB,YAAA,CAAa,GAAQ"}
1
+ {"version":3,"file":"helpers.d.mts","names":[],"sources":["../../src/storage/helpers.ts"],"mappings":";;;;;;;;;iBA0BgB,WAAA,CAAY,GAAQ;;;AAApC;;;;iBAUgB,cAAA,CAAe,GAAQ;AAAvC;;;;AAAuC;AAavC;AAbA,iBAagB,YAAA,CAAa,GAAQ"}
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  import { isError } from "@stryke/type-checks/is-error";
2
10
 
3
11
  //#region src/storage/helpers.ts
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.mjs","names":[],"sources":["../../src/storage/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 { isError } from \"@stryke/type-checks/is-error\";\n\n/**\n * Checks if an error is a file system error.\n *\n * @param err - The error to check.\n * @returns `true` if the error is a file system error, otherwise `false`.\n */\nexport function isFileError(err: any) {\n return isError(err) && \"code\" in err && err.code;\n}\n\n/**\n * Ignores file not found errors.\n *\n * @param err - The error to check.\n * @returns `null` if the error is a file not found error, otherwise returns the error.\n */\nexport function ignoreNotfound(err: any) {\n return (\n isFileError(err) &&\n (err.code === \"ENOENT\" || err.code === \"EISDIR\" ? null : err)\n );\n}\n\n/**\n * Ignores file exists errors.\n *\n * @param err - The error to check.\n * @returns `null` if the error is a file exists error, otherwise returns the error.\n */\nexport function ignoreExists(err: any) {\n return isFileError(err) && err.code === \"EEXIST\" ? null : err;\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAgB,YAAY,KAAU;CACpC,OAAO,QAAQ,GAAG,KAAK,UAAU,OAAO,IAAI;AAC9C;;;;;;;AAQA,SAAgB,eAAe,KAAU;CACvC,OACE,YAAY,GAAG,MACd,IAAI,SAAS,YAAY,IAAI,SAAS,WAAW,OAAO;AAE7D;;;;;;;AAQA,SAAgB,aAAa,KAAU;CACrC,OAAO,YAAY,GAAG,KAAK,IAAI,SAAS,WAAW,OAAO;AAC5D"}
1
+ {"version":3,"file":"helpers.mjs","names":[],"sources":["../../src/storage/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 { isError } from \"@stryke/type-checks/is-error\";\n\n/**\n * Checks if an error is a file system error.\n *\n * @param err - The error to check.\n * @returns `true` if the error is a file system error, otherwise `false`.\n */\nexport function isFileError(err: any) {\n return isError(err) && \"code\" in err && err.code;\n}\n\n/**\n * Ignores file not found errors.\n *\n * @param err - The error to check.\n * @returns `null` if the error is a file not found error, otherwise returns the error.\n */\nexport function ignoreNotfound(err: any) {\n return (\n isFileError(err) &&\n (err.code === \"ENOENT\" || err.code === \"EISDIR\" ? null : err)\n );\n}\n\n/**\n * Ignores file exists errors.\n *\n * @param err - The error to check.\n * @returns `null` if the error is a file exists error, otherwise returns the error.\n */\nexport function ignoreExists(err: any) {\n return isFileError(err) && err.code === \"EEXIST\" ? null : err;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,SAAgB,YAAY,KAAU;CACpC,OAAO,QAAQ,GAAG,KAAK,UAAU,OAAO,IAAI;AAC9C;;;;;;;AAQA,SAAgB,eAAe,KAAU;CACvC,OACE,YAAY,GAAG,MACd,IAAI,SAAS,YAAY,IAAI,SAAS,WAAW,OAAO;AAE7D;;;;;;;AAQA,SAAgB,aAAa,KAAU;CACrC,OAAO,YAAY,GAAG,KAAK,IAAI,SAAS,WAAW,OAAO;AAC5D"}
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
10
  const require_storage_base = require('./base.cjs');
3
11
  const require_storage_helpers = require('./helpers.cjs');
@@ -1,3 +1,5 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
1
3
  import { BaseStorageAdapter, StorageAdapterOptions } from "./base.mjs";
2
4
  import { FileSystemStorageAdapter, SetOptions, SetSyncOptions } from "./file-system.mjs";
3
5
  import { ignoreExists, ignoreNotfound, isFileError } from "./helpers.mjs";
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  import { BaseStorageAdapter } from "./base.mjs";
2
10
  import { ignoreExists, ignoreNotfound, isFileError } from "./helpers.mjs";
3
11
  import { FileSystemStorageAdapter } from "./file-system.mjs";
@@ -1,3 +1,11 @@
1
+
2
+
3
+ import __tsdown_shims_path from 'node:path'
4
+ import __tsdown_shims_url from 'node:url'
5
+
6
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
7
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
8
+
1
9
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
10
  const require_storage_base = require('./base.cjs');
3
11
  let _stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
@@ -1,3 +1,5 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
1
3
  import { Context } from "../types/context.mjs";
2
4
  import { BaseStorageAdapter, StorageAdapterOptions } from "./base.mjs";
3
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"virtual.d.mts","names":[],"sources":["../../src/storage/virtual.ts"],"mappings":";;;;;;AAyBA;cAAa,qBAAA,SAA8B,kBAAA;;;;EAIlC,IAAA;EAuF0B;;;;;;EAAA,SA/ER,MAAA;EAKf;;;EAAA,UAAA,IAAA,EAAI,GAAA;EAQK;;;;;;cAAA,OAAA,EAAS,OAAA,EAAS,OAAA,GAAU,qBAAA;EA8BxC;;;;;;EApBA,UAAA,CAAW,GAAA;EAwDI;;;;AASU;;EAvDzB,OAAA,CAAQ,GAAA;;;;;;;EAUR,OAAA,CAAQ,GAAA,UAAa,KAAA;;;;;;EAWrB,UAAA,CAAW,GAAA;;;;;;;EAYX,QAAA,CAAS,IAAA;;;;;;EAaM,OAAA,CAAA,GAAW,OAAA;;;;;;gBASV,SAAA,CAAA;AAAA"}
1
+ {"version":3,"file":"virtual.d.mts","names":[],"sources":["../../src/storage/virtual.ts"],"mappings":";;;;;;;;;cAyBa,qBAAA,SAA8B,kBAAA;;;;EAIlC,IAAA;;;AAJT;;;;WAY2B,MAAA;EAasB;;;EAAA,UARrC,IAAA,EAAI,GAAA;EAjB6C;;;;;;cAyBxC,OAAA,EAAS,OAAA,EAAS,OAAA,GAAU,qBAAA;EAAnB;;;;;;EAUrB,UAAA,CAAW,GAAA;EAUH;;;;;;EAAR,OAAA,CAAQ,GAAA;EAiCC;;;;;AAsBgB;EA7CzB,OAAA,CAAQ,GAAA,UAAa,KAAA;;;;;;EAWrB,UAAA,CAAW,GAAA;;;;;;;EAYX,QAAA,CAAS,IAAA;;;;;;EAaM,OAAA,CAAA,GAAW,OAAA;;;;;;gBASV,SAAA,CAAA;AAAA"}