create-snapify-app 0.0.0-stage → 1.1.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.
- package/LICENSE.md +24 -0
- package/README.md +55 -2
- package/bin/create-snapify-app.mjs +174 -0
- package/lib/args.mjs +59 -0
- package/lib/copy.mjs +44 -0
- package/lib/env.mjs +84 -0
- package/lib/prompt.mjs +63 -0
- package/package.json +35 -4
- package/template/.env.example +79 -0
- package/template/.github/workflows/ci.yml +23 -0
- package/template/.github/workflows/deploy.yml +26 -0
- package/template/.github/workflows/ping.yml +8 -0
- package/template/.github/workflows/release.yml +67 -0
- package/template/.snapify-install.json +5 -0
- package/template/CHANGELOG.md +28 -0
- package/template/LICENSE +14 -0
- package/template/README.md +287 -0
- package/template/administrator.html +23 -0
- package/template/apps/client/src/App.tsx +765 -0
- package/template/apps/client/src/auth.css +400 -0
- package/template/apps/client/src/lib/api.ts +22 -0
- package/template/apps/client/src/main.tsx +20 -0
- package/template/apps/community/src/App.tsx +592 -0
- package/template/apps/community/src/main.tsx +20 -0
- package/template/apps/community/src/styles.css +24 -0
- package/template/apps/developers/src/App.tsx +643 -0
- package/template/apps/developers/src/main.tsx +17 -0
- package/template/apps/developers/src/pages.tsx +1587 -0
- package/template/apps/developers/src/styles.css +98 -0
- package/template/apps/developers/src/ui.tsx +179 -0
- package/template/apps/landing/src/App.tsx +598 -0
- package/template/apps/landing/src/LegalPages.tsx +158 -0
- package/template/apps/landing/src/OrderPage.tsx +381 -0
- package/template/apps/landing/src/SeoPages.tsx +923 -0
- package/template/apps/landing/src/copy.ts +195 -0
- package/template/apps/landing/src/main.tsx +20 -0
- package/template/apps/landing/src/styles.css +803 -0
- package/template/apps/landing/src/types.ts +19 -0
- package/template/apps/marketplace/src/App.tsx +1229 -0
- package/template/apps/marketplace/src/developer/DeveloperApp.tsx +1266 -0
- package/template/apps/marketplace/src/main.tsx +20 -0
- package/template/apps/marketplace/src/styles.css +1001 -0
- package/template/apps/shared/AuthContext.tsx +65 -0
- package/template/apps/shared/Logo.tsx +33 -0
- package/template/apps/shared/api.ts +47 -0
- package/template/apps/shared/ui.tsx +128 -0
- package/template/apps/superadmin/src/App.tsx +1264 -0
- package/template/apps/superadmin/src/lib/api.ts +20 -0
- package/template/apps/superadmin/src/lib/hooks.ts +20 -0
- package/template/apps/superadmin/src/main.tsx +16 -0
- package/template/apps/superadmin/src/pages/ClientsPage.tsx +185 -0
- package/template/apps/superadmin/src/pages/InvoicesPage.tsx +157 -0
- package/template/apps/superadmin/src/pages/NewsletterPage.tsx +212 -0
- package/template/apps/superadmin/src/pages/OrdersPage.tsx +195 -0
- package/template/apps/superadmin/src/pages/PaymentsPage.tsx +150 -0
- package/template/apps/superadmin/src/pages/PayoutsPage.tsx +133 -0
- package/template/apps/superadmin/src/pages/PublishersPage.tsx +151 -0
- package/template/apps/superadmin/src/pages/SeoControlPage.tsx +692 -0
- package/template/apps/superadmin/src/pages/SettingsPage.tsx +199 -0
- package/template/apps/superadmin/src/pages/SystemPage.tsx +109 -0
- package/template/apps/superadmin/src/pages/TicketsPage.tsx +201 -0
- package/template/apps/superadmin/src/pages/UsersPage.tsx +167 -0
- package/template/client.html +21 -0
- package/template/community/hamdiayari/akhbar/README.md +23 -0
- package/template/community/hamdiayari/akhbar/screenshot.jpg +0 -0
- package/template/community/hamdiayari/akhbar/snapify.theme.json +76 -0
- package/template/community/hamdiayari/akhbar/src/Brand.tsx +26 -0
- package/template/community/hamdiayari/akhbar/src/Footer.tsx +182 -0
- package/template/community/hamdiayari/akhbar/src/Header.tsx +191 -0
- package/template/community/hamdiayari/akhbar/src/Layout.tsx +49 -0
- package/template/community/hamdiayari/akhbar/src/Social.tsx +33 -0
- package/template/community/hamdiayari/akhbar/src/Ticker.tsx +86 -0
- package/template/community/hamdiayari/akhbar/src/Views.tsx +285 -0
- package/template/community/hamdiayari/akhbar/src/blocks/CollectionBlocks.tsx +672 -0
- package/template/community/hamdiayari/akhbar/src/blocks/ContentBlocks.tsx +305 -0
- package/template/community/hamdiayari/akhbar/src/blocks/ConversionBlocks.tsx +569 -0
- package/template/community/hamdiayari/akhbar/src/blocks/HeaderBlocks.tsx +287 -0
- package/template/community/hamdiayari/akhbar/src/index.tsx +51 -0
- package/template/community/hamdiayari/akhbar/src/kit.tsx +357 -0
- package/template/community/hamdiayari/akhbar/src/site.ts +96 -0
- package/template/community/hamdiayari/akhbar/src/styles.css +566 -0
- package/template/community/hamdiayari/akhbar-actualites/README.md +28 -0
- package/template/community/hamdiayari/akhbar-actualites/screenshot.jpg +0 -0
- package/template/community/hamdiayari/akhbar-actualites/snapify.module.json +107 -0
- package/template/community/hamdiayari/akhbar-actualites/src/admin/AudiencePage.tsx +185 -0
- package/template/community/hamdiayari/akhbar-actualites/src/admin/index.tsx +11 -0
- package/template/community/hamdiayari/akhbar-actualites/src/public/Archive.tsx +142 -0
- package/template/community/hamdiayari/akhbar-actualites/src/public/cards.tsx +152 -0
- package/template/community/hamdiayari/akhbar-actualites/src/public/index.tsx +71 -0
- package/template/community/hamdiayari/akhbar-actualites/src/public/posts.ts +103 -0
- package/template/community/hamdiayari/akhbar-actualites/src/public/styles.css +568 -0
- package/template/community/hamdiayari/akhbar-actualites/src/public/widgets.tsx +226 -0
- package/template/community/hamdiayari/akhbar-actualites/src/server.ts +119 -0
- package/template/community/hamdiayari/akhbar-actualites/src/types.ts +25 -0
- package/template/community/hamdiayari/akhbar-urgent/README.md +36 -0
- package/template/community/hamdiayari/akhbar-urgent/screenshot.jpg +0 -0
- package/template/community/hamdiayari/akhbar-urgent/snapify.module.json +64 -0
- package/template/community/hamdiayari/akhbar-urgent/src/admin/FlashesPage.tsx +229 -0
- package/template/community/hamdiayari/akhbar-urgent/src/admin/index.tsx +11 -0
- package/template/community/hamdiayari/akhbar-urgent/src/public/Ticker.tsx +81 -0
- package/template/community/hamdiayari/akhbar-urgent/src/public/index.tsx +63 -0
- package/template/community/hamdiayari/akhbar-urgent/src/public/styles.css +142 -0
- package/template/community/hamdiayari/akhbar-urgent/src/server.ts +101 -0
- package/template/community/hamdiayari/akhbar-urgent/src/types.ts +35 -0
- package/template/community.html +21 -0
- package/template/developers.html +24 -0
- package/template/docker-compose.db.yml +24 -0
- package/template/docs/BACKOFFICE_SNAPIFY.md +130 -0
- package/template/docs/CI_CD.md +66 -0
- package/template/docs/MODULES.md +346 -0
- package/template/docs/PLATFORM_DEPLOY.md +54 -0
- package/template/docs/logo.svg +10 -0
- package/template/drizzle/0000_init.sql +147 -0
- package/template/drizzle/0001_page_project.sql +5 -0
- package/template/drizzle/0002_modules.sql +23 -0
- package/template/drizzle/0003_themes.sql +4 -0
- package/template/drizzle/0004_security.sql +82 -0
- package/template/drizzle/0005_module_records.sql +16 -0
- package/template/drizzle/0006_avatars.sql +4 -0
- package/template/drizzle/0007_platform.sql +264 -0
- package/template/drizzle/0008_mp_validation.sql +3 -0
- package/template/drizzle/0009_saas_ops.sql +77 -0
- package/template/drizzle/0010_cms_chrome.sql +13 -0
- package/template/drizzle/0011_client_portal.sql +26 -0
- package/template/drizzle/meta/0000_snapshot.json +998 -0
- package/template/drizzle/meta/0001_snapshot.json +1004 -0
- package/template/drizzle/meta/_journal.json +90 -0
- package/template/drizzle.config.ts +16 -0
- package/template/ecosystem.snapify.cjs +24 -0
- package/template/for.html +1 -0
- package/template/index.html +29 -0
- package/template/landing.html +37 -0
- package/template/marketplace/catalog.json +373 -0
- package/template/marketplace/gallery/hamdiayari.preveris/01-home.jpg +0 -0
- package/template/marketplace/gallery/hamdiayari.recaptcha/01-reglages.jpg +0 -0
- package/template/marketplace/gallery/hamdiayari.recaptcha/02-logo.jpg +0 -0
- package/template/marketplace/gallery/novalabs.ai-articles/01-generer.jpg +0 -0
- package/template/marketplace/gallery/novalabs.ai-articles/02-fournisseur-ia.jpg +0 -0
- package/template/marketplace/gallery/novalabs.calendar/01-agenda-site.jpg +0 -0
- package/template/marketplace/gallery/novalabs.calendar/02-evenements-admin.jpg +0 -0
- package/template/marketplace/gallery/novalabs.calendar/03-reglages.jpg +0 -0
- package/template/marketplace/screenshots/hamdiayari.preveris-1.0.6.jpg +0 -0
- package/template/marketplace/screenshots/hamdiayari.recaptcha-1.0.0.jpg +0 -0
- package/template/marketplace/screenshots/hamdiayari.wp-seo-migrator-1.1.1.jpg +0 -0
- package/template/marketplace/screenshots/novalabs.ai-articles-1.0.1.jpg +0 -0
- package/template/marketplace/screenshots/novalabs.ai-chat-1.0.1.jpg +0 -0
- package/template/marketplace/screenshots/novalabs.calendar-1.0.1.jpg +0 -0
- package/template/marketplace/screenshots/novalabs.cart-1.0.0.jpg +0 -0
- package/template/marketplace/screenshots/novalabs.checkout-1.0.0.jpg +0 -0
- package/template/marketplace/screenshots/novalabs.customers-1.1.0.jpg +0 -0
- package/template/marketplace/screenshots/novalabs.dogga-1.0.0.jpg +0 -0
- package/template/marketplace/screenshots/novalabs.mahdia-1.0.0.jpg +0 -0
- package/template/marketplace/screenshots/novalabs.shop-1.0.0.jpg +0 -0
- package/template/marketplace/screenshots/novalabs.sidibou-1.0.0.jpg +0 -0
- package/template/marketplace/screenshots/novalabs.whatsapp-1.0.1.jpg +0 -0
- package/template/marketplace.html +21 -0
- package/template/metadata.json +7 -0
- package/template/modules/ai-articles/screenshot.jpg +0 -0
- package/template/modules/ai-articles/snapify.module.json +74 -0
- package/template/modules/ai-articles/src/admin/ArticlesPage.tsx +162 -0
- package/template/modules/ai-articles/src/admin/GeneratePage.tsx +118 -0
- package/template/modules/ai-articles/src/admin/index.tsx +12 -0
- package/template/modules/ai-articles/src/public/index.tsx +119 -0
- package/template/modules/ai-articles/src/server.ts +287 -0
- package/template/modules/ai-articles/src/types.ts +30 -0
- package/template/modules/ai-chat/screenshot.jpg +0 -0
- package/template/modules/ai-chat/snapify.module.json +217 -0
- package/template/modules/ai-chat/src/public.tsx +198 -0
- package/template/modules/ai-chat/src/server.ts +142 -0
- package/template/modules/ai-theme-studio/README.md +15 -0
- package/template/modules/ai-theme-studio/screenshot.jpg +0 -0
- package/template/modules/ai-theme-studio/snapify.module.json +175 -0
- package/template/modules/ai-theme-studio/src/admin/HistoryPage.tsx +91 -0
- package/template/modules/ai-theme-studio/src/admin/StudioPage.tsx +414 -0
- package/template/modules/ai-theme-studio/src/admin/index.tsx +11 -0
- package/template/modules/ai-theme-studio/src/lib/images.ts +240 -0
- package/template/modules/ai-theme-studio/src/lib/llm.ts +123 -0
- package/template/modules/ai-theme-studio/src/lib/normalize.ts +714 -0
- package/template/modules/ai-theme-studio/src/lib/prompts.ts +198 -0
- package/template/modules/ai-theme-studio/src/server.ts +137 -0
- package/template/modules/ai-theme-studio/src/types.ts +112 -0
- package/template/modules/calendar/screenshot.jpg +0 -0
- package/template/modules/calendar/snapify.module.json +45 -0
- package/template/modules/calendar/src/admin/EventsPage.tsx +217 -0
- package/template/modules/calendar/src/admin/index.tsx +11 -0
- package/template/modules/calendar/src/public/index.tsx +231 -0
- package/template/modules/calendar/src/server.ts +143 -0
- package/template/modules/calendar/src/types.ts +25 -0
- package/template/modules/cart/screenshot.jpg +0 -0
- package/template/modules/cart/snapify.module.json +90 -0
- package/template/modules/cart/src/admin/index.tsx +265 -0
- package/template/modules/cart/src/public/CartPage.tsx +198 -0
- package/template/modules/cart/src/public/index.tsx +261 -0
- package/template/modules/cart/src/public/useQuote.ts +67 -0
- package/template/modules/cart/src/server.ts +148 -0
- package/template/modules/cart/src/types.ts +31 -0
- package/template/modules/checkout/screenshot.jpg +0 -0
- package/template/modules/checkout/snapify.module.json +264 -0
- package/template/modules/checkout/src/admin/OrderDetailPage.tsx +304 -0
- package/template/modules/checkout/src/admin/badges.tsx +28 -0
- package/template/modules/checkout/src/admin/index.tsx +236 -0
- package/template/modules/checkout/src/public/CheckoutPage.tsx +461 -0
- package/template/modules/checkout/src/public/OrderPages.tsx +153 -0
- package/template/modules/checkout/src/public/index.tsx +23 -0
- package/template/modules/checkout/src/server.ts +383 -0
- package/template/modules/checkout/src/types.ts +70 -0
- package/template/modules/customers/screenshot.jpg +0 -0
- package/template/modules/customers/snapify.module.json +115 -0
- package/template/modules/customers/src/admin/CustomerDetailPage.tsx +274 -0
- package/template/modules/customers/src/admin/index.tsx +194 -0
- package/template/modules/customers/src/public/AccountPages.tsx +470 -0
- package/template/modules/customers/src/public/AddressForm.tsx +115 -0
- package/template/modules/customers/src/public/AuthPages.tsx +349 -0
- package/template/modules/customers/src/public/Avatar.tsx +29 -0
- package/template/modules/customers/src/public/ProfileSection.tsx +291 -0
- package/template/modules/customers/src/public/index.tsx +137 -0
- package/template/modules/customers/src/public/session.ts +51 -0
- package/template/modules/customers/src/server.ts +421 -0
- package/template/modules/customers/src/types.ts +53 -0
- package/template/modules/recaptcha/logo.jpg +0 -0
- package/template/modules/recaptcha/screenshot.jpg +0 -0
- package/template/modules/recaptcha/snapify.module.json +99 -0
- package/template/modules/recaptcha/src/public/index.tsx +94 -0
- package/template/modules/recaptcha/src/server.ts +65 -0
- package/template/modules/recaptcha/src/types.ts +18 -0
- package/template/modules/shop/screenshot.jpg +0 -0
- package/template/modules/shop/snapify.module.json +340 -0
- package/template/modules/shop/src/admin/CategoriesPage.tsx +224 -0
- package/template/modules/shop/src/admin/ProductEditor.tsx +313 -0
- package/template/modules/shop/src/admin/ProductsPage.tsx +307 -0
- package/template/modules/shop/src/admin/index.tsx +14 -0
- package/template/modules/shop/src/public/Catalog.tsx +244 -0
- package/template/modules/shop/src/public/NotFound.tsx +22 -0
- package/template/modules/shop/src/public/ProductPage.tsx +195 -0
- package/template/modules/shop/src/public/index.tsx +134 -0
- package/template/modules/shop/src/public/useFetch.ts +26 -0
- package/template/modules/shop/src/server.ts +493 -0
- package/template/modules/shop/src/shared.ts +41 -0
- package/template/modules/shop/src/types.ts +60 -0
- package/template/modules/whatsapp/screenshot.jpg +0 -0
- package/template/modules/whatsapp/snapify.module.json +121 -0
- package/template/modules/whatsapp/src/public.tsx +119 -0
- package/template/modules/wp-seo-migrator/ARCHITECTURE.md +113 -0
- package/template/modules/wp-seo-migrator/README.md +21 -0
- package/template/modules/wp-seo-migrator/fixtures/aioseo-sample.csv +3 -0
- package/template/modules/wp-seo-migrator/fixtures/sample-exporter.json +39 -0
- package/template/modules/wp-seo-migrator/fixtures/sample-page.html +12 -0
- package/template/modules/wp-seo-migrator/fixtures/sample.htaccess +3 -0
- package/template/modules/wp-seo-migrator/screenshot.jpg +0 -0
- package/template/modules/wp-seo-migrator/snapify.module.json +87 -0
- package/template/modules/wp-seo-migrator/src/admin/HistoryPage.tsx +64 -0
- package/template/modules/wp-seo-migrator/src/admin/WizardPage.tsx +788 -0
- package/template/modules/wp-seo-migrator/src/admin/i18n.ts +156 -0
- package/template/modules/wp-seo-migrator/src/admin/index.tsx +11 -0
- package/template/modules/wp-seo-migrator/src/connectors/CUSTOM_CONNECTOR.md +31 -0
- package/template/modules/wp-seo-migrator/src/connectors/csvSeoFactory.ts +106 -0
- package/template/modules/wp-seo-migrator/src/connectors/exporter.ts +96 -0
- package/template/modules/wp-seo-migrator/src/connectors/gscCsv.ts +53 -0
- package/template/modules/wp-seo-migrator/src/connectors/htaccess.ts +65 -0
- package/template/modules/wp-seo-migrator/src/connectors/htmlCrawler.ts +90 -0
- package/template/modules/wp-seo-migrator/src/connectors/index.ts +113 -0
- package/template/modules/wp-seo-migrator/src/connectors/pluginCsv.ts +77 -0
- package/template/modules/wp-seo-migrator/src/connectors/rankMathCsv.ts +77 -0
- package/template/modules/wp-seo-migrator/src/connectors/redirection.ts +62 -0
- package/template/modules/wp-seo-migrator/src/connectors/sitemap.ts +44 -0
- package/template/modules/wp-seo-migrator/src/connectors/utils.ts +111 -0
- package/template/modules/wp-seo-migrator/src/connectors/wxr.ts +103 -0
- package/template/modules/wp-seo-migrator/src/connectors/yoastCsv.ts +56 -0
- package/template/modules/wp-seo-migrator/src/pipeline/analyze.ts +158 -0
- package/template/modules/wp-seo-migrator/src/pipeline/htmlParse.ts +58 -0
- package/template/modules/wp-seo-migrator/src/pipeline/remoteAuto.ts +328 -0
- package/template/modules/wp-seo-migrator/src/server.ts +492 -0
- package/template/modules/wp-seo-migrator/src/types.ts +151 -0
- package/template/modules/wp-seo-migrator/tests/connectors-extra.test.ts +39 -0
- package/template/modules/wp-seo-migrator/tests/merge.test.ts +25 -0
- package/template/package-lock.json +6016 -0
- package/template/package.json +74 -0
- package/template/public/images/photos/caravane-chameaux-desert.webp +0 -0
- package/template/public/images/photos/hammamet-medina-plage.jpg +0 -0
- package/template/public/images/photos/maison-campagne-collines.webp +0 -0
- package/template/public/images/photos/maisons-troglodytes-desert.jpg +0 -0
- package/template/public/images/photos/panorama-ville.jpg +0 -0
- package/template/public/images/photos/preveris-accessibilite-erp.jpg +0 -0
- package/template/public/images/photos/preveris-collectivites.jpg +0 -0
- package/template/public/images/photos/preveris-etudes-plans.jpg +0 -0
- package/template/public/images/photos/preveris-hero-erp.jpg +0 -0
- package/template/public/images/photos/preveris-ssi-incendie.jpg +0 -0
- package/template/public/images/photos/preveris-suivi-hotel.jpg +0 -0
- package/template/public/images/photos/ruelle-bleue-medina.jpg +0 -0
- package/template/public/images/photos/sidi-bou-said-port.webp +0 -0
- package/template/public/images/photos/terrasse-blanche-mer-voilier.jpg +0 -0
- package/template/public/landing/hero-ai-cms.jpg +0 -0
- package/template/public/landing/shot-dogga.jpg +0 -0
- package/template/public/landing/shot-mahdia.jpg +0 -0
- package/template/public/landing/shot-sidibou.jpg +0 -0
- package/template/public/llms.txt +35 -0
- package/template/public/logo.svg +10 -0
- package/template/scripts/app-pack.ts +155 -0
- package/template/scripts/app-publish.ts +123 -0
- package/template/scripts/apply-ecommerce-home.ts +196 -0
- package/template/scripts/auto-deploy-poll.sh +13 -0
- package/template/scripts/db-backup.sh +16 -0
- package/template/scripts/db-restore.sh +11 -0
- package/template/scripts/deploy.sh +34 -0
- package/template/scripts/github-webhook-deploy.sh +7 -0
- package/template/scripts/install-new-modules.ts +96 -0
- package/template/scripts/refresh-demo-baseline.ts +9 -0
- package/template/scripts/reinstall-marketplace-packs.ts +51 -0
- package/template/scripts/restore-classic-home.ts +13 -0
- package/template/scripts/sdk-pack.ts +289 -0
- package/template/scripts/sdk-publish.ts +75 -0
- package/template/scripts/seed-demo-products.ts +120 -0
- package/template/scripts/seed-theme-content-packs.ts +42 -0
- package/template/scripts/snapify-module.ts +207 -0
- package/template/scripts/test-theme-switch.ts +24 -0
- package/template/sdk/admin.css +18 -0
- package/template/sdk/admin.ts +95 -0
- package/template/sdk/build.ts +249 -0
- package/template/sdk/commerce.ts +512 -0
- package/template/sdk/content.ts +76 -0
- package/template/sdk/icons.ts +101 -0
- package/template/sdk/image.ts +60 -0
- package/template/sdk/index.ts +500 -0
- package/template/sdk/package.ts +298 -0
- package/template/sdk/recaptcha.tsx +122 -0
- package/template/sdk/settings.ts +84 -0
- package/template/sdk/theme.css +29 -0
- package/template/sdk/theme.ts +100 -0
- package/template/sdk/ui/commerce.tsx +385 -0
- package/template/sdk/ui/orders.tsx +136 -0
- package/template/sdk-kit/CHANGELOG.md +17 -0
- package/template/sdk-kit/LICENSE.md +47 -0
- package/template/sdk-kit/README.md +81 -0
- package/template/sdk-kit/cli.ts +339 -0
- package/template/sdk-kit/create-snapify/README.md +28 -0
- package/template/sdk-kit/create-snapify/create-snapify.mjs +11 -0
- package/template/sdk-kit/create-snapify/package.template.json +16 -0
- package/template/sdk-kit/package.template.json +95 -0
- package/template/sdk-kit/templates/common/README.md.tpl +27 -0
- package/template/sdk-kit/templates/common/_gitignore +3 -0
- package/template/sdk-kit/templates/common/package.json.tpl +19 -0
- package/template/sdk-kit/templates/common/src/snapify-env.d.ts +2 -0
- package/template/sdk-kit/templates/common/tsconfig.json +15 -0
- package/template/sdk-kit/templates/module/snapify.module.json.tpl +33 -0
- package/template/sdk-kit/templates/module/src/admin.tsx +53 -0
- package/template/sdk-kit/templates/module/src/public.tsx +49 -0
- package/template/sdk-kit/templates/module/src/server.ts +30 -0
- package/template/sdk-kit/templates/module/src/types.ts +19 -0
- package/template/sdk-kit/templates/theme/snapify.theme.json.tpl +22 -0
- package/template/sdk-kit/templates/theme/src/Footer.tsx +40 -0
- package/template/sdk-kit/templates/theme/src/Header.tsx +47 -0
- package/template/sdk-kit/templates/theme/src/Views.tsx +36 -0
- package/template/sdk-kit/templates/theme/src/blocks.tsx +93 -0
- package/template/sdk-kit/templates/theme/src/index.tsx +30 -0
- package/template/sdk-kit/templates/theme/src/site.tsx +59 -0
- package/template/sdk-kit/templates/theme/src/styles.css +71 -0
- package/template/server/client/routes.ts +252 -0
- package/template/server/cms/analyticsStore.ts +180 -0
- package/template/server/cms/auth.ts +155 -0
- package/template/server/cms/blockCatalog.ts +342 -0
- package/template/server/cms/blocks.ts +521 -0
- package/template/server/cms/contentMigration.ts +1119 -0
- package/template/server/cms/defaults.ts +303 -0
- package/template/server/cms/permissions.ts +154 -0
- package/template/server/cms/restoreClassicHome.ts +183 -0
- package/template/server/cms/revisions.ts +99 -0
- package/template/server/cms/scheduler.ts +78 -0
- package/template/server/cms/seed.ts +72 -0
- package/template/server/cms/seoAnalyzer.ts +213 -0
- package/template/server/cms/store.ts +122 -0
- package/template/server/cms/themeContent.ts +1386 -0
- package/template/server/cms/themePacks/sidibou-branding.json +1 -0
- package/template/server/cms/themePacks/sidibou-home.json +1 -0
- package/template/server/cms/themePacks/sidibou-menus.json +1 -0
- package/template/server/cms/types.ts +432 -0
- package/template/server/community/routes.ts +410 -0
- package/template/server/db/client.ts +43 -0
- package/template/server/db/repository.ts +389 -0
- package/template/server/db/schema.ts +726 -0
- package/template/server/demo/cmsReset.ts +196 -0
- package/template/server/developers/sdk.ts +85 -0
- package/template/server/geoip.ts +15 -0
- package/template/server/http.ts +53 -0
- package/template/server/mail.ts +216 -0
- package/template/server/marketplace/catalog.ts +74 -0
- package/template/server/marketplace/packageValidate.ts +475 -0
- package/template/server/marketplace/payments.ts +193 -0
- package/template/server/marketplace/routes.ts +850 -0
- package/template/server/marketplace/signing.ts +116 -0
- package/template/server/marketplace/syncOfficial.ts +282 -0
- package/template/server/media/images.ts +63 -0
- package/template/server/middleware/adminAuth.ts +134 -0
- package/template/server/modules/legacy.ts +44 -0
- package/template/server/modules/manager.ts +1122 -0
- package/template/server/modules/marketplace.ts +178 -0
- package/template/server/modules/outbound.ts +178 -0
- package/template/server/modules/purchases.ts +149 -0
- package/template/server/modules/records.ts +168 -0
- package/template/server/modules/themeHtml.ts +32 -0
- package/template/server/modules/trust.ts +16 -0
- package/template/server/modules/types.ts +147 -0
- package/template/server/platform/auth.ts +223 -0
- package/template/server/platform/clientWelcome.ts +168 -0
- package/template/server/platform/clients.ts +139 -0
- package/template/server/platform/dailyImprove.ts +356 -0
- package/template/server/platform/flouci.ts +126 -0
- package/template/server/platform/host.ts +69 -0
- package/template/server/platform/hostingProviders.ts +143 -0
- package/template/server/platform/licenseOrders.ts +291 -0
- package/template/server/platform/money.ts +42 -0
- package/template/server/platform/passwords.ts +41 -0
- package/template/server/platform/region.ts +86 -0
- package/template/server/platform/routes.ts +225 -0
- package/template/server/platform/seed.ts +82 -0
- package/template/server/platform/settings.ts +72 -0
- package/template/server/routes/adminAccount.ts +403 -0
- package/template/server/routes/adminCms.ts +808 -0
- package/template/server/routes/adminSystem.ts +243 -0
- package/template/server/routes/adminUsers.ts +449 -0
- package/template/server/routes/googleOAuth.ts +327 -0
- package/template/server/routes/modules.ts +323 -0
- package/template/server/routes/publicCms.ts +313 -0
- package/template/server/routes/seoPublic.ts +158 -0
- package/template/server/security/accounts.ts +121 -0
- package/template/server/security/audit.ts +143 -0
- package/template/server/security/authTokens.ts +74 -0
- package/template/server/security/ip.ts +68 -0
- package/template/server/security/rateLimit.ts +85 -0
- package/template/server/security/retention.ts +46 -0
- package/template/server/security/secrets.ts +44 -0
- package/template/server/security/sessions.ts +140 -0
- package/template/server/security/totp.ts +101 -0
- package/template/server/superadmin/analytics.ts +109 -0
- package/template/server/superadmin/auth.ts +92 -0
- package/template/server/superadmin/backlinksCatalog.ts +210 -0
- package/template/server/superadmin/frSeoContent.ts +165 -0
- package/template/server/superadmin/landingSeo.ts +675 -0
- package/template/server/superadmin/ops.ts +238 -0
- package/template/server/superadmin/routes.ts +1095 -0
- package/template/server/superadmin/tnSeoContent.ts +130 -0
- package/template/server.ts +522 -0
- package/template/src/App.tsx +263 -0
- package/template/src/admin/AdminApp.tsx +162 -0
- package/template/src/admin/account/AuthLayout.tsx +57 -0
- package/template/src/admin/account/SecurityForms.tsx +276 -0
- package/template/src/admin/admin.css +127 -0
- package/template/src/admin/context/AuthContext.tsx +147 -0
- package/template/src/admin/context/SiteContext.tsx +50 -0
- package/template/src/admin/editor/BlockLibrary.tsx +173 -0
- package/template/src/admin/editor/BlocksPanel.tsx +396 -0
- package/template/src/admin/editor/EditorBits.tsx +106 -0
- package/template/src/admin/editor/PreviewFrame.tsx +145 -0
- package/template/src/admin/editor/RichTextEditor.tsx +276 -0
- package/template/src/admin/editor/SeoPanel.tsx +349 -0
- package/template/src/admin/editor/StyleEditor.tsx +114 -0
- package/template/src/admin/editor/blockSchemas.ts +699 -0
- package/template/src/admin/editor/fields.tsx +486 -0
- package/template/src/admin/layout/AdminShell.tsx +418 -0
- package/template/src/admin/layout/nav.ts +95 -0
- package/template/src/admin/lib/api.ts +408 -0
- package/template/src/admin/lib/audit.ts +141 -0
- package/template/src/admin/lib/format.ts +84 -0
- package/template/src/admin/lib/hooks.ts +125 -0
- package/template/src/admin/main.tsx +16 -0
- package/template/src/admin/modules/InstallDialog.tsx +160 -0
- package/template/src/admin/modules/SettingsForm.tsx +145 -0
- package/template/src/admin/modules/kit.tsx +127 -0
- package/template/src/admin/modules/labels.tsx +226 -0
- package/template/src/admin/pages/AccountSetupPage.tsx +62 -0
- package/template/src/admin/pages/AnalyticsPage.tsx +206 -0
- package/template/src/admin/pages/BrandingPage.tsx +154 -0
- package/template/src/admin/pages/DashboardPage.tsx +239 -0
- package/template/src/admin/pages/EngagementPage.tsx +168 -0
- package/template/src/admin/pages/FormsPage.tsx +435 -0
- package/template/src/admin/pages/GeneralPage.tsx +120 -0
- package/template/src/admin/pages/LoginPage.tsx +249 -0
- package/template/src/admin/pages/MaintenancePage.tsx +125 -0
- package/template/src/admin/pages/MarketplacePage.tsx +426 -0
- package/template/src/admin/pages/MediaPage.tsx +251 -0
- package/template/src/admin/pages/MenusPage.tsx +446 -0
- package/template/src/admin/pages/ModuleAdminPage.tsx +113 -0
- package/template/src/admin/pages/ModuleDetailPage.tsx +293 -0
- package/template/src/admin/pages/ModulesPage.tsx +135 -0
- package/template/src/admin/pages/NewsletterPage.tsx +193 -0
- package/template/src/admin/pages/PageEditorPage.tsx +322 -0
- package/template/src/admin/pages/PagesListPage.tsx +277 -0
- package/template/src/admin/pages/PostEditorPage.tsx +292 -0
- package/template/src/admin/pages/PostsListPage.tsx +187 -0
- package/template/src/admin/pages/ProfilePage.tsx +489 -0
- package/template/src/admin/pages/ResetPasswordPage.tsx +110 -0
- package/template/src/admin/pages/SeoPage.tsx +670 -0
- package/template/src/admin/pages/SettingsPage.tsx +189 -0
- package/template/src/admin/pages/ThemeCustomizePage.tsx +170 -0
- package/template/src/admin/pages/ThemesPage.tsx +292 -0
- package/template/src/admin/pages/UsersPage.tsx +57 -0
- package/template/src/admin/pages/WidgetsPage.tsx +200 -0
- package/template/src/admin/seo/GoogleSetup.tsx +529 -0
- package/template/src/admin/settings/EmailTab.tsx +293 -0
- package/template/src/admin/settings/OtherTabs.tsx +270 -0
- package/template/src/admin/settings/SecurityTab.tsx +172 -0
- package/template/src/admin/settings/controls.tsx +133 -0
- package/template/src/admin/ui/Pagination.tsx +170 -0
- package/template/src/admin/ui/SaveBar.tsx +77 -0
- package/template/src/admin/ui/TagInput.tsx +54 -0
- package/template/src/admin/ui/charts.tsx +108 -0
- package/template/src/admin/ui/media.tsx +265 -0
- package/template/src/admin/ui/overlays.tsx +239 -0
- package/template/src/admin/ui/primitives.tsx +544 -0
- package/template/src/admin/users/AuditTab.tsx +104 -0
- package/template/src/admin/users/RolesTab.tsx +368 -0
- package/template/src/admin/users/UsersTab.tsx +723 -0
- package/template/src/admin/users/shared.tsx +278 -0
- package/template/src/cms/icons.ts +7 -0
- package/template/src/components/CookieBanner.tsx +166 -0
- package/template/src/components/MaintenanceGate.tsx +66 -0
- package/template/src/components/SiteAnalytics.tsx +64 -0
- package/template/src/components/SnapifyLogo.tsx +44 -0
- package/template/src/components/cms/BlockRenderer.tsx +154 -0
- package/template/src/components/cms/WidgetArea.tsx +193 -0
- package/template/src/context/SiteConfigContext.tsx +130 -0
- package/template/src/demoBase.ts +23 -0
- package/template/src/index.css +90 -0
- package/template/src/main.tsx +16 -0
- package/template/src/modules/ModuleHost.tsx +197 -0
- package/template/src/preview.ts +63 -0
- package/template/src/runtime.ts +38 -0
- package/template/src/themes/ThemeHost.tsx +168 -0
- package/template/src/themes/fallback.tsx +71 -0
- package/template/src/types.ts +94 -0
- package/template/src/views/BlogPostView.tsx +68 -0
- package/template/src/views/CmsPageView.tsx +34 -0
- package/template/start-pm2.sh +3 -0
- package/template/superadmin.html +20 -0
- package/template/themes/ai-canvas/screenshot.jpg +0 -0
- package/template/themes/ai-canvas/snapify.theme.json +96 -0
- package/template/themes/ai-canvas/src/CeeSimulator.tsx +247 -0
- package/template/themes/ai-canvas/src/Footer.tsx +190 -0
- package/template/themes/ai-canvas/src/Header.tsx +324 -0
- package/template/themes/ai-canvas/src/Layout.tsx +56 -0
- package/template/themes/ai-canvas/src/NotFound.tsx +58 -0
- package/template/themes/ai-canvas/src/Post.tsx +26 -0
- package/template/themes/ai-canvas/src/SnapifyLogo.tsx +44 -0
- package/template/themes/ai-canvas/src/blocks/CollectionBlocks.tsx +711 -0
- package/template/themes/ai-canvas/src/blocks/ContentBlocks.tsx +318 -0
- package/template/themes/ai-canvas/src/blocks/ConversionBlocks.tsx +559 -0
- package/template/themes/ai-canvas/src/blocks/HeaderBlocks.tsx +341 -0
- package/template/themes/ai-canvas/src/index.tsx +54 -0
- package/template/themes/ai-canvas/src/kit.tsx +398 -0
- package/template/themes/ai-canvas/src/site.ts +29 -0
- package/template/themes/ai-canvas/src/styles.css +317 -0
- package/template/themes/dogga/screenshot.jpg +0 -0
- package/template/themes/dogga/snapify.theme.json +55 -0
- package/template/themes/dogga/src/Brand.tsx +41 -0
- package/template/themes/dogga/src/Footer.tsx +202 -0
- package/template/themes/dogga/src/Header.tsx +239 -0
- package/template/themes/dogga/src/Layout.tsx +43 -0
- package/template/themes/dogga/src/Views.tsx +71 -0
- package/template/themes/dogga/src/blocks/CollectionBlocks.tsx +674 -0
- package/template/themes/dogga/src/blocks/ContentBlocks.tsx +307 -0
- package/template/themes/dogga/src/blocks/ConversionBlocks.tsx +571 -0
- package/template/themes/dogga/src/blocks/HeaderBlocks.tsx +289 -0
- package/template/themes/dogga/src/index.tsx +53 -0
- package/template/themes/dogga/src/kit.tsx +362 -0
- package/template/themes/dogga/src/site.ts +56 -0
- package/template/themes/dogga/src/styles.css +396 -0
- package/template/themes/mahdia/screenshot.jpg +0 -0
- package/template/themes/mahdia/snapify.theme.json +65 -0
- package/template/themes/mahdia/src/Brand.tsx +39 -0
- package/template/themes/mahdia/src/Footer.tsx +210 -0
- package/template/themes/mahdia/src/Header.tsx +291 -0
- package/template/themes/mahdia/src/Layout.tsx +44 -0
- package/template/themes/mahdia/src/Views.tsx +79 -0
- package/template/themes/mahdia/src/blocks/CollectionBlocks.tsx +674 -0
- package/template/themes/mahdia/src/blocks/ContentBlocks.tsx +307 -0
- package/template/themes/mahdia/src/blocks/ConversionBlocks.tsx +571 -0
- package/template/themes/mahdia/src/blocks/HeaderBlocks.tsx +289 -0
- package/template/themes/mahdia/src/index.tsx +53 -0
- package/template/themes/mahdia/src/kit.tsx +362 -0
- package/template/themes/mahdia/src/site.ts +75 -0
- package/template/themes/mahdia/src/styles.css +446 -0
- package/template/themes/preveris/screenshot.jpg +0 -0
- package/template/themes/preveris/snapify.theme.json +126 -0
- package/template/themes/preveris/src/Brand.tsx +44 -0
- package/template/themes/preveris/src/Footer.tsx +202 -0
- package/template/themes/preveris/src/Header.tsx +239 -0
- package/template/themes/preveris/src/Layout.tsx +42 -0
- package/template/themes/preveris/src/Views.tsx +71 -0
- package/template/themes/preveris/src/blocks/CollectionBlocks.tsx +678 -0
- package/template/themes/preveris/src/blocks/ContentBlocks.tsx +307 -0
- package/template/themes/preveris/src/blocks/ConversionBlocks.tsx +571 -0
- package/template/themes/preveris/src/blocks/HeaderBlocks.tsx +299 -0
- package/template/themes/preveris/src/index.tsx +53 -0
- package/template/themes/preveris/src/kit.tsx +365 -0
- package/template/themes/preveris/src/site.ts +79 -0
- package/template/themes/preveris/src/styles.css +446 -0
- package/template/themes/sidibou/screenshot.jpg +0 -0
- package/template/themes/sidibou/snapify.theme.json +21 -0
- package/template/themes/sidibou/src/CeeSimulator.tsx +247 -0
- package/template/themes/sidibou/src/Footer.tsx +203 -0
- package/template/themes/sidibou/src/Header.tsx +324 -0
- package/template/themes/sidibou/src/Layout.tsx +53 -0
- package/template/themes/sidibou/src/NotFound.tsx +58 -0
- package/template/themes/sidibou/src/Post.tsx +26 -0
- package/template/themes/sidibou/src/SnapifyLogo.tsx +44 -0
- package/template/themes/sidibou/src/blocks/CollectionBlocks.tsx +711 -0
- package/template/themes/sidibou/src/blocks/ContentBlocks.tsx +318 -0
- package/template/themes/sidibou/src/blocks/ConversionBlocks.tsx +559 -0
- package/template/themes/sidibou/src/blocks/HeaderBlocks.tsx +341 -0
- package/template/themes/sidibou/src/index.tsx +54 -0
- package/template/themes/sidibou/src/kit.tsx +398 -0
- package/template/themes/sidibou/src/site.ts +28 -0
- package/template/themes/sidibou/src/styles.css +317 -0
- package/template/tsconfig.json +33 -0
- 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
|
+
};
|