@cimplify/cli 0.6.9 → 0.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/{add-U4S5DBPN.mjs → add-5G7UZ6DA.mjs} +1 -1
  2. package/dist/{chunk-R3FDBXR6.mjs → chunk-CLNS2NBR.mjs} +4 -1
  3. package/dist/{chunk-CMF2X3SI.mjs → chunk-KOJZB3S4.mjs} +1 -1
  4. package/dist/chunk-OLZMA2TM.mjs +5707 -0
  5. package/dist/{chunk-4HDXZJMR.mjs → chunk-SNDMYYOK.mjs} +1 -1
  6. package/dist/{deploy-7BPO5BNB.mjs → deploy-YVCYHNSS.mjs} +48 -19
  7. package/dist/dispatcher.mjs +11 -11
  8. package/dist/{doctor-BTMEATD4.mjs → doctor-3UOTPOJ6.mjs} +2 -2
  9. package/dist/{explain-JH4TKGTP.mjs → explain-DXJ3R52F.mjs} +1 -1
  10. package/dist/{introspect-DOZCE52F.mjs → introspect-77SUZ5X5.mjs} +2 -2
  11. package/dist/{list-KO2QX42Q.mjs → list-QX7RM3P3.mjs} +1 -1
  12. package/dist/{repo-WOBWKEAO.mjs → repo-KNQMSPVV.mjs} +1 -1
  13. package/dist/{update-O2UR6PAW.mjs → update-UHKPFT6F.mjs} +1 -1
  14. package/package.json +1 -1
  15. package/templates/storefront-auto/app/layout.tsx +3 -1
  16. package/templates/storefront-auto/bun.lock +428 -0
  17. package/templates/storefront-auto/components/product-modal.tsx +104 -0
  18. package/templates/storefront-auto/lib/site-url.ts +3 -26
  19. package/templates/storefront-auto/lib/site.config.ts +7 -0
  20. package/templates/storefront-auto/next.config.ts +7 -0
  21. package/templates/storefront-bakery/app/layout.tsx +3 -1
  22. package/templates/storefront-bakery/lib/site-url.ts +3 -26
  23. package/templates/storefront-bakery/lib/site.config.ts +7 -0
  24. package/templates/storefront-bakery/next.config.ts +7 -0
  25. package/templates/storefront-fashion/app/layout.tsx +3 -1
  26. package/templates/storefront-fashion/bun.lock +437 -0
  27. package/templates/storefront-fashion/components/product-modal.tsx +104 -0
  28. package/templates/storefront-fashion/lib/site-url.ts +3 -26
  29. package/templates/storefront-fashion/lib/site.config.ts +7 -0
  30. package/templates/storefront-fashion/next.config.ts +7 -0
  31. package/templates/storefront-grocery/app/layout.tsx +3 -1
  32. package/templates/storefront-grocery/bun.lock +428 -0
  33. package/templates/storefront-grocery/lib/site-url.ts +3 -26
  34. package/templates/storefront-grocery/lib/site.config.ts +7 -0
  35. package/templates/storefront-grocery/next.config.ts +7 -0
  36. package/templates/storefront-pharmacy/app/layout.tsx +3 -1
  37. package/templates/storefront-pharmacy/bun.lock +428 -0
  38. package/templates/storefront-pharmacy/components/product-modal.tsx +104 -0
  39. package/templates/storefront-pharmacy/lib/site-url.ts +3 -26
  40. package/templates/storefront-pharmacy/lib/site.config.ts +7 -0
  41. package/templates/storefront-pharmacy/next.config.ts +7 -0
  42. package/templates/storefront-restaurant/app/layout.tsx +3 -1
  43. package/templates/storefront-restaurant/app/reservations/reservations-client.tsx +1 -1
  44. package/templates/storefront-restaurant/bun.lock +428 -0
  45. package/templates/storefront-restaurant/lib/site-url.ts +3 -26
  46. package/templates/storefront-restaurant/lib/site.config.ts +7 -0
  47. package/templates/storefront-restaurant/next.config.ts +7 -0
  48. package/templates/storefront-retail/app/layout.tsx +3 -1
  49. package/templates/storefront-retail/bun.lock +428 -0
  50. package/templates/storefront-retail/components/product-modal.tsx +104 -0
  51. package/templates/storefront-retail/lib/site-url.ts +3 -26
  52. package/templates/storefront-retail/lib/site.config.ts +7 -0
  53. package/templates/storefront-retail/next.config.ts +7 -0
  54. package/templates/storefront-services/app/book/book-client.tsx +2 -1
  55. package/templates/storefront-services/app/layout.tsx +3 -1
  56. package/templates/storefront-services/bun.lock +428 -0
  57. package/templates/storefront-services/lib/site-url.ts +3 -26
  58. package/templates/storefront-services/lib/site.config.ts +7 -0
  59. package/templates/storefront-services/next.config.ts +7 -0
  60. package/dist/chunk-EALN6SAN.mjs +0 -5707
  61. package/templates/storefront-auto/app/login/page.tsx +0 -17
  62. package/templates/storefront-auto/app/signup/page.tsx +0 -17
  63. package/templates/storefront-bakery/app/login/page.tsx +0 -17
  64. package/templates/storefront-bakery/app/signup/page.tsx +0 -17
  65. package/templates/storefront-fashion/app/login/page.tsx +0 -17
  66. package/templates/storefront-fashion/app/signup/page.tsx +0 -17
  67. package/templates/storefront-grocery/app/login/page.tsx +0 -17
  68. package/templates/storefront-grocery/app/signup/page.tsx +0 -17
  69. package/templates/storefront-pharmacy/app/login/page.tsx +0 -17
  70. package/templates/storefront-pharmacy/app/signup/page.tsx +0 -17
  71. package/templates/storefront-restaurant/app/login/page.tsx +0 -17
  72. package/templates/storefront-restaurant/app/signup/page.tsx +0 -17
  73. package/templates/storefront-retail/app/login/page.tsx +0 -17
  74. package/templates/storefront-retail/app/signup/page.tsx +0 -17
  75. package/templates/storefront-services/app/login/page.tsx +0 -17
  76. package/templates/storefront-services/app/signup/page.tsx +0 -17
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { gitDetectRoot, gitCurrentBranch, gitCurrentSha, gitStatusPorcelain } from './chunk-K5464A3L.mjs';
3
3
  import { parseEnvFile } from './chunk-DBZ3UOQ2.mjs';
