@cimplify/cli 0.6.10 → 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.
- package/dist/{add-GDHA7MKM.mjs → add-5G7UZ6DA.mjs} +1 -1
- package/dist/{chunk-R3FDBXR6.mjs → chunk-CLNS2NBR.mjs} +4 -1
- package/dist/{chunk-5L6LJE6I.mjs → chunk-KOJZB3S4.mjs} +1 -1
- package/dist/{chunk-EKJ6T66O.mjs → chunk-OLZMA2TM.mjs} +7 -7
- package/dist/{chunk-ZTKQOLAC.mjs → chunk-SNDMYYOK.mjs} +1 -1
- package/dist/{deploy-7BPO5BNB.mjs → deploy-YVCYHNSS.mjs} +48 -19
- package/dist/dispatcher.mjs +11 -11
- package/dist/{doctor-SSSYBYCL.mjs → doctor-3UOTPOJ6.mjs} +2 -2
- package/dist/{explain-VG7XUP62.mjs → explain-DXJ3R52F.mjs} +1 -1
- package/dist/{introspect-HYJ6VI3U.mjs → introspect-77SUZ5X5.mjs} +2 -2
- package/dist/{list-NQP4SU5K.mjs → list-QX7RM3P3.mjs} +1 -1
- package/dist/{repo-WOBWKEAO.mjs → repo-KNQMSPVV.mjs} +1 -1
- package/dist/{update-HHRCPKSU.mjs → update-UHKPFT6F.mjs} +1 -1
- package/package.json +1 -1
- package/templates/storefront-auto/bun.lock +428 -0
- package/templates/storefront-fashion/bun.lock +437 -0
- package/templates/storefront-grocery/bun.lock +428 -0
- package/templates/storefront-pharmacy/bun.lock +428 -0
- package/templates/storefront-restaurant/bun.lock +428 -0
- package/templates/storefront-retail/bun.lock +428 -0
- package/templates/storefront-services/bun.lock +428 -0
|
@@ -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-
|
|
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,
|
|
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-
|
|
4
|
+
import { fetchRepoRecord, fetchCloneToken } from './chunk-CLNS2NBR.mjs';
|
|
5
5
|
import { promptYesNo } from './chunk-ITAFAORS.mjs';
|
|
6
|
-
import {
|
|
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,
|
|
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
|
-
|
|
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 };
|
package/dist/dispatcher.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { TEMPLATES } from './chunk-
|
|
3
|
-
import { package_default } from './chunk-
|
|
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-
|
|
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-
|
|
141
|
-
doctor: () => import('./doctor-
|
|
142
|
-
explain: () => import('./explain-
|
|
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-
|
|
145
|
-
list: () => import('./list-
|
|
146
|
-
add: () => import('./add-
|
|
147
|
-
update: () => import('./update-
|
|
148
|
-
upgrade: () => import('./update-
|
|
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-
|
|
2
|
+
import { gatherIntrospection } from './chunk-SNDMYYOK.mjs';
|
|
3
3
|
import './chunk-K5464A3L.mjs';
|
|
4
4
|
import './chunk-DBZ3UOQ2.mjs';
|
|
5
|
-
import './chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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';
|