@getjack/jack 0.1.15 → 0.1.16
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/package.json +2 -1
- package/src/commands/clone.ts +2 -1
- package/src/commands/down.ts +11 -22
- package/src/commands/link.ts +5 -5
- package/src/commands/projects.ts +2 -2
- package/src/commands/publish.ts +2 -2
- package/src/commands/services.ts +6 -9
- package/src/commands/sync.ts +6 -4
- package/src/lib/build-helper.ts +3 -3
- package/src/lib/wrangler.ts +2 -0
- package/src/mcp/utils.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getjack/jack",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "Ship before you forget why you started. The vibecoder's deployment CLI.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"bun-types": "latest"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
+
"@clack/prompts": "^0.11.0",
|
|
44
45
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
45
46
|
"archiver": "^7.0.1",
|
|
46
47
|
"fflate": "^0.8.2",
|
package/src/commands/clone.ts
CHANGED
|
@@ -72,7 +72,8 @@ export default async function clone(projectName?: string, flags: CloneFlags = {}
|
|
|
72
72
|
|
|
73
73
|
if (!result.success) {
|
|
74
74
|
downloadSpin.error("Clone failed");
|
|
75
|
-
error(result.error || "
|
|
75
|
+
error(result.error || "Could not download project files");
|
|
76
|
+
info("Check your network connection and try again");
|
|
76
77
|
process.exit(1);
|
|
77
78
|
}
|
|
78
79
|
|
package/src/commands/down.ts
CHANGED
|
@@ -100,27 +100,10 @@ export default async function down(projectName?: string, flags: DownFlags = {}):
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
// Track auth state for final messaging
|
|
104
|
+
let authState: Awaited<ReturnType<typeof getAuthState>> | null = null;
|
|
103
105
|
if (!resolved && !link) {
|
|
104
|
-
|
|
105
|
-
const authState = await getAuthState();
|
|
106
|
-
|
|
107
|
-
if (authState === "logged-in") {
|
|
108
|
-
// We're logged in and control plane didn't find it - definitely not a managed project
|
|
109
|
-
warn(`Project '${name}' not tracked by jack`);
|
|
110
|
-
info("Checking your Cloudflare account...");
|
|
111
|
-
} else if (authState === "session-expired") {
|
|
112
|
-
// Session expired - can't verify if this is a managed project
|
|
113
|
-
warn(`Project '${name}' not found locally`);
|
|
114
|
-
info("Session expired - can't check jack cloud");
|
|
115
|
-
info("If this was deployed via jack, run: jack login");
|
|
116
|
-
info("Checking your Cloudflare account...");
|
|
117
|
-
} else {
|
|
118
|
-
// Not logged in - can't verify if this is a managed project
|
|
119
|
-
warn(`Project '${name}' not found locally`);
|
|
120
|
-
info("Not logged in - can't check jack cloud");
|
|
121
|
-
info("If this was deployed via jack, run: jack login");
|
|
122
|
-
info("Checking your Cloudflare account...");
|
|
123
|
-
}
|
|
106
|
+
authState = await getAuthState();
|
|
124
107
|
}
|
|
125
108
|
|
|
126
109
|
// Check if this is a managed project (from link or resolved data)
|
|
@@ -153,8 +136,14 @@ export default async function down(projectName?: string, flags: DownFlags = {}):
|
|
|
153
136
|
|
|
154
137
|
if (!workerExists) {
|
|
155
138
|
console.error("");
|
|
156
|
-
|
|
157
|
-
|
|
139
|
+
error(`Project '${name}' not found`);
|
|
140
|
+
if (authState === "session-expired") {
|
|
141
|
+
info("Session expired. Run: jack login");
|
|
142
|
+
} else if (authState === "not-logged-in") {
|
|
143
|
+
info("Not logged in. Run: jack login");
|
|
144
|
+
} else {
|
|
145
|
+
info("Run jack projects to see your projects");
|
|
146
|
+
}
|
|
158
147
|
return;
|
|
159
148
|
}
|
|
160
149
|
|
package/src/commands/link.ts
CHANGED
|
@@ -46,11 +46,11 @@ export default async function link(projectName?: string, flags: LinkFlags = {}):
|
|
|
46
46
|
// BYO mode - generate local ID
|
|
47
47
|
if (flags.byo) {
|
|
48
48
|
const projectId = generateByoProjectId();
|
|
49
|
-
output.start("
|
|
49
|
+
output.start("Linking to your Cloudflare account...");
|
|
50
50
|
await linkProject(process.cwd(), projectId, "byo");
|
|
51
51
|
await registerPath(projectId, process.cwd());
|
|
52
52
|
output.stop();
|
|
53
|
-
success("Linked
|
|
53
|
+
success("Linked to your Cloudflare account");
|
|
54
54
|
info(`Project ID: ${projectId}`);
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
@@ -62,7 +62,7 @@ export default async function link(projectName?: string, flags: LinkFlags = {}):
|
|
|
62
62
|
// Not logged in and no project name - suggest options
|
|
63
63
|
error("Not logged in to jack cloud");
|
|
64
64
|
info("Login with: jack login");
|
|
65
|
-
info("Or
|
|
65
|
+
info("Or link to your Cloudflare account: jack link --byo");
|
|
66
66
|
process.exit(1);
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -118,9 +118,9 @@ export default async function link(projectName?: string, flags: LinkFlags = {}):
|
|
|
118
118
|
output.stop();
|
|
119
119
|
|
|
120
120
|
if (projects.length === 0) {
|
|
121
|
-
error("No
|
|
121
|
+
error("No projects found");
|
|
122
122
|
info("Create one with: jack new");
|
|
123
|
-
info("Or link
|
|
123
|
+
info("Or link to your Cloudflare account: jack link --byo");
|
|
124
124
|
process.exit(1);
|
|
125
125
|
}
|
|
126
126
|
|
package/src/commands/projects.ts
CHANGED
|
@@ -448,7 +448,7 @@ async function removeProjectEntry(args: string[]): Promise<void> {
|
|
|
448
448
|
// Warn if still deployed
|
|
449
449
|
if (project.status === "live") {
|
|
450
450
|
console.error("");
|
|
451
|
-
warn("Project is still
|
|
451
|
+
warn("Project is still live; this only removes it from jack, not from Cloudflare");
|
|
452
452
|
}
|
|
453
453
|
|
|
454
454
|
console.error("");
|
|
@@ -496,7 +496,7 @@ async function removeProjectEntry(args: string[]): Promise<void> {
|
|
|
496
496
|
// Hint about undeploying
|
|
497
497
|
if (project.status === "live") {
|
|
498
498
|
console.error("");
|
|
499
|
-
info(`To
|
|
499
|
+
info(`To take it offline: jack down ${name}`);
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
|
package/src/commands/publish.ts
CHANGED
|
@@ -12,8 +12,8 @@ export default async function publish(): Promise<void> {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
if (link.deploy_mode !== "managed") {
|
|
15
|
-
output.error("Only
|
|
16
|
-
output.info("Projects
|
|
15
|
+
output.error("Only jack cloud projects can be published");
|
|
16
|
+
output.info("Projects on your own Cloudflare account cannot be published");
|
|
17
17
|
process.exit(1);
|
|
18
18
|
}
|
|
19
19
|
|
package/src/commands/services.ts
CHANGED
|
@@ -186,9 +186,8 @@ async function dbInfo(options: ServiceOptions): Promise<void> {
|
|
|
186
186
|
|
|
187
187
|
if (!dbInfo) {
|
|
188
188
|
console.error("");
|
|
189
|
-
error("No database found for this project
|
|
190
|
-
info("
|
|
191
|
-
info("For BYO projects, add d1_databases to your wrangler.jsonc");
|
|
189
|
+
error("No database found for this project");
|
|
190
|
+
info("Create one with: jack services db create");
|
|
192
191
|
console.error("");
|
|
193
192
|
return;
|
|
194
193
|
}
|
|
@@ -228,9 +227,8 @@ async function dbExport(options: ServiceOptions): Promise<void> {
|
|
|
228
227
|
|
|
229
228
|
if (!dbInfo) {
|
|
230
229
|
console.error("");
|
|
231
|
-
error("No database found for this project
|
|
232
|
-
info("
|
|
233
|
-
info("For BYO projects, add d1_databases to your wrangler.jsonc");
|
|
230
|
+
error("No database found for this project");
|
|
231
|
+
info("Create one with: jack services db create");
|
|
234
232
|
console.error("");
|
|
235
233
|
return;
|
|
236
234
|
}
|
|
@@ -267,9 +265,8 @@ async function dbDelete(options: ServiceOptions): Promise<void> {
|
|
|
267
265
|
|
|
268
266
|
if (!dbInfo) {
|
|
269
267
|
console.error("");
|
|
270
|
-
error("No database found for this project
|
|
271
|
-
info("
|
|
272
|
-
info("For BYO projects, add d1_databases to your wrangler.jsonc");
|
|
268
|
+
error("No database found for this project");
|
|
269
|
+
info("Create one with: jack services db create");
|
|
273
270
|
console.error("");
|
|
274
271
|
return;
|
|
275
272
|
}
|
package/src/commands/sync.ts
CHANGED
|
@@ -20,8 +20,8 @@ export default async function sync(flags: SyncFlags = {}): Promise<void> {
|
|
|
20
20
|
|
|
21
21
|
// Check for wrangler config
|
|
22
22
|
if (!hasWranglerConfig()) {
|
|
23
|
-
error("
|
|
24
|
-
|
|
23
|
+
error("Not in a project directory");
|
|
24
|
+
info("Run jack new <name> to create a project");
|
|
25
25
|
process.exit(1);
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -39,10 +39,12 @@ export default async function sync(flags: SyncFlags = {}): Promise<void> {
|
|
|
39
39
|
const result = await syncToCloud(projectDir, { force, dryRun, verbose });
|
|
40
40
|
|
|
41
41
|
if (!result.success) {
|
|
42
|
-
syncSpin.
|
|
42
|
+
syncSpin.stop();
|
|
43
|
+
error("Sync failed");
|
|
43
44
|
if (result.error) {
|
|
44
|
-
|
|
45
|
+
info(result.error);
|
|
45
46
|
}
|
|
47
|
+
info("Check your network connection and try again");
|
|
46
48
|
process.exit(1);
|
|
47
49
|
}
|
|
48
50
|
|
package/src/lib/build-helper.ts
CHANGED
|
@@ -217,11 +217,11 @@ export async function buildProject(options: BuildOptions): Promise<BuildOutput>
|
|
|
217
217
|
|
|
218
218
|
if (dryRunResult.exitCode !== 0) {
|
|
219
219
|
reporter?.stop();
|
|
220
|
-
reporter?.error("
|
|
220
|
+
reporter?.error("Build failed");
|
|
221
221
|
throw new JackError(
|
|
222
222
|
JackErrorCode.BUILD_FAILED,
|
|
223
|
-
"
|
|
224
|
-
"Check your
|
|
223
|
+
"Build failed",
|
|
224
|
+
"Check your code for syntax errors",
|
|
225
225
|
{
|
|
226
226
|
exitCode: dryRunResult.exitCode,
|
|
227
227
|
stderr: dryRunResult.stderr.toString(),
|
package/src/lib/wrangler.ts
CHANGED
|
@@ -32,6 +32,7 @@ export async function ensureWrangler(): Promise<void> {
|
|
|
32
32
|
|
|
33
33
|
if (install.exitCode !== 0) {
|
|
34
34
|
spin.error("Failed to install wrangler");
|
|
35
|
+
error("Try manually: bun add -g wrangler");
|
|
35
36
|
process.exit(1);
|
|
36
37
|
}
|
|
37
38
|
spin.success("Installed wrangler");
|
|
@@ -53,6 +54,7 @@ export async function ensureAuth(): Promise<void> {
|
|
|
53
54
|
|
|
54
55
|
if (login.exitCode !== 0) {
|
|
55
56
|
error("Failed to authenticate with Cloudflare");
|
|
57
|
+
error("Try manually: wrangler login");
|
|
56
58
|
process.exit(1);
|
|
57
59
|
}
|
|
58
60
|
}
|
package/src/mcp/utils.ts
CHANGED
|
@@ -142,6 +142,6 @@ export function getSuggestionForError(code: McpErrorCode): string {
|
|
|
142
142
|
return "Review the error message and ensure all required fields are provided correctly.";
|
|
143
143
|
|
|
144
144
|
default:
|
|
145
|
-
return "
|
|
145
|
+
return "Check the error message above for details. If the problem persists, try running the equivalent CLI command directly.";
|
|
146
146
|
}
|
|
147
147
|
}
|