4
- import { package_default } from './chunk-CMF2X3SI.mjs';
4
+ import { package_default } from './chunk-KOJZB3S4.mjs';
5
5
  import { parseArgs } from './chunk-C4M3DXKC.mjs';
6
6
  import { readAuthOrNull, readProjectLinkOrNull, readProjectState } from './chunk-UBAI443T.mjs';
7
7
  import { bold, dim, yellow, green, info, result, red } from './chunk-E2T2SBP5.mjs';
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import { gitDetectRoot, gitStatusPorcelain, gitCurrentBranch, gitCurrentSha, gitGetRemoteUrl, isFreestyleRemote, gitPushToUrl, gitPush } from './chunk-K5464A3L.mjs';
2
+ import { isFreestyleRemote, gitDetectRoot, gitStatusPorcelain, gitCurrentBranch, gitCurrentSha, gitGetRemoteUrl, gitPushToUrl, gitPush } from './chunk-K5464A3L.mjs';
3
3
  import { pollDeployment } from './chunk-VTR5R5NQ.mjs';
4
- import { fetchCloneToken } from './chunk-R3FDBXR6.mjs';
4
+ import { fetchRepoRecord, fetchCloneToken } from './chunk-CLNS2NBR.mjs';
5
5
  import { promptYesNo } from './chunk-ITAFAORS.mjs';
6
- import { TOKEN_PURPOSE, ENV_SCOPE, DEPLOY_TRIGGER, DEPLOYMENT_STATUS } from './chunk-MXYUAJEW.mjs';
6
+ import { REPO_PROVIDER, ENV_SCOPE, DEPLOY_TRIGGER, DEPLOYMENT_STATUS, TOKEN_PURPOSE } from './chunk-MXYUAJEW.mjs';
7
7
  import { parseArgs, flagBool, flagString } from './chunk-C4M3DXKC.mjs';
8
8
  import { ApiClient } from './chunk-MAOO6ZZ5.mjs';
9
9
  import { readAuth, readProjectLink, writeProjectState } from './chunk-UBAI443T.mjs';
10
- import { CliError, CLI_ERROR_CODE, step, info, dim, success, result, EXIT_CODE } from './chunk-E2T2SBP5.mjs';
10
+ import { CliError, CLI_ERROR_CODE, info, dim, step, success, result, EXIT_CODE } from './chunk-E2T2SBP5.mjs';
11
11
 
12
12
  // src/commands/deploy.ts
13
13
  var FLAG_PROD = "prod";
@@ -18,6 +18,48 @@ var FLAG_NO_POLL = "no-poll";
18
18
  function deployEndpoint(businessId, projectId) {
19
19
  return `/v1/businesses/${encodeURIComponent(businessId)}/projects/${encodeURIComponent(projectId)}/deploy`;
20
20
  }
