@cimplify/cli 0.2.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/README.md +69 -0
- package/dist/add-ZJQJZJEF.mjs +125 -0
- package/dist/chunk-4YSOZ6LY.mjs +61 -0
- package/dist/chunk-4ZVTPMUZ.mjs +155 -0
- package/dist/chunk-5XH72JMJ.mjs +211 -0
- package/dist/chunk-D7D75ONX.mjs +36 -0
- package/dist/chunk-JJYWETGA.mjs +127 -0
- package/dist/chunk-L6474RPL.mjs +37 -0
- package/dist/chunk-MQMNWLMU.mjs +48 -0
- package/dist/chunk-NZ4RG62Z.mjs +141 -0
- package/dist/chunk-TAMGCHIL.mjs +81 -0
- package/dist/chunk-XSWWWO6H.mjs +3779 -0
- package/dist/deploy-WCZOGMED.mjs +206 -0
- package/dist/dev-4HKIXWXX.mjs +130 -0
- package/dist/dispatcher.mjs +321 -0
- package/dist/domains-3RJ4T5IX.mjs +387 -0
- package/dist/env-LBYBCBWV.mjs +268 -0
- package/dist/link-SEJNW7JS.mjs +45 -0
- package/dist/list-D4JC2VWY.mjs +48 -0
- package/dist/login-MRYWLQRY.mjs +276 -0
- package/dist/logout-ZFZLSJ32.mjs +16 -0
- package/dist/logs-LK7CMBCE.mjs +95 -0
- package/dist/projects-QJUGOCQZ.mjs +164 -0
- package/dist/repo-MV22OHON.mjs +8 -0
- package/dist/rollback-XO7RIG2A.mjs +107 -0
- package/dist/status-7CMVLD54.mjs +127 -0
- package/dist/unlink-5ABCT7B6.mjs +16 -0
- package/dist/whoami-INHDUHWA.mjs +24 -0
- package/package.json +44 -0
- package/templates/storefront-bakery/.claude/skills/cimplify-storefront/SKILL.md +145 -0
- package/templates/storefront-bakery/.cursor/rules/cimplify-storefront.mdc +25 -0
- package/templates/storefront-bakery/.env.example +16 -0
- package/templates/storefront-bakery/AGENTS.md +120 -0
- package/templates/storefront-bakery/CLAUDE.md +22 -0
- package/templates/storefront-bakery/README.md +73 -0
- package/templates/storefront-bakery/__tests__/brand.test.ts +4 -0
- package/templates/storefront-bakery/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-bakery/__tests__/contract.test.ts +4 -0
- package/templates/storefront-bakery/app/about/page.tsx +38 -0
- package/templates/storefront-bakery/app/accessibility/page.tsx +11 -0
- package/templates/storefront-bakery/app/account/addresses/page.tsx +21 -0
- package/templates/storefront-bakery/app/account/orders/page.tsx +21 -0
- package/templates/storefront-bakery/app/account/page.tsx +22 -0
- package/templates/storefront-bakery/app/account/settings/page.tsx +21 -0
- package/templates/storefront-bakery/app/cart/page.tsx +9 -0
- package/templates/storefront-bakery/app/categories/[slug]/listing-client.tsx +19 -0
- package/templates/storefront-bakery/app/categories/[slug]/page.tsx +118 -0
- package/templates/storefront-bakery/app/checkout/page.tsx +17 -0
- package/templates/storefront-bakery/app/collections/[slug]/listing-client.tsx +20 -0
- package/templates/storefront-bakery/app/collections/[slug]/page.tsx +118 -0
- package/templates/storefront-bakery/app/contact/contact-form.tsx +109 -0
- package/templates/storefront-bakery/app/contact/page.tsx +54 -0
- package/templates/storefront-bakery/app/error.tsx +60 -0
- package/templates/storefront-bakery/app/faq/page.tsx +46 -0
- package/templates/storefront-bakery/app/globals.css +47 -0
- package/templates/storefront-bakery/app/layout.tsx +82 -0
- package/templates/storefront-bakery/app/llms.txt/route.ts +94 -0
- package/templates/storefront-bakery/app/login/page.tsx +17 -0
- package/templates/storefront-bakery/app/not-found.tsx +39 -0
- package/templates/storefront-bakery/app/opensearch.xml/route.ts +37 -0
- package/templates/storefront-bakery/app/orders/[id]/page.tsx +21 -0
- package/templates/storefront-bakery/app/page.tsx +97 -0
- package/templates/storefront-bakery/app/privacy/page.tsx +44 -0
- package/templates/storefront-bakery/app/returns/page.tsx +11 -0
- package/templates/storefront-bakery/app/robots.ts +18 -0
- package/templates/storefront-bakery/app/search/page.tsx +38 -0
- package/templates/storefront-bakery/app/search/search-client.tsx +7 -0
- package/templates/storefront-bakery/app/shipping/page.tsx +16 -0
- package/templates/storefront-bakery/app/shop/page.tsx +31 -0
- package/templates/storefront-bakery/app/shop/shop-client.tsx +27 -0
- package/templates/storefront-bakery/app/signup/page.tsx +17 -0
- package/templates/storefront-bakery/app/sitemap-page/page.tsx +167 -0
- package/templates/storefront-bakery/app/sitemap.ts +62 -0
- package/templates/storefront-bakery/app/terms/page.tsx +44 -0
- package/templates/storefront-bakery/app/track-order/page.tsx +24 -0
- package/templates/storefront-bakery/app/track-order/track-order-form.tsx +69 -0
- package/templates/storefront-bakery/components/account-iframe.tsx +13 -0
- package/templates/storefront-bakery/components/cart-drawer.tsx +14 -0
- package/templates/storefront-bakery/components/cart-pill.tsx +36 -0
- package/templates/storefront-bakery/components/category-grid.tsx +28 -0
- package/templates/storefront-bakery/components/collection-strip.tsx +45 -0
- package/templates/storefront-bakery/components/footer.tsx +148 -0
- package/templates/storefront-bakery/components/header.tsx +43 -0
- package/templates/storefront-bakery/components/hero.tsx +25 -0
- package/templates/storefront-bakery/components/nav-link.tsx +20 -0
- package/templates/storefront-bakery/components/policy-page.tsx +49 -0
- package/templates/storefront-bakery/components/product-modal.tsx +104 -0
- package/templates/storefront-bakery/components/providers.tsx +35 -0
- package/templates/storefront-bakery/components/store-product-card.tsx +87 -0
- package/templates/storefront-bakery/lib/brand.ts +570 -0
- package/templates/storefront-bakery/lib/cart.ts +12 -0
- package/templates/storefront-bakery/next.config.ts +42 -0
- package/templates/storefront-bakery/package.json +35 -0
- package/templates/storefront-bakery/postcss.config.mjs +7 -0
- package/templates/storefront-bakery/tsconfig.json +23 -0
- package/templates/storefront-bakery/vitest.config.ts +9 -0
- package/templates/storefront-fashion/.claude/skills/cimplify-storefront/SKILL.md +145 -0
- package/templates/storefront-fashion/.cursor/rules/cimplify-storefront.mdc +25 -0
- package/templates/storefront-fashion/.env.example +16 -0
- package/templates/storefront-fashion/AGENTS.md +126 -0
- package/templates/storefront-fashion/CLAUDE.md +22 -0
- package/templates/storefront-fashion/README.md +77 -0
- package/templates/storefront-fashion/__tests__/brand.test.ts +4 -0
- package/templates/storefront-fashion/__tests__/cart-flow.test.ts +55 -0
- package/templates/storefront-fashion/__tests__/contract.test.ts +4 -0
- package/templates/storefront-fashion/app/about/page.tsx +41 -0
- package/templates/storefront-fashion/app/accessibility/page.tsx +11 -0
- package/templates/storefront-fashion/app/account/addresses/page.tsx +21 -0
- package/templates/storefront-fashion/app/account/orders/page.tsx +21 -0
- package/templates/storefront-fashion/app/account/page.tsx +22 -0
- package/templates/storefront-fashion/app/account/settings/page.tsx +21 -0
- package/templates/storefront-fashion/app/cart/page.tsx +9 -0
- package/templates/storefront-fashion/app/categories/[slug]/listing-client.tsx +19 -0
- package/templates/storefront-fashion/app/categories/[slug]/page.tsx +130 -0
- package/templates/storefront-fashion/app/checkout/page.tsx +17 -0
- package/templates/storefront-fashion/app/collections/[slug]/listing-client.tsx +20 -0
- package/templates/storefront-fashion/app/collections/[slug]/page.tsx +130 -0
- package/templates/storefront-fashion/app/contact/contact-form.tsx +109 -0
- package/templates/storefront-fashion/app/contact/page.tsx +54 -0
- package/templates/storefront-fashion/app/error.tsx +61 -0
- package/templates/storefront-fashion/app/faq/page.tsx +46 -0
- package/templates/storefront-fashion/app/globals.css +46 -0
- package/templates/storefront-fashion/app/layout.tsx +78 -0
- package/templates/storefront-fashion/app/llms.txt/route.ts +94 -0
- package/templates/storefront-fashion/app/login/page.tsx +17 -0
- package/templates/storefront-fashion/app/lookbook/page.tsx +132 -0
- package/templates/storefront-fashion/app/not-found.tsx +39 -0
- package/templates/storefront-fashion/app/opensearch.xml/route.ts +37 -0
- package/templates/storefront-fashion/app/orders/[id]/page.tsx +24 -0
- package/templates/storefront-fashion/app/page.tsx +183 -0
- package/templates/storefront-fashion/app/privacy/page.tsx +44 -0
- package/templates/storefront-fashion/app/products/[slug]/page.tsx +165 -0
- package/templates/storefront-fashion/app/products/[slug]/product-detail.tsx +70 -0
- package/templates/storefront-fashion/app/returns/page.tsx +11 -0
- package/templates/storefront-fashion/app/robots.ts +18 -0
- package/templates/storefront-fashion/app/search/page.tsx +38 -0
- package/templates/storefront-fashion/app/search/search-client.tsx +7 -0
- package/templates/storefront-fashion/app/shipping/page.tsx +16 -0
- package/templates/storefront-fashion/app/shop/page.tsx +63 -0
- package/templates/storefront-fashion/app/shop/shop-client.tsx +32 -0
- package/templates/storefront-fashion/app/signup/page.tsx +17 -0
- package/templates/storefront-fashion/app/sitemap-page/page.tsx +167 -0
- package/templates/storefront-fashion/app/sitemap.ts +59 -0
- package/templates/storefront-fashion/app/size-guide/page.tsx +155 -0
- package/templates/storefront-fashion/app/terms/page.tsx +44 -0
- package/templates/storefront-fashion/app/track-order/page.tsx +24 -0
- package/templates/storefront-fashion/app/track-order/track-order-form.tsx +69 -0
- package/templates/storefront-fashion/components/account-iframe.tsx +13 -0
- package/templates/storefront-fashion/components/brand-marquee.tsx +27 -0
- package/templates/storefront-fashion/components/cart-drawer.tsx +14 -0
- package/templates/storefront-fashion/components/cart-pill.tsx +36 -0
- package/templates/storefront-fashion/components/category-grid.tsx +28 -0
- package/templates/storefront-fashion/components/category-tiles.tsx +104 -0
- package/templates/storefront-fashion/components/collection-strip.tsx +45 -0
- package/templates/storefront-fashion/components/feature-hero.tsx +82 -0
- package/templates/storefront-fashion/components/footer.tsx +153 -0
- package/templates/storefront-fashion/components/header.tsx +43 -0
- package/templates/storefront-fashion/components/hero.tsx +28 -0
- package/templates/storefront-fashion/components/nav-link.tsx +20 -0
- package/templates/storefront-fashion/components/newsletter.tsx +50 -0
- package/templates/storefront-fashion/components/policy-page.tsx +49 -0
- package/templates/storefront-fashion/components/promo-banner.tsx +41 -0
- package/templates/storefront-fashion/components/providers.tsx +35 -0
- package/templates/storefront-fashion/components/section-heading.tsx +37 -0
- package/templates/storefront-fashion/components/store-product-card.tsx +87 -0
- package/templates/storefront-fashion/components/trade-in-cta.tsx +54 -0
- package/templates/storefront-fashion/components/trust-bar.tsx +66 -0
- package/templates/storefront-fashion/e2e/visual.spec.ts +52 -0
- package/templates/storefront-fashion/lib/brand.ts +518 -0
- package/templates/storefront-fashion/lib/cart.ts +12 -0
- package/templates/storefront-fashion/next.config.ts +42 -0
- package/templates/storefront-fashion/package.json +38 -0
- package/templates/storefront-fashion/playwright.config.ts +48 -0
- package/templates/storefront-fashion/postcss.config.mjs +7 -0
- package/templates/storefront-fashion/tsconfig.json +23 -0
- package/templates/storefront-fashion/vitest.config.ts +9 -0
- package/templates/storefront-grocery/.claude/skills/cimplify-storefront/SKILL.md +145 -0
- package/templates/storefront-grocery/.cursor/rules/cimplify-storefront.mdc +25 -0
- package/templates/storefront-grocery/.env.example +16 -0
- package/templates/storefront-grocery/AGENTS.md +96 -0
- package/templates/storefront-grocery/CLAUDE.md +22 -0
- package/templates/storefront-grocery/README.md +73 -0
- package/templates/storefront-grocery/__tests__/brand.test.ts +4 -0
- package/templates/storefront-grocery/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-grocery/__tests__/contract.test.ts +4 -0
- package/templates/storefront-grocery/app/about/page.tsx +38 -0
- package/templates/storefront-grocery/app/accessibility/page.tsx +11 -0
- package/templates/storefront-grocery/app/account/addresses/page.tsx +21 -0
- package/templates/storefront-grocery/app/account/orders/page.tsx +21 -0
- package/templates/storefront-grocery/app/account/page.tsx +22 -0
- package/templates/storefront-grocery/app/account/settings/page.tsx +21 -0
- package/templates/storefront-grocery/app/cart/page.tsx +9 -0
- package/templates/storefront-grocery/app/categories/[slug]/listing-client.tsx +19 -0
- package/templates/storefront-grocery/app/categories/[slug]/page.tsx +118 -0
- package/templates/storefront-grocery/app/checkout/page.tsx +17 -0
- package/templates/storefront-grocery/app/collections/[slug]/listing-client.tsx +20 -0
- package/templates/storefront-grocery/app/collections/[slug]/page.tsx +118 -0
- package/templates/storefront-grocery/app/contact/contact-form.tsx +109 -0
- package/templates/storefront-grocery/app/contact/page.tsx +54 -0
- package/templates/storefront-grocery/app/error.tsx +60 -0
- package/templates/storefront-grocery/app/faq/page.tsx +46 -0
- package/templates/storefront-grocery/app/globals.css +45 -0
- package/templates/storefront-grocery/app/layout.tsx +77 -0
- package/templates/storefront-grocery/app/llms.txt/route.ts +94 -0
- package/templates/storefront-grocery/app/login/page.tsx +17 -0
- package/templates/storefront-grocery/app/not-found.tsx +39 -0
- package/templates/storefront-grocery/app/opensearch.xml/route.ts +37 -0
- package/templates/storefront-grocery/app/orders/[id]/page.tsx +21 -0
- package/templates/storefront-grocery/app/page.tsx +97 -0
- package/templates/storefront-grocery/app/privacy/page.tsx +44 -0
- package/templates/storefront-grocery/app/returns/page.tsx +11 -0
- package/templates/storefront-grocery/app/robots.ts +18 -0
- package/templates/storefront-grocery/app/search/page.tsx +38 -0
- package/templates/storefront-grocery/app/search/search-client.tsx +7 -0
- package/templates/storefront-grocery/app/shipping/page.tsx +16 -0
- package/templates/storefront-grocery/app/shop/page.tsx +31 -0
- package/templates/storefront-grocery/app/shop/shop-client.tsx +27 -0
- package/templates/storefront-grocery/app/signup/page.tsx +17 -0
- package/templates/storefront-grocery/app/sitemap-page/page.tsx +167 -0
- package/templates/storefront-grocery/app/sitemap.ts +62 -0
- package/templates/storefront-grocery/app/terms/page.tsx +44 -0
- package/templates/storefront-grocery/app/track-order/page.tsx +24 -0
- package/templates/storefront-grocery/app/track-order/track-order-form.tsx +69 -0
- package/templates/storefront-grocery/components/account-iframe.tsx +13 -0
- package/templates/storefront-grocery/components/cart-drawer.tsx +14 -0
- package/templates/storefront-grocery/components/cart-pill.tsx +36 -0
- package/templates/storefront-grocery/components/category-grid.tsx +28 -0
- package/templates/storefront-grocery/components/collection-strip.tsx +45 -0
- package/templates/storefront-grocery/components/footer.tsx +148 -0
- package/templates/storefront-grocery/components/header.tsx +43 -0
- package/templates/storefront-grocery/components/hero.tsx +25 -0
- package/templates/storefront-grocery/components/nav-link.tsx +20 -0
- package/templates/storefront-grocery/components/policy-page.tsx +49 -0
- package/templates/storefront-grocery/components/product-modal.tsx +104 -0
- package/templates/storefront-grocery/components/providers.tsx +35 -0
- package/templates/storefront-grocery/components/store-product-card.tsx +87 -0
- package/templates/storefront-grocery/lib/brand.ts +375 -0
- package/templates/storefront-grocery/lib/cart.ts +12 -0
- package/templates/storefront-grocery/next.config.ts +42 -0
- package/templates/storefront-grocery/package.json +35 -0
- package/templates/storefront-grocery/postcss.config.mjs +7 -0
- package/templates/storefront-grocery/tsconfig.json +23 -0
- package/templates/storefront-grocery/vitest.config.ts +9 -0
- package/templates/storefront-restaurant/.claude/skills/cimplify-storefront/SKILL.md +145 -0
- package/templates/storefront-restaurant/.cursor/rules/cimplify-storefront.mdc +25 -0
- package/templates/storefront-restaurant/.env.example +16 -0
- package/templates/storefront-restaurant/AGENTS.md +102 -0
- package/templates/storefront-restaurant/CLAUDE.md +22 -0
- package/templates/storefront-restaurant/README.md +73 -0
- package/templates/storefront-restaurant/__tests__/brand.test.ts +4 -0
- package/templates/storefront-restaurant/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-restaurant/__tests__/contract.test.ts +4 -0
- package/templates/storefront-restaurant/app/about/page.tsx +38 -0
- package/templates/storefront-restaurant/app/accessibility/page.tsx +11 -0
- package/templates/storefront-restaurant/app/account/addresses/page.tsx +21 -0
- package/templates/storefront-restaurant/app/account/orders/page.tsx +21 -0
- package/templates/storefront-restaurant/app/account/page.tsx +22 -0
- package/templates/storefront-restaurant/app/account/settings/page.tsx +21 -0
- package/templates/storefront-restaurant/app/cart/page.tsx +9 -0
- package/templates/storefront-restaurant/app/categories/[slug]/listing-client.tsx +19 -0
- package/templates/storefront-restaurant/app/categories/[slug]/page.tsx +118 -0
- package/templates/storefront-restaurant/app/checkout/page.tsx +17 -0
- package/templates/storefront-restaurant/app/collections/[slug]/listing-client.tsx +20 -0
- package/templates/storefront-restaurant/app/collections/[slug]/page.tsx +118 -0
- package/templates/storefront-restaurant/app/contact/contact-form.tsx +109 -0
- package/templates/storefront-restaurant/app/contact/page.tsx +54 -0
- package/templates/storefront-restaurant/app/error.tsx +60 -0
- package/templates/storefront-restaurant/app/faq/page.tsx +46 -0
- package/templates/storefront-restaurant/app/globals.css +44 -0
- package/templates/storefront-restaurant/app/layout.tsx +82 -0
- package/templates/storefront-restaurant/app/llms.txt/route.ts +94 -0
- package/templates/storefront-restaurant/app/login/page.tsx +17 -0
- package/templates/storefront-restaurant/app/not-found.tsx +39 -0
- package/templates/storefront-restaurant/app/opensearch.xml/route.ts +37 -0
- package/templates/storefront-restaurant/app/orders/[id]/page.tsx +21 -0
- package/templates/storefront-restaurant/app/page.tsx +97 -0
- package/templates/storefront-restaurant/app/privacy/page.tsx +44 -0
- package/templates/storefront-restaurant/app/reservations/page.tsx +66 -0
- package/templates/storefront-restaurant/app/reservations/reservations-client.tsx +234 -0
- package/templates/storefront-restaurant/app/returns/page.tsx +11 -0
- package/templates/storefront-restaurant/app/robots.ts +18 -0
- package/templates/storefront-restaurant/app/search/page.tsx +38 -0
- package/templates/storefront-restaurant/app/search/search-client.tsx +7 -0
- package/templates/storefront-restaurant/app/shipping/page.tsx +16 -0
- package/templates/storefront-restaurant/app/shop/page.tsx +31 -0
- package/templates/storefront-restaurant/app/shop/shop-client.tsx +27 -0
- package/templates/storefront-restaurant/app/signup/page.tsx +17 -0
- package/templates/storefront-restaurant/app/sitemap-page/page.tsx +167 -0
- package/templates/storefront-restaurant/app/sitemap.ts +62 -0
- package/templates/storefront-restaurant/app/terms/page.tsx +44 -0
- package/templates/storefront-restaurant/app/track-order/page.tsx +24 -0
- package/templates/storefront-restaurant/app/track-order/track-order-form.tsx +69 -0
- package/templates/storefront-restaurant/components/account-iframe.tsx +13 -0
- package/templates/storefront-restaurant/components/cart-drawer.tsx +14 -0
- package/templates/storefront-restaurant/components/cart-pill.tsx +36 -0
- package/templates/storefront-restaurant/components/category-grid.tsx +28 -0
- package/templates/storefront-restaurant/components/collection-strip.tsx +45 -0
- package/templates/storefront-restaurant/components/footer.tsx +148 -0
- package/templates/storefront-restaurant/components/header.tsx +43 -0
- package/templates/storefront-restaurant/components/hero.tsx +25 -0
- package/templates/storefront-restaurant/components/nav-link.tsx +20 -0
- package/templates/storefront-restaurant/components/policy-page.tsx +49 -0
- package/templates/storefront-restaurant/components/product-modal.tsx +104 -0
- package/templates/storefront-restaurant/components/providers.tsx +35 -0
- package/templates/storefront-restaurant/components/store-product-card.tsx +87 -0
- package/templates/storefront-restaurant/lib/brand.ts +377 -0
- package/templates/storefront-restaurant/lib/cart.ts +12 -0
- package/templates/storefront-restaurant/next.config.ts +42 -0
- package/templates/storefront-restaurant/package.json +35 -0
- package/templates/storefront-restaurant/postcss.config.mjs +7 -0
- package/templates/storefront-restaurant/tsconfig.json +23 -0
- package/templates/storefront-restaurant/vitest.config.ts +9 -0
- package/templates/storefront-retail/.claude/skills/cimplify-storefront/SKILL.md +145 -0
- package/templates/storefront-retail/.cursor/rules/cimplify-storefront.mdc +25 -0
- package/templates/storefront-retail/.env.example +16 -0
- package/templates/storefront-retail/AGENTS.md +117 -0
- package/templates/storefront-retail/CLAUDE.md +22 -0
- package/templates/storefront-retail/README.md +77 -0
- package/templates/storefront-retail/__tests__/brand.test.ts +4 -0
- package/templates/storefront-retail/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-retail/__tests__/contract.test.ts +4 -0
- package/templates/storefront-retail/app/about/page.tsx +41 -0
- package/templates/storefront-retail/app/accessibility/page.tsx +11 -0
- package/templates/storefront-retail/app/account/addresses/page.tsx +21 -0
- package/templates/storefront-retail/app/account/orders/page.tsx +21 -0
- package/templates/storefront-retail/app/account/page.tsx +22 -0
- package/templates/storefront-retail/app/account/settings/page.tsx +21 -0
- package/templates/storefront-retail/app/cart/page.tsx +9 -0
- package/templates/storefront-retail/app/categories/[slug]/listing-client.tsx +19 -0
- package/templates/storefront-retail/app/categories/[slug]/page.tsx +130 -0
- package/templates/storefront-retail/app/checkout/page.tsx +17 -0
- package/templates/storefront-retail/app/collections/[slug]/listing-client.tsx +20 -0
- package/templates/storefront-retail/app/collections/[slug]/page.tsx +130 -0
- package/templates/storefront-retail/app/contact/contact-form.tsx +109 -0
- package/templates/storefront-retail/app/contact/page.tsx +54 -0
- package/templates/storefront-retail/app/error.tsx +61 -0
- package/templates/storefront-retail/app/faq/page.tsx +46 -0
- package/templates/storefront-retail/app/globals.css +47 -0
- package/templates/storefront-retail/app/layout.tsx +77 -0
- package/templates/storefront-retail/app/llms.txt/route.ts +94 -0
- package/templates/storefront-retail/app/login/page.tsx +17 -0
- package/templates/storefront-retail/app/not-found.tsx +39 -0
- package/templates/storefront-retail/app/opensearch.xml/route.ts +37 -0
- package/templates/storefront-retail/app/orders/[id]/page.tsx +24 -0
- package/templates/storefront-retail/app/page.tsx +182 -0
- package/templates/storefront-retail/app/privacy/page.tsx +44 -0
- package/templates/storefront-retail/app/products/[slug]/page.tsx +165 -0
- package/templates/storefront-retail/app/products/[slug]/product-detail.tsx +70 -0
- package/templates/storefront-retail/app/returns/page.tsx +11 -0
- package/templates/storefront-retail/app/robots.ts +18 -0
- package/templates/storefront-retail/app/search/page.tsx +38 -0
- package/templates/storefront-retail/app/search/search-client.tsx +7 -0
- package/templates/storefront-retail/app/shipping/page.tsx +16 -0
- package/templates/storefront-retail/app/shop/page.tsx +63 -0
- package/templates/storefront-retail/app/shop/shop-client.tsx +32 -0
- package/templates/storefront-retail/app/signup/page.tsx +17 -0
- package/templates/storefront-retail/app/sitemap-page/page.tsx +167 -0
- package/templates/storefront-retail/app/sitemap.ts +59 -0
- package/templates/storefront-retail/app/terms/page.tsx +44 -0
- package/templates/storefront-retail/app/track-order/page.tsx +24 -0
- package/templates/storefront-retail/app/track-order/track-order-form.tsx +69 -0
- package/templates/storefront-retail/components/account-iframe.tsx +13 -0
- package/templates/storefront-retail/components/brand-marquee.tsx +27 -0
- package/templates/storefront-retail/components/cart-drawer.tsx +14 -0
- package/templates/storefront-retail/components/cart-pill.tsx +36 -0
- package/templates/storefront-retail/components/category-grid.tsx +28 -0
- package/templates/storefront-retail/components/category-tiles.tsx +104 -0
- package/templates/storefront-retail/components/collection-strip.tsx +45 -0
- package/templates/storefront-retail/components/feature-hero.tsx +84 -0
- package/templates/storefront-retail/components/footer.tsx +153 -0
- package/templates/storefront-retail/components/header.tsx +45 -0
- package/templates/storefront-retail/components/hero.tsx +28 -0
- package/templates/storefront-retail/components/nav-link.tsx +20 -0
- package/templates/storefront-retail/components/newsletter.tsx +50 -0
- package/templates/storefront-retail/components/policy-page.tsx +49 -0
- package/templates/storefront-retail/components/promo-banner.tsx +41 -0
- package/templates/storefront-retail/components/providers.tsx +35 -0
- package/templates/storefront-retail/components/section-heading.tsx +37 -0
- package/templates/storefront-retail/components/store-product-card.tsx +87 -0
- package/templates/storefront-retail/components/trade-in-cta.tsx +54 -0
- package/templates/storefront-retail/components/trust-bar.tsx +66 -0
- package/templates/storefront-retail/lib/brand.ts +664 -0
- package/templates/storefront-retail/lib/cart.ts +12 -0
- package/templates/storefront-retail/next.config.ts +42 -0
- package/templates/storefront-retail/package.json +35 -0
- package/templates/storefront-retail/postcss.config.mjs +7 -0
- package/templates/storefront-retail/tsconfig.json +23 -0
- package/templates/storefront-retail/vitest.config.ts +9 -0
- package/templates/storefront-services/.claude/skills/cimplify-storefront/SKILL.md +145 -0
- package/templates/storefront-services/.cursor/rules/cimplify-storefront.mdc +25 -0
- package/templates/storefront-services/.env.example +16 -0
- package/templates/storefront-services/AGENTS.md +101 -0
- package/templates/storefront-services/CLAUDE.md +22 -0
- package/templates/storefront-services/README.md +73 -0
- package/templates/storefront-services/__tests__/brand.test.ts +4 -0
- package/templates/storefront-services/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-services/__tests__/contract.test.ts +4 -0
- package/templates/storefront-services/app/about/page.tsx +38 -0
- package/templates/storefront-services/app/accessibility/page.tsx +11 -0
- package/templates/storefront-services/app/account/addresses/page.tsx +21 -0
- package/templates/storefront-services/app/account/orders/page.tsx +21 -0
- package/templates/storefront-services/app/account/page.tsx +22 -0
- package/templates/storefront-services/app/account/settings/page.tsx +21 -0
- package/templates/storefront-services/app/book/book-client.tsx +195 -0
- package/templates/storefront-services/app/book/page.tsx +65 -0
- package/templates/storefront-services/app/cart/page.tsx +9 -0
- package/templates/storefront-services/app/categories/[slug]/listing-client.tsx +19 -0
- package/templates/storefront-services/app/categories/[slug]/page.tsx +118 -0
- package/templates/storefront-services/app/checkout/page.tsx +17 -0
- package/templates/storefront-services/app/collections/[slug]/listing-client.tsx +20 -0
- package/templates/storefront-services/app/collections/[slug]/page.tsx +118 -0
- package/templates/storefront-services/app/contact/contact-form.tsx +109 -0
- package/templates/storefront-services/app/contact/page.tsx +54 -0
- package/templates/storefront-services/app/error.tsx +60 -0
- package/templates/storefront-services/app/faq/page.tsx +46 -0
- package/templates/storefront-services/app/globals.css +45 -0
- package/templates/storefront-services/app/layout.tsx +82 -0
- package/templates/storefront-services/app/llms.txt/route.ts +94 -0
- package/templates/storefront-services/app/login/page.tsx +17 -0
- package/templates/storefront-services/app/not-found.tsx +39 -0
- package/templates/storefront-services/app/opensearch.xml/route.ts +37 -0
- package/templates/storefront-services/app/orders/[id]/page.tsx +21 -0
- package/templates/storefront-services/app/page.tsx +97 -0
- package/templates/storefront-services/app/privacy/page.tsx +44 -0
- package/templates/storefront-services/app/returns/page.tsx +11 -0
- package/templates/storefront-services/app/robots.ts +18 -0
- package/templates/storefront-services/app/search/page.tsx +38 -0
- package/templates/storefront-services/app/search/search-client.tsx +7 -0
- package/templates/storefront-services/app/shipping/page.tsx +16 -0
- package/templates/storefront-services/app/shop/page.tsx +31 -0
- package/templates/storefront-services/app/shop/shop-client.tsx +27 -0
- package/templates/storefront-services/app/signup/page.tsx +17 -0
- package/templates/storefront-services/app/sitemap-page/page.tsx +167 -0
- package/templates/storefront-services/app/sitemap.ts +62 -0
- package/templates/storefront-services/app/terms/page.tsx +44 -0
- package/templates/storefront-services/app/track-order/page.tsx +24 -0
- package/templates/storefront-services/app/track-order/track-order-form.tsx +69 -0
- package/templates/storefront-services/components/account-iframe.tsx +13 -0
- package/templates/storefront-services/components/cart-drawer.tsx +14 -0
- package/templates/storefront-services/components/cart-pill.tsx +36 -0
- package/templates/storefront-services/components/category-grid.tsx +28 -0
- package/templates/storefront-services/components/collection-strip.tsx +45 -0
- package/templates/storefront-services/components/footer.tsx +148 -0
- package/templates/storefront-services/components/header.tsx +43 -0
- package/templates/storefront-services/components/hero.tsx +25 -0
- package/templates/storefront-services/components/nav-link.tsx +20 -0
- package/templates/storefront-services/components/policy-page.tsx +49 -0
- package/templates/storefront-services/components/product-modal.tsx +104 -0
- package/templates/storefront-services/components/providers.tsx +35 -0
- package/templates/storefront-services/components/store-product-card.tsx +87 -0
- package/templates/storefront-services/lib/brand.ts +396 -0
- package/templates/storefront-services/lib/cart.ts +12 -0
- package/templates/storefront-services/next.config.ts +42 -0
- package/templates/storefront-services/package.json +35 -0
- package/templates/storefront-services/postcss.config.mjs +7 -0
- package/templates/storefront-services/tsconfig.json +23 -0
- package/templates/storefront-services/vitest.config.ts +9 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { pollDeployment } from './chunk-TAMGCHIL.mjs';
|
|
3
|
+
import { fetchCloneToken } from './chunk-5XH72JMJ.mjs';
|
|
4
|
+
import { promptYesNo } from './chunk-L6474RPL.mjs';
|
|
5
|
+
import { TOKEN_PURPOSE, ENV_SCOPE, DEPLOY_TRIGGER, DEPLOYMENT_STATUS } from './chunk-MQMNWLMU.mjs';
|
|
6
|
+
import { parseArgs, flagBool, flagString } from './chunk-D7D75ONX.mjs';
|
|
7
|
+
import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
|
|
8
|
+
import { readAuth, readProjectLink, writeProjectState } from './chunk-JJYWETGA.mjs';
|
|
9
|
+
import { CliError, CLI_ERROR_CODE, step, info, dim, success, result, EXIT_CODE } from './chunk-NZ4RG62Z.mjs';
|
|
10
|
+
import { spawn } from 'child_process';
|
|
11
|
+
|
|
12
|
+
var GIT_BINARY = "git";
|
|
13
|
+
var ENCODING_UTF8 = "utf8";
|
|
14
|
+
var REMOTE_DEFAULT = "origin";
|
|
15
|
+
var ARGS_STATUS_PORCELAIN = ["status", "--porcelain=v1"];
|
|
16
|
+
var ARGS_REV_PARSE_HEAD = ["rev-parse", "HEAD"];
|
|
17
|
+
var ARGS_REV_PARSE_ABBREV_REF = ["rev-parse", "--abbrev-ref", "HEAD"];
|
|
18
|
+
var ARGS_REV_PARSE_SHOW_TOPLEVEL = ["rev-parse", "--show-toplevel"];
|
|
19
|
+
var ARGS_REMOTE_GET_URL = ["remote", "get-url"];
|
|
20
|
+
var ARGS_PUSH = ["push"];
|
|
21
|
+
async function runGit(args, cwd) {
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
const child = spawn(GIT_BINARY, args, { cwd, stdio: ["ignore", "pipe", "pipe"] });
|
|
24
|
+
const stdoutChunks = [];
|
|
25
|
+
const stderrChunks = [];
|
|
26
|
+
child.stdout.on("data", (chunk) => stdoutChunks.push(chunk));
|
|
27
|
+
child.stderr.on("data", (chunk) => stderrChunks.push(chunk));
|
|
28
|
+
child.on("error", (err) => {
|
|
29
|
+
reject(new CliError(CLI_ERROR_CODE.GIT_ERROR, `git not found: ${err.message}`));
|
|
30
|
+
});
|
|
31
|
+
child.on("close", (code) => {
|
|
32
|
+
resolve({
|
|
33
|
+
code: code ?? -1,
|
|
34
|
+
stdout: Buffer.concat(stdoutChunks).toString(ENCODING_UTF8),
|
|
35
|
+
stderr: Buffer.concat(stderrChunks).toString(ENCODING_UTF8)
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async function runGitOk(args, cwd) {
|
|
41
|
+
const { code, stdout, stderr } = await runGit(args, cwd);
|
|
42
|
+
if (code !== 0) {
|
|
43
|
+
throw new CliError(
|
|
44
|
+
CLI_ERROR_CODE.GIT_ERROR,
|
|
45
|
+
`git ${args.join(" ")} failed: ${stderr.trim() || stdout.trim() || `exit ${code}`}`
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
return stdout.trimEnd();
|
|
49
|
+
}
|
|
50
|
+
async function gitStatusPorcelain(cwd) {
|
|
51
|
+
return runGitOk(ARGS_STATUS_PORCELAIN, cwd);
|
|
52
|
+
}
|
|
53
|
+
async function gitCurrentSha(cwd) {
|
|
54
|
+
return runGitOk(ARGS_REV_PARSE_HEAD, cwd);
|
|
55
|
+
}
|
|
56
|
+
async function gitCurrentBranch(cwd) {
|
|
57
|
+
return runGitOk(ARGS_REV_PARSE_ABBREV_REF, cwd);
|
|
58
|
+
}
|
|
59
|
+
async function gitDetectRoot(cwd) {
|
|
60
|
+
const { code, stdout } = await runGit(ARGS_REV_PARSE_SHOW_TOPLEVEL, cwd);
|
|
61
|
+
if (code !== 0) return null;
|
|
62
|
+
return stdout.trimEnd() || null;
|
|
63
|
+
}
|
|
64
|
+
async function gitGetRemoteUrl(cwd, name = REMOTE_DEFAULT) {
|
|
65
|
+
const { code, stdout } = await runGit([...ARGS_REMOTE_GET_URL, name], cwd);
|
|
66
|
+
if (code !== 0) return null;
|
|
67
|
+
return stdout.trimEnd() || null;
|
|
68
|
+
}
|
|
69
|
+
async function gitPush(cwd, branch) {
|
|
70
|
+
const args = branch ? [...ARGS_PUSH, REMOTE_DEFAULT, branch] : [...ARGS_PUSH];
|
|
71
|
+
await runGitOk(args, cwd);
|
|
72
|
+
}
|
|
73
|
+
async function gitPushToUrl(cwd, url, branch) {
|
|
74
|
+
await runGitOk([...ARGS_PUSH, url, branch], cwd);
|
|
75
|
+
}
|
|
76
|
+
var FREESTYLE_GIT_HOST = "git.freestyle.sh";
|
|
77
|
+
function isFreestyleRemote(url) {
|
|
78
|
+
if (!url) return false;
|
|
79
|
+
try {
|
|
80
|
+
return new URL(url).hostname === FREESTYLE_GIT_HOST;
|
|
81
|
+
} catch {
|
|
82
|
+
return url.includes(FREESTYLE_GIT_HOST);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// src/commands/deploy.ts
|
|
87
|
+
var FLAG_PROD = "prod";
|
|
88
|
+
var FLAG_REF = "ref";
|
|
89
|
+
var FLAG_NO_PUSH = "no-push";
|
|
90
|
+
var FLAG_ALLOW_DIRTY = "allow-dirty";
|
|
91
|
+
var FLAG_NO_POLL = "no-poll";
|
|
92
|
+
function deployEndpoint(businessId, projectId) {
|
|
93
|
+
return `/v1/businesses/${encodeURIComponent(businessId)}/projects/${encodeURIComponent(projectId)}/deploy`;
|
|
94
|
+
}
|
|
95
|
+
async function run(argv) {
|
|
96
|
+
const args = parseArgs(argv);
|
|
97
|
+
const auth = await readAuth();
|
|
98
|
+
const link = await readProjectLink();
|
|
99
|
+
const client = ApiClient.fromAuth(auth);
|
|
100
|
+
const cwd = process.cwd();
|
|
101
|
+
const root = await gitDetectRoot(cwd);
|
|
102
|
+
if (!root) {
|
|
103
|
+
throw new CliError(
|
|
104
|
+
CLI_ERROR_CODE.GIT_ERROR,
|
|
105
|
+
"Not inside a git repository. `cimplify deploy` needs git history."
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
const allowDirty = flagBool(args, FLAG_ALLOW_DIRTY);
|
|
109
|
+
const dirty = (await gitStatusPorcelain(root)).length > 0;
|
|
110
|
+
if (dirty && !allowDirty) {
|
|
111
|
+
const proceed = await promptYesNo(
|
|
112
|
+
"You have uncommitted changes. Continue anyway?",
|
|
113
|
+
true
|
|
114
|
+
);
|
|
115
|
+
if (!proceed) {
|
|
116
|
+
throw new CliError(CLI_ERROR_CODE.ABORTED, "Aborted by user.");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const explicitRef = flagString(args, FLAG_REF);
|
|
120
|
+
const branch = await gitCurrentBranch(root);
|
|
121
|
+
const localSha = await gitCurrentSha(root);
|
|
122
|
+
const gitRef = explicitRef ?? localSha;
|
|
123
|
+
if (!flagBool(args, FLAG_NO_PUSH)) {
|
|
124
|
+
const originUrl = await gitGetRemoteUrl(root);
|
|
125
|
+
if (isFreestyleRemote(originUrl)) {
|
|
126
|
+
step(`Pushing ${branch} to Freestyle (with minted clone token)`);
|
|
127
|
+
const token = await fetchCloneToken(
|
|
128
|
+
client,
|
|
129
|
+
link.businessId,
|
|
130
|
+
link.projectId,
|
|
131
|
+
TOKEN_PURPOSE.EDITOR
|
|
132
|
+
);
|
|
133
|
+
await gitPushToUrl(root, token.clone_url, branch);
|
|
134
|
+
} else {
|
|
135
|
+
step(`Pushing ${branch} to origin`);
|
|
136
|
+
await gitPush(root, branch);
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
info(dim("Skipping git push (--no-push)"));
|
|
140
|
+
}
|
|
141
|
+
const envScope = flagBool(args, FLAG_PROD) ? ENV_SCOPE.PRODUCTION : ENV_SCOPE.PREVIEW;
|
|
142
|
+
const body = {
|
|
143
|
+
git_ref: gitRef,
|
|
144
|
+
env_scope: envScope,
|
|
145
|
+
trigger: DEPLOY_TRIGGER.CLI
|
|
146
|
+
};
|
|
147
|
+
step(`Triggering ${envScope} deploy for ${gitRef.slice(0, 12)}`);
|
|
148
|
+
const enqueued = await client.post(
|
|
149
|
+
deployEndpoint(link.businessId, link.projectId),
|
|
150
|
+
body
|
|
151
|
+
);
|
|
152
|
+
await writeProjectState({
|
|
153
|
+
lastDeploymentId: enqueued.deployment_id,
|
|
154
|
+
lastDeploymentSha: enqueued.git_sha,
|
|
155
|
+
lastDeploymentEnv: envScope,
|
|
156
|
+
lastDeploymentAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
157
|
+
});
|
|
158
|
+
if (enqueued.existing) {
|
|
159
|
+
info(
|
|
160
|
+
dim(
|
|
161
|
+
`Existing deployment ${enqueued.deployment_id} for sha ${enqueued.git_sha.slice(0, 12)} is already in progress; resuming poll`
|
|
162
|
+
)
|
|
163
|
+
);
|
|
164
|
+
} else {
|
|
165
|
+
success(`Enqueued deployment ${enqueued.deployment_id} (sha ${enqueued.git_sha.slice(0, 12)})`);
|
|
166
|
+
}
|
|
167
|
+
if (flagBool(args, FLAG_NO_POLL)) {
|
|
168
|
+
result({
|
|
169
|
+
deployment: {
|
|
170
|
+
id: enqueued.deployment_id,
|
|
171
|
+
git_sha: enqueued.git_sha,
|
|
172
|
+
existing: enqueued.existing,
|
|
173
|
+
environment: envScope,
|
|
174
|
+
status: enqueued.existing ? "in_progress" : "queued"
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const final = await pollDeployment(
|
|
180
|
+
client,
|
|
181
|
+
link.businessId,
|
|
182
|
+
link.projectId,
|
|
183
|
+
enqueued.deployment_id
|
|
184
|
+
);
|
|
185
|
+
result({
|
|
186
|
+
deployment: {
|
|
187
|
+
id: enqueued.deployment_id,
|
|
188
|
+
git_sha: enqueued.git_sha,
|
|
189
|
+
environment: envScope,
|
|
190
|
+
status: final.status,
|
|
191
|
+
url: final.url ?? null,
|
|
192
|
+
error_message: final.error_message ?? null
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
if (final.status === DEPLOYMENT_STATUS.ACTIVE) {
|
|
196
|
+
process.exitCode = EXIT_CODE.OK;
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (final.status === DEPLOYMENT_STATUS.SUPERSEDED) {
|
|
200
|
+
process.exitCode = EXIT_CODE.SUPERSEDED;
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
process.exitCode = EXIT_CODE.ERROR;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export { run as default };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { parseEnvFile, formatEnvFile } from './chunk-4YSOZ6LY.mjs';
|
|
3
|
+
import { ENV_SCOPE, PUBLIC_ENV_PREFIX } from './chunk-MQMNWLMU.mjs';
|
|
4
|
+
import { parseArgs, flagBool } from './chunk-D7D75ONX.mjs';
|
|
5
|
+
import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
|
|
6
|
+
import { readAuth, readProjectLink } from './chunk-JJYWETGA.mjs';
|
|
7
|
+
import { info, CliError, CLI_ERROR_CODE, dim } from './chunk-NZ4RG62Z.mjs';
|
|
8
|
+
import { spawn } from 'child_process';
|
|
9
|
+
import { promises } from 'fs';
|
|
10
|
+
import path from 'path';
|
|
11
|
+
|
|
12
|
+
var FLAG_REMOTE = "remote";
|
|
13
|
+
var PACKAGE_JSON = "package.json";
|
|
14
|
+
var ENV_LOCAL_FILE = ".env.local";
|
|
15
|
+
var PUBLIC_API_URL_KEY = "NEXT_PUBLIC_CIMPLIFY_API_URL";
|
|
16
|
+
var SCRIPT_DEV = "dev";
|
|
17
|
+
var PM_BUN = "bun";
|
|
18
|
+
var PM_PNPM = "pnpm";
|
|
19
|
+
var PM_YARN = "yarn";
|
|
20
|
+
var PM_NPM = "npm";
|
|
21
|
+
var LOCKFILE_BUN = "bun.lock";
|
|
22
|
+
var LOCKFILE_BUN_BINARY = "bun.lockb";
|
|
23
|
+
var LOCKFILE_PNPM = "pnpm-lock.yaml";
|
|
24
|
+
var LOCKFILE_YARN = "yarn.lock";
|
|
25
|
+
var BUNFIG = "bunfig.toml";
|
|
26
|
+
function envEndpoint(businessId, projectId) {
|
|
27
|
+
return `/v1/businesses/${encodeURIComponent(businessId)}/projects/${encodeURIComponent(projectId)}/env-vars`;
|
|
28
|
+
}
|
|
29
|
+
async function detectPackageManager(cwd) {
|
|
30
|
+
if (await pathExists(path.join(cwd, LOCKFILE_BUN))) return PM_BUN;
|
|
31
|
+
if (await pathExists(path.join(cwd, LOCKFILE_BUN_BINARY))) return PM_BUN;
|
|
32
|
+
if (await pathExists(path.join(cwd, BUNFIG))) return PM_BUN;
|
|
33
|
+
if (await pathExists(path.join(cwd, LOCKFILE_PNPM))) return PM_PNPM;
|
|
34
|
+
if (await pathExists(path.join(cwd, LOCKFILE_YARN))) return PM_YARN;
|
|
35
|
+
return PM_NPM;
|
|
36
|
+
}
|
|
37
|
+
async function pathExists(target) {
|
|
38
|
+
try {
|
|
39
|
+
await promises.stat(target);
|
|
40
|
+
return true;
|
|
41
|
+
} catch (err) {
|
|
42
|
+
if (err.code === "ENOENT") return false;
|
|
43
|
+
throw err;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function readPackageJson(cwd) {
|
|
47
|
+
const pkgPath = path.join(cwd, PACKAGE_JSON);
|
|
48
|
+
let raw;
|
|
49
|
+
try {
|
|
50
|
+
raw = await promises.readFile(pkgPath, "utf8");
|
|
51
|
+
} catch (err) {
|
|
52
|
+
if (err.code === "ENOENT") {
|
|
53
|
+
throw new CliError(
|
|
54
|
+
CLI_ERROR_CODE.INVALID_INPUT,
|
|
55
|
+
`No package.json in ${cwd}. \`cimplify dev\` runs your project's dev script.`
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
throw err;
|
|
59
|
+
}
|
|
60
|
+
return JSON.parse(raw);
|
|
61
|
+
}
|
|
62
|
+
function mergeEnvEntries(existing, incoming) {
|
|
63
|
+
const seen = new Set(existing.map((e) => e.key));
|
|
64
|
+
const merged = [...existing];
|
|
65
|
+
for (const entry of incoming) {
|
|
66
|
+
if (seen.has(entry.key)) continue;
|
|
67
|
+
merged.push(entry);
|
|
68
|
+
seen.add(entry.key);
|
|
69
|
+
}
|
|
70
|
+
return merged;
|
|
71
|
+
}
|
|
72
|
+
async function applyRemoteEnv(client, businessId, projectId, apiBaseUrl, cwd) {
|
|
73
|
+
const records = await client.get(envEndpoint(businessId, projectId), {
|
|
74
|
+
query: { scope: ENV_SCOPE.PRODUCTION }
|
|
75
|
+
});
|
|
76
|
+
const incoming = records.filter((r) => r.value !== null && !r.is_secret).map((r) => ({ key: r.key, value: r.value }));
|
|
77
|
+
incoming.push({ key: PUBLIC_API_URL_KEY, value: apiBaseUrl });
|
|
78
|
+
const envPath = path.join(cwd, ENV_LOCAL_FILE);
|
|
79
|
+
let existing = [];
|
|
80
|
+
try {
|
|
81
|
+
const raw = await promises.readFile(envPath, "utf8");
|
|
82
|
+
existing = parseEnvFile(raw);
|
|
83
|
+
} catch (err) {
|
|
84
|
+
if (err.code !== "ENOENT") throw err;
|
|
85
|
+
}
|
|
86
|
+
const merged = mergeEnvEntries(existing, incoming);
|
|
87
|
+
await promises.writeFile(envPath, formatEnvFile(merged), "utf8");
|
|
88
|
+
const publicCount = incoming.filter((e) => e.key.startsWith(PUBLIC_ENV_PREFIX)).length;
|
|
89
|
+
return publicCount;
|
|
90
|
+
}
|
|
91
|
+
async function run(argv) {
|
|
92
|
+
const args = parseArgs(argv);
|
|
93
|
+
const remote = flagBool(args, FLAG_REMOTE);
|
|
94
|
+
const cwd = process.cwd();
|
|
95
|
+
if (remote) {
|
|
96
|
+
const auth = await readAuth();
|
|
97
|
+
const link = await readProjectLink();
|
|
98
|
+
const client = ApiClient.fromAuth(auth);
|
|
99
|
+
const publicCount = await applyRemoteEnv(
|
|
100
|
+
client,
|
|
101
|
+
link.businessId,
|
|
102
|
+
link.projectId,
|
|
103
|
+
auth.apiBaseUrl,
|
|
104
|
+
cwd
|
|
105
|
+
);
|
|
106
|
+
const label = link.businessHandle ?? auth.businessHandle ?? auth.businessId;
|
|
107
|
+
info(`Dev mode: connected to ${label} production data (${publicCount} public var${publicCount === 1 ? "" : "s"} merged)`);
|
|
108
|
+
} else {
|
|
109
|
+
info("Dev mode: using local mock (`cimplify mock`)");
|
|
110
|
+
}
|
|
111
|
+
const pkg = await readPackageJson(cwd);
|
|
112
|
+
if (!pkg.scripts || !pkg.scripts[SCRIPT_DEV]) {
|
|
113
|
+
throw new CliError(
|
|
114
|
+
CLI_ERROR_CODE.INVALID_INPUT,
|
|
115
|
+
`No "${SCRIPT_DEV}" script in package.json. Add one (e.g. "next dev") and re-run.`
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
const pm = await detectPackageManager(cwd);
|
|
119
|
+
info(dim(`(running: ${pm} run ${SCRIPT_DEV})`));
|
|
120
|
+
const child = spawn(pm, ["run", SCRIPT_DEV], { cwd, stdio: "inherit" });
|
|
121
|
+
await new Promise((resolve, reject) => {
|
|
122
|
+
child.on("error", (err) => reject(new CliError(CLI_ERROR_CODE.INVALID_INPUT, `Failed to spawn ${pm}: ${err.message}`)));
|
|
123
|
+
child.on("close", (code) => {
|
|
124
|
+
process.exitCode = code ?? 0;
|
|
125
|
+
resolve();
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export { run as default, detectPackageManager, mergeEnvEntries };
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { TEMPLATES } from './chunk-XSWWWO6H.mjs';
|
|
3
|
+
|
|
4
|
+
// package.json
|
|
5
|
+
var package_default = {
|
|
6
|
+
version: "0.2.0"};
|
|
7
|
+
|
|
8
|
+
// src/dispatcher.ts
|
|
9
|
+
var VERSION = package_default.version;
|
|
10
|
+
var HELP = `cimplify \u2014 Cimplify CLI
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
cimplify <subcommand> [flags]
|
|
14
|
+
|
|
15
|
+
Project:
|
|
16
|
+
cimplify init [dir] [flags] Scaffold a working storefront from a template
|
|
17
|
+
cimplify login [flags] Open a browser to authorize this CLI (PKCE loopback)
|
|
18
|
+
cimplify logout Forget saved credentials
|
|
19
|
+
cimplify whoami Show the current account/business
|
|
20
|
+
cimplify projects ls List projects in the current business
|
|
21
|
+
cimplify projects create <name> Create a Next.js project
|
|
22
|
+
cimplify link <project-id> Link CWD to a Cimplify project (writes .cimplify/project.json)
|
|
23
|
+
cimplify unlink Remove the local project link
|
|
24
|
+
|
|
25
|
+
Deploy:
|
|
26
|
+
cimplify deploy [flags] Push current SHA + trigger a build
|
|
27
|
+
cimplify rollback <deploy-id> Re-deploy a previous deployment's SHA
|
|
28
|
+
cimplify status Show the latest deployment for the linked project
|
|
29
|
+
cimplify logs [flags] Stream build logs for the latest (or given) deployment
|
|
30
|
+
cimplify dev [--remote] Run your project's dev script (optionally with prod env)
|
|
31
|
+
|
|
32
|
+
Env vars:
|
|
33
|
+
cimplify env ls [--scope=<s>] List env vars (default scope: preview)
|
|
34
|
+
cimplify env pull [--scope=<s>] Write public env vars to .env.local
|
|
35
|
+
cimplify env push [--scope=<s>] Push .env.local to the given scope
|
|
36
|
+
cimplify env add KEY=VAL [...] Add a single env var
|
|
37
|
+
cimplify env rm KEY [--yes] Remove an env var
|
|
38
|
+
|
|
39
|
+
Components (eject from @cimplify/sdk's registry):
|
|
40
|
+
cimplify list [--components|--utilities] List ejectable components from the SDK
|
|
41
|
+
cimplify add <name> [--dir <path>] [--force] [--no-deps]
|
|
42
|
+
Copy a component (and its registry deps) into your project
|
|
43
|
+
cimplify add --all [--dir <path>] Eject the entire registry at once
|
|
44
|
+
|
|
45
|
+
Repo:
|
|
46
|
+
cimplify repo provision Mint a Freestyle Git repo for the linked project
|
|
47
|
+
cimplify repo connect <url> [--provider=\u2026] Connect an existing remote (GitHub, Gitea, external)
|
|
48
|
+
cimplify repo info Show the linked project's repo metadata
|
|
49
|
+
cimplify repo unlink [--purge] [--yes] Unlink the repo (use --purge to also delete upstream)
|
|
50
|
+
cimplify repo rotate-token Rotate the access token (alias of provision)
|
|
51
|
+
cimplify repo clone-url Mint a short-lived auth-embedded clone URL (stdout)
|
|
52
|
+
|
|
53
|
+
Note: \`cimplify projects create <name>\` auto-provisions a Freestyle repo unless --no-repo is passed.
|
|
54
|
+
Use --connect <url> on create to attach an existing remote instead.
|
|
55
|
+
|
|
56
|
+
Domains:
|
|
57
|
+
cimplify domains ls List business domains
|
|
58
|
+
cimplify domains ls --attached List domains attached to the linked project
|
|
59
|
+
cimplify domains add <domain> Add a domain (prints DNS records to set)
|
|
60
|
+
cimplify domains verify <dom> Trigger verification after DNS is configured
|
|
61
|
+
cimplify domains rm <dom> Remove a domain
|
|
62
|
+
cimplify domains attach <dom> [flags] Attach a verified domain to the linked project
|
|
63
|
+
flags: --env=preview|production --primary
|
|
64
|
+
cimplify domains detach <dom> [flags] Detach a domain from the linked project
|
|
65
|
+
flags: --env=preview|production --yes
|
|
66
|
+
cimplify domains primary <dom> [--env=...] Promote an attached domain to primary for its env
|
|
67
|
+
|
|
68
|
+
Global flags (work with any cloud subcommand):
|
|
69
|
+
--json Emit a single JSON document on stdout instead
|
|
70
|
+
of human progress; suppresses colorized text.
|
|
71
|
+
Equivalent of CIMPLIFY_JSON=1 in the env.
|
|
72
|
+
Success: { "ok": true, "data": ... }
|
|
73
|
+
Failure: { "ok": false, "error": { "code": ..., "message": ..., "remediation": ... } }
|
|
74
|
+
--yes, -y Auto-confirm yes/no prompts (e.g. --allow-dirty).
|
|
75
|
+
Non-TTY runs throw INTERACTIVE_REQUIRED unless --yes is set.
|
|
76
|
+
|
|
77
|
+
Misc:
|
|
78
|
+
cimplify --help, -h Show this help
|
|
79
|
+
cimplify --version, -v Show CLI version
|
|
80
|
+
|
|
81
|
+
Init flags:
|
|
82
|
+
--template <name>, -t bakery (default) | restaurant | retail | services | grocery | fashion
|
|
83
|
+
Picks the storefront design.
|
|
84
|
+
|
|
85
|
+
Login flags:
|
|
86
|
+
(no flags) Open a browser to authorize this CLI (default)
|
|
87
|
+
--no-browser Print the URL instead of opening it (useful over SSH)
|
|
88
|
+
--api-key <dk_...> Skip the browser and authenticate with a key (CI / headless)
|
|
89
|
+
--base-url <url> API base URL (env: CIMPLIFY_API_URL; default https://api.cimplify.io)
|
|
90
|
+
|
|
91
|
+
Deploy flags:
|
|
92
|
+
--prod Deploy to production (default: preview)
|
|
93
|
+
--ref <sha> Override the git ref (default: HEAD of current branch)
|
|
94
|
+
--no-push Skip \`git push\` (assumes remote already has the SHA)
|
|
95
|
+
--allow-dirty Skip the dirty-tree confirmation prompt
|
|
96
|
+
--no-poll Return after enqueue; don't stream progress
|
|
97
|
+
|
|
98
|
+
Env flags:
|
|
99
|
+
--scope <scope> development | preview | staging | production
|
|
100
|
+
--show Reveal non-secret values in \`env ls\`
|
|
101
|
+
--out <path> Output path for \`env pull\` (default .env.local)
|
|
102
|
+
--file <path> Input path for \`env push\` (default .env.local)
|
|
103
|
+
--overwrite Replace the entire scope on \`env push\`
|
|
104
|
+
--secret / --public Force is_secret on \`env add\`
|
|
105
|
+
--yes Skip confirmation on \`env rm\`
|
|
106
|
+
|
|
107
|
+
Logs flags:
|
|
108
|
+
--deployment <id> Override which deployment to read (default: latest)
|
|
109
|
+
--follow Poll until the deployment terminates
|
|
110
|
+
|
|
111
|
+
Need the mock storefront server? It ships with @cimplify/sdk:
|
|
112
|
+
bunx @cimplify/sdk mock [flags] Boot the local Cimplify API mock
|
|
113
|
+
`;
|
|
114
|
+
var COMMANDS = {
|
|
115
|
+
login: () => import('./login-MRYWLQRY.mjs'),
|
|
116
|
+
logout: () => import('./logout-ZFZLSJ32.mjs'),
|
|
117
|
+
whoami: () => import('./whoami-INHDUHWA.mjs'),
|
|
118
|
+
projects: () => import('./projects-QJUGOCQZ.mjs'),
|
|
119
|
+
link: () => import('./link-SEJNW7JS.mjs'),
|
|
120
|
+
unlink: () => import('./unlink-5ABCT7B6.mjs'),
|
|
121
|
+
deploy: () => import('./deploy-WCZOGMED.mjs'),
|
|
122
|
+
rollback: () => import('./rollback-XO7RIG2A.mjs'),
|
|
123
|
+
env: () => import('./env-LBYBCBWV.mjs'),
|
|
124
|
+
domains: () => import('./domains-3RJ4T5IX.mjs'),
|
|
125
|
+
logs: () => import('./logs-LK7CMBCE.mjs'),
|
|
126
|
+
status: () => import('./status-7CMVLD54.mjs'),
|
|
127
|
+
dev: () => import('./dev-4HKIXWXX.mjs'),
|
|
128
|
+
repo: () => import('./repo-MV22OHON.mjs'),
|
|
129
|
+
list: () => import('./list-D4JC2VWY.mjs'),
|
|
130
|
+
add: () => import('./add-ZJQJZJEF.mjs')
|
|
131
|
+
};
|
|
132
|
+
var GLOBAL_FLAGS = /* @__PURE__ */ new Set(["--json", "--yes", "-y"]);
|
|
133
|
+
function extractGlobalFlags(argv) {
|
|
134
|
+
const cleaned = [];
|
|
135
|
+
let json = process.env.CIMPLIFY_JSON === "1" || process.env.CIMPLIFY_JSON === "true";
|
|
136
|
+
let yes = false;
|
|
137
|
+
for (const a of argv) {
|
|
138
|
+
if (!GLOBAL_FLAGS.has(a)) {
|
|
139
|
+
cleaned.push(a);
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (a === "--json") json = true;
|
|
143
|
+
else if (a === "--yes" || a === "-y") yes = true;
|
|
144
|
+
}
|
|
145
|
+
return { args: cleaned, json, yes };
|
|
146
|
+
}
|
|
147
|
+
async function main() {
|
|
148
|
+
const cleaned = extractGlobalFlags(process.argv.slice(2));
|
|
149
|
+
if (cleaned.json) process.env.CIMPLIFY_JSON = "1";
|
|
150
|
+
if (cleaned.yes) process.env.CIMPLIFY_YES = "1";
|
|
151
|
+
process.argv = [process.argv[0], process.argv[1], ...cleaned.args];
|
|
152
|
+
const [maybeSub, ...rest] = cleaned.args;
|
|
153
|
+
const TOP_LEVEL_FLAGS = /* @__PURE__ */ new Set(["--help", "-h", "help", "--version", "-v", "version"]);
|
|
154
|
+
if (!maybeSub) {
|
|
155
|
+
console.log(HELP);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (TOP_LEVEL_FLAGS.has(maybeSub)) {
|
|
159
|
+
return await runDispatcherFlag(maybeSub);
|
|
160
|
+
}
|
|
161
|
+
const sub = maybeSub;
|
|
162
|
+
const args = rest;
|
|
163
|
+
if (sub === "init") {
|
|
164
|
+
await runInit(args);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const loader = COMMANDS[sub];
|
|
168
|
+
if (!loader) {
|
|
169
|
+
console.error(`cimplify: unknown command "${sub}"`);
|
|
170
|
+
console.error(`Run \`cimplify --help\` for usage.`);
|
|
171
|
+
process.exit(1);
|
|
172
|
+
}
|
|
173
|
+
await runCommand(sub, loader, args);
|
|
174
|
+
}
|
|
175
|
+
async function runInit(args) {
|
|
176
|
+
const { existsSync, mkdirSync, readdirSync, writeFileSync } = await import('fs');
|
|
177
|
+
const { dirname, join, resolve } = await import('path');
|
|
178
|
+
const { spawnSync } = await import('child_process');
|
|
179
|
+
const dir = args.find((a) => !a.startsWith("-")) ?? "my-storefront";
|
|
180
|
+
const target = resolve(process.cwd(), dir);
|
|
181
|
+
if (existsSync(target) && readdirSync(target).length > 0) {
|
|
182
|
+
console.error(`cimplify init: directory ${target} is not empty`);
|
|
183
|
+
process.exit(1);
|
|
184
|
+
}
|
|
185
|
+
mkdirSync(target, { recursive: true });
|
|
186
|
+
const VALID_TEMPLATES = /* @__PURE__ */ new Set([
|
|
187
|
+
"bakery",
|
|
188
|
+
"restaurant",
|
|
189
|
+
"retail",
|
|
190
|
+
"services",
|
|
191
|
+
"grocery",
|
|
192
|
+
"fashion"
|
|
193
|
+
]);
|
|
194
|
+
let template = "bakery";
|
|
195
|
+
for (let i = 0; i < args.length; i++) {
|
|
196
|
+
if (args[i] === "--template" || args[i] === "-t") {
|
|
197
|
+
const next = args[i + 1];
|
|
198
|
+
if (next && VALID_TEMPLATES.has(next)) template = next;
|
|
199
|
+
else {
|
|
200
|
+
console.error(
|
|
201
|
+
`cimplify init: unknown template "${next ?? ""}". Valid options: ${[...VALID_TEMPLATES].join(", ")}.`
|
|
202
|
+
);
|
|
203
|
+
process.exit(1);
|
|
204
|
+
}
|
|
205
|
+
} else if (args[i].startsWith("--template=")) {
|
|
206
|
+
const next = args[i].slice("--template=".length);
|
|
207
|
+
if (VALID_TEMPLATES.has(next)) template = next;
|
|
208
|
+
else {
|
|
209
|
+
console.error(
|
|
210
|
+
`cimplify init: unknown template "${next}". Valid options: ${[...VALID_TEMPLATES].join(", ")}.`
|
|
211
|
+
);
|
|
212
|
+
process.exit(1);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const templateKey = `storefront-${template}`;
|
|
217
|
+
const files = TEMPLATES[templateKey];
|
|
218
|
+
if (!files) {
|
|
219
|
+
console.error(
|
|
220
|
+
`cimplify init: template "${template}" not present in the embedded bundle. Available: ${Object.keys(TEMPLATES).join(", ")}`
|
|
221
|
+
);
|
|
222
|
+
process.exit(1);
|
|
223
|
+
}
|
|
224
|
+
const placeholderName = dir.replace(/[^a-z0-9-]/gi, "-").toLowerCase();
|
|
225
|
+
for (const file of files) {
|
|
226
|
+
const dst = join(target, file.path);
|
|
227
|
+
mkdirSync(dirname(dst), { recursive: true });
|
|
228
|
+
if (file.kind === "text") {
|
|
229
|
+
writeFileSync(dst, file.content.replaceAll("__STOREFRONT_NAME__", placeholderName));
|
|
230
|
+
} else {
|
|
231
|
+
writeFileSync(dst, Buffer.from(file.content, "base64"));
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
const envExample = join(target, ".env.example");
|
|
235
|
+
const envLocal = join(target, ".env.local");
|
|
236
|
+
if (existsSync(envExample) && !existsSync(envLocal)) {
|
|
237
|
+
const { copyFileSync } = await import('fs');
|
|
238
|
+
copyFileSync(envExample, envLocal);
|
|
239
|
+
}
|
|
240
|
+
console.log(`\u2713 Scaffolded ${placeholderName} in ${target}`);
|
|
241
|
+
console.log("");
|
|
242
|
+
console.log("Installing dependencies...");
|
|
243
|
+
const installer = spawnSync("bun", ["install"], { cwd: target, stdio: "inherit" });
|
|
244
|
+
if (installer.status !== 0) {
|
|
245
|
+
console.warn("(bun install failed; run it manually)");
|
|
246
|
+
}
|
|
247
|
+
console.log("");
|
|
248
|
+
console.log("Next steps:");
|
|
249
|
+
console.log(` cd ${dir}`);
|
|
250
|
+
console.log(" bun dev # boots both the mock API and the storefront");
|
|
251
|
+
console.log("");
|
|
252
|
+
console.log("Then open http://localhost:3000");
|
|
253
|
+
}
|
|
254
|
+
async function runCommand(sub, loader, args) {
|
|
255
|
+
let mod;
|
|
256
|
+
try {
|
|
257
|
+
mod = await loader();
|
|
258
|
+
} catch (err) {
|
|
259
|
+
await emitError(sub, err);
|
|
260
|
+
process.exit(1);
|
|
261
|
+
}
|
|
262
|
+
if (typeof mod.default !== "function") {
|
|
263
|
+
await emitError(sub, new Error("command module did not export a default function"));
|
|
264
|
+
process.exit(1);
|
|
265
|
+
}
|
|
266
|
+
try {
|
|
267
|
+
await mod.default(args);
|
|
268
|
+
} catch (err) {
|
|
269
|
+
await emitError(sub, err);
|
|
270
|
+
process.exit(exitCodeFromError(err));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function isCliErrorLike(err) {
|
|
274
|
+
return err !== null && typeof err === "object" && err.name === "CliError" && typeof err.code === "string" && typeof err.message === "string" && typeof err.exitCode === "number";
|
|
275
|
+
}
|
|
276
|
+
function exitCodeFromError(err) {
|
|
277
|
+
return isCliErrorLike(err) ? err.exitCode : 1;
|
|
278
|
+
}
|
|
279
|
+
async function emitError(sub, err) {
|
|
280
|
+
const json = process.env.CIMPLIFY_JSON === "1" || process.env.CIMPLIFY_JSON === "true";
|
|
281
|
+
if (json) {
|
|
282
|
+
if (isCliErrorLike(err)) {
|
|
283
|
+
const payload = {
|
|
284
|
+
ok: false,
|
|
285
|
+
error: {
|
|
286
|
+
code: err.code,
|
|
287
|
+
message: err.message,
|
|
288
|
+
...err.remediation ? { remediation: err.remediation } : {}
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
process.stdout.write(`${JSON.stringify(payload)}
|
|
292
|
+
`);
|
|
293
|
+
} else {
|
|
294
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
295
|
+
process.stdout.write(`${JSON.stringify({ ok: false, error: { code: "INTERNAL", message } })}
|
|
296
|
+
`);
|
|
297
|
+
}
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
if (isCliErrorLike(err)) {
|
|
301
|
+
console.error(`cimplify ${sub}: ${err.message}`);
|
|
302
|
+
if (err.remediation) console.error(` \u2192 ${err.remediation}`);
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
if (err instanceof Error) {
|
|
306
|
+
console.error(`cimplify ${sub}:`, err.stack ?? err.message);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
console.error(`cimplify ${sub}:`, String(err));
|
|
310
|
+
}
|
|
311
|
+
async function runDispatcherFlag(flag) {
|
|
312
|
+
if (flag === "-h" || flag === "--help" || flag === "help") {
|
|
313
|
+
console.log(HELP);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
console.log(VERSION);
|
|
317
|
+
}
|
|
318
|
+
main().catch((err) => {
|
|
319
|
+
console.error("cimplify:", err);
|
|
320
|
+
process.exit(1);
|
|
321
|
+
});
|