create-snapify-app 0.0.0-stage → 1.1.0

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 (614) hide show
  1. package/LICENSE.md +24 -0
  2. package/README.md +55 -2
  3. package/bin/create-snapify-app.mjs +174 -0
  4. package/lib/args.mjs +59 -0
  5. package/lib/copy.mjs +44 -0
  6. package/lib/env.mjs +84 -0
  7. package/lib/prompt.mjs +63 -0
  8. package/package.json +33 -4
  9. package/template/.env.example +79 -0
  10. package/template/.github/workflows/ci.yml +23 -0
  11. package/template/.github/workflows/deploy.yml +26 -0
  12. package/template/.github/workflows/ping.yml +8 -0
  13. package/template/.github/workflows/release.yml +67 -0
  14. package/template/.snapify-install.json +5 -0
  15. package/template/CHANGELOG.md +28 -0
  16. package/template/LICENSE +14 -0
  17. package/template/README.md +287 -0
  18. package/template/administrator.html +23 -0
  19. package/template/apps/client/src/App.tsx +765 -0
  20. package/template/apps/client/src/auth.css +400 -0
  21. package/template/apps/client/src/lib/api.ts +22 -0
  22. package/template/apps/client/src/main.tsx +20 -0
  23. package/template/apps/community/src/App.tsx +592 -0
  24. package/template/apps/community/src/main.tsx +20 -0
  25. package/template/apps/community/src/styles.css +24 -0
  26. package/template/apps/developers/src/App.tsx +643 -0
  27. package/template/apps/developers/src/main.tsx +17 -0
  28. package/template/apps/developers/src/pages.tsx +1587 -0
  29. package/template/apps/developers/src/styles.css +98 -0
  30. package/template/apps/developers/src/ui.tsx +179 -0
  31. package/template/apps/landing/src/App.tsx +598 -0
  32. package/template/apps/landing/src/LegalPages.tsx +158 -0
  33. package/template/apps/landing/src/OrderPage.tsx +381 -0
  34. package/template/apps/landing/src/SeoPages.tsx +923 -0
  35. package/template/apps/landing/src/copy.ts +195 -0
  36. package/template/apps/landing/src/main.tsx +20 -0
  37. package/template/apps/landing/src/styles.css +803 -0
  38. package/template/apps/landing/src/types.ts +19 -0
  39. package/template/apps/marketplace/src/App.tsx +1229 -0
  40. package/template/apps/marketplace/src/developer/DeveloperApp.tsx +1266 -0
  41. package/template/apps/marketplace/src/main.tsx +20 -0
  42. package/template/apps/marketplace/src/styles.css +1001 -0
  43. package/template/apps/shared/AuthContext.tsx +65 -0
  44. package/template/apps/shared/Logo.tsx +33 -0
  45. package/template/apps/shared/api.ts +47 -0
  46. package/template/apps/shared/ui.tsx +128 -0
  47. package/template/apps/superadmin/src/App.tsx +1264 -0
  48. package/template/apps/superadmin/src/lib/api.ts +20 -0
  49. package/template/apps/superadmin/src/lib/hooks.ts +20 -0
  50. package/template/apps/superadmin/src/main.tsx +16 -0
  51. package/template/apps/superadmin/src/pages/ClientsPage.tsx +185 -0
  52. package/template/apps/superadmin/src/pages/InvoicesPage.tsx +157 -0
  53. package/template/apps/superadmin/src/pages/NewsletterPage.tsx +212 -0
  54. package/template/apps/superadmin/src/pages/OrdersPage.tsx +195 -0
  55. package/template/apps/superadmin/src/pages/PaymentsPage.tsx +150 -0
  56. package/template/apps/superadmin/src/pages/PayoutsPage.tsx +133 -0
  57. package/template/apps/superadmin/src/pages/PublishersPage.tsx +151 -0
  58. package/template/apps/superadmin/src/pages/SeoControlPage.tsx +692 -0
  59. package/template/apps/superadmin/src/pages/SettingsPage.tsx +199 -0
  60. package/template/apps/superadmin/src/pages/SystemPage.tsx +109 -0
  61. package/template/apps/superadmin/src/pages/TicketsPage.tsx +201 -0
  62. package/template/apps/superadmin/src/pages/UsersPage.tsx +167 -0
  63. package/template/client.html +21 -0
  64. package/template/community/hamdiayari/akhbar/README.md +23 -0
  65. package/template/community/hamdiayari/akhbar/screenshot.jpg +0 -0
  66. package/template/community/hamdiayari/akhbar/snapify.theme.json +76 -0
  67. package/template/community/hamdiayari/akhbar/src/Brand.tsx +26 -0
  68. package/template/community/hamdiayari/akhbar/src/Footer.tsx +182 -0
  69. package/template/community/hamdiayari/akhbar/src/Header.tsx +191 -0
  70. package/template/community/hamdiayari/akhbar/src/Layout.tsx +49 -0
  71. package/template/community/hamdiayari/akhbar/src/Social.tsx +33 -0
  72. package/template/community/hamdiayari/akhbar/src/Ticker.tsx +86 -0
  73. package/template/community/hamdiayari/akhbar/src/Views.tsx +285 -0
  74. package/template/community/hamdiayari/akhbar/src/blocks/CollectionBlocks.tsx +672 -0
  75. package/template/community/hamdiayari/akhbar/src/blocks/ContentBlocks.tsx +305 -0
  76. package/template/community/hamdiayari/akhbar/src/blocks/ConversionBlocks.tsx +569 -0
  77. package/template/community/hamdiayari/akhbar/src/blocks/HeaderBlocks.tsx +287 -0
  78. package/template/community/hamdiayari/akhbar/src/index.tsx +51 -0
  79. package/template/community/hamdiayari/akhbar/src/kit.tsx +357 -0
  80. package/template/community/hamdiayari/akhbar/src/site.ts +96 -0
  81. package/template/community/hamdiayari/akhbar/src/styles.css +566 -0
  82. package/template/community/hamdiayari/akhbar-actualites/README.md +28 -0
  83. package/template/community/hamdiayari/akhbar-actualites/screenshot.jpg +0 -0
  84. package/template/community/hamdiayari/akhbar-actualites/snapify.module.json +107 -0
  85. package/template/community/hamdiayari/akhbar-actualites/src/admin/AudiencePage.tsx +185 -0
  86. package/template/community/hamdiayari/akhbar-actualites/src/admin/index.tsx +11 -0
  87. package/template/community/hamdiayari/akhbar-actualites/src/public/Archive.tsx +142 -0
  88. package/template/community/hamdiayari/akhbar-actualites/src/public/cards.tsx +152 -0
  89. package/template/community/hamdiayari/akhbar-actualites/src/public/index.tsx +71 -0
  90. package/template/community/hamdiayari/akhbar-actualites/src/public/posts.ts +103 -0
  91. package/template/community/hamdiayari/akhbar-actualites/src/public/styles.css +568 -0
  92. package/template/community/hamdiayari/akhbar-actualites/src/public/widgets.tsx +226 -0
  93. package/template/community/hamdiayari/akhbar-actualites/src/server.ts +119 -0
  94. package/template/community/hamdiayari/akhbar-actualites/src/types.ts +25 -0
  95. package/template/community/hamdiayari/akhbar-urgent/README.md +36 -0
  96. package/template/community/hamdiayari/akhbar-urgent/screenshot.jpg +0 -0
  97. package/template/community/hamdiayari/akhbar-urgent/snapify.module.json +64 -0
  98. package/template/community/hamdiayari/akhbar-urgent/src/admin/FlashesPage.tsx +229 -0
  99. package/template/community/hamdiayari/akhbar-urgent/src/admin/index.tsx +11 -0
  100. package/template/community/hamdiayari/akhbar-urgent/src/public/Ticker.tsx +81 -0
  101. package/template/community/hamdiayari/akhbar-urgent/src/public/index.tsx +63 -0
  102. package/template/community/hamdiayari/akhbar-urgent/src/public/styles.css +142 -0
  103. package/template/community/hamdiayari/akhbar-urgent/src/server.ts +101 -0
  104. package/template/community/hamdiayari/akhbar-urgent/src/types.ts +35 -0
  105. package/template/community.html +21 -0
  106. package/template/developers.html +24 -0
  107. package/template/docker-compose.db.yml +24 -0
  108. package/template/docs/BACKOFFICE_SNAPIFY.md +130 -0
  109. package/template/docs/CI_CD.md +66 -0
  110. package/template/docs/MODULES.md +346 -0
  111. package/template/docs/PLATFORM_DEPLOY.md +54 -0
  112. package/template/docs/logo.svg +10 -0
  113. package/template/drizzle/0000_init.sql +147 -0
  114. package/template/drizzle/0001_page_project.sql +5 -0
  115. package/template/drizzle/0002_modules.sql +23 -0
  116. package/template/drizzle/0003_themes.sql +4 -0
  117. package/template/drizzle/0004_security.sql +82 -0
  118. package/template/drizzle/0005_module_records.sql +16 -0
  119. package/template/drizzle/0006_avatars.sql +4 -0
  120. package/template/drizzle/0007_platform.sql +264 -0
  121. package/template/drizzle/0008_mp_validation.sql +3 -0
  122. package/template/drizzle/0009_saas_ops.sql +77 -0
  123. package/template/drizzle/0010_cms_chrome.sql +13 -0
  124. package/template/drizzle/0011_client_portal.sql +26 -0
  125. package/template/drizzle/meta/0000_snapshot.json +998 -0
  126. package/template/drizzle/meta/0001_snapshot.json +1004 -0
  127. package/template/drizzle/meta/_journal.json +90 -0
  128. package/template/drizzle.config.ts +16 -0
  129. package/template/ecosystem.snapify.cjs +24 -0
  130. package/template/for.html +1 -0
  131. package/template/index.html +29 -0
  132. package/template/landing.html +37 -0
  133. package/template/marketplace/catalog.json +373 -0
  134. package/template/marketplace/gallery/hamdiayari.preveris/01-home.jpg +0 -0
  135. package/template/marketplace/gallery/hamdiayari.recaptcha/01-reglages.jpg +0 -0
  136. package/template/marketplace/gallery/hamdiayari.recaptcha/02-logo.jpg +0 -0
  137. package/template/marketplace/gallery/novalabs.ai-articles/01-generer.jpg +0 -0
  138. package/template/marketplace/gallery/novalabs.ai-articles/02-fournisseur-ia.jpg +0 -0
  139. package/template/marketplace/gallery/novalabs.calendar/01-agenda-site.jpg +0 -0
  140. package/template/marketplace/gallery/novalabs.calendar/02-evenements-admin.jpg +0 -0
  141. package/template/marketplace/gallery/novalabs.calendar/03-reglages.jpg +0 -0
  142. package/template/marketplace/screenshots/hamdiayari.preveris-1.0.6.jpg +0 -0
  143. package/template/marketplace/screenshots/hamdiayari.recaptcha-1.0.0.jpg +0 -0
  144. package/template/marketplace/screenshots/hamdiayari.wp-seo-migrator-1.1.1.jpg +0 -0
  145. package/template/marketplace/screenshots/novalabs.ai-articles-1.0.1.jpg +0 -0
  146. package/template/marketplace/screenshots/novalabs.ai-chat-1.0.1.jpg +0 -0
  147. package/template/marketplace/screenshots/novalabs.calendar-1.0.1.jpg +0 -0
  148. package/template/marketplace/screenshots/novalabs.cart-1.0.0.jpg +0 -0
  149. package/template/marketplace/screenshots/novalabs.checkout-1.0.0.jpg +0 -0
  150. package/template/marketplace/screenshots/novalabs.customers-1.1.0.jpg +0 -0
  151. package/template/marketplace/screenshots/novalabs.dogga-1.0.0.jpg +0 -0
  152. package/template/marketplace/screenshots/novalabs.mahdia-1.0.0.jpg +0 -0
  153. package/template/marketplace/screenshots/novalabs.shop-1.0.0.jpg +0 -0
  154. package/template/marketplace/screenshots/novalabs.sidibou-1.0.0.jpg +0 -0
  155. package/template/marketplace/screenshots/novalabs.whatsapp-1.0.1.jpg +0 -0
  156. package/template/marketplace.html +21 -0
  157. package/template/metadata.json +7 -0
  158. package/template/modules/ai-articles/screenshot.jpg +0 -0
  159. package/template/modules/ai-articles/snapify.module.json +74 -0
  160. package/template/modules/ai-articles/src/admin/ArticlesPage.tsx +162 -0
  161. package/template/modules/ai-articles/src/admin/GeneratePage.tsx +118 -0
  162. package/template/modules/ai-articles/src/admin/index.tsx +12 -0
  163. package/template/modules/ai-articles/src/public/index.tsx +119 -0
  164. package/template/modules/ai-articles/src/server.ts +287 -0
  165. package/template/modules/ai-articles/src/types.ts +30 -0
  166. package/template/modules/ai-chat/screenshot.jpg +0 -0
  167. package/template/modules/ai-chat/snapify.module.json +217 -0
  168. package/template/modules/ai-chat/src/public.tsx +198 -0
  169. package/template/modules/ai-chat/src/server.ts +142 -0
  170. package/template/modules/ai-theme-studio/README.md +15 -0
  171. package/template/modules/ai-theme-studio/screenshot.jpg +0 -0
  172. package/template/modules/ai-theme-studio/snapify.module.json +175 -0
  173. package/template/modules/ai-theme-studio/src/admin/HistoryPage.tsx +91 -0
  174. package/template/modules/ai-theme-studio/src/admin/StudioPage.tsx +414 -0
  175. package/template/modules/ai-theme-studio/src/admin/index.tsx +11 -0
  176. package/template/modules/ai-theme-studio/src/lib/images.ts +240 -0
  177. package/template/modules/ai-theme-studio/src/lib/llm.ts +123 -0
  178. package/template/modules/ai-theme-studio/src/lib/normalize.ts +714 -0
  179. package/template/modules/ai-theme-studio/src/lib/prompts.ts +198 -0
  180. package/template/modules/ai-theme-studio/src/server.ts +137 -0
  181. package/template/modules/ai-theme-studio/src/types.ts +112 -0
  182. package/template/modules/calendar/screenshot.jpg +0 -0
  183. package/template/modules/calendar/snapify.module.json +45 -0
  184. package/template/modules/calendar/src/admin/EventsPage.tsx +217 -0
  185. package/template/modules/calendar/src/admin/index.tsx +11 -0
  186. package/template/modules/calendar/src/public/index.tsx +231 -0
  187. package/template/modules/calendar/src/server.ts +143 -0
  188. package/template/modules/calendar/src/types.ts +25 -0
  189. package/template/modules/cart/screenshot.jpg +0 -0
  190. package/template/modules/cart/snapify.module.json +90 -0
  191. package/template/modules/cart/src/admin/index.tsx +265 -0
  192. package/template/modules/cart/src/public/CartPage.tsx +198 -0
  193. package/template/modules/cart/src/public/index.tsx +261 -0
  194. package/template/modules/cart/src/public/useQuote.ts +67 -0
  195. package/template/modules/cart/src/server.ts +148 -0
  196. package/template/modules/cart/src/types.ts +31 -0
  197. package/template/modules/checkout/screenshot.jpg +0 -0
  198. package/template/modules/checkout/snapify.module.json +264 -0
  199. package/template/modules/checkout/src/admin/OrderDetailPage.tsx +304 -0
  200. package/template/modules/checkout/src/admin/badges.tsx +28 -0
  201. package/template/modules/checkout/src/admin/index.tsx +236 -0
  202. package/template/modules/checkout/src/public/CheckoutPage.tsx +461 -0
  203. package/template/modules/checkout/src/public/OrderPages.tsx +153 -0
  204. package/template/modules/checkout/src/public/index.tsx +23 -0
  205. package/template/modules/checkout/src/server.ts +383 -0
  206. package/template/modules/checkout/src/types.ts +70 -0
  207. package/template/modules/customers/screenshot.jpg +0 -0
  208. package/template/modules/customers/snapify.module.json +115 -0
  209. package/template/modules/customers/src/admin/CustomerDetailPage.tsx +274 -0
  210. package/template/modules/customers/src/admin/index.tsx +194 -0
  211. package/template/modules/customers/src/public/AccountPages.tsx +470 -0
  212. package/template/modules/customers/src/public/AddressForm.tsx +115 -0
  213. package/template/modules/customers/src/public/AuthPages.tsx +349 -0
  214. package/template/modules/customers/src/public/Avatar.tsx +29 -0
  215. package/template/modules/customers/src/public/ProfileSection.tsx +291 -0
  216. package/template/modules/customers/src/public/index.tsx +137 -0
  217. package/template/modules/customers/src/public/session.ts +51 -0
  218. package/template/modules/customers/src/server.ts +421 -0
  219. package/template/modules/customers/src/types.ts +53 -0
  220. package/template/modules/recaptcha/logo.jpg +0 -0
  221. package/template/modules/recaptcha/screenshot.jpg +0 -0
  222. package/template/modules/recaptcha/snapify.module.json +99 -0
  223. package/template/modules/recaptcha/src/public/index.tsx +94 -0
  224. package/template/modules/recaptcha/src/server.ts +65 -0
  225. package/template/modules/recaptcha/src/types.ts +18 -0
  226. package/template/modules/shop/screenshot.jpg +0 -0
  227. package/template/modules/shop/snapify.module.json +340 -0
  228. package/template/modules/shop/src/admin/CategoriesPage.tsx +224 -0
  229. package/template/modules/shop/src/admin/ProductEditor.tsx +313 -0
  230. package/template/modules/shop/src/admin/ProductsPage.tsx +307 -0
  231. package/template/modules/shop/src/admin/index.tsx +14 -0
  232. package/template/modules/shop/src/public/Catalog.tsx +244 -0
  233. package/template/modules/shop/src/public/NotFound.tsx +22 -0
  234. package/template/modules/shop/src/public/ProductPage.tsx +195 -0
  235. package/template/modules/shop/src/public/index.tsx +134 -0
  236. package/template/modules/shop/src/public/useFetch.ts +26 -0
  237. package/template/modules/shop/src/server.ts +493 -0
  238. package/template/modules/shop/src/shared.ts +41 -0
  239. package/template/modules/shop/src/types.ts +60 -0
  240. package/template/modules/whatsapp/screenshot.jpg +0 -0
  241. package/template/modules/whatsapp/snapify.module.json +121 -0
  242. package/template/modules/whatsapp/src/public.tsx +119 -0
  243. package/template/modules/wp-seo-migrator/ARCHITECTURE.md +113 -0
  244. package/template/modules/wp-seo-migrator/README.md +21 -0
  245. package/template/modules/wp-seo-migrator/fixtures/aioseo-sample.csv +3 -0
  246. package/template/modules/wp-seo-migrator/fixtures/sample-exporter.json +39 -0
  247. package/template/modules/wp-seo-migrator/fixtures/sample-page.html +12 -0
  248. package/template/modules/wp-seo-migrator/fixtures/sample.htaccess +3 -0
  249. package/template/modules/wp-seo-migrator/screenshot.jpg +0 -0
  250. package/template/modules/wp-seo-migrator/snapify.module.json +87 -0
  251. package/template/modules/wp-seo-migrator/src/admin/HistoryPage.tsx +64 -0
  252. package/template/modules/wp-seo-migrator/src/admin/WizardPage.tsx +788 -0
  253. package/template/modules/wp-seo-migrator/src/admin/i18n.ts +156 -0
  254. package/template/modules/wp-seo-migrator/src/admin/index.tsx +11 -0
  255. package/template/modules/wp-seo-migrator/src/connectors/CUSTOM_CONNECTOR.md +31 -0
  256. package/template/modules/wp-seo-migrator/src/connectors/csvSeoFactory.ts +106 -0
  257. package/template/modules/wp-seo-migrator/src/connectors/exporter.ts +96 -0
  258. package/template/modules/wp-seo-migrator/src/connectors/gscCsv.ts +53 -0
  259. package/template/modules/wp-seo-migrator/src/connectors/htaccess.ts +65 -0
  260. package/template/modules/wp-seo-migrator/src/connectors/htmlCrawler.ts +90 -0
  261. package/template/modules/wp-seo-migrator/src/connectors/index.ts +113 -0
  262. package/template/modules/wp-seo-migrator/src/connectors/pluginCsv.ts +77 -0
  263. package/template/modules/wp-seo-migrator/src/connectors/rankMathCsv.ts +77 -0
  264. package/template/modules/wp-seo-migrator/src/connectors/redirection.ts +62 -0
  265. package/template/modules/wp-seo-migrator/src/connectors/sitemap.ts +44 -0
  266. package/template/modules/wp-seo-migrator/src/connectors/utils.ts +111 -0
  267. package/template/modules/wp-seo-migrator/src/connectors/wxr.ts +103 -0
  268. package/template/modules/wp-seo-migrator/src/connectors/yoastCsv.ts +56 -0
  269. package/template/modules/wp-seo-migrator/src/pipeline/analyze.ts +158 -0
  270. package/template/modules/wp-seo-migrator/src/pipeline/htmlParse.ts +58 -0
  271. package/template/modules/wp-seo-migrator/src/pipeline/remoteAuto.ts +328 -0
  272. package/template/modules/wp-seo-migrator/src/server.ts +492 -0
  273. package/template/modules/wp-seo-migrator/src/types.ts +151 -0
  274. package/template/modules/wp-seo-migrator/tests/connectors-extra.test.ts +39 -0
  275. package/template/modules/wp-seo-migrator/tests/merge.test.ts +25 -0
  276. package/template/package-lock.json +6016 -0
  277. package/template/package.json +74 -0
  278. package/template/public/images/photos/caravane-chameaux-desert.webp +0 -0
  279. package/template/public/images/photos/hammamet-medina-plage.jpg +0 -0
  280. package/template/public/images/photos/maison-campagne-collines.webp +0 -0
  281. package/template/public/images/photos/maisons-troglodytes-desert.jpg +0 -0
  282. package/template/public/images/photos/panorama-ville.jpg +0 -0
  283. package/template/public/images/photos/preveris-accessibilite-erp.jpg +0 -0
  284. package/template/public/images/photos/preveris-collectivites.jpg +0 -0
  285. package/template/public/images/photos/preveris-etudes-plans.jpg +0 -0
  286. package/template/public/images/photos/preveris-hero-erp.jpg +0 -0
  287. package/template/public/images/photos/preveris-ssi-incendie.jpg +0 -0
  288. package/template/public/images/photos/preveris-suivi-hotel.jpg +0 -0
  289. package/template/public/images/photos/ruelle-bleue-medina.jpg +0 -0
  290. package/template/public/images/photos/sidi-bou-said-port.webp +0 -0
  291. package/template/public/images/photos/terrasse-blanche-mer-voilier.jpg +0 -0
  292. package/template/public/landing/hero-ai-cms.jpg +0 -0
  293. package/template/public/landing/shot-dogga.jpg +0 -0
  294. package/template/public/landing/shot-mahdia.jpg +0 -0
  295. package/template/public/landing/shot-sidibou.jpg +0 -0
  296. package/template/public/llms.txt +35 -0
  297. package/template/public/logo.svg +10 -0
  298. package/template/scripts/app-pack.ts +155 -0
  299. package/template/scripts/app-publish.ts +100 -0
  300. package/template/scripts/apply-ecommerce-home.ts +196 -0
  301. package/template/scripts/auto-deploy-poll.sh +13 -0
  302. package/template/scripts/db-backup.sh +16 -0
  303. package/template/scripts/db-restore.sh +11 -0
  304. package/template/scripts/deploy.sh +34 -0
  305. package/template/scripts/github-webhook-deploy.sh +7 -0
  306. package/template/scripts/install-new-modules.ts +96 -0
  307. package/template/scripts/refresh-demo-baseline.ts +9 -0
  308. package/template/scripts/reinstall-marketplace-packs.ts +51 -0
  309. package/template/scripts/restore-classic-home.ts +13 -0
  310. package/template/scripts/sdk-pack.ts +289 -0
  311. package/template/scripts/sdk-publish.ts +75 -0
  312. package/template/scripts/seed-demo-products.ts +120 -0
  313. package/template/scripts/seed-theme-content-packs.ts +42 -0
  314. package/template/scripts/snapify-module.ts +207 -0
  315. package/template/scripts/test-theme-switch.ts +24 -0
  316. package/template/sdk/admin.css +18 -0
  317. package/template/sdk/admin.ts +95 -0
  318. package/template/sdk/build.ts +249 -0
  319. package/template/sdk/commerce.ts +512 -0
  320. package/template/sdk/content.ts +76 -0
  321. package/template/sdk/icons.ts +101 -0
  322. package/template/sdk/image.ts +60 -0
  323. package/template/sdk/index.ts +500 -0
  324. package/template/sdk/package.ts +298 -0
  325. package/template/sdk/recaptcha.tsx +122 -0
  326. package/template/sdk/settings.ts +84 -0
  327. package/template/sdk/theme.css +29 -0
  328. package/template/sdk/theme.ts +100 -0
  329. package/template/sdk/ui/commerce.tsx +385 -0
  330. package/template/sdk/ui/orders.tsx +136 -0
  331. package/template/sdk-kit/CHANGELOG.md +17 -0
  332. package/template/sdk-kit/LICENSE.md +47 -0
  333. package/template/sdk-kit/README.md +81 -0
  334. package/template/sdk-kit/cli.ts +339 -0
  335. package/template/sdk-kit/create-snapify/README.md +28 -0
  336. package/template/sdk-kit/create-snapify/create-snapify.mjs +11 -0
  337. package/template/sdk-kit/create-snapify/package.template.json +16 -0
  338. package/template/sdk-kit/package.template.json +95 -0
  339. package/template/sdk-kit/templates/common/README.md.tpl +27 -0
  340. package/template/sdk-kit/templates/common/_gitignore +3 -0
  341. package/template/sdk-kit/templates/common/package.json.tpl +19 -0
  342. package/template/sdk-kit/templates/common/src/snapify-env.d.ts +2 -0
  343. package/template/sdk-kit/templates/common/tsconfig.json +15 -0
  344. package/template/sdk-kit/templates/module/snapify.module.json.tpl +33 -0
  345. package/template/sdk-kit/templates/module/src/admin.tsx +53 -0
  346. package/template/sdk-kit/templates/module/src/public.tsx +49 -0
  347. package/template/sdk-kit/templates/module/src/server.ts +30 -0
  348. package/template/sdk-kit/templates/module/src/types.ts +19 -0
  349. package/template/sdk-kit/templates/theme/snapify.theme.json.tpl +22 -0
  350. package/template/sdk-kit/templates/theme/src/Footer.tsx +40 -0
  351. package/template/sdk-kit/templates/theme/src/Header.tsx +47 -0
  352. package/template/sdk-kit/templates/theme/src/Views.tsx +36 -0
  353. package/template/sdk-kit/templates/theme/src/blocks.tsx +93 -0
  354. package/template/sdk-kit/templates/theme/src/index.tsx +30 -0
  355. package/template/sdk-kit/templates/theme/src/site.tsx +59 -0
  356. package/template/sdk-kit/templates/theme/src/styles.css +71 -0
  357. package/template/server/client/routes.ts +252 -0
  358. package/template/server/cms/analyticsStore.ts +180 -0
  359. package/template/server/cms/auth.ts +155 -0
  360. package/template/server/cms/blockCatalog.ts +342 -0
  361. package/template/server/cms/blocks.ts +521 -0
  362. package/template/server/cms/contentMigration.ts +1119 -0
  363. package/template/server/cms/defaults.ts +303 -0
  364. package/template/server/cms/permissions.ts +154 -0
  365. package/template/server/cms/restoreClassicHome.ts +183 -0
  366. package/template/server/cms/revisions.ts +99 -0
  367. package/template/server/cms/scheduler.ts +78 -0
  368. package/template/server/cms/seed.ts +72 -0
  369. package/template/server/cms/seoAnalyzer.ts +213 -0
  370. package/template/server/cms/store.ts +122 -0
  371. package/template/server/cms/themeContent.ts +1386 -0
  372. package/template/server/cms/themePacks/sidibou-branding.json +1 -0
  373. package/template/server/cms/themePacks/sidibou-home.json +1 -0
  374. package/template/server/cms/themePacks/sidibou-menus.json +1 -0
  375. package/template/server/cms/types.ts +432 -0
  376. package/template/server/community/routes.ts +410 -0
  377. package/template/server/db/client.ts +43 -0
  378. package/template/server/db/repository.ts +389 -0
  379. package/template/server/db/schema.ts +726 -0
  380. package/template/server/demo/cmsReset.ts +196 -0
  381. package/template/server/developers/sdk.ts +85 -0
  382. package/template/server/geoip.ts +15 -0
  383. package/template/server/http.ts +53 -0
  384. package/template/server/mail.ts +216 -0
  385. package/template/server/marketplace/catalog.ts +74 -0
  386. package/template/server/marketplace/packageValidate.ts +475 -0
  387. package/template/server/marketplace/payments.ts +193 -0
  388. package/template/server/marketplace/routes.ts +850 -0
  389. package/template/server/marketplace/signing.ts +116 -0
  390. package/template/server/marketplace/syncOfficial.ts +282 -0
  391. package/template/server/media/images.ts +63 -0
  392. package/template/server/middleware/adminAuth.ts +134 -0
  393. package/template/server/modules/legacy.ts +44 -0
  394. package/template/server/modules/manager.ts +1122 -0
  395. package/template/server/modules/marketplace.ts +178 -0
  396. package/template/server/modules/outbound.ts +178 -0
  397. package/template/server/modules/purchases.ts +149 -0
  398. package/template/server/modules/records.ts +168 -0
  399. package/template/server/modules/themeHtml.ts +32 -0
  400. package/template/server/modules/trust.ts +16 -0
  401. package/template/server/modules/types.ts +147 -0
  402. package/template/server/platform/auth.ts +223 -0
  403. package/template/server/platform/clientWelcome.ts +168 -0
  404. package/template/server/platform/clients.ts +139 -0
  405. package/template/server/platform/dailyImprove.ts +356 -0
  406. package/template/server/platform/flouci.ts +126 -0
  407. package/template/server/platform/host.ts +69 -0
  408. package/template/server/platform/hostingProviders.ts +143 -0
  409. package/template/server/platform/licenseOrders.ts +291 -0
  410. package/template/server/platform/money.ts +42 -0
  411. package/template/server/platform/passwords.ts +41 -0
  412. package/template/server/platform/region.ts +86 -0
  413. package/template/server/platform/routes.ts +225 -0
  414. package/template/server/platform/seed.ts +82 -0
  415. package/template/server/platform/settings.ts +72 -0
  416. package/template/server/routes/adminAccount.ts +403 -0
  417. package/template/server/routes/adminCms.ts +808 -0
  418. package/template/server/routes/adminSystem.ts +243 -0
  419. package/template/server/routes/adminUsers.ts +449 -0
  420. package/template/server/routes/googleOAuth.ts +327 -0
  421. package/template/server/routes/modules.ts +323 -0
  422. package/template/server/routes/publicCms.ts +313 -0
  423. package/template/server/routes/seoPublic.ts +158 -0
  424. package/template/server/security/accounts.ts +121 -0
  425. package/template/server/security/audit.ts +143 -0
  426. package/template/server/security/authTokens.ts +74 -0
  427. package/template/server/security/ip.ts +68 -0
  428. package/template/server/security/rateLimit.ts +85 -0
  429. package/template/server/security/retention.ts +46 -0
  430. package/template/server/security/secrets.ts +44 -0
  431. package/template/server/security/sessions.ts +140 -0
  432. package/template/server/security/totp.ts +101 -0
  433. package/template/server/superadmin/analytics.ts +109 -0
  434. package/template/server/superadmin/auth.ts +92 -0
  435. package/template/server/superadmin/backlinksCatalog.ts +210 -0
  436. package/template/server/superadmin/frSeoContent.ts +165 -0
  437. package/template/server/superadmin/landingSeo.ts +675 -0
  438. package/template/server/superadmin/ops.ts +238 -0
  439. package/template/server/superadmin/routes.ts +1095 -0
  440. package/template/server/superadmin/tnSeoContent.ts +130 -0
  441. package/template/server.ts +522 -0
  442. package/template/src/App.tsx +263 -0
  443. package/template/src/admin/AdminApp.tsx +162 -0
  444. package/template/src/admin/account/AuthLayout.tsx +57 -0
  445. package/template/src/admin/account/SecurityForms.tsx +276 -0
  446. package/template/src/admin/admin.css +127 -0
  447. package/template/src/admin/context/AuthContext.tsx +147 -0
  448. package/template/src/admin/context/SiteContext.tsx +50 -0
  449. package/template/src/admin/editor/BlockLibrary.tsx +173 -0
  450. package/template/src/admin/editor/BlocksPanel.tsx +396 -0
  451. package/template/src/admin/editor/EditorBits.tsx +106 -0
  452. package/template/src/admin/editor/PreviewFrame.tsx +145 -0
  453. package/template/src/admin/editor/RichTextEditor.tsx +276 -0
  454. package/template/src/admin/editor/SeoPanel.tsx +349 -0
  455. package/template/src/admin/editor/StyleEditor.tsx +114 -0
  456. package/template/src/admin/editor/blockSchemas.ts +699 -0
  457. package/template/src/admin/editor/fields.tsx +486 -0
  458. package/template/src/admin/layout/AdminShell.tsx +418 -0
  459. package/template/src/admin/layout/nav.ts +95 -0
  460. package/template/src/admin/lib/api.ts +408 -0
  461. package/template/src/admin/lib/audit.ts +141 -0
  462. package/template/src/admin/lib/format.ts +84 -0
  463. package/template/src/admin/lib/hooks.ts +125 -0
  464. package/template/src/admin/main.tsx +16 -0
  465. package/template/src/admin/modules/InstallDialog.tsx +160 -0
  466. package/template/src/admin/modules/SettingsForm.tsx +145 -0
  467. package/template/src/admin/modules/kit.tsx +127 -0
  468. package/template/src/admin/modules/labels.tsx +226 -0
  469. package/template/src/admin/pages/AccountSetupPage.tsx +62 -0
  470. package/template/src/admin/pages/AnalyticsPage.tsx +206 -0
  471. package/template/src/admin/pages/BrandingPage.tsx +154 -0
  472. package/template/src/admin/pages/DashboardPage.tsx +239 -0
  473. package/template/src/admin/pages/EngagementPage.tsx +168 -0
  474. package/template/src/admin/pages/FormsPage.tsx +435 -0
  475. package/template/src/admin/pages/GeneralPage.tsx +120 -0
  476. package/template/src/admin/pages/LoginPage.tsx +249 -0
  477. package/template/src/admin/pages/MaintenancePage.tsx +125 -0
  478. package/template/src/admin/pages/MarketplacePage.tsx +426 -0
  479. package/template/src/admin/pages/MediaPage.tsx +251 -0
  480. package/template/src/admin/pages/MenusPage.tsx +446 -0
  481. package/template/src/admin/pages/ModuleAdminPage.tsx +113 -0
  482. package/template/src/admin/pages/ModuleDetailPage.tsx +293 -0
  483. package/template/src/admin/pages/ModulesPage.tsx +135 -0
  484. package/template/src/admin/pages/NewsletterPage.tsx +193 -0
  485. package/template/src/admin/pages/PageEditorPage.tsx +322 -0
  486. package/template/src/admin/pages/PagesListPage.tsx +277 -0
  487. package/template/src/admin/pages/PostEditorPage.tsx +292 -0
  488. package/template/src/admin/pages/PostsListPage.tsx +187 -0
  489. package/template/src/admin/pages/ProfilePage.tsx +489 -0
  490. package/template/src/admin/pages/ResetPasswordPage.tsx +110 -0
  491. package/template/src/admin/pages/SeoPage.tsx +670 -0
  492. package/template/src/admin/pages/SettingsPage.tsx +189 -0
  493. package/template/src/admin/pages/ThemeCustomizePage.tsx +170 -0
  494. package/template/src/admin/pages/ThemesPage.tsx +292 -0
  495. package/template/src/admin/pages/UsersPage.tsx +57 -0
  496. package/template/src/admin/pages/WidgetsPage.tsx +200 -0
  497. package/template/src/admin/seo/GoogleSetup.tsx +529 -0
  498. package/template/src/admin/settings/EmailTab.tsx +293 -0
  499. package/template/src/admin/settings/OtherTabs.tsx +270 -0
  500. package/template/src/admin/settings/SecurityTab.tsx +172 -0
  501. package/template/src/admin/settings/controls.tsx +133 -0
  502. package/template/src/admin/ui/Pagination.tsx +170 -0
  503. package/template/src/admin/ui/SaveBar.tsx +77 -0
  504. package/template/src/admin/ui/TagInput.tsx +54 -0
  505. package/template/src/admin/ui/charts.tsx +108 -0
  506. package/template/src/admin/ui/media.tsx +265 -0
  507. package/template/src/admin/ui/overlays.tsx +239 -0
  508. package/template/src/admin/ui/primitives.tsx +544 -0
  509. package/template/src/admin/users/AuditTab.tsx +104 -0
  510. package/template/src/admin/users/RolesTab.tsx +368 -0
  511. package/template/src/admin/users/UsersTab.tsx +723 -0
  512. package/template/src/admin/users/shared.tsx +278 -0
  513. package/template/src/cms/icons.ts +7 -0
  514. package/template/src/components/CookieBanner.tsx +166 -0
  515. package/template/src/components/MaintenanceGate.tsx +66 -0
  516. package/template/src/components/SiteAnalytics.tsx +64 -0
  517. package/template/src/components/SnapifyLogo.tsx +44 -0
  518. package/template/src/components/cms/BlockRenderer.tsx +154 -0
  519. package/template/src/components/cms/WidgetArea.tsx +193 -0
  520. package/template/src/context/SiteConfigContext.tsx +130 -0
  521. package/template/src/demoBase.ts +23 -0
  522. package/template/src/index.css +90 -0
  523. package/template/src/main.tsx +16 -0
  524. package/template/src/modules/ModuleHost.tsx +197 -0
  525. package/template/src/preview.ts +63 -0
  526. package/template/src/runtime.ts +38 -0
  527. package/template/src/themes/ThemeHost.tsx +168 -0
  528. package/template/src/themes/fallback.tsx +71 -0
  529. package/template/src/types.ts +94 -0
  530. package/template/src/views/BlogPostView.tsx +68 -0
  531. package/template/src/views/CmsPageView.tsx +34 -0
  532. package/template/start-pm2.sh +3 -0
  533. package/template/superadmin.html +20 -0
  534. package/template/themes/ai-canvas/screenshot.jpg +0 -0
  535. package/template/themes/ai-canvas/snapify.theme.json +96 -0
  536. package/template/themes/ai-canvas/src/CeeSimulator.tsx +247 -0
  537. package/template/themes/ai-canvas/src/Footer.tsx +190 -0
  538. package/template/themes/ai-canvas/src/Header.tsx +324 -0
  539. package/template/themes/ai-canvas/src/Layout.tsx +56 -0
  540. package/template/themes/ai-canvas/src/NotFound.tsx +58 -0
  541. package/template/themes/ai-canvas/src/Post.tsx +26 -0
  542. package/template/themes/ai-canvas/src/SnapifyLogo.tsx +44 -0
  543. package/template/themes/ai-canvas/src/blocks/CollectionBlocks.tsx +711 -0
  544. package/template/themes/ai-canvas/src/blocks/ContentBlocks.tsx +318 -0
  545. package/template/themes/ai-canvas/src/blocks/ConversionBlocks.tsx +559 -0
  546. package/template/themes/ai-canvas/src/blocks/HeaderBlocks.tsx +341 -0
  547. package/template/themes/ai-canvas/src/index.tsx +54 -0
  548. package/template/themes/ai-canvas/src/kit.tsx +398 -0
  549. package/template/themes/ai-canvas/src/site.ts +29 -0
  550. package/template/themes/ai-canvas/src/styles.css +317 -0
  551. package/template/themes/dogga/screenshot.jpg +0 -0
  552. package/template/themes/dogga/snapify.theme.json +55 -0
  553. package/template/themes/dogga/src/Brand.tsx +41 -0
  554. package/template/themes/dogga/src/Footer.tsx +202 -0
  555. package/template/themes/dogga/src/Header.tsx +239 -0
  556. package/template/themes/dogga/src/Layout.tsx +43 -0
  557. package/template/themes/dogga/src/Views.tsx +71 -0
  558. package/template/themes/dogga/src/blocks/CollectionBlocks.tsx +674 -0
  559. package/template/themes/dogga/src/blocks/ContentBlocks.tsx +307 -0
  560. package/template/themes/dogga/src/blocks/ConversionBlocks.tsx +571 -0
  561. package/template/themes/dogga/src/blocks/HeaderBlocks.tsx +289 -0
  562. package/template/themes/dogga/src/index.tsx +53 -0
  563. package/template/themes/dogga/src/kit.tsx +362 -0
  564. package/template/themes/dogga/src/site.ts +56 -0
  565. package/template/themes/dogga/src/styles.css +396 -0
  566. package/template/themes/mahdia/screenshot.jpg +0 -0
  567. package/template/themes/mahdia/snapify.theme.json +65 -0
  568. package/template/themes/mahdia/src/Brand.tsx +39 -0
  569. package/template/themes/mahdia/src/Footer.tsx +210 -0
  570. package/template/themes/mahdia/src/Header.tsx +291 -0
  571. package/template/themes/mahdia/src/Layout.tsx +44 -0
  572. package/template/themes/mahdia/src/Views.tsx +79 -0
  573. package/template/themes/mahdia/src/blocks/CollectionBlocks.tsx +674 -0
  574. package/template/themes/mahdia/src/blocks/ContentBlocks.tsx +307 -0
  575. package/template/themes/mahdia/src/blocks/ConversionBlocks.tsx +571 -0
  576. package/template/themes/mahdia/src/blocks/HeaderBlocks.tsx +289 -0
  577. package/template/themes/mahdia/src/index.tsx +53 -0
  578. package/template/themes/mahdia/src/kit.tsx +362 -0
  579. package/template/themes/mahdia/src/site.ts +75 -0
  580. package/template/themes/mahdia/src/styles.css +446 -0
  581. package/template/themes/preveris/screenshot.jpg +0 -0
  582. package/template/themes/preveris/snapify.theme.json +126 -0
  583. package/template/themes/preveris/src/Brand.tsx +44 -0
  584. package/template/themes/preveris/src/Footer.tsx +202 -0
  585. package/template/themes/preveris/src/Header.tsx +239 -0
  586. package/template/themes/preveris/src/Layout.tsx +42 -0
  587. package/template/themes/preveris/src/Views.tsx +71 -0
  588. package/template/themes/preveris/src/blocks/CollectionBlocks.tsx +678 -0
  589. package/template/themes/preveris/src/blocks/ContentBlocks.tsx +307 -0
  590. package/template/themes/preveris/src/blocks/ConversionBlocks.tsx +571 -0
  591. package/template/themes/preveris/src/blocks/HeaderBlocks.tsx +299 -0
  592. package/template/themes/preveris/src/index.tsx +53 -0
  593. package/template/themes/preveris/src/kit.tsx +365 -0
  594. package/template/themes/preveris/src/site.ts +79 -0
  595. package/template/themes/preveris/src/styles.css +446 -0
  596. package/template/themes/sidibou/screenshot.jpg +0 -0
  597. package/template/themes/sidibou/snapify.theme.json +21 -0
  598. package/template/themes/sidibou/src/CeeSimulator.tsx +247 -0
  599. package/template/themes/sidibou/src/Footer.tsx +203 -0
  600. package/template/themes/sidibou/src/Header.tsx +324 -0
  601. package/template/themes/sidibou/src/Layout.tsx +53 -0
  602. package/template/themes/sidibou/src/NotFound.tsx +58 -0
  603. package/template/themes/sidibou/src/Post.tsx +26 -0
  604. package/template/themes/sidibou/src/SnapifyLogo.tsx +44 -0
  605. package/template/themes/sidibou/src/blocks/CollectionBlocks.tsx +711 -0
  606. package/template/themes/sidibou/src/blocks/ContentBlocks.tsx +318 -0
  607. package/template/themes/sidibou/src/blocks/ConversionBlocks.tsx +559 -0
  608. package/template/themes/sidibou/src/blocks/HeaderBlocks.tsx +341 -0
  609. package/template/themes/sidibou/src/index.tsx +54 -0
  610. package/template/themes/sidibou/src/kit.tsx +398 -0
  611. package/template/themes/sidibou/src/site.ts +28 -0
  612. package/template/themes/sidibou/src/styles.css +317 -0
  613. package/template/tsconfig.json +33 -0
  614. package/template/vite.config.ts +42 -0