21
+ function resolvePushStrategy(originUrl, linkRemoteUrl, repo) {
22
+ if (isFreestyleRemote(originUrl) || isFreestyleRemote(linkRemoteUrl)) {
23
+ return { kind: "managed" };
24
+ }
25
+ if (repo) {
26
+ if (repo.provider === REPO_PROVIDER.FREESTYLE || isFreestyleRemote(repo.remote_url)) {
27
+ return { kind: "managed" };
28
+ }
29
+ if (!originUrl) {
30
+ return {
31
+ kind: "error",
32
+ message: `This project uses a connected ${repo.provider} repo but no local 'origin' remote is set.
33
+ Add it: git remote add origin ${repo.remote_url}
34
+ Then re-run cimplify deploy.`
35
+ };
36
+ }
37
+ return { kind: "origin" };
38
+ }
39
+ if (!originUrl) {
40
+ return {
41
+ kind: "error",
42
+ message: "No git remote configured and no repo attached to this project.\nProvision a managed repo: cimplify repo provision\nOr connect your own: cimplify repo connect <url>"
43
+ };
44
+ }
45
+ return { kind: "origin" };
46
+ }
47
+ async function pushForDeploy(client, businessId, projectId, root, branch, linkRemoteUrl) {
48
+ const originUrl = await gitGetRemoteUrl(root);
49
+ const repo = isFreestyleRemote(originUrl) || isFreestyleRemote(linkRemoteUrl) ? null : await fetchRepoRecord(client, businessId, projectId);
50
+ const strategy = resolvePushStrategy(originUrl, linkRemoteUrl, repo);
51
+ if (strategy.kind === "error") {
52
+ throw new CliError(CLI_ERROR_CODE.GIT_ERROR, strategy.message);
53
+ }
54
+ if (strategy.kind === "managed") {
55
+ step(`Pushing ${branch} (managed remote \u2014 minting short-TTL clone token)`);
56
+ const token = await fetchCloneToken(client, businessId, projectId, TOKEN_PURPOSE.EDITOR);
57
+ await gitPushToUrl(root, token.clone_url, branch);
58
+ return;
59
+ }
60
+ step(`Pushing ${branch} to origin`);
61
+ await gitPush(root, branch);
62
+ }
21
63
  async function run(argv) {
22
64
  const args = parseArgs(argv);
23
65
  const auth = await readAuth();
@@ -47,20 +89,7 @@ async function run(argv) {
47
89
  const localSha = await gitCurrentSha(root);
48
90
  const gitRef = explicitRef ?? localSha;
49
91
  if (!flagBool(args, FLAG_NO_PUSH)) {
50
- const originUrl = await gitGetRemoteUrl(root);
51
- if (isFreestyleRemote(originUrl)) {
52
- step(`Pushing ${branch} (managed remote \u2014 minting short-TTL clone token)`);
53
- const token = await fetchCloneToken(
54
- client,
55
- link.businessId,
56
- link.projectId,
57
- TOKEN_PURPOSE.EDITOR
58
- );
59
- await gitPushToUrl(root, token.clone_url, branch);
60
- } else {
61
- step(`Pushing ${branch} to origin`);
62
- await gitPush(root, branch);
63
- }
92
+ await pushForDeploy(client, link.businessId, link.projectId, root, branch, link.remoteUrl);
64
93
  } else {
65
94
  info(dim("Skipping git push (--no-push)"));
66
95
  }
@@ -129,4 +158,4 @@ async function run(argv) {
129
158
  process.exitCode = EXIT_CODE.ERROR;
130
159
  }
131
160
 
132
- export { run as default };
161
+ export { run as default, resolvePushStrategy };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { TEMPLATES } from './chunk-EALN6SAN.mjs';
3
- import { package_default } from './chunk-CMF2X3SI.mjs';
2
+ import { TEMPLATES } from './chunk-OLZMA2TM.mjs';
3
+ import { package_default } from './chunk-KOJZB3S4.mjs';
4
4
 
5
5
  // src/dispatcher.ts
6
6
  var VERSION = package_default.version ?? "unknown";
@@ -129,7 +129,7 @@ var COMMANDS = {
129
129
  projects: () => import('./projects-JSEC2YCX.mjs'),
130
130
  link: () => import('./link-DZSILT5N.mjs'),
131
131
  unlink: () => import('./unlink-RFK74SFP.mjs'),
132
- deploy: () => import('./deploy-7BPO5BNB.mjs'),
132
+ deploy: () => import('./deploy-YVCYHNSS.mjs'),
133
133
  cancel: () => import('./cancel-HANLRA6Q.mjs'),
134
134
  rollback: () => import('./rollback-DD4RNRFM.mjs'),
135
135
  env: () => import('./env-7ISJ73YI.mjs'),
@@ -137,15 +137,15 @@ var COMMANDS = {
137
137
  logs: () => import('./logs-YNN2PQ24.mjs'),
138
138
  status: () => import('./status-JSYXM5RT.mjs'),
139
139
  dev: () => import('./dev-ONW2S77K.mjs'),
140
- introspect: () => import('./introspect-DOZCE52F.mjs'),
141
- doctor: () => import('./doctor-BTMEATD4.mjs'),
142
- explain: () => import('./explain-JH4TKGTP.mjs'),
140
+ introspect: () => import('./introspect-77SUZ5X5.mjs'),
141
+ doctor: () => import('./doctor-3UOTPOJ6.mjs'),
142
+ explain: () => import('./explain-DXJ3R52F.mjs'),
143
143
  assets: () => import('./assets-EBEMMENZ.mjs'),
144
- repo: () => import('./repo-WOBWKEAO.mjs'),
145
- list: () => import('./list-KO2QX42Q.mjs'),
146
- add: () => import('./add-U4S5DBPN.mjs'),
147
- update: () => import('./update-O2UR6PAW.mjs'),
148
- upgrade: () => import('./update-O2UR6PAW.mjs'),
144
+ repo: () => import('./repo-KNQMSPVV.mjs'),
145
+ list: () => import('./list-QX7RM3P3.mjs'),
146
+ add: () => import('./add-5G7UZ6DA.mjs'),
147
+ update: () => import('./update-UHKPFT6F.mjs'),
148
+ upgrade: () => import('./update-UHKPFT6F.mjs'),
149
149
  "auth-step-up": () => import('./auth-step-up-BIUYQJP6.mjs')
150
150
  };
151
151
  var COMMAND_PREFIXES = {
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { gatherIntrospection } from './chunk-4HDXZJMR.mjs';
2
+ import { gatherIntrospection } from './chunk-SNDMYYOK.mjs';
3
3
  import './chunk-K5464A3L.mjs';
4
4
  import './chunk-DBZ3UOQ2.mjs';
5
- import './chunk-CMF2X3SI.mjs';
5
+ import './chunk-KOJZB3S4.mjs';
6
6
  import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
7
7
  import { ApiClient } from './chunk-MAOO6ZZ5.mjs';
8
8
  import { readAuthOrNull } from './chunk-UBAI443T.mjs';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { package_default } from './chunk-CMF2X3SI.mjs';
2
+ import { package_default } from './chunk-KOJZB3S4.mjs';
3
3
  import { parseArgs } from './chunk-C4M3DXKC.mjs';
4
4
  import { bold, dim, info, result, CliError, CLI_ERROR_CODE } from './chunk-E2T2SBP5.mjs';
5
5
 
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-4HDXZJMR.mjs';
2
+ export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-SNDMYYOK.mjs';
3
3
  import './chunk-K5464A3L.mjs';
4
4
  import './chunk-DBZ3UOQ2.mjs';
5
- import './chunk-CMF2X3SI.mjs';
5
+ import './chunk-KOJZB3S4.mjs';
6
6
  import './chunk-C4M3DXKC.mjs';
7
7
  import './chunk-UBAI443T.mjs';
8
8
  import './chunk-E2T2SBP5.mjs';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { REGISTRY_INDEX } from './chunk-EALN6SAN.mjs';
2
+ import { REGISTRY_INDEX } from './chunk-OLZMA2TM.mjs';
3
3
  import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
4
4
  import { CliError, CLI_ERROR_CODE, info, bold, dim, green, result } from './chunk-E2T2SBP5.mjs';
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- export { run as default, fetchCloneToken } from './chunk-R3FDBXR6.mjs';
2
+ export { run as default, fetchCloneToken, fetchRepoRecord } from './chunk-CLNS2NBR.mjs';
3
3
  import './chunk-ITAFAORS.mjs';
4
4
  import './chunk-MXYUAJEW.mjs';
5
5
  import './chunk-C4M3DXKC.mjs';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { package_default } from './chunk-CMF2X3SI.mjs';
2
+ import { package_default } from './chunk-KOJZB3S4.mjs';
3
3
  import { promptYesNo } from './chunk-ITAFAORS.mjs';
4
4
  import { parseArgs, flagBool, flagString } from './chunk-C4M3DXKC.mjs';
5
5
  import { success, bold, info, dim, result, failure, CliError, CLI_ERROR_CODE, step, isJsonMode } from './chunk-E2T2SBP5.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/cli",
3
- "version": "0.6.9",
3
+ "version": "0.6.11",
4
4
  "description": "Cimplify CLI — deploy, manage env vars, link projects, and scaffold storefronts",
5
5
  "keywords": [
6
6
  "cimplify",
@@ -53,7 +53,9 @@ export default function RootLayout({ children }: { children: React.ReactNode })
53
53
  </Suspense>
54
54
  <Providers>
55
55
  <Header />
56
- <main className="flex-1 pb-12 w-full">{children}</main>
56
+ <main className="flex-1 pb-12 w-full">
57
+ <Suspense fallback={null}>{children}</Suspense>
58
+ </main>
57
59
  <Footer />
58
60
  <Suspense fallback={null}>
59
61
  <ProductModal />