@sonordev/site-kit 5.5.0 → 5.6.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.
- package/agent-manifest.json +1 -1
- package/dist/AnalyticsProvider-6PXC7UDP.js +32 -0
- package/dist/{AnalyticsProvider-WDDW3IJW.js.map → AnalyticsProvider-6PXC7UDP.js.map} +1 -1
- package/dist/AnalyticsProvider-FVQIYSLY.mjs +11 -0
- package/dist/{AnalyticsProvider-KFXAH4GR.mjs.map → AnalyticsProvider-FVQIYSLY.mjs.map} +1 -1
- package/dist/{BlogViewTracker-D4DIEP4Q.js → BlogViewTracker-S4HSRCW7.js} +6 -6
- package/dist/{BlogViewTracker-D4DIEP4Q.js.map → BlogViewTracker-S4HSRCW7.js.map} +1 -1
- package/dist/{BlogViewTracker-ZVEGGH3Y.mjs → BlogViewTracker-ZUGLBOVI.mjs} +5 -5
- package/dist/{BlogViewTracker-ZVEGGH3Y.mjs.map → BlogViewTracker-ZUGLBOVI.mjs.map} +1 -1
- package/dist/ChatWidget-2TQWCXWP.js +22 -0
- package/dist/{ChatWidget-2ZYPYIMQ.js.map → ChatWidget-2TQWCXWP.js.map} +1 -1
- package/dist/ChatWidget-DG52ZIE6.mjs +13 -0
- package/dist/{ChatWidget-FYCCLMQE.mjs.map → ChatWidget-DG52ZIE6.mjs.map} +1 -1
- package/dist/EngageWidget-2VUJADIU.mjs +12 -0
- package/dist/{EngageWidget-6HUZYOY7.mjs.map → EngageWidget-2VUJADIU.mjs.map} +1 -1
- package/dist/EngageWidget-Z7RC2INM.js +21 -0
- package/dist/{EngageWidget-MYQTBBW6.js.map → EngageWidget-Z7RC2INM.js.map} +1 -1
- package/dist/{FileField-OZZHWGPA.mjs → FileField-FSQ7W3A5.mjs} +5 -5
- package/dist/{FileField-OZZHWGPA.mjs.map → FileField-FSQ7W3A5.mjs.map} +1 -1
- package/dist/{FileField-JK2S24XU.js → FileField-UOQHL25J.js} +6 -6
- package/dist/{FileField-JK2S24XU.js.map → FileField-UOQHL25J.js.map} +1 -1
- package/dist/{FormSpotlight-XV42L72H.mjs → FormSpotlight-RHL5FWM2.mjs} +3 -3
- package/dist/{FormSpotlight-XV42L72H.mjs.map → FormSpotlight-RHL5FWM2.mjs.map} +1 -1
- package/dist/{FormSpotlight-5AXFQU5M.js → FormSpotlight-TED32NHP.js} +15 -15
- package/dist/{FormSpotlight-5AXFQU5M.js.map → FormSpotlight-TED32NHP.js.map} +1 -1
- package/dist/{FormStage-RUK675HV.mjs → FormStage-DINIRFOX.mjs} +3 -3
- package/dist/{FormStage-RUK675HV.mjs.map → FormStage-DINIRFOX.mjs.map} +1 -1
- package/dist/{FormStage-HATUHNRV.js → FormStage-PFEBKHGY.js} +13 -13
- package/dist/{FormStage-HATUHNRV.js.map → FormStage-PFEBKHGY.js.map} +1 -1
- package/dist/ManagedForm-43WLCUAK.js +23 -0
- package/dist/{ManagedForm-JWEXJEXK.js.map → ManagedForm-43WLCUAK.js.map} +1 -1
- package/dist/ManagedForm-545YAUFC.mjs +14 -0
- package/dist/{ManagedForm-OA3MNGXT.mjs.map → ManagedForm-545YAUFC.mjs.map} +1 -1
- package/dist/{ManagedNewsletterForm-AAHH63KT.js → ManagedNewsletterForm-I3QN57HB.js} +8 -8
- package/dist/{ManagedNewsletterForm-AAHH63KT.js.map → ManagedNewsletterForm-I3QN57HB.js.map} +1 -1
- package/dist/{ManagedNewsletterForm-HZKTNWLW.mjs → ManagedNewsletterForm-ZPY5RRKX.mjs} +7 -7
- package/dist/{ManagedNewsletterForm-HZKTNWLW.mjs.map → ManagedNewsletterForm-ZPY5RRKX.mjs.map} +1 -1
- package/dist/{SignalCore-X3GDGBZD.mjs → SignalCore-EEH5IM4U.mjs} +5 -5
- package/dist/{SignalCore-X3GDGBZD.mjs.map → SignalCore-EEH5IM4U.mjs.map} +1 -1
- package/dist/{SignalCore-YSNZYBKJ.js → SignalCore-M4AXIMV4.js} +11 -11
- package/dist/{SignalCore-YSNZYBKJ.js.map → SignalCore-M4AXIMV4.js.map} +1 -1
- package/dist/SitemapSync-46G7LVZS.mjs +9 -0
- package/dist/{SitemapSync-2PTDBH5E.mjs.map → SitemapSync-46G7LVZS.mjs.map} +1 -1
- package/dist/SitemapSync-XK4JKCS7.js +18 -0
- package/dist/{SitemapSync-3SFAI546.js.map → SitemapSync-XK4JKCS7.js.map} +1 -1
- package/dist/SitemapSync.d.ts +3 -2
- package/dist/SitemapSync.d.ts.map +1 -1
- package/dist/analytics/AnalyticsProvider.d.ts +3 -1
- package/dist/analytics/AnalyticsProvider.d.ts.map +1 -1
- package/dist/analytics/WebVitals.d.ts +3 -1
- package/dist/analytics/WebVitals.d.ts.map +1 -1
- package/dist/analytics/index.js +13 -13
- package/dist/analytics/index.mjs +5 -5
- package/dist/analytics/send-gate.d.ts +8 -37
- package/dist/analytics/send-gate.d.ts.map +1 -1
- package/dist/blog/index.js +20 -20
- package/dist/blog/index.mjs +3 -3
- package/dist/blog/server-ui.js +14 -14
- package/dist/blog/server-ui.mjs +2 -2
- package/dist/{chunk-RMMHWSPP.mjs → chunk-473WDGQZ.mjs} +3 -3
- package/dist/{chunk-RMMHWSPP.mjs.map → chunk-473WDGQZ.mjs.map} +1 -1
- package/dist/{chunk-FYVLQ3OU.js → chunk-53KMRZT7.js} +3 -3
- package/dist/{chunk-FYVLQ3OU.js.map → chunk-53KMRZT7.js.map} +1 -1
- package/dist/{chunk-S6FEC6UT.mjs → chunk-5KIEZHVK.mjs} +14 -17
- package/dist/chunk-5KIEZHVK.mjs.map +1 -0
- package/dist/{chunk-MCJF2KJ6.js → chunk-5KIO6FXE.js} +5 -5
- package/dist/{chunk-MCJF2KJ6.js.map → chunk-5KIO6FXE.js.map} +1 -1
- package/dist/chunk-5RNAUYWE.js +50 -0
- package/dist/chunk-5RNAUYWE.js.map +1 -0
- package/dist/{chunk-MU7IEPDG.mjs → chunk-5UFDHGFE.mjs} +3 -3
- package/dist/{chunk-MU7IEPDG.mjs.map → chunk-5UFDHGFE.mjs.map} +1 -1
- package/dist/{chunk-V6NOM7PJ.mjs → chunk-6OP5XSMM.mjs} +3 -3
- package/dist/{chunk-V6NOM7PJ.mjs.map → chunk-6OP5XSMM.mjs.map} +1 -1
- package/dist/{chunk-TALEV3IH.mjs → chunk-7AUDKXY5.mjs} +3 -3
- package/dist/{chunk-TALEV3IH.mjs.map → chunk-7AUDKXY5.mjs.map} +1 -1
- package/dist/{chunk-3B6CXGAK.mjs → chunk-7C7XO5HX.mjs} +3 -3
- package/dist/{chunk-3B6CXGAK.mjs.map → chunk-7C7XO5HX.mjs.map} +1 -1
- package/dist/chunk-A6UYV475.mjs +45 -0
- package/dist/chunk-A6UYV475.mjs.map +1 -0
- package/dist/{chunk-ZRQFG3L6.mjs → chunk-AHZR4VGY.mjs} +4 -4
- package/dist/{chunk-ZRQFG3L6.mjs.map → chunk-AHZR4VGY.mjs.map} +1 -1
- package/dist/{chunk-YYAFHIY7.js → chunk-AY7JBGYC.js} +14 -14
- package/dist/{chunk-YYAFHIY7.js.map → chunk-AY7JBGYC.js.map} +1 -1
- package/dist/{chunk-CT5REGAK.js → chunk-B64AZC6P.js} +14 -14
- package/dist/{chunk-CT5REGAK.js.map → chunk-B64AZC6P.js.map} +1 -1
- package/dist/{chunk-VAS3LH5W.js → chunk-B6O7D5U4.js} +55 -49
- package/dist/chunk-B6O7D5U4.js.map +1 -0
- package/dist/{chunk-A3F5GRNJ.js → chunk-BWSMUSDB.js} +8 -8
- package/dist/{chunk-A3F5GRNJ.js.map → chunk-BWSMUSDB.js.map} +1 -1
- package/dist/{chunk-2CMSWJWC.js → chunk-BZLIOT7Q.js} +18 -18
- package/dist/{chunk-2CMSWJWC.js.map → chunk-BZLIOT7Q.js.map} +1 -1
- package/dist/{chunk-DRLHQQBH.mjs → chunk-C2MSD2UM.mjs} +4 -4
- package/dist/{chunk-DRLHQQBH.mjs.map → chunk-C2MSD2UM.mjs.map} +1 -1
- package/dist/{chunk-YNC5D3FT.js → chunk-CQRLKNHQ.js} +12 -12
- package/dist/{chunk-YNC5D3FT.js.map → chunk-CQRLKNHQ.js.map} +1 -1
- package/dist/{chunk-RZUZMUTN.mjs → chunk-CQS5ZYI6.mjs} +21 -9
- package/dist/chunk-CQS5ZYI6.mjs.map +1 -0
- package/dist/{chunk-W5NVW23S.js → chunk-DHIWR7CG.js} +4 -4
- package/dist/{chunk-W5NVW23S.js.map → chunk-DHIWR7CG.js.map} +1 -1
- package/dist/chunk-DQUBETXH.mjs +6 -0
- package/dist/{chunk-WDBCXRTT.mjs.map → chunk-DQUBETXH.mjs.map} +1 -1
- package/dist/{chunk-TX2QQ7IX.mjs → chunk-GJ6NOLGC.mjs} +3 -3
- package/dist/{chunk-TX2QQ7IX.mjs.map → chunk-GJ6NOLGC.mjs.map} +1 -1
- package/dist/{chunk-R4MX6EOM.mjs → chunk-GPLCPMVD.mjs} +7 -7
- package/dist/{chunk-R4MX6EOM.mjs.map → chunk-GPLCPMVD.mjs.map} +1 -1
- package/dist/{chunk-2OU4KBUN.js → chunk-H3D3ZGOJ.js} +15 -15
- package/dist/{chunk-2OU4KBUN.js.map → chunk-H3D3ZGOJ.js.map} +1 -1
- package/dist/{chunk-UZL2QU2V.mjs → chunk-H44XZUOV.mjs} +4 -4
- package/dist/{chunk-UZL2QU2V.mjs.map → chunk-H44XZUOV.mjs.map} +1 -1
- package/dist/{chunk-OFSA7LUH.mjs → chunk-HIHAXEPD.mjs} +4 -4
- package/dist/{chunk-OFSA7LUH.mjs.map → chunk-HIHAXEPD.mjs.map} +1 -1
- package/dist/{chunk-DYULWKDC.mjs → chunk-IYCLN3XS.mjs} +14 -33
- package/dist/chunk-IYCLN3XS.mjs.map +1 -0
- package/dist/{chunk-BNOQXDPJ.js → chunk-JE5DWAE6.js} +4 -4
- package/dist/{chunk-BNOQXDPJ.js.map → chunk-JE5DWAE6.js.map} +1 -1
- package/dist/{chunk-VYHRAICF.mjs → chunk-JNABXCLY.mjs} +4 -4
- package/dist/{chunk-VYHRAICF.mjs.map → chunk-JNABXCLY.mjs.map} +1 -1
- package/dist/{chunk-4XGACM7D.mjs → chunk-K2V3ZW36.mjs} +3 -3
- package/dist/{chunk-4XGACM7D.mjs.map → chunk-K2V3ZW36.mjs.map} +1 -1
- package/dist/chunk-KSL3WA2I.js +8 -0
- package/dist/{chunk-SUZ3ZLB2.js.map → chunk-KSL3WA2I.js.map} +1 -1
- package/dist/{chunk-HX3BRMOX.js → chunk-KY6M76JW.js} +3 -3
- package/dist/{chunk-HX3BRMOX.js.map → chunk-KY6M76JW.js.map} +1 -1
- package/dist/{chunk-X2XFLYZ3.mjs → chunk-LCSYJXIO.mjs} +3 -3
- package/dist/{chunk-X2XFLYZ3.mjs.map → chunk-LCSYJXIO.mjs.map} +1 -1
- package/dist/{chunk-UNPEMSLK.js → chunk-N2PGTPWN.js} +24 -12
- package/dist/chunk-N2PGTPWN.js.map +1 -0
- package/dist/{chunk-7PPNXORV.mjs → chunk-OA7KKOAK.mjs} +25 -31
- package/dist/chunk-OA7KKOAK.mjs.map +1 -0
- package/dist/{chunk-QEGUI2Q2.js → chunk-OC7AO7XS.js} +15 -15
- package/dist/{chunk-QEGUI2Q2.js.map → chunk-OC7AO7XS.js.map} +1 -1
- package/dist/{chunk-5TGAUWNO.mjs → chunk-QNPVVWR7.mjs} +3 -3
- package/dist/{chunk-5TGAUWNO.mjs.map → chunk-QNPVVWR7.mjs.map} +1 -1
- package/dist/{chunk-MNYM2XU4.js → chunk-R3KTBKSW.js} +4 -4
- package/dist/{chunk-MNYM2XU4.js.map → chunk-R3KTBKSW.js.map} +1 -1
- package/dist/{chunk-WIZRCI6J.mjs → chunk-RIYAMYLV.mjs} +3 -3
- package/dist/{chunk-WIZRCI6J.mjs.map → chunk-RIYAMYLV.mjs.map} +1 -1
- package/dist/{chunk-SQVYLIIN.js → chunk-S4RC6VAQ.js} +16 -19
- package/dist/chunk-S4RC6VAQ.js.map +1 -0
- package/dist/{chunk-Z6S4MWSR.js → chunk-SYGGZZMU.js} +21 -17
- package/dist/chunk-SYGGZZMU.js.map +1 -0
- package/dist/{chunk-FF5N5D3D.js → chunk-T5VTQUNF.js} +8 -8
- package/dist/{chunk-FF5N5D3D.js.map → chunk-T5VTQUNF.js.map} +1 -1
- package/dist/{chunk-G5HUI4BO.mjs → chunk-USKIL6V6.mjs} +3 -3
- package/dist/{chunk-G5HUI4BO.mjs.map → chunk-USKIL6V6.mjs.map} +1 -1
- package/dist/{chunk-PIPLBBDH.js → chunk-UU47DGHE.js} +22 -41
- package/dist/chunk-UU47DGHE.js.map +1 -0
- package/dist/{chunk-XQYC4KMH.mjs → chunk-VHZ4LHQT.mjs} +48 -42
- package/dist/chunk-VHZ4LHQT.mjs.map +1 -0
- package/dist/{chunk-Q26VZNM2.js → chunk-X5TCH7VZ.js} +3 -3
- package/dist/{chunk-Q26VZNM2.js.map → chunk-X5TCH7VZ.js.map} +1 -1
- package/dist/{chunk-QFNSM77X.js → chunk-XK5AIWQG.js} +3 -3
- package/dist/{chunk-QFNSM77X.js.map → chunk-XK5AIWQG.js.map} +1 -1
- package/dist/{chunk-KAUUGRYB.js → chunk-XR32C47O.js} +26 -32
- package/dist/chunk-XR32C47O.js.map +1 -0
- package/dist/{chunk-HBI67P7Y.mjs → chunk-YCI36ZUS.mjs} +18 -14
- package/dist/chunk-YCI36ZUS.mjs.map +1 -0
- package/dist/{chunk-HFJQMIFM.js → chunk-YYN4YZYZ.js} +4 -4
- package/dist/{chunk-HFJQMIFM.js.map → chunk-YYN4YZYZ.js.map} +1 -1
- package/dist/cli/api/{uptrade.d.ts → sonor.d.ts} +3 -2
- package/dist/cli/api/sonor.d.ts.map +1 -0
- package/dist/cli/commands/config-regression.test.d.ts +2 -0
- package/dist/cli/commands/config-regression.test.d.ts.map +1 -0
- package/dist/cli/commands/faqs.d.ts.map +1 -1
- package/dist/cli/commands/images.d.ts.map +1 -1
- package/dist/cli/commands/locations.d.ts.map +1 -1
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/config.d.ts +31 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.test.d.ts +2 -0
- package/dist/cli/config.test.d.ts.map +1 -0
- package/dist/cli/index.js +459 -470
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +452 -463
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/migrator/index.d.ts +1 -0
- package/dist/cli/migrator/index.d.ts.map +1 -1
- package/dist/cli/state.d.ts +7 -0
- package/dist/cli/state.d.ts.map +1 -0
- package/dist/cli/state.test.d.ts +2 -0
- package/dist/cli/state.test.d.ts.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/commerce/index.js +57 -57
- package/dist/commerce/index.mjs +6 -6
- package/dist/engage/EngageWidget.d.ts +3 -2
- package/dist/engage/EngageWidget.d.ts.map +1 -1
- package/dist/engage/index.js +11 -10
- package/dist/engage/index.js.map +1 -1
- package/dist/engage/index.mjs +8 -7
- package/dist/engage/index.mjs.map +1 -1
- package/dist/fleet/FleetHeartbeat.d.ts +3 -2
- package/dist/fleet/FleetHeartbeat.d.ts.map +1 -1
- package/dist/fleet/heartbeat.d.ts +3 -2
- package/dist/fleet/heartbeat.d.ts.map +1 -1
- package/dist/fleet/heartbeat.test.d.ts +2 -0
- package/dist/fleet/heartbeat.test.d.ts.map +1 -0
- package/dist/fleet/index.js +9 -8
- package/dist/fleet/index.mjs +5 -4
- package/dist/forms/index.js +16 -16
- package/dist/forms/index.mjs +9 -9
- package/dist/forms/server.js +10 -10
- package/dist/forms/server.mjs +8 -8
- package/dist/forms/static.js +7 -7
- package/dist/forms/static.mjs +6 -6
- package/dist/images/index.js +11 -11
- package/dist/images/index.mjs +4 -4
- package/dist/index.js +64 -64
- package/dist/index.mjs +10 -10
- package/dist/layout/SiteKitClientProviders.d.ts.map +1 -1
- package/dist/layout/client.d.ts.map +1 -1
- package/dist/layout/client.js +9 -8
- package/dist/layout/client.mjs +8 -7
- package/dist/layout/index.js +11 -10
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/index.mjs +9 -8
- package/dist/layout/index.mjs.map +1 -1
- package/dist/layout/types.d.ts +2 -0
- package/dist/layout/types.d.ts.map +1 -1
- package/dist/maps/index.js +5 -5
- package/dist/maps/index.mjs +3 -3
- package/dist/search/index.js +4 -4
- package/dist/search/index.mjs +3 -3
- package/dist/seo/client.js +6 -6
- package/dist/seo/client.mjs +5 -5
- package/dist/seo/index.js +6 -6
- package/dist/seo/index.mjs +5 -5
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/dist/shared/reporting-gate.d.ts +43 -0
- package/dist/shared/reporting-gate.d.ts.map +1 -0
- package/dist/shared/version.d.ts +1 -1
- package/dist/signal/index.js +11 -11
- package/dist/signal/index.mjs +2 -2
- package/dist/sync/AddToCalendar.d.ts +19 -0
- package/dist/sync/AddToCalendar.d.ts.map +1 -0
- package/dist/sync/BookingWidget.d.ts.map +1 -1
- package/dist/sync/add-to-calendar.test.d.ts +2 -0
- package/dist/sync/add-to-calendar.test.d.ts.map +1 -0
- package/dist/sync/api-errors.test.d.ts +2 -0
- package/dist/sync/api-errors.test.d.ts.map +1 -0
- package/dist/sync/api.d.ts.map +1 -1
- package/dist/sync/index.js +17 -17
- package/dist/sync/index.mjs +4 -4
- package/dist/sync/types.d.ts +14 -0
- package/dist/sync/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/AnalyticsProvider-KFXAH4GR.mjs +0 -11
- package/dist/AnalyticsProvider-WDDW3IJW.js +0 -32
- package/dist/ChatWidget-2ZYPYIMQ.js +0 -22
- package/dist/ChatWidget-FYCCLMQE.mjs +0 -13
- package/dist/EngageWidget-6HUZYOY7.mjs +0 -11
- package/dist/EngageWidget-MYQTBBW6.js +0 -20
- package/dist/ManagedForm-JWEXJEXK.js +0 -23
- package/dist/ManagedForm-OA3MNGXT.mjs +0 -14
- package/dist/SitemapSync-2PTDBH5E.mjs +0 -9
- package/dist/SitemapSync-3SFAI546.js +0 -18
- package/dist/chunk-7PPNXORV.mjs.map +0 -1
- package/dist/chunk-DYULWKDC.mjs.map +0 -1
- package/dist/chunk-HBI67P7Y.mjs.map +0 -1
- package/dist/chunk-KAUUGRYB.js.map +0 -1
- package/dist/chunk-NVSWTDWU.mjs +0 -25
- package/dist/chunk-NVSWTDWU.mjs.map +0 -1
- package/dist/chunk-OL2QBWAU.js +0 -29
- package/dist/chunk-OL2QBWAU.js.map +0 -1
- package/dist/chunk-PIPLBBDH.js.map +0 -1
- package/dist/chunk-RZUZMUTN.mjs.map +0 -1
- package/dist/chunk-S6FEC6UT.mjs.map +0 -1
- package/dist/chunk-SQVYLIIN.js.map +0 -1
- package/dist/chunk-SUZ3ZLB2.js +0 -8
- package/dist/chunk-UNPEMSLK.js.map +0 -1
- package/dist/chunk-VAS3LH5W.js.map +0 -1
- package/dist/chunk-WDBCXRTT.mjs +0 -6
- package/dist/chunk-XQYC4KMH.mjs.map +0 -1
- package/dist/chunk-Z6S4MWSR.js.map +0 -1
- package/dist/cli/api/uptrade.d.ts.map +0 -1
package/dist/cli/index.js
CHANGED
|
@@ -6,11 +6,11 @@ var chunkI7AZC5ZQ_js = require('../chunk-I7AZC5ZQ.js');
|
|
|
6
6
|
var chunk6CJP7BFM_js = require('../chunk-6CJP7BFM.js');
|
|
7
7
|
var chunkNN2YE5WT_js = require('../chunk-NN2YE5WT.js');
|
|
8
8
|
var chunkLOS5D6B3_js = require('../chunk-LOS5D6B3.js');
|
|
9
|
-
var
|
|
9
|
+
var chunkKSL3WA2I_js = require('../chunk-KSL3WA2I.js');
|
|
10
10
|
var chunkSNAQBZPT_js = require('../chunk-SNAQBZPT.js');
|
|
11
11
|
var events = require('events');
|
|
12
12
|
var childProcess = require('child_process');
|
|
13
|
-
var
|
|
13
|
+
var path12 = require('path');
|
|
14
14
|
var fs = require('fs');
|
|
15
15
|
var process2 = require('process');
|
|
16
16
|
var util = require('util');
|
|
@@ -48,7 +48,7 @@ function _interopNamespace(e) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
var childProcess__default = /*#__PURE__*/_interopDefault(childProcess);
|
|
51
|
-
var
|
|
51
|
+
var path12__default = /*#__PURE__*/_interopDefault(path12);
|
|
52
52
|
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
53
53
|
var process2__default = /*#__PURE__*/_interopDefault(process2);
|
|
54
54
|
var os__default = /*#__PURE__*/_interopDefault(os);
|
|
@@ -6234,10 +6234,10 @@ var require_lib2 = chunkSNAQBZPT_js.__commonJS({
|
|
|
6234
6234
|
exports.analyse = analyse;
|
|
6235
6235
|
var detectFile = (filepath, opts = {}) => new Promise((resolve, reject) => {
|
|
6236
6236
|
let fd;
|
|
6237
|
-
const
|
|
6237
|
+
const fs29 = (0, node_1.default)();
|
|
6238
6238
|
const handler = (err, buffer) => {
|
|
6239
6239
|
if (fd) {
|
|
6240
|
-
|
|
6240
|
+
fs29.closeSync(fd);
|
|
6241
6241
|
}
|
|
6242
6242
|
if (err) {
|
|
6243
6243
|
reject(err);
|
|
@@ -6249,9 +6249,9 @@ var require_lib2 = chunkSNAQBZPT_js.__commonJS({
|
|
|
6249
6249
|
};
|
|
6250
6250
|
const sampleSize = (opts === null || opts === void 0 ? void 0 : opts.sampleSize) || 0;
|
|
6251
6251
|
if (sampleSize > 0) {
|
|
6252
|
-
fd =
|
|
6252
|
+
fd = fs29.openSync(filepath, "r");
|
|
6253
6253
|
let sample = Buffer.allocUnsafe(sampleSize);
|
|
6254
|
-
|
|
6254
|
+
fs29.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
|
|
6255
6255
|
if (err) {
|
|
6256
6256
|
handler(err, null);
|
|
6257
6257
|
} else {
|
|
@@ -6263,22 +6263,22 @@ var require_lib2 = chunkSNAQBZPT_js.__commonJS({
|
|
|
6263
6263
|
});
|
|
6264
6264
|
return;
|
|
6265
6265
|
}
|
|
6266
|
-
|
|
6266
|
+
fs29.readFile(filepath, handler);
|
|
6267
6267
|
});
|
|
6268
6268
|
exports.detectFile = detectFile;
|
|
6269
6269
|
var detectFileSync = (filepath, opts = {}) => {
|
|
6270
|
-
const
|
|
6270
|
+
const fs29 = (0, node_1.default)();
|
|
6271
6271
|
if (opts && opts.sampleSize) {
|
|
6272
|
-
const fd =
|
|
6272
|
+
const fd = fs29.openSync(filepath, "r");
|
|
6273
6273
|
let sample = Buffer.allocUnsafe(opts.sampleSize);
|
|
6274
|
-
const bytesRead =
|
|
6274
|
+
const bytesRead = fs29.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
|
|
6275
6275
|
if (bytesRead < opts.sampleSize) {
|
|
6276
6276
|
sample = sample.subarray(0, bytesRead);
|
|
6277
6277
|
}
|
|
6278
|
-
|
|
6278
|
+
fs29.closeSync(fd);
|
|
6279
6279
|
return (0, exports.detect)(sample);
|
|
6280
6280
|
}
|
|
6281
|
-
return (0, exports.detect)(
|
|
6281
|
+
return (0, exports.detect)(fs29.readFileSync(filepath));
|
|
6282
6282
|
};
|
|
6283
6283
|
exports.detectFileSync = detectFileSync;
|
|
6284
6284
|
exports.default = {
|
|
@@ -10167,7 +10167,7 @@ var require_run_async = chunkSNAQBZPT_js.__commonJS({
|
|
|
10167
10167
|
});
|
|
10168
10168
|
|
|
10169
10169
|
// src/cli/index.ts
|
|
10170
|
-
var
|
|
10170
|
+
var import_dotenv2 = chunkSNAQBZPT_js.__toESM(chunkNN2YE5WT_js.require_main());
|
|
10171
10171
|
|
|
10172
10172
|
// node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js
|
|
10173
10173
|
var CommanderError = class extends Error {
|
|
@@ -12296,9 +12296,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
12296
12296
|
args = args.slice();
|
|
12297
12297
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
12298
12298
|
function findFile(baseDir, baseName) {
|
|
12299
|
-
const localBin =
|
|
12299
|
+
const localBin = path12__default.default.resolve(baseDir, baseName);
|
|
12300
12300
|
if (fs__namespace.default.existsSync(localBin)) return localBin;
|
|
12301
|
-
if (sourceExt.includes(
|
|
12301
|
+
if (sourceExt.includes(path12__default.default.extname(baseName))) return void 0;
|
|
12302
12302
|
const foundExt = sourceExt.find(
|
|
12303
12303
|
(ext2) => fs__namespace.default.existsSync(`${localBin}${ext2}`)
|
|
12304
12304
|
);
|
|
@@ -12316,17 +12316,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
12316
12316
|
} catch {
|
|
12317
12317
|
resolvedScriptPath = this._scriptPath;
|
|
12318
12318
|
}
|
|
12319
|
-
executableDir =
|
|
12320
|
-
|
|
12319
|
+
executableDir = path12__default.default.resolve(
|
|
12320
|
+
path12__default.default.dirname(resolvedScriptPath),
|
|
12321
12321
|
executableDir
|
|
12322
12322
|
);
|
|
12323
12323
|
}
|
|
12324
12324
|
if (executableDir) {
|
|
12325
12325
|
let localFile = findFile(executableDir, executableFile);
|
|
12326
12326
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
12327
|
-
const legacyName =
|
|
12327
|
+
const legacyName = path12__default.default.basename(
|
|
12328
12328
|
this._scriptPath,
|
|
12329
|
-
|
|
12329
|
+
path12__default.default.extname(this._scriptPath)
|
|
12330
12330
|
);
|
|
12331
12331
|
if (legacyName !== this._name) {
|
|
12332
12332
|
localFile = findFile(
|
|
@@ -12337,7 +12337,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
12337
12337
|
}
|
|
12338
12338
|
executableFile = localFile || executableFile;
|
|
12339
12339
|
}
|
|
12340
|
-
const launchWithNode = sourceExt.includes(
|
|
12340
|
+
const launchWithNode = sourceExt.includes(path12__default.default.extname(executableFile));
|
|
12341
12341
|
let proc;
|
|
12342
12342
|
if (process2__default.default.platform !== "win32") {
|
|
12343
12343
|
if (launchWithNode) {
|
|
@@ -13254,7 +13254,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
13254
13254
|
* @return {Command}
|
|
13255
13255
|
*/
|
|
13256
13256
|
nameFromFilename(filename) {
|
|
13257
|
-
this._name =
|
|
13257
|
+
this._name = path12__default.default.basename(filename, path12__default.default.extname(filename));
|
|
13258
13258
|
return this;
|
|
13259
13259
|
}
|
|
13260
13260
|
/**
|
|
@@ -13268,9 +13268,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
13268
13268
|
* @param {string} [path]
|
|
13269
13269
|
* @return {(string|null|Command)}
|
|
13270
13270
|
*/
|
|
13271
|
-
executableDir(
|
|
13272
|
-
if (
|
|
13273
|
-
this._executableDir =
|
|
13271
|
+
executableDir(path29) {
|
|
13272
|
+
if (path29 === void 0) return this._executableDir;
|
|
13273
|
+
this._executableDir = path29;
|
|
13274
13274
|
return this;
|
|
13275
13275
|
}
|
|
13276
13276
|
/**
|
|
@@ -13543,7 +13543,7 @@ function buildEnvelope(input, nowMs = Date.now()) {
|
|
|
13543
13543
|
ok: exitCode === 0 /* OK */,
|
|
13544
13544
|
command,
|
|
13545
13545
|
schemaVersion: 1,
|
|
13546
|
-
siteKitVersion:
|
|
13546
|
+
siteKitVersion: chunkKSL3WA2I_js.SITE_KIT_VERSION,
|
|
13547
13547
|
exitCode,
|
|
13548
13548
|
status: statusForCode(exitCode),
|
|
13549
13549
|
summary,
|
|
@@ -18779,7 +18779,7 @@ function createPrompt(view) {
|
|
|
18779
18779
|
if (nextView === void 0) {
|
|
18780
18780
|
let callerFilename = callSites[1]?.getFileName();
|
|
18781
18781
|
if (callerFilename && !callerFilename.startsWith("file://")) {
|
|
18782
|
-
callerFilename =
|
|
18782
|
+
callerFilename = path12__default.default.resolve(callerFilename);
|
|
18783
18783
|
}
|
|
18784
18784
|
throw new Error(`Prompt functions must return a string.
|
|
18785
18785
|
at ${callerFilename}`);
|
|
@@ -19168,13 +19168,13 @@ var ExternalEditor = class {
|
|
|
19168
19168
|
}
|
|
19169
19169
|
createTempFile() {
|
|
19170
19170
|
try {
|
|
19171
|
-
const baseDir =
|
|
19172
|
-
this.tempDir = fs.mkdtempSync(
|
|
19171
|
+
const baseDir = path12__default.default.resolve(this.fileOptions.dir ?? os__default.default.tmpdir());
|
|
19172
|
+
this.tempDir = fs.mkdtempSync(path12__default.default.join(baseDir, "inquirer-editor-"));
|
|
19173
19173
|
const id = crypto.randomUUID();
|
|
19174
19174
|
const prefix = sanitizeAffix(this.fileOptions.prefix);
|
|
19175
19175
|
const postfix = sanitizeAffix(this.fileOptions.postfix);
|
|
19176
19176
|
const filename = `${prefix}${id}${postfix}`;
|
|
19177
|
-
this.tempFile =
|
|
19177
|
+
this.tempFile = path12__default.default.join(this.tempDir, filename);
|
|
19178
19178
|
const opt = { encoding: "utf8", flag: "wx" };
|
|
19179
19179
|
if (Object.prototype.hasOwnProperty.call(this.fileOptions, "mode")) {
|
|
19180
19180
|
opt.mode = this.fileOptions.mode;
|
|
@@ -20377,9 +20377,9 @@ function observableToAsyncIterable(source) {
|
|
|
20377
20377
|
|
|
20378
20378
|
// node_modules/.pnpm/inquirer@14.0.2_@types+node@26.2.0/node_modules/inquirer/dist/ui/prompt.js
|
|
20379
20379
|
var _ = {
|
|
20380
|
-
set: (obj,
|
|
20380
|
+
set: (obj, path29 = "", value) => {
|
|
20381
20381
|
let pointer = obj;
|
|
20382
|
-
|
|
20382
|
+
path29.split(".").forEach((key, index, arr) => {
|
|
20383
20383
|
if (key === "__proto__" || key === "constructor")
|
|
20384
20384
|
return;
|
|
20385
20385
|
if (index === arr.length - 1) {
|
|
@@ -20390,8 +20390,8 @@ var _ = {
|
|
|
20390
20390
|
pointer = pointer[key];
|
|
20391
20391
|
});
|
|
20392
20392
|
},
|
|
20393
|
-
get: (obj,
|
|
20394
|
-
const travel = (regexp) => String.prototype.split.call(
|
|
20393
|
+
get: (obj, path29 = "", defaultValue) => {
|
|
20394
|
+
const travel = (regexp) => String.prototype.split.call(path29, regexp).filter(Boolean).reduce(
|
|
20395
20395
|
// @ts-expect-error implicit any on res[key]
|
|
20396
20396
|
(res, key) => res == null ? res : res[key],
|
|
20397
20397
|
obj
|
|
@@ -20681,7 +20681,7 @@ async function scanCodebase(rootDir) {
|
|
|
20681
20681
|
for (const file of files) {
|
|
20682
20682
|
try {
|
|
20683
20683
|
const content = await fs3__default.default.readFile(file, "utf-8");
|
|
20684
|
-
const relPath =
|
|
20684
|
+
const relPath = path12__default.default.relative(rootDir, file);
|
|
20685
20685
|
const ast = chunkI7AZC5ZQ_js.parse(content, {
|
|
20686
20686
|
sourceType: "module",
|
|
20687
20687
|
plugins: ["jsx", "typescript"]
|
|
@@ -20730,7 +20730,7 @@ async function scanCodebase(rootDir) {
|
|
|
20730
20730
|
async function findSourceFiles(dir, files = []) {
|
|
20731
20731
|
const entries = await fs3__default.default.readdir(dir, { withFileTypes: true });
|
|
20732
20732
|
for (const entry of entries) {
|
|
20733
|
-
const fullPath =
|
|
20733
|
+
const fullPath = path12__default.default.join(dir, entry.name);
|
|
20734
20734
|
if (entry.isDirectory()) {
|
|
20735
20735
|
if (["node_modules", ".next", ".git", "dist", "build"].includes(entry.name)) {
|
|
20736
20736
|
continue;
|
|
@@ -20748,18 +20748,18 @@ function scanForForms(ast, content, filePath) {
|
|
|
20748
20748
|
const forms = [];
|
|
20749
20749
|
content.split("\n");
|
|
20750
20750
|
chunkJS75ORH7_js.traverse(ast, {
|
|
20751
|
-
JSXElement(
|
|
20752
|
-
const opening =
|
|
20751
|
+
JSXElement(path29) {
|
|
20752
|
+
const opening = path29.node.openingElement;
|
|
20753
20753
|
if (chunkJS75ORH7_js.isJSXIdentifier(opening.name) && opening.name.name === "form") {
|
|
20754
|
-
const fields = extractFieldsFromForm(
|
|
20754
|
+
const fields = extractFieldsFromForm(path29);
|
|
20755
20755
|
const hasOnSubmit = opening.attributes.some(
|
|
20756
20756
|
(attr) => chunkJS75ORH7_js.isJSXAttribute(attr) && chunkJS75ORH7_js.isJSXIdentifier(attr.name) && attr.name.name === "onSubmit"
|
|
20757
20757
|
);
|
|
20758
20758
|
if (hasOnSubmit && fields.length > 0) {
|
|
20759
|
-
const startLine =
|
|
20760
|
-
const endLine =
|
|
20759
|
+
const startLine = path29.node.loc?.start.line || 0;
|
|
20760
|
+
const endLine = path29.node.loc?.end.line || 0;
|
|
20761
20761
|
let componentName = "UnknownForm";
|
|
20762
|
-
let current =
|
|
20762
|
+
let current = path29.parentPath;
|
|
20763
20763
|
while (current) {
|
|
20764
20764
|
if (chunkJS75ORH7_js.isFunctionDeclaration(current.node) && current.node.id) {
|
|
20765
20765
|
componentName = current.node.id.name;
|
|
@@ -20792,7 +20792,7 @@ function scanForForms(ast, content, filePath) {
|
|
|
20792
20792
|
}
|
|
20793
20793
|
if (chunkJS75ORH7_js.isJSXIdentifier(opening.name) && opening.name.name === "Form") {
|
|
20794
20794
|
if (content.includes("Formik") || content.includes("formik")) {
|
|
20795
|
-
const fields = extractFieldsFromFormik(
|
|
20795
|
+
const fields = extractFieldsFromFormik(path29);
|
|
20796
20796
|
if (fields.length > 0) {
|
|
20797
20797
|
forms.push({
|
|
20798
20798
|
filePath,
|
|
@@ -20803,8 +20803,8 @@ function scanForForms(ast, content, filePath) {
|
|
|
20803
20803
|
submitsTo: null,
|
|
20804
20804
|
complexity: "moderate",
|
|
20805
20805
|
suggestedAction: "assisted",
|
|
20806
|
-
startLine:
|
|
20807
|
-
endLine:
|
|
20806
|
+
startLine: path29.node.loc?.start.line || 0,
|
|
20807
|
+
endLine: path29.node.loc?.end.line || 0
|
|
20808
20808
|
});
|
|
20809
20809
|
}
|
|
20810
20810
|
}
|
|
@@ -20822,8 +20822,8 @@ function extractFieldsFromForm(formPath) {
|
|
|
20822
20822
|
const radioGroups = /* @__PURE__ */ new Map();
|
|
20823
20823
|
const checkboxGroups = /* @__PURE__ */ new Map();
|
|
20824
20824
|
formPath.traverse({
|
|
20825
|
-
JSXElement(
|
|
20826
|
-
const opening =
|
|
20825
|
+
JSXElement(path29) {
|
|
20826
|
+
const opening = path29.node.openingElement;
|
|
20827
20827
|
const tagName = chunkJS75ORH7_js.isJSXIdentifier(opening.name) ? opening.name.name : null;
|
|
20828
20828
|
if (["input", "textarea", "select"].includes(tagName || "")) {
|
|
20829
20829
|
const attrs = opening.attributes;
|
|
@@ -20870,7 +20870,7 @@ function extractFieldsFromForm(formPath) {
|
|
|
20870
20870
|
}
|
|
20871
20871
|
if (tagName === "select") {
|
|
20872
20872
|
const selectOptions = [];
|
|
20873
|
-
|
|
20873
|
+
path29.traverse({
|
|
20874
20874
|
JSXElement(optionPath) {
|
|
20875
20875
|
const optOpening = optionPath.node.openingElement;
|
|
20876
20876
|
const optTagName = chunkJS75ORH7_js.isJSXIdentifier(optOpening.name) ? optOpening.name.name : null;
|
|
@@ -20945,8 +20945,8 @@ function extractFieldsFromForm(formPath) {
|
|
|
20945
20945
|
function extractFieldsFromFormik(formPath, content) {
|
|
20946
20946
|
const fields = [];
|
|
20947
20947
|
formPath.traverse({
|
|
20948
|
-
JSXElement(
|
|
20949
|
-
const opening =
|
|
20948
|
+
JSXElement(path29) {
|
|
20949
|
+
const opening = path29.node.openingElement;
|
|
20950
20950
|
const tagName = chunkJS75ORH7_js.isJSXIdentifier(opening.name) ? opening.name.name : null;
|
|
20951
20951
|
if (tagName === "Field" || tagName === "FastField") {
|
|
20952
20952
|
const attrs = opening.attributes;
|
|
@@ -21065,11 +21065,11 @@ function scanForMetadata(ast, content, filePath) {
|
|
|
21065
21065
|
}
|
|
21066
21066
|
let hasHeadComponent = false;
|
|
21067
21067
|
chunkJS75ORH7_js.traverse(ast, {
|
|
21068
|
-
JSXElement(
|
|
21069
|
-
const opening =
|
|
21068
|
+
JSXElement(path29) {
|
|
21069
|
+
const opening = path29.node.openingElement;
|
|
21070
21070
|
if (chunkJS75ORH7_js.isJSXIdentifier(opening.name) && opening.name.name === "Head") {
|
|
21071
21071
|
hasHeadComponent = true;
|
|
21072
|
-
|
|
21072
|
+
path29.stop();
|
|
21073
21073
|
}
|
|
21074
21074
|
}
|
|
21075
21075
|
});
|
|
@@ -21104,8 +21104,8 @@ function scanForWidgets(ast, content, filePath) {
|
|
|
21104
21104
|
for (const { pattern, type } of widgetPatterns) {
|
|
21105
21105
|
if (pattern.test(content)) {
|
|
21106
21106
|
chunkJS75ORH7_js.traverse(ast, {
|
|
21107
|
-
JSXElement(
|
|
21108
|
-
const opening =
|
|
21107
|
+
JSXElement(path29) {
|
|
21108
|
+
const opening = path29.node.openingElement;
|
|
21109
21109
|
if (chunkJS75ORH7_js.isJSXIdentifier(opening.name) && (opening.name.name === "script" || opening.name.name === "Script")) {
|
|
21110
21110
|
const srcAttr = opening.attributes.find(
|
|
21111
21111
|
(attr) => chunkJS75ORH7_js.isJSXAttribute(attr) && chunkJS75ORH7_js.isJSXIdentifier(attr.name) && attr.name.name === "src"
|
|
@@ -21120,8 +21120,8 @@ function scanForWidgets(ast, content, filePath) {
|
|
|
21120
21120
|
filePath,
|
|
21121
21121
|
widgetType: type,
|
|
21122
21122
|
scriptTag: src,
|
|
21123
|
-
startLine:
|
|
21124
|
-
endLine:
|
|
21123
|
+
startLine: path29.node.loc?.start.line || 0,
|
|
21124
|
+
endLine: path29.node.loc?.end.line || 0
|
|
21125
21125
|
});
|
|
21126
21126
|
}
|
|
21127
21127
|
}
|
|
@@ -21195,7 +21195,7 @@ async function scanForSitemapFiles(rootDir) {
|
|
|
21195
21195
|
"next-sitemap.config.ts"
|
|
21196
21196
|
];
|
|
21197
21197
|
for (const configPath of configPaths) {
|
|
21198
|
-
const fullPath =
|
|
21198
|
+
const fullPath = path12__default.default.join(rootDir, configPath);
|
|
21199
21199
|
try {
|
|
21200
21200
|
await fs3__default.default.access(fullPath);
|
|
21201
21201
|
const content = await fs3__default.default.readFile(fullPath, "utf-8");
|
|
@@ -21213,7 +21213,7 @@ async function scanForSitemapFiles(rootDir) {
|
|
|
21213
21213
|
} catch {
|
|
21214
21214
|
}
|
|
21215
21215
|
}
|
|
21216
|
-
const staticSitemapPath =
|
|
21216
|
+
const staticSitemapPath = path12__default.default.join(rootDir, "public", "sitemap.xml");
|
|
21217
21217
|
try {
|
|
21218
21218
|
await fs3__default.default.access(staticSitemapPath);
|
|
21219
21219
|
const content = await fs3__default.default.readFile(staticSitemapPath, "utf-8");
|
|
@@ -21236,7 +21236,7 @@ async function scanForSitemapFiles(rootDir) {
|
|
|
21236
21236
|
"out/sitemap.xml"
|
|
21237
21237
|
];
|
|
21238
21238
|
for (const genPath of generatedPaths) {
|
|
21239
|
-
const fullPath =
|
|
21239
|
+
const fullPath = path12__default.default.join(rootDir, genPath);
|
|
21240
21240
|
try {
|
|
21241
21241
|
await fs3__default.default.access(fullPath);
|
|
21242
21242
|
} catch {
|
|
@@ -21260,8 +21260,8 @@ function scanForSchemas(ast, content, filePath) {
|
|
|
21260
21260
|
return schemas;
|
|
21261
21261
|
}
|
|
21262
21262
|
chunkJS75ORH7_js.traverse(ast, {
|
|
21263
|
-
JSXElement(
|
|
21264
|
-
const opening =
|
|
21263
|
+
JSXElement(path29) {
|
|
21264
|
+
const opening = path29.node.openingElement;
|
|
21265
21265
|
if (chunkJS75ORH7_js.isJSXIdentifier(opening.name) && (opening.name.name === "script" || opening.name.name === "Script")) {
|
|
21266
21266
|
const typeAttr = opening.attributes.find(
|
|
21267
21267
|
(attr) => chunkJS75ORH7_js.isJSXAttribute(attr) && chunkJS75ORH7_js.isJSXIdentifier(attr.name) && attr.name.name === "type"
|
|
@@ -21288,8 +21288,8 @@ function scanForSchemas(ast, content, filePath) {
|
|
|
21288
21288
|
filePath,
|
|
21289
21289
|
type: detectedType,
|
|
21290
21290
|
schemaType,
|
|
21291
|
-
startLine:
|
|
21292
|
-
endLine:
|
|
21291
|
+
startLine: path29.node.loc?.start.line || 0,
|
|
21292
|
+
endLine: path29.node.loc?.end.line || 0
|
|
21293
21293
|
});
|
|
21294
21294
|
}
|
|
21295
21295
|
}
|
|
@@ -21322,8 +21322,8 @@ function scanForFAQs(ast, content, filePath) {
|
|
|
21322
21322
|
/questions?\s*(?:and|&)?\s*answers?/i
|
|
21323
21323
|
];
|
|
21324
21324
|
chunkJS75ORH7_js.traverse(ast, {
|
|
21325
|
-
JSXElement(
|
|
21326
|
-
const opening =
|
|
21325
|
+
JSXElement(path29) {
|
|
21326
|
+
const opening = path29.node.openingElement;
|
|
21327
21327
|
let tagName = "";
|
|
21328
21328
|
if (chunkJS75ORH7_js.isJSXIdentifier(opening.name)) {
|
|
21329
21329
|
tagName = opening.name.name;
|
|
@@ -21336,8 +21336,8 @@ function scanForFAQs(ast, content, filePath) {
|
|
|
21336
21336
|
faqs.push({
|
|
21337
21337
|
filePath,
|
|
21338
21338
|
type: "details-summary",
|
|
21339
|
-
startLine:
|
|
21340
|
-
endLine:
|
|
21339
|
+
startLine: path29.node.loc?.start.line || 0,
|
|
21340
|
+
endLine: path29.node.loc?.end.line || 0,
|
|
21341
21341
|
hasSchema: content.includes("FAQPage") || content.includes("application/ld+json")
|
|
21342
21342
|
});
|
|
21343
21343
|
return;
|
|
@@ -21345,7 +21345,7 @@ function scanForFAQs(ast, content, filePath) {
|
|
|
21345
21345
|
for (const pattern of faqPatterns) {
|
|
21346
21346
|
if (pattern.test(tagName)) {
|
|
21347
21347
|
let itemCount = 0;
|
|
21348
|
-
|
|
21348
|
+
path29.traverse({
|
|
21349
21349
|
JSXElement(itemPath) {
|
|
21350
21350
|
const itemOpening = itemPath.node.openingElement;
|
|
21351
21351
|
if (chunkJS75ORH7_js.isJSXIdentifier(itemOpening.name)) {
|
|
@@ -21361,8 +21361,8 @@ function scanForFAQs(ast, content, filePath) {
|
|
|
21361
21361
|
type: "accordion",
|
|
21362
21362
|
componentName: tagName,
|
|
21363
21363
|
itemCount: itemCount || void 0,
|
|
21364
|
-
startLine:
|
|
21365
|
-
endLine:
|
|
21364
|
+
startLine: path29.node.loc?.start.line || 0,
|
|
21365
|
+
endLine: path29.node.loc?.end.line || 0,
|
|
21366
21366
|
hasSchema: content.includes("FAQPage") || content.includes("application/ld+json")
|
|
21367
21367
|
});
|
|
21368
21368
|
return;
|
|
@@ -21485,8 +21485,8 @@ function scanForImages(ast, content, filePath) {
|
|
|
21485
21485
|
return images;
|
|
21486
21486
|
}
|
|
21487
21487
|
chunkJS75ORH7_js.traverse(ast, {
|
|
21488
|
-
JSXElement(
|
|
21489
|
-
const opening =
|
|
21488
|
+
JSXElement(path29) {
|
|
21489
|
+
const opening = path29.node.openingElement;
|
|
21490
21490
|
if (!chunkJS75ORH7_js.isJSXIdentifier(opening.name)) return;
|
|
21491
21491
|
const tagName = opening.name.name;
|
|
21492
21492
|
if (tagName === "img" || tagName === "Image") {
|
|
@@ -21514,8 +21514,8 @@ function scanForImages(ast, content, filePath) {
|
|
|
21514
21514
|
src: src || void 0,
|
|
21515
21515
|
alt: alt || void 0,
|
|
21516
21516
|
isLocal,
|
|
21517
|
-
startLine:
|
|
21518
|
-
endLine:
|
|
21517
|
+
startLine: path29.node.loc?.start.line || 0,
|
|
21518
|
+
endLine: path29.node.loc?.end.line || 0
|
|
21519
21519
|
});
|
|
21520
21520
|
}
|
|
21521
21521
|
}
|
|
@@ -21720,7 +21720,7 @@ async function migrateFiles(scanResults, options) {
|
|
|
21720
21720
|
}
|
|
21721
21721
|
async function migrateForm(form, options) {
|
|
21722
21722
|
const changes = [];
|
|
21723
|
-
const fullPath =
|
|
21723
|
+
const fullPath = path12__default.default.resolve(process.cwd(), form.filePath);
|
|
21724
21724
|
const formSlug = generateSlug(form.componentName);
|
|
21725
21725
|
let formId;
|
|
21726
21726
|
if (!options.dryRun) {
|
|
@@ -21859,7 +21859,7 @@ export default ${componentName}
|
|
|
21859
21859
|
`;
|
|
21860
21860
|
}
|
|
21861
21861
|
async function createFormInUptrade(form, slug, options) {
|
|
21862
|
-
const response = await fetch("https://api.sonor.io/forms
|
|
21862
|
+
const response = await fetch(`${options.apiUrl || "https://api.sonor.io"}/forms`, {
|
|
21863
21863
|
method: "POST",
|
|
21864
21864
|
headers: {
|
|
21865
21865
|
"Content-Type": "application/json",
|
|
@@ -21897,7 +21897,7 @@ async function migrateWidget(filePath, widget, options) {
|
|
|
21897
21897
|
changes.push("[DRY RUN] Sonor Engage chat would come from SiteKitLayout (engage is on by default)");
|
|
21898
21898
|
return { filePath, success: true, changes };
|
|
21899
21899
|
}
|
|
21900
|
-
const fullPath =
|
|
21900
|
+
const fullPath = path12__default.default.resolve(process.cwd(), filePath);
|
|
21901
21901
|
let content = await fs3__default.default.readFile(fullPath, "utf-8");
|
|
21902
21902
|
switch (widget.widgetType) {
|
|
21903
21903
|
case "intercom":
|
|
@@ -21934,15 +21934,15 @@ function matchBalancedBraces(content, startIndex) {
|
|
|
21934
21934
|
}
|
|
21935
21935
|
async function migrateMetadata(filePath, metadata, options) {
|
|
21936
21936
|
const changes = [];
|
|
21937
|
-
const fullPath =
|
|
21937
|
+
const fullPath = path12__default.default.resolve(process.cwd(), filePath);
|
|
21938
21938
|
let pagePath = filePath.replace(/^app\//, "/").replace(/^src\/app\//, "/").replace(/\/page\.(tsx?|jsx?)$/, "").replace(/\/layout\.(tsx?|jsx?)$/, "").replace(/\[([^\]]+)\]/g, ":$1");
|
|
21939
21939
|
if (pagePath === "") pagePath = "/";
|
|
21940
21940
|
let content = await fs3__default.default.readFile(fullPath, "utf-8");
|
|
21941
21941
|
const isTypeScript = filePath.endsWith(".tsx") || filePath.endsWith(".ts");
|
|
21942
21942
|
const ext2 = isTypeScript ? ".tsx" : ".jsx";
|
|
21943
21943
|
if (isClientComponent(content)) {
|
|
21944
|
-
const dir =
|
|
21945
|
-
const layoutPath =
|
|
21944
|
+
const dir = path12__default.default.dirname(fullPath);
|
|
21945
|
+
const layoutPath = path12__default.default.join(dir, `layout${ext2}`);
|
|
21946
21946
|
try {
|
|
21947
21947
|
await fs3__default.default.access(layoutPath);
|
|
21948
21948
|
const layoutContent = await fs3__default.default.readFile(layoutPath, "utf-8");
|
|
@@ -21965,7 +21965,7 @@ async function migrateMetadata(filePath, metadata, options) {
|
|
|
21965
21965
|
} catch (error2) {
|
|
21966
21966
|
changes.push(`Page metadata may already exist: ${pagePath}`);
|
|
21967
21967
|
}
|
|
21968
|
-
const dirName =
|
|
21968
|
+
const dirName = path12__default.default.basename(dir).replace(/^\[\.\.\.([^\]]+)\]$/, "$1").replace(/^\[([^\]]+)\]$/, "$1");
|
|
21969
21969
|
const layoutName = dirName.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("") + "Layout";
|
|
21970
21970
|
const layoutCode = `import { getManagedMetadata, ManagedSchema } from '@sonordev/site-kit/seo'
|
|
21971
21971
|
|
|
@@ -22074,7 +22074,7 @@ export async function generateMetadata() {
|
|
|
22074
22074
|
return { filePath, success: true, changes };
|
|
22075
22075
|
}
|
|
22076
22076
|
async function createPageMetadata(pagePath, metadata, options) {
|
|
22077
|
-
const response = await fetch("https://api.sonor.io/seo/pages
|
|
22077
|
+
const response = await fetch(`${options.apiUrl || "https://api.sonor.io"}/seo/pages`, {
|
|
22078
22078
|
method: "POST",
|
|
22079
22079
|
headers: {
|
|
22080
22080
|
"Content-Type": "application/json",
|
|
@@ -22159,7 +22159,7 @@ async function createSchemaRecord(pagePath, schemaType, schemaJson, options) {
|
|
|
22159
22159
|
}
|
|
22160
22160
|
async function migrateSchema(filePath, schema, options) {
|
|
22161
22161
|
const changes = [];
|
|
22162
|
-
const fullPath =
|
|
22162
|
+
const fullPath = path12__default.default.resolve(process.cwd(), filePath);
|
|
22163
22163
|
let pagePath = filePath.replace(/^app\//, "/").replace(/^src\/app\//, "/").replace(/\/page\.(tsx?|jsx?)$/, "").replace(/\[([^\]]+)\]/g, ":$1");
|
|
22164
22164
|
if (pagePath === "") pagePath = "/";
|
|
22165
22165
|
let content = await fs3__default.default.readFile(fullPath, "utf-8");
|
|
@@ -22270,7 +22270,7 @@ async function createFAQRecord(pagePath, items, options) {
|
|
|
22270
22270
|
}
|
|
22271
22271
|
async function migrateFAQ(filePath, faq, options) {
|
|
22272
22272
|
const changes = [];
|
|
22273
|
-
const fullPath =
|
|
22273
|
+
const fullPath = path12__default.default.resolve(process.cwd(), filePath);
|
|
22274
22274
|
let pagePath = filePath.replace(/^app\//, "/").replace(/^src\/app\//, "/").replace(/\/page\.(tsx?|jsx?)$/, "").replace(/\[([^\]]+)\]/g, ":$1");
|
|
22275
22275
|
if (pagePath === "") pagePath = "/";
|
|
22276
22276
|
let content = await fs3__default.default.readFile(fullPath, "utf-8");
|
|
@@ -22338,7 +22338,7 @@ async function migrateFAQ(filePath, faq, options) {
|
|
|
22338
22338
|
}
|
|
22339
22339
|
async function migrateSitemap(filePath, sitemap, options) {
|
|
22340
22340
|
const changes = [];
|
|
22341
|
-
const fullPath =
|
|
22341
|
+
const fullPath = path12__default.default.resolve(process.cwd(), filePath);
|
|
22342
22342
|
if (options.dryRun) {
|
|
22343
22343
|
changes.push(`[DRY RUN] Would migrate ${sitemap.type} to Site-Kit sitemap`);
|
|
22344
22344
|
if (sitemap.type === "next-sitemap-config") {
|
|
@@ -22380,8 +22380,8 @@ async function migrateAnalytics(filePath, analytics, options) {
|
|
|
22380
22380
|
return { filePath, success: true, changes };
|
|
22381
22381
|
}
|
|
22382
22382
|
async function migrateFile(filePath, options) {
|
|
22383
|
-
const fullPath =
|
|
22384
|
-
const relPath =
|
|
22383
|
+
const fullPath = path12__default.default.resolve(filePath);
|
|
22384
|
+
const relPath = path12__default.default.relative(process.cwd(), fullPath);
|
|
22385
22385
|
const content = await fs3__default.default.readFile(fullPath, "utf-8");
|
|
22386
22386
|
const hasFormTag = content.includes("<form") || content.includes("onSubmit");
|
|
22387
22387
|
const hasWidget = /intercom|crisp|drift|hubspot|zendesk/i.test(content);
|
|
@@ -22398,26 +22398,26 @@ async function migrateFile(filePath, options) {
|
|
|
22398
22398
|
return migrateWidget(relPath, {
|
|
22399
22399
|
widgetType}, options);
|
|
22400
22400
|
}
|
|
22401
|
-
const { parse:
|
|
22402
|
-
const ast =
|
|
22401
|
+
const { parse: parse3 } = await import('../lib-6HOOMENJ.js');
|
|
22402
|
+
const ast = parse3(content, {
|
|
22403
22403
|
sourceType: "module",
|
|
22404
22404
|
plugins: ["jsx", "typescript"]
|
|
22405
22405
|
});
|
|
22406
22406
|
let componentName = "Form";
|
|
22407
22407
|
const traverse2 = (await import('../lib-BGAWCSUH.js')).default;
|
|
22408
22408
|
traverse2(ast, {
|
|
22409
|
-
ExportNamedDeclaration(
|
|
22410
|
-
const decl =
|
|
22409
|
+
ExportNamedDeclaration(path29) {
|
|
22410
|
+
const decl = path29.node.declaration;
|
|
22411
22411
|
if (decl && decl.type === "FunctionDeclaration" && decl.id) {
|
|
22412
22412
|
componentName = decl.id.name;
|
|
22413
|
-
|
|
22413
|
+
path29.stop();
|
|
22414
22414
|
}
|
|
22415
22415
|
},
|
|
22416
|
-
ExportDefaultDeclaration(
|
|
22417
|
-
const decl =
|
|
22416
|
+
ExportDefaultDeclaration(path29) {
|
|
22417
|
+
const decl = path29.node.declaration;
|
|
22418
22418
|
if (decl && decl.type === "FunctionDeclaration" && decl.id) {
|
|
22419
22419
|
componentName = decl.id.name;
|
|
22420
|
-
|
|
22420
|
+
path29.stop();
|
|
22421
22421
|
}
|
|
22422
22422
|
}
|
|
22423
22423
|
});
|
|
@@ -22474,7 +22474,7 @@ function detectFormType(form) {
|
|
|
22474
22474
|
return "contact";
|
|
22475
22475
|
}
|
|
22476
22476
|
async function generateEnvFile(options) {
|
|
22477
|
-
const envPath =
|
|
22477
|
+
const envPath = path12__default.default.join(process.cwd(), ".env.local");
|
|
22478
22478
|
let existingContent = "";
|
|
22479
22479
|
try {
|
|
22480
22480
|
existingContent = await fs3__default.default.readFile(envPath, "utf-8");
|
|
@@ -22574,7 +22574,7 @@ async function findLayoutFile() {
|
|
|
22574
22574
|
"app/layout.jsx"
|
|
22575
22575
|
];
|
|
22576
22576
|
for (const relativePath of possiblePaths) {
|
|
22577
|
-
const fullPath =
|
|
22577
|
+
const fullPath = path12__default.default.join(process.cwd(), relativePath);
|
|
22578
22578
|
try {
|
|
22579
22579
|
await fs3__default.default.access(fullPath);
|
|
22580
22580
|
return fullPath;
|
|
@@ -22744,15 +22744,15 @@ var wslDefaultBrowser = async () => {
|
|
|
22744
22744
|
const { stdout } = await executePowerShell(command, { powerShellPath: psPath });
|
|
22745
22745
|
return stdout.trim();
|
|
22746
22746
|
};
|
|
22747
|
-
var convertWslPathToWindows = async (
|
|
22748
|
-
if (/^[a-z]+:\/\//i.test(
|
|
22749
|
-
return
|
|
22747
|
+
var convertWslPathToWindows = async (path29) => {
|
|
22748
|
+
if (/^[a-z]+:\/\//i.test(path29)) {
|
|
22749
|
+
return path29;
|
|
22750
22750
|
}
|
|
22751
22751
|
try {
|
|
22752
|
-
const { stdout } = await execFile2("wslpath", ["-aw",
|
|
22752
|
+
const { stdout } = await execFile2("wslpath", ["-aw", path29], { encoding: "utf8" });
|
|
22753
22753
|
return stdout.trim();
|
|
22754
22754
|
} catch {
|
|
22755
|
-
return
|
|
22755
|
+
return path29;
|
|
22756
22756
|
}
|
|
22757
22757
|
};
|
|
22758
22758
|
|
|
@@ -22872,8 +22872,8 @@ var is_in_ssh_default = isInSsh;
|
|
|
22872
22872
|
|
|
22873
22873
|
// node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
|
|
22874
22874
|
var fallbackAttemptSymbol = /* @__PURE__ */ Symbol("fallbackAttempt");
|
|
22875
|
-
var __dirname2 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href)) ?
|
|
22876
|
-
var localXdgOpenPath =
|
|
22875
|
+
var __dirname2 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href)) ? path12__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href)))) : "";
|
|
22876
|
+
var localXdgOpenPath = path12__default.default.join(__dirname2, "xdg-open");
|
|
22877
22877
|
var { platform, arch } = process2__default.default;
|
|
22878
22878
|
var tryEachApp = async (apps2, opener) => {
|
|
22879
22879
|
if (apps2.length === 0) {
|
|
@@ -23151,8 +23151,37 @@ defineLazyProperty(apps, "safari", () => detectPlatformBinary({
|
|
|
23151
23151
|
darwin: "Safari"
|
|
23152
23152
|
}));
|
|
23153
23153
|
var open_default = open;
|
|
23154
|
+
var SONOR_STATE_DIR = ".sonor";
|
|
23155
|
+
var IMAGE_MANIFEST = ".sonor-images.json";
|
|
23156
|
+
var LEGACY_IMAGE_MANIFEST = ".uptrade-images.json";
|
|
23157
|
+
var LEGACY_STATE_DIR = ".uptrade";
|
|
23158
|
+
function resolveStateReadPath(relativePath, root = process.cwd()) {
|
|
23159
|
+
return preferCurrent(path12__default.default.join(root, SONOR_STATE_DIR, relativePath), path12__default.default.join(root, LEGACY_STATE_DIR, relativePath));
|
|
23160
|
+
}
|
|
23161
|
+
function resolveImageManifestReadPath(root) {
|
|
23162
|
+
return preferCurrent(path12__default.default.join(root, IMAGE_MANIFEST), path12__default.default.join(root, LEGACY_IMAGE_MANIFEST));
|
|
23163
|
+
}
|
|
23164
|
+
function preferCurrent(current, legacy) {
|
|
23165
|
+
return fs.existsSync(current) || !fs.existsSync(legacy) ? current : legacy;
|
|
23166
|
+
}
|
|
23167
|
+
async function listLocalTemplates(root = process.cwd()) {
|
|
23168
|
+
const names = /* @__PURE__ */ new Set();
|
|
23169
|
+
for (const dir of [SONOR_STATE_DIR, LEGACY_STATE_DIR]) {
|
|
23170
|
+
try {
|
|
23171
|
+
const files = await fs3__default.default.readdir(path12__default.default.join(root, dir, "templates"));
|
|
23172
|
+
for (const file of files) if (file.endsWith(".json")) names.add(file);
|
|
23173
|
+
} catch (error2) {
|
|
23174
|
+
if (error2.code !== "ENOENT") throw error2;
|
|
23175
|
+
}
|
|
23176
|
+
}
|
|
23177
|
+
return [...names].sort();
|
|
23178
|
+
}
|
|
23179
|
+
|
|
23180
|
+
// src/cli/api/sonor.ts
|
|
23154
23181
|
var PORTAL_URL = "https://app.sonor.io";
|
|
23155
|
-
|
|
23182
|
+
function getSonorApiUrl() {
|
|
23183
|
+
return (process.env.SONOR_API_URL || "https://api.sonor.io").replace(/\/+$/, "");
|
|
23184
|
+
}
|
|
23156
23185
|
async function authenticateWithSonor() {
|
|
23157
23186
|
return new Promise((resolve, reject) => {
|
|
23158
23187
|
const server = http__default.default.createServer(async (req, res) => {
|
|
@@ -23179,7 +23208,7 @@ async function authenticateWithSonor() {
|
|
|
23179
23208
|
server.close();
|
|
23180
23209
|
return;
|
|
23181
23210
|
}
|
|
23182
|
-
const tokenResponse = await fetch(`${
|
|
23211
|
+
const tokenResponse = await fetch(`${getSonorApiUrl()}/auth/cli-token`, {
|
|
23183
23212
|
method: "POST",
|
|
23184
23213
|
headers: { "Content-Type": "application/json" },
|
|
23185
23214
|
body: JSON.stringify({ code, redirect_uri: `http://localhost:${port}/callback` })
|
|
@@ -23225,32 +23254,41 @@ async function authenticateWithSonor() {
|
|
|
23225
23254
|
}, 5 * 60 * 1e3);
|
|
23226
23255
|
});
|
|
23227
23256
|
}
|
|
23228
|
-
async function authenticateWithApiKey(apiKey) {
|
|
23229
|
-
|
|
23230
|
-
|
|
23231
|
-
|
|
23232
|
-
|
|
23233
|
-
|
|
23234
|
-
|
|
23235
|
-
|
|
23236
|
-
|
|
23237
|
-
|
|
23238
|
-
|
|
23239
|
-
|
|
23240
|
-
projectName: data.project?.name,
|
|
23241
|
-
orgId: data.organization?.id,
|
|
23242
|
-
orgName: data.organization?.name,
|
|
23243
|
-
isApiKey: true
|
|
23244
|
-
};
|
|
23245
|
-
}
|
|
23257
|
+
async function authenticateWithApiKey(apiKey, apiUrl = getSonorApiUrl()) {
|
|
23258
|
+
let response;
|
|
23259
|
+
try {
|
|
23260
|
+
response = await fetch(`${apiUrl}/api/public/seo/verify-api-key`, {
|
|
23261
|
+
headers: { "X-API-Key": apiKey },
|
|
23262
|
+
signal: AbortSignal.timeout(15e3)
|
|
23263
|
+
});
|
|
23264
|
+
} catch {
|
|
23265
|
+
throw new NetworkError("PROJECT_LOOKUP_FAILED", "Could not reach the Sonor API to resolve the project. Check SONOR_API_URL and your connection.");
|
|
23266
|
+
}
|
|
23267
|
+
if (!response.ok) {
|
|
23268
|
+
throw new NetworkError("PROJECT_LOOKUP_FAILED", `Sonor API verification failed (HTTP ${response.status}). Check SONOR_API_KEY and SONOR_API_URL.`);
|
|
23246
23269
|
}
|
|
23247
|
-
|
|
23248
|
-
|
|
23270
|
+
let data;
|
|
23271
|
+
try {
|
|
23272
|
+
data = await response.json();
|
|
23273
|
+
} catch {
|
|
23274
|
+
throw new NetworkError("INVALID_PROJECT_RESPONSE", "Sonor API returned an invalid project response.");
|
|
23275
|
+
}
|
|
23276
|
+
if (data?.valid !== true || typeof data.project?.id !== "string" || !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(data.project.id)) {
|
|
23277
|
+
throw new NetworkError("INVALID_PROJECT_RESPONSE", "Sonor API did not return a valid full project UUID. Check SONOR_API_KEY.");
|
|
23249
23278
|
}
|
|
23250
|
-
|
|
23279
|
+
return {
|
|
23280
|
+
accessToken: apiKey,
|
|
23281
|
+
userId: "api-key-user",
|
|
23282
|
+
email: data.project.name ? `Project: ${data.project.name}` : "API Key verified",
|
|
23283
|
+
projectId: data.project.id,
|
|
23284
|
+
projectName: data.project.name,
|
|
23285
|
+
orgId: data.organization?.id,
|
|
23286
|
+
orgName: data.organization?.name,
|
|
23287
|
+
isApiKey: true
|
|
23288
|
+
};
|
|
23251
23289
|
}
|
|
23252
23290
|
async function fetchOrganizations(accessToken) {
|
|
23253
|
-
const response = await fetch(`${
|
|
23291
|
+
const response = await fetch(`${getSonorApiUrl()}/organizations`, {
|
|
23254
23292
|
headers: { "Authorization": `Bearer ${accessToken}` }
|
|
23255
23293
|
});
|
|
23256
23294
|
if (!response.ok) {
|
|
@@ -23259,7 +23297,7 @@ async function fetchOrganizations(accessToken) {
|
|
|
23259
23297
|
return response.json();
|
|
23260
23298
|
}
|
|
23261
23299
|
async function fetchProjects(accessToken, orgId) {
|
|
23262
|
-
const response = await fetch(`${
|
|
23300
|
+
const response = await fetch(`${getSonorApiUrl()}/organizations/${orgId}/projects`, {
|
|
23263
23301
|
headers: { "Authorization": `Bearer ${accessToken}` }
|
|
23264
23302
|
});
|
|
23265
23303
|
if (!response.ok) {
|
|
@@ -23268,7 +23306,7 @@ async function fetchProjects(accessToken, orgId) {
|
|
|
23268
23306
|
return response.json();
|
|
23269
23307
|
}
|
|
23270
23308
|
async function createProject(accessToken, orgId, data) {
|
|
23271
|
-
const response = await fetch(`${
|
|
23309
|
+
const response = await fetch(`${getSonorApiUrl()}/organizations/${orgId}/projects`, {
|
|
23272
23310
|
method: "POST",
|
|
23273
23311
|
headers: {
|
|
23274
23312
|
"Authorization": `Bearer ${accessToken}`,
|
|
@@ -23282,7 +23320,7 @@ async function createProject(accessToken, orgId, data) {
|
|
|
23282
23320
|
return response.json();
|
|
23283
23321
|
}
|
|
23284
23322
|
async function generateApiKey(accessToken, projectId) {
|
|
23285
|
-
const response = await fetch(`${
|
|
23323
|
+
const response = await fetch(`${getSonorApiUrl()}/projects/${projectId}/api-keys`, {
|
|
23286
23324
|
method: "POST",
|
|
23287
23325
|
headers: {
|
|
23288
23326
|
"Authorization": `Bearer ${accessToken}`,
|
|
@@ -23486,7 +23524,7 @@ function progress(ctx, line) {
|
|
|
23486
23524
|
// src/cli/commands/init.ts
|
|
23487
23525
|
async function checkNextJsProject(cwd) {
|
|
23488
23526
|
try {
|
|
23489
|
-
const pkg = JSON.parse(await fs3__default.default.readFile(
|
|
23527
|
+
const pkg = JSON.parse(await fs3__default.default.readFile(path12__default.default.join(cwd, "package.json"), "utf-8"));
|
|
23490
23528
|
return !!(pkg.dependencies?.next || pkg.devDependencies?.next);
|
|
23491
23529
|
} catch {
|
|
23492
23530
|
return false;
|
|
@@ -23566,7 +23604,7 @@ async function run(ctx, options) {
|
|
|
23566
23604
|
]);
|
|
23567
23605
|
if (chosen === "new") {
|
|
23568
23606
|
const answers = await dist_default14.prompt([
|
|
23569
|
-
{ type: "input", name: "name", message: "Project name:", default:
|
|
23607
|
+
{ type: "input", name: "name", message: "Project name:", default: path12__default.default.basename(ctx.cwd) },
|
|
23570
23608
|
{ type: "input", name: "domain", message: "Project domain (optional):" }
|
|
23571
23609
|
]);
|
|
23572
23610
|
const project = await createProject(auth.accessToken, orgId, { name: answers.name, domain: answers.domain || "" });
|
|
@@ -23621,7 +23659,7 @@ async function run(ctx, options) {
|
|
|
23621
23659
|
};
|
|
23622
23660
|
}
|
|
23623
23661
|
async function ensureSitemapPostbuild(ctx) {
|
|
23624
|
-
const pkgPath =
|
|
23662
|
+
const pkgPath = path12__default.default.join(ctx.cwd, "package.json");
|
|
23625
23663
|
try {
|
|
23626
23664
|
const pkg = JSON.parse(await fs3__default.default.readFile(pkgPath, "utf-8"));
|
|
23627
23665
|
if (!pkg.scripts) pkg.scripts = {};
|
|
@@ -23663,7 +23701,7 @@ async function scanCommand(options) {
|
|
|
23663
23701
|
console.log("");
|
|
23664
23702
|
console.log(source_default.bold(" Scanning codebase..."));
|
|
23665
23703
|
console.log("");
|
|
23666
|
-
const targetDir =
|
|
23704
|
+
const targetDir = path12__default.default.resolve(options.dir || ".");
|
|
23667
23705
|
const spinner = ora("Looking for forms, metadata, widgets, schemas, FAQs, analytics, and images...").start();
|
|
23668
23706
|
let scanResults;
|
|
23669
23707
|
try {
|
|
@@ -23841,6 +23879,48 @@ async function scanCommand(options) {
|
|
|
23841
23879
|
process.exit(1);
|
|
23842
23880
|
}
|
|
23843
23881
|
}
|
|
23882
|
+
|
|
23883
|
+
// src/cli/config.ts
|
|
23884
|
+
var import_dotenv = chunkSNAQBZPT_js.__toESM(chunkNN2YE5WT_js.require_main());
|
|
23885
|
+
async function loadConfig({ resolveProject = false, cwd = process.cwd() } = {}) {
|
|
23886
|
+
const envFile = await readOptionalFile(path12__default.default.join(cwd, ".env.local"));
|
|
23887
|
+
const env3 = { ...(0, import_dotenv.parse)(envFile || ""), ...process.env };
|
|
23888
|
+
const configPath = resolveStateReadPath("config.json", cwd);
|
|
23889
|
+
const saved = await readOptionalFile(configPath);
|
|
23890
|
+
let stored = {};
|
|
23891
|
+
if (saved !== void 0) {
|
|
23892
|
+
try {
|
|
23893
|
+
stored = JSON.parse(saved);
|
|
23894
|
+
if (!stored || typeof stored !== "object" || Array.isArray(stored)) throw new Error();
|
|
23895
|
+
} catch {
|
|
23896
|
+
throw new ConfigError("INVALID_CONFIG", `Invalid JSON config: ${configPath}. Fix or remove it, then set SONOR_API_KEY in .env.local.`);
|
|
23897
|
+
}
|
|
23898
|
+
}
|
|
23899
|
+
const apiKey = String(env3.SONOR_API_KEY || stored.apiKey || stored.api_key || "").trim();
|
|
23900
|
+
if (!apiKey) {
|
|
23901
|
+
throw new ConfigError("MISSING_API_KEY", "Set SONOR_API_KEY in .env.local or run `sonor-setup init` first.");
|
|
23902
|
+
}
|
|
23903
|
+
if (!/^sonor_[0-9a-f]{8}_.+$/i.test(apiKey)) {
|
|
23904
|
+
throw new ConfigError("INVALID_API_KEY", "SONOR_API_KEY must be a sonor_ key from app.sonor.io.");
|
|
23905
|
+
}
|
|
23906
|
+
const config2 = {
|
|
23907
|
+
apiKey,
|
|
23908
|
+
apiUrl: (env3.SONOR_API_URL || getSonorApiUrl()).replace(/\/+$/, ""),
|
|
23909
|
+
siteUrl: env3.NEXT_PUBLIC_SITE_URL || env3.SITE_URL || stored.siteUrl || stored.site_url,
|
|
23910
|
+
businessInfo: stored.businessInfo || stored.business_info
|
|
23911
|
+
};
|
|
23912
|
+
if (!resolveProject) return config2;
|
|
23913
|
+
const auth = await authenticateWithApiKey(apiKey, config2.apiUrl);
|
|
23914
|
+
return { ...config2, projectId: auth.projectId };
|
|
23915
|
+
}
|
|
23916
|
+
async function readOptionalFile(file) {
|
|
23917
|
+
try {
|
|
23918
|
+
return await fs3__default.default.readFile(file, "utf-8");
|
|
23919
|
+
} catch (error2) {
|
|
23920
|
+
if (error2.code === "ENOENT") return void 0;
|
|
23921
|
+
throw new ConfigError("CONFIG_READ_FAILED", `Could not read ${file}. Check file permissions.`);
|
|
23922
|
+
}
|
|
23923
|
+
}
|
|
23844
23924
|
var IMAGE_EXTENSIONS = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg", ".ico", ".bmp", ".avif"];
|
|
23845
23925
|
var MIME_TYPES = {
|
|
23846
23926
|
".jpg": "image/jpeg",
|
|
@@ -23863,7 +23943,7 @@ function filePathToPagePath(filePath) {
|
|
|
23863
23943
|
}
|
|
23864
23944
|
if (p.startsWith("pages/") || p.startsWith("src/pages/")) {
|
|
23865
23945
|
p = p.replace(/^pages\//, "").replace(/^src\/pages\//, "");
|
|
23866
|
-
const base =
|
|
23946
|
+
const base = path12__default.default.basename(p, path12__default.default.extname(p));
|
|
23867
23947
|
return base === "index" ? "/" : "/" + base;
|
|
23868
23948
|
}
|
|
23869
23949
|
p = p.replace(/\.[^.]+$/, "").replace(/^\.\//, "").replace(/\\/g, "/");
|
|
@@ -23906,8 +23986,8 @@ async function imagesCommand(subcommand, options) {
|
|
|
23906
23986
|
}
|
|
23907
23987
|
}
|
|
23908
23988
|
async function scanImages(options) {
|
|
23909
|
-
const targetDir =
|
|
23910
|
-
const publicDir =
|
|
23989
|
+
const targetDir = path12__default.default.resolve(options.dir || ".");
|
|
23990
|
+
const publicDir = path12__default.default.join(targetDir, "public");
|
|
23911
23991
|
try {
|
|
23912
23992
|
await fs3__default.default.access(publicDir);
|
|
23913
23993
|
} catch {
|
|
@@ -23977,7 +24057,7 @@ async function uploadImages(options) {
|
|
|
23977
24057
|
console.log("");
|
|
23978
24058
|
process.exit(1);
|
|
23979
24059
|
}
|
|
23980
|
-
const targetDir =
|
|
24060
|
+
const targetDir = path12__default.default.resolve(options.dir || ".");
|
|
23981
24061
|
const spinner = ora("Scanning for images...").start();
|
|
23982
24062
|
const results = await scanPublicImages(targetDir);
|
|
23983
24063
|
spinner.stop();
|
|
@@ -24030,7 +24110,7 @@ async function uploadImages(options) {
|
|
|
24030
24110
|
const uploadSpinner = ora(`Uploading ${img.filename}...`).start();
|
|
24031
24111
|
try {
|
|
24032
24112
|
const result = await uploadImageToPortal(
|
|
24033
|
-
|
|
24113
|
+
path12__default.default.join(targetDir, img.filePath),
|
|
24034
24114
|
img,
|
|
24035
24115
|
{ apiUrl, apiKey, category: options.category }
|
|
24036
24116
|
);
|
|
@@ -24049,7 +24129,7 @@ async function uploadImages(options) {
|
|
|
24049
24129
|
}
|
|
24050
24130
|
console.log("");
|
|
24051
24131
|
if (uploaded.length > 0) {
|
|
24052
|
-
const manifestPath =
|
|
24132
|
+
const manifestPath = path12__default.default.join(targetDir, IMAGE_MANIFEST);
|
|
24053
24133
|
await fs3__default.default.writeFile(manifestPath, JSON.stringify({
|
|
24054
24134
|
uploaded,
|
|
24055
24135
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -24062,8 +24142,8 @@ async function uploadImages(options) {
|
|
|
24062
24142
|
console.log("");
|
|
24063
24143
|
}
|
|
24064
24144
|
async function migrateImages(options) {
|
|
24065
|
-
const targetDir =
|
|
24066
|
-
const manifestPath =
|
|
24145
|
+
const targetDir = path12__default.default.resolve(options.dir || ".");
|
|
24146
|
+
const manifestPath = resolveImageManifestReadPath(targetDir);
|
|
24067
24147
|
const apiUrl = process.env.SONOR_API_URL || "https://api.sonor.io";
|
|
24068
24148
|
const apiKey = process.env.SONOR_API_KEY || "";
|
|
24069
24149
|
if (!apiKey) {
|
|
@@ -24166,9 +24246,9 @@ async function migrateImages(options) {
|
|
|
24166
24246
|
let successCount = 0;
|
|
24167
24247
|
let failCount = 0;
|
|
24168
24248
|
for (const [filePath, fileMigrations] of byFile) {
|
|
24169
|
-
const fileSpinner = ora(`Migrating ${
|
|
24249
|
+
const fileSpinner = ora(`Migrating ${path12__default.default.basename(filePath)}...`).start();
|
|
24170
24250
|
try {
|
|
24171
|
-
await migrateFileImages(
|
|
24251
|
+
await migrateFileImages(path12__default.default.join(targetDir, filePath), fileMigrations);
|
|
24172
24252
|
successCount += fileMigrations.length;
|
|
24173
24253
|
fileSpinner.succeed(`Migrated: ${filePath} (${fileMigrations.length} images)`);
|
|
24174
24254
|
} catch (error2) {
|
|
@@ -24190,7 +24270,7 @@ async function migrateImages(options) {
|
|
|
24190
24270
|
console.log("");
|
|
24191
24271
|
}
|
|
24192
24272
|
async function uploadAndMigrate(options) {
|
|
24193
|
-
const targetDir =
|
|
24273
|
+
const targetDir = path12__default.default.resolve(options.dir || ".");
|
|
24194
24274
|
const apiUrl = process.env.SONOR_API_URL || "https://api.sonor.io";
|
|
24195
24275
|
const apiKey = process.env.SONOR_API_KEY || "";
|
|
24196
24276
|
if (!apiKey) {
|
|
@@ -24257,7 +24337,7 @@ async function uploadAndMigrate(options) {
|
|
|
24257
24337
|
const uploadSpinner = ora(`Uploading ${img.filename}...`).start();
|
|
24258
24338
|
try {
|
|
24259
24339
|
const result = await uploadImageToPortal(
|
|
24260
|
-
|
|
24340
|
+
path12__default.default.join(targetDir, img.filePath),
|
|
24261
24341
|
img,
|
|
24262
24342
|
{ apiUrl, apiKey, category: options.category }
|
|
24263
24343
|
);
|
|
@@ -24329,9 +24409,9 @@ async function uploadAndMigrate(options) {
|
|
|
24329
24409
|
let successCount = 0;
|
|
24330
24410
|
let failCount = 0;
|
|
24331
24411
|
for (const [filePath, fileMigrations] of byFile) {
|
|
24332
|
-
const fileSpinner = ora(`Migrating ${
|
|
24412
|
+
const fileSpinner = ora(`Migrating ${path12__default.default.basename(filePath)}...`).start();
|
|
24333
24413
|
try {
|
|
24334
|
-
await migrateFileImages(
|
|
24414
|
+
await migrateFileImages(path12__default.default.join(targetDir, filePath), fileMigrations);
|
|
24335
24415
|
successCount += fileMigrations.length;
|
|
24336
24416
|
fileSpinner.succeed(`Migrated: ${filePath} (${fileMigrations.length} images)`);
|
|
24337
24417
|
} catch (error2) {
|
|
@@ -24339,7 +24419,7 @@ async function uploadAndMigrate(options) {
|
|
|
24339
24419
|
fileSpinner.fail(`Failed: ${filePath} - ${error2.message}`);
|
|
24340
24420
|
}
|
|
24341
24421
|
}
|
|
24342
|
-
const manifestPath =
|
|
24422
|
+
const manifestPath = path12__default.default.join(targetDir, IMAGE_MANIFEST);
|
|
24343
24423
|
await fs3__default.default.writeFile(manifestPath, JSON.stringify({
|
|
24344
24424
|
uploaded,
|
|
24345
24425
|
criticalKeptLocal: criticalImages.map((i) => i.filename),
|
|
@@ -24366,8 +24446,8 @@ async function uploadAndMigrate(options) {
|
|
|
24366
24446
|
console.log("");
|
|
24367
24447
|
}
|
|
24368
24448
|
async function replaceWithCdnUrls(options) {
|
|
24369
|
-
const targetDir =
|
|
24370
|
-
const manifestPath =
|
|
24449
|
+
const targetDir = path12__default.default.resolve(options.dir || ".");
|
|
24450
|
+
const manifestPath = resolveImageManifestReadPath(targetDir);
|
|
24371
24451
|
let manifest;
|
|
24372
24452
|
try {
|
|
24373
24453
|
const content = await fs3__default.default.readFile(manifestPath, "utf-8");
|
|
@@ -24415,7 +24495,7 @@ async function replaceWithCdnUrls(options) {
|
|
|
24415
24495
|
if (!seenFileLines.has(key)) {
|
|
24416
24496
|
seenFileLines.add(key);
|
|
24417
24497
|
replacements2.push({
|
|
24418
|
-
file:
|
|
24498
|
+
file: path12__default.default.relative(targetDir, file),
|
|
24419
24499
|
localPath: pattern,
|
|
24420
24500
|
cdnUrl: img.publicUrl,
|
|
24421
24501
|
line: i + 1
|
|
@@ -24463,9 +24543,9 @@ async function replaceWithCdnUrls(options) {
|
|
|
24463
24543
|
let successCount = 0;
|
|
24464
24544
|
let failCount = 0;
|
|
24465
24545
|
for (const [filePath, fileReplacements] of byFile) {
|
|
24466
|
-
const fileSpinner = ora(`Updating ${
|
|
24546
|
+
const fileSpinner = ora(`Updating ${path12__default.default.basename(filePath)}...`).start();
|
|
24467
24547
|
try {
|
|
24468
|
-
const fullPath =
|
|
24548
|
+
const fullPath = path12__default.default.join(targetDir, filePath);
|
|
24469
24549
|
let content = await fs3__default.default.readFile(fullPath, "utf-8");
|
|
24470
24550
|
for (const r of fileReplacements) {
|
|
24471
24551
|
const escaped = r.localPath.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -24493,8 +24573,8 @@ async function replaceWithCdnUrls(options) {
|
|
|
24493
24573
|
console.log("");
|
|
24494
24574
|
}
|
|
24495
24575
|
async function refreshManifest(options) {
|
|
24496
|
-
const targetDir =
|
|
24497
|
-
const manifestPath =
|
|
24576
|
+
const targetDir = path12__default.default.resolve(options.dir || ".");
|
|
24577
|
+
const manifestPath = path12__default.default.join(targetDir, IMAGE_MANIFEST);
|
|
24498
24578
|
const apiUrl = process.env.SONOR_API_URL || "https://api.sonor.io";
|
|
24499
24579
|
const apiKey = process.env.SONOR_API_KEY || "";
|
|
24500
24580
|
if (!apiKey) {
|
|
@@ -24503,7 +24583,7 @@ async function refreshManifest(options) {
|
|
|
24503
24583
|
}
|
|
24504
24584
|
let manifest;
|
|
24505
24585
|
try {
|
|
24506
|
-
const content = await fs3__default.default.readFile(
|
|
24586
|
+
const content = await fs3__default.default.readFile(resolveImageManifestReadPath(targetDir), "utf-8");
|
|
24507
24587
|
manifest = JSON.parse(content);
|
|
24508
24588
|
} catch {
|
|
24509
24589
|
console.log(source_default.yellow(" \u26A0 No upload manifest found"));
|
|
@@ -24556,12 +24636,12 @@ async function refreshManifest(options) {
|
|
|
24556
24636
|
}
|
|
24557
24637
|
async function findDataFiles(rootDir) {
|
|
24558
24638
|
const files = [];
|
|
24559
|
-
const excludeFiles = [
|
|
24639
|
+
const excludeFiles = [IMAGE_MANIFEST, LEGACY_IMAGE_MANIFEST];
|
|
24560
24640
|
async function scan(dir) {
|
|
24561
24641
|
try {
|
|
24562
24642
|
const entries = await fs3__default.default.readdir(dir, { withFileTypes: true });
|
|
24563
24643
|
for (const entry of entries) {
|
|
24564
|
-
const fullPath =
|
|
24644
|
+
const fullPath = path12__default.default.join(dir, entry.name);
|
|
24565
24645
|
if (entry.isDirectory()) {
|
|
24566
24646
|
if (["node_modules", ".next", ".git", "dist", "build"].includes(entry.name)) {
|
|
24567
24647
|
continue;
|
|
@@ -24571,7 +24651,7 @@ async function findDataFiles(rootDir) {
|
|
|
24571
24651
|
if (excludeFiles.includes(entry.name)) {
|
|
24572
24652
|
continue;
|
|
24573
24653
|
}
|
|
24574
|
-
const ext2 =
|
|
24654
|
+
const ext2 = path12__default.default.extname(entry.name).toLowerCase();
|
|
24575
24655
|
if ([".js", ".ts", ".json", ".jsx", ".tsx", ".mjs", ".cjs"].includes(ext2)) {
|
|
24576
24656
|
files.push(fullPath);
|
|
24577
24657
|
}
|
|
@@ -24584,16 +24664,16 @@ async function findDataFiles(rootDir) {
|
|
|
24584
24664
|
return files;
|
|
24585
24665
|
}
|
|
24586
24666
|
async function scanPublicImages(rootDir) {
|
|
24587
|
-
const publicDir =
|
|
24667
|
+
const publicDir = path12__default.default.join(rootDir, "public");
|
|
24588
24668
|
const images = [];
|
|
24589
24669
|
let totalSize = 0;
|
|
24590
24670
|
let usageCount = 0;
|
|
24591
24671
|
const imageFiles = await findImagesRecursive(publicDir);
|
|
24592
24672
|
const sourceFiles = await findSourceFiles2(rootDir);
|
|
24593
24673
|
for (const imagePath of imageFiles) {
|
|
24594
|
-
const relPath =
|
|
24595
|
-
const filename =
|
|
24596
|
-
const ext2 =
|
|
24674
|
+
const relPath = path12__default.default.relative(rootDir, imagePath);
|
|
24675
|
+
const filename = path12__default.default.basename(imagePath);
|
|
24676
|
+
const ext2 = path12__default.default.extname(filename).toLowerCase();
|
|
24597
24677
|
const stat = await fs3__default.default.stat(imagePath);
|
|
24598
24678
|
const category = getCategoryFromPath(relPath);
|
|
24599
24679
|
const suggestedSlotId = generateSlotId(relPath);
|
|
@@ -24619,11 +24699,11 @@ async function findImagesRecursive(dir, files = []) {
|
|
|
24619
24699
|
try {
|
|
24620
24700
|
const entries = await fs3__default.default.readdir(dir, { withFileTypes: true });
|
|
24621
24701
|
for (const entry of entries) {
|
|
24622
|
-
const fullPath =
|
|
24702
|
+
const fullPath = path12__default.default.join(dir, entry.name);
|
|
24623
24703
|
if (entry.isDirectory()) {
|
|
24624
24704
|
await findImagesRecursive(fullPath, files);
|
|
24625
24705
|
} else if (entry.isFile()) {
|
|
24626
|
-
const ext2 =
|
|
24706
|
+
const ext2 = path12__default.default.extname(entry.name).toLowerCase();
|
|
24627
24707
|
if (IMAGE_EXTENSIONS.includes(ext2)) {
|
|
24628
24708
|
files.push(fullPath);
|
|
24629
24709
|
}
|
|
@@ -24636,7 +24716,7 @@ async function findImagesRecursive(dir, files = []) {
|
|
|
24636
24716
|
async function findSourceFiles2(dir, files = []) {
|
|
24637
24717
|
const entries = await fs3__default.default.readdir(dir, { withFileTypes: true });
|
|
24638
24718
|
for (const entry of entries) {
|
|
24639
|
-
const fullPath =
|
|
24719
|
+
const fullPath = path12__default.default.join(dir, entry.name);
|
|
24640
24720
|
if (entry.isDirectory()) {
|
|
24641
24721
|
if (["node_modules", ".next", ".git", "dist", "build", "public"].includes(entry.name)) {
|
|
24642
24722
|
continue;
|
|
@@ -24652,8 +24732,8 @@ async function findSourceFiles2(dir, files = []) {
|
|
|
24652
24732
|
}
|
|
24653
24733
|
async function findImageUsages(imagePath, sourceFiles, rootDir) {
|
|
24654
24734
|
const usages = [];
|
|
24655
|
-
const filename =
|
|
24656
|
-
const relPath =
|
|
24735
|
+
const filename = path12__default.default.basename(imagePath);
|
|
24736
|
+
const relPath = path12__default.default.relative(path12__default.default.join(rootDir, "public"), imagePath);
|
|
24657
24737
|
const patterns = [
|
|
24658
24738
|
`/${relPath}`,
|
|
24659
24739
|
// /images/hero.jpg
|
|
@@ -24675,7 +24755,7 @@ async function findImageUsages(imagePath, sourceFiles, rootDir) {
|
|
|
24675
24755
|
const elementType = detectElementType(line);
|
|
24676
24756
|
const canAutoMigrate = ["img", "Image"].includes(elementType);
|
|
24677
24757
|
usages.push({
|
|
24678
|
-
filePath:
|
|
24758
|
+
filePath: path12__default.default.relative(rootDir, sourceFile),
|
|
24679
24759
|
line: i + 1,
|
|
24680
24760
|
elementType,
|
|
24681
24761
|
altText: extractAltText(line),
|
|
@@ -24747,7 +24827,7 @@ function detectCriticalImage(filename, relPath, usages, fileSize) {
|
|
|
24747
24827
|
(u) => u.filePath.includes("layout.") || u.filePath.includes("/layout/")
|
|
24748
24828
|
);
|
|
24749
24829
|
const usedInCriticalComponent = usages.some((u) => {
|
|
24750
|
-
const fileName =
|
|
24830
|
+
const fileName = path12__default.default.basename(u.filePath).toLowerCase();
|
|
24751
24831
|
return fileName.includes("header") || fileName.includes("navbar") || fileName.includes("nav.") || fileName.includes("hero") || fileName.includes("footer");
|
|
24752
24832
|
});
|
|
24753
24833
|
const isSiteLogo = SITE_LOGO_PATTERNS.some((p) => p.test(filename));
|
|
@@ -24883,7 +24963,7 @@ async function uploadAndMigrateImages(scanResults, options) {
|
|
|
24883
24963
|
for (const img of scanResults.images) {
|
|
24884
24964
|
try {
|
|
24885
24965
|
const uploadResult = await uploadImageToPortal(
|
|
24886
|
-
|
|
24966
|
+
path12__default.default.join(rootDir, img.filePath),
|
|
24887
24967
|
img,
|
|
24888
24968
|
{
|
|
24889
24969
|
apiUrl: options.apiUrl,
|
|
@@ -24911,7 +24991,7 @@ async function uploadAndMigrateImages(scanResults, options) {
|
|
|
24911
24991
|
}
|
|
24912
24992
|
for (const [filePath, migrations] of byFile) {
|
|
24913
24993
|
try {
|
|
24914
|
-
await migrateFileImages(
|
|
24994
|
+
await migrateFileImages(path12__default.default.join(rootDir, filePath), migrations);
|
|
24915
24995
|
result.migrated += migrations.length;
|
|
24916
24996
|
} catch (error2) {
|
|
24917
24997
|
result.errors.push(`Migration failed for ${filePath}: ${error2.message}`);
|
|
@@ -24925,31 +25005,25 @@ async function migrateCommand(options) {
|
|
|
24925
25005
|
console.log("");
|
|
24926
25006
|
console.log(source_default.bold(" Site-Kit Migration"));
|
|
24927
25007
|
console.log("");
|
|
24928
|
-
const apiKey =
|
|
24929
|
-
const projectId = process.env.SONOR_PROJECT_ID;
|
|
24930
|
-
if (!apiKey || !projectId) {
|
|
24931
|
-
console.log(source_default.red(" \u2717 Missing environment variables"));
|
|
24932
|
-
console.log(source_default.gray(" Run `sonor-setup init` first to configure your project."));
|
|
24933
|
-
console.log("");
|
|
24934
|
-
process.exit(1);
|
|
24935
|
-
}
|
|
25008
|
+
const { apiKey, projectId, apiUrl } = await loadConfig({ resolveProject: true });
|
|
24936
25009
|
if (options.dryRun) {
|
|
24937
25010
|
console.log(source_default.yellow(" Running in dry-run mode - no files will be modified"));
|
|
24938
25011
|
console.log("");
|
|
24939
25012
|
}
|
|
24940
25013
|
if (options.file) {
|
|
24941
|
-
const filePath =
|
|
25014
|
+
const filePath = path12__default.default.resolve(options.file);
|
|
24942
25015
|
try {
|
|
24943
25016
|
await fs3__default.default.access(filePath);
|
|
24944
25017
|
} catch {
|
|
24945
25018
|
console.log(source_default.red(` \u2717 File not found: ${filePath}`));
|
|
24946
25019
|
process.exit(1);
|
|
24947
25020
|
}
|
|
24948
|
-
const spinner = ora(`Migrating ${
|
|
25021
|
+
const spinner = ora(`Migrating ${path12__default.default.basename(filePath)}...`).start();
|
|
24949
25022
|
try {
|
|
24950
25023
|
const result = await migrateFile(filePath, {
|
|
24951
25024
|
projectId,
|
|
24952
25025
|
apiKey,
|
|
25026
|
+
apiUrl,
|
|
24953
25027
|
dryRun: options.dryRun
|
|
24954
25028
|
});
|
|
24955
25029
|
if (result.success) {
|
|
@@ -25012,6 +25086,7 @@ async function migrateCommand(options) {
|
|
|
25012
25086
|
const results = await migrateFiles(scanResults, {
|
|
25013
25087
|
projectId,
|
|
25014
25088
|
apiKey,
|
|
25089
|
+
apiUrl,
|
|
25015
25090
|
dryRun: options.dryRun
|
|
25016
25091
|
});
|
|
25017
25092
|
const successful = results.filter((r) => r.success);
|
|
@@ -25041,10 +25116,9 @@ async function migrateCommand(options) {
|
|
|
25041
25116
|
process.exit(1);
|
|
25042
25117
|
}
|
|
25043
25118
|
console.log("");
|
|
25044
|
-
await handleImageMigration(options, apiKey);
|
|
25119
|
+
await handleImageMigration(options, apiKey, apiUrl);
|
|
25045
25120
|
}
|
|
25046
|
-
async function handleImageMigration(options, apiKey,
|
|
25047
|
-
const apiUrl = process.env.SONOR_API_URL || "https://api.sonor.io";
|
|
25121
|
+
async function handleImageMigration(options, apiKey, apiUrl) {
|
|
25048
25122
|
const imageScanSpinner = ora("Scanning for images...").start();
|
|
25049
25123
|
let imageResults;
|
|
25050
25124
|
try {
|
|
@@ -25108,17 +25182,11 @@ function formatBytes2(bytes) {
|
|
|
25108
25182
|
return `${parseFloat((bytes / Math.pow(k2, i)).toFixed(1))} ${sizes[i]}`;
|
|
25109
25183
|
}
|
|
25110
25184
|
var SKIP_PROPS = ["href", "src", "className", "style", "onClick", "ref", "key", "id", "target", "rel", "type", "name", "variant", "size", "icon"];
|
|
25111
|
-
var
|
|
25112
|
-
var TEMPLATES_DIR = ".uptrade/templates";
|
|
25185
|
+
var TEMPLATES_DIR = path12__default.default.join(SONOR_STATE_DIR, "templates");
|
|
25113
25186
|
async function locationsCommand(subcommand, arg, options) {
|
|
25114
25187
|
console.log("");
|
|
25115
25188
|
console.log(source_default.bold(" \u{1F4CD} Site-Kit Location Page Manager"));
|
|
25116
25189
|
console.log("");
|
|
25117
|
-
const config2 = await loadConfig();
|
|
25118
|
-
if (!config2?.projectId) {
|
|
25119
|
-
console.log(source_default.red(" \u2717 Not configured. Run `npx sonor-setup init` first."));
|
|
25120
|
-
return;
|
|
25121
|
-
}
|
|
25122
25190
|
switch (subcommand) {
|
|
25123
25191
|
case "template":
|
|
25124
25192
|
if (!arg) {
|
|
@@ -25126,6 +25194,7 @@ async function locationsCommand(subcommand, arg, options) {
|
|
|
25126
25194
|
console.log(source_default.gray(" Example: locations template ./app/services/plumbing/page.tsx"));
|
|
25127
25195
|
return;
|
|
25128
25196
|
}
|
|
25197
|
+
await loadConfig();
|
|
25129
25198
|
await templateCommand(arg, options);
|
|
25130
25199
|
break;
|
|
25131
25200
|
case "upload":
|
|
@@ -25133,17 +25202,17 @@ async function locationsCommand(subcommand, arg, options) {
|
|
|
25133
25202
|
console.log(source_default.red(" \u2717 Usage: locations upload --template <name>"));
|
|
25134
25203
|
return;
|
|
25135
25204
|
}
|
|
25136
|
-
await uploadCommand(options.template,
|
|
25205
|
+
await uploadCommand(options.template, await loadConfig({ resolveProject: true }));
|
|
25137
25206
|
break;
|
|
25138
25207
|
case "generate":
|
|
25139
25208
|
if (!options.template) {
|
|
25140
25209
|
console.log(source_default.red(' \u2717 Usage: locations generate --template <name> --locations "City, ST" ...'));
|
|
25141
25210
|
return;
|
|
25142
25211
|
}
|
|
25143
|
-
await generateCommand(options,
|
|
25212
|
+
await generateCommand(options, await loadConfig({ resolveProject: true }));
|
|
25144
25213
|
break;
|
|
25145
25214
|
case "list":
|
|
25146
|
-
await listCommand(
|
|
25215
|
+
await listCommand(await loadConfig({ resolveProject: true }));
|
|
25147
25216
|
break;
|
|
25148
25217
|
default:
|
|
25149
25218
|
console.log(source_default.yellow(" Available subcommands:"));
|
|
@@ -25155,10 +25224,10 @@ async function locationsCommand(subcommand, arg, options) {
|
|
|
25155
25224
|
console.log("");
|
|
25156
25225
|
}
|
|
25157
25226
|
}
|
|
25158
|
-
async function templateCommand(sourcePath, options
|
|
25227
|
+
async function templateCommand(sourcePath, options) {
|
|
25159
25228
|
const spinner = ora("Analyzing source page...").start();
|
|
25160
25229
|
try {
|
|
25161
|
-
const resolvedPath =
|
|
25230
|
+
const resolvedPath = path12__default.default.resolve(sourcePath);
|
|
25162
25231
|
if (!fs.existsSync(resolvedPath)) {
|
|
25163
25232
|
spinner.fail(`File not found: ${sourcePath}`);
|
|
25164
25233
|
return;
|
|
@@ -25171,8 +25240,8 @@ async function templateCommand(sourcePath, options, config2) {
|
|
|
25171
25240
|
const slots = [];
|
|
25172
25241
|
const componentNames = [];
|
|
25173
25242
|
chunkJS75ORH7_js.traverse(ast, {
|
|
25174
|
-
JSXElement(
|
|
25175
|
-
const openingElement =
|
|
25243
|
+
JSXElement(path29) {
|
|
25244
|
+
const openingElement = path29.node.openingElement;
|
|
25176
25245
|
if (chunkJS75ORH7_js.isJSXIdentifier(openingElement.name)) {
|
|
25177
25246
|
const componentName = openingElement.name.name;
|
|
25178
25247
|
if (componentName[0] === componentName[0].toUpperCase()) {
|
|
@@ -25212,8 +25281,9 @@ async function templateCommand(sourcePath, options, config2) {
|
|
|
25212
25281
|
},
|
|
25213
25282
|
managed_components: ["schema", "faqs", "metadata"]
|
|
25214
25283
|
};
|
|
25215
|
-
|
|
25216
|
-
|
|
25284
|
+
const templatesDir = path12__default.default.join(process.cwd(), TEMPLATES_DIR);
|
|
25285
|
+
await fs3__default.default.mkdir(templatesDir, { recursive: true });
|
|
25286
|
+
const templatePath = path12__default.default.join(templatesDir, `${templateName}.json`);
|
|
25217
25287
|
await fs3__default.default.writeFile(templatePath, JSON.stringify(template, null, 2));
|
|
25218
25288
|
console.log("");
|
|
25219
25289
|
console.log(source_default.green(" \u2713 Template created:"), source_default.cyan(templatePath));
|
|
@@ -25292,7 +25362,7 @@ function inferGenerationHint(propName) {
|
|
|
25292
25362
|
return void 0;
|
|
25293
25363
|
}
|
|
25294
25364
|
function inferTemplateName(sourcePath) {
|
|
25295
|
-
const parts = sourcePath.split(
|
|
25365
|
+
const parts = sourcePath.split(path12__default.default.sep);
|
|
25296
25366
|
const pageIndex = parts.findIndex((p) => p === "page.tsx" || p === "page.jsx");
|
|
25297
25367
|
if (pageIndex > 0) {
|
|
25298
25368
|
return parts[pageIndex - 1];
|
|
@@ -25301,14 +25371,14 @@ function inferTemplateName(sourcePath) {
|
|
|
25301
25371
|
return filtered[filtered.length - 1] || "template";
|
|
25302
25372
|
}
|
|
25303
25373
|
function inferSourcePagePath(sourcePath) {
|
|
25304
|
-
const parts = sourcePath.split(
|
|
25374
|
+
const parts = sourcePath.split(path12__default.default.sep);
|
|
25305
25375
|
const appIndex = parts.findIndex((p) => p === "app" || p === "pages");
|
|
25306
25376
|
if (appIndex >= 0) {
|
|
25307
25377
|
const pathParts = parts.slice(appIndex + 1);
|
|
25308
25378
|
const filtered = pathParts.filter((p) => !["page.tsx", "page.jsx", "index.tsx", "index.jsx"].includes(p));
|
|
25309
25379
|
return "/" + filtered.join("/");
|
|
25310
25380
|
}
|
|
25311
|
-
return "/" +
|
|
25381
|
+
return "/" + path12__default.default.basename(sourcePath, path12__default.default.extname(sourcePath));
|
|
25312
25382
|
}
|
|
25313
25383
|
function toSnakeCase(str) {
|
|
25314
25384
|
return str.replace(/([A-Z])/g, "_$1").toLowerCase().replace(/^_/, "");
|
|
@@ -25320,22 +25390,22 @@ function truncate(str, maxLength) {
|
|
|
25320
25390
|
async function uploadCommand(templateName, config2) {
|
|
25321
25391
|
const spinner = ora("Uploading template to Portal...").start();
|
|
25322
25392
|
try {
|
|
25323
|
-
const templatePath =
|
|
25393
|
+
const templatePath = resolveStateReadPath(path12__default.default.join("templates", `${templateName}.json`));
|
|
25324
25394
|
if (!fs.existsSync(templatePath)) {
|
|
25325
25395
|
spinner.fail(`Template not found: ${templatePath}`);
|
|
25326
25396
|
console.log(source_default.gray(` Run: npx sonor-setup locations template <page> --name ${templateName}`));
|
|
25327
25397
|
return;
|
|
25328
25398
|
}
|
|
25329
25399
|
const template = JSON.parse(fs.readFileSync(templatePath, "utf-8"));
|
|
25330
|
-
const response = await fetch(`${
|
|
25400
|
+
const response = await fetch(`${config2.apiUrl}/seo/location-templates`, {
|
|
25331
25401
|
method: "POST",
|
|
25332
25402
|
headers: {
|
|
25333
25403
|
"Content-Type": "application/json",
|
|
25334
25404
|
"Authorization": `Bearer ${config2.apiKey}`
|
|
25335
25405
|
},
|
|
25336
25406
|
body: JSON.stringify({
|
|
25337
|
-
|
|
25338
|
-
|
|
25407
|
+
...template,
|
|
25408
|
+
project_id: config2.projectId
|
|
25339
25409
|
})
|
|
25340
25410
|
});
|
|
25341
25411
|
if (!response.ok) {
|
|
@@ -25343,11 +25413,11 @@ async function uploadCommand(templateName, config2) {
|
|
|
25343
25413
|
if (response.status === 409) {
|
|
25344
25414
|
spinner.text = "Template exists, updating...";
|
|
25345
25415
|
const existing = await fetch(
|
|
25346
|
-
`${
|
|
25416
|
+
`${config2.apiUrl}/seo/location-templates/by-name/${templateName}?project_id=${config2.projectId}`,
|
|
25347
25417
|
{ headers: { "Authorization": `Bearer ${config2.apiKey}` } }
|
|
25348
25418
|
);
|
|
25349
25419
|
const existingData = await existing.json();
|
|
25350
|
-
const updateResponse = await fetch(`${
|
|
25420
|
+
const updateResponse = await fetch(`${config2.apiUrl}/seo/location-templates/${existingData.id}`, {
|
|
25351
25421
|
method: "PUT",
|
|
25352
25422
|
headers: {
|
|
25353
25423
|
"Content-Type": "application/json",
|
|
@@ -25396,7 +25466,7 @@ async function generateCommand(options, config2) {
|
|
|
25396
25466
|
}
|
|
25397
25467
|
const spinner = ora(`Generating ${type || "service-location"} pages...`).start();
|
|
25398
25468
|
try {
|
|
25399
|
-
const response = await fetch(`${
|
|
25469
|
+
const response = await fetch(`${config2.apiUrl}/seo/location-pages/generate`, {
|
|
25400
25470
|
method: "POST",
|
|
25401
25471
|
headers: {
|
|
25402
25472
|
"Content-Type": "application/json",
|
|
@@ -25436,7 +25506,7 @@ async function listCommand(config2) {
|
|
|
25436
25506
|
const spinner = ora("Fetching templates...").start();
|
|
25437
25507
|
try {
|
|
25438
25508
|
const response = await fetch(
|
|
25439
|
-
`${
|
|
25509
|
+
`${config2.apiUrl}/seo/location-templates?project_id=${config2.projectId}`,
|
|
25440
25510
|
{ headers: { "Authorization": `Bearer ${config2.apiKey}` } }
|
|
25441
25511
|
);
|
|
25442
25512
|
if (!response.ok) {
|
|
@@ -25461,69 +25531,21 @@ async function listCommand(config2) {
|
|
|
25461
25531
|
});
|
|
25462
25532
|
}
|
|
25463
25533
|
console.log("");
|
|
25464
|
-
|
|
25465
|
-
|
|
25466
|
-
|
|
25467
|
-
|
|
25468
|
-
console.log(source_default.gray(
|
|
25469
|
-
|
|
25470
|
-
|
|
25471
|
-
});
|
|
25472
|
-
console.log("");
|
|
25473
|
-
}
|
|
25534
|
+
const localTemplates = await listLocalTemplates();
|
|
25535
|
+
if (localTemplates.length > 0) {
|
|
25536
|
+
console.log(source_default.gray(" Local (not uploaded):"));
|
|
25537
|
+
localTemplates.forEach((f) => {
|
|
25538
|
+
console.log(source_default.gray(` \u2022 ${f.replace(".json", "")}`));
|
|
25539
|
+
});
|
|
25540
|
+
console.log("");
|
|
25474
25541
|
}
|
|
25475
25542
|
} catch (error2) {
|
|
25476
25543
|
spinner.fail(`Failed to fetch templates: ${error2.message}`);
|
|
25477
25544
|
}
|
|
25478
25545
|
}
|
|
25479
|
-
async function loadConfig() {
|
|
25480
|
-
const configPath = path10__default.default.join(".uptrade", "config.json");
|
|
25481
|
-
if (fs.existsSync(configPath)) {
|
|
25482
|
-
try {
|
|
25483
|
-
const config2 = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
25484
|
-
return {
|
|
25485
|
-
projectId: config2.projectId || config2.project_id,
|
|
25486
|
-
apiKey: config2.apiKey || config2.api_key
|
|
25487
|
-
};
|
|
25488
|
-
} catch {
|
|
25489
|
-
return null;
|
|
25490
|
-
}
|
|
25491
|
-
}
|
|
25492
|
-
const projectId = process.env.SONOR_PROJECT_ID;
|
|
25493
|
-
const apiKey = process.env.SONOR_API_KEY;
|
|
25494
|
-
if (projectId && apiKey) {
|
|
25495
|
-
return { projectId, apiKey };
|
|
25496
|
-
}
|
|
25497
|
-
return null;
|
|
25498
|
-
}
|
|
25499
|
-
var API_URL3 = process.env.SONOR_API_URL || "https://api.sonor.io";
|
|
25500
|
-
async function loadConfig2() {
|
|
25501
|
-
const configPath = path10__default.default.join(".uptrade", "config.json");
|
|
25502
|
-
if (fs.existsSync(configPath)) {
|
|
25503
|
-
try {
|
|
25504
|
-
const config2 = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
25505
|
-
return {
|
|
25506
|
-
projectId: config2.projectId || config2.project_id,
|
|
25507
|
-
apiKey: config2.apiKey || config2.api_key
|
|
25508
|
-
};
|
|
25509
|
-
} catch {
|
|
25510
|
-
return null;
|
|
25511
|
-
}
|
|
25512
|
-
}
|
|
25513
|
-
const projectId = process.env.SONOR_PROJECT_ID;
|
|
25514
|
-
const apiKey = process.env.SONOR_API_KEY;
|
|
25515
|
-
if (projectId && apiKey) return { projectId, apiKey };
|
|
25516
|
-
return null;
|
|
25517
|
-
}
|
|
25518
25546
|
async function faqsCommand(subcommand, options) {
|
|
25519
25547
|
console.log("");
|
|
25520
|
-
const config2 = await
|
|
25521
|
-
if (!config2?.projectId || !config2?.apiKey) {
|
|
25522
|
-
console.log(source_default.red(" \u2717 Not configured. Run `npx sonor-setup init` first."));
|
|
25523
|
-
console.log(source_default.gray(" Set SONOR_API_KEY, or use .uptrade/config.json"));
|
|
25524
|
-
console.log("");
|
|
25525
|
-
return;
|
|
25526
|
-
}
|
|
25548
|
+
const config2 = await loadConfig({ resolveProject: true });
|
|
25527
25549
|
switch (subcommand) {
|
|
25528
25550
|
case "extract":
|
|
25529
25551
|
await extractCommand(options, config2);
|
|
@@ -25573,7 +25595,7 @@ async function extractCommand(options, config2) {
|
|
|
25573
25595
|
const faqContexts = [];
|
|
25574
25596
|
for (const faq of faqSections) {
|
|
25575
25597
|
try {
|
|
25576
|
-
const fullPath =
|
|
25598
|
+
const fullPath = path12__default.default.resolve(process.cwd(), faq.filePath);
|
|
25577
25599
|
const content = await fs3__default.default.readFile(fullPath, "utf-8");
|
|
25578
25600
|
let pagePath = faq.filePath.replace(/^app\//, "/").replace(/^src\/app\//, "/").replace(/\/page\.(tsx?|jsx?)$/, "").replace(/\[([^\]]+)\]/g, ":$1");
|
|
25579
25601
|
if (pagePath === "" || pagePath === "/page") pagePath = "/";
|
|
@@ -25588,7 +25610,7 @@ async function extractCommand(options, config2) {
|
|
|
25588
25610
|
if (importPath.startsWith("@/")) {
|
|
25589
25611
|
resolvedPath = importPath.replace("@/", "./");
|
|
25590
25612
|
} else if (importPath.startsWith(".")) {
|
|
25591
|
-
resolvedPath =
|
|
25613
|
+
resolvedPath = path12__default.default.resolve(path12__default.default.dirname(fullPath), importPath);
|
|
25592
25614
|
}
|
|
25593
25615
|
const extensions = ["", ".js", ".ts", ".jsx", ".tsx", ".json"];
|
|
25594
25616
|
for (const ext2 of extensions) {
|
|
@@ -25633,7 +25655,7 @@ async function extractCommand(options, config2) {
|
|
|
25633
25655
|
}
|
|
25634
25656
|
const extractSpinner = ora("Extracting FAQs via AI...").start();
|
|
25635
25657
|
try {
|
|
25636
|
-
const response = await fetch(`${
|
|
25658
|
+
const response = await fetch(`${config2.apiUrl}/seo/managed/faqs/extract`, {
|
|
25637
25659
|
method: "POST",
|
|
25638
25660
|
headers: {
|
|
25639
25661
|
"Content-Type": "application/json",
|
|
@@ -25668,7 +25690,7 @@ async function extractCommand(options, config2) {
|
|
|
25668
25690
|
let failed = 0;
|
|
25669
25691
|
for (const faq of extractedFaqs) {
|
|
25670
25692
|
try {
|
|
25671
|
-
const res = await fetch(`${
|
|
25693
|
+
const res = await fetch(`${config2.apiUrl}/seo/managed/faqs`, {
|
|
25672
25694
|
method: "POST",
|
|
25673
25695
|
headers: {
|
|
25674
25696
|
"Content-Type": "application/json",
|
|
@@ -25693,7 +25715,7 @@ async function extractCommand(options, config2) {
|
|
|
25693
25715
|
uploaded++;
|
|
25694
25716
|
console.log(source_default.green(` \u2713 ${faq.path}`) + source_default.gray(` (${faq.items.length} items)`));
|
|
25695
25717
|
} else if (res.status === 409 || res.status === 400) {
|
|
25696
|
-
const updateRes = await fetch(`${
|
|
25718
|
+
const updateRes = await fetch(`${config2.apiUrl}/seo/managed/faqs/by-path`, {
|
|
25697
25719
|
method: "PUT",
|
|
25698
25720
|
headers: {
|
|
25699
25721
|
"Content-Type": "application/json",
|
|
@@ -25780,7 +25802,7 @@ async function syncCommand(options, config2) {
|
|
|
25780
25802
|
const listSpinner = ora("Fetching existing FAQ sections from Portal...").start();
|
|
25781
25803
|
let existing = [];
|
|
25782
25804
|
try {
|
|
25783
|
-
const res = await fetch(`${
|
|
25805
|
+
const res = await fetch(`${config2.apiUrl}/seo/managed/faqs/project/${config2.projectId}`, {
|
|
25784
25806
|
headers: { Authorization: `Bearer ${config2.apiKey}` }
|
|
25785
25807
|
});
|
|
25786
25808
|
if (!res.ok) {
|
|
@@ -25809,7 +25831,7 @@ async function syncCommand(options, config2) {
|
|
|
25809
25831
|
let failed = 0;
|
|
25810
25832
|
for (const p of toCreate) {
|
|
25811
25833
|
try {
|
|
25812
|
-
const res = await fetch(`${
|
|
25834
|
+
const res = await fetch(`${config2.apiUrl}/seo/managed/faqs`, {
|
|
25813
25835
|
method: "POST",
|
|
25814
25836
|
headers: {
|
|
25815
25837
|
"Content-Type": "application/json",
|
|
@@ -25846,44 +25868,12 @@ async function syncCommand(options, config2) {
|
|
|
25846
25868
|
console.log(source_default.gray(" Add questions and answers there; they will appear on your site."));
|
|
25847
25869
|
console.log("");
|
|
25848
25870
|
}
|
|
25849
|
-
function getApiUrl() {
|
|
25850
|
-
return process.env.SONOR_API_URL || "https://api.sonor.io";
|
|
25851
|
-
}
|
|
25852
|
-
async function loadConfig3() {
|
|
25853
|
-
const configPath = path10__default.default.join(".uptrade", "config.json");
|
|
25854
|
-
if (fs.existsSync(configPath)) {
|
|
25855
|
-
try {
|
|
25856
|
-
const config2 = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
25857
|
-
return {
|
|
25858
|
-
projectId: config2.projectId || config2.project_id,
|
|
25859
|
-
apiKey: config2.apiKey || config2.api_key,
|
|
25860
|
-
siteUrl: config2.siteUrl || config2.site_url,
|
|
25861
|
-
businessInfo: config2.businessInfo || config2.business_info
|
|
25862
|
-
};
|
|
25863
|
-
} catch {
|
|
25864
|
-
return null;
|
|
25865
|
-
}
|
|
25866
|
-
}
|
|
25867
|
-
const projectId = process.env.SONOR_PROJECT_ID;
|
|
25868
|
-
const apiKey = process.env.SONOR_API_KEY;
|
|
25869
|
-
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || process.env.SITE_URL;
|
|
25870
|
-
if (projectId && apiKey) {
|
|
25871
|
-
return { projectId, apiKey, siteUrl };
|
|
25872
|
-
}
|
|
25873
|
-
return null;
|
|
25874
|
-
}
|
|
25875
25871
|
async function setupCommand(options) {
|
|
25876
25872
|
console.log("");
|
|
25877
25873
|
console.log(source_default.bold.blue(" \u{1F680} Signal-Enhanced SEO Setup"));
|
|
25878
25874
|
console.log(source_default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
25879
25875
|
console.log("");
|
|
25880
|
-
const config2 = await
|
|
25881
|
-
if (!config2?.projectId || !config2?.apiKey) {
|
|
25882
|
-
console.log(source_default.red(" \u2717 Not configured. Run `npx sonor-setup init` first."));
|
|
25883
|
-
console.log(source_default.gray(" Set SONOR_API_KEY"));
|
|
25884
|
-
console.log("");
|
|
25885
|
-
return;
|
|
25886
|
-
}
|
|
25876
|
+
const config2 = await loadConfig();
|
|
25887
25877
|
const capabilities = [];
|
|
25888
25878
|
if (options.faqsOnly) {
|
|
25889
25879
|
capabilities.push("extract_faqs");
|
|
@@ -25981,14 +25971,13 @@ async function setupCommand(options) {
|
|
|
25981
25971
|
const batch = batches[batchIndex];
|
|
25982
25972
|
const batchSpinner = ora(`Batch ${batchIndex + 1}/${batches.length}: Analyzing ${batch.length} pages...`).start();
|
|
25983
25973
|
try {
|
|
25984
|
-
const response = await fetch(`${
|
|
25974
|
+
const response = await fetch(`${config2.apiUrl}/api/public/seo/site-setup`, {
|
|
25985
25975
|
method: "POST",
|
|
25986
25976
|
headers: {
|
|
25987
25977
|
"Content-Type": "application/json",
|
|
25988
25978
|
"x-api-key": config2.apiKey
|
|
25989
25979
|
},
|
|
25990
25980
|
body: JSON.stringify({
|
|
25991
|
-
project_id: config2.projectId,
|
|
25992
25981
|
site_url: config2.siteUrl || "https://example.com",
|
|
25993
25982
|
// Only send business_info on first batch (for org schema)
|
|
25994
25983
|
business_info: batchIndex === 0 ? config2.businessInfo : void 0,
|
|
@@ -26080,10 +26069,10 @@ async function setupCommand(options) {
|
|
|
26080
26069
|
}
|
|
26081
26070
|
async function scanForPageFiles(rootDir) {
|
|
26082
26071
|
const pages = [];
|
|
26083
|
-
const appDir =
|
|
26084
|
-
const srcAppDir =
|
|
26085
|
-
const pagesDir =
|
|
26086
|
-
const srcPagesDir =
|
|
26072
|
+
const appDir = path12__default.default.join(rootDir, "app");
|
|
26073
|
+
const srcAppDir = path12__default.default.join(rootDir, "src", "app");
|
|
26074
|
+
const pagesDir = path12__default.default.join(rootDir, "pages");
|
|
26075
|
+
const srcPagesDir = path12__default.default.join(rootDir, "src", "pages");
|
|
26087
26076
|
const dirs = [appDir, srcAppDir, pagesDir, srcPagesDir];
|
|
26088
26077
|
for (const dir of dirs) {
|
|
26089
26078
|
if (fs.existsSync(dir)) {
|
|
@@ -26095,7 +26084,7 @@ async function scanForPageFiles(rootDir) {
|
|
|
26095
26084
|
async function scanDirectory(dir, baseDir, pages) {
|
|
26096
26085
|
const entries = await fs3__default.default.readdir(dir, { withFileTypes: true });
|
|
26097
26086
|
for (const entry of entries) {
|
|
26098
|
-
const fullPath =
|
|
26087
|
+
const fullPath = path12__default.default.join(dir, entry.name);
|
|
26099
26088
|
if (entry.isDirectory()) {
|
|
26100
26089
|
if (entry.name.startsWith(".") || entry.name === "node_modules" || entry.name === "api") {
|
|
26101
26090
|
continue;
|
|
@@ -26106,8 +26095,8 @@ async function scanDirectory(dir, baseDir, pages) {
|
|
|
26106
26095
|
const isLegacyPage = baseDir.includes("/pages") && entry.name.match(/\.(tsx?|jsx?)$/) && !entry.name.startsWith("_");
|
|
26107
26096
|
if (isPage || isLegacyPage) {
|
|
26108
26097
|
const content = await fs3__default.default.readFile(fullPath, "utf-8");
|
|
26109
|
-
const relativePath =
|
|
26110
|
-
let pagePath = "/" +
|
|
26098
|
+
const relativePath = path12__default.default.relative(baseDir, fullPath);
|
|
26099
|
+
let pagePath = "/" + path12__default.default.dirname(relativePath).replace(/\\/g, "/").replace(/\/page$/, "");
|
|
26111
26100
|
pagePath = pagePath.replace(/\[([^\]]+)\]/g, ":$1").replace(/^\/\.$/, "/");
|
|
26112
26101
|
if (pagePath === "/.") pagePath = "/";
|
|
26113
26102
|
pages.push({
|
|
@@ -26127,10 +26116,10 @@ async function gatherImportedFiles(page, rootDir) {
|
|
|
26127
26116
|
if (importPath.toLowerCase().includes("faq") || importPath.includes("@/data") || importPath.includes("./data") || importPath.includes("../data") || importPath.includes("/constants") || importPath.includes("/content") || importPath.includes("practice-areas") || importPath.includes("subpages") || importPath.includes("pages-data")) {
|
|
26128
26117
|
let resolvedPath = importPath;
|
|
26129
26118
|
if (importPath.startsWith("@/")) {
|
|
26130
|
-
resolvedPath =
|
|
26119
|
+
resolvedPath = path12__default.default.join(rootDir, importPath.replace("@/", ""));
|
|
26131
26120
|
} else if (importPath.startsWith(".")) {
|
|
26132
|
-
const pageDir =
|
|
26133
|
-
resolvedPath =
|
|
26121
|
+
const pageDir = path12__default.default.dirname(path12__default.default.join(rootDir, "app", page.filePath));
|
|
26122
|
+
resolvedPath = path12__default.default.resolve(pageDir, importPath);
|
|
26134
26123
|
}
|
|
26135
26124
|
const extensions = ["", ".js", ".ts", ".jsx", ".tsx", ".json"];
|
|
26136
26125
|
for (const ext2 of extensions) {
|
|
@@ -26186,20 +26175,20 @@ async function expandDynamicRoutes(pages, rootDir) {
|
|
|
26186
26175
|
async function findDynamicRouteData(page, parentPath, rootDir) {
|
|
26187
26176
|
const results = [];
|
|
26188
26177
|
const dataFilePaths = [
|
|
26189
|
-
|
|
26190
|
-
|
|
26191
|
-
|
|
26192
|
-
|
|
26193
|
-
|
|
26194
|
-
|
|
26195
|
-
|
|
26196
|
-
|
|
26197
|
-
|
|
26198
|
-
|
|
26199
|
-
|
|
26200
|
-
|
|
26201
|
-
|
|
26202
|
-
|
|
26178
|
+
path12__default.default.join(rootDir, "data", "practice-areas.js"),
|
|
26179
|
+
path12__default.default.join(rootDir, "data", "practice-areas.ts"),
|
|
26180
|
+
path12__default.default.join(rootDir, "data", "personal-injury-pages.js"),
|
|
26181
|
+
path12__default.default.join(rootDir, "data", "personal-injury-pages.ts"),
|
|
26182
|
+
path12__default.default.join(rootDir, "data", "pages.js"),
|
|
26183
|
+
path12__default.default.join(rootDir, "data", "pages.ts"),
|
|
26184
|
+
path12__default.default.join(rootDir, "data", "content.js"),
|
|
26185
|
+
path12__default.default.join(rootDir, "data", "content.ts"),
|
|
26186
|
+
path12__default.default.join(rootDir, "data", "services.js"),
|
|
26187
|
+
path12__default.default.join(rootDir, "data", "services.ts"),
|
|
26188
|
+
path12__default.default.join(rootDir, "data", "subpages.js"),
|
|
26189
|
+
path12__default.default.join(rootDir, "data", "subpages.ts"),
|
|
26190
|
+
path12__default.default.join(rootDir, "src", "data", "practice-areas.js"),
|
|
26191
|
+
path12__default.default.join(rootDir, "src", "data", "practice-areas.ts")
|
|
26203
26192
|
];
|
|
26204
26193
|
const routeSegment = parentPath.replace(/^\//, "").split("/")[0];
|
|
26205
26194
|
const routeSegmentNormalized = routeSegment.replace(/-/g, "");
|
|
@@ -26291,7 +26280,7 @@ async function uploadFaqs(pages, config2) {
|
|
|
26291
26280
|
for (const page of pages) {
|
|
26292
26281
|
if (!page.faqs?.items?.length) continue;
|
|
26293
26282
|
try {
|
|
26294
|
-
const res = await fetch(`${
|
|
26283
|
+
const res = await fetch(`${config2.apiUrl}/api/public/seo/register-faq`, {
|
|
26295
26284
|
method: "POST",
|
|
26296
26285
|
headers: {
|
|
26297
26286
|
"Content-Type": "application/json",
|
|
@@ -26326,7 +26315,7 @@ async function uploadFaqs(pages, config2) {
|
|
|
26326
26315
|
async function uploadSchemas(pages, globalSchema, config2) {
|
|
26327
26316
|
if (globalSchema) {
|
|
26328
26317
|
try {
|
|
26329
|
-
const res = await fetch(`${
|
|
26318
|
+
const res = await fetch(`${config2.apiUrl}/api/public/seo/register-schema`, {
|
|
26330
26319
|
method: "POST",
|
|
26331
26320
|
headers: {
|
|
26332
26321
|
"Content-Type": "application/json",
|
|
@@ -26352,7 +26341,7 @@ async function uploadSchemas(pages, globalSchema, config2) {
|
|
|
26352
26341
|
if (!page.schemas?.length) continue;
|
|
26353
26342
|
for (const schema of page.schemas) {
|
|
26354
26343
|
try {
|
|
26355
|
-
const res = await fetch(`${
|
|
26344
|
+
const res = await fetch(`${config2.apiUrl}/api/public/seo/register-schema`, {
|
|
26356
26345
|
method: "POST",
|
|
26357
26346
|
headers: {
|
|
26358
26347
|
"Content-Type": "application/json",
|
|
@@ -26376,7 +26365,7 @@ async function uploadSchemas(pages, globalSchema, config2) {
|
|
|
26376
26365
|
}
|
|
26377
26366
|
}
|
|
26378
26367
|
}
|
|
26379
|
-
var APP_DIRS = ["app",
|
|
26368
|
+
var APP_DIRS = ["app", path12__default.default.join("src", "app")];
|
|
26380
26369
|
var CARD_FILE = /^(opengraph-image|twitter-image)\b.*\.(png|jpe?g|gif|webp)$/i;
|
|
26381
26370
|
function safeExists(p) {
|
|
26382
26371
|
try {
|
|
@@ -26396,19 +26385,19 @@ function findPageCards(cwd) {
|
|
|
26396
26385
|
}
|
|
26397
26386
|
for (const entry of entries) {
|
|
26398
26387
|
if (entry.name.startsWith(".") || entry.name === "node_modules") continue;
|
|
26399
|
-
const full =
|
|
26388
|
+
const full = path12__default.default.join(dir, entry.name);
|
|
26400
26389
|
if (entry.isDirectory()) walk(full);
|
|
26401
26390
|
else if (CARD_FILE.test(entry.name)) found.push(full);
|
|
26402
26391
|
}
|
|
26403
26392
|
};
|
|
26404
|
-
for (const rel of APP_DIRS) walk(
|
|
26393
|
+
for (const rel of APP_DIRS) walk(path12__default.default.join(cwd, rel));
|
|
26405
26394
|
return found;
|
|
26406
26395
|
}
|
|
26407
26396
|
function readOgWiring(cwd) {
|
|
26408
26397
|
const siteCard = ["public/og.png", "public/og.jpg", "public/opengraph.png"].some(
|
|
26409
|
-
(rel) => safeExists(
|
|
26398
|
+
(rel) => safeExists(path12__default.default.join(cwd, rel))
|
|
26410
26399
|
);
|
|
26411
|
-
const layoutPath = ["app/layout.tsx", "src/app/layout.tsx"].map((rel) =>
|
|
26400
|
+
const layoutPath = ["app/layout.tsx", "src/app/layout.tsx"].map((rel) => path12__default.default.join(cwd, rel)).find(safeExists);
|
|
26412
26401
|
let layout = "";
|
|
26413
26402
|
if (layoutPath) {
|
|
26414
26403
|
try {
|
|
@@ -26475,7 +26464,7 @@ var SSR_BAILOUT_FIX = `Keep the layout: ${LAYOUT_ALREADY_DEFERS}, so it is not t
|
|
|
26475
26464
|
var ANALYTICS_WRAPPER_FIX = `Remove the <AnalyticsProvider> wrapper: ${LAYOUT_ALREADY_DEFERS} (configure it with analytics={{ ... }}). Track custom events with trackEvent / trackConversion from @sonordev/site-kit/analytics, which need no provider, instead of useAnalytics(). ` + LEGACY_STOPGAP;
|
|
26476
26465
|
|
|
26477
26466
|
// src/cli/agent/checks.ts
|
|
26478
|
-
var
|
|
26467
|
+
var API_URL = process.env.SONOR_API_URL || "https://api.sonor.io";
|
|
26479
26468
|
async function readFileOrNull(p) {
|
|
26480
26469
|
try {
|
|
26481
26470
|
return await fs3__default.default.readFile(p, "utf-8");
|
|
@@ -26485,7 +26474,7 @@ async function readFileOrNull(p) {
|
|
|
26485
26474
|
}
|
|
26486
26475
|
async function findFirst(cwd, candidates) {
|
|
26487
26476
|
for (const rel of candidates) {
|
|
26488
|
-
const full =
|
|
26477
|
+
const full = path12__default.default.join(cwd, rel);
|
|
26489
26478
|
if (await readFileOrNull(full)) return full;
|
|
26490
26479
|
}
|
|
26491
26480
|
return null;
|
|
@@ -26537,7 +26526,7 @@ function checkApiKeyEnv() {
|
|
|
26537
26526
|
};
|
|
26538
26527
|
}
|
|
26539
26528
|
async function checkPackageInstalled(cwd) {
|
|
26540
|
-
const raw = await readFileOrNull(
|
|
26529
|
+
const raw = await readFileOrNull(path12__default.default.join(cwd, "package.json"));
|
|
26541
26530
|
if (!raw) {
|
|
26542
26531
|
return {
|
|
26543
26532
|
id: "package.installed",
|
|
@@ -26601,7 +26590,7 @@ async function checkSiteKitLayout(cwd) {
|
|
|
26601
26590
|
};
|
|
26602
26591
|
}
|
|
26603
26592
|
const content = await readFileOrNull(layoutPath) || "";
|
|
26604
|
-
const rel =
|
|
26593
|
+
const rel = path12__default.default.relative(cwd, layoutPath);
|
|
26605
26594
|
if (content.includes("SiteKitLayout")) {
|
|
26606
26595
|
return {
|
|
26607
26596
|
id: "layout.sitekit",
|
|
@@ -26657,7 +26646,7 @@ async function checkSitemap(cwd) {
|
|
|
26657
26646
|
};
|
|
26658
26647
|
}
|
|
26659
26648
|
async function checkPostbuildSitemap(cwd) {
|
|
26660
|
-
const raw = await readFileOrNull(
|
|
26649
|
+
const raw = await readFileOrNull(path12__default.default.join(cwd, "package.json"));
|
|
26661
26650
|
let pkg = {};
|
|
26662
26651
|
try {
|
|
26663
26652
|
pkg = raw ? JSON.parse(raw) : {};
|
|
@@ -26694,18 +26683,18 @@ async function checkPostbuildSitemap(cwd) {
|
|
|
26694
26683
|
async function checkApiReachable(timeoutMs = 5e3) {
|
|
26695
26684
|
const key = process.env.SONOR_API_KEY;
|
|
26696
26685
|
try {
|
|
26697
|
-
const res = await fetch(`${
|
|
26686
|
+
const res = await fetch(`${API_URL}/health`, {
|
|
26698
26687
|
headers: key ? { "x-api-key": key } : {},
|
|
26699
26688
|
signal: AbortSignal.timeout(timeoutMs)
|
|
26700
26689
|
});
|
|
26701
26690
|
if (res.ok) {
|
|
26702
|
-
return { id: "api.reachable", title: "Sonor API", level: "ok", message: `Reachable (${
|
|
26691
|
+
return { id: "api.reachable", title: "Sonor API", level: "ok", message: `Reachable (${API_URL})` };
|
|
26703
26692
|
}
|
|
26704
26693
|
return {
|
|
26705
26694
|
id: "api.reachable",
|
|
26706
26695
|
title: "Sonor API",
|
|
26707
26696
|
level: "warn",
|
|
26708
|
-
message: `HTTP ${res.status} from ${
|
|
26697
|
+
message: `HTTP ${res.status} from ${API_URL}`
|
|
26709
26698
|
};
|
|
26710
26699
|
} catch (err) {
|
|
26711
26700
|
return {
|
|
@@ -26730,7 +26719,7 @@ async function checkKeyValid(timeoutMs = 8e3) {
|
|
|
26730
26719
|
};
|
|
26731
26720
|
}
|
|
26732
26721
|
try {
|
|
26733
|
-
const res = await fetch(`${
|
|
26722
|
+
const res = await fetch(`${API_URL}/api/public/seo/verify-api-key`, {
|
|
26734
26723
|
headers: { "x-api-key": key },
|
|
26735
26724
|
signal: AbortSignal.timeout(timeoutMs)
|
|
26736
26725
|
});
|
|
@@ -26833,7 +26822,7 @@ async function checkClientAuth(timeoutMs = 8e3) {
|
|
|
26833
26822
|
}
|
|
26834
26823
|
const qs2 = host ? `?host=${encodeURIComponent(host)}` : "";
|
|
26835
26824
|
try {
|
|
26836
|
-
const res = await fetch(`${
|
|
26825
|
+
const res = await fetch(`${API_URL}/api/public/site-token/status${qs2}`, {
|
|
26837
26826
|
headers: { "x-api-key": key },
|
|
26838
26827
|
signal: AbortSignal.timeout(timeoutMs)
|
|
26839
26828
|
});
|
|
@@ -26978,7 +26967,7 @@ async function checkSsrRenderFromUrl(url, timeoutMs = 12e3) {
|
|
|
26978
26967
|
}
|
|
26979
26968
|
}
|
|
26980
26969
|
async function checkSsrRenderFromBuild(cwd) {
|
|
26981
|
-
const appDir =
|
|
26970
|
+
const appDir = path12__default.default.join(cwd, ".next", "server", "app");
|
|
26982
26971
|
let entries;
|
|
26983
26972
|
try {
|
|
26984
26973
|
entries = await fs3__default.default.readdir(appDir);
|
|
@@ -27001,7 +26990,7 @@ async function checkSsrRenderFromBuild(cwd) {
|
|
|
27001
26990
|
detail: "The root route may be fully dynamic. Pass --url to verify a running instance."
|
|
27002
26991
|
};
|
|
27003
26992
|
}
|
|
27004
|
-
const html = await readFileOrNull(
|
|
26993
|
+
const html = await readFileOrNull(path12__default.default.join(appDir, htmlName)) || "";
|
|
27005
26994
|
const { rendered, contentTags } = looksServerRendered(html);
|
|
27006
26995
|
if (rendered) {
|
|
27007
26996
|
return {
|
|
@@ -27024,7 +27013,7 @@ async function checkNetlifyMiddleware(cwd) {
|
|
|
27024
27013
|
const runtimeRe = /runtime\s*[:=]\s*['"](nodejs|edge)['"]/;
|
|
27025
27014
|
const proxyFiles = ["proxy.ts", "proxy.js", "src/proxy.ts", "src/proxy.js"];
|
|
27026
27015
|
for (const rel of proxyFiles) {
|
|
27027
|
-
const content = await readFileOrNull(
|
|
27016
|
+
const content = await readFileOrNull(path12__default.default.join(cwd, rel));
|
|
27028
27017
|
if (content === null) continue;
|
|
27029
27018
|
if (runtimeRe.test(content)) {
|
|
27030
27019
|
return {
|
|
@@ -27041,7 +27030,7 @@ async function checkNetlifyMiddleware(cwd) {
|
|
|
27041
27030
|
}
|
|
27042
27031
|
const middlewareFiles = ["middleware.ts", "middleware.js", "src/middleware.ts", "src/middleware.js"];
|
|
27043
27032
|
for (const rel of middlewareFiles) {
|
|
27044
|
-
const content = await readFileOrNull(
|
|
27033
|
+
const content = await readFileOrNull(path12__default.default.join(cwd, rel));
|
|
27045
27034
|
if (content === null) continue;
|
|
27046
27035
|
if (/runtime\s*[:=]\s*['"]nodejs['"]/.test(content)) {
|
|
27047
27036
|
return {
|
|
@@ -27068,7 +27057,7 @@ async function checkNetlifyMiddleware(cwd) {
|
|
|
27068
27057
|
}
|
|
27069
27058
|
async function checkImageDimsDrift(cwd) {
|
|
27070
27059
|
const scanRoots = ["app", "src/app", "components", "src/components"];
|
|
27071
|
-
const publicDir =
|
|
27060
|
+
const publicDir = path12__default.default.join(cwd, "public");
|
|
27072
27061
|
const files = [];
|
|
27073
27062
|
async function walk(dir, depth) {
|
|
27074
27063
|
if (depth > 4) return;
|
|
@@ -27080,19 +27069,19 @@ async function checkImageDimsDrift(cwd) {
|
|
|
27080
27069
|
}
|
|
27081
27070
|
for (const e of entries) {
|
|
27082
27071
|
if (e.name === "node_modules" || e.name.startsWith(".")) continue;
|
|
27083
|
-
const full =
|
|
27072
|
+
const full = path12__default.default.join(dir, e.name);
|
|
27084
27073
|
if (e.isDirectory()) await walk(full, depth + 1);
|
|
27085
27074
|
else if (/\.(tsx|jsx)$/.test(e.name)) files.push(full);
|
|
27086
27075
|
}
|
|
27087
27076
|
}
|
|
27088
|
-
for (const root of scanRoots) await walk(
|
|
27077
|
+
for (const root of scanRoots) await walk(path12__default.default.join(cwd, root), 0);
|
|
27089
27078
|
if (files.length === 0) {
|
|
27090
27079
|
return { id: "images.dims-drift", title: "Image dims vs SVG", level: "skip", message: "No component files found" };
|
|
27091
27080
|
}
|
|
27092
27081
|
const viewBoxCache = /* @__PURE__ */ new Map();
|
|
27093
27082
|
async function svgAspect(publicPath) {
|
|
27094
27083
|
if (viewBoxCache.has(publicPath)) return viewBoxCache.get(publicPath);
|
|
27095
|
-
const svg = await readFileOrNull(
|
|
27084
|
+
const svg = await readFileOrNull(path12__default.default.join(publicDir, publicPath.replace(/^\//, "")));
|
|
27096
27085
|
let aspect = null;
|
|
27097
27086
|
if (svg) {
|
|
27098
27087
|
const vb = svg.match(/viewBox="([\d.\s-]+)"/);
|
|
@@ -27119,7 +27108,7 @@ async function checkImageDimsDrift(cwd) {
|
|
|
27119
27108
|
const drift = Math.abs(declared - actual) / actual;
|
|
27120
27109
|
if (drift > 0.02) {
|
|
27121
27110
|
drifts.push(
|
|
27122
|
-
`${
|
|
27111
|
+
`${path12__default.default.relative(cwd, file)}: ${src} is ${actual.toFixed(2)}:1 but width/height declare ${declared.toFixed(2)}:1 (${Math.round(drift * 100)}% off)`
|
|
27123
27112
|
);
|
|
27124
27113
|
}
|
|
27125
27114
|
}
|
|
@@ -27235,8 +27224,8 @@ async function statusCommand(options) {
|
|
|
27235
27224
|
|
|
27236
27225
|
// src/og/pages.ts
|
|
27237
27226
|
var DYNAMIC = "*";
|
|
27238
|
-
function pathSegments(
|
|
27239
|
-
return
|
|
27227
|
+
function pathSegments(path29) {
|
|
27228
|
+
return path29.split("/").filter(Boolean);
|
|
27240
27229
|
}
|
|
27241
27230
|
function stripBrandSuffix(title, brand) {
|
|
27242
27231
|
const cleaned = title.replace(/\s*[|–—-]\s*[^|–—-]+$/, "").trim();
|
|
@@ -27244,13 +27233,13 @@ function stripBrandSuffix(title, brand) {
|
|
|
27244
27233
|
if (brand && cleaned.toLowerCase() === brand.toLowerCase()) return title.trim();
|
|
27245
27234
|
return cleaned;
|
|
27246
27235
|
}
|
|
27247
|
-
function titleFromPath(
|
|
27248
|
-
const last = pathSegments(
|
|
27236
|
+
function titleFromPath(path29) {
|
|
27237
|
+
const last = pathSegments(path29).filter((s) => s !== DYNAMIC).pop();
|
|
27249
27238
|
if (!last) return "Home";
|
|
27250
27239
|
return last.replace(/[-_]+/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()).trim();
|
|
27251
27240
|
}
|
|
27252
|
-
function kickerFromPath(
|
|
27253
|
-
const parts = pathSegments(
|
|
27241
|
+
function kickerFromPath(path29, fallback) {
|
|
27242
|
+
const parts = pathSegments(path29);
|
|
27254
27243
|
const section = parts.includes(DYNAMIC) ? parts.filter((s) => s !== DYNAMIC) : parts.slice(0, -1);
|
|
27255
27244
|
if (!section.length) return fallback;
|
|
27256
27245
|
return section.join(" / ").replace(/[-_]+/g, " ");
|
|
@@ -27274,8 +27263,8 @@ function kickerIsRedundant(kicker, title) {
|
|
|
27274
27263
|
const titleWords = new Set(t.split(" "));
|
|
27275
27264
|
return k2.split(" ").every((w) => titleWords.has(w));
|
|
27276
27265
|
}
|
|
27277
|
-
function slugForPath(
|
|
27278
|
-
const segments = pathSegments(
|
|
27266
|
+
function slugForPath(path29) {
|
|
27267
|
+
const segments = pathSegments(path29);
|
|
27279
27268
|
if (!segments.length) return "home";
|
|
27280
27269
|
return segments.map((s) => s === DYNAMIC ? "any" : s).join("-").replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "").toLowerCase();
|
|
27281
27270
|
}
|
|
@@ -27329,10 +27318,10 @@ function findChrome() {
|
|
|
27329
27318
|
}
|
|
27330
27319
|
return null;
|
|
27331
27320
|
}
|
|
27332
|
-
async function
|
|
27321
|
+
async function loadConfig2(cwd) {
|
|
27333
27322
|
const candidates = ["og.config.ts", "og.config.mts", "og.config.mjs", "og.config.js"];
|
|
27334
27323
|
for (const rel of candidates) {
|
|
27335
|
-
const full =
|
|
27324
|
+
const full = path12__default.default.join(cwd, rel);
|
|
27336
27325
|
if (!fs.existsSync(full)) continue;
|
|
27337
27326
|
try {
|
|
27338
27327
|
const mod = await import(
|
|
@@ -27357,7 +27346,7 @@ async function loadConfig4(cwd) {
|
|
|
27357
27346
|
return null;
|
|
27358
27347
|
}
|
|
27359
27348
|
async function seedConfig(cwd) {
|
|
27360
|
-
let name =
|
|
27349
|
+
let name = path12__default.default.basename(cwd).replace(/-nextjs$/, "").replace(/-/g, " ");
|
|
27361
27350
|
let accent = "#111111";
|
|
27362
27351
|
let logo;
|
|
27363
27352
|
try {
|
|
@@ -27370,7 +27359,7 @@ async function seedConfig(cwd) {
|
|
|
27370
27359
|
} catch {
|
|
27371
27360
|
}
|
|
27372
27361
|
for (const candidate of ["/logo-mark.svg", "/logo.svg", "/logohorizontal.svg"]) {
|
|
27373
|
-
if (fs.existsSync(
|
|
27362
|
+
if (fs.existsSync(path12__default.default.join(cwd, "public", candidate))) {
|
|
27374
27363
|
logo = candidate;
|
|
27375
27364
|
break;
|
|
27376
27365
|
}
|
|
@@ -27384,14 +27373,14 @@ async function seedConfig(cwd) {
|
|
|
27384
27373
|
}
|
|
27385
27374
|
function inlinePublicPaths(html, cwd) {
|
|
27386
27375
|
return html.replace(/src="(\/[^"]+)"/g, (_3, p) => {
|
|
27387
|
-
const full =
|
|
27376
|
+
const full = path12__default.default.join(cwd, "public", p);
|
|
27388
27377
|
return fs.existsSync(full) ? `src="file://${full}"` : `src="${p}"`;
|
|
27389
27378
|
});
|
|
27390
27379
|
}
|
|
27391
27380
|
async function renderCard(config2, outPath, cwd, chrome, tmpSuffix) {
|
|
27392
|
-
const tmpHtml =
|
|
27381
|
+
const tmpHtml = path12__default.default.join(cwd, `.sonor-og-${tmpSuffix}.html`);
|
|
27393
27382
|
try {
|
|
27394
|
-
await fs3__default.default.mkdir(
|
|
27383
|
+
await fs3__default.default.mkdir(path12__default.default.dirname(outPath), { recursive: true });
|
|
27395
27384
|
await fs3__default.default.writeFile(tmpHtml, inlinePublicPaths(chunk6CJP7BFM_js.buildOgHtml(config2), cwd));
|
|
27396
27385
|
const { stdout } = await execFileAsync5(
|
|
27397
27386
|
chrome,
|
|
@@ -27426,7 +27415,7 @@ function parseReport(dom) {
|
|
|
27426
27415
|
}
|
|
27427
27416
|
async function compressCard(pngPath, cwd) {
|
|
27428
27417
|
try {
|
|
27429
|
-
const require_ = (await import('module')).createRequire(
|
|
27418
|
+
const require_ = (await import('module')).createRequire(path12__default.default.join(cwd, "package.json"));
|
|
27430
27419
|
const sharp = require_("sharp");
|
|
27431
27420
|
const jpgPath = pngPath.replace(/\.png$/, ".jpg");
|
|
27432
27421
|
await sharp(pngPath).jpeg({ quality: 84, mozjpeg: true }).toFile(jpgPath);
|
|
@@ -27443,13 +27432,13 @@ function discoverDynamicSegments(appDir) {
|
|
|
27443
27432
|
if (!entry.isDirectory()) continue;
|
|
27444
27433
|
if (entry.name.startsWith("_") || entry.name.startsWith(".")) continue;
|
|
27445
27434
|
if (entry.name === "api" || entry.name === "node_modules") continue;
|
|
27446
|
-
const full =
|
|
27435
|
+
const full = path12__default.default.join(dir, entry.name);
|
|
27447
27436
|
const isGroup = entry.name.startsWith("(") && entry.name.endsWith(")");
|
|
27448
27437
|
const isDynamic = entry.name.startsWith("[") && entry.name.endsWith("]");
|
|
27449
27438
|
const nextUrl = isGroup || isDynamic ? urlSegments : [...urlSegments, entry.name];
|
|
27450
27439
|
const nextPattern = isGroup ? pattern : [...pattern, isDynamic ? DYNAMIC : entry.name];
|
|
27451
27440
|
if (isDynamic) {
|
|
27452
|
-
const hasPage = ["tsx", "jsx", "ts", "js"].some((ext2) => fs.existsSync(
|
|
27441
|
+
const hasPage = ["tsx", "jsx", "ts", "js"].some((ext2) => fs.existsSync(path12__default.default.join(full, `page.${ext2}`)));
|
|
27453
27442
|
if (hasPage) {
|
|
27454
27443
|
found.push({ dir: full, path: `/${nextPattern.join("/")}`, parent: `/${urlSegments.join("/")}` });
|
|
27455
27444
|
}
|
|
@@ -27525,7 +27514,7 @@ async function runOg(options) {
|
|
|
27525
27514
|
errors: [{ code: "chrome_missing", message: "No Chrome or Chromium binary found", fix: "Install Chrome, or set SONOR_CHROME_PATH to its path." }]
|
|
27526
27515
|
};
|
|
27527
27516
|
}
|
|
27528
|
-
let config2 = await
|
|
27517
|
+
let config2 = await loadConfig2(cwd);
|
|
27529
27518
|
let seeded = false;
|
|
27530
27519
|
if (!config2) {
|
|
27531
27520
|
config2 = await seedConfig(cwd);
|
|
@@ -27533,7 +27522,7 @@ async function runOg(options) {
|
|
|
27533
27522
|
console.log(source_default.yellow(" ! No og.config.ts \u2014 generating a seed card from Sonor brand data."));
|
|
27534
27523
|
console.log(source_default.gray(" The site owns its theme: add og.config.ts (defineOgCard) with the real palette."));
|
|
27535
27524
|
}
|
|
27536
|
-
const outPath =
|
|
27525
|
+
const outPath = path12__default.default.resolve(cwd, options.out || "public/og.png");
|
|
27537
27526
|
let clean = true;
|
|
27538
27527
|
let cardKeyFix = null;
|
|
27539
27528
|
let pageCardsWritten = 0;
|
|
@@ -27543,8 +27532,8 @@ async function runOg(options) {
|
|
|
27543
27532
|
const report = await renderCard(config2, outPath, cwd, chrome, "site");
|
|
27544
27533
|
spinner.stop();
|
|
27545
27534
|
console.log(source_default.bold(` Site card${seeded ? source_default.gray(" (seed)") : ""}`));
|
|
27546
|
-
clean = reportCard(`${
|
|
27547
|
-
checks.push(cardCheck("site card",
|
|
27535
|
+
clean = reportCard(`${path12__default.default.relative(cwd, outPath)} \u2014 1200x630`, report) && clean;
|
|
27536
|
+
checks.push(cardCheck("site card", path12__default.default.relative(cwd, outPath), report));
|
|
27548
27537
|
} catch (err) {
|
|
27549
27538
|
const message = err instanceof Error ? err.message.split("\n")[0] : String(err);
|
|
27550
27539
|
spinner.fail(`Render failed: ${message}`);
|
|
@@ -27607,16 +27596,16 @@ async function runOg(options) {
|
|
|
27607
27596
|
const pageConfig = pageCardConfig(config2, route, brand);
|
|
27608
27597
|
const dir = route.dir ?? routeOutputDir(appDir, route.path);
|
|
27609
27598
|
for (const ext2 of ["png", "jpg", "jpeg"]) {
|
|
27610
|
-
await fs3__default.default.rm(
|
|
27599
|
+
await fs3__default.default.rm(path12__default.default.join(dir, `opengraph-image.${ext2}`), { force: true });
|
|
27611
27600
|
}
|
|
27612
|
-
const png =
|
|
27601
|
+
const png = path12__default.default.join(dir, "opengraph-image.png");
|
|
27613
27602
|
const report = await renderCard(pageConfig, png, cwd, chrome, `page-${i}`);
|
|
27614
27603
|
const file = await compressCard(png, cwd);
|
|
27615
27604
|
return { route, file, report };
|
|
27616
27605
|
});
|
|
27617
27606
|
for (const { route, file, report } of reports) {
|
|
27618
|
-
clean = reportCard(`${route.path} ${source_default.gray(
|
|
27619
|
-
checks.push(cardCheck(route.path,
|
|
27607
|
+
clean = reportCard(`${route.path} ${source_default.gray(path12__default.default.relative(cwd, file))}`, report) && clean;
|
|
27608
|
+
checks.push(cardCheck(route.path, path12__default.default.relative(cwd, file), report));
|
|
27620
27609
|
}
|
|
27621
27610
|
pageCardsWritten = reports.length;
|
|
27622
27611
|
const bytes = await totalBytes(reports.map((r) => r.file));
|
|
@@ -27627,13 +27616,13 @@ async function runOg(options) {
|
|
|
27627
27616
|
}
|
|
27628
27617
|
if (options.preview !== false) {
|
|
27629
27618
|
try {
|
|
27630
|
-
const require_ = (await import('module')).createRequire(
|
|
27619
|
+
const require_ = (await import('module')).createRequire(path12__default.default.join(cwd, "package.json"));
|
|
27631
27620
|
const sharp = require_("sharp");
|
|
27632
|
-
const previewPath =
|
|
27633
|
-
await fs3__default.default.mkdir(
|
|
27621
|
+
const previewPath = path12__default.default.join(cwd, ".sonor", "og-preview.png");
|
|
27622
|
+
await fs3__default.default.mkdir(path12__default.default.dirname(previewPath), { recursive: true });
|
|
27634
27623
|
await sharp(outPath).resize(300).toFile(previewPath);
|
|
27635
27624
|
console.log("");
|
|
27636
|
-
console.log(source_default.gray(` Thumbnail check: ${
|
|
27625
|
+
console.log(source_default.gray(` Thumbnail check: ${path12__default.default.relative(cwd, previewPath)} \u2014 if text is mush there, fix the card.`));
|
|
27637
27626
|
} catch {
|
|
27638
27627
|
console.log(source_default.gray(" (sharp not resolvable \u2014 skipped the 300px preview)"));
|
|
27639
27628
|
}
|
|
@@ -27692,15 +27681,15 @@ function routeOutputDir(appDir, urlPath) {
|
|
|
27692
27681
|
const segments = urlPath.split("/").filter(Boolean);
|
|
27693
27682
|
let dir = appDir;
|
|
27694
27683
|
for (const segment of segments) {
|
|
27695
|
-
const direct =
|
|
27684
|
+
const direct = path12__default.default.join(dir, segment);
|
|
27696
27685
|
if (fs.existsSync(direct)) {
|
|
27697
27686
|
dir = direct;
|
|
27698
27687
|
continue;
|
|
27699
27688
|
}
|
|
27700
27689
|
const group = fs.existsSync(dir) ? fs.readdirSync(dir, { withFileTypes: true }).find(
|
|
27701
|
-
(e) => e.isDirectory() && e.name.startsWith("(") && e.name.endsWith(")") && fs.existsSync(
|
|
27690
|
+
(e) => e.isDirectory() && e.name.startsWith("(") && e.name.endsWith(")") && fs.existsSync(path12__default.default.join(dir, e.name, segment))
|
|
27702
27691
|
) : void 0;
|
|
27703
|
-
dir = group ?
|
|
27692
|
+
dir = group ? path12__default.default.join(dir, group.name, segment) : direct;
|
|
27704
27693
|
}
|
|
27705
27694
|
return dir;
|
|
27706
27695
|
}
|
|
@@ -27715,7 +27704,7 @@ async function totalBytes(files) {
|
|
|
27715
27704
|
return total;
|
|
27716
27705
|
}
|
|
27717
27706
|
async function siteDomain(cwd) {
|
|
27718
|
-
const envFile =
|
|
27707
|
+
const envFile = path12__default.default.join(cwd, ".env.local");
|
|
27719
27708
|
if (fs.existsSync(envFile)) {
|
|
27720
27709
|
const env3 = await fs3__default.default.readFile(envFile, "utf-8").catch(() => "");
|
|
27721
27710
|
const url = env3.match(/^NEXT_PUBLIC_SITE_URL=(.+)$/m)?.[1]?.trim();
|
|
@@ -27840,14 +27829,14 @@ var hs = new RegExp(pe, "g");
|
|
|
27840
27829
|
var as = /\\\\/g;
|
|
27841
27830
|
var ls = /\\{/g;
|
|
27842
27831
|
var cs = /\\}/g;
|
|
27843
|
-
var
|
|
27832
|
+
var fs22 = /\\,/g;
|
|
27844
27833
|
var us = /\\./g;
|
|
27845
27834
|
var ds = 1e5;
|
|
27846
27835
|
function Ht(n5) {
|
|
27847
27836
|
return isNaN(n5) ? n5.charCodeAt(0) : parseInt(n5, 10);
|
|
27848
27837
|
}
|
|
27849
27838
|
function ps(n5) {
|
|
27850
|
-
return n5.replace(as, fe).replace(ls, ue).replace(cs, qt).replace(
|
|
27839
|
+
return n5.replace(as, fe).replace(ls, ue).replace(cs, qt).replace(fs22, de).replace(us, pe);
|
|
27851
27840
|
}
|
|
27852
27841
|
function ms(n5) {
|
|
27853
27842
|
return n5.replace(is, "\\").replace(rs, "{").replace(ns, "}").replace(os5, ",").replace(hs, ".");
|
|
@@ -29930,7 +29919,7 @@ var Pt = class n extends R {
|
|
|
29930
29919
|
return new n(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
29931
29920
|
}
|
|
29932
29921
|
getRootString(t) {
|
|
29933
|
-
return
|
|
29922
|
+
return path12.win32.parse(t).root;
|
|
29934
29923
|
}
|
|
29935
29924
|
getRoot(t) {
|
|
29936
29925
|
if (t = Ri(t.toUpperCase()), t === this.root.name) return this.root;
|
|
@@ -30202,13 +30191,13 @@ var It = (_a8 = class {
|
|
|
30202
30191
|
var it = class extends It {
|
|
30203
30192
|
constructor(t = process.cwd(), e = {}) {
|
|
30204
30193
|
let { nocase: s = true } = e;
|
|
30205
|
-
super(t,
|
|
30194
|
+
super(t, path12.win32, "\\", { ...e, nocase: s });
|
|
30206
30195
|
chunkSNAQBZPT_js.__publicField(this, "sep", "\\");
|
|
30207
30196
|
this.nocase = s;
|
|
30208
30197
|
for (let i = this.cwd; i; i = i.parent) i.nocase = this.nocase;
|
|
30209
30198
|
}
|
|
30210
30199
|
parseRootPath(t) {
|
|
30211
|
-
return
|
|
30200
|
+
return path12.win32.parse(t).root.toUpperCase();
|
|
30212
30201
|
}
|
|
30213
30202
|
newRoot(t) {
|
|
30214
30203
|
return new Pt(this.rootPath, U, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t });
|
|
@@ -30220,7 +30209,7 @@ var it = class extends It {
|
|
|
30220
30209
|
var rt = class extends It {
|
|
30221
30210
|
constructor(t = process.cwd(), e = {}) {
|
|
30222
30211
|
let { nocase: s = false } = e;
|
|
30223
|
-
super(t,
|
|
30212
|
+
super(t, path12.posix, "/", { ...e, nocase: s });
|
|
30224
30213
|
chunkSNAQBZPT_js.__publicField(this, "sep", "/");
|
|
30225
30214
|
this.nocase = s;
|
|
30226
30215
|
}
|
|
@@ -30879,10 +30868,10 @@ function unifiedDiff(before, after, filePath, context = 2) {
|
|
|
30879
30868
|
return lines.join("\n");
|
|
30880
30869
|
}
|
|
30881
30870
|
function ext(filePath) {
|
|
30882
|
-
return
|
|
30871
|
+
return path12__default.default.extname(filePath).toLowerCase();
|
|
30883
30872
|
}
|
|
30884
30873
|
function basename(filePath) {
|
|
30885
|
-
return
|
|
30874
|
+
return path12__default.default.basename(filePath).toLowerCase();
|
|
30886
30875
|
}
|
|
30887
30876
|
var CODE_EXT = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"]);
|
|
30888
30877
|
var TEXT_EXT = /* @__PURE__ */ new Set([...CODE_EXT, ".css", ".scss", ".json", ".md", ".mdx"]);
|
|
@@ -31036,7 +31025,7 @@ var IGNORE = [
|
|
|
31036
31025
|
];
|
|
31037
31026
|
async function listFiles(cwd, onlyPath) {
|
|
31038
31027
|
if (onlyPath) {
|
|
31039
|
-
const rel =
|
|
31028
|
+
const rel = path12__default.default.isAbsolute(onlyPath) ? path12__default.default.relative(cwd, onlyPath) : onlyPath;
|
|
31040
31029
|
return [rel];
|
|
31041
31030
|
}
|
|
31042
31031
|
const matches = await Ze(SCAN_PATTERNS, { cwd, ignore: IGNORE, dot: true, nodir: true });
|
|
@@ -31048,7 +31037,7 @@ async function runCodemod(options) {
|
|
|
31048
31037
|
const files = await listFiles(cwd, onlyPath);
|
|
31049
31038
|
const changes = [];
|
|
31050
31039
|
for (const rel of files) {
|
|
31051
|
-
const full =
|
|
31040
|
+
const full = path12__default.default.join(cwd, rel);
|
|
31052
31041
|
let source;
|
|
31053
31042
|
try {
|
|
31054
31043
|
source = await fs3__default.default.readFile(full, "utf-8");
|
|
@@ -31197,9 +31186,9 @@ function findManifestPath() {
|
|
|
31197
31186
|
const baseDir = typeof __dirname !== "undefined" ? __dirname : process.cwd();
|
|
31198
31187
|
let dir = baseDir;
|
|
31199
31188
|
for (let i = 0; i < 8; i++) {
|
|
31200
|
-
const candidate =
|
|
31189
|
+
const candidate = path12__default.default.join(dir, "agent-manifest.json");
|
|
31201
31190
|
if (fs__namespace.default.existsSync(candidate)) return candidate;
|
|
31202
|
-
const parent =
|
|
31191
|
+
const parent = path12__default.default.dirname(dir);
|
|
31203
31192
|
if (parent === dir) break;
|
|
31204
31193
|
dir = parent;
|
|
31205
31194
|
}
|
|
@@ -31341,8 +31330,8 @@ async function syncPagesToPortal(apiUrl, apiKey, dryRun) {
|
|
|
31341
31330
|
}
|
|
31342
31331
|
function findAppDir() {
|
|
31343
31332
|
const candidates = [
|
|
31344
|
-
|
|
31345
|
-
|
|
31333
|
+
path12__default.default.join(process.cwd(), "app"),
|
|
31334
|
+
path12__default.default.join(process.cwd(), "src", "app")
|
|
31346
31335
|
];
|
|
31347
31336
|
for (const candidate of candidates) {
|
|
31348
31337
|
if (fs.existsSync(candidate)) {
|
|
@@ -31352,7 +31341,7 @@ function findAppDir() {
|
|
|
31352
31341
|
return null;
|
|
31353
31342
|
}
|
|
31354
31343
|
function discoverPages(appDir, currentPath = "", pages = []) {
|
|
31355
|
-
const fullPath =
|
|
31344
|
+
const fullPath = path12__default.default.join(appDir, currentPath);
|
|
31356
31345
|
if (!fs.existsSync(fullPath)) {
|
|
31357
31346
|
return pages;
|
|
31358
31347
|
}
|
|
@@ -31374,7 +31363,7 @@ function discoverPages(appDir, currentPath = "", pages = []) {
|
|
|
31374
31363
|
});
|
|
31375
31364
|
}
|
|
31376
31365
|
for (const entry of entries) {
|
|
31377
|
-
const entryPath =
|
|
31366
|
+
const entryPath = path12__default.default.join(fullPath, entry);
|
|
31378
31367
|
const stat = fs.statSync(entryPath);
|
|
31379
31368
|
if (stat.isDirectory()) {
|
|
31380
31369
|
const folderName = entry.toLowerCase();
|
|
@@ -31387,21 +31376,21 @@ function discoverPages(appDir, currentPath = "", pages = []) {
|
|
|
31387
31376
|
if (entry.startsWith("_")) {
|
|
31388
31377
|
continue;
|
|
31389
31378
|
}
|
|
31390
|
-
discoverPages(appDir,
|
|
31379
|
+
discoverPages(appDir, path12__default.default.join(currentPath, entry), pages);
|
|
31391
31380
|
}
|
|
31392
31381
|
}
|
|
31393
31382
|
return pages;
|
|
31394
31383
|
}
|
|
31395
31384
|
function findNextBuildDir() {
|
|
31396
31385
|
const cwd = process.cwd();
|
|
31397
|
-
const candidate =
|
|
31386
|
+
const candidate = path12__default.default.join(cwd, ".next", "server", "app");
|
|
31398
31387
|
return fs.existsSync(candidate) ? candidate : null;
|
|
31399
31388
|
}
|
|
31400
31389
|
function extractPageContent(buildDir, pagePath) {
|
|
31401
31390
|
const baseName = pagePath === "/" ? "index" : pagePath.replace(/^\//, "");
|
|
31402
31391
|
const htmlCandidates = [
|
|
31403
|
-
|
|
31404
|
-
|
|
31392
|
+
path12__default.default.join(buildDir, `${baseName}.html`),
|
|
31393
|
+
path12__default.default.join(buildDir, baseName, "index.html")
|
|
31405
31394
|
];
|
|
31406
31395
|
let html = null;
|
|
31407
31396
|
for (const candidate of htmlCandidates) {
|
|
@@ -31415,8 +31404,8 @@ function extractPageContent(buildDir, pagePath) {
|
|
|
31415
31404
|
}
|
|
31416
31405
|
}
|
|
31417
31406
|
const rscCandidates = [
|
|
31418
|
-
|
|
31419
|
-
|
|
31407
|
+
path12__default.default.join(buildDir, `${baseName}.rsc`),
|
|
31408
|
+
path12__default.default.join(buildDir, baseName, "index.rsc")
|
|
31420
31409
|
];
|
|
31421
31410
|
let rsc = null;
|
|
31422
31411
|
for (const candidate of rscCandidates) {
|
|
@@ -31527,7 +31516,7 @@ var BLOG_EXTENSIONS = [".mdx", ".md"];
|
|
|
31527
31516
|
function findBlogDir() {
|
|
31528
31517
|
const cwd = process.cwd();
|
|
31529
31518
|
for (const dir of BLOG_DIRS) {
|
|
31530
|
-
const full =
|
|
31519
|
+
const full = path12__default.default.join(cwd, dir);
|
|
31531
31520
|
if (fs.existsSync(full)) return full;
|
|
31532
31521
|
}
|
|
31533
31522
|
return null;
|
|
@@ -31537,7 +31526,7 @@ async function discoverBlogPosts(dir) {
|
|
|
31537
31526
|
async function walk(currentDir) {
|
|
31538
31527
|
const entries = fs.readdirSync(currentDir);
|
|
31539
31528
|
for (const entry of entries) {
|
|
31540
|
-
const fullPath =
|
|
31529
|
+
const fullPath = path12__default.default.join(currentDir, entry);
|
|
31541
31530
|
const stat = fs.statSync(fullPath);
|
|
31542
31531
|
if (stat.isDirectory()) {
|
|
31543
31532
|
await walk(fullPath);
|
|
@@ -31554,7 +31543,7 @@ async function discoverBlogPosts(dir) {
|
|
|
31554
31543
|
date: frontmatter.date,
|
|
31555
31544
|
tags: frontmatter.tags,
|
|
31556
31545
|
author: frontmatter.author,
|
|
31557
|
-
filePath:
|
|
31546
|
+
filePath: path12__default.default.relative(process.cwd(), fullPath)
|
|
31558
31547
|
});
|
|
31559
31548
|
}
|
|
31560
31549
|
}
|
|
@@ -31587,7 +31576,7 @@ async function syncBlogToPortal(_apiUrl, _apiKey, _dryRun) {
|
|
|
31587
31576
|
}
|
|
31588
31577
|
const spinner = ora("Discovering blog posts...").start();
|
|
31589
31578
|
const posts = await discoverBlogPosts(blogDir);
|
|
31590
|
-
spinner.succeed(`Found ${posts.length} local markdown post(s) in ${
|
|
31579
|
+
spinner.succeed(`Found ${posts.length} local markdown post(s) in ${path12__default.default.relative(process.cwd(), blogDir)}`);
|
|
31591
31580
|
if (posts.length === 0) return;
|
|
31592
31581
|
for (const post of posts.slice(0, 10)) {
|
|
31593
31582
|
console.log(source_default.gray(` ${post.slug}: ${post.title || "(no title)"}`));
|
|
@@ -31604,11 +31593,11 @@ async function discoverSchemaUsage(appDir) {
|
|
|
31604
31593
|
async function walk(currentDir, currentPath = "") {
|
|
31605
31594
|
const entries = fs.readdirSync(currentDir);
|
|
31606
31595
|
for (const entry of entries) {
|
|
31607
|
-
const fullPath =
|
|
31596
|
+
const fullPath = path12__default.default.join(currentDir, entry);
|
|
31608
31597
|
const stat = fs.statSync(fullPath);
|
|
31609
31598
|
if (stat.isDirectory()) {
|
|
31610
31599
|
if (entry.startsWith(".") || entry === "node_modules") continue;
|
|
31611
|
-
await walk(fullPath,
|
|
31600
|
+
await walk(fullPath, path12__default.default.join(currentPath, entry));
|
|
31612
31601
|
continue;
|
|
31613
31602
|
}
|
|
31614
31603
|
if (!/\.(tsx?|jsx?)$/.test(entry)) continue;
|
|
@@ -31622,7 +31611,7 @@ async function discoverSchemaUsage(appDir) {
|
|
|
31622
31611
|
pagePath: pathMatch[1],
|
|
31623
31612
|
schemaTypes: ["managed"],
|
|
31624
31613
|
source: "ManagedSchema",
|
|
31625
|
-
filePath:
|
|
31614
|
+
filePath: path12__default.default.relative(process.cwd(), fullPath)
|
|
31626
31615
|
});
|
|
31627
31616
|
}
|
|
31628
31617
|
}
|
|
@@ -31640,7 +31629,7 @@ async function discoverSchemaUsage(appDir) {
|
|
|
31640
31629
|
pagePath,
|
|
31641
31630
|
schemaTypes: [...new Set(types)],
|
|
31642
31631
|
source: "json-ld",
|
|
31643
|
-
filePath:
|
|
31632
|
+
filePath: path12__default.default.relative(process.cwd(), fullPath)
|
|
31644
31633
|
});
|
|
31645
31634
|
}
|
|
31646
31635
|
}
|
|
@@ -31700,8 +31689,8 @@ async function apiRoutesCommand(options) {
|
|
|
31700
31689
|
console.log("");
|
|
31701
31690
|
process.exit(1);
|
|
31702
31691
|
}
|
|
31703
|
-
const routeDir =
|
|
31704
|
-
const routeFile =
|
|
31692
|
+
const routeDir = path12__default.default.join(appDir, "_uptrade", "api", "[...path]");
|
|
31693
|
+
const routeFile = path12__default.default.join(routeDir, "route.ts");
|
|
31705
31694
|
if (fs.existsSync(routeFile) && !options.force) {
|
|
31706
31695
|
console.log(source_default.yellow(" \u26A0 API routes already exist"));
|
|
31707
31696
|
console.log(source_default.gray(` ${routeFile}`));
|
|
@@ -31738,8 +31727,8 @@ async function apiRoutesCommand(options) {
|
|
|
31738
31727
|
}
|
|
31739
31728
|
function findAppDir2() {
|
|
31740
31729
|
const candidates = [
|
|
31741
|
-
|
|
31742
|
-
|
|
31730
|
+
path12__default.default.join(process.cwd(), "app"),
|
|
31731
|
+
path12__default.default.join(process.cwd(), "src", "app")
|
|
31743
31732
|
];
|
|
31744
31733
|
for (const candidate of candidates) {
|
|
31745
31734
|
if (fs.existsSync(candidate)) {
|
|
@@ -31852,12 +31841,12 @@ async function handleRequest(
|
|
|
31852
31841
|
`;
|
|
31853
31842
|
}
|
|
31854
31843
|
function detectPackageManager(cwd) {
|
|
31855
|
-
if (fs.existsSync(
|
|
31856
|
-
if (fs.existsSync(
|
|
31844
|
+
if (fs.existsSync(path12__default.default.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
31845
|
+
if (fs.existsSync(path12__default.default.join(cwd, "yarn.lock"))) return "yarn";
|
|
31857
31846
|
return "npm";
|
|
31858
31847
|
}
|
|
31859
31848
|
async function run6(ctx, options) {
|
|
31860
|
-
if (!fs.existsSync(
|
|
31849
|
+
if (!fs.existsSync(path12__default.default.join(ctx.cwd, "package.json"))) {
|
|
31861
31850
|
throw new UsageError(
|
|
31862
31851
|
"NO_PACKAGE_JSON",
|
|
31863
31852
|
"No package.json found",
|
|
@@ -31902,12 +31891,12 @@ async function installCommand(options) {
|
|
|
31902
31891
|
await runCommand(ctx, (c) => run6(c, options), renderHuman4);
|
|
31903
31892
|
}
|
|
31904
31893
|
function detectPackageManager2(cwd) {
|
|
31905
|
-
if (fs.existsSync(
|
|
31906
|
-
if (fs.existsSync(
|
|
31894
|
+
if (fs.existsSync(path12__default.default.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
31895
|
+
if (fs.existsSync(path12__default.default.join(cwd, "yarn.lock"))) return "yarn";
|
|
31907
31896
|
return "npm";
|
|
31908
31897
|
}
|
|
31909
31898
|
async function run7(ctx, options) {
|
|
31910
|
-
const pkgPath =
|
|
31899
|
+
const pkgPath = path12__default.default.join(ctx.cwd, "package.json");
|
|
31911
31900
|
if (!fs.existsSync(pkgPath)) {
|
|
31912
31901
|
throw new UsageError("NO_PACKAGE_JSON", "No package.json found", "Run this from your project root.");
|
|
31913
31902
|
}
|
|
@@ -31969,7 +31958,7 @@ async function scaffoldCommand(options) {
|
|
|
31969
31958
|
}
|
|
31970
31959
|
const files = [
|
|
31971
31960
|
{
|
|
31972
|
-
path:
|
|
31961
|
+
path: path12__default.default.join(appDir, "sitemap.ts"),
|
|
31973
31962
|
label: "Sitemap",
|
|
31974
31963
|
content: `import { createSitemap } from '@sonordev/site-kit/sitemap'
|
|
31975
31964
|
|
|
@@ -31984,7 +31973,7 @@ export default createSitemap({
|
|
|
31984
31973
|
`
|
|
31985
31974
|
},
|
|
31986
31975
|
{
|
|
31987
|
-
path:
|
|
31976
|
+
path: path12__default.default.join(appDir, "robots.txt", "route.ts"),
|
|
31988
31977
|
label: "Robots.txt",
|
|
31989
31978
|
content: `import { createRobots } from '@sonordev/site-kit/robots'
|
|
31990
31979
|
|
|
@@ -31992,7 +31981,7 @@ export const GET = createRobots({})
|
|
|
31992
31981
|
`
|
|
31993
31982
|
},
|
|
31994
31983
|
{
|
|
31995
|
-
path:
|
|
31984
|
+
path: path12__default.default.join(appDir, "llms.txt", "route.ts"),
|
|
31996
31985
|
label: "llms.txt",
|
|
31997
31986
|
content: `import { createLLMsTxtHandler } from '@sonordev/site-kit/llms'
|
|
31998
31987
|
|
|
@@ -32000,7 +31989,7 @@ export const GET = createLLMsTxtHandler({ preferStatic: true })
|
|
|
32000
31989
|
`
|
|
32001
31990
|
},
|
|
32002
31991
|
{
|
|
32003
|
-
path:
|
|
31992
|
+
path: path12__default.default.join(appDir, "llms-full.txt", "route.ts"),
|
|
32004
31993
|
label: "llms-full.txt",
|
|
32005
31994
|
content: `import { createLLMsFullTxtHandler } from '@sonordev/site-kit/llms'
|
|
32006
31995
|
|
|
@@ -32011,7 +32000,7 @@ export const GET = createLLMsFullTxtHandler({ preferStatic: true })
|
|
|
32011
32000
|
if (!options.minimal) {
|
|
32012
32001
|
files.push(
|
|
32013
32002
|
{
|
|
32014
|
-
path:
|
|
32003
|
+
path: path12__default.default.join(cwd, "proxy.ts"),
|
|
32015
32004
|
label: "Proxy (security headers; redirects resolve at the 404 boundary)",
|
|
32016
32005
|
content: `import { createProxy } from '@sonordev/site-kit/proxy'
|
|
32017
32006
|
|
|
@@ -32031,7 +32020,7 @@ export const config = {
|
|
|
32031
32020
|
`
|
|
32032
32021
|
},
|
|
32033
32022
|
{
|
|
32034
|
-
path:
|
|
32023
|
+
path: path12__default.default.join(appDir, "manifest.webmanifest", "route.ts"),
|
|
32035
32024
|
label: "PWA Manifest",
|
|
32036
32025
|
content: `import { createManifest } from '@sonordev/site-kit/manifest'
|
|
32037
32026
|
|
|
@@ -32039,7 +32028,7 @@ export const GET = createManifest()
|
|
|
32039
32028
|
`
|
|
32040
32029
|
},
|
|
32041
32030
|
{
|
|
32042
|
-
path:
|
|
32031
|
+
path: path12__default.default.join(appDir, "not-found.tsx"),
|
|
32043
32032
|
label: "404 Page (resolves managed redirects)",
|
|
32044
32033
|
content: `import { redirect, permanentRedirect } from 'next/navigation'
|
|
32045
32034
|
import { resolveManagedRedirect } from '@sonordev/site-kit/redirects/not-found'
|
|
@@ -32079,7 +32068,7 @@ export default async function NotFound() {
|
|
|
32079
32068
|
`
|
|
32080
32069
|
},
|
|
32081
32070
|
{
|
|
32082
|
-
path:
|
|
32071
|
+
path: path12__default.default.join(appDir, "error.tsx"),
|
|
32083
32072
|
label: "Error Boundary",
|
|
32084
32073
|
content: `'use client'
|
|
32085
32074
|
|
|
@@ -32119,7 +32108,7 @@ export default function Error({
|
|
|
32119
32108
|
`
|
|
32120
32109
|
},
|
|
32121
32110
|
{
|
|
32122
|
-
path:
|
|
32111
|
+
path: path12__default.default.join(cwd, "og.config.ts"),
|
|
32123
32112
|
label: "OG card config (run: sonor-setup og)",
|
|
32124
32113
|
content: `import { defineOgCard } from '@sonordev/site-kit/og'
|
|
32125
32114
|
|
|
@@ -32148,7 +32137,7 @@ export default defineOgCard({
|
|
|
32148
32137
|
// .env.local, not .env.example: one real env file per project. The
|
|
32149
32138
|
// deployer copies these values into the host's env settings. Skipped
|
|
32150
32139
|
// when the file already exists, so real keys are never touched.
|
|
32151
|
-
path:
|
|
32140
|
+
path: path12__default.default.join(cwd, ".env.local"),
|
|
32152
32141
|
label: ".env.local",
|
|
32153
32142
|
content: `# ===================================
|
|
32154
32143
|
# @sonordev/site-kit \u2014 Environment Variables
|
|
@@ -32170,7 +32159,7 @@ SONOR_API_KEY=sonor_your-project-uuid_your-secret-key
|
|
|
32170
32159
|
if (options.dryRun) {
|
|
32171
32160
|
console.log(source_default.yellow(" [DRY RUN] Would create:"));
|
|
32172
32161
|
for (const f of files) {
|
|
32173
|
-
const rel =
|
|
32162
|
+
const rel = path12__default.default.relative(cwd, f.path);
|
|
32174
32163
|
const exists = fs.existsSync(f.path);
|
|
32175
32164
|
console.log(
|
|
32176
32165
|
source_default.gray(` ${rel}`) + (exists ? source_default.yellow(" (exists, would skip)") : "")
|
|
@@ -32185,13 +32174,13 @@ SONOR_API_KEY=sonor_your-project-uuid_your-secret-key
|
|
|
32185
32174
|
for (const f of files) {
|
|
32186
32175
|
try {
|
|
32187
32176
|
if (fs.existsSync(f.path) && !options.force) {
|
|
32188
|
-
spinner.warn(`Skipped (exists): ${
|
|
32177
|
+
spinner.warn(`Skipped (exists): ${path12__default.default.relative(cwd, f.path)}`);
|
|
32189
32178
|
skipped++;
|
|
32190
32179
|
continue;
|
|
32191
32180
|
}
|
|
32192
|
-
await fs3__default.default.mkdir(
|
|
32181
|
+
await fs3__default.default.mkdir(path12__default.default.dirname(f.path), { recursive: true });
|
|
32193
32182
|
await fs3__default.default.writeFile(f.path, f.content, "utf-8");
|
|
32194
|
-
spinner.succeed(`${f.label}: ${
|
|
32183
|
+
spinner.succeed(`${f.label}: ${path12__default.default.relative(cwd, f.path)}`);
|
|
32195
32184
|
created++;
|
|
32196
32185
|
} catch (err) {
|
|
32197
32186
|
spinner.fail(`Failed: ${f.path}`);
|
|
@@ -32240,8 +32229,8 @@ SONOR_API_KEY=sonor_your-project-uuid_your-secret-key
|
|
|
32240
32229
|
async function findAppDir3() {
|
|
32241
32230
|
const cwd = process.cwd();
|
|
32242
32231
|
const candidates = [
|
|
32243
|
-
|
|
32244
|
-
|
|
32232
|
+
path12__default.default.join(cwd, "app"),
|
|
32233
|
+
path12__default.default.join(cwd, "src", "app")
|
|
32245
32234
|
];
|
|
32246
32235
|
for (const dir of candidates) {
|
|
32247
32236
|
if (fs.existsSync(dir)) return dir;
|
|
@@ -32265,17 +32254,17 @@ async function readIfExists(p) {
|
|
|
32265
32254
|
}
|
|
32266
32255
|
}
|
|
32267
32256
|
async function ensureLlmsRouteFiles(appDir, dryRun) {
|
|
32268
|
-
const llms =
|
|
32269
|
-
const llmsFull =
|
|
32257
|
+
const llms = path12__default.default.join(appDir, "llms.txt", "route.ts");
|
|
32258
|
+
const llmsFull = path12__default.default.join(appDir, "llms-full.txt", "route.ts");
|
|
32270
32259
|
let n5 = 0;
|
|
32271
32260
|
if (dryRun) return 0;
|
|
32272
32261
|
if (!fs.existsSync(llms)) {
|
|
32273
|
-
await fs3__default.default.mkdir(
|
|
32262
|
+
await fs3__default.default.mkdir(path12__default.default.dirname(llms), { recursive: true });
|
|
32274
32263
|
await fs3__default.default.writeFile(llms, LLMS_ROUTE, "utf-8");
|
|
32275
32264
|
n5++;
|
|
32276
32265
|
}
|
|
32277
32266
|
if (!fs.existsSync(llmsFull)) {
|
|
32278
|
-
await fs3__default.default.mkdir(
|
|
32267
|
+
await fs3__default.default.mkdir(path12__default.default.dirname(llmsFull), { recursive: true });
|
|
32279
32268
|
await fs3__default.default.writeFile(llmsFull, LLMS_FULL_ROUTE, "utf-8");
|
|
32280
32269
|
n5++;
|
|
32281
32270
|
}
|
|
@@ -32309,9 +32298,9 @@ async function geoCommand(options) {
|
|
|
32309
32298
|
console.log(source_default.red(" \u2717 No app directory (app/ or src/app/)"));
|
|
32310
32299
|
process.exit(1);
|
|
32311
32300
|
}
|
|
32312
|
-
const llms =
|
|
32313
|
-
const llmsFull =
|
|
32314
|
-
const sitemap =
|
|
32301
|
+
const llms = path12__default.default.join(appDir, "llms.txt", "route.ts");
|
|
32302
|
+
const llmsFull = path12__default.default.join(appDir, "llms-full.txt", "route.ts");
|
|
32303
|
+
const sitemap = path12__default.default.join(appDir, "sitemap.ts");
|
|
32315
32304
|
let allOk = true;
|
|
32316
32305
|
const row = (label, pass) => {
|
|
32317
32306
|
if (!pass) allOk = false;
|
|
@@ -32330,9 +32319,9 @@ async function geoCommand(options) {
|
|
|
32330
32319
|
row("sitemap.ts lists llms URLs", false);
|
|
32331
32320
|
}
|
|
32332
32321
|
const nextConfigs = [
|
|
32333
|
-
|
|
32334
|
-
|
|
32335
|
-
|
|
32322
|
+
path12__default.default.join(cwd, "next.config.ts"),
|
|
32323
|
+
path12__default.default.join(cwd, "next.config.mjs"),
|
|
32324
|
+
path12__default.default.join(cwd, "next.config.js")
|
|
32336
32325
|
];
|
|
32337
32326
|
let nextCfg = "";
|
|
32338
32327
|
for (const p of nextConfigs) {
|
|
@@ -32342,9 +32331,9 @@ async function geoCommand(options) {
|
|
|
32342
32331
|
}
|
|
32343
32332
|
}
|
|
32344
32333
|
const layoutCandidates = [
|
|
32345
|
-
|
|
32346
|
-
|
|
32347
|
-
|
|
32334
|
+
path12__default.default.join(appDir, "layout.tsx"),
|
|
32335
|
+
path12__default.default.join(appDir, "layout.jsx"),
|
|
32336
|
+
path12__default.default.join(appDir, "layout.js")
|
|
32348
32337
|
];
|
|
32349
32338
|
let layoutTxt = "";
|
|
32350
32339
|
for (const p of layoutCandidates) {
|
|
@@ -32404,10 +32393,10 @@ async function geoCommand(options) {
|
|
|
32404
32393
|
}
|
|
32405
32394
|
|
|
32406
32395
|
// src/cli/index.ts
|
|
32407
|
-
(0,
|
|
32408
|
-
(0,
|
|
32396
|
+
(0, import_dotenv2.config)({ path: ".env.local", quiet: true });
|
|
32397
|
+
(0, import_dotenv2.config)({ path: ".env", quiet: true });
|
|
32409
32398
|
var program2 = new Command();
|
|
32410
|
-
program2.name("sonor-setup").description("Setup + verification toolchain for @sonordev/site-kit").version(
|
|
32399
|
+
program2.name("sonor-setup").description("Setup + verification toolchain for @sonordev/site-kit").version(chunkKSL3WA2I_js.SITE_KIT_VERSION);
|
|
32411
32400
|
withAgentFlags(
|
|
32412
32401
|
program2.command("verify").description("Verify the integration actually works (health + key + SSR) \u2014 exit 0 = done").option("--url <url>", "Verify a running/deployed URL server-renders (recommended for agents)").option("--offline", "Skip the network key-validity ping").option("--strict", "Treat warnings as failures")
|
|
32413
32402
|
).action(verifyCommand);
|