@cimplify/cli 0.13.5 → 0.14.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.
Files changed (25) hide show
  1. package/dist/{add-NZ47GUMD.mjs → add-PPUGTTDA.mjs} +1 -1
  2. package/dist/{chunk-OE7YRDLH.mjs → chunk-7CI5RWNE.mjs} +22 -4
  3. package/dist/{chunk-BDC7XQIL.mjs → chunk-JOF7ESSA.mjs} +9 -9
  4. package/dist/{chunk-5YVMA7A5.mjs → chunk-KAZMZD4X.mjs} +2 -2
  5. package/dist/{chunk-GOTWRZVM.mjs → chunk-SOYZZZVT.mjs} +2 -2
  6. package/dist/{chunk-MLVBE5V2.mjs → chunk-YIBOOKQQ.mjs} +15 -1
  7. package/dist/{deploy-SLRFPGTH.mjs → deploy-64ZVAQ3R.mjs} +36 -3
  8. package/dist/dispatcher.mjs +13 -13
  9. package/dist/{doctor-6NI2XNTD.mjs → doctor-6ZIFM5J5.mjs} +3 -3
  10. package/dist/{explain-HPRJBFHS.mjs → explain-REIDDRKC.mjs} +2 -2
  11. package/dist/{introspect-3OYRCVUF.mjs → introspect-APRI7R7K.mjs} +3 -3
  12. package/dist/{link-KGNQWCSZ.mjs → link-AWC7VJNN.mjs} +18 -1
  13. package/dist/{list-QNEUCCP5.mjs → list-7ZL6FRKT.mjs} +1 -1
  14. package/dist/{projects-U75DOOR7.mjs → projects-P65SUETQ.mjs} +2 -2
  15. package/dist/{repo-IE5IOLR5.mjs → repo-ZPYZK3KW.mjs} +2 -1
  16. package/dist/{update-47HG7LN7.mjs → update-MBEPZANS.mjs} +1 -1
  17. package/package.json +2 -2
  18. package/templates/storefront-auto/package.json +1 -1
  19. package/templates/storefront-bakery/package.json +1 -1
  20. package/templates/storefront-fashion/package.json +1 -1
  21. package/templates/storefront-grocery/package.json +1 -1
  22. package/templates/storefront-pharmacy/package.json +1 -1
  23. package/templates/storefront-restaurant/package.json +1 -1
  24. package/templates/storefront-retail/package.json +1 -1
  25. package/templates/storefront-services/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { REGISTRY_INDEX, REGISTRY } from './chunk-BDC7XQIL.mjs';
2
+ import { REGISTRY_INDEX, REGISTRY } from './chunk-JOF7ESSA.mjs';
3
3
  import { promptYesNo } from './chunk-5ZQURRIM.mjs';
4
4
  import { parseArgs, flagString, flagBool } from './chunk-5KYR6WJB.mjs';
5
5
  import { CliError, CLI_ERROR_CODE, info, bold, dim, success, result, yellow } from './chunk-4O4G2CDE.mjs';
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { promptYesNo } from './chunk-5ZQURRIM.mjs';
3
3
  import { TOKEN_PURPOSE, REPO_PROVIDER, REPO_PROVIDER_VALUES } from './chunk-MXYUAJEW.mjs';
4
+ import { gitRemoteHead } from './chunk-YIBOOKQQ.mjs';
4
5
  import { parseArgs, flagString, flagBool } from './chunk-5KYR6WJB.mjs';
5
6
  import { ApiClient } from './chunk-TOQGLBWF.mjs';
6
7
  import { readAuth, readProjectLink } from './chunk-6CHBU7O4.mjs';
@@ -171,8 +172,20 @@ async function repoInfo(client, businessId, projectId) {
171
172
  result({ repo: null });
172
173
  return;
173
174
  }
175
+ const remoteHead = await resolveRemoteHead(client, businessId, projectId, repo);
174
176
  printRepo(repo);
175
- result({ repo: repoPayload(repo) });
177
+ if (remoteHead) {
178
+ info(` remote_head: ${remoteHead.slice(0, 12)}`);
179
+ }
180
+ result({ repo: repoPayload(repo, remoteHead) });
181
+ }
182
+ async function resolveRemoteHead(client, businessId, projectId, repo) {
183
+ try {
184
+ const url = repo.provider === REPO_PROVIDER.FREESTYLE ? (await fetchCloneToken(client, businessId, projectId)).clone_url : repo.remote_url;
185
+ return await gitRemoteHead(process.cwd(), url, repo.default_branch);
186
+ } catch {
187
+ return null;
188
+ }
176
189
  }
177
190
  async function unlinkRepo(client, businessId, projectId, args) {
178
191
  const purge = flagBool(args, FLAG_PURGE);
@@ -197,17 +210,22 @@ function printRepo(repo) {
197
210
  info(` remote_url: ${repo.remote_url}`);
198
211
  info(` default_branch: ${repo.default_branch}`);
199
212
  if (repo.last_pushed_commit) {
200
- info(` last_pushed: ${repo.last_pushed_commit.slice(0, 12)} (${repo.last_pushed_at ?? "\u2014"})`);
213
+ info(` last_deployed: ${repo.last_pushed_commit.slice(0, 12)} (${repo.last_pushed_at ?? "\u2014"})`);
201
214
  }
202
215
  }
203
- function repoPayload(repo) {
216
+ function repoPayload(repo, remoteHead) {
204
217
  return {
205
218
  provider: repo.provider,
206
219
  id: repo.id,
207
220
  remote_url: repo.remote_url,
208
221
  default_branch: repo.default_branch,
222
+ // The server field only advances on `cimplify deploy`; `last_pushed_commit`
223
+ // is kept one release as a deprecated alias for parsers.
224
+ last_deployed_commit: repo.last_pushed_commit ?? null,
225
+ last_deployed_at: repo.last_pushed_at ?? null,
209
226
  last_pushed_commit: repo.last_pushed_commit ?? null,
210
- last_pushed_at: repo.last_pushed_at ?? null
227
+ last_pushed_at: repo.last_pushed_at ?? null,
228
+ remote_head_commit: remoteHead ?? null
211
229
  };
212
230
  }
213
231