workspace-manager-cli 1.0.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/README.md +339 -0
- package/dist/build.d.ts +19 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +384 -0
- package/dist/build.js.map +1 -0
- package/dist/bundler/build-bundler.d.ts +9 -0
- package/dist/bundler/build-bundler.d.ts.map +1 -0
- package/dist/bundler/build-bundler.js +218 -0
- package/dist/bundler/build-bundler.js.map +1 -0
- package/dist/bundler/package-merger.d.ts +21 -0
- package/dist/bundler/package-merger.d.ts.map +1 -0
- package/dist/bundler/package-merger.js +192 -0
- package/dist/bundler/package-merger.js.map +1 -0
- package/dist/bundler/vite-generator.d.ts +14 -0
- package/dist/bundler/vite-generator.d.ts.map +1 -0
- package/dist/bundler/vite-generator.js +186 -0
- package/dist/bundler/vite-generator.js.map +1 -0
- package/dist/config.d.ts +250 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +268 -0
- package/dist/config.js.map +1 -0
- package/dist/copy.d.ts +9 -0
- package/dist/copy.d.ts.map +1 -0
- package/dist/copy.js +56 -0
- package/dist/copy.js.map +1 -0
- package/dist/git.d.ts +76 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +377 -0
- package/dist/git.js.map +1 -0
- package/dist/index-update-base.d.ts +2 -0
- package/dist/index-update-base.d.ts.map +1 -0
- package/dist/index-update-base.js +76 -0
- package/dist/index-update-base.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +626 -0
- package/dist/index.js.map +1 -0
- package/dist/lock.d.ts +39 -0
- package/dist/lock.d.ts.map +1 -0
- package/dist/lock.js +91 -0
- package/dist/lock.js.map +1 -0
- package/dist/logger.d.ts +42 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +90 -0
- package/dist/logger.js.map +1 -0
- package/dist/status.d.ts +23 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +158 -0
- package/dist/status.js.map +1 -0
- package/package.json +47 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { select, confirm, input } from "@inquirer/prompts";
|
|
4
|
+
import { existsSync, writeFileSync } from "fs";
|
|
5
|
+
import { join } from "path";
|
|
6
|
+
import { loadConfig, getProjectTypeDescription, persistHashesToWorkspaceConfig, } from "./config.js";
|
|
7
|
+
import { cloneToCache, cloneBaseToCache, cloneCoreToCache, fetchLatest, checkoutRef, getCorePath, getGitInfo, listRemoteRefs, listRemoteRefsFromUrl, isGitRepo, } from "./git.js";
|
|
8
|
+
import { buildWorkspace } from "./build.js";
|
|
9
|
+
import { getStatus, printStatus } from "./status.js";
|
|
10
|
+
import { createLogger } from "./logger.js";
|
|
11
|
+
import { createRequire } from "module";
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
const pkg = require("../package.json");
|
|
14
|
+
const program = new Command();
|
|
15
|
+
/**
|
|
16
|
+
* Generate a default workspace.config.json file interactively
|
|
17
|
+
*/
|
|
18
|
+
async function generateDefaultConfig(logger) {
|
|
19
|
+
try {
|
|
20
|
+
logger.info("No workspace.config.json found in current directory.");
|
|
21
|
+
// Ask for project type
|
|
22
|
+
const projectType = await select({
|
|
23
|
+
message: "What type of project is this?",
|
|
24
|
+
choices: [
|
|
25
|
+
{
|
|
26
|
+
name: "core + custom (Remote core repo + Local custom folder)",
|
|
27
|
+
value: "core-custom",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "base + core (Remote base repo + Local core folder)",
|
|
31
|
+
value: "base-core",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "base + core + custom (Remote base repo + Remote core repo + Local custom folder)",
|
|
35
|
+
value: "base-core-custom",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
default: "base-core-custom",
|
|
39
|
+
});
|
|
40
|
+
// Build unified config
|
|
41
|
+
const config = {
|
|
42
|
+
projectType: projectType,
|
|
43
|
+
};
|
|
44
|
+
// Collect input based on project type
|
|
45
|
+
switch (projectType) {
|
|
46
|
+
case "core-custom": {
|
|
47
|
+
// Remote core + local custom
|
|
48
|
+
const coreUrl = await input({
|
|
49
|
+
message: "Enter the CORE repository URL:",
|
|
50
|
+
default: "https://github.com/your-org/your-core-repo.git",
|
|
51
|
+
validate: (value) => {
|
|
52
|
+
if (!value.trim())
|
|
53
|
+
return "URL is required";
|
|
54
|
+
return true;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
config.core = {
|
|
58
|
+
name: coreUrl.split("/").pop()?.replace(".git", "") || "core",
|
|
59
|
+
url: coreUrl,
|
|
60
|
+
ref: "main",
|
|
61
|
+
};
|
|
62
|
+
config.custom = {
|
|
63
|
+
path: "custom",
|
|
64
|
+
};
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
case "base-core": {
|
|
68
|
+
// Remote base + local core
|
|
69
|
+
const baseUrl = await input({
|
|
70
|
+
message: "Enter the BASE repository URL:",
|
|
71
|
+
default: "https://github.com/your-org/your-base-repo.git",
|
|
72
|
+
validate: (value) => {
|
|
73
|
+
if (!value.trim())
|
|
74
|
+
return "URL is required";
|
|
75
|
+
return true;
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
config.base = {
|
|
79
|
+
name: baseUrl.split("/").pop()?.replace(".git", "") || "base",
|
|
80
|
+
url: baseUrl,
|
|
81
|
+
ref: "main",
|
|
82
|
+
};
|
|
83
|
+
config.core = {
|
|
84
|
+
path: "core",
|
|
85
|
+
};
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
case "base-core-custom": {
|
|
89
|
+
// Remote base + remote core + local custom
|
|
90
|
+
const baseUrl = await input({
|
|
91
|
+
message: "Enter the BASE repository URL:",
|
|
92
|
+
default: "https://github.com/your-org/your-base-repo.git",
|
|
93
|
+
validate: (value) => {
|
|
94
|
+
if (!value.trim())
|
|
95
|
+
return "URL is required";
|
|
96
|
+
return true;
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
config.base = {
|
|
100
|
+
name: baseUrl.split("/").pop()?.replace(".git", "") || "base",
|
|
101
|
+
url: baseUrl,
|
|
102
|
+
ref: "main",
|
|
103
|
+
};
|
|
104
|
+
const coreUrl = await input({
|
|
105
|
+
message: "Enter the CORE repository URL:",
|
|
106
|
+
default: "https://github.com/your-org/your-core-repo.git",
|
|
107
|
+
validate: (value) => {
|
|
108
|
+
if (!value.trim())
|
|
109
|
+
return "URL is required";
|
|
110
|
+
return true;
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
config.core = {
|
|
114
|
+
name: coreUrl.split("/").pop()?.replace(".git", "") || "core",
|
|
115
|
+
url: coreUrl,
|
|
116
|
+
ref: "main",
|
|
117
|
+
};
|
|
118
|
+
config.custom = {
|
|
119
|
+
path: "custom",
|
|
120
|
+
};
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Install command run after build
|
|
125
|
+
config.install = {
|
|
126
|
+
command: "npm install",
|
|
127
|
+
};
|
|
128
|
+
// Additional glob patterns to exclude when copying
|
|
129
|
+
// Examples: "**/*.log", "dist/**", "node_modules/**", "**/*.tmp"
|
|
130
|
+
config.excludes = ["**/*.log", "dist/**", "node_modules/**", "**/*.tmp"];
|
|
131
|
+
// Write config file
|
|
132
|
+
const configPath = join(process.cwd(), "workspace.config.json");
|
|
133
|
+
writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
134
|
+
logger.success(`Created ${configPath}`);
|
|
135
|
+
// Create .gitignore
|
|
136
|
+
const gitignorePath = join(process.cwd(), ".gitignore");
|
|
137
|
+
// Minimal, fixed .gitignore (workspace and cache)
|
|
138
|
+
const gitignoreContent = `# Workspace CLI
|
|
139
|
+
workspace/
|
|
140
|
+
.wmc-cache/
|
|
141
|
+
`;
|
|
142
|
+
writeFileSync(gitignorePath, gitignoreContent, "utf-8");
|
|
143
|
+
logger.success(`Created ${gitignorePath}`);
|
|
144
|
+
logger.info(`Project type: ${getProjectTypeDescription(projectType)}`);
|
|
145
|
+
logger.info("You can now run 'wmc init' to initialize the repositories.");
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
catch (err) {
|
|
149
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
150
|
+
logger.error(`Failed to generate config: ${errorMessage}`);
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Initialize logger and config with error handling
|
|
156
|
+
*/
|
|
157
|
+
async function setup(options) {
|
|
158
|
+
const logger = createLogger({ json: options.json });
|
|
159
|
+
try {
|
|
160
|
+
const config = await loadConfig();
|
|
161
|
+
return { logger, config };
|
|
162
|
+
}
|
|
163
|
+
catch (err) {
|
|
164
|
+
// Check if error is due to missing config file
|
|
165
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
166
|
+
const configExists = existsSync(join(process.cwd(), "workspace.config.json")) ||
|
|
167
|
+
existsSync(join(process.cwd(), "workspace.config.js"));
|
|
168
|
+
if (!configExists && !options.json) {
|
|
169
|
+
// Offer to generate config
|
|
170
|
+
logger.info("No config file found.");
|
|
171
|
+
const shouldGenerate = await confirm({
|
|
172
|
+
message: "Would you like to create a workspace config now?",
|
|
173
|
+
default: true,
|
|
174
|
+
});
|
|
175
|
+
if (shouldGenerate) {
|
|
176
|
+
const generated = await generateDefaultConfig(logger);
|
|
177
|
+
if (generated) {
|
|
178
|
+
// Try loading again
|
|
179
|
+
try {
|
|
180
|
+
const config = await loadConfig();
|
|
181
|
+
return { logger, config };
|
|
182
|
+
}
|
|
183
|
+
catch (retryErr) {
|
|
184
|
+
const retryError = retryErr instanceof Error ? retryErr.message : String(retryErr);
|
|
185
|
+
logger.error(`Failed to load generated config: ${retryError}`);
|
|
186
|
+
process.exit(1);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
logger.error("Config generation was not completed");
|
|
191
|
+
process.exit(1);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
logger.info("Config generation skipped");
|
|
196
|
+
process.exit(1);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
logger.error(errorMessage);
|
|
200
|
+
if (options.json) {
|
|
201
|
+
logger.outputJson({
|
|
202
|
+
command: "setup",
|
|
203
|
+
success: false,
|
|
204
|
+
error: errorMessage,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
process.exit(1);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
program
|
|
211
|
+
.name("workspace-manager-cli")
|
|
212
|
+
.description("Assemble project workspace from shared core boilerplate plus custom folder")
|
|
213
|
+
.version(pkg.version ?? "0.0.0")
|
|
214
|
+
.option("--json", "Output machine-readable JSON");
|
|
215
|
+
// ============================================================================
|
|
216
|
+
// init command
|
|
217
|
+
// ============================================================================
|
|
218
|
+
program
|
|
219
|
+
.command("init")
|
|
220
|
+
.description("Initialize repositories (clone to cache)")
|
|
221
|
+
.option("-i, --interactive", "Interactively select branch or tag")
|
|
222
|
+
.option("--ref <ref>", "Override the ref (branch/tag/commit) to checkout for core")
|
|
223
|
+
.option("--base-ref <ref>", "Override the ref for base repository")
|
|
224
|
+
.option("--base-latest", "Fetch and checkout latest commit on base branch")
|
|
225
|
+
.option("--core-latest", "Fetch and checkout latest commit on core branch")
|
|
226
|
+
.option("--build", "Build workspace after initialization")
|
|
227
|
+
.option("--no-install", "Skip install when building (requires --build)")
|
|
228
|
+
.action(async (cmdOptions) => {
|
|
229
|
+
const options = program.opts();
|
|
230
|
+
const { logger, config } = await setup(options);
|
|
231
|
+
try {
|
|
232
|
+
logger.info(`Project type: ${getProjectTypeDescription(config.projectType)}`);
|
|
233
|
+
// Handle initialization based on project type
|
|
234
|
+
switch (config.projectType) {
|
|
235
|
+
case "core-custom":
|
|
236
|
+
await initCoreCustom(config, logger, cmdOptions, options);
|
|
237
|
+
break;
|
|
238
|
+
case "base-core":
|
|
239
|
+
await initBaseCore(config, logger, cmdOptions, options);
|
|
240
|
+
break;
|
|
241
|
+
case "base-core-custom":
|
|
242
|
+
await initBaseCoreCustom(config, logger, cmdOptions, options);
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
logger.success("Initialization complete");
|
|
246
|
+
// Build workspace if --build flag is set
|
|
247
|
+
if (cmdOptions.build) {
|
|
248
|
+
logger.info("Building workspace...");
|
|
249
|
+
const result = await buildWorkspace(config, logger, {
|
|
250
|
+
noInstall: !cmdOptions.install,
|
|
251
|
+
});
|
|
252
|
+
if (!result.success) {
|
|
253
|
+
process.exit(1);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
catch (err) {
|
|
258
|
+
logger.error(err instanceof Error ? err.message : String(err));
|
|
259
|
+
if (options.json) {
|
|
260
|
+
logger.outputJson({
|
|
261
|
+
command: "init",
|
|
262
|
+
success: false,
|
|
263
|
+
error: String(err),
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
process.exit(1);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
/**
|
|
270
|
+
* Initialize for core-custom project type
|
|
271
|
+
*/
|
|
272
|
+
async function initCoreCustom(config, logger, cmdOptions, options) {
|
|
273
|
+
if (!config.core || !("url" in config.core)) {
|
|
274
|
+
throw new Error("No remote core repository configured");
|
|
275
|
+
}
|
|
276
|
+
let selectedRef = cmdOptions.ref || config.core.ref;
|
|
277
|
+
// If --core-latest flag is set, use origin/<ref>
|
|
278
|
+
if (cmdOptions.coreLatest) {
|
|
279
|
+
selectedRef = `origin/${config.core.ref}`;
|
|
280
|
+
}
|
|
281
|
+
// Interactive mode: let user choose branch or tag
|
|
282
|
+
if (cmdOptions.interactive && !options.json) {
|
|
283
|
+
selectedRef = await selectRef(config.coreCachePath, config.core.url, selectedRef, "core", logger);
|
|
284
|
+
}
|
|
285
|
+
// Proceed with initialization - clone to cache
|
|
286
|
+
await cloneToCache(config, logger);
|
|
287
|
+
await fetchLatest(config.cachePath, logger);
|
|
288
|
+
const coreCommit = await checkoutRef(config.cachePath, selectedRef, logger);
|
|
289
|
+
config.core.hash = coreCommit;
|
|
290
|
+
config.core.ref = selectedRef;
|
|
291
|
+
await persistHashesToWorkspaceConfig(config, { coreHash: coreCommit, coreRef: selectedRef }, logger);
|
|
292
|
+
// Check local custom exists
|
|
293
|
+
if (config.customPath) {
|
|
294
|
+
if (existsSync(config.customPath)) {
|
|
295
|
+
logger.success(`Local custom directory found: ${config.customDir}`);
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
logger.warn(`Local custom directory not found: ${config.customDir}`);
|
|
299
|
+
if (!options.json) {
|
|
300
|
+
const shouldCreate = await confirm({
|
|
301
|
+
message: `Would you like to create the custom directory "${config.customDir}"?`,
|
|
302
|
+
default: true,
|
|
303
|
+
});
|
|
304
|
+
if (shouldCreate) {
|
|
305
|
+
const { mkdirSync } = await import("fs");
|
|
306
|
+
mkdirSync(config.customPath, { recursive: true });
|
|
307
|
+
logger.success(`Created custom directory: ${config.customDir}`);
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
logger.info(`Create the directory manually and add your custom files.`);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
logger.info(`Create the directory and add your custom files.`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
if (options.json) {
|
|
319
|
+
const gitInfo = await getGitInfo(getCorePath(config));
|
|
320
|
+
logger.outputJson({
|
|
321
|
+
command: "init",
|
|
322
|
+
success: true,
|
|
323
|
+
projectType: config.projectType,
|
|
324
|
+
ref: selectedRef,
|
|
325
|
+
commit: gitInfo?.commit,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Initialize for base-core project type (remote base + local core)
|
|
331
|
+
*/
|
|
332
|
+
async function initBaseCore(config, logger, cmdOptions, options) {
|
|
333
|
+
if (!config.base) {
|
|
334
|
+
throw new Error("No base repository configured");
|
|
335
|
+
}
|
|
336
|
+
let selectedBaseRef = cmdOptions.baseRef || cmdOptions.ref || config.base.ref;
|
|
337
|
+
// If --base-latest flag is set, use origin/<ref>
|
|
338
|
+
if (cmdOptions.baseLatest) {
|
|
339
|
+
selectedBaseRef = `origin/${config.base.ref}`;
|
|
340
|
+
}
|
|
341
|
+
// Interactive mode: let user choose branch or tag for base
|
|
342
|
+
if (cmdOptions.interactive && !options.json) {
|
|
343
|
+
selectedBaseRef = await selectRef(config.baseCachePath, config.base.url, selectedBaseRef, "base", logger);
|
|
344
|
+
}
|
|
345
|
+
// Clone and checkout base
|
|
346
|
+
await cloneBaseToCache(config, logger);
|
|
347
|
+
await fetchLatest(config.baseCachePath, logger);
|
|
348
|
+
const baseCommit = await checkoutRef(config.baseCachePath, selectedBaseRef, logger);
|
|
349
|
+
config.base.hash = baseCommit;
|
|
350
|
+
config.base.ref = selectedBaseRef;
|
|
351
|
+
await persistHashesToWorkspaceConfig(config, { baseHash: baseCommit, baseRef: selectedBaseRef }, logger);
|
|
352
|
+
// Check local core exists
|
|
353
|
+
if (config.coreLocalPath) {
|
|
354
|
+
if (existsSync(config.coreLocalPath)) {
|
|
355
|
+
logger.success(`Local core directory found: ${config.coreDir}`);
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
logger.warn(`Local core directory not found: ${config.coreDir}`);
|
|
359
|
+
if (!options.json) {
|
|
360
|
+
const shouldCreate = await confirm({
|
|
361
|
+
message: `Would you like to create the core directory "${config.coreDir}"?`,
|
|
362
|
+
default: true,
|
|
363
|
+
});
|
|
364
|
+
if (shouldCreate) {
|
|
365
|
+
const { mkdirSync } = await import("fs");
|
|
366
|
+
mkdirSync(config.coreLocalPath, { recursive: true });
|
|
367
|
+
logger.success(`Created core directory: ${config.coreDir}`);
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
logger.info(`Create the directory manually and add your core files.`);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
logger.info(`Create the directory and add your core files.`);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
if (options.json) {
|
|
379
|
+
const gitInfo = await getGitInfo(config.baseCachePath);
|
|
380
|
+
logger.outputJson({
|
|
381
|
+
command: "init",
|
|
382
|
+
success: true,
|
|
383
|
+
projectType: config.projectType,
|
|
384
|
+
baseRef: selectedBaseRef,
|
|
385
|
+
baseCommit: gitInfo?.commit,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Initialize for base-core-custom project type (remote base + remote core + local custom)
|
|
391
|
+
*/
|
|
392
|
+
async function initBaseCoreCustom(config, logger, cmdOptions, options) {
|
|
393
|
+
if (!config.base) {
|
|
394
|
+
throw new Error("No base repository configured");
|
|
395
|
+
}
|
|
396
|
+
if (!config.core || !("url" in config.core)) {
|
|
397
|
+
throw new Error("No remote core repository configured");
|
|
398
|
+
}
|
|
399
|
+
let selectedBaseRef = cmdOptions.baseRef || config.base.ref;
|
|
400
|
+
let selectedCoreRef = cmdOptions.ref || config.core.ref;
|
|
401
|
+
// If --base-latest flag is set, use origin/<ref>
|
|
402
|
+
if (cmdOptions.baseLatest) {
|
|
403
|
+
selectedBaseRef = `origin/${config.base.ref}`;
|
|
404
|
+
}
|
|
405
|
+
// If --core-latest flag is set, use origin/<ref>
|
|
406
|
+
if (cmdOptions.coreLatest) {
|
|
407
|
+
selectedCoreRef = `origin/${config.core.ref}`;
|
|
408
|
+
}
|
|
409
|
+
// Determine which repos to (re)initialize
|
|
410
|
+
const baseMissing = !(await isGitRepo(config.baseCachePath));
|
|
411
|
+
const coreMissing = !(await isGitRepo(config.coreCachePath));
|
|
412
|
+
const shouldInitBase = baseMissing ||
|
|
413
|
+
cmdOptions.baseRef !== undefined ||
|
|
414
|
+
cmdOptions.baseLatest === true ||
|
|
415
|
+
(!cmdOptions.ref && !cmdOptions.baseRef && !cmdOptions.coreLatest);
|
|
416
|
+
const shouldInitCore = coreMissing ||
|
|
417
|
+
cmdOptions.ref !== undefined ||
|
|
418
|
+
cmdOptions.coreLatest === true ||
|
|
419
|
+
(!cmdOptions.ref && !cmdOptions.baseRef && !cmdOptions.baseLatest);
|
|
420
|
+
// Interactive mode: let user choose refs (only for repos being updated)
|
|
421
|
+
if (cmdOptions.interactive && !options.json) {
|
|
422
|
+
logger.info("Select refs for base and core repositories...");
|
|
423
|
+
if (shouldInitBase) {
|
|
424
|
+
selectedBaseRef = await selectRef(config.baseCachePath, config.base.url, selectedBaseRef, "base", logger);
|
|
425
|
+
}
|
|
426
|
+
if (shouldInitCore) {
|
|
427
|
+
selectedCoreRef = await selectRef(config.coreCachePath, config.core.url, selectedCoreRef, "core", logger);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
let baseCommit;
|
|
431
|
+
let coreCommit;
|
|
432
|
+
if (shouldInitBase) {
|
|
433
|
+
logger.info("Initializing base repository...");
|
|
434
|
+
await cloneBaseToCache(config, logger);
|
|
435
|
+
await fetchLatest(config.baseCachePath, logger);
|
|
436
|
+
baseCommit = await checkoutRef(config.baseCachePath, selectedBaseRef, logger);
|
|
437
|
+
config.base.hash = baseCommit;
|
|
438
|
+
config.base.ref = selectedBaseRef;
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
logger.info("Skipping base (no --base-ref provided and base already initialized)");
|
|
442
|
+
}
|
|
443
|
+
if (shouldInitCore) {
|
|
444
|
+
logger.info("Initializing core repository...");
|
|
445
|
+
await cloneCoreToCache(config, logger);
|
|
446
|
+
await fetchLatest(config.coreCachePath, logger);
|
|
447
|
+
coreCommit = await checkoutRef(config.coreCachePath, selectedCoreRef, logger);
|
|
448
|
+
config.core.hash = coreCommit;
|
|
449
|
+
config.core.ref = selectedCoreRef;
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
logger.info("Skipping core (no --ref provided and core already initialized)");
|
|
453
|
+
}
|
|
454
|
+
// Persist hashes and refs for repos that were updated
|
|
455
|
+
const hashes = {};
|
|
456
|
+
if (baseCommit) {
|
|
457
|
+
hashes.baseHash = baseCommit;
|
|
458
|
+
hashes.baseRef = selectedBaseRef;
|
|
459
|
+
}
|
|
460
|
+
if (coreCommit) {
|
|
461
|
+
hashes.coreHash = coreCommit;
|
|
462
|
+
hashes.coreRef = selectedCoreRef;
|
|
463
|
+
}
|
|
464
|
+
if (Object.keys(hashes).length > 0) {
|
|
465
|
+
await persistHashesToWorkspaceConfig(config, hashes, logger);
|
|
466
|
+
}
|
|
467
|
+
// Check local custom exists
|
|
468
|
+
if (config.customPath) {
|
|
469
|
+
if (existsSync(config.customPath)) {
|
|
470
|
+
logger.success(`Local custom directory found: ${config.customDir}`);
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
logger.warn(`Local custom directory not found: ${config.customDir}`);
|
|
474
|
+
if (!options.json) {
|
|
475
|
+
const shouldCreate = await confirm({
|
|
476
|
+
message: `Would you like to create the custom directory "${config.customDir}"?`,
|
|
477
|
+
default: true,
|
|
478
|
+
});
|
|
479
|
+
if (shouldCreate) {
|
|
480
|
+
const { mkdirSync } = await import("fs");
|
|
481
|
+
mkdirSync(config.customPath, { recursive: true });
|
|
482
|
+
logger.success(`Created custom directory: ${config.customDir}`);
|
|
483
|
+
}
|
|
484
|
+
else {
|
|
485
|
+
logger.info(`Create the directory manually and add your custom files.`);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
logger.info(`Create the directory and add your custom files.`);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
if (options.json) {
|
|
494
|
+
const baseInfo = shouldInitBase
|
|
495
|
+
? await getGitInfo(config.baseCachePath)
|
|
496
|
+
: undefined;
|
|
497
|
+
const coreInfo = shouldInitCore
|
|
498
|
+
? await getGitInfo(config.coreCachePath)
|
|
499
|
+
: undefined;
|
|
500
|
+
logger.outputJson({
|
|
501
|
+
command: "init",
|
|
502
|
+
success: true,
|
|
503
|
+
projectType: config.projectType,
|
|
504
|
+
baseRef: shouldInitBase ? selectedBaseRef : undefined,
|
|
505
|
+
baseCommit: baseInfo?.commit,
|
|
506
|
+
coreRef: shouldInitCore ? selectedCoreRef : undefined,
|
|
507
|
+
coreCommit: coreInfo?.commit,
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Interactive ref selection helper
|
|
513
|
+
*/
|
|
514
|
+
async function selectRef(cachePath, url, defaultRef, repoName, logger) {
|
|
515
|
+
logger.info(`Fetching available branches and tags for ${repoName}...`);
|
|
516
|
+
let refs;
|
|
517
|
+
if (await isGitRepo(cachePath)) {
|
|
518
|
+
await fetchLatest(cachePath, logger);
|
|
519
|
+
refs = await listRemoteRefs(cachePath, logger);
|
|
520
|
+
}
|
|
521
|
+
else {
|
|
522
|
+
refs = await listRemoteRefsFromUrl(url, logger);
|
|
523
|
+
}
|
|
524
|
+
const choices = [];
|
|
525
|
+
if (refs.branches.length > 0) {
|
|
526
|
+
choices.push({
|
|
527
|
+
name: "── Branches ──",
|
|
528
|
+
value: "__separator_branches__",
|
|
529
|
+
});
|
|
530
|
+
for (const branch of refs.branches) {
|
|
531
|
+
const isDefault = branch === defaultRef;
|
|
532
|
+
choices.push({
|
|
533
|
+
name: isDefault ? ` ${branch} (default)` : ` ${branch}`,
|
|
534
|
+
value: branch,
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
if (refs.tags.length > 0) {
|
|
539
|
+
choices.push({ name: "── Tags ──", value: "__separator_tags__" });
|
|
540
|
+
const sortedTags = [...refs.tags].reverse();
|
|
541
|
+
for (const tag of sortedTags) {
|
|
542
|
+
choices.push({
|
|
543
|
+
name: ` ${tag}`,
|
|
544
|
+
value: tag,
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
if (choices.length === 0) {
|
|
549
|
+
logger.warn(`No branches or tags found for ${repoName}. Using default ref.`);
|
|
550
|
+
return defaultRef;
|
|
551
|
+
}
|
|
552
|
+
const selectedRef = await select({
|
|
553
|
+
message: `Select branch or tag for ${repoName}:`,
|
|
554
|
+
choices: choices.filter((c) => !c.value.startsWith("__separator")),
|
|
555
|
+
default: defaultRef,
|
|
556
|
+
});
|
|
557
|
+
logger.info(`Selected ${repoName}: ${selectedRef}`);
|
|
558
|
+
return selectedRef;
|
|
559
|
+
}
|
|
560
|
+
// ============================================================================
|
|
561
|
+
// build command (alias: sync)
|
|
562
|
+
// ============================================================================
|
|
563
|
+
program
|
|
564
|
+
.command("build")
|
|
565
|
+
.alias("sync")
|
|
566
|
+
.description("Build workspace by assembling repositories and overlaying custom code based on project type")
|
|
567
|
+
.option("--no-install", "Skip running install command")
|
|
568
|
+
.option("--dry-run", "Log planned actions without executing")
|
|
569
|
+
.action(async (cmdOptions) => {
|
|
570
|
+
const options = program.opts();
|
|
571
|
+
const { logger, config } = await setup(options);
|
|
572
|
+
try {
|
|
573
|
+
const result = await buildWorkspace(config, logger, {
|
|
574
|
+
noInstall: !cmdOptions.install,
|
|
575
|
+
dryRun: cmdOptions.dryRun,
|
|
576
|
+
});
|
|
577
|
+
if (options.json) {
|
|
578
|
+
logger.outputJson({
|
|
579
|
+
command: "build",
|
|
580
|
+
...result,
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
if (!result.success) {
|
|
584
|
+
process.exit(1);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
catch (err) {
|
|
588
|
+
logger.error(err instanceof Error ? err.message : String(err));
|
|
589
|
+
if (options.json) {
|
|
590
|
+
logger.outputJson({
|
|
591
|
+
command: "build",
|
|
592
|
+
success: false,
|
|
593
|
+
error: String(err),
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
process.exit(1);
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
// ============================================================================
|
|
600
|
+
// status command
|
|
601
|
+
// ============================================================================
|
|
602
|
+
program
|
|
603
|
+
.command("status")
|
|
604
|
+
.description("Print current status of core, lockfile, and custom directory")
|
|
605
|
+
.action(async () => {
|
|
606
|
+
const options = program.opts();
|
|
607
|
+
const { logger, config } = await setup(options);
|
|
608
|
+
try {
|
|
609
|
+
const status = await getStatus(config, logger);
|
|
610
|
+
printStatus(config, status, logger, !!options.json);
|
|
611
|
+
}
|
|
612
|
+
catch (err) {
|
|
613
|
+
logger.error(err instanceof Error ? err.message : String(err));
|
|
614
|
+
if (options.json) {
|
|
615
|
+
logger.outputJson({
|
|
616
|
+
command: "status",
|
|
617
|
+
success: false,
|
|
618
|
+
error: String(err),
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
process.exit(1);
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
// Parse and run
|
|
625
|
+
program.parse();
|
|
626
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,UAAU,EAGV,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,WAAW,EAEX,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,SAAS,GAEV,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,O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