@vigla/svelte 0.0.0-stage → 5.57.4

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 (373) hide show
  1. package/action.d.ts +2 -0
  2. package/animate.d.ts +2 -0
  3. package/compiler/index.js +43266 -0
  4. package/compiler/index.js.map +1 -0
  5. package/compiler/package.json +3 -0
  6. package/compiler.d.ts +2 -0
  7. package/dist/compiler/diagnostics.d.ts +70 -0
  8. package/dist/compiler/diagnostics.d.ts.map +1 -0
  9. package/dist/compiler/diagnostics.js +166 -0
  10. package/dist/compiler/diagnostics.js.map +1 -0
  11. package/dist/compiler/index.d.ts +72 -0
  12. package/dist/compiler/index.d.ts.map +1 -0
  13. package/dist/compiler/index.js +178 -0
  14. package/dist/compiler/index.js.map +1 -0
  15. package/dist/compiler/options.d.ts +7 -0
  16. package/dist/compiler/options.d.ts.map +1 -0
  17. package/dist/compiler/options.js +126 -0
  18. package/dist/compiler/options.js.map +1 -0
  19. package/dist/compiler/preprocess/decode.d.ts +3 -0
  20. package/dist/compiler/preprocess/decode.d.ts.map +1 -0
  21. package/dist/compiler/preprocess/decode.js +60 -0
  22. package/dist/compiler/preprocess/decode.js.map +1 -0
  23. package/dist/compiler/preprocess/index.d.ts +27 -0
  24. package/dist/compiler/preprocess/index.d.ts.map +1 -0
  25. package/dist/compiler/preprocess/index.js +208 -0
  26. package/dist/compiler/preprocess/index.js.map +1 -0
  27. package/dist/compiler/preprocess/mapped.d.ts +25 -0
  28. package/dist/compiler/preprocess/mapped.d.ts.map +1 -0
  29. package/dist/compiler/preprocess/mapped.js +129 -0
  30. package/dist/compiler/preprocess/mapped.js.map +1 -0
  31. package/dist/compiler/proxy.d.ts +3 -0
  32. package/dist/compiler/proxy.d.ts.map +1 -0
  33. package/dist/compiler/proxy.js +133 -0
  34. package/dist/compiler/proxy.js.map +1 -0
  35. package/dist/entries/action.d.ts +2 -0
  36. package/dist/entries/action.d.ts.map +1 -0
  37. package/dist/entries/action.js +1 -0
  38. package/dist/entries/action.js.map +1 -0
  39. package/dist/entries/animate.d.ts +2 -0
  40. package/dist/entries/animate.d.ts.map +1 -0
  41. package/dist/entries/animate.js +2 -0
  42. package/dist/entries/animate.js.map +1 -0
  43. package/dist/entries/attachments.d.ts +2 -0
  44. package/dist/entries/attachments.d.ts.map +1 -0
  45. package/dist/entries/attachments.js +2 -0
  46. package/dist/entries/attachments.js.map +1 -0
  47. package/dist/entries/context.d.ts +15 -0
  48. package/dist/entries/context.d.ts.map +1 -0
  49. package/dist/entries/context.js +32 -0
  50. package/dist/entries/context.js.map +1 -0
  51. package/dist/entries/easing.d.ts +2 -0
  52. package/dist/entries/easing.d.ts.map +1 -0
  53. package/dist/entries/easing.js +2 -0
  54. package/dist/entries/easing.js.map +1 -0
  55. package/dist/entries/events.d.ts +2 -0
  56. package/dist/entries/events.d.ts.map +1 -0
  57. package/dist/entries/events.js +2 -0
  58. package/dist/entries/events.js.map +1 -0
  59. package/dist/entries/index-server.d.ts +4 -0
  60. package/dist/entries/index-server.d.ts.map +1 -0
  61. package/dist/entries/index-server.js +11 -0
  62. package/dist/entries/index-server.js.map +1 -0
  63. package/dist/entries/index.d.ts +10 -0
  64. package/dist/entries/index.d.ts.map +1 -0
  65. package/dist/entries/index.js +24 -0
  66. package/dist/entries/index.js.map +1 -0
  67. package/dist/entries/internal/client.d.ts +4 -0
  68. package/dist/entries/internal/client.d.ts.map +1 -0
  69. package/dist/entries/internal/client.js +9 -0
  70. package/dist/entries/internal/client.js.map +1 -0
  71. package/dist/entries/internal/disclose-version.d.ts +2 -0
  72. package/dist/entries/internal/disclose-version.d.ts.map +1 -0
  73. package/dist/entries/internal/disclose-version.js +4 -0
  74. package/dist/entries/internal/disclose-version.js.map +1 -0
  75. package/dist/entries/internal/index.d.ts +2 -0
  76. package/dist/entries/internal/index.d.ts.map +1 -0
  77. package/dist/entries/internal/index.js +2 -0
  78. package/dist/entries/internal/index.js.map +1 -0
  79. package/dist/entries/internal/server.d.ts +2 -0
  80. package/dist/entries/internal/server.d.ts.map +1 -0
  81. package/dist/entries/internal/server.js +7 -0
  82. package/dist/entries/internal/server.js.map +1 -0
  83. package/dist/entries/internal/tracing.d.ts +2 -0
  84. package/dist/entries/internal/tracing.d.ts.map +1 -0
  85. package/dist/entries/internal/tracing.js +2 -0
  86. package/dist/entries/internal/tracing.js.map +1 -0
  87. package/dist/entries/motion-server.d.ts +2 -0
  88. package/dist/entries/motion-server.d.ts.map +1 -0
  89. package/dist/entries/motion-server.js +2 -0
  90. package/dist/entries/motion-server.js.map +1 -0
  91. package/dist/entries/motion.d.ts +2 -0
  92. package/dist/entries/motion.d.ts.map +1 -0
  93. package/dist/entries/motion.js +2 -0
  94. package/dist/entries/motion.js.map +1 -0
  95. package/dist/entries/proxy.d.ts +6 -0
  96. package/dist/entries/proxy.d.ts.map +1 -0
  97. package/dist/entries/proxy.js +77 -0
  98. package/dist/entries/proxy.js.map +1 -0
  99. package/dist/entries/reactivity-server.d.ts +2 -0
  100. package/dist/entries/reactivity-server.d.ts.map +1 -0
  101. package/dist/entries/reactivity-server.js +2 -0
  102. package/dist/entries/reactivity-server.js.map +1 -0
  103. package/dist/entries/reactivity.d.ts +2 -0
  104. package/dist/entries/reactivity.d.ts.map +1 -0
  105. package/dist/entries/reactivity.js +2 -0
  106. package/dist/entries/reactivity.js.map +1 -0
  107. package/dist/entries/report.d.ts +3 -0
  108. package/dist/entries/report.d.ts.map +1 -0
  109. package/dist/entries/report.js +66 -0
  110. package/dist/entries/report.js.map +1 -0
  111. package/dist/entries/server.d.ts +8 -0
  112. package/dist/entries/server.d.ts.map +1 -0
  113. package/dist/entries/server.js +48 -0
  114. package/dist/entries/server.js.map +1 -0
  115. package/dist/entries/store-client.d.ts +12 -0
  116. package/dist/entries/store-client.d.ts.map +1 -0
  117. package/dist/entries/store-client.js +63 -0
  118. package/dist/entries/store-client.js.map +1 -0
  119. package/dist/entries/store-server.d.ts +12 -0
  120. package/dist/entries/store-server.d.ts.map +1 -0
  121. package/dist/entries/store-server.js +30 -0
  122. package/dist/entries/store-server.js.map +1 -0
  123. package/dist/entries/store.d.ts +25 -0
  124. package/dist/entries/store.d.ts.map +1 -0
  125. package/dist/entries/store.js +139 -0
  126. package/dist/entries/store.js.map +1 -0
  127. package/dist/entries/transition.d.ts +2 -0
  128. package/dist/entries/transition.d.ts.map +1 -0
  129. package/dist/entries/transition.js +2 -0
  130. package/dist/entries/transition.js.map +1 -0
  131. package/dist/entries/window-server.d.ts +2 -0
  132. package/dist/entries/window-server.d.ts.map +1 -0
  133. package/dist/entries/window-server.js +2 -0
  134. package/dist/entries/window-server.js.map +1 -0
  135. package/dist/entries/window.d.ts +2 -0
  136. package/dist/entries/window.d.ts.map +1 -0
  137. package/dist/entries/window.js +2 -0
  138. package/dist/entries/window.js.map +1 -0
  139. package/dist/front/ast.d.ts +290 -0
  140. package/dist/front/ast.d.ts.map +1 -0
  141. package/dist/front/ast.js +1 -0
  142. package/dist/front/ast.js.map +1 -0
  143. package/dist/front/diagnostics.d.ts +13 -0
  144. package/dist/front/diagnostics.d.ts.map +1 -0
  145. package/dist/front/diagnostics.js +38 -0
  146. package/dist/front/diagnostics.js.map +1 -0
  147. package/dist/front/ignores.d.ts +12 -0
  148. package/dist/front/ignores.d.ts.map +1 -0
  149. package/dist/front/ignores.js +75 -0
  150. package/dist/front/ignores.js.map +1 -0
  151. package/dist/front/index.d.ts +17 -0
  152. package/dist/front/index.d.ts.map +1 -0
  153. package/dist/front/index.js +65 -0
  154. package/dist/front/index.js.map +1 -0
  155. package/dist/front/legacy.d.ts +5 -0
  156. package/dist/front/legacy.d.ts.map +1 -0
  157. package/dist/front/legacy.js +408 -0
  158. package/dist/front/legacy.js.map +1 -0
  159. package/dist/front/locate.d.ts +4 -0
  160. package/dist/front/locate.d.ts.map +1 -0
  161. package/dist/front/locate.js +19 -0
  162. package/dist/front/locate.js.map +1 -0
  163. package/dist/front/lower.d.ts +39 -0
  164. package/dist/front/lower.d.ts.map +1 -0
  165. package/dist/front/lower.js +470 -0
  166. package/dist/front/lower.js.map +1 -0
  167. package/dist/front/parse/attribute.d.ts +12 -0
  168. package/dist/front/parse/attribute.d.ts.map +1 -0
  169. package/dist/front/parse/attribute.js +288 -0
  170. package/dist/front/parse/attribute.js.map +1 -0
  171. package/dist/front/parse/bracket.d.ts +3 -0
  172. package/dist/front/parse/bracket.d.ts.map +1 -0
  173. package/dist/front/parse/bracket.js +102 -0
  174. package/dist/front/parse/bracket.js.map +1 -0
  175. package/dist/front/parse/characters.d.ts +4 -0
  176. package/dist/front/parse/characters.d.ts.map +1 -0
  177. package/dist/front/parse/characters.js +6 -0
  178. package/dist/front/parse/characters.js.map +1 -0
  179. package/dist/front/parse/decode.d.ts +2 -0
  180. package/dist/front/parse/decode.d.ts.map +1 -0
  181. package/dist/front/parse/decode.js +89 -0
  182. package/dist/front/parse/decode.js.map +1 -0
  183. package/dist/front/parse/element.d.ts +3 -0
  184. package/dist/front/parse/element.d.ts.map +1 -0
  185. package/dist/front/parse/element.js +311 -0
  186. package/dist/front/parse/element.js.map +1 -0
  187. package/dist/front/parse/entities.d.ts +2 -0
  188. package/dist/front/parse/entities.d.ts.map +1 -0
  189. package/dist/front/parse/entities.js +2234 -0
  190. package/dist/front/parse/entities.js.map +1 -0
  191. package/dist/front/parse/expression.d.ts +5 -0
  192. package/dist/front/parse/expression.d.ts.map +1 -0
  193. package/dist/front/parse/expression.js +86 -0
  194. package/dist/front/parse/expression.js.map +1 -0
  195. package/dist/front/parse/html.d.ts +8 -0
  196. package/dist/front/parse/html.d.ts.map +1 -0
  197. package/dist/front/parse/html.js +146 -0
  198. package/dist/front/parse/html.js.map +1 -0
  199. package/dist/front/parse/identifier.d.ts +4 -0
  200. package/dist/front/parse/identifier.d.ts.map +1 -0
  201. package/dist/front/parse/identifier.js +24 -0
  202. package/dist/front/parse/identifier.js.map +1 -0
  203. package/dist/front/parse/index.d.ts +13 -0
  204. package/dist/front/parse/index.d.ts.map +1 -0
  205. package/dist/front/parse/index.js +74 -0
  206. package/dist/front/parse/index.js.map +1 -0
  207. package/dist/front/parse/js.d.ts +27 -0
  208. package/dist/front/parse/js.d.ts.map +1 -0
  209. package/dist/front/parse/js.js +241 -0
  210. package/dist/front/parse/js.js.map +1 -0
  211. package/dist/front/parse/options.d.ts +3 -0
  212. package/dist/front/parse/options.d.ts.map +1 -0
  213. package/dist/front/parse/options.js +198 -0
  214. package/dist/front/parse/options.js.map +1 -0
  215. package/dist/front/parse/parser.d.ts +50 -0
  216. package/dist/front/parse/parser.d.ts.map +1 -0
  217. package/dist/front/parse/parser.js +157 -0
  218. package/dist/front/parse/parser.js.map +1 -0
  219. package/dist/front/parse/pattern.d.ts +4 -0
  220. package/dist/front/parse/pattern.d.ts.map +1 -0
  221. package/dist/front/parse/pattern.js +53 -0
  222. package/dist/front/parse/pattern.js.map +1 -0
  223. package/dist/front/parse/script.d.ts +4 -0
  224. package/dist/front/parse/script.d.ts.map +1 -0
  225. package/dist/front/parse/script.js +60 -0
  226. package/dist/front/parse/script.js.map +1 -0
  227. package/dist/front/parse/style.d.ts +7 -0
  228. package/dist/front/parse/style.d.ts.map +1 -0
  229. package/dist/front/parse/style.js +397 -0
  230. package/dist/front/parse/style.js.map +1 -0
  231. package/dist/front/parse/tag.d.ts +3 -0
  232. package/dist/front/parse/tag.d.ts.map +1 -0
  233. package/dist/front/parse/tag.js +591 -0
  234. package/dist/front/parse/tag.js.map +1 -0
  235. package/dist/front/print/css.d.ts +5 -0
  236. package/dist/front/print/css.d.ts.map +1 -0
  237. package/dist/front/print/css.js +234 -0
  238. package/dist/front/print/css.js.map +1 -0
  239. package/dist/front/print/index.d.ts +18 -0
  240. package/dist/front/print/index.d.ts.map +1 -0
  241. package/dist/front/print/index.js +24 -0
  242. package/dist/front/print/index.js.map +1 -0
  243. package/dist/front/print/layout.d.ts +11 -0
  244. package/dist/front/print/layout.d.ts.map +1 -0
  245. package/dist/front/print/layout.js +73 -0
  246. package/dist/front/print/layout.js.map +1 -0
  247. package/dist/front/print/template.d.ts +5 -0
  248. package/dist/front/print/template.d.ts.map +1 -0
  249. package/dist/front/print/template.js +455 -0
  250. package/dist/front/print/template.js.map +1 -0
  251. package/dist/front/runes.d.ts +13 -0
  252. package/dist/front/runes.d.ts.map +1 -0
  253. package/dist/front/runes.js +253 -0
  254. package/dist/front/runes.js.map +1 -0
  255. package/dist/front/stores.d.ts +5 -0
  256. package/dist/front/stores.d.ts.map +1 -0
  257. package/dist/front/stores.js +84 -0
  258. package/dist/front/stores.js.map +1 -0
  259. package/dist/front/typescript.d.ts +2 -0
  260. package/dist/front/typescript.d.ts.map +1 -0
  261. package/dist/front/typescript.js +182 -0
  262. package/dist/front/typescript.js.map +1 -0
  263. package/dist/front/validate/anchors.d.ts +15 -0
  264. package/dist/front/validate/anchors.d.ts.map +1 -0
  265. package/dist/front/validate/anchors.js +43 -0
  266. package/dist/front/validate/anchors.js.map +1 -0
  267. package/dist/front/validate/index.d.ts +16 -0
  268. package/dist/front/validate/index.d.ts.map +1 -0
  269. package/dist/front/validate/index.js +139 -0
  270. package/dist/front/validate/index.js.map +1 -0
  271. package/dist/front/validate/legacy.d.ts +9 -0
  272. package/dist/front/validate/legacy.d.ts.map +1 -0
  273. package/dist/front/validate/legacy.js +102 -0
  274. package/dist/front/validate/legacy.js.map +1 -0
  275. package/dist/front/validate/report.d.ts +14 -0
  276. package/dist/front/validate/report.d.ts.map +1 -0
  277. package/dist/front/validate/report.js +29 -0
  278. package/dist/front/validate/report.js.map +1 -0
  279. package/dist/front/validate/template.d.ts +31 -0
  280. package/dist/front/validate/template.d.ts.map +1 -0
  281. package/dist/front/validate/template.js +507 -0
  282. package/dist/front/validate/template.js.map +1 -0
  283. package/dist/front/wording.d.ts +4 -0
  284. package/dist/front/wording.d.ts.map +1 -0
  285. package/dist/front/wording.js +110 -0
  286. package/dist/front/wording.js.map +1 -0
  287. package/dist/shared/format.d.ts +3 -0
  288. package/dist/shared/format.d.ts.map +1 -0
  289. package/dist/shared/format.js +7 -0
  290. package/dist/shared/format.js.map +1 -0
  291. package/easing.d.ts +2 -0
  292. package/elements.d.ts +1220 -0
  293. package/index.d.ts +2 -0
  294. package/motion.d.ts +2 -0
  295. package/package.json +128 -5
  296. package/src/compiler/diagnostics.ts +233 -0
  297. package/src/compiler/index.ts +292 -0
  298. package/src/compiler/options.ts +140 -0
  299. package/src/compiler/preprocess/decode.ts +85 -0
  300. package/src/compiler/preprocess/index.ts +299 -0
  301. package/src/compiler/preprocess/mapped.ts +146 -0
  302. package/src/compiler/proxy.ts +154 -0
  303. package/src/entries/action.ts +1 -0
  304. package/src/entries/animate.ts +1 -0
  305. package/src/entries/attachments.ts +1 -0
  306. package/src/entries/context.ts +50 -0
  307. package/src/entries/easing.ts +1 -0
  308. package/src/entries/events.ts +1 -0
  309. package/src/entries/index-server.ts +17 -0
  310. package/src/entries/index.ts +41 -0
  311. package/src/entries/internal/client.ts +15 -0
  312. package/src/entries/internal/disclose-version.ts +4 -0
  313. package/src/entries/internal/index.ts +3 -0
  314. package/src/entries/internal/server.ts +8 -0
  315. package/src/entries/internal/tracing.ts +1 -0
  316. package/src/entries/motion-server.ts +1 -0
  317. package/src/entries/motion.ts +1 -0
  318. package/src/entries/proxy.ts +86 -0
  319. package/src/entries/reactivity-server.ts +9 -0
  320. package/src/entries/reactivity.ts +9 -0
  321. package/src/entries/report.ts +81 -0
  322. package/src/entries/server.ts +76 -0
  323. package/src/entries/store-client.ts +80 -0
  324. package/src/entries/store-server.ts +44 -0
  325. package/src/entries/store.ts +201 -0
  326. package/src/entries/transition.ts +1 -0
  327. package/src/entries/window-server.ts +1 -0
  328. package/src/entries/window.ts +1 -0
  329. package/src/front/ast.ts +369 -0
  330. package/src/front/diagnostics.ts +53 -0
  331. package/src/front/ignores.ts +84 -0
  332. package/src/front/index.ts +86 -0
  333. package/src/front/legacy.ts +414 -0
  334. package/src/front/locate.ts +20 -0
  335. package/src/front/lower.ts +509 -0
  336. package/src/front/parse/attribute.ts +319 -0
  337. package/src/front/parse/bracket.ts +99 -0
  338. package/src/front/parse/characters.ts +19 -0
  339. package/src/front/parse/decode.ts +87 -0
  340. package/src/front/parse/element.ts +354 -0
  341. package/src/front/parse/entities.ts +2233 -0
  342. package/src/front/parse/expression.ts +85 -0
  343. package/src/front/parse/html.ts +158 -0
  344. package/src/front/parse/identifier.ts +29 -0
  345. package/src/front/parse/index.ts +88 -0
  346. package/src/front/parse/js.ts +284 -0
  347. package/src/front/parse/options.ts +194 -0
  348. package/src/front/parse/parser.ts +189 -0
  349. package/src/front/parse/pattern.ts +57 -0
  350. package/src/front/parse/script.ts +74 -0
  351. package/src/front/parse/style.ts +399 -0
  352. package/src/front/parse/tag.ts +601 -0
  353. package/src/front/print/css.ts +239 -0
  354. package/src/front/print/index.ts +40 -0
  355. package/src/front/print/layout.ts +87 -0
  356. package/src/front/print/template.ts +448 -0
  357. package/src/front/runes.ts +267 -0
  358. package/src/front/stores.ts +98 -0
  359. package/src/front/typescript.ts +178 -0
  360. package/src/front/validate/anchors.ts +54 -0
  361. package/src/front/validate/index.ts +174 -0
  362. package/src/front/validate/legacy.ts +119 -0
  363. package/src/front/validate/report.ts +38 -0
  364. package/src/front/validate/template.ts +549 -0
  365. package/src/front/wording.ts +112 -0
  366. package/src/shared/format.ts +8 -0
  367. package/store.d.ts +2 -0
  368. package/svelte-html.d.ts +53 -0
  369. package/transition.d.ts +2 -0
  370. package/types/compiler/interfaces.d.ts +2 -0
  371. package/types/compiler/preprocess.d.ts +2 -0
  372. package/types/index.d.ts +1453 -0
  373. package/README.md +0 -3
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ /// <reference path="./types/index.d.ts" />
2
+ export {};
package/motion.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ /// <reference path="./types/index.d.ts" />
2
+ export {};
package/package.json CHANGED
@@ -1,6 +1,129 @@
1
1
  {
2
- "name": "@vigla/svelte",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@vigla/svelte",
3
+ "version": "5.57.4",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/runlith/vigla.git",
7
+ "directory": "packages/svelte"
8
+ },
9
+ "type": "module",
10
+ "types": "./types/index.d.ts",
11
+ "files": [
12
+ "dist",
13
+ "src",
14
+ "compiler",
15
+ "types",
16
+ "elements.d.ts",
17
+ "svelte-html.d.ts",
18
+ "index.d.ts",
19
+ "compiler.d.ts",
20
+ "action.d.ts",
21
+ "animate.d.ts",
22
+ "easing.d.ts",
23
+ "motion.d.ts",
24
+ "store.d.ts",
25
+ "transition.d.ts"
26
+ ],
27
+ "vigla": {
28
+ "frontEnd": {
29
+ "compiler": "./compiler",
30
+ "components": [
31
+ ".svelte"
32
+ ],
33
+ "modules": {
34
+ "infixes": [
35
+ ".svelte."
36
+ ],
37
+ "extensions": [
38
+ ".js",
39
+ ".ts"
40
+ ]
41
+ },
42
+ "condition": "svelte",
43
+ "config": "svelte.config"
44
+ }
45
+ },
46
+ "exports": {
47
+ ".": {
48
+ "types": "./types/index.d.ts",
49
+ "worker": "./dist/entries/index-server.js",
50
+ "browser": "./dist/entries/index.js",
51
+ "default": "./dist/entries/index-server.js"
52
+ },
53
+ "./package.json": "./package.json",
54
+ "./action": {
55
+ "types": "./types/index.d.ts",
56
+ "default": "./dist/entries/action.js"
57
+ },
58
+ "./animate": {
59
+ "types": "./types/index.d.ts",
60
+ "default": "./dist/entries/animate.js"
61
+ },
62
+ "./attachments": {
63
+ "types": "./types/index.d.ts",
64
+ "default": "./dist/entries/attachments.js"
65
+ },
66
+ "./easing": {
67
+ "types": "./types/index.d.ts",
68
+ "default": "./dist/entries/easing.js"
69
+ },
70
+ "./compiler": {
71
+ "types": "./types/index.d.ts",
72
+ "require": "./compiler/index.js",
73
+ "default": "./dist/compiler/index.js"
74
+ },
75
+ "./elements": {
76
+ "types": "./elements.d.ts"
77
+ },
78
+ "./events": {
79
+ "types": "./types/index.d.ts",
80
+ "default": "./dist/entries/events.js"
81
+ },
82
+ "./internal": "./dist/entries/internal/index.js",
83
+ "./internal/client": "./dist/entries/internal/client.js",
84
+ "./internal/disclose-version": "./dist/entries/internal/disclose-version.js",
85
+ "./internal/flags/tracing": "./dist/entries/internal/tracing.js",
86
+ "./internal/server": "./dist/entries/internal/server.js",
87
+ "./motion": {
88
+ "types": "./types/index.d.ts",
89
+ "worker": "./dist/entries/motion-server.js",
90
+ "browser": "./dist/entries/motion.js",
91
+ "default": "./dist/entries/motion-server.js"
92
+ },
93
+ "./reactivity": {
94
+ "types": "./types/index.d.ts",
95
+ "worker": "./dist/entries/reactivity-server.js",
96
+ "browser": "./dist/entries/reactivity.js",
97
+ "default": "./dist/entries/reactivity-server.js"
98
+ },
99
+ "./reactivity/window": {
100
+ "types": "./types/index.d.ts",
101
+ "worker": "./dist/entries/window-server.js",
102
+ "browser": "./dist/entries/window.js",
103
+ "default": "./dist/entries/window-server.js"
104
+ },
105
+ "./server": {
106
+ "types": "./types/index.d.ts",
107
+ "default": "./dist/entries/server.js"
108
+ },
109
+ "./store": {
110
+ "types": "./types/index.d.ts",
111
+ "worker": "./dist/entries/store-server.js",
112
+ "browser": "./dist/entries/store-client.js",
113
+ "default": "./dist/entries/store-server.js"
114
+ },
115
+ "./transition": {
116
+ "types": "./types/index.d.ts",
117
+ "default": "./dist/entries/transition.js"
118
+ }
119
+ },
120
+ "dependencies": {
121
+ "@jridgewell/remapping": "^2.3.5",
122
+ "@jridgewell/sourcemap-codec": "^1.6.0",
123
+ "@sveltejs/acorn-typescript": "^1.0.13",
124
+ "@types/estree": "^1.0.9",
125
+ "acorn": "^8.18.0",
126
+ "vigla": "0.2.0",
127
+ "esrap": "^2.3.6"
128
+ }
129
+ }
@@ -0,0 +1,233 @@
1
+ import { CompileError as Fault, type Diagnostic } from 'vigla/compiler';
2
+ import { locator, type Locator } from '../front/index.ts';
3
+
4
+ export interface Location {
5
+ line: number;
6
+ column: number;
7
+ character: number;
8
+ }
9
+
10
+ export interface Warning {
11
+ code: string;
12
+ message: string;
13
+ filename?: string;
14
+ start?: Location;
15
+ end?: Location;
16
+ position?: [number, number];
17
+ frame?: string;
18
+ }
19
+
20
+ const unknownFilename = '(unknown)';
21
+ const leadingTabs = /^\t+/;
22
+
23
+ function tabsToSpaces(line: string): string {
24
+ return line.replace(leadingTabs, (tabs) => ' '.repeat(tabs.length));
25
+ }
26
+
27
+ function codeFrame(lines: readonly string[], line: number, column: number): string {
28
+ const first = Math.max(0, line - 2);
29
+ const last = Math.min(line + 3, lines.length);
30
+ const digits = String(last + 1).length;
31
+ const out: string[] = [];
32
+ for (let index = first; index < last; index++) {
33
+ const text = lines[index] as string;
34
+ const number = String(index + 1).padStart(digits, ' ');
35
+ out.push(`${number}: ${tabsToSpaces(text)}`);
36
+ if (index === line) {
37
+ const indent = digits + 2 + tabsToSpaces(text.slice(0, column)).length;
38
+ out.push(`${' '.repeat(indent)}^`);
39
+ }
40
+ }
41
+ return out.join('\n');
42
+ }
43
+
44
+ function link(diagnostic: { code: string; message: string }): string {
45
+ return `${diagnostic.message}\nhttps://svelte.dev/e/${diagnostic.code}`;
46
+ }
47
+
48
+ interface Located {
49
+ readonly filename?: string;
50
+ readonly position?: [number, number];
51
+ readonly start?: Location;
52
+ readonly end?: Location;
53
+ readonly frame?: () => string;
54
+ }
55
+
56
+ function place(target: object, at: Located): void {
57
+ const { frame, ...rest } = at;
58
+ Object.assign(target, rest);
59
+ if (frame === undefined) return;
60
+ let text: string | undefined;
61
+ Object.defineProperty(target, 'frame', {
62
+ enumerable: true,
63
+ configurable: true,
64
+ get: () => (text ??= frame()),
65
+ set: (value: string) => {
66
+ text = value;
67
+ }
68
+ });
69
+ }
70
+
71
+ function described(code: string, message: string, at: Warning): string {
72
+ let out = `${code}: ${message}`;
73
+ if (at.filename !== undefined) {
74
+ out += `\n${at.filename}`;
75
+ if (at.start !== undefined) out += `:${at.start.line}:${at.start.column}`;
76
+ }
77
+ if (at.frame !== undefined) out += `\n${at.frame}`;
78
+ return out;
79
+ }
80
+
81
+ export class CompileWarning implements Warning {
82
+ readonly name = 'CompileWarning';
83
+ code: string;
84
+ message: string;
85
+ declare filename?: string;
86
+ declare position?: [number, number];
87
+ declare start?: Location;
88
+ declare end?: Location;
89
+ declare frame?: string;
90
+
91
+ constructor(code: string, message: string, at: Located) {
92
+ this.code = code;
93
+ this.message = message;
94
+ place(this, at);
95
+ }
96
+
97
+ toString(): string {
98
+ return described(this.code, this.message, this);
99
+ }
100
+
101
+ toJSON(): Warning {
102
+ const { code, message, filename, start, end, position, frame } = this;
103
+ return { code, message, filename, start, end, position, frame };
104
+ }
105
+ }
106
+
107
+ export class CompileError extends Error {
108
+ override message = '';
109
+ code: string;
110
+ declare filename?: string;
111
+ declare position?: [number, number];
112
+ declare start?: Location;
113
+ declare end?: Location;
114
+ declare frame?: string;
115
+
116
+ constructor(code: string, message: string, at: Located) {
117
+ super(message);
118
+ this.stack = '';
119
+ this.message = message;
120
+ this.code = code;
121
+ place(this, at);
122
+ this.name = 'CompileError';
123
+ }
124
+
125
+ override toString(): string {
126
+ return described(this.code, this.message, this);
127
+ }
128
+
129
+ toJSON(): Warning {
130
+ const { code, message, filename, start, end, position, frame } = this;
131
+ return { code, message, filename, start, end, position, frame };
132
+ }
133
+ }
134
+
135
+ export interface Notice {
136
+ readonly code: string;
137
+ readonly message: string;
138
+ }
139
+
140
+ export interface Place {
141
+ readonly filename?: string;
142
+ readonly rootDir?: string;
143
+ }
144
+
145
+ function normalized(filename: string | undefined): string {
146
+ return (filename ?? unknownFilename).replace(/\\/g, '/');
147
+ }
148
+
149
+ export function relativeFilename(place: Place): string {
150
+ const filename = normalized(place.filename);
151
+ const root = place.rootDir?.replace(/\\/g, '/');
152
+ if (root === undefined || !filename.startsWith(root)) return filename;
153
+ return filename.replace(root, '').replace(/^[/\\]/, '');
154
+ }
155
+
156
+ export class Diagnostics {
157
+ readonly source: string;
158
+ readonly #place: Place;
159
+ readonly #filter: (warning: Warning) => boolean;
160
+ #filename: string;
161
+ #locate: Locator | undefined;
162
+ #lines: string[] | undefined;
163
+
164
+ constructor(source: string, place: Place, filter?: (warning: Warning) => boolean) {
165
+ this.source = source;
166
+ this.#place = place;
167
+ this.#filter = filter ?? (() => true);
168
+ this.#filename = normalized(place.filename);
169
+ }
170
+
171
+ analysing(): void {
172
+ this.#filename = relativeFilename(this.#place);
173
+ }
174
+
175
+ get locate(): Locator {
176
+ this.#locate ??= locator(this.source);
177
+ return this.#locate;
178
+ }
179
+
180
+ located(start: number | undefined, end: number | undefined): Located {
181
+ const filename = this.#filename === unknownFilename ? undefined : this.#filename;
182
+ if (start === undefined) return filename === undefined ? {} : { filename };
183
+ const finish = end ?? start;
184
+ const from = this.locate(start);
185
+ const to = this.locate(finish);
186
+ this.#lines ??= this.source.split('\n');
187
+ const lines = this.#lines;
188
+ const frame = (): string => codeFrame(lines, from.line - 1, to.column);
189
+ return {
190
+ ...(filename === undefined ? {} : { filename }),
191
+ position: [start, finish],
192
+ start: from,
193
+ end: to,
194
+ frame
195
+ };
196
+ }
197
+
198
+ notices(notices: readonly Notice[]): Warning[] {
199
+ return notices
200
+ .map(
201
+ (notice) =>
202
+ new CompileWarning(notice.code, link(notice), this.located(undefined, undefined))
203
+ )
204
+ .filter(this.#filter);
205
+ }
206
+
207
+ warnings(diagnostics: readonly Diagnostic[]): Warning[] {
208
+ const reshaped: Warning[] = [];
209
+ for (const diagnostic of diagnostics) {
210
+ const warning = new CompileWarning(
211
+ diagnostic.code,
212
+ link(diagnostic),
213
+ this.located(diagnostic.start, diagnostic.end)
214
+ );
215
+ if (this.#filter(warning)) reshaped.push(warning);
216
+ }
217
+ return reshaped;
218
+ }
219
+
220
+ guard<T>(run: () => T): T {
221
+ try {
222
+ return run();
223
+ } catch (error) {
224
+ if (error instanceof Fault) {
225
+ const { code, start, end } = error.diagnostic;
226
+ const unplaced = code.startsWith('options_');
227
+ const at = unplaced ? this.located(undefined, undefined) : this.located(start, end);
228
+ throw new CompileError(code, link(error.diagnostic), at);
229
+ }
230
+ throw error;
231
+ }
232
+ }
233
+ }
@@ -0,0 +1,292 @@
1
+ import {
2
+ analyzeStyle,
3
+ compile as compileUnit,
4
+ hash,
5
+ compileModule as compileModuleUnit,
6
+ validateComponent as validateUnit,
7
+ validateModule as validateModuleUnit,
8
+ type Code,
9
+ type Diagnostic,
10
+ type InputMap,
11
+ type Runtime,
12
+ type ValidateOptions
13
+ } from 'vigla/compiler';
14
+ import {
15
+ front,
16
+ legacy,
17
+ lowerComponent,
18
+ parseComponent,
19
+ parseStylesheet,
20
+ validateComponent,
21
+ validateModuleSyntax,
22
+ wording,
23
+ type AST,
24
+ type Parsed
25
+ } from '../front/index.ts';
26
+ import { Diagnostics, relativeFilename, type Warning } from './diagnostics.ts';
27
+ import { validate } from './options.ts';
28
+ import { format } from '../shared/format.ts';
29
+ import { proxyDiagnostics } from './proxy.ts';
30
+
31
+ export { CompileError, CompileWarning, type Location, type Warning } from './diagnostics.ts';
32
+ export { format } from '../shared/format.ts';
33
+ export { print, type PrintOptions, type Printed } from '../front/index.ts';
34
+ export {
35
+ preprocess,
36
+ type MarkupPreprocessor,
37
+ type Preprocessor,
38
+ type PreprocessorGroup,
39
+ type Processed
40
+ } from './preprocess/index.ts';
41
+ export type { AST };
42
+
43
+ export const VERSION = '5.57.4';
44
+
45
+ export interface Experimental {
46
+ async?: boolean;
47
+ }
48
+
49
+ export interface ModuleCompileOptions {
50
+ filename?: string;
51
+ rootDir?: string;
52
+ dev?: boolean;
53
+ generate?: 'client' | 'server' | false;
54
+ warningFilter?: (warning: Warning) => boolean;
55
+ experimental?: Experimental;
56
+ }
57
+
58
+ export interface CssHashInput {
59
+ name: string;
60
+ filename: string;
61
+ css: string;
62
+ hash: (input: string) => string;
63
+ }
64
+
65
+ export interface CompileOptions extends ModuleCompileOptions {
66
+ name?: string;
67
+ runes?: boolean;
68
+ css?: 'injected' | 'external';
69
+ cssHash?: (input: CssHashInput) => string;
70
+ cssOutputFilename?: string;
71
+ outputFilename?: string;
72
+ customElement?: boolean;
73
+ discloseVersion?: boolean;
74
+ namespace?: 'html' | 'svg' | 'mathml';
75
+ modernAst?: boolean;
76
+ preserveComments?: boolean;
77
+ preserveWhitespace?: boolean;
78
+ fragments?: 'html' | 'tree';
79
+ hmr?: boolean;
80
+ sourcemap?: InputMap;
81
+ }
82
+
83
+ export interface Metadata {
84
+ runes: boolean;
85
+ }
86
+
87
+ export interface CssResult {
88
+ code: string;
89
+ map: unknown;
90
+ hasGlobal: boolean;
91
+ }
92
+
93
+ export interface CompileResult {
94
+ js: Code | null;
95
+ css: CssResult | null;
96
+ warnings: Warning[];
97
+ metadata: Metadata;
98
+ ast?: AST.Root | Record<string, any>;
99
+ }
100
+
101
+ export interface ParseOptions {
102
+ filename?: string;
103
+ rootDir?: string;
104
+ modern?: boolean;
105
+ loose?: boolean;
106
+ }
107
+
108
+ const stores = ['svelte/store'];
109
+
110
+ const runtime: Runtime = {
111
+ client: 'svelte/internal/client',
112
+ server: 'svelte/internal/server',
113
+ names: { pre: 'user_pre_effect', userEffect: 'user_effect' }
114
+ };
115
+
116
+ function generated(options: ModuleCompileOptions): 'client' | 'server' {
117
+ return options.generate === 'server' ? 'server' : 'client';
118
+ }
119
+
120
+ function sourceName(filename: string | undefined): string {
121
+ const parts = (filename ?? '(unknown)').split(/[/\\]/);
122
+ const base = parts.pop() as string;
123
+ const directory = parts.at(-1);
124
+ let name = base.replace('.svelte', '');
125
+ if (name === 'index' && directory && directory !== 'src') name = directory;
126
+ return name.charAt(0).toUpperCase() + name.slice(1);
127
+ }
128
+
129
+ function functionName(preferred: string): string {
130
+ return preferred.replace(/[^a-zA-Z0-9_$]/g, '_').replace(/^[0-9]/, '_');
131
+ }
132
+
133
+ function styleHash(root: AST.Root, options: CompileOptions, name: string): string {
134
+ if (root.css === null) return '';
135
+ const css = root.css.content.styles;
136
+ const filename = relativeFilename(options);
137
+ if (options.cssHash) return options.cssHash({ name, filename, css, hash });
138
+ return `svelte-${hash(filename === '(unknown)' ? css : filename)}`;
139
+ }
140
+
141
+ function publicAst(
142
+ source: string,
143
+ parsed: Parsed,
144
+ modern: boolean | undefined
145
+ ): AST.Root | Record<string, any> {
146
+ return modern ? parsed.root : legacy(source, parsed.root, parsed.options);
147
+ }
148
+
149
+ function withoutBom(source: string): string {
150
+ return source.charCodeAt(0) === 0xfeff ? source.slice(1) : source;
151
+ }
152
+
153
+ export function parse(source: string, options: ParseOptions & { modern: true }): AST.Root;
154
+ export function parse(source: string, options?: ParseOptions): Record<string, any>;
155
+ export function parse(
156
+ input: string,
157
+ { modern, loose }: ParseOptions = {}
158
+ ): AST.Root | Record<string, any> {
159
+ if (typeof input !== 'string') throw new TypeError('Template must be a string');
160
+ const source = withoutBom(input);
161
+ return new Diagnostics(source, {}).guard(() => {
162
+ const parsed = parseComponent(source, loose);
163
+ return modern ? parsed.root : legacy(source, parsed.root, parsed.options);
164
+ });
165
+ }
166
+
167
+ export function parseCss(input: string): AST.Css.StyleSheetFile {
168
+ const source = withoutBom(input);
169
+ return new Diagnostics(source, {}).guard(() => parseStylesheet(source));
170
+ }
171
+
172
+ export function compile(input: string, options: CompileOptions = {}): CompileResult {
173
+ const source = withoutBom(input);
174
+ const diagnostics = new Diagnostics(source, options, options.warningFilter);
175
+ return diagnostics.guard(() => {
176
+ const notices = diagnostics.notices(validate(options, 'component'));
177
+ const parsed = parseComponent(source);
178
+ diagnostics.analysing();
179
+ const reading = lowerComponent(parsed, source, options.filename ?? null);
180
+ const syntax = validateComponent(parsed, source, {
181
+ customElement: options.customElement === true,
182
+ filename: options.filename
183
+ });
184
+ const validation: ValidateOptions = {
185
+ customElement: options.customElement === true,
186
+ namespace: options.namespace,
187
+ stores,
188
+ wording,
189
+ front: {
190
+ before: syntax.before,
191
+ at: syntax.anchors.translated(reading.lowered, reading.anchored)
192
+ }
193
+ };
194
+ const reported = (core: readonly Diagnostic[]): Warning[] => [
195
+ ...notices,
196
+ ...diagnostics.warnings([...syntax.parse, ...core])
197
+ ];
198
+ const named = sourceName(options.filename);
199
+ const name = functionName(options.name ?? named);
200
+ const css = {
201
+ hash: styleHash(parsed.root, options, named),
202
+ id:
203
+ options.cssHash === undefined && relativeFilename(options) === '(unknown)'
204
+ ? `svelte-${hash(source)}`
205
+ : undefined,
206
+ inject: options.css === 'injected',
207
+ outputFilename: options.cssOutputFilename
208
+ };
209
+ if (options.generate === false) {
210
+ const core = validateUnit(reading.unit, validation);
211
+ const style = analyzeStyle(reading.unit, { hash: css.hash });
212
+ return {
213
+ js: null,
214
+ css: null,
215
+ warnings: reported([...core, ...style.warnings]),
216
+ metadata: { runes: true },
217
+ ast: publicAst(source, parsed, options.modernAst)
218
+ };
219
+ }
220
+ const output = compileUnit(reading.unit, {
221
+ generate: generated(options),
222
+ runtime,
223
+ clientExpression:
224
+ options.dev && generated(options) === 'client'
225
+ ? proxyDiagnostics(reading.unit, relativeFilename(options))
226
+ : undefined,
227
+ format,
228
+ devFilename: relativeFilename(options),
229
+ discloseVersion: options.discloseVersion === false ? false : '5',
230
+ name,
231
+ customElement: options.customElement ?? false,
232
+ css,
233
+ dev: options.dev,
234
+ namespace: options.namespace,
235
+ preserveWhitespace: options.preserveWhitespace,
236
+ preserveComments: options.preserveComments,
237
+ fragments: options.fragments,
238
+ validation,
239
+ outputFilename: options.outputFilename,
240
+ inputMap: options.sourcemap,
241
+ hmr: options.hmr
242
+ });
243
+ return {
244
+ js: output.js,
245
+ css: output.css,
246
+ warnings: reported(output.warnings),
247
+ metadata: { runes: true },
248
+ ast: publicAst(source, parsed, options.modernAst)
249
+ };
250
+ });
251
+ }
252
+
253
+ export function compileModule(input: string, options: ModuleCompileOptions = {}): CompileResult {
254
+ const source = withoutBom(input);
255
+ const diagnostics = new Diagnostics(source, options, options.warningFilter);
256
+ return diagnostics.guard(() => {
257
+ const notices = diagnostics.notices(validate(options, 'module'));
258
+ diagnostics.analysing();
259
+ const reading = front.module({ source, filename: options.filename ?? null });
260
+ const program = reading.unit.program;
261
+ const validation: ValidateOptions = {
262
+ stores,
263
+ wording,
264
+ front: { at: validateModuleSyntax(program).translated(new Map(), new Map()) }
265
+ };
266
+ if (options.generate === false) {
267
+ const core = validateModuleUnit(reading.unit, validation);
268
+ return {
269
+ js: null,
270
+ css: null,
271
+ warnings: [...notices, ...diagnostics.warnings(core)],
272
+ metadata: { runes: true }
273
+ };
274
+ }
275
+ const output = compileModuleUnit(reading.unit, {
276
+ generate: generated(options),
277
+ runtime,
278
+ clientExpression:
279
+ options.dev && generated(options) === 'client'
280
+ ? proxyDiagnostics(reading.unit, relativeFilename(options))
281
+ : undefined,
282
+ dev: options.dev,
283
+ validation
284
+ });
285
+ return {
286
+ js: output.js,
287
+ css: null,
288
+ warnings: [...notices, ...diagnostics.warnings(output.warnings)],
289
+ metadata: { runes: true }
290
+ };
291
+ });
292
+ }