@cimplify/cli 0.13.4 → 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.
- package/dist/{add-542NLKYG.mjs → add-PPUGTTDA.mjs} +1 -1
- package/dist/{chunk-OE7YRDLH.mjs → chunk-7CI5RWNE.mjs} +22 -4
- package/dist/{chunk-VCDGYXFU.mjs → chunk-JOF7ESSA.mjs} +9 -9
- package/dist/{chunk-7NUSJVN3.mjs → chunk-KAZMZD4X.mjs} +2 -2
- package/dist/{chunk-HJQ6PF5N.mjs → chunk-SOYZZZVT.mjs} +2 -2
- package/dist/{chunk-MLVBE5V2.mjs → chunk-YIBOOKQQ.mjs} +15 -1
- package/dist/{deploy-SLRFPGTH.mjs → deploy-64ZVAQ3R.mjs} +36 -3
- package/dist/dispatcher.mjs +14 -14
- package/dist/{doctor-E6JH4VSN.mjs → doctor-6ZIFM5J5.mjs} +3 -3
- package/dist/{explain-SZPLL5MP.mjs → explain-REIDDRKC.mjs} +2 -2
- package/dist/{introspect-SDHD3PVX.mjs → introspect-APRI7R7K.mjs} +3 -3
- package/dist/{link-KGNQWCSZ.mjs → link-AWC7VJNN.mjs} +18 -1
- package/dist/{lint-NM3APP7L.mjs → lint-EYKIQ6RO.mjs} +9 -5
- package/dist/{list-W5JABY7B.mjs → list-7ZL6FRKT.mjs} +1 -1
- package/dist/{projects-U75DOOR7.mjs → projects-P65SUETQ.mjs} +2 -2
- package/dist/{repo-IE5IOLR5.mjs → repo-ZPYZK3KW.mjs} +2 -1
- package/dist/{update-447FR363.mjs → update-MBEPZANS.mjs} +1 -1
- package/package.json +2 -2
- package/templates/storefront-auto/package.json +1 -1
- package/templates/storefront-bakery/package.json +1 -1
- package/templates/storefront-fashion/package.json +1 -1
- package/templates/storefront-grocery/package.json +1 -1
- package/templates/storefront-pharmacy/package.json +1 -1
- package/templates/storefront-restaurant/package.json +1 -1
- package/templates/storefront-retail/package.json +1 -1
- 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-
|
|
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
|
-
|
|
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(`
|
|
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
|
|