@cimplify/cli 0.13.5 → 0.15.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-NZ47GUMD.mjs → add-EPY25NNV.mjs} +3 -3
- package/dist/{assets-OEY6FHHZ.mjs → assets-CWB72PZG.mjs} +3 -3
- package/dist/{auth-step-up-ALEUQUCE.mjs → auth-step-up-VL742AS7.mjs} +4 -4
- package/dist/{cancel-FD66LTTS.mjs → cancel-ZHVVILOU.mjs} +3 -3
- package/dist/{chunk-IK6NQHTG.mjs → chunk-3KRSHO6J.mjs} +1 -1
- package/dist/{chunk-4O4G2CDE.mjs → chunk-3QUK5BPY.mjs} +7 -3
- package/dist/{chunk-GOTWRZVM.mjs → chunk-5SMYK3U2.mjs} +5 -5
- package/dist/{chunk-OE7YRDLH.mjs → chunk-A6WHBSXZ.mjs} +26 -8
- package/dist/{dev-L3W6UXYN.mjs → chunk-F2UI225N.mjs} +5 -5
- package/dist/{chunk-5YVMA7A5.mjs → chunk-GCQKTUXN.mjs} +2 -2
- package/dist/{chunk-RU53TQLZ.mjs → chunk-I2UP7YTG.mjs} +1 -1
- package/dist/{chunk-MLVBE5V2.mjs → chunk-KN2YSKXZ.mjs} +16 -2
- package/dist/{chunk-6CHBU7O4.mjs → chunk-MLE4MVYC.mjs} +1 -1
- package/dist/{chunk-PDGKBATF.mjs → chunk-NK6VC264.mjs} +1 -1
- package/dist/{chunk-TOQGLBWF.mjs → chunk-NYXA6X56.mjs} +1 -1
- package/dist/{chunk-5ZQURRIM.mjs → chunk-TH4XENKH.mjs} +1 -1
- package/dist/{chunk-BDC7XQIL.mjs → chunk-YJDQYKZU.mjs} +9 -9
- package/dist/{deploy-SLRFPGTH.mjs → deploy-JE6TUYCL.mjs} +86 -9
- package/dist/dev-V7JSUVOI.mjs +8 -0
- package/dist/dispatcher.mjs +29 -29
- package/dist/{doctor-6NI2XNTD.mjs → doctor-TTI237ZY.mjs} +7 -7
- package/dist/{domains-7D7WJAMC.mjs → domains-BZKGIDF4.mjs} +4 -4
- package/dist/{env-PAENNABF.mjs → env-FZNXKLGL.mjs} +5 -5
- package/dist/{explain-HPRJBFHS.mjs → explain-HVK5ZNTV.mjs} +3 -3
- package/dist/{inspect-MGVG4Z44.mjs → inspect-X3M7WSTL.mjs} +2 -2
- package/dist/introspect-KTB4BXU5.mjs +8 -0
- package/dist/{link-KGNQWCSZ.mjs → link-4NM2QMI5.mjs} +21 -4
- package/dist/{lint-EYKIQ6RO.mjs → lint-DDZ7HUQN.mjs} +1 -1
- package/dist/{list-QNEUCCP5.mjs → list-L6FMY3AF.mjs} +2 -2
- package/dist/{login-NCO4P5G5.mjs → login-ZTSWYO5G.mjs} +4 -4
- package/dist/{logout-MF6SOLPE.mjs → logout-Z57X6HPE.mjs} +2 -2
- package/dist/{logs-76TCJBIQ.mjs → logs-36BLYJHJ.mjs} +3 -3
- package/dist/{mock-CAWNXSGC.mjs → mock-EVER34IX.mjs} +1 -1
- package/dist/{projects-U75DOOR7.mjs → projects-4XRNHJAH.mjs} +5 -5
- package/dist/repo-X3KZ5R64.mjs +9 -0
- package/dist/{rollback-ZL3V7SYH.mjs → rollback-WCRWXSE3.mjs} +4 -4
- package/dist/{status-52HG63FE.mjs → status-VA326DWD.mjs} +3 -3
- package/dist/{unlink-TCG3NBAR.mjs → unlink-H3BO3DOQ.mjs} +2 -2
- package/dist/{update-47HG7LN7.mjs → update-XUDRJZDE.mjs} +3 -3
- package/dist/{whoami-B5Y5KSOZ.mjs → whoami-ZWTJMEDB.mjs} +3 -3
- 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
- package/dist/introspect-3OYRCVUF.mjs +0 -8
- package/dist/repo-IE5IOLR5.mjs +0 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { promptYesNo } from './chunk-TH4XENKH.mjs';
|
|
3
|
+
import { REGISTRY_INDEX, REGISTRY } from './chunk-YJDQYKZU.mjs';
|
|
4
4
|
import { parseArgs, flagString, flagBool } from './chunk-5KYR6WJB.mjs';
|
|
5
|
-
import { CliError, CLI_ERROR_CODE, info, bold, dim, success, result, yellow } from './chunk-
|
|
5
|
+
import { CliError, CLI_ERROR_CODE, info, bold, dim, success, result, yellow } from './chunk-3QUK5BPY.mjs';
|
|
6
6
|
import { mkdirSync, existsSync, writeFileSync } from 'fs';
|
|
7
7
|
import { resolve, join, dirname } from 'path';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { parseArgs, flagString, flagBool } from './chunk-5KYR6WJB.mjs';
|
|
3
|
-
import { ApiClient } from './chunk-
|
|
4
|
-
import { readAuth } from './chunk-
|
|
5
|
-
import { CliError, CLI_ERROR_CODE, step, yellow, dim, success, info, result, bold, green } from './chunk-
|
|
3
|
+
import { ApiClient } from './chunk-NYXA6X56.mjs';
|
|
4
|
+
import { readAuth } from './chunk-MLE4MVYC.mjs';
|
|
5
|
+
import { CliError, CLI_ERROR_CODE, step, yellow, dim, success, info, result, bold, green } from './chunk-3QUK5BPY.mjs';
|
|
6
6
|
import { createHash } from 'crypto';
|
|
7
7
|
import { promises } from 'fs';
|
|
8
8
|
import path from 'path';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { startLoopbackServer, generateState, openBrowser } from './chunk-
|
|
2
|
+
import { startLoopbackServer, generateState, openBrowser } from './chunk-3KRSHO6J.mjs';
|
|
3
3
|
import { parseArgs, flagString, flagBool } from './chunk-5KYR6WJB.mjs';
|
|
4
|
-
import { resolveBaseUrl } from './chunk-
|
|
5
|
-
import { readAuth, writeStepUp } from './chunk-
|
|
6
|
-
import { isJsonMode, CliError, CLI_ERROR_CODE, step, info, dim, success, result } from './chunk-
|
|
4
|
+
import { resolveBaseUrl } from './chunk-NYXA6X56.mjs';
|
|
5
|
+
import { readAuth, writeStepUp } from './chunk-MLE4MVYC.mjs';
|
|
6
|
+
import { isJsonMode, CliError, CLI_ERROR_CODE, step, info, dim, success, result } from './chunk-3QUK5BPY.mjs';
|
|
7
7
|
|
|
8
8
|
// src/commands/auth-step-up.ts
|
|
9
9
|
var FLAG_NO_BROWSER = "no-browser";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { parseArgs } from './chunk-5KYR6WJB.mjs';
|
|
3
|
-
import { ApiClient } from './chunk-
|
|
4
|
-
import { readAuth, readProjectLink } from './chunk-
|
|
5
|
-
import { CliError, CLI_ERROR_CODE, success, result } from './chunk-
|
|
3
|
+
import { ApiClient } from './chunk-NYXA6X56.mjs';
|
|
4
|
+
import { readAuth, readProjectLink } from './chunk-MLE4MVYC.mjs';
|
|
5
|
+
import { CliError, CLI_ERROR_CODE, success, result } from './chunk-3QUK5BPY.mjs';
|
|
6
6
|
|
|
7
7
|
// src/commands/cancel.ts
|
|
8
8
|
function cancelEndpoint(businessId, projectId, deploymentId) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { CliError, CLI_ERROR_CODE } from './chunk-
|
|
2
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-3QUK5BPY.mjs';
|
|
3
3
|
import { randomBytes, createHash } from 'crypto';
|
|
4
4
|
import { createServer } from 'http';
|
|
5
5
|
import { spawn } from 'child_process';
|
|
@@ -18,7 +18,9 @@ var CLI_ERROR_CODE = {
|
|
|
18
18
|
/** Generic resource-not-found (e.g. unknown registry component, missing local fixture). */
|
|
19
19
|
NOT_FOUND: "NOT_FOUND",
|
|
20
20
|
/** Destructive op needs a fresh user re-auth — run `cimplify auth step-up`. */
|
|
21
|
-
STEP_UP_REQUIRED: "STEP_UP_REQUIRED"
|
|
21
|
+
STEP_UP_REQUIRED: "STEP_UP_REQUIRED",
|
|
22
|
+
/** The project's local build failed, so the deploy was not started. */
|
|
23
|
+
BUILD_FAILED: "BUILD_FAILED"
|
|
22
24
|
};
|
|
23
25
|
var EXIT_CODE = {
|
|
24
26
|
OK: 0,
|
|
@@ -38,7 +40,8 @@ var EXIT_CODE = {
|
|
|
38
40
|
AUTH_FAILED: 21,
|
|
39
41
|
UNAUTHORIZED: 22,
|
|
40
42
|
STEP_UP_REQUIRED: 23,
|
|
41
|
-
INVALID_INPUT: 30
|
|
43
|
+
INVALID_INPUT: 30,
|
|
44
|
+
BUILD_FAILED: 31
|
|
42
45
|
};
|
|
43
46
|
var EXIT_CODE_FOR = {
|
|
44
47
|
NOT_LOGGED_IN: EXIT_CODE.NOT_LOGGED_IN,
|
|
@@ -55,7 +58,8 @@ var EXIT_CODE_FOR = {
|
|
|
55
58
|
TIMEOUT: EXIT_CODE.TIMEOUT,
|
|
56
59
|
INTERACTIVE_REQUIRED: EXIT_CODE.INTERACTIVE_REQUIRED,
|
|
57
60
|
NOT_FOUND: EXIT_CODE.NOT_FOUND,
|
|
58
|
-
STEP_UP_REQUIRED: EXIT_CODE.STEP_UP_REQUIRED
|
|
61
|
+
STEP_UP_REQUIRED: EXIT_CODE.STEP_UP_REQUIRED,
|
|
62
|
+
BUILD_FAILED: EXIT_CODE.BUILD_FAILED
|
|
59
63
|
};
|
|
60
64
|
var CliError = class extends Error {
|
|
61
65
|
code;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { parseEnvFile } from './chunk-I2UP7YTG.mjs';
|
|
3
|
+
import { package_default } from './chunk-GCQKTUXN.mjs';
|
|
4
|
+
import { gitDetectRoot, gitCurrentBranch, gitCurrentSha, gitStatusPorcelain } from './chunk-KN2YSKXZ.mjs';
|
|
5
5
|
import { parseArgs } from './chunk-5KYR6WJB.mjs';
|
|
6
|
-
import { readAuthOrNull, readProjectLinkOrNull, readProjectState } from './chunk-
|
|
7
|
-
import { bold, dim, yellow, green, info, result, red } from './chunk-
|
|
6
|
+
import { readAuthOrNull, readProjectLinkOrNull, readProjectState } from './chunk-MLE4MVYC.mjs';
|
|
7
|
+
import { bold, dim, yellow, green, info, result, red } from './chunk-3QUK5BPY.mjs';
|
|
8
8
|
import { promises } from 'fs';
|
|
9
9
|
import path from 'path';
|
|
10
10
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { promptYesNo } from './chunk-
|
|
2
|
+
import { promptYesNo } from './chunk-TH4XENKH.mjs';
|
|
3
3
|
import { TOKEN_PURPOSE, REPO_PROVIDER, REPO_PROVIDER_VALUES } from './chunk-MXYUAJEW.mjs';
|
|
4
|
+
import { gitRemoteHead } from './chunk-KN2YSKXZ.mjs';
|
|
4
5
|
import { parseArgs, flagString, flagBool } from './chunk-5KYR6WJB.mjs';
|
|
5
|
-
import { ApiClient } from './chunk-
|
|
6
|
-
import { readAuth, readProjectLink } from './chunk-
|
|
7
|
-
import { CliError, CLI_ERROR_CODE, isJsonMode, result, dim, success, info, bold } from './chunk-
|
|
6
|
+
import { ApiClient } from './chunk-NYXA6X56.mjs';
|
|
7
|
+
import { readAuth, readProjectLink } from './chunk-MLE4MVYC.mjs';
|
|
8
|
+
import { CliError, CLI_ERROR_CODE, isJsonMode, result, dim, success, info, bold } from './chunk-3QUK5BPY.mjs';
|
|
8
9
|
|
|
9
10
|
// src/commands/repo.ts
|
|
10
11
|
var SUB_PROVISION = "provision";
|
|
@@ -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
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { parseEnvFile, formatEnvFile } from './chunk-
|
|
2
|
+
import { parseEnvFile, formatEnvFile } from './chunk-I2UP7YTG.mjs';
|
|
3
3
|
import { ENV_SCOPE, PUBLIC_ENV_PREFIX } from './chunk-MXYUAJEW.mjs';
|
|
4
4
|
import { parseArgs, flagBool } from './chunk-5KYR6WJB.mjs';
|
|
5
|
-
import { ApiClient } from './chunk-
|
|
6
|
-
import { readAuth, readProjectLink } from './chunk-
|
|
7
|
-
import { info, CliError, CLI_ERROR_CODE, dim } from './chunk-
|
|
5
|
+
import { ApiClient } from './chunk-NYXA6X56.mjs';
|
|
6
|
+
import { readAuth, readProjectLink } from './chunk-MLE4MVYC.mjs';
|
|
7
|
+
import { info, CliError, CLI_ERROR_CODE, dim } from './chunk-3QUK5BPY.mjs';
|
|
8
8
|
import { spawn } from 'child_process';
|
|
9
9
|
import { promises } from 'fs';
|
|
10
10
|
import path from 'path';
|
|
@@ -159,4 +159,4 @@ async function run(argv) {
|
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
export {
|
|
162
|
+
export { detectPackageManager, mergeEnvEntries, run };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// package.json
|
|
3
3
|
var package_default = {
|
|
4
4
|
name: "@cimplify/cli",
|
|
5
|
-
version: "0.
|
|
5
|
+
version: "0.15.0",
|
|
6
6
|
description: "Cimplify CLI \u2014 deploy, manage env vars, link projects, and scaffold storefronts",
|
|
7
7
|
keywords: [
|
|
8
8
|
"cimplify",
|
|
@@ -43,7 +43,7 @@ var package_default = {
|
|
|
43
43
|
"@babel/parser": "^8.0.4",
|
|
44
44
|
"@babel/traverse": "^8.0.4",
|
|
45
45
|
"@babel/types": "^8.0.4",
|
|
46
|
-
"@cimplify/sdk": "^0.
|
|
46
|
+
"@cimplify/sdk": "^0.102.0",
|
|
47
47
|
re2js: "^1.4.0"
|
|
48
48
|
},
|
|
49
49
|
devDependencies: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { CliError, CLI_ERROR_CODE } from './chunk-
|
|
2
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-3QUK5BPY.mjs';
|
|
3
3
|
import { spawn } from 'child_process';
|
|
4
4
|
|
|
5
5
|
var GIT_BINARY = "git";
|
|
@@ -10,6 +10,8 @@ var ARGS_REV_PARSE_HEAD = ["rev-parse", "HEAD"];
|
|
|
10
10
|
var ARGS_REV_PARSE_ABBREV_REF = ["rev-parse", "--abbrev-ref", "HEAD"];
|
|
11
11
|
var ARGS_REV_PARSE_SHOW_TOPLEVEL = ["rev-parse", "--show-toplevel"];
|
|
12
12
|
var ARGS_REMOTE_GET_URL = ["remote", "get-url"];
|
|
13
|
+
var ARGS_REMOTE_ADD = ["remote", "add"];
|
|
14
|
+
var ARGS_LS_REMOTE = ["ls-remote"];
|
|
13
15
|
var ARGS_PUSH = ["push"];
|
|
14
16
|
async function runGit(args, cwd) {
|
|
15
17
|
return new Promise((resolve, reject) => {
|
|
@@ -59,6 +61,18 @@ async function gitGetRemoteUrl(cwd, name = REMOTE_DEFAULT) {
|
|
|
59
61
|
if (code !== 0) return null;
|
|
60
62
|
return stdout.trimEnd() || null;
|
|
61
63
|
}
|
|
64
|
+
async function gitAddRemote(cwd, url, name = REMOTE_DEFAULT) {
|
|
65
|
+
await runGitOk([...ARGS_REMOTE_ADD, name, url], cwd);
|
|
66
|
+
}
|
|
67
|
+
async function gitRemoteHead(cwd, url, branch) {
|
|
68
|
+
const { code, stdout } = await runGit(
|
|
69
|
+
[...ARGS_LS_REMOTE, url, `refs/heads/${branch}`],
|
|
70
|
+
cwd
|
|
71
|
+
);
|
|
72
|
+
if (code !== 0) return null;
|
|
73
|
+
const sha = stdout.split(/\s+/)[0]?.trim();
|
|
74
|
+
return sha || null;
|
|
75
|
+
}
|
|
62
76
|
async function gitPush(cwd, branch) {
|
|
63
77
|
const args = branch ? [...ARGS_PUSH, REMOTE_DEFAULT, branch] : [...ARGS_PUSH];
|
|
64
78
|
await runGitOk(args, cwd);
|
|
@@ -76,4 +90,4 @@ function isFreestyleRemote(url) {
|
|
|
76
90
|
}
|
|
77
91
|
}
|
|
78
92
|
|
|
79
|
-
export { gitCurrentBranch, gitCurrentSha, gitDetectRoot, gitGetRemoteUrl, gitPush, gitPushToUrl, gitStatusPorcelain, isFreestyleRemote };
|
|
93
|
+
export { gitAddRemote, gitCurrentBranch, gitCurrentSha, gitDetectRoot, gitGetRemoteUrl, gitPush, gitPushToUrl, gitRemoteHead, gitStatusPorcelain, isFreestyleRemote };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { TERMINAL_DEPLOYMENT_STATUSES, DEPLOYMENT_STATUS } from './chunk-MXYUAJEW.mjs';
|
|
3
|
-
import { dim, CliError, CLI_ERROR_CODE, failure, success, isJsonMode } from './chunk-
|
|
3
|
+
import { dim, CliError, CLI_ERROR_CODE, failure, success, isJsonMode } from './chunk-3QUK5BPY.mjs';
|
|
4
4
|
|
|
5
5
|
// src/progress.ts
|
|
6
6
|
var POLL_INTERVAL_MS = 1e3;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { isAutoYes, isInteractive, CliError, CLI_ERROR_CODE } from './chunk-
|
|
2
|
+
import { isAutoYes, isInteractive, CliError, CLI_ERROR_CODE } from './chunk-3QUK5BPY.mjs';
|
|
3
3
|
import readline from 'readline';
|
|
4
4
|
|
|
5
5
|
async function promptLine(question) {
|