@@ -0,0 +1,156 @@
1
+ export type Lang = 'fr' | 'en' | 'ar';
2
+
3
+ const fr = {
4
+ title: 'Migrer le SEO WordPress',
5
+ sub: 'Trois minutes : on lit votre site tout seuls, vous validez, on importe.',
6
+ step1: 'Site',
7
+ step2: 'Analyse',
8
+ step3: 'Vérifier',
9
+ step4: 'Terminé',
10
+ howTitle: 'Comment ça marche ?',
11
+ how1: 'Collez l’adresse de votre site WordPress',
12
+ how2: 'On récupère titres, descriptions et redirections automatiquement',
13
+ how3: 'Vous validez, puis un clic pour migrer vers Snapify',
14
+ siteUrl: 'Adresse de votre site',
15
+ sitePh: 'https://www.monsite.tn',
16
+ siteHint: 'Commencez par https:// — pas besoin d’export ni de plugin.',
17
+ analyze: 'Lancer l’analyse',
18
+ analyzing: 'Analyse en cours…',
19
+ analyzingHint: 'Vous pouvez laisser cette page ouverte. On vous prévient dès que c’est prêt.',
20
+ waitConnect: 'Connexion au site',
21
+ waitApi: 'Lecture WordPress',
22
+ waitSitemap: 'Plan du site',
23
+ waitPages: 'Pages & articles',
24
+ waitFtp: 'Fichiers serveur (FTP)',
25
+ advanced: 'Le site refuse l’accès ? Options avancées',
26
+ advancedHint: 'Seulement si l’analyse simple échoue. La plupart des sites n’en ont pas besoin.',
27
+ wpUser: 'Identifiant WordPress',
28
+ wpPass: 'Mot de passe d’application',
29
+ wpPassHelp: 'WordPress → Utilisateurs → Votre profil → « Mots de passe d’application ». Ce n’est pas le mot de passe de connexion habituel.',
30
+ ftpTitle: 'Accès FTP (optionnel)',
31
+ ftpHint: 'Utile pour récupérer le fichier .htaccess (redirections serveur).',
32
+ ftpHost: 'Serveur FTP',
33
+ ftpUser: 'Utilisateur FTP',
34
+ ftpPass: 'Mot de passe FTP',
35
+ ftpRoot: 'Dossier du site',
36
+ ftpSecure: 'Connexion FTPS sécurisée',
37
+ expert: 'Dernier recours : fichier d’export',
38
+ upload: 'Téléverser un fichier',
39
+ uploadHelp: 'Export WordPress, CSV Yoast/Rank Math, ou JSON — uniquement si la connexion auto a échoué.',
40
+ downloadPlugin: 'Télécharger le mini-plugin Exporter',
41
+ pluginHelp: 'À installer sur WordPress seulement si le site bloque complètement l’accès public.',
42
+ cancel: 'Annuler',
43
+ next: 'Continuer',
44
+ back: 'Retour',
45
+ migrate: 'Migrer mon SEO',
46
+ migrateHint: 'Rien n’est destructif : on met à jour le SEO et on ajoute des redirections 301.',
47
+ coverage: 'SEO récupérable',
48
+ fix: 'Corriger automatiquement',
49
+ beforeAfter: 'Aperçu sur quelques pages',
50
+ dnsTitle: 'Ensuite, côté nom de domaine',
51
+ done: 'Migration terminée',
52
+ report: 'Télécharger le rapport',
53
+ applying: 'Migration en cours…',
54
+ needUrl: 'Indiquez l’adresse de votre site (https://…).',
55
+ analyzeFail: 'Analyse échouée',
56
+ analyzeOk: 'Analyse prête',
57
+ foundSources: 'Sources détectées',
58
+ contents: 'Contenus',
59
+ redirects: 'Redirections',
60
+ retry: 'Réessayer',
61
+ startOver: 'Recommencer',
62
+ };
63
+
64
+ const en: typeof fr = {
65
+ ...fr,
66
+ title: 'Migrate WordPress SEO',
67
+ sub: 'Three minutes: we read your site, you review, we import.',
68
+ step1: 'Site',
69
+ step2: 'Analysis',
70
+ step3: 'Review',
71
+ step4: 'Done',
72
+ howTitle: 'How it works',
73
+ how1: 'Paste your WordPress site URL',
74
+ how2: 'We fetch titles, descriptions and redirects automatically',
75
+ how3: 'You review, then one click to migrate into Snapify',
76
+ siteUrl: 'Your site URL',
77
+ siteHint: 'Start with https:// — no export or plugin needed.',
78
+ analyze: 'Start analysis',
79
+ analyzing: 'Analyzing…',
80
+ analyzingHint: 'Keep this page open. We’ll show results when ready.',
81
+ advanced: 'Site blocks access? Advanced options',
82
+ advancedHint: 'Only if the simple analysis fails. Most sites don’t need this.',
83
+ wpUser: 'WordPress username',
84
+ wpPass: 'Application password',
85
+ wpPassHelp: 'WordPress → Users → Profile → Application passwords. Not your normal login password.',
86
+ ftpTitle: 'FTP access (optional)',
87
+ ftpHint: 'Useful to fetch .htaccess redirects.',
88
+ ftpHost: 'FTP host',
89
+ ftpUser: 'FTP user',
90
+ ftpPass: 'FTP password',
91
+ ftpRoot: 'Site folder',
92
+ ftpSecure: 'Secure FTPS',
93
+ expert: 'Last resort: export file',
94
+ upload: 'Upload a file',
95
+ uploadHelp: 'Only if auto-connect failed.',
96
+ downloadPlugin: 'Download Exporter plugin',
97
+ cancel: 'Cancel',
98
+ next: 'Continue',
99
+ back: 'Back',
100
+ migrate: 'Migrate my SEO',
101
+ migrateHint: 'Non-destructive: we update SEO fields and add 301 redirects.',
102
+ coverage: 'Recoverable SEO',
103
+ fix: 'Auto-fix',
104
+ beforeAfter: 'Sample pages preview',
105
+ dnsTitle: 'Next: domain checklist',
106
+ done: 'Migration complete',
107
+ report: 'Download report',
108
+ applying: 'Migrating…',
109
+ needUrl: 'Enter your site URL (https://…).',
110
+ analyzeFail: 'Analysis failed',
111
+ analyzeOk: 'Analysis ready',
112
+ foundSources: 'Sources found',
113
+ contents: 'Content',
114
+ redirects: 'Redirects',
115
+ retry: 'Try again',
116
+ startOver: 'Start over',
117
+ };
118
+
119
+ const ar: typeof fr = {
120
+ ...fr,
121
+ title: 'ترحيل سيو ووردبريس',
122
+ sub: 'ثلاث دقائق: نقرأ موقعك تلقائياً ثم تُرحّل إلى Snapify.',
123
+ step1: 'الموقع',
124
+ step2: 'التحليل',
125
+ step3: 'مراجعة',
126
+ step4: 'تم',
127
+ howTitle: 'كيف يعمل؟',
128
+ how1: 'الصق عنوان موقع ووردبريس',
129
+ how2: 'نستخرج العناوين والوصف وإعادة التوجيه تلقائياً',
130
+ how3: 'تراجع ثم ترحّل بنقرة واحدة',
131
+ siteUrl: 'عنوان الموقع',
132
+ analyze: 'بدء التحليل',
133
+ analyzing: 'جاري التحليل…',
134
+ advanced: 'خيارات متقدمة',
135
+ cancel: 'إلغاء',
136
+ next: 'متابعة',
137
+ back: 'رجوع',
138
+ migrate: 'ترحيل السيو',
139
+ coverage: 'السيو القابل للاسترداد',
140
+ fix: 'إصلاح تلقائي',
141
+ done: 'اكتمل الترحيل',
142
+ report: 'تحميل التقرير',
143
+ needUrl: 'أدخل عنوان الموقع (https://…).',
144
+ analyzeFail: 'فشل التحليل',
145
+ analyzeOk: 'التحليل جاهز',
146
+ contents: 'المحتوى',
147
+ redirects: 'إعادة التوجيه',
148
+ retry: 'إعادة المحاولة',
149
+ startOver: 'البداية من جديد',
150
+ };
151
+
152
+ export function t(lang: Lang) {
153
+ if (lang === 'en') return en;
154
+ if (lang === 'ar') return ar;
155
+ return fr;
156
+ }
@@ -0,0 +1,11 @@
1
+ import { defineAdminModule } from '@snapify/sdk/admin';
2
+ import { WizardPage } from './WizardPage';
3
+ import { HistoryPage } from './HistoryPage';
4
+ import type { Settings } from '../types';
5
+
6
+ export default defineAdminModule<Settings>({
7
+ pages: {
8
+ wizard: WizardPage,
9
+ history: HistoryPage,
10
+ },
11
+ });
@@ -0,0 +1,31 @@
1
+ # Gabarit — connecteur SEO personnalisé (groupe G)
2
+
3
+ Tout connecteur implémente `SeoConnector` (`src/types.ts`) :
4
+
5
+ ```ts
6
+ import type { SeoConnector } from '../types';
7
+ import { pathFromUrl, slugFromPath } from './utils';
8
+ // ou createCsvSeoConnector depuis ./csvSeoFactory
9
+
10
+ export const monConnector: SeoConnector = {
11
+ id: 'mon-plugin', // unique, kebab-case
12
+ name: 'Mon plugin SEO',
13
+ fields: ['url', 'seoTitle', 'metaDescription'],
14
+ detect(ctx) {
15
+ const found = ctx.textFiles.some((f) => f.name.includes('mon-plugin'));
16
+ return { id: 'mon-plugin', name: 'Mon plugin SEO', found };
17
+ },
18
+ extract(ctx) {
19
+ return { records: [], redirects: [], warnings: [] };
20
+ },
21
+ };
22
+ ```
23
+
24
+ 1. Ajoutez le fichier dans `src/connectors/`.
25
+ 2. Enregistrez-le dans `CONNECTORS` (`src/connectors/index.ts`).
26
+ 3. Ajoutez une fixture + un test dans `tests/`.
27
+ 4. Rebuild / republiez le module (`npm run module -- build modules/wp-seo-migrator`).
28
+
29
+ Pour un CSV simple, préférez `createCsvSeoConnector({ id, name, detectHints, columns })`.
30
+
31
+ **Limite SDK** : pas d’hôte `net:` dynamique — un connecteur live REST vers un WordPress arbitraire nécessite une évolution core (`net:outbound` SSRF-safe) ; en attendant, fournissez un export fichier ou le plugin Snapify Exporter.
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Fabrique de connecteurs CSV SEO (Yoast-like, AIOSEO, SEOPress, Screaming Frog…).
3
+ * Gabarit réutilisable pour la communauté (groupe G).
4
+ */
5
+ import type { AnalyzeContext, ExtractResult, SeoConnector, SeoField, SeoRecord } from '../types';
6
+ import { csvIdx, parseCsv, pathFromUrl, slugFromPath } from './utils';
7
+
8
+ export type CsvColumnMap = {
9
+ url: string[];
10
+ seoTitle?: string[];
11
+ metaDescription?: string[];
12
+ focusKeyphrase?: string[];
13
+ canonicalUrl?: string[];
14
+ ogTitle?: string[];
15
+ ogDescription?: string[];
16
+ ogImage?: string[];
17
+ noindex?: string[];
18
+ };
19
+
20
+ export function createCsvSeoConnector(opts: {
21
+ id: string;
22
+ name: string;
23
+ /** Indices / noms de colonnes */
24
+ columns: CsvColumnMap;
25
+ /** Détection : noms de fichier ou en-têtes attendus */
26
+ detectHints: string[];
27
+ fields?: SeoField[];
28
+ }): SeoConnector {
29
+ const fields: SeoField[] = opts.fields || [
30
+ 'url',
31
+ 'seoTitle',
32
+ 'metaDescription',
33
+ 'focusKeyphrase',
34
+ 'canonicalUrl',
35
+ 'ogTitle',
36
+ 'ogDescription',
37
+ 'ogImage',
38
+ 'noindex',
39
+ ];
40
+
41
+ return {
42
+ id: opts.id,
43
+ name: opts.name,
44
+ fields,
45
+ detect: (ctx) => {
46
+ const hit = ctx.textFiles.some((f) => {
47
+ const head = f.text.slice(0, 600).toLowerCase();
48
+ const name = f.name.toLowerCase();
49
+ return opts.detectHints.some((h) => name.includes(h) || head.includes(h));
50
+ });
51
+ return { id: opts.id, name: opts.name, found: hit };
52
+ },
53
+ extract: (ctx: AnalyzeContext): ExtractResult => {
54
+ const records: SeoRecord[] = [];
55
+ const warnings: string[] = [];
56
+ for (const f of ctx.textFiles) {
57
+ if (!f.name.endsWith('.csv') && !f.text.includes(',')) continue;
58
+ const rows = parseCsv(f.text);
59
+ if (rows.length < 2) continue;
60
+ const header = rows[0];
61
+ const iUrl = csvIdx(header, ...opts.columns.url);
62
+ if (iUrl < 0) continue;
63
+ const iTitle = opts.columns.seoTitle ? csvIdx(header, ...opts.columns.seoTitle) : -1;
64
+ const iDesc = opts.columns.metaDescription ? csvIdx(header, ...opts.columns.metaDescription) : -1;
65
+ const iKw = opts.columns.focusKeyphrase ? csvIdx(header, ...opts.columns.focusKeyphrase) : -1;
66
+ const iCanon = opts.columns.canonicalUrl ? csvIdx(header, ...opts.columns.canonicalUrl) : -1;
67
+ const iOgT = opts.columns.ogTitle ? csvIdx(header, ...opts.columns.ogTitle) : -1;
68
+ const iOgD = opts.columns.ogDescription ? csvIdx(header, ...opts.columns.ogDescription) : -1;
69
+ const iOgI = opts.columns.ogImage ? csvIdx(header, ...opts.columns.ogImage) : -1;
70
+ const iNo = opts.columns.noindex ? csvIdx(header, ...opts.columns.noindex) : -1;
71
+
72
+ for (const r of rows.slice(1)) {
73
+ const url = (r[iUrl] || '').trim();
74
+ if (!url) continue;
75
+ const path = pathFromUrl(url);
76
+ const noRaw = iNo >= 0 ? (r[iNo] || '').toLowerCase() : '';
77
+ records.push({
78
+ id: `${opts.id}:${path}`,
79
+ kind: 'other',
80
+ url,
81
+ path,
82
+ slug: slugFromPath(path),
83
+ status: 'publish',
84
+ seoTitle: iTitle >= 0 ? r[iTitle] || undefined : undefined,
85
+ metaDescription: iDesc >= 0 ? r[iDesc] || undefined : undefined,
86
+ focusKeyphrase: iKw >= 0 ? r[iKw] || undefined : undefined,
87
+ canonicalUrl: iCanon >= 0 ? r[iCanon] || undefined : undefined,
88
+ ogTitle: iOgT >= 0 ? r[iOgT] || undefined : undefined,
89
+ ogDescription: iOgD >= 0 ? r[iOgD] || undefined : undefined,
90
+ ogImage: iOgI >= 0 ? r[iOgI] || undefined : undefined,
91
+ noindex: noRaw === '1' || noRaw === 'true' || noRaw === 'yes' || noRaw === 'noindex',
92
+ sources: {
93
+ url: opts.id,
94
+ seoTitle: iTitle >= 0 ? opts.id : undefined,
95
+ metaDescription: iDesc >= 0 ? opts.id : undefined,
96
+ focusKeyphrase: iKw >= 0 ? opts.id : undefined,
97
+ canonicalUrl: iCanon >= 0 ? opts.id : undefined,
98
+ },
99
+ });
100
+ }
101
+ }
102
+ if (!records.length) warnings.push(`${opts.name} : aucune ligne URL trouvée`);
103
+ return { records, redirects: [], warnings };
104
+ },
105
+ };
106
+ }
@@ -0,0 +1,96 @@
1
+ /**
2
+ * JSON produit par le plugin WordPress « Snapify Exporter ».
3
+ * Format : { format: 'snapify-wp-seo/1', site, plugins, records, redirects }
4
+ */
5
+ import type { AnalyzeContext, ExtractResult, RedirectRecord, SeoConnector, SeoRecord } from '../types';
6
+ import { pathFromUrl, safeJson, slugFromPath } from './utils';
7
+
8
+ type ExporterPayload = {
9
+ format?: string;
10
+ site?: { url?: string };
11
+ plugins?: { id: string; name: string; active?: boolean }[];
12
+ records?: Partial<SeoRecord>[];
13
+ redirects?: { from: string; to: string; permanent?: boolean }[];
14
+ };
15
+
16
+ export const exporterConnector: SeoConnector = {
17
+ id: 'snapify-exporter',
18
+ name: 'Plugin Snapify Exporter',
19
+ fields: [
20
+ 'url',
21
+ 'slug',
22
+ 'seoTitle',
23
+ 'metaDescription',
24
+ 'focusKeyphrase',
25
+ 'canonicalUrl',
26
+ 'noindex',
27
+ 'nofollow',
28
+ 'ogTitle',
29
+ 'ogDescription',
30
+ 'ogImage',
31
+ 'schemaJsonLd',
32
+ 'hreflang',
33
+ 'redirects',
34
+ ],
35
+ detect: (ctx) => {
36
+ const hit = ctx.textFiles.some((f) => {
37
+ const j = safeJson<ExporterPayload>(f.text);
38
+ return j?.format === 'snapify-wp-seo/1' || (Array.isArray(j?.records) && Array.isArray(j?.plugins));
39
+ });
40
+ return {
41
+ id: 'snapify-exporter',
42
+ name: 'Plugin Snapify Exporter',
43
+ found: hit,
44
+ detail: hit ? 'Export Snapify complet détecté' : undefined,
45
+ };
46
+ },
47
+ extract: (ctx: AnalyzeContext): ExtractResult => {
48
+ const records: SeoRecord[] = [];
49
+ const redirects: RedirectRecord[] = [];
50
+ const warnings: string[] = [];
51
+ for (const f of ctx.textFiles) {
52
+ const j = safeJson<ExporterPayload>(f.text);
53
+ if (!j || (j.format !== 'snapify-wp-seo/1' && !j.records)) continue;
54
+ for (const r of j.records || []) {
55
+ const url = String(r.url || '');
56
+ const path = r.path || pathFromUrl(url);
57
+ records.push({
58
+ id: String(r.id || `exp:${path}`),
59
+ kind: (r.kind as SeoRecord['kind']) || 'other',
60
+ url: url || path,
61
+ path,
62
+ slug: r.slug || slugFromPath(path),
63
+ status: (r.status as SeoRecord['status']) || 'publish',
64
+ title: r.title,
65
+ seoTitle: r.seoTitle,
66
+ metaDescription: r.metaDescription,
67
+ focusKeyphrase: r.focusKeyphrase,
68
+ canonicalUrl: r.canonicalUrl,
69
+ noindex: !!r.noindex,
70
+ nofollow: !!r.nofollow,
71
+ ogTitle: r.ogTitle,
72
+ ogDescription: r.ogDescription,
73
+ ogImage: r.ogImage,
74
+ twitterCard: r.twitterCard || 'summary_large_image',
75
+ schemaType: r.schemaType,
76
+ schemaJsonLd: r.schemaJsonLd,
77
+ hreflang: r.hreflang,
78
+ breadcrumbsTitle: r.breadcrumbsTitle,
79
+ imageAlts: r.imageAlts,
80
+ sources: { ...(r.sources || {}), url: 'snapify-exporter' },
81
+ });
82
+ }
83
+ for (const re of j.redirects || []) {
84
+ redirects.push({
85
+ id: `exp-redir:${re.from}`,
86
+ from: pathFromUrl(re.from),
87
+ to: re.to.startsWith('http') ? re.to : pathFromUrl(re.to),
88
+ permanent: re.permanent !== false,
89
+ source: 'snapify-exporter',
90
+ });
91
+ }
92
+ }
93
+ if (!records.length && !redirects.length) warnings.push('Export Snapify vide ou illisible');
94
+ return { records, redirects, warnings };
95
+ },
96
+ };
@@ -0,0 +1,53 @@
1
+ /** Groupe F — Google Search Console (CSV) pour prioriser les URLs à fort trafic */
2
+ import type { AnalyzeContext, ExtractResult, SeoConnector, SeoRecord } from '../types';
3
+ import { csvIdx, parseCsv, pathFromUrl, slugFromPath } from './utils';
4
+
5
+ export const gscCsvConnector: SeoConnector = {
6
+ id: 'gsc-csv',
7
+ name: 'Google Search Console (CSV)',
8
+ fields: ['url'],
9
+ detect: (ctx) => {
10
+ const hit = ctx.textFiles.some((f) => {
11
+ const h = f.text.slice(0, 400).toLowerCase();
12
+ const n = f.name.toLowerCase();
13
+ return n.includes('gsc') || n.includes('search-console') || (h.includes('clicks') && h.includes('impressions') && (h.includes('top pages') || h.includes('page') || h.includes('url')));
14
+ });
15
+ return { id: 'gsc-csv', name: 'Google Search Console (CSV)', found: hit };
16
+ },
17
+ extract: (ctx: AnalyzeContext): ExtractResult => {
18
+ const records: SeoRecord[] = [];
19
+ const warnings: string[] = [];
20
+ for (const f of ctx.textFiles) {
21
+ if (!f.name.endsWith('.csv') && !f.text.includes(',')) continue;
22
+ const rows = parseCsv(f.text);
23
+ if (rows.length < 2) continue;
24
+ const header = rows[0];
25
+ const iUrl = csvIdx(header, 'top pages', 'page', 'url', 'landing page');
26
+ const iClicks = csvIdx(header, 'clicks', 'clics');
27
+ if (iUrl < 0) continue;
28
+ const scored: { path: string; url: string; clicks: number }[] = [];
29
+ for (const r of rows.slice(1)) {
30
+ const url = (r[iUrl] || '').trim();
31
+ if (!url) continue;
32
+ const clicks = iClicks >= 0 ? Number(r[iClicks]) || 0 : 0;
33
+ scored.push({ url, path: pathFromUrl(url), clicks });
34
+ }
35
+ scored.sort((a, b) => b.clicks - a.clicks);
36
+ for (const s of scored) {
37
+ records.push({
38
+ id: `gsc:${s.path}`,
39
+ kind: 'other',
40
+ url: s.url,
41
+ path: s.path,
42
+ slug: slugFromPath(s.path),
43
+ status: 'publish',
44
+ // focusKeyphrase détourné : stocke un hint de priorité lisible
45
+ focusKeyphrase: s.clicks > 0 ? `gsc-clicks:${s.clicks}` : undefined,
46
+ sources: { url: 'gsc-csv', focusKeyphrase: s.clicks > 0 ? 'gsc-csv' : undefined },
47
+ });
48
+ }
49
+ }
50
+ if (!records.length) warnings.push('GSC : aucune page dans le CSV');
51
+ return { records, redirects: [], warnings };
52
+ },
53
+ };
@@ -0,0 +1,65 @@
1
+ /** Groupe B — redirections .htaccess / nginx.conf */
2
+ import type { AnalyzeContext, ExtractResult, RedirectRecord, SeoConnector } from '../types';
3
+ import { pathFromUrl } from './utils';
4
+
5
+ function push(redir: RedirectRecord[], from: string, to: string, permanent: boolean, source: string) {
6
+ if (!from || !to) return;
7
+ redir.push({
8
+ id: `${source}:${from}`,
9
+ from: pathFromUrl(from),
10
+ to: to.startsWith('http') ? to : pathFromUrl(to),
11
+ permanent,
12
+ source,
13
+ });
14
+ }
15
+
16
+ export const htaccessConnector: SeoConnector = {
17
+ id: 'htaccess',
18
+ name: '.htaccess / nginx',
19
+ fields: ['redirects'],
20
+ detect: (ctx) => {
21
+ const hit = ctx.textFiles.some((f) => {
22
+ const n = f.name.toLowerCase();
23
+ const t = f.text.slice(0, 400).toLowerCase();
24
+ return n.includes('.htaccess') || n.includes('nginx') || t.includes('rewriteengine') || t.includes('rewrite ^') || t.includes('redirect 301');
25
+ });
26
+ return { id: 'htaccess', name: '.htaccess / nginx', found: hit };
27
+ },
28
+ extract: (ctx: AnalyzeContext): ExtractResult => {
29
+ const redirects: RedirectRecord[] = [];
30
+ const warnings: string[] = [];
31
+ for (const f of ctx.textFiles) {
32
+ const lines = f.text.split(/\r?\n/);
33
+ for (const line of lines) {
34
+ const l = line.trim();
35
+ if (!l || l.startsWith('#')) continue;
36
+ // Redirect 301 /old /new
37
+ let m = /^Redirect\s+(301|302|permanent|temp)\s+(\S+)\s+(\S+)/i.exec(l);
38
+ if (m) {
39
+ push(redirects, m[2], m[3], /301|permanent/i.test(m[1]), 'htaccess');
40
+ continue;
41
+ }
42
+ // RedirectMatch 301 ^/old$ /new
43
+ m = /^RedirectMatch\s+(301|302)\s+(\S+)\s+(\S+)/i.exec(l);
44
+ if (m) {
45
+ push(redirects, m[2].replace(/^\^/, '').replace(/\$$/, ''), m[3], m[1] === '301', 'htaccess');
46
+ continue;
47
+ }
48
+ // RewriteRule ^old$ /new [R=301,L]
49
+ m = /^RewriteRule\s+(\S+)\s+(\S+)\s*\[([^\]]*)\]/i.exec(l);
50
+ if (m && /R=\d+/i.test(m[3])) {
51
+ const code = /R=(\d+)/i.exec(m[3])?.[1] || '302';
52
+ push(redirects, m[1].replace(/^\^/, '').replace(/\$$/, ''), m[2], code === '301', 'htaccess');
53
+ continue;
54
+ }
55
+ // nginx: rewrite ^/old$ /new permanent;
56
+ m = /^rewrite\s+(\S+)\s+(\S+)\s+(permanent|redirect)/i.exec(l);
57
+ if (m) {
58
+ push(redirects, m[1].replace(/^\^/, '').replace(/\$$/, ''), m[2].replace(/;$/, ''), m[3] === 'permanent', 'nginx');
59
+ }
60
+ }
61
+ }
62
+ if (!redirects.length) warnings.push('Aucune règle de redirection dans .htaccess / nginx');
63
+ return { records: [], redirects, warnings };
64
+ },
65
+ };
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Groupe F — crawler de secours hors-ligne : HTML déjà téléversé (rendu).
3
+ * Title, meta, canonical, OG, Twitter, JSON-LD, hreflang.
4
+ * (Crawl live HTTP = lacune SDK net:hôte — voir ARCHITECTURE.md)
5
+ */
6
+ import type { AnalyzeContext, ExtractResult, SeoConnector, SeoRecord } from '../types';
7
+ import { pathFromUrl, slugFromPath, stripTags } from './utils';
8
+
9
+ function meta(html: string, name: string): string | undefined {
10
+ const re = new RegExp(`<meta[^>]+(?:name|property)=["']${name}["'][^>]+content=["']([^"']*)["']`, 'i');
11
+ const re2 = new RegExp(`<meta[^>]+content=["']([^"']*)["'][^>]+(?:name|property)=["']${name}["']`, 'i');
12
+ return re.exec(html)?.[1] || re2.exec(html)?.[1];
13
+ }
14
+
15
+ function linkRel(html: string, rel: string): string | undefined {
16
+ const re = new RegExp(`<link[^>]+rel=["']${rel}["'][^>]+href=["']([^"']+)["']`, 'i');
17
+ const re2 = new RegExp(`<link[^>]+href=["']([^"']+)["'][^>]+rel=["']${rel}["']`, 'i');
18
+ return re.exec(html)?.[1] || re2.exec(html)?.[1];
19
+ }
20
+
21
+ export const htmlCrawlerConnector: SeoConnector = {
22
+ id: 'html-crawler',
23
+ name: 'HTML rendu (secours)',
24
+ fields: ['url', 'seoTitle', 'metaDescription', 'canonicalUrl', 'ogTitle', 'ogDescription', 'ogImage', 'schemaJsonLd', 'hreflang', 'noindex'],
25
+ detect: (ctx) => {
26
+ const hit = ctx.textFiles.some((f) => {
27
+ const n = f.name.toLowerCase();
28
+ const t = f.text.slice(0, 300).toLowerCase();
29
+ return n.endsWith('.html') || n.endsWith('.htm') || t.includes('<html') || t.includes('<!doctype html');
30
+ });
31
+ return { id: 'html-crawler', name: 'HTML rendu (secours)', found: hit };
32
+ },
33
+ extract: (ctx: AnalyzeContext): ExtractResult => {
34
+ const records: SeoRecord[] = [];
35
+ const warnings: string[] = [];
36
+ for (const f of ctx.textFiles) {
37
+ const html = f.text;
38
+ if (!/<html|<!doctype html/i.test(html.slice(0, 500))) continue;
39
+ const title = /<title[^>]*>([^<]*)<\/title>/i.exec(html)?.[1]?.trim();
40
+ const canonical = linkRel(html, 'canonical');
41
+ const url =
42
+ canonical ||
43
+ meta(html, 'og:url') ||
44
+ `https://imported.local/${f.name.replace(/\.html?$/i, '')}`;
45
+ const path = pathFromUrl(url);
46
+ const robots = (meta(html, 'robots') || '').toLowerCase();
47
+ const jsonLds = [...html.matchAll(/<script[^>]+type=["']application\/ld\+json["'][^>]*>([\s\S]*?)<\/script>/gi)].map((m) =>
48
+ m[1].trim()
49
+ );
50
+ const hreflang = [...html.matchAll(/<link[^>]+rel=["']alternate["'][^>]+hreflang=["']([^"']+)["'][^>]+href=["']([^"']+)["']/gi)].map(
51
+ (m) => ({ lang: m[1], url: m[2] })
52
+ );
53
+ const alts = [...html.matchAll(/<img[^>]+src=["']([^"']+)["'][^>]*alt=["']([^"']*)["']/gi)].map((m) => ({
54
+ src: m[1],
55
+ alt: m[2],
56
+ }));
57
+ records.push({
58
+ id: `html:${path}`,
59
+ kind: 'other',
60
+ url,
61
+ path,
62
+ slug: slugFromPath(path),
63
+ status: 'publish',
64
+ title: title ? stripTags(title) : undefined,
65
+ seoTitle: title ? stripTags(title) : undefined,
66
+ metaDescription: meta(html, 'description'),
67
+ canonicalUrl: canonical,
68
+ ogTitle: meta(html, 'og:title'),
69
+ ogDescription: meta(html, 'og:description'),
70
+ ogImage: meta(html, 'og:image'),
71
+ twitterCard: (meta(html, 'twitter:card') as 'summary' | 'summary_large_image' | undefined) || undefined,
72
+ schemaJsonLd: jsonLds[0],
73
+ schemaType: jsonLds[0]?.includes('Product') ? 'Product' : jsonLds[0]?.includes('Article') ? 'Article' : undefined,
74
+ hreflang: hreflang.length ? hreflang : undefined,
75
+ imageAlts: alts.length ? alts : undefined,
76
+ noindex: robots.includes('noindex'),
77
+ nofollow: robots.includes('nofollow'),
78
+ sources: {
79
+ url: 'html-crawler',
80
+ seoTitle: 'html-crawler',
81
+ metaDescription: 'html-crawler',
82
+ canonicalUrl: canonical ? 'html-crawler' : undefined,
83
+ schemaJsonLd: jsonLds[0] ? 'html-crawler' : undefined,
84
+ },
85
+ });
86
+ }
87
+ if (!records.length) warnings.push('HTML : aucun fichier de page détecté');
88
+ return { records, redirects: [], warnings };
89
+ },
90
+ };