loopwind 0.9.1

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 (245) hide show
  1. package/FONTS.md +156 -0
  2. package/HELPERS_DEMO.md +134 -0
  3. package/PROJECT_STRUCTURE.md +286 -0
  4. package/PUBLISHING.md +171 -0
  5. package/README.md +1020 -0
  6. package/REGISTRY_SETUP.md +427 -0
  7. package/SHADCN_INTEGRATION.md +269 -0
  8. package/TAILWIND.md +228 -0
  9. package/TEMPLATE_SOURCES.md +363 -0
  10. package/_dsgn/templates/banner-hero/banner-hero.tsx +57 -0
  11. package/_dsgn/templates/banner-hero/meta.json +14 -0
  12. package/_dsgn/templates/composite-card/meta.json +16 -0
  13. package/_dsgn/templates/composite-card/template.tsx +44 -0
  14. package/_dsgn/templates/image/meta.json +13 -0
  15. package/_dsgn/templates/image/template.tsx +28 -0
  16. package/_dsgn/templates/kitchen-sink/meta.json +13 -0
  17. package/_dsgn/templates/kitchen-sink/template.tsx +72 -0
  18. package/_dsgn/templates/qr-card/meta.json +14 -0
  19. package/_dsgn/templates/qr-card/template.tsx +39 -0
  20. package/_dsgn/templates/test-parent/child/meta.json +11 -0
  21. package/_dsgn/templates/test-parent/child/template.tsx +27 -0
  22. package/_dsgn/templates/test-parent/meta.json +12 -0
  23. package/_dsgn/templates/test-parent/template.tsx +30 -0
  24. package/_dsgn/templates/test-sibling/meta.json +11 -0
  25. package/_dsgn/templates/test-sibling/template.tsx +20 -0
  26. package/_dsgn/templates/video/.tmp/template-1763421345296.mjs +43 -0
  27. package/_dsgn/templates/video/.tmp/template-1763421362228.mjs +43 -0
  28. package/_dsgn/templates/video/.tmp/template-1763421377706.mjs +43 -0
  29. package/_dsgn/templates/video/meta.json +17 -0
  30. package/_dsgn/templates/video/template.tsx +48 -0
  31. package/dist/cli.d.ts +3 -0
  32. package/dist/cli.d.ts.map +1 -0
  33. package/dist/cli.js +70 -0
  34. package/dist/cli.js.map +1 -0
  35. package/dist/commands/add.d.ts +6 -0
  36. package/dist/commands/add.d.ts.map +1 -0
  37. package/dist/commands/add.js +86 -0
  38. package/dist/commands/add.js.map +1 -0
  39. package/dist/commands/default.d.ts +2 -0
  40. package/dist/commands/default.d.ts.map +1 -0
  41. package/dist/commands/default.js +69 -0
  42. package/dist/commands/default.js.map +1 -0
  43. package/dist/commands/init.d.ts +2 -0
  44. package/dist/commands/init.d.ts.map +1 -0
  45. package/dist/commands/init.js +75 -0
  46. package/dist/commands/init.js.map +1 -0
  47. package/dist/commands/list.d.ts +2 -0
  48. package/dist/commands/list.d.ts.map +1 -0
  49. package/dist/commands/list.js +83 -0
  50. package/dist/commands/list.js.map +1 -0
  51. package/dist/commands/preview.d.ts +3 -0
  52. package/dist/commands/preview.d.ts.map +1 -0
  53. package/dist/commands/preview.js +296 -0
  54. package/dist/commands/preview.js.map +1 -0
  55. package/dist/commands/render.d.ts +10 -0
  56. package/dist/commands/render.d.ts.map +1 -0
  57. package/dist/commands/render.js +204 -0
  58. package/dist/commands/render.js.map +1 -0
  59. package/dist/commands/validate.d.ts +2 -0
  60. package/dist/commands/validate.d.ts.map +1 -0
  61. package/dist/commands/validate.js +107 -0
  62. package/dist/commands/validate.js.map +1 -0
  63. package/dist/default-templates/AGENTS.md +229 -0
  64. package/dist/default-templates/image/meta.json +13 -0
  65. package/dist/default-templates/image/template.d.ts +20 -0
  66. package/dist/default-templates/image/template.d.ts.map +1 -0
  67. package/dist/default-templates/image/template.js +18 -0
  68. package/dist/default-templates/image/template.js.map +1 -0
  69. package/dist/default-templates/image/template.tsx +20 -0
  70. package/dist/default-templates/image-template/meta.json +13 -0
  71. package/dist/default-templates/image-template/template.tsx +19 -0
  72. package/dist/default-templates/kitchen-sink/meta.json +13 -0
  73. package/dist/default-templates/kitchen-sink/template.tsx +64 -0
  74. package/dist/default-templates/page/meta.json +17 -0
  75. package/dist/default-templates/page/template.tsx +37 -0
  76. package/dist/default-templates/video/meta.json +17 -0
  77. package/dist/default-templates/video/template.d.ts +26 -0
  78. package/dist/default-templates/video/template.d.ts.map +1 -0
  79. package/dist/default-templates/video/template.js +33 -0
  80. package/dist/default-templates/video/template.js.map +1 -0
  81. package/dist/default-templates/video/template.tsx +37 -0
  82. package/dist/default-templates/video-template/meta.json +17 -0
  83. package/dist/default-templates/video-template/template.tsx +36 -0
  84. package/dist/default-templates/website/meta.json +16 -0
  85. package/dist/default-templates/website/pages/home.tsx +17 -0
  86. package/dist/default-templates/website/parts/footer.tsx +17 -0
  87. package/dist/default-templates/website/parts/header.tsx +17 -0
  88. package/dist/default-templates/website/template.tsx +17 -0
  89. package/dist/default-templates/website-template/meta.json +16 -0
  90. package/dist/default-templates/website-template/pages/home.tsx +16 -0
  91. package/dist/default-templates/website-template/parts/footer.tsx +16 -0
  92. package/dist/default-templates/website-template/parts/header.tsx +16 -0
  93. package/dist/default-templates/website-template/template.tsx +16 -0
  94. package/dist/lib/config.d.ts +34 -0
  95. package/dist/lib/config.d.ts.map +1 -0
  96. package/dist/lib/config.js +248 -0
  97. package/dist/lib/config.js.map +1 -0
  98. package/dist/lib/constants.d.ts +7 -0
  99. package/dist/lib/constants.d.ts.map +1 -0
  100. package/dist/lib/constants.js +12 -0
  101. package/dist/lib/constants.js.map +1 -0
  102. package/dist/lib/helpers.d.ts +29 -0
  103. package/dist/lib/helpers.d.ts.map +1 -0
  104. package/dist/lib/helpers.js +159 -0
  105. package/dist/lib/helpers.js.map +1 -0
  106. package/dist/lib/installer.d.ts +51 -0
  107. package/dist/lib/installer.d.ts.map +1 -0
  108. package/dist/lib/installer.js +215 -0
  109. package/dist/lib/installer.js.map +1 -0
  110. package/dist/lib/renderer.d.ts +51 -0
  111. package/dist/lib/renderer.d.ts.map +1 -0
  112. package/dist/lib/renderer.js +524 -0
  113. package/dist/lib/renderer.js.map +1 -0
  114. package/dist/lib/tailwind-config-loader.d.ts +47 -0
  115. package/dist/lib/tailwind-config-loader.d.ts.map +1 -0
  116. package/dist/lib/tailwind-config-loader.js +432 -0
  117. package/dist/lib/tailwind-config-loader.js.map +1 -0
  118. package/dist/lib/tailwind-detector.d.ts +36 -0
  119. package/dist/lib/tailwind-detector.d.ts.map +1 -0
  120. package/dist/lib/tailwind-detector.js +156 -0
  121. package/dist/lib/tailwind-detector.js.map +1 -0
  122. package/dist/lib/tailwind.d.ts +8 -0
  123. package/dist/lib/tailwind.d.ts.map +1 -0
  124. package/dist/lib/tailwind.js +994 -0
  125. package/dist/lib/tailwind.js.map +1 -0
  126. package/dist/lib/template-validator.d.ts +22 -0
  127. package/dist/lib/template-validator.d.ts.map +1 -0
  128. package/dist/lib/template-validator.js +174 -0
  129. package/dist/lib/template-validator.js.map +1 -0
  130. package/dist/lib/utils.d.ts +44 -0
  131. package/dist/lib/utils.d.ts.map +1 -0
  132. package/dist/lib/utils.js +207 -0
  133. package/dist/lib/utils.js.map +1 -0
  134. package/dist/lib/version-check.d.ts +16 -0
  135. package/dist/lib/version-check.d.ts.map +1 -0
  136. package/dist/lib/version-check.js +88 -0
  137. package/dist/lib/version-check.js.map +1 -0
  138. package/dist/lib/video-renderer.d.ts +32 -0
  139. package/dist/lib/video-renderer.d.ts.map +1 -0
  140. package/dist/lib/video-renderer.js +226 -0
  141. package/dist/lib/video-renderer.js.map +1 -0
  142. package/dist/sdk/index.d.ts +58 -0
  143. package/dist/sdk/index.d.ts.map +1 -0
  144. package/dist/sdk/index.js +119 -0
  145. package/dist/sdk/index.js.map +1 -0
  146. package/dist/sdk/template.d.ts +40 -0
  147. package/dist/sdk/template.d.ts.map +1 -0
  148. package/dist/sdk/template.js +60 -0
  149. package/dist/sdk/template.js.map +1 -0
  150. package/dist/types/config.d.ts +62 -0
  151. package/dist/types/config.d.ts.map +1 -0
  152. package/dist/types/config.js +47 -0
  153. package/dist/types/config.js.map +1 -0
  154. package/dist/types/template.d.ts +79 -0
  155. package/dist/types/template.d.ts.map +1 -0
  156. package/dist/types/template.js +2 -0
  157. package/dist/types/template.js.map +1 -0
  158. package/examples/nextjs-api/README.md +180 -0
  159. package/examples/nextjs-api/package.json +21 -0
  160. package/examples/nextjs-api/pages/api/intro-video.ts +53 -0
  161. package/examples/nextjs-api/pages/api/og-image.ts +50 -0
  162. package/netlify.toml +13 -0
  163. package/package.json +84 -0
  164. package/patches/satori+0.18.3.patch +13 -0
  165. package/test-templates/TESTS.md +63 -0
  166. package/test-templates/_dsgn/templates/absolute-spin/meta.json +7 -0
  167. package/test-templates/_dsgn/templates/absolute-spin/template.tsx +16 -0
  168. package/test-templates/_dsgn/templates/animated-intro/.tmp/template-1763468771640.mjs +7 -0
  169. package/test-templates/_dsgn/templates/animated-intro/meta.json +10 -0
  170. package/test-templates/_dsgn/templates/animated-intro/template.tsx +23 -0
  171. package/test-templates/_dsgn/templates/centered-spin/.tmp/template-1763468525386.mjs +7 -0
  172. package/test-templates/_dsgn/templates/centered-spin/meta.json +7 -0
  173. package/test-templates/_dsgn/templates/centered-spin/template.tsx +11 -0
  174. package/test-templates/_dsgn/templates/composite/.tmp/template-1763468815645.mjs +7 -0
  175. package/test-templates/_dsgn/templates/composite/meta.json +9 -0
  176. package/test-templates/_dsgn/templates/composite/template.tsx +23 -0
  177. package/test-templates/_dsgn/templates/easing-test/.tmp/template-1763468824501.mjs +7 -0
  178. package/test-templates/_dsgn/templates/easing-test/meta.json +7 -0
  179. package/test-templates/_dsgn/templates/easing-test/template.tsx +47 -0
  180. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763466364336.mjs +10 -0
  181. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763466584319.mjs +10 -0
  182. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763466667797.mjs +10 -0
  183. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763466746504.mjs +10 -0
  184. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763466930225.mjs +10 -0
  185. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763467004552.mjs +10 -0
  186. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763467060334.mjs +10 -0
  187. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763467124493.mjs +10 -0
  188. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763467174690.mjs +10 -0
  189. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763467359134.mjs +10 -0
  190. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763467451928.mjs +10 -0
  191. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763467758275.mjs +10 -0
  192. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763467985201.mjs +10 -0
  193. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763468020563.mjs +10 -0
  194. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763468090428.mjs +10 -0
  195. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763468211036.mjs +10 -0
  196. package/test-templates/_dsgn/templates/minimal-spin/.tmp/template-1763468394057.mjs +10 -0
  197. package/test-templates/_dsgn/templates/minimal-spin/meta.json +7 -0
  198. package/test-templates/_dsgn/templates/minimal-spin/template.tsx +13 -0
  199. package/test-templates/_dsgn/templates/no-origin-spin/meta.json +7 -0
  200. package/test-templates/_dsgn/templates/no-origin-spin/template.tsx +10 -0
  201. package/test-templates/_dsgn/templates/opacity-test/meta.json +7 -0
  202. package/test-templates/_dsgn/templates/opacity-test/template.tsx +9 -0
  203. package/test-templates/_dsgn/templates/qr-code/.tmp/template-1763468758954.mjs +17 -0
  204. package/test-templates/_dsgn/templates/qr-code/.tmp/template-1763468815672.mjs +17 -0
  205. package/test-templates/_dsgn/templates/qr-code/meta.json +9 -0
  206. package/test-templates/_dsgn/templates/qr-code/template.tsx +20 -0
  207. package/test-templates/_dsgn/templates/rotation-abs-test/meta.json +7 -0
  208. package/test-templates/_dsgn/templates/rotation-abs-test/template.tsx +15 -0
  209. package/test-templates/_dsgn/templates/rotation-corner/meta.json +7 -0
  210. package/test-templates/_dsgn/templates/rotation-corner/template.tsx +12 -0
  211. package/test-templates/_dsgn/templates/rotation-test/meta.json +7 -0
  212. package/test-templates/_dsgn/templates/rotation-test/template.tsx +12 -0
  213. package/test-templates/_dsgn/templates/shake-test/meta.json +7 -0
  214. package/test-templates/_dsgn/templates/shake-test/template.tsx +12 -0
  215. package/test-templates/_dsgn/templates/static-image/.tmp/template-1763468746271.mjs +7 -0
  216. package/test-templates/_dsgn/templates/static-image/meta.json +9 -0
  217. package/test-templates/_dsgn/templates/static-image/template.tsx +19 -0
  218. package/test-templates/_dsgn/templates/translate-test/meta.json +7 -0
  219. package/test-templates/_dsgn/templates/translate-test/template.tsx +9 -0
  220. package/test-templates/_dsgn/templates/video-loops/.tmp/template-1763468793192.mjs +15 -0
  221. package/test-templates/_dsgn/templates/video-loops/meta.json +9 -0
  222. package/test-templates/_dsgn/templates/video-loops/template.tsx +39 -0
  223. package/test-templates/_dsgn/templates/wrapped-spin/meta.json +7 -0
  224. package/test-templates/_dsgn/templates/wrapped-spin/template.tsx +17 -0
  225. package/test-templates/compare-svgs.mjs +30 -0
  226. package/test-templates/convert-frames.mjs +15 -0
  227. package/test-templates/debug-rotation.mjs +25 -0
  228. package/test-templates/run-tests.sh +39 -0
  229. package/test-templates/test-sdk.mjs +115 -0
  230. package/website/.astro/settings.json +5 -0
  231. package/website/.astro/types.d.ts +1 -0
  232. package/website/README.md +112 -0
  233. package/website/astro.config.mjs +18 -0
  234. package/website/dist/_astro/fonts.DHdiHGBO.css +1 -0
  235. package/website/dist/fonts/index.html +193 -0
  236. package/website/dist/helpers/index.html +166 -0
  237. package/website/dist/images/index.html +314 -0
  238. package/website/dist/index.html +219 -0
  239. package/website/dist/llm.txt +2448 -0
  240. package/website/dist/styling/index.html +365 -0
  241. package/website/dist/templates/index.html +124 -0
  242. package/website/dist/video/index.html +636 -0
  243. package/website/package-lock.json +7606 -0
  244. package/website/package.json +23 -0
  245. package/website/public/robots.txt +5 -0
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "website",
3
+ "description": "Generate websites",
4
+ "type": "website",
5
+ "size": {
6
+ "width": 1200
7
+ },
8
+ "props": {
9
+ "title": "string",
10
+ "description": "string?"
11
+ },
12
+ "url": {
13
+ "fps": 30,
14
+ "duration": 3
15
+ }
16
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+
3
+ // Template metadata is defined in meta.json
4
+
5
+ export default function Template({ title, description}) {
6
+ return (
7
+ <html>
8
+ <head>
9
+ <title>{title}</title>
10
+ </head>
11
+ <body>
12
+ <h1>{title}</h1>
13
+ <p>{description}</p>
14
+ </body>
15
+ </html>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+
3
+ // Template metadata is defined in meta.json
4
+
5
+ export default function Template({ title, description}) {
6
+ return (
7
+ <html>
8
+ <head>
9
+ <title>{title}</title>
10
+ </head>
11
+ <body>
12
+ <h1>{title}</h1>
13
+ <p>{description}</p>
14
+ </body>
15
+ </html>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+
3
+ // Template metadata is defined in meta.json
4
+
5
+ export default function Template({ title, description}) {
6
+ return (
7
+ <html>
8
+ <head>
9
+ <title>{title}</title>
10
+ </head>
11
+ <body>
12
+ <h1>{title}</h1>
13
+ <p>{description}</p>
14
+ </body>
15
+ </html>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+
3
+ // Template metadata is defined in meta.json
4
+
5
+ export default function Template({ title, description}) {
6
+ return (
7
+ <html>
8
+ <head>
9
+ <title>{title}</title>
10
+ </head>
11
+ <body>
12
+ <h1>{title}</h1>
13
+ <p>{description}</p>
14
+ </body>
15
+ </html>
16
+ );
17
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "website",
3
+ "description": "Generate websites",
4
+ "type": "website",
5
+ "size": {
6
+ "width": 1200
7
+ },
8
+ "props": {
9
+ "title": "string",
10
+ "description": "string?"
11
+ },
12
+ "url": {
13
+ "fps": 30,
14
+ "duration": 3
15
+ }
16
+ }
@@ -0,0 +1,16 @@
1
+
2
+ // Template metadata is defined in meta.json
3
+
4
+ export default function Template({ title, description}) {
5
+ return (
6
+ <html>
7
+ <head>
8
+ <title>{title}</title>
9
+ </head>
10
+ <body>
11
+ <h1>{title}</h1>
12
+ <p>{description}</p>
13
+ </body>
14
+ </html>
15
+ );
16
+ }
@@ -0,0 +1,16 @@
1
+
2
+ // Template metadata is defined in meta.json
3
+
4
+ export default function Template({ title, description}) {
5
+ return (
6
+ <html>
7
+ <head>
8
+ <title>{title}</title>
9
+ </head>
10
+ <body>
11
+ <h1>{title}</h1>
12
+ <p>{description}</p>
13
+ </body>
14
+ </html>
15
+ );
16
+ }
@@ -0,0 +1,16 @@
1
+
2
+ // Template metadata is defined in meta.json
3
+
4
+ export default function Template({ title, description}) {
5
+ return (
6
+ <html>
7
+ <head>
8
+ <title>{title}</title>
9
+ </head>
10
+ <body>
11
+ <h1>{title}</h1>
12
+ <p>{description}</p>
13
+ </body>
14
+ </html>
15
+ );
16
+ }
@@ -0,0 +1,16 @@
1
+
2
+ // Template metadata is defined in meta.json
3
+
4
+ export default function Template({ title, description}) {
5
+ return (
6
+ <html>
7
+ <head>
8
+ <title>{title}</title>
9
+ </head>
10
+ <body>
11
+ <h1>{title}</h1>
12
+ <p>{description}</p>
13
+ </body>
14
+ </html>
15
+ );
16
+ }
@@ -0,0 +1,34 @@
1
+ import type { DesignConfig } from '../types/config.js';
2
+ /**
3
+ * Resolved paths for loopwind directories
4
+ */
5
+ export interface ResolvedPaths {
6
+ root: string;
7
+ templates: string;
8
+ outputs: string;
9
+ }
10
+ /**
11
+ * Get resolved paths from config or use defaults
12
+ */
13
+ export declare function getResolvedPaths(config?: DesignConfig): Promise<ResolvedPaths>;
14
+ /**
15
+ * Load loopwind.json config from the current project
16
+ */
17
+ export declare function loadConfig(): Promise<DesignConfig>;
18
+ /**
19
+ * Check if config file exists
20
+ */
21
+ export declare function configExists(): Promise<boolean>;
22
+ /**
23
+ * Create a sample config file
24
+ */
25
+ export declare function createSampleConfig(): Promise<void>;
26
+ /**
27
+ * Create config from detected Tailwind/shadcn settings
28
+ */
29
+ export declare function createConfigFromDetected(detected: any): Promise<void>;
30
+ /**
31
+ * Copy AGENTS.md file from default-templates to project
32
+ */
33
+ export declare function createAgentsDoc(): Promise<void>;
34
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKvD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAkBpF;AAeD;;GAEG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,YAAY,CAAC,CAaxD;AAeD;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,CAQrD;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAqExD;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAsG3E;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAUrD"}
@@ -0,0 +1,248 @@
1
+ import fs from 'fs/promises';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import { CWD, DEFAULT_LOOPWIND_DIR_NAME } from './constants.js';
5
+ import { DEFAULT_CONFIG } from '../types/config.js';
6
+ const CONFIG_FILE = 'loopwind.json';
7
+ /**
8
+ * Get resolved paths from config or use defaults
9
+ */
10
+ export async function getResolvedPaths(config) {
11
+ // If no config provided, try to load it
12
+ if (!config) {
13
+ config = await loadConfig();
14
+ }
15
+ const rootDir = config.paths?.root || DEFAULT_LOOPWIND_DIR_NAME;
16
+ const resolvedRoot = path.isAbsolute(rootDir) ? rootDir : path.join(CWD, rootDir);
17
+ return {
18
+ root: resolvedRoot,
19
+ templates: config.paths?.templates
20
+ ? (path.isAbsolute(config.paths.templates) ? config.paths.templates : path.join(CWD, config.paths.templates))
21
+ : path.join(resolvedRoot, 'templates'),
22
+ outputs: config.paths?.outputs
23
+ ? (path.isAbsolute(config.paths.outputs) ? config.paths.outputs : path.join(CWD, config.paths.outputs))
24
+ : path.join(resolvedRoot, 'outputs'),
25
+ };
26
+ }
27
+ // Get version from package.json
28
+ async function getVersion() {
29
+ try {
30
+ // Read package.json from the loopwind package installation
31
+ const packagePath = new URL('../../package.json', import.meta.url).pathname;
32
+ const content = await fs.readFile(packagePath, 'utf-8');
33
+ const pkg = JSON.parse(content);
34
+ return pkg.version || '0.0.0';
35
+ }
36
+ catch {
37
+ return '0.0.0';
38
+ }
39
+ }
40
+ /**
41
+ * Load loopwind.json config from the current project
42
+ */
43
+ export async function loadConfig() {
44
+ const configPath = path.join(CWD, CONFIG_FILE);
45
+ try {
46
+ const content = await fs.readFile(configPath, 'utf-8');
47
+ const userConfig = JSON.parse(content);
48
+ // Merge with defaults
49
+ return mergeConfig(DEFAULT_CONFIG, userConfig);
50
+ }
51
+ catch (error) {
52
+ // If no config file, return defaults
53
+ return DEFAULT_CONFIG;
54
+ }
55
+ }
56
+ /**
57
+ * Deep merge two config objects
58
+ */
59
+ function mergeConfig(base, override) {
60
+ return {
61
+ colors: { ...base.colors, ...override.colors },
62
+ fonts: { ...base.fonts, ...override.fonts },
63
+ tokens: { ...base.tokens, ...override.tokens },
64
+ defaults: { ...base.defaults, ...override.defaults },
65
+ paths: { ...base.paths, ...override.paths },
66
+ };
67
+ }
68
+ /**
69
+ * Check if config file exists
70
+ */
71
+ export async function configExists() {
72
+ const configPath = path.join(CWD, CONFIG_FILE);
73
+ try {
74
+ await fs.access(configPath);
75
+ return true;
76
+ }
77
+ catch {
78
+ return false;
79
+ }
80
+ }
81
+ /**
82
+ * Create a sample config file
83
+ */
84
+ export async function createSampleConfig() {
85
+ const configPath = path.join(CWD, CONFIG_FILE);
86
+ // shadcn/ui design system (zinc theme)
87
+ const sampleConfig = {
88
+ colors: {
89
+ // Primary colors
90
+ primary: '#18181b',
91
+ 'primary-foreground': '#fafafa',
92
+ // Secondary colors
93
+ secondary: '#f4f4f5',
94
+ 'secondary-foreground': '#18181b',
95
+ // Background colors
96
+ background: '#ffffff',
97
+ foreground: '#09090b',
98
+ // Muted colors
99
+ muted: '#f4f4f5',
100
+ 'muted-foreground': '#71717a',
101
+ // Accent colors
102
+ accent: '#f4f4f5',
103
+ 'accent-foreground': '#18181b',
104
+ // Destructive
105
+ destructive: '#ef4444',
106
+ 'destructive-foreground': '#fafafa',
107
+ // Border and input
108
+ border: '#e4e4e7',
109
+ input: '#e4e4e7',
110
+ ring: '#18181b',
111
+ // Card
112
+ card: '#ffffff',
113
+ 'card-foreground': '#09090b',
114
+ // Popover
115
+ popover: '#ffffff',
116
+ 'popover-foreground': '#09090b',
117
+ },
118
+ fonts: {
119
+ sans: ['Inter', 'system-ui', 'sans-serif'],
120
+ mono: ['JetBrains Mono', 'monospace'],
121
+ },
122
+ tokens: {
123
+ borderRadius: {
124
+ sm: '0.25rem',
125
+ md: '0.375rem',
126
+ lg: '0.5rem',
127
+ xl: '0.75rem',
128
+ },
129
+ },
130
+ defaults: {
131
+ width: 1200,
132
+ height: 630,
133
+ },
134
+ paths: {
135
+ root: DEFAULT_LOOPWIND_DIR_NAME,
136
+ },
137
+ };
138
+ await fs.writeFile(configPath, JSON.stringify(sampleConfig, null, 2), 'utf-8');
139
+ }
140
+ /**
141
+ * Create config from detected Tailwind/shadcn settings
142
+ */
143
+ export async function createConfigFromDetected(detected) {
144
+ const configPath = path.join(CWD, CONFIG_FILE);
145
+ // Start with shadcn defaults
146
+ const config = {
147
+ colors: {},
148
+ fonts: {
149
+ sans: ['Inter', 'system-ui', 'sans-serif'],
150
+ mono: ['JetBrains Mono', 'monospace'],
151
+ },
152
+ tokens: {
153
+ borderRadius: {
154
+ sm: '0.25rem',
155
+ md: '0.375rem',
156
+ lg: '0.5rem',
157
+ xl: '0.75rem',
158
+ },
159
+ },
160
+ defaults: {
161
+ width: 1200,
162
+ height: 630,
163
+ },
164
+ paths: {
165
+ root: DEFAULT_LOOPWIND_DIR_NAME,
166
+ },
167
+ };
168
+ // Extract colors from Tailwind config if available
169
+ if (detected.jsColors) {
170
+ // Merge Tailwind colors into config
171
+ // Prefer shadcn semantic tokens, but include custom colors too
172
+ const tailwindColors = detected.jsColors;
173
+ // Map common color names to shadcn semantic tokens
174
+ config.colors = {
175
+ // Try to extract shadcn-style colors first
176
+ primary: tailwindColors.primary || '#18181b',
177
+ 'primary-foreground': tailwindColors['primary-foreground'] || '#fafafa',
178
+ secondary: tailwindColors.secondary || '#f4f4f5',
179
+ 'secondary-foreground': tailwindColors['secondary-foreground'] || '#18181b',
180
+ background: tailwindColors.background || '#ffffff',
181
+ foreground: tailwindColors.foreground || '#09090b',
182
+ muted: tailwindColors.muted || '#f4f4f5',
183
+ 'muted-foreground': tailwindColors['muted-foreground'] || '#71717a',
184
+ accent: tailwindColors.accent || '#f4f4f5',
185
+ 'accent-foreground': tailwindColors['accent-foreground'] || '#18181b',
186
+ destructive: tailwindColors.destructive || '#ef4444',
187
+ 'destructive-foreground': tailwindColors['destructive-foreground'] || '#fafafa',
188
+ border: tailwindColors.border || '#e4e4e7',
189
+ input: tailwindColors.input || '#e4e4e7',
190
+ ring: tailwindColors.ring || '#18181b',
191
+ card: tailwindColors.card || '#ffffff',
192
+ 'card-foreground': tailwindColors['card-foreground'] || '#09090b',
193
+ popover: tailwindColors.popover || '#ffffff',
194
+ 'popover-foreground': tailwindColors['popover-foreground'] || '#09090b',
195
+ // Include any other custom colors from Tailwind config
196
+ ...Object.fromEntries(Object.entries(tailwindColors)
197
+ .filter(([key]) => !key.includes('-foreground') && !['primary', 'secondary', 'background', 'foreground', 'muted', 'accent', 'destructive', 'border', 'input', 'ring', 'card', 'popover'].includes(key))
198
+ .filter(([_, value]) => typeof value === 'string') // Only string colors (not objects with shades)
199
+ ),
200
+ };
201
+ }
202
+ else {
203
+ // Use shadcn defaults (zinc theme)
204
+ config.colors = {
205
+ primary: '#18181b',
206
+ 'primary-foreground': '#fafafa',
207
+ secondary: '#f4f4f5',
208
+ 'secondary-foreground': '#18181b',
209
+ background: '#ffffff',
210
+ foreground: '#09090b',
211
+ muted: '#f4f4f5',
212
+ 'muted-foreground': '#71717a',
213
+ accent: '#f4f4f5',
214
+ 'accent-foreground': '#18181b',
215
+ destructive: '#ef4444',
216
+ 'destructive-foreground': '#fafafa',
217
+ border: '#e4e4e7',
218
+ input: '#e4e4e7',
219
+ ring: '#18181b',
220
+ card: '#ffffff',
221
+ 'card-foreground': '#09090b',
222
+ popover: '#ffffff',
223
+ 'popover-foreground': '#09090b',
224
+ };
225
+ }
226
+ // Write config file with a comment about the source
227
+ const configWithComment = {
228
+ $schema: 'https://loopwind.dev/schema.json',
229
+ _comment: detected.shadcn.hasShadcn
230
+ ? 'Generated from shadcn/ui components.json and tailwind.config'
231
+ : 'Generated from tailwind.config - customize as needed',
232
+ ...config,
233
+ };
234
+ await fs.writeFile(configPath, JSON.stringify(configWithComment, null, 2), 'utf-8');
235
+ }
236
+ /**
237
+ * Copy AGENTS.md file from default-templates to project
238
+ */
239
+ export async function createAgentsDoc() {
240
+ const paths = await getResolvedPaths();
241
+ const agentsPath = path.join(paths.root, 'AGENTS.md');
242
+ // Get path to source AGENTS.md in the package
243
+ const packageRoot = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
244
+ const sourceAgentsPath = path.join(packageRoot, 'default-templates', 'AGENTS.md');
245
+ // Copy the file
246
+ await fs.copyFile(sourceAgentsPath, agentsPath);
247
+ }
248
+ //# s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;YACf,IAAI,EAAE,SAAS;YACf,iBAAiB,EAAE,SAAS;YAC5B,OAAO,EAAE,SAAS;YAClB,oBAAoB,EAAE,SAAS;SAChC,CAAC;IACJ,CAAC;IAED,oDAAoD;IACpD,MAAM,iBAAiB,GAAG;QACxB,OAAO,EAAE,kCAAkC;QAC3C,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS;YACjC,CAAC,CAAC,8DAA8D;YAChE,CAAC,CAAC,sDAAsD;QAC1D,GAAG,MAAM;KACV,CAAC;IAEF,MAAM,EAAE,CAAC,SAAS,CAChB,UAAU,EACV,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,EAC1C,OAAO,CACR,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,KAAK,GAAG,MAAM,gBAAgB,EAAE,CAAC;IACvC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAEtD,8CAA8C;IAC9C,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAClF,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE,WAAW,CAAC,CAAC;IAElF,gBAAgB;IAChB,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const CWD: string;
2
+ export declare const DEFAULT_LOOPWIND_DIR_NAME = "_loopwind";
3
+ export declare const LOOPWIND_DIR: string;
4
+ export declare const TEMPLATES_DIR: string;
5
+ export declare const OUTPUT_DIR: string;
6
+ export declare const DEFAULT_REGISTRY = "https://loopwind.dev/r";
7
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG,QAAgB,CAAC;AAGjC,eAAO,MAAM,yBAAyB,cAAc,CAAC;AAGrD,eAAO,MAAM,YAAY,QAA4C,CAAC;AACtE,eAAO,MAAM,aAAa,QAAuC,CAAC;AAClE,eAAO,MAAM,UAAU,QAAqC,CAAC;AAG7D,eAAO,MAAM,gBAAgB,2BAA2B,CAAC"}
@@ -0,0 +1,12 @@
1
+ import path from 'path';
2
+ // Get current working directory (where user runs the command)
3
+ export const CWD = process.cwd();
4
+ // Default directory name (can be overridden in loopwind.json)
5
+ export const DEFAULT_LOOPWIND_DIR_NAME = '_loopwind';
6
+ // Project-local directories (defaults - can be overridden via config)
7
+ export const LOOPWIND_DIR = path.join(CWD, DEFAULT_LOOPWIND_DIR_NAME);
8
+ export const TEMPLATES_DIR = path.join(LOOPWIND_DIR, 'templates');
9
+ export const OUTPUT_DIR = path.join(LOOPWIND_DIR, 'outputs');
10
+ // Default registry URL
11
+ export const DEFAULT_REGISTRY = 'https://loopwind.dev/r';
12
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,8DAA8D;AAC9D,MAAM,CAAC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAEjC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,yBAAyB,GAAG,WAAW,CAAC;AAErD,sEAAsE;AACtE,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,yBAAyB,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;AAClE,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AAE7D,uBAAuB;AACvB,MAAM,CAAC,MAAM,gBAAgB,GAAG,wBAAwB,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * QR Code helper for templates
3
+ * Generates a data URI for a QR code from a string
4
+ */
5
+ export declare function qr(text: string, options?: {
6
+ width?: number;
7
+ margin?: number;
8
+ errorCorrectionLevel?: 'L' | 'M' | 'Q' | 'H';
9
+ color?: {
10
+ dark?: string;
11
+ light?: string;
12
+ };
13
+ }): Promise<string>;
14
+ /**
15
+ * Image helper for templates
16
+ * Converts an image file to a data URI
17
+ */
18
+ export declare function image(filePath: string): Promise<string>;
19
+ /**
20
+ * Pre-extract all frames from a video file
21
+ * This should be called during the discovery/pre-generation phase
22
+ */
23
+ export declare function extractVideoFramesForCache(filePath: string, fps: number): Promise<string[]>;
24
+ /**
25
+ * Video helper for templates
26
+ * Returns the appropriate video frame as a data URI based on current frame number
27
+ */
28
+ export declare function video(filePath: string, currentFrame: number, fps: number): Promise<string>;
29
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/lib/helpers.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAsB,EAAE,CACtB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC7C,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,GACA,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAED;;;GAGG;AACH,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoB7D;AA6FD;;;GAGG;AACH,wBAAsB,0BAA0B,CAC9C,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,EAAE,CAAC,CAEnB;AAED;;;GAGG;AACH,wBAAsB,KAAK,CACzB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CAajB"}