@xano/sdk 1.0.6 → 1.0.8
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/CHANGELOG.md +30 -0
- package/README.md +32 -4
- package/dist/.build-fingerprint +1 -1
- package/dist/{agent-file-refresh-67QIX45H.js → agent-file-refresh-QJO3MT6Q.js} +13 -13
- package/dist/agent-skill-command-GBR4KUUG.js +414 -0
- package/dist/{answer-shape-UCDUKPAN.js → answer-shape-UMQRXMCX.js} +5 -5
- package/dist/{backend-dir-3LIL6SCT.js → backend-dir-PFUIPCV3.js} +15 -15
- package/dist/{backend-slot-JREP27UD.js → backend-slot-TTRNOQF5.js} +4 -4
- package/dist/bin.js +54 -53
- package/dist/{branch-2IPHOAYS.js → branch-Q7CDJRU6.js} +12 -11
- package/dist/{branch-commands-KTKAXBAN.js → branch-commands-CR3SAHMV.js} +27 -26
- package/dist/bundle.js +5 -5
- package/dist/{chunk-YKP4ZKVO.js → chunk-2HZDWZM2.js} +3 -3
- package/dist/{chunk-ZDP6GDAB.js → chunk-33KELF2X.js} +103 -94
- package/dist/{chunk-7VR4IO5B.js → chunk-3P35HT64.js} +2 -2
- package/dist/{chunk-2FLIJGBZ.js → chunk-3UZQ5TMG.js} +47 -8
- package/dist/{chunk-AWQ7BQTQ.js → chunk-4GPIOIAC.js} +6 -1
- package/dist/{chunk-YYLUBYXM.js → chunk-4JKXGPXB.js} +3 -3
- package/dist/{chunk-EQFYOOO6.js → chunk-5GIOCDUM.js} +829 -893
- package/dist/{chunk-26MOFAJT.js → chunk-5QOV52V4.js} +6 -3
- package/dist/{chunk-Q22BMRPF.js → chunk-5Y5HWQ2P.js} +2 -2
- package/dist/{chunk-T4LJ5UR2.js → chunk-6BOKCTCM.js} +52 -22
- package/dist/{chunk-FNLTFOUD.js → chunk-6NEV2PEC.js} +2 -2
- package/dist/{chunk-QJM5XZ4K.js → chunk-6PTITS3M.js} +8 -8
- package/dist/{chunk-N5I37JFB.js → chunk-6S263KTM.js} +2 -2
- package/dist/{chunk-JI3BLXWQ.js → chunk-6YOH2L3G.js} +11 -5
- package/dist/{chunk-5QMJOE2K.js → chunk-6ZFJEJXZ.js} +5 -3
- package/dist/{chunk-NPODGBVJ.js → chunk-75MKIQON.js} +4 -4
- package/dist/{chunk-SPITRSOF.js → chunk-76UAME77.js} +2 -2
- package/dist/{chunk-JRVQ7M7W.js → chunk-77GV772V.js} +8 -8
- package/dist/{chunk-GWTFI3GA.js → chunk-7JKNWDYN.js} +2 -2
- package/dist/{chunk-6X6BJN6Y.js → chunk-7MPI7NIW.js} +3 -3
- package/dist/{chunk-3II44CUJ.js → chunk-7UWUEUVJ.js} +24 -24
- package/dist/{chunk-ENMBEXOP.js → chunk-AS4G2MIE.js} +3 -3
- package/dist/{chunk-PMMHSX4H.js → chunk-B3NH5UBI.js} +4 -4
- package/dist/{chunk-SLGJIWCY.js → chunk-B5N6EWOM.js} +2 -2
- package/dist/chunk-BRANWM4U.js +853 -0
- package/dist/{chunk-6X3MY2JP.js → chunk-C2GHFADU.js} +2 -2
- package/dist/{chunk-CCU5CCRX.js → chunk-C2I4GC36.js} +8 -8
- package/dist/{chunk-D7BUMOKU.js → chunk-C6KBZH7M.js} +82 -6
- package/dist/{chunk-LAOMN6QQ.js → chunk-CRE7P7P2.js} +3 -3
- package/dist/{chunk-AVS4WPPY.js → chunk-DER2CVNC.js} +2 -2
- package/dist/{chunk-UIVMR7UK.js → chunk-DY3EJWWH.js} +2 -2
- package/dist/{chunk-SKEG3V2V.js → chunk-EKTIGGFO.js} +2 -2
- package/dist/{chunk-PL7AIAWS.js → chunk-F3IA3YWI.js} +4 -111
- package/dist/{chunk-FQ53GTII.js → chunk-F5RPNTN7.js} +6 -6
- package/dist/{chunk-2WBH5HUY.js → chunk-FHQYXGAY.js} +7 -7
- package/dist/{chunk-ND43ZOS3.js → chunk-FN7E6XGD.js} +7 -7
- package/dist/{chunk-3BBIDW3Y.js → chunk-GN5SQMIQ.js} +5 -5
- package/dist/{chunk-SSITMX7I.js → chunk-H3ZBAR2L.js} +16 -14
- package/dist/{chunk-OIKLDDYC.js → chunk-HFOGQIII.js} +3 -3
- package/dist/chunk-HKLBDSML.js +995 -0
- package/dist/{chunk-JXVJGF3Y.js → chunk-HQPL34O6.js} +2 -2
- package/dist/{chunk-CHINR7WD.js → chunk-HTP2CLRQ.js} +5 -5
- package/dist/{chunk-ROY4YAEQ.js → chunk-HU7F56VF.js} +22 -2
- package/dist/{chunk-TECTL2NU.js → chunk-HVPSDQJB.js} +4 -4
- package/dist/{chunk-IYXL5NYU.js → chunk-I53OTC3O.js} +2 -2
- package/dist/{chunk-M5CSVB23.js → chunk-IB6SKACE.js} +11 -8
- package/dist/{chunk-UD2Z7K6W.js → chunk-JG642U5D.js} +4 -4
- package/dist/{chunk-ZJSTUD6D.js → chunk-JJGK7XGC.js} +8 -8
- package/dist/{local-engine-command-RYLGMQ2O.js → chunk-JPRZ4ZGU.js} +22 -77
- package/dist/{chunk-QZEAANWP.js → chunk-K75BFHQQ.js} +8 -8
- package/dist/chunk-LCOCRJ4K.js +116 -0
- package/dist/{chunk-3EDSPMXN.js → chunk-LJM5CIY4.js} +5 -1
- package/dist/{chunk-D3KEPRRN.js → chunk-LTPF25L2.js} +2 -1
- package/dist/{chunk-HCG7NDIL.js → chunk-M3RLLT4O.js} +5 -5
- package/dist/{chunk-IXFJORNH.js → chunk-NFSUGVDY.js} +4 -4
- package/dist/{chunk-GHQ4BVI4.js → chunk-NFZUXS7D.js} +14 -14
- package/dist/{chunk-LBJA7IEM.js → chunk-O376UAZS.js} +2 -2
- package/dist/{chunk-LD6ARK3A.js → chunk-OBJ7FQDX.js} +2 -2
- package/dist/{chunk-VJFMUJWZ.js → chunk-OHTHG3LL.js} +2 -2
- package/dist/{chunk-U35MTOXQ.js → chunk-P5W6DBV6.js} +3 -3
- package/dist/{chunk-A7MRZ4GF.js → chunk-PAS5HOG3.js} +5 -5
- package/dist/{chunk-WZHLMU6T.js → chunk-PBK257CI.js} +2 -2
- package/dist/{chunk-SPKA2LV6.js → chunk-PFW7WFAT.js} +4 -4
- package/dist/{chunk-GOLFAEUV.js → chunk-QC3MKMDK.js} +2 -2
- package/dist/{chunk-YGLMRH5U.js → chunk-QE2GNFMP.js} +12 -12
- package/dist/{chunk-763M6LX3.js → chunk-QL3ZJWGG.js} +2 -2
- package/dist/{chunk-ITC2R2OT.js → chunk-QRKBFXIB.js} +7 -7
- package/dist/{chunk-KPFS3RGM.js → chunk-QTMXJQZN.js} +4 -4
- package/dist/{chunk-BTVUYHWV.js → chunk-QXOBZSQD.js} +4 -4
- package/dist/{chunk-NDWVJ2QZ.js → chunk-R3LANPQZ.js} +3 -3
- package/dist/{chunk-QXYMDARD.js → chunk-R4NOZBOY.js} +4 -4
- package/dist/{chunk-YYC2DZMG.js → chunk-RYMGK2K5.js} +6 -6
- package/dist/{chunk-IF4PEGVD.js → chunk-S2F7KVUL.js} +11 -11
- package/dist/{chunk-I3VHW6XM.js → chunk-S3STXOAO.js} +18 -18
- package/dist/{chunk-JFBRXRJD.js → chunk-S3WN6GGO.js} +40 -40
- package/dist/{chunk-U6MTGB46.js → chunk-S42TFTM5.js} +5 -5
- package/dist/{chunk-7GAIJW62.js → chunk-TG65NWUR.js} +2 -2
- package/dist/{chunk-YR2I5HGE.js → chunk-TR7EOUQE.js} +2 -2
- package/dist/{chunk-I3H3HCPY.js → chunk-U7XNJ33Q.js} +34 -31
- package/dist/{chunk-FU3VCE5A.js → chunk-UKJFCEMI.js} +13 -9
- package/dist/{chunk-5TVFLG3C.js → chunk-ULUUOUQX.js} +2 -2
- package/dist/{chunk-PFBXSVZF.js → chunk-UU7EEREQ.js} +7 -7
- package/dist/{chunk-ATJ2W7DC.js → chunk-V7KMIEMF.js} +286 -126
- package/dist/{chunk-VDHA5SSQ.js → chunk-VD7YTLWL.js} +2 -2
- package/dist/{chunk-EADVVTDK.js → chunk-VHV25AAO.js} +7 -7
- package/dist/{chunk-BL3AZ3AP.js → chunk-VJTTTIIB.js} +2 -2
- package/dist/{chunk-TTEIDD5Q.js → chunk-W2BVP27L.js} +4 -4
- package/dist/{chunk-GZHLCUZ6.js → chunk-WEQFI55W.js} +7 -7
- package/dist/{chunk-WBH4KJWM.js → chunk-XQO4A4Q4.js} +3 -3
- package/dist/{chunk-Z4ZGTCCD.js → chunk-XYTVP4WI.js} +6 -6
- package/dist/{chunk-5YQV35C2.js → chunk-Y5ET37NN.js} +7 -7
- package/dist/{chunk-VW4CWVYX.js → chunk-YE7MHW45.js} +4 -4
- package/dist/{chunk-YHB34BN6.js → chunk-YEH5OIPF.js} +2 -1
- package/dist/{chunk-GLY552SI.js → chunk-YG7S3N7P.js} +128 -60
- package/dist/{chunk-MBDFH7XB.js → chunk-YP76ZCQ5.js} +4 -4
- package/dist/{chunk-XFBGXB7X.js → chunk-ZJCHS7FM.js} +163 -107
- package/dist/{chunk-IMELQ2I6.js → chunk-ZO3QWFNV.js} +3 -3
- package/dist/{chunk-RIN4YY34.js → chunk-ZQ5WZWHF.js} +106 -69
- package/dist/{chunk-GW5RHGOB.js → chunk-ZT2B22VQ.js} +9 -9
- package/dist/cli.d.ts +32 -4
- package/dist/cli.js +51 -48
- package/dist/{codegen-command-R5IASBFC.js → codegen-command-4YXDJSLU.js} +69 -68
- package/dist/{commands-H7CPMMHH.js → commands-FOHIPDKZ.js} +3 -3
- package/dist/{completion-W5ZAI6TN.js → completion-XUBGMKGV.js} +9 -5
- package/dist/{config-MZ5KG4EP.js → config-544VCRKP.js} +8 -8
- package/dist/{deploy-command-34T2LKQ5.js → deploy-command-FIDS56ZC.js} +56 -55
- package/dist/{deploy-source-YLQ7WMYR.js → deploy-source-FPNNNNOW.js} +34 -33
- package/dist/{dev-env-sync-TMJTNU3U.js → dev-env-sync-RBJ2U3HG.js} +54 -53
- package/dist/{diagnostics-OMN5Y2AH.js → diagnostics-FNVNRYMB.js} +2 -2
- package/dist/{display-name-hint-ZJGFNJKQ.js → display-name-hint-EZQK2PDU.js} +14 -13
- package/dist/{emit-D125xxty.d.ts → emit-8lcNcRrd.d.ts} +12 -12
- package/dist/env-example-refresh-6UTTMDOI.js +134 -0
- package/dist/{env-pull-command-UTG6IC2K.js → env-pull-command-P5MATITQ.js} +46 -45
- package/dist/{env-target-FZROWYFS.js → env-target-F75YF25S.js} +13 -12
- package/dist/{env-var-command-VYDBQJJW.js → env-var-command-H3GHROVB.js} +50 -49
- package/dist/{ephemeral-BIE6FMJV.js → ephemeral-H24NF6WP.js} +11 -10
- package/dist/{ephemeral-command-OZ26RGXF.js → ephemeral-command-NH2XW3YK.js} +64 -63
- package/dist/{ephemeral-state-SNZOX2YK.js → ephemeral-state-YLZQIOBF.js} +11 -10
- package/dist/{generate-command-4HR7MR36.js → generate-command-IANKN6WV.js} +84 -82
- package/dist/{gitignore-EWQBXNX2.js → gitignore-FT2LVOMI.js} +19 -19
- package/dist/{guards-KYEOCVHN.js → guards-4VPSEOAI.js} +6 -4
- package/dist/{impersonate-command-WC7OGKUM.js → impersonate-command-7B67ICPL.js} +42 -41
- package/dist/{import-7Z4GCCPO.js → import-TXYVFYJS.js} +5 -5
- package/dist/index.d.ts +4 -4
- package/dist/index.js +8 -8
- package/dist/{init-command-HAO3WXH3.js → init-command-QOA4TJI2.js} +68 -53
- package/dist/{init-modules-NSKD4ASY.js → init-modules-KEEJ4HAF.js} +8 -8
- package/dist/{init-web-MKFFOQUU.js → init-web-MSXDARRF.js} +3 -3
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +10 -10
- package/dist/{keep-data-merge-QR2TMKEO.js → keep-data-merge-BIBW4QR4.js} +28 -28
- package/dist/{lambda-config-reconcile-7FJXXV6V.js → lambda-config-reconcile-47X5C2E4.js} +6 -5
- package/dist/{landing-record-MWXFIRCP.js → landing-record-DO3PM7QP.js} +22 -22
- package/dist/{live-diff-5E2BQWQ7.js → live-diff-CGTGOH3S.js} +3 -3
- package/dist/{local-engine-choice-VD5LNXJU.js → local-engine-choice-2UF7S5QZ.js} +37 -36
- package/dist/local-engine-command-WGMMZRQL.js +85 -0
- package/dist/{local-engine-config-W3KB7RWM.js → local-engine-config-6CB6FOEJ.js} +3 -2
- package/dist/{local-engine-deploy-6O7NKZCA.js → local-engine-deploy-ID4JJXB5.js} +18 -16
- package/dist/local-engine-lookup-IC7BKAYP.js +43 -0
- package/dist/local-engine-mcp-bridge-3SOJMZ5T.js +423 -0
- package/dist/local-engine-mcp-command-RMVUH4FL.js +181 -0
- package/dist/{local-engine-process-ZLLZEIRF.js → local-engine-process-HG5BGG3F.js} +12 -9
- package/dist/{local-engine-state-OCW5YDD7.js → local-engine-state-JZHTKHDG.js} +4 -3
- package/dist/{local-engine-update-check-LVX4HBBI.js → local-engine-update-check-SKZR7YSC.js} +7 -6
- package/dist/{lock-commands-X2OECR4R.js → lock-commands-5NMQWBGH.js} +57 -56
- package/dist/{login-command-RLLKD565.js → login-command-GLLFZWHT.js} +33 -33
- package/dist/{logout-command-XDMSXCDO.js → logout-command-NCMKMJWF.js} +16 -15
- package/dist/{loop-SUB6C2LK.js → loop-XFDS65OD.js} +3 -3
- package/dist/{marketplace-command-2NHHY2X3.js → marketplace-command-Y3RRUEWL.js} +34 -34
- package/dist/{marketplace-resolve-OTZYT4FG.js → marketplace-resolve-PWEYJ2XS.js} +6 -6
- package/dist/{meta-client-TMHVBZFY.js → meta-client-Y7N6WDS2.js} +14 -13
- package/dist/{module-manifest-FNMW23IX.js → module-manifest-KY7J63HG.js} +4 -4
- package/dist/node.d.ts +4 -4
- package/dist/node.js +60 -59
- package/dist/operation-outcome-4BFISK2R.js +53 -0
- package/dist/{output-target-MOLCTPBP.js → output-target-MFANTVGZ.js} +20 -20
- package/dist/{plan-disclosure-CY7AF6KP.js → plan-disclosure-GNLDYV2A.js} +17 -16
- package/dist/{plugin-contributions-WR26U7NT.js → plugin-contributions-PAGG6SUP.js} +6 -6
- package/dist/{plugin-prompt-ZUYQQIX4.js → plugin-prompt-2MX6LF6X.js} +5 -5
- package/dist/{plugin-questions-HAZOQ67R.js → plugin-questions-AP6VUTOB.js} +4 -4
- package/dist/{preflight-command-OHJXYND3.js → preflight-command-Q6XOKRM6.js} +61 -60
- package/dist/{profile-command-6JWT2BTL.js → profile-command-XPQIXFWN.js} +34 -34
- package/dist/{profile-pointer-PDA5XBIB.js → profile-pointer-4HJQH5ZR.js} +5 -4
- package/dist/{project-dependency-GZWWGWEW.js → project-dependency-ORX45I74.js} +7 -7
- package/dist/{project-sdk-3W72H5QO.js → project-sdk-IYMFVQRC.js} +4 -4
- package/dist/promote-command-DN64QK7O.js +147 -0
- package/dist/{prompt-U37K5RPQ.js → prompt-ZZUYWFQX.js} +4 -4
- package/dist/{publish-command-BUS27HGB.js → publish-command-SLE46MQX.js} +61 -60
- package/dist/{pull-command-ZGUNP27P.js → pull-command-UVK3IOXM.js} +72 -71
- package/dist/{pull-superseded-EZBGYRZF.js → pull-superseded-UZ3MB53B.js} +4 -4
- package/dist/{release-command-BQ6OHS3P.js → release-command-MKNESNGB.js} +67 -66
- package/dist/{release-ns-command-ATGVBVIU.js → release-ns-command-HLR46IKP.js} +92 -91
- package/dist/{retry-command-QJ57WVW7.js → retry-command-VZYLYDVX.js} +10 -9
- package/dist/{routes-manifest-YR4ZIMLM.js → routes-manifest-RIZGSOZC.js} +4 -4
- package/dist/{routes-manifest-file-UALYSZLY.js → routes-manifest-file-UHVVL2YB.js} +8 -8
- package/dist/scaffold.js +4 -4
- package/dist/secrets-IV4N5HYI.js +20 -0
- package/dist/{secrets-file-LMS7KX3E.js → secrets-file-HST7BMQC.js} +19 -19
- package/dist/{secrets-fill-command-QNBDGCGM.js → secrets-fill-command-FQJ4QFBP.js} +55 -54
- package/dist/{seed-SZ6OS5DQ.js → seed-KEPIS7UZ.js} +6 -6
- package/dist/{source-resolve-MKLNYFWG.js → source-resolve-LNRUITLS.js} +24 -22
- package/dist/{static-host-ONEHA4LI.js → static-host-JAOT3N3E.js} +5 -5
- package/dist/{status-command-XKIFKBGM.js → status-command-S5CBG2SW.js} +53 -52
- package/dist/{store-Bg4Na6Sm.d.ts → store-CuD1k4kV.d.ts} +1 -1
- package/dist/{store-X6ZH7EC3.js → store-YFNDD6GZ.js} +8 -7
- package/dist/{sync-baseline-DOV5AGIO.js → sync-baseline-3CDL4PKT.js} +7 -5
- package/dist/{sync-contributions-HNVHDIQW.js → sync-contributions-O5ZRM2JN.js} +10 -10
- package/dist/{sync-record-PRXHLK4S.js → sync-record-U65BCPSP.js} +14 -13
- package/dist/{table-DC36QA4Y.js → table-E5YTK7QX.js} +7 -7
- package/dist/{tables-command-UQLKTELN.js → tables-command-7KI2KZOS.js} +40 -39
- package/dist/{tenant-EKNQGG5A.js → tenant-DAXJ4P4D.js} +12 -11
- package/dist/{tenant-command-2LWP2MPB.js → tenant-command-MQTLNETR.js} +97 -96
- package/dist/{test-command-IU5MBBXY.js → test-command-NLYMAAPD.js} +42 -41
- package/dist/{tests-RG2Y5EQ4.js → tests-CLDZWLKF.js} +6 -6
- package/dist/{token-7AWSJLKO.js → token-3IPTVEEW.js} +12 -11
- package/dist/{toolchain-hooks-4ZMQLBPQ.js → toolchain-hooks-3ZAAAWPL.js} +7 -7
- package/dist/{toolchain-modules-VU7SURVJ.js → toolchain-modules-K46KYJ4G.js} +5 -5
- package/dist/{toolchain-peers-CIDNEEQV.js → toolchain-peers-AIKWKJH7.js} +8 -8
- package/dist/{tracked-backend-4BHSV7NC.js → tracked-backend-FQFXTTYZ.js} +37 -36
- package/dist/{update-check-A7FXIINW.js → update-check-FHRRUDEC.js} +52 -51
- package/dist/{upgrade-command-C5KBITFI.js → upgrade-command-WNBPKUXN.js} +58 -55
- package/dist/{whoami-command-7WQII2H4.js → whoami-command-DPGDK35H.js} +15 -14
- package/dist/{workspace-Z46PUZNI.js → workspace-2GMONZ2A.js} +5 -5
- package/dist/{workspace-binding-JE6YNDZJ.js → workspace-binding-PAUOIK3V.js} +14 -13
- package/dist/{workspace-command-FC4IMLAE.js → workspace-command-KEKL27Y4.js} +99 -103
- package/dist/{workspace-env-N4ZPFT6A.js → workspace-env-GGEZVZDY.js} +16 -16
- package/dist/{workspace-export-3A5BZTPS.js → workspace-export-UHY22VBI.js} +5 -5
- package/dist/{writable-D7KCZI5N.js → writable-2A6MBSFD.js} +4 -4
- package/dist/{xano-LCI7VWPS.js → xano-6T6L7TTI.js} +5 -5
- package/dist/{xanosdk-import-P2A2KSXM.js → xanosdk-import-HYHABD5U.js} +6 -6
- package/dist/{xanosdk-project-6AGMW2SL.js → xanosdk-project-2T56DRYS.js} +16 -16
- package/guides/README.md +2 -2
- package/guides/cli.md +69 -0
- package/guides/codegen.md +23 -5
- package/guides/codes.md +5 -1
- package/guides/coverage.md +5 -0
- package/guides/deploying.md +45 -1
- package/guides/scaffold.md +61 -10
- package/llms/errors.md +1 -1
- package/llms/kinds-agent-mcp.md +1 -1
- package/llms-full.txt +3 -3
- package/llms.txt +1 -1
- package/manifest.json +67 -5
- package/package.json +5 -2
- package/skills/xano-backend/SKILL.md +119 -0
- package/dist/chunk-LL7SGTRC.js +0 -663
- package/dist/chunk-M6ZFSTIZ.js +0 -630
- package/dist/env-example-refresh-CQP3ZMKM.js +0 -133
- package/dist/operation-outcome-RN62735X.js +0 -51
- package/dist/promote-command-UYAMUXKB.js +0 -146
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ROUTES_MANIFEST_BASENAME
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-O376UAZS.js";
|
|
4
4
|
import {
|
|
5
5
|
questionOrCancel
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HQPL34O6.js";
|
|
7
7
|
import {
|
|
8
8
|
ensureWorkspaceEnvGitignored
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JG642U5D.js";
|
|
10
10
|
import {
|
|
11
11
|
readVersion
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZJCHS7FM.js";
|
|
13
13
|
import {
|
|
14
14
|
WORKSPACE_ENV_EXAMPLE_FILE,
|
|
15
15
|
renderWorkspaceEnvExample
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-M3RLLT4O.js";
|
|
17
17
|
import {
|
|
18
18
|
parseSlot,
|
|
19
19
|
requireBackendSlot
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-VD7YTLWL.js";
|
|
21
21
|
import {
|
|
22
|
+
MERGED_IN_EXISTING,
|
|
22
23
|
XANO_DIR,
|
|
23
24
|
changedOnDisk,
|
|
24
|
-
|
|
25
|
+
describeClash,
|
|
26
|
+
existingProjectClashes,
|
|
25
27
|
isNonEmptyDir,
|
|
26
|
-
plannedAgentsMd,
|
|
27
28
|
scaffoldProject
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-HKLBDSML.js";
|
|
29
30
|
import {
|
|
30
31
|
inProject,
|
|
31
32
|
installModules,
|
|
@@ -33,7 +34,7 @@ import {
|
|
|
33
34
|
preflightPackages,
|
|
34
35
|
rebaseLocalSpec,
|
|
35
36
|
renderXanoIndexWithModules
|
|
36
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-RYMGK2K5.js";
|
|
37
38
|
import {
|
|
38
39
|
npmViewVersion
|
|
39
40
|
} from "./chunk-ZFDZKNGG.js";
|
|
@@ -42,11 +43,14 @@ import {
|
|
|
42
43
|
} from "./chunk-FWD7AL6N.js";
|
|
43
44
|
import {
|
|
44
45
|
isLocalSpecifier
|
|
45
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-6PTITS3M.js";
|
|
46
47
|
import {
|
|
47
48
|
readToolchainBlock,
|
|
48
49
|
readToolchainConfig
|
|
49
50
|
} from "./chunk-DXUICABI.js";
|
|
51
|
+
import {
|
|
52
|
+
statusLabel
|
|
53
|
+
} from "./chunk-TR7EOUQE.js";
|
|
50
54
|
import {
|
|
51
55
|
detectInstallRoot,
|
|
52
56
|
detectPackageManager,
|
|
@@ -58,24 +62,29 @@ import {
|
|
|
58
62
|
localPathOf,
|
|
59
63
|
packageNameOf,
|
|
60
64
|
readInstalledManifestState
|
|
61
|
-
} from "./chunk-
|
|
62
|
-
import {
|
|
63
|
-
statusLabel
|
|
64
|
-
} from "./chunk-YR2I5HGE.js";
|
|
65
|
+
} from "./chunk-QL3ZJWGG.js";
|
|
65
66
|
import {
|
|
66
67
|
readEnvVar
|
|
67
68
|
} from "./chunk-X2NL4KUO.js";
|
|
68
69
|
import {
|
|
69
70
|
DEFAULT_FRAMEWORK,
|
|
70
71
|
FRAMEWORKS,
|
|
71
|
-
NODE_MIN,
|
|
72
72
|
allFrontendPresets,
|
|
73
|
+
findFrontendPreset
|
|
74
|
+
} from "./chunk-BRANWM4U.js";
|
|
75
|
+
import {
|
|
76
|
+
BACKEND_TSCONFIG_PATH,
|
|
77
|
+
ICON_LIBRARIES,
|
|
78
|
+
NODE_MIN,
|
|
73
79
|
checkJobDir,
|
|
74
80
|
checkWorkflowName,
|
|
75
81
|
checkWorkflowPath,
|
|
76
|
-
findFrontendPreset,
|
|
77
82
|
initLanding,
|
|
83
|
+
mergeGitignore,
|
|
78
84
|
renderApiTs,
|
|
85
|
+
renderBackendPackageJson,
|
|
86
|
+
renderBackendReadme,
|
|
87
|
+
renderBackendTsconfig,
|
|
79
88
|
renderCheckWorkflow,
|
|
80
89
|
renderCnUtil,
|
|
81
90
|
renderEnvExample,
|
|
@@ -91,13 +100,14 @@ import {
|
|
|
91
100
|
renderViteConfig,
|
|
92
101
|
renderXanoExampleMd,
|
|
93
102
|
renderXanoIndex,
|
|
94
|
-
|
|
103
|
+
resolveIconsFlag,
|
|
95
104
|
sdkDep
|
|
96
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-5GIOCDUM.js";
|
|
97
106
|
import {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
107
|
+
composeBlock,
|
|
108
|
+
gitattributesSpec,
|
|
109
|
+
upsertBlock
|
|
110
|
+
} from "./chunk-LJM5CIY4.js";
|
|
101
111
|
import {
|
|
102
112
|
UsageError,
|
|
103
113
|
blank,
|
|
@@ -120,7 +130,7 @@ import {
|
|
|
120
130
|
unknownFlag,
|
|
121
131
|
warn,
|
|
122
132
|
writeJson
|
|
123
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-C6KBZH7M.js";
|
|
124
134
|
import {
|
|
125
135
|
suggest
|
|
126
136
|
} from "./chunk-UTI5G6OJ.js";
|
|
@@ -235,6 +245,8 @@ async function resolveThemeChoice(args) {
|
|
|
235
245
|
}
|
|
236
246
|
|
|
237
247
|
// src/emit/frontend-resolve.ts
|
|
248
|
+
var NO_FRONTEND = "none";
|
|
249
|
+
var FRAMEWORK_CHOICES = [...FRAMEWORKS, NO_FRONTEND];
|
|
238
250
|
function defaultFrontendPreset() {
|
|
239
251
|
const preset = findFrontendPreset(DEFAULT_FRAMEWORK);
|
|
240
252
|
if (preset === void 0) {
|
|
@@ -242,6 +254,10 @@ function defaultFrontendPreset() {
|
|
|
242
254
|
}
|
|
243
255
|
return preset;
|
|
244
256
|
}
|
|
257
|
+
function isNoFrontend(token) {
|
|
258
|
+
const t = token.trim().toLowerCase();
|
|
259
|
+
return t === NO_FRONTEND || t === "no frontend";
|
|
260
|
+
}
|
|
245
261
|
async function promptFramework() {
|
|
246
262
|
const presets = allFrontendPresets();
|
|
247
263
|
const rl = createInterface({ input: process.stdin, output: process.stderr });
|
|
@@ -250,6 +266,7 @@ async function promptFramework() {
|
|
|
250
266
|
`
|
|
251
267
|
Which frontend framework?
|
|
252
268
|
` + presets.map((p, i) => ` ${i + 1}) ${p.label}${p.id === DEFAULT_FRAMEWORK ? " (default)" : ""}`).join("\n") + `
|
|
269
|
+
${presets.length + 1}) No frontend (the backend only)
|
|
253
270
|
`
|
|
254
271
|
);
|
|
255
272
|
const answer = await questionOrCancel(rl, `Enter a number or name, or leave blank for the default: `);
|
|
@@ -259,13 +276,24 @@ Which frontend framework?
|
|
|
259
276
|
if (Number.isInteger(byIndex) && byIndex >= 1 && byIndex <= presets.length) {
|
|
260
277
|
return presets[byIndex - 1];
|
|
261
278
|
}
|
|
279
|
+
if (byIndex === presets.length + 1 || isNoFrontend(token)) return null;
|
|
262
280
|
return findFrontendPreset(token) ?? defaultFrontendPreset();
|
|
263
281
|
} finally {
|
|
264
282
|
rl.close();
|
|
265
283
|
}
|
|
266
284
|
}
|
|
285
|
+
function resolveFrameworkValue(flag) {
|
|
286
|
+
if (isNoFrontend(flag)) return null;
|
|
287
|
+
return flagValue(flag, FRAMEWORK_CHOICES, () => {
|
|
288
|
+
const preset = findFrontendPreset(flag);
|
|
289
|
+
if (preset === void 0) {
|
|
290
|
+
throw new Error(`Unknown --framework "${flag}". Valid values: ${FRAMEWORK_CHOICES.join(", ")}.`);
|
|
291
|
+
}
|
|
292
|
+
return preset;
|
|
293
|
+
});
|
|
294
|
+
}
|
|
267
295
|
async function resolveFrontendPreset(flag) {
|
|
268
|
-
if (flag !== void 0 && flag !== "") return
|
|
296
|
+
if (flag !== void 0 && flag !== "") return resolveFrameworkValue(flag);
|
|
269
297
|
if (process.stdin.isTTY && process.stderr.isTTY) return promptFramework();
|
|
270
298
|
return defaultFrontendPreset();
|
|
271
299
|
}
|
|
@@ -432,12 +460,78 @@ function projectShellFiles(vars, preset, parts, choice = defaultThemeChoice(), c
|
|
|
432
460
|
...preset.files(vars, parts.landing, choice)
|
|
433
461
|
]);
|
|
434
462
|
}
|
|
463
|
+
function backendShellFiles(vars, shell, contributions = {}, existingXanoSdk) {
|
|
464
|
+
const backend = [
|
|
465
|
+
{ path: BACKEND_TSCONFIG_PATH, content: renderBackendTsconfig() },
|
|
466
|
+
{ path: "xano/lambdas/tsconfig.json", content: renderLambdaTsconfig("backend") }
|
|
467
|
+
];
|
|
468
|
+
const manifest = {
|
|
469
|
+
path: "package.json",
|
|
470
|
+
content: withXanoSdkBlock(
|
|
471
|
+
renderBackendPackageJson(vars),
|
|
472
|
+
contributions.xanosdk,
|
|
473
|
+
shell.kind === "existing" ? void 0 : existingXanoSdk
|
|
474
|
+
)
|
|
475
|
+
};
|
|
476
|
+
if (shell.kind === "existing") {
|
|
477
|
+
return spelledForProject(vars, [
|
|
478
|
+
manifest,
|
|
479
|
+
...backend,
|
|
480
|
+
...moduleTypeMarker(shell.dir),
|
|
481
|
+
// The line-ending rule, scoped to `xano/`: a `*` rule at the project's
|
|
482
|
+
// root would renormalize every file the project already has.
|
|
483
|
+
{ path: `${XANO_DIR}/.gitattributes`, content: renderGitattributes() },
|
|
484
|
+
...moduleGitattributes(shell.dir, contributions.gitattributes ?? []),
|
|
485
|
+
...gitignoreBlock(shell.dir, vars.sdkVersion)
|
|
486
|
+
]);
|
|
487
|
+
}
|
|
488
|
+
return spelledForProject(vars, [
|
|
489
|
+
manifest,
|
|
490
|
+
...backend,
|
|
491
|
+
{ path: ".gitignore", content: renderGitignore() },
|
|
492
|
+
{ path: ".gitattributes", content: renderGitattributes(contributions.gitattributes) },
|
|
493
|
+
{ path: checkWorkflowPath(vars.install), content: renderCheckWorkflow(vars.install) },
|
|
494
|
+
{ path: "README.md", content: shell.readme }
|
|
495
|
+
]);
|
|
496
|
+
}
|
|
497
|
+
function moduleTypeMarker(dir) {
|
|
498
|
+
let manifest;
|
|
499
|
+
try {
|
|
500
|
+
manifest = JSON.parse(readFileSync2(join(dir, "package.json"), "utf8"));
|
|
501
|
+
} catch {
|
|
502
|
+
return [];
|
|
503
|
+
}
|
|
504
|
+
if (manifest?.type === "module") return [];
|
|
505
|
+
return [{ path: `${XANO_DIR}/package.json`, content: `${JSON.stringify({ type: "module" }, null, 2)}
|
|
506
|
+
` }];
|
|
507
|
+
}
|
|
508
|
+
function gitignoreBlock(dir, version) {
|
|
509
|
+
const path = join(dir, ".gitignore");
|
|
510
|
+
const existing = existsSync(path) ? readFileSync2(path, "utf8") : null;
|
|
511
|
+
const merged = mergeGitignore(existing, version);
|
|
512
|
+
return merged === existing ? [] : [{ path: ".gitignore", content: merged }];
|
|
513
|
+
}
|
|
514
|
+
function moduleGitattributes(dir, contributions) {
|
|
515
|
+
if (contributions.length === 0) return [];
|
|
516
|
+
const path = join(dir, ".gitattributes");
|
|
517
|
+
let text = existsSync(path) ? readFileSync2(path, "utf8") : "";
|
|
518
|
+
for (const { pkg, version, lines } of contributions) {
|
|
519
|
+
const spec = gitattributesSpec(pkg);
|
|
520
|
+
text = upsertBlock(text, spec, composeBlock(spec, lines, version)).text;
|
|
521
|
+
}
|
|
522
|
+
return [{ path: ".gitattributes", content: text }];
|
|
523
|
+
}
|
|
435
524
|
function spelledForProject(vars, files) {
|
|
436
525
|
return files.map((f) => ({ ...f, content: spellProjectSdkDir(spellProjectCli(f.content, vars.cli), vars.sdkDir) }));
|
|
437
526
|
}
|
|
438
|
-
function buildFileSet(vars, preset, choice, contributions = {}, existingXanoSdk) {
|
|
527
|
+
function buildFileSet(targetDir, vars, preset, mode, choice, contributions = {}, existingXanoSdk) {
|
|
439
528
|
return [
|
|
440
|
-
...
|
|
529
|
+
...preset === null ? backendShellFiles(
|
|
530
|
+
vars,
|
|
531
|
+
mode === "new" ? { kind: "new", readme: renderBackendReadme(vars) } : { kind: "existing", dir: targetDir },
|
|
532
|
+
contributions,
|
|
533
|
+
existingXanoSdk
|
|
534
|
+
) : projectShellFiles(
|
|
441
535
|
vars,
|
|
442
536
|
preset,
|
|
443
537
|
{ readme: renderReadme(vars, preset, choice), landing: initLanding(vars) },
|
|
@@ -488,14 +582,41 @@ function rejectPullOnlyFlags(args) {
|
|
|
488
582
|
{ helpFor: { command: "init" } }
|
|
489
583
|
);
|
|
490
584
|
}
|
|
491
|
-
function
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
585
|
+
function frontendOnlyFlags(args) {
|
|
586
|
+
return [
|
|
587
|
+
...args.theme !== void 0 ? ["--theme"] : [],
|
|
588
|
+
...args.radius !== void 0 ? ["--radius"] : [],
|
|
589
|
+
...args.dark !== void 0 ? ["--dark"] : [],
|
|
590
|
+
...args.font !== void 0 ? ["--font"] : [],
|
|
591
|
+
...args.fontMono !== void 0 ? ["--font-mono"] : [],
|
|
592
|
+
...args.fontHeading !== void 0 ? ["--font-heading"] : [],
|
|
593
|
+
...args.icons !== void 0 ? ["--icons"] : []
|
|
594
|
+
];
|
|
595
|
+
}
|
|
596
|
+
function refuseFrontendOnlyFlags(args, why) {
|
|
597
|
+
const passed = frontendOnlyFlags(args);
|
|
598
|
+
if (passed.length === 0) return;
|
|
599
|
+
const one = passed.length === 1;
|
|
600
|
+
throw new UsageError(
|
|
601
|
+
`${passed.join(", ")} ${one ? "applies" : "apply"} only with a frontend, and ${why}. Drop ${one ? "it" : "them"}.`,
|
|
602
|
+
{ helpFor: { command: "init" } }
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
async function resolveInitFrontend(args, targetDir, mode) {
|
|
606
|
+
if (mode === "existing") {
|
|
607
|
+
if (args.framework !== void 0 && resolveFrameworkValue(args.framework) !== null) {
|
|
608
|
+
throw new UsageError(
|
|
609
|
+
`\`--framework ${args.framework}\` writes a new frontend, and ${targetDir} is not empty: an existing app gets the backend only. Drop --framework to add the backend to it, or run init in an empty directory for a full app.`,
|
|
610
|
+
{ helpFor: { command: "init" } }
|
|
611
|
+
);
|
|
612
|
+
}
|
|
613
|
+
refuseFrontendOnlyFlags(args, `${targetDir} is an existing project, which gets the backend only`);
|
|
614
|
+
return null;
|
|
497
615
|
}
|
|
498
|
-
return
|
|
616
|
+
if (args.framework === void 0) return void 0;
|
|
617
|
+
const preset = resolveFrameworkValue(args.framework);
|
|
618
|
+
if (preset === null) refuseFrontendOnlyFlags(args, `\`--framework ${NO_FRONTEND}\` writes none`);
|
|
619
|
+
return preset;
|
|
499
620
|
}
|
|
500
621
|
function readLockEntryCount(targetDir) {
|
|
501
622
|
const path = join(targetDir, LOCK_REL);
|
|
@@ -507,32 +628,43 @@ function readLockEntryCount(targetDir) {
|
|
|
507
628
|
return 0;
|
|
508
629
|
}
|
|
509
630
|
}
|
|
510
|
-
async function
|
|
511
|
-
const
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
631
|
+
async function settleClashes(targetDir, files, args) {
|
|
632
|
+
const clashes = existingProjectClashes(targetDir, files);
|
|
633
|
+
if (clashes.length === 0) return [];
|
|
634
|
+
const one = clashes.length === 1;
|
|
635
|
+
if (!args.force) {
|
|
636
|
+
throw new UsageError(
|
|
637
|
+
`init adds the backend to ${targetDir}, and ${one ? "this clashes" : `these ${clashes.length} clash`} with what is already there:
|
|
638
|
+
${clashes.map((c) => ` ${describeClash(c)}`).join("\n")}
|
|
639
|
+
Nothing was written. ` + (process.stdin.isTTY === true ? `Re-run with --force to write over ${one ? "it" : "them"}.` : `Re-run with --force --yes to write over ${one ? "it" : "them"} (--yes confirms the overwrite, which cannot be asked without a terminal).`)
|
|
640
|
+
);
|
|
641
|
+
}
|
|
642
|
+
const scripts = clashes.flatMap((c) => c.kind === "script" ? [c.name] : []);
|
|
643
|
+
const changed = changedOnDisk(targetDir, files.filter((f) => !MERGED_IN_EXISTING.has(f.path)));
|
|
644
|
+
const listed = [...changed, ...clashes.filter((c) => c.kind === "script").map(describeClash)];
|
|
645
|
+
if (listed.length === 0) return scripts;
|
|
646
|
+
const counted = [
|
|
647
|
+
...changed.length === 0 ? [] : [`${changed.length} file${changed.length === 1 ? "" : "s"}`],
|
|
648
|
+
...scripts.length === 0 ? [] : [`${scripts.length} script${scripts.length === 1 ? "" : "s"}`]
|
|
649
|
+
].join(" and ");
|
|
650
|
+
warn(`init --force overwrites ${counted} already in ${targetDir}:`, "init.overwrite", [
|
|
651
|
+
...listed.slice(0, 30),
|
|
652
|
+
...listed.length > 30 ? [`\u2026 and ${listed.length - 30} more`] : []
|
|
653
|
+
]);
|
|
654
|
+
if (args.yes === true) return scripts;
|
|
655
|
+
const { confirm } = await import("./prompt-ZZUYWFQX.js");
|
|
656
|
+
const { yesRerun } = await import("./retry-command-VZYLYDVX.js");
|
|
529
657
|
const { rerun, note } = yesRerun(args, "init");
|
|
658
|
+
const noun = scripts.length === 0 ? "file" : changed.length === 0 ? "script" : "file and script";
|
|
530
659
|
const ok = await confirm(
|
|
531
|
-
`Overwrite ${
|
|
532
|
-
{ flag: "--yes", refusal: { details: { written: false, files:
|
|
660
|
+
`Overwrite ${listed.length === 1 ? `this ${noun}` : `these ${listed.length} ${noun === "file and script" ? "files and scripts" : `${noun}s`}`} in ${targetDir}?`,
|
|
661
|
+
{ flag: "--yes", refusal: { details: { written: false, files: listed }, rerun, note } }
|
|
533
662
|
);
|
|
534
|
-
if (!ok)
|
|
535
|
-
|
|
663
|
+
if (!ok) {
|
|
664
|
+
info("Cancelled. Nothing was written.");
|
|
665
|
+
return "cancelled";
|
|
666
|
+
}
|
|
667
|
+
return scripts;
|
|
536
668
|
}
|
|
537
669
|
function renderMinimalPackageJson(appName, sdkVersion) {
|
|
538
670
|
return `${JSON.stringify(
|
|
@@ -596,7 +728,7 @@ async function runInitCommand(args) {
|
|
|
596
728
|
}
|
|
597
729
|
const source = resolveFromSource(args.from);
|
|
598
730
|
if (source.kind === "file") await refuseUnknownProfileFlag(args, resolve(args.positionals[0] ?? "."));
|
|
599
|
-
const { runInitFromCommand } = await import("./codegen-command-
|
|
731
|
+
const { runInitFromCommand } = await import("./codegen-command-4YXDJSLU.js");
|
|
600
732
|
return runInitFromCommand(args, source);
|
|
601
733
|
}
|
|
602
734
|
rejectPullOnlyFlags(args);
|
|
@@ -604,10 +736,11 @@ async function runInitCommand(args) {
|
|
|
604
736
|
const targetDir = resolve(targetArg);
|
|
605
737
|
await refuseUnknownProfileFlag(args, targetDir);
|
|
606
738
|
const appName = sanitizeAppName(args.name ?? basename(targetDir));
|
|
739
|
+
const mode = isNonEmptyDir(targetDir) ? "existing" : "new";
|
|
607
740
|
const existingXanoSdk = readToolchainBlock(targetDir);
|
|
608
741
|
const typedModules = parseMarketplaceFlag(args.marketplace);
|
|
609
|
-
|
|
610
|
-
await resolveThemeChoice(args);
|
|
742
|
+
const flagFrontend = await resolveInitFrontend(args, targetDir, mode);
|
|
743
|
+
if (flagFrontend !== null) await resolveThemeChoice(args);
|
|
611
744
|
const unclaimable = args.unknownFlags.filter((f) => {
|
|
612
745
|
const name = flagName(f);
|
|
613
746
|
if (!name.startsWith("--")) return true;
|
|
@@ -615,10 +748,10 @@ async function runInitCommand(args) {
|
|
|
615
748
|
return flagNames().includes(bare) || bare.startsWith("no-") && flagNames().includes(bare.slice(3));
|
|
616
749
|
});
|
|
617
750
|
if (unclaimable.length > 0) throw unknownFlag(unclaimable, { command: "init" });
|
|
618
|
-
const { refusePlugAndPlay } = await import("./project-dependency-
|
|
619
|
-
const { retryCommand } = await import("./retry-command-
|
|
751
|
+
const { refusePlugAndPlay } = await import("./project-dependency-ORX45I74.js");
|
|
752
|
+
const { retryCommand } = await import("./retry-command-VZYLYDVX.js");
|
|
620
753
|
refusePlugAndPlay(targetDir, retryCommand(args, { command: "init" }).command);
|
|
621
|
-
const { resolveMarketplaceSpecs, withCatalogueRerun } = await import("./marketplace-resolve-
|
|
754
|
+
const { resolveMarketplaceSpecs, withCatalogueRerun } = await import("./marketplace-resolve-PWEYJ2XS.js");
|
|
622
755
|
const resolvedModules = typedModules.length === 0 ? [] : await resolveMarketplaceSpecs(typedModules, "xanosdk init --marketplace").catch(async (err) => {
|
|
623
756
|
throw await withCatalogueRerun(err, args, "init");
|
|
624
757
|
});
|
|
@@ -627,50 +760,45 @@ async function runInitCommand(args) {
|
|
|
627
760
|
if (requestedModules.length > 0) preflightPackages(requestedModules, targetDir);
|
|
628
761
|
const deferredModules = args.noInstall ? requestedModules : [];
|
|
629
762
|
const modules = args.noInstall ? [] : requestedModules;
|
|
630
|
-
let overwrite;
|
|
631
763
|
let moduleOutcome;
|
|
632
|
-
const forcedOver = args.force && isNonEmptyDir(targetDir);
|
|
633
764
|
const hadLock = readLockEntryCount(targetDir);
|
|
634
|
-
let
|
|
765
|
+
let overrideScripts;
|
|
766
|
+
const settle = async () => mode === "existing" ? settleClashes(
|
|
767
|
+
targetDir,
|
|
768
|
+
buildFileSet(targetDir, { appName, sdkVersion: readVersion() }, null, mode, defaultThemeChoice(), {}, existingXanoSdk),
|
|
769
|
+
args
|
|
770
|
+
) : [];
|
|
635
771
|
let passOne;
|
|
636
772
|
if (modules.length > 0) {
|
|
637
|
-
|
|
638
|
-
if (
|
|
639
|
-
|
|
640
|
-
const earlyTheme = await resolveThemeChoice(args);
|
|
641
|
-
const provisional = buildFileSet(
|
|
642
|
-
{ appName, sdkVersion: readVersion() },
|
|
643
|
-
earlyPreset,
|
|
644
|
-
earlyTheme,
|
|
645
|
-
{ gitattributes: [], xanosdk: {} },
|
|
646
|
-
existingXanoSdk
|
|
647
|
-
);
|
|
648
|
-
const agents = { appName, frontend: earlyPreset, theme: earlyTheme };
|
|
649
|
-
if (!await confirmForcedOverwrite(targetDir, provisional, args, agents)) return;
|
|
650
|
-
}
|
|
773
|
+
const settled = await settle();
|
|
774
|
+
if (settled === "cancelled") return;
|
|
775
|
+
overrideScripts = settled;
|
|
651
776
|
passOne = snapshotForRollback(targetDir);
|
|
652
777
|
mkdirSync(targetDir, { recursive: true });
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
778
|
+
if (mode === "new" || !existsSync(join(targetDir, "package.json"))) {
|
|
779
|
+
writeFileSync(
|
|
780
|
+
join(targetDir, "package.json"),
|
|
781
|
+
renderMinimalPackageJson(appName, readVersion()),
|
|
782
|
+
"utf8"
|
|
783
|
+
);
|
|
784
|
+
}
|
|
658
785
|
blank();
|
|
659
786
|
moduleOutcome = await installModules(targetDir, modules);
|
|
660
787
|
if (moduleOutcome.toolchain.length > 0) {
|
|
661
|
-
const { addToolchainPeers } = await import("./toolchain-peers-
|
|
788
|
+
const { addToolchainPeers } = await import("./toolchain-peers-AIKWKJH7.js");
|
|
662
789
|
const rerun = retryCommand(args, { command: "init" }).command;
|
|
663
790
|
for (const pkg of moduleOutcome.toolchain) await addToolchainPeers(targetDir, pkg, rerun);
|
|
664
791
|
}
|
|
665
792
|
}
|
|
666
793
|
let scaffolded = false;
|
|
667
794
|
try {
|
|
668
|
-
const { discoverToolchainPlugins } = await import("./toolchain-modules-
|
|
795
|
+
const { discoverToolchainPlugins } = await import("./toolchain-modules-K46KYJ4G.js");
|
|
669
796
|
const toolchain = await discoverToolchainPlugins(targetDir, { frozen: false, configuring: true });
|
|
670
|
-
const preset =
|
|
797
|
+
const preset = flagFrontend !== void 0 ? flagFrontend : await resolveFrontendPreset(args.framework);
|
|
798
|
+
if (preset === null && flagFrontend === void 0) refuseFrontendOnlyFlags(args, "no frontend was chosen");
|
|
671
799
|
const choice = await resolveThemeChoice(args);
|
|
672
|
-
const { pluginPrompter } = await import("./plugin-prompt-
|
|
673
|
-
const { contributionOutcomes, recordedConfig, runPluginQuestionnaire } = await import("./plugin-contributions-
|
|
800
|
+
const { pluginPrompter } = await import("./plugin-prompt-2MX6LF6X.js");
|
|
801
|
+
const { contributionOutcomes, recordedConfig, runPluginQuestionnaire } = await import("./plugin-contributions-PAGG6SUP.js");
|
|
674
802
|
const { answers: pluginAnswers } = await runPluginQuestionnaire(toolchain.loaded, {
|
|
675
803
|
host: "init",
|
|
676
804
|
unknownFlags: args.unknownFlags,
|
|
@@ -689,12 +817,14 @@ async function runInitCommand(args) {
|
|
|
689
817
|
if (record !== void 0) pluginConfig[outcome.pkg] = record;
|
|
690
818
|
}
|
|
691
819
|
const vars = templateVarsFor(appName, targetDir);
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
820
|
+
if (overrideScripts === void 0) {
|
|
821
|
+
const settled = await settle();
|
|
822
|
+
if (settled === "cancelled") return;
|
|
823
|
+
overrideScripts = settled;
|
|
824
|
+
}
|
|
825
|
+
const fileSet = buildFileSet(targetDir, vars, preset, mode, choice, { gitattributes, xanosdk: pluginConfig }, existingXanoSdk);
|
|
696
826
|
step(
|
|
697
|
-
`Scaffolding ${style.bold(appName)} (${preset.label}, ${choice.theme.label}) in ${targetDir}`
|
|
827
|
+
mode === "existing" ? `Adding a Xano backend to ${style.bold(appName)} in ${targetDir}` : preset === null ? `Scaffolding ${style.bold(appName)} (no frontend) in ${targetDir}` : `Scaffolding ${style.bold(appName)} (${preset.label}, ${choice.theme.label}) in ${targetDir}`
|
|
698
828
|
);
|
|
699
829
|
const pin = await planProfilePin(args, targetDir);
|
|
700
830
|
scaffolded = true;
|
|
@@ -708,9 +838,14 @@ async function runInitCommand(args) {
|
|
|
708
838
|
// An `init` project's `xano/` is hand-authored, never machine-written: it is
|
|
709
839
|
// not refreshable, and `--force` must not clear it.
|
|
710
840
|
regenerable: false,
|
|
711
|
-
|
|
712
|
-
//
|
|
713
|
-
|
|
841
|
+
// A new project's directory is empty, and an existing one's clashes were
|
|
842
|
+
// settled above: nothing here is refused.
|
|
843
|
+
overwrite: "full",
|
|
844
|
+
// An existing project's manifest is the user's, merged into with the
|
|
845
|
+
// project winning. Otherwise only the module path writes package.json
|
|
846
|
+
// twice, so only that path merges.
|
|
847
|
+
mergePackageJson: mode === "existing" ? "project" : modules.length > 0 ? "rendered" : void 0,
|
|
848
|
+
overrideScripts,
|
|
714
849
|
// A project install failing for the reason an add-on's already did (the
|
|
715
850
|
// manifest they share names a range npm has no version for) is that one
|
|
716
851
|
// failure, already warned — not a second warning repeating npm's text.
|
|
@@ -728,7 +863,7 @@ async function runInitCommand(args) {
|
|
|
728
863
|
reportWorkflowPlacement(result.written, vars.install, targetDir);
|
|
729
864
|
pin.report();
|
|
730
865
|
const pinnedProfile = pin.name;
|
|
731
|
-
info(`Theme: ${choice.theme.label} \u2014 dark mode: ${choice.dark}`);
|
|
866
|
+
if (preset !== null) info(`Theme: ${choice.theme.label} \u2014 dark mode: ${choice.dark}`);
|
|
732
867
|
if (deferredModules.length > 0) {
|
|
733
868
|
recordDeferredModules(targetDir, deferredModules);
|
|
734
869
|
info(`Added to package.json, not installed (--no-install): ${deferredModules.join(", ")}.`);
|
|
@@ -789,10 +924,10 @@ async function runInitCommand(args) {
|
|
|
789
924
|
}
|
|
790
925
|
}
|
|
791
926
|
if (result.install === "installed") {
|
|
792
|
-
const { skewedProjectSdk } = await import("./project-sdk-
|
|
927
|
+
const { skewedProjectSdk } = await import("./project-sdk-IYMFVQRC.js");
|
|
793
928
|
const installedSdk = skewedProjectSdk(targetDir, readVersion());
|
|
794
929
|
if (installedSdk !== void 0) {
|
|
795
|
-
const { reconcileWithInstalled } = await import("./upgrade-command-
|
|
930
|
+
const { reconcileWithInstalled } = await import("./upgrade-command-WNBPKUXN.js");
|
|
796
931
|
const rendered = reconcileWithInstalled(targetDir);
|
|
797
932
|
if (rendered.length > 0) {
|
|
798
933
|
info(`Rendered ${rendered.join(", ")} with the installed @xano/sdk ${installedSdk.version} (this CLI is ${readVersion()}).`);
|
|
@@ -824,17 +959,18 @@ async function runInitCommand(args) {
|
|
|
824
959
|
}
|
|
825
960
|
const cdHint = targetDir === process.cwd() ? "" : ` cd ${shellWord(targetArg)}
|
|
826
961
|
`;
|
|
962
|
+
const needsInstall = !(result.install === "installed" || sdkResolves(targetDir));
|
|
827
963
|
detail(
|
|
828
964
|
`Next steps:
|
|
829
|
-
` + cdHint + (
|
|
830
|
-
`) + // A declared name with no line in xano/.env refuses the deploy, so the
|
|
965
|
+
` + cdHint + (needsInstall ? ` ${installLine}
|
|
966
|
+
` : ``) + // A declared name with no line in xano/.env refuses the deploy, so the
|
|
831
967
|
// step that supplies it comes first.
|
|
832
968
|
(addonEnv.length > 0 ? ` cp xano/.env.example xano/.env # then set ${addonEnv.join(", ")} \u2014 the add-ons read ${addonEnv.length === 1 ? "it" : "them"}
|
|
833
969
|
` : ``) + // The Xano Engine first: it needs no account, so sign-in waits for
|
|
834
970
|
// the cloud deploy that does.
|
|
835
971
|
` npm run xano:deploy # run the backend on the Xano Engine, on this machine
|
|
836
|
-
npm run dev # run the frontend, pointed at it
|
|
837
|
-
` + loginNextStep(pin, targetDir) +
|
|
972
|
+
` + (preset === null ? `` : ` npm run dev # run the frontend, pointed at it
|
|
973
|
+
`) + loginNextStep(pin, targetDir) + `${ephemeralNextStep(preset !== null)}
|
|
838
974
|
|
|
839
975
|
` + (hadLock !== void 0 ? `xano/xano.lock was kept (${hadLock} ${hadLock === 1 ? "entry" : "entries"}). An entry the new xano/index.ts
|
|
840
976
|
does not export fails \`npm run xano:check\`; once those objects are gone for good,
|
|
@@ -848,11 +984,18 @@ ${ROUTES_REL} was written for the add-ons' endpoints \u2014 commit it too.` : ""
|
|
|
848
984
|
writeJson({
|
|
849
985
|
dir: targetDir,
|
|
850
986
|
name: appName,
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
987
|
+
// `new` or `existing`: whether this run wrote a project, or added the
|
|
988
|
+
// backend to one that was already there.
|
|
989
|
+
mode,
|
|
990
|
+
framework: preset?.id ?? NO_FRONTEND,
|
|
991
|
+
theme: preset === null ? null : choice.theme.id,
|
|
992
|
+
dark: preset === null ? null : choice.dark,
|
|
854
993
|
install: result.install,
|
|
855
994
|
pinnedProfile,
|
|
995
|
+
// Every file this run wrote or merged into, project-relative.
|
|
996
|
+
files: runFiles(result.written, derived),
|
|
997
|
+
// The one command to run next, from where `init` was typed.
|
|
998
|
+
next: deployNextCommand(cdHint === "" ? null : targetArg, needsInstall ? installLine : null, manager),
|
|
856
999
|
// `--no-install` still names what it added: recorded in package.json,
|
|
857
1000
|
// not installed, not wired.
|
|
858
1001
|
...moduleOutcome === void 0 && deferredModules.length > 0 ? {
|
|
@@ -922,20 +1065,20 @@ async function writeDerivedFiles(targetDir, renderIndexWithEnv, toolchain) {
|
|
|
922
1065
|
const routesPath = join(targetDir, ROUTES_REL);
|
|
923
1066
|
try {
|
|
924
1067
|
const { loadDefault, checkStandInTokens } = await import("./cli.js");
|
|
925
|
-
const { Xano } = await import("./xano-
|
|
1068
|
+
const { Xano } = await import("./xano-6T6L7TTI.js");
|
|
926
1069
|
const { createLockContext, lockKey, mergeObserved } = await import("./lock-HDCHD2ON.js");
|
|
927
1070
|
const { resetLockOverrides, seedLockOverrides } = await import("./store-6VNCD4D7.js");
|
|
928
1071
|
const { readLockFile, writeLockFile } = await import("./io-PGTCBSIQ.js");
|
|
929
|
-
const { setDiagnosticSink } = await import("./diagnostics-
|
|
930
|
-
const { planRouteManifest } = await import("./routes-manifest-
|
|
931
|
-
const { renderManifestFile, reportModuleFailures } = await import("./routes-manifest-file-
|
|
932
|
-
const { isEnabled } = await import("./toolchain-modules-
|
|
1072
|
+
const { setDiagnosticSink } = await import("./diagnostics-FNVNRYMB.js");
|
|
1073
|
+
const { planRouteManifest } = await import("./routes-manifest-RIZGSOZC.js");
|
|
1074
|
+
const { renderManifestFile, reportModuleFailures } = await import("./routes-manifest-file-UHVVL2YB.js");
|
|
1075
|
+
const { isEnabled } = await import("./toolchain-modules-K46KYJ4G.js");
|
|
933
1076
|
const existing = existsSync(lockPath) ? readLockFile(lockPath) : void 0;
|
|
934
1077
|
resetLockOverrides();
|
|
935
1078
|
if (existing !== void 0) seedLockOverrides(existing);
|
|
936
1079
|
const ctx = createLockContext(existing);
|
|
937
|
-
const { envNamesRead } = await import("./guards-
|
|
938
|
-
const { refreshEnvExample } = await import("./env-example-refresh-
|
|
1080
|
+
const { envNamesRead } = await import("./guards-4VPSEOAI.js");
|
|
1081
|
+
const { refreshEnvExample } = await import("./env-example-refresh-6UTTMDOI.js");
|
|
939
1082
|
const def = await loadDefault(join(targetDir, XANO_DIR, "index.ts"));
|
|
940
1083
|
if (!Xano.isXano(def)) return { written, env: declaredEnv };
|
|
941
1084
|
const previousSink = setDiagnosticSink(() => {
|
|
@@ -994,15 +1137,15 @@ async function refuseUnknownProfileFlag(args, targetDir) {
|
|
|
994
1137
|
const name = args.profile ?? (fromEnv ? envRaw : void 0);
|
|
995
1138
|
if (name === void 0) return;
|
|
996
1139
|
if (fromEnv && targetDir !== void 0) {
|
|
997
|
-
const { POINTER_FILE } = await import("./profile-pointer-
|
|
1140
|
+
const { POINTER_FILE } = await import("./profile-pointer-4HJQH5ZR.js");
|
|
998
1141
|
if (existsSync(join(targetDir, POINTER_FILE))) return;
|
|
999
1142
|
}
|
|
1000
|
-
const { readCredentialFile, resolveAuthFilePath, profileNames, loginHint } = await import("./store-
|
|
1143
|
+
const { readCredentialFile, resolveAuthFilePath, profileNames, loginHint } = await import("./store-YFNDD6GZ.js");
|
|
1001
1144
|
const path = resolveAuthFilePath(args, "read");
|
|
1002
1145
|
const file = readCredentialFile(path);
|
|
1003
1146
|
const stored = file === null ? [] : profileNames(file);
|
|
1004
1147
|
if (stored.includes(name)) return;
|
|
1005
|
-
const { ProfileNotFoundError } = await import("./token-
|
|
1148
|
+
const { ProfileNotFoundError } = await import("./token-3IPTVEEW.js");
|
|
1006
1149
|
const have = stored.length === 0 ? "Nothing is signed in on this machine." : `Stored profiles: ${quotedNames(stored)}.`;
|
|
1007
1150
|
throw new ProfileNotFoundError(
|
|
1008
1151
|
`No credential profile "${name}" in ${path} (from ${fromEnv ? `$${ENV_PROFILE}` : "--profile"}), so there is nothing to pin this project to. ${have} Run ${loginHint(name)} to add it, or name a stored one${fromEnv ? ` (or unset ${ENV_PROFILE})` : ""}.`,
|
|
@@ -1011,13 +1154,22 @@ async function refuseUnknownProfileFlag(args, targetDir) {
|
|
|
1011
1154
|
);
|
|
1012
1155
|
}
|
|
1013
1156
|
async function envCredentialSet() {
|
|
1014
|
-
const { envMetaCredentialVarsSet } = await import("./token-
|
|
1157
|
+
const { envMetaCredentialVarsSet } = await import("./token-3IPTVEEW.js");
|
|
1015
1158
|
return envMetaCredentialVarsSet().length > 0;
|
|
1016
1159
|
}
|
|
1017
1160
|
function loginNextStep(pin, projectDir) {
|
|
1018
1161
|
return pin.signedIn ? "" : ` ${projectCli(projectDir)} login # authenticate with Xano
|
|
1019
1162
|
`;
|
|
1020
1163
|
}
|
|
1164
|
+
function ephemeralNextStep(frontend) {
|
|
1165
|
+
return frontend ? ` npm run xano:deploy:ephemeral # build the frontend, then deploy \u2192 live ephemeral URL` : ` npm run xano:deploy:ephemeral # deploy the backend \u2192 live ephemeral URL`;
|
|
1166
|
+
}
|
|
1167
|
+
function deployNextCommand(cdArg, install, manager) {
|
|
1168
|
+
return (cdArg === null ? "" : `cd ${shellWord(cdArg)} && `) + (install === null ? "" : `${install} && `) + `${manager} run xano:deploy`;
|
|
1169
|
+
}
|
|
1170
|
+
function runFiles(...groups) {
|
|
1171
|
+
return [...new Set(groups.flat())].sort();
|
|
1172
|
+
}
|
|
1021
1173
|
function projectCli(projectDir) {
|
|
1022
1174
|
const prefix = cliPrefixAt(projectDir);
|
|
1023
1175
|
return prefix === "xanosdk" || prefix === "npx @xano/sdk" ? "npx xanosdk" : prefix;
|
|
@@ -1026,8 +1178,8 @@ function runFromHere(text, targetDir) {
|
|
|
1026
1178
|
return text.replace(/`npx xanosdk /g, `\`${inProject(targetDir)}xanosdk `);
|
|
1027
1179
|
}
|
|
1028
1180
|
async function planProfilePin(args, targetDir, opts = {}) {
|
|
1029
|
-
const { POINTER_FILE, readPointerFile } = await import("./profile-pointer-
|
|
1030
|
-
const { readCredentialFile, resolveAuthFilePath, profileNames, loginHint } = await import("./store-
|
|
1181
|
+
const { POINTER_FILE, readPointerFile } = await import("./profile-pointer-4HJQH5ZR.js");
|
|
1182
|
+
const { readCredentialFile, resolveAuthFilePath, profileNames, loginHint } = await import("./store-YFNDD6GZ.js");
|
|
1031
1183
|
const credentialPath = resolveAuthFilePath(args, "read");
|
|
1032
1184
|
const file = readCredentialFile(credentialPath);
|
|
1033
1185
|
const signedIn = file !== null && profileNames(file).length > 0 || await envCredentialSet();
|
|
@@ -1057,7 +1209,7 @@ async function planProfilePin(args, targetDir, opts = {}) {
|
|
|
1057
1209
|
};
|
|
1058
1210
|
}
|
|
1059
1211
|
if (opts.credentialRead === true) {
|
|
1060
|
-
const { environmentCredentialVars } = await import("./token-
|
|
1212
|
+
const { environmentCredentialVars } = await import("./token-3IPTVEEW.js");
|
|
1061
1213
|
const env = environmentCredentialVars();
|
|
1062
1214
|
if (env.complete) {
|
|
1063
1215
|
return {
|
|
@@ -1080,7 +1232,7 @@ async function planProfilePin(args, targetDir, opts = {}) {
|
|
|
1080
1232
|
});
|
|
1081
1233
|
const stored = file === null ? [] : profileNames(file);
|
|
1082
1234
|
if (!stored.includes(selection.name)) {
|
|
1083
|
-
const env = stored.length === 0 ? (await import("./token-
|
|
1235
|
+
const env = stored.length === 0 ? (await import("./token-3IPTVEEW.js")).environmentCredentialVars() : void 0;
|
|
1084
1236
|
const storeEnv = env?.complete === true ? await storeEnvCredentialCommand(credentialPath, targetDir) : "";
|
|
1085
1237
|
return {
|
|
1086
1238
|
name: null,
|
|
@@ -1104,7 +1256,7 @@ async function planProfilePin(args, targetDir, opts = {}) {
|
|
|
1104
1256
|
};
|
|
1105
1257
|
}
|
|
1106
1258
|
}
|
|
1107
|
-
const { writePointerFile } = await import("./profile-pointer-
|
|
1259
|
+
const { writePointerFile } = await import("./profile-pointer-4HJQH5ZR.js");
|
|
1108
1260
|
return {
|
|
1109
1261
|
name: selection.name,
|
|
1110
1262
|
signedIn,
|
|
@@ -1121,7 +1273,7 @@ async function envAddressesElsewhere(file, name, credentialPath) {
|
|
|
1121
1273
|
const instance = readEnvVar("XANO_INSTANCE_URL")?.trim();
|
|
1122
1274
|
const workspace = readEnvVar("XANO_WORKSPACE_ID")?.trim();
|
|
1123
1275
|
if (instance === void 0 || workspace === void 0 || readEnvVar("XANO_META_TOKEN") === void 0) return null;
|
|
1124
|
-
const { readProfile, sameOriginAs } = await import("./store-
|
|
1276
|
+
const { readProfile, sameOriginAs } = await import("./store-YFNDD6GZ.js");
|
|
1125
1277
|
let record;
|
|
1126
1278
|
try {
|
|
1127
1279
|
record = readProfile(file, name, credentialPath);
|
|
@@ -1137,7 +1289,7 @@ async function envAddressesElsewhere(file, name, credentialPath) {
|
|
|
1137
1289
|
};
|
|
1138
1290
|
}
|
|
1139
1291
|
async function storeEnvCredentialCommand(credentialPath, targetDir) {
|
|
1140
|
-
const { credentialFileFlag, profileAddCommand } = await import("./store-
|
|
1292
|
+
const { credentialFileFlag, profileAddCommand } = await import("./store-YFNDD6GZ.js");
|
|
1141
1293
|
const { DEFAULT_PROFILE } = await import("./profile-select-45G5VPJK.js");
|
|
1142
1294
|
const instance = readEnvVar("XANO_INSTANCE_URL");
|
|
1143
1295
|
const workspaceId = readEnvVar("XANO_WORKSPACE_ID");
|
|
@@ -1151,6 +1303,7 @@ function sdkResolves(dir) {
|
|
|
1151
1303
|
|
|
1152
1304
|
export {
|
|
1153
1305
|
resolveThemeChoice,
|
|
1306
|
+
resolveFrameworkValue,
|
|
1154
1307
|
resolveFrontendPreset,
|
|
1155
1308
|
projectInstallOf,
|
|
1156
1309
|
workflowPlacementNote,
|
|
@@ -1159,10 +1312,17 @@ export {
|
|
|
1159
1312
|
templateVarsFor,
|
|
1160
1313
|
sanitizeAppName,
|
|
1161
1314
|
projectShellFiles,
|
|
1315
|
+
backendShellFiles,
|
|
1162
1316
|
resolveFromSource,
|
|
1317
|
+
refuseFrontendOnlyFlags,
|
|
1318
|
+
resolveInitFrontend,
|
|
1319
|
+
settleClashes,
|
|
1163
1320
|
runInitCommand,
|
|
1164
1321
|
loginNextStep,
|
|
1322
|
+
ephemeralNextStep,
|
|
1323
|
+
deployNextCommand,
|
|
1324
|
+
runFiles,
|
|
1165
1325
|
projectCli,
|
|
1166
1326
|
planProfilePin
|
|
1167
1327
|
};
|
|
1168
|
-
//# sourceMappingURL=chunk-
|
|
1328
|
+
//# sourceMappingURL=chunk-V7KMIEMF.js.map
|