@nagarjuna2002/ios-agent 0.2.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 +167 -0
- package/dist/commands.d.ts +37 -0
- package/dist/commands.js +553 -0
- package/dist/commands.js.map +1 -0
- package/dist/config.d.ts +53 -0
- package/dist/config.js +82 -0
- package/dist/config.js.map +1 -0
- package/dist/discover.d.ts +21 -0
- package/dist/discover.js +48 -0
- package/dist/discover.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.d.ts +96 -0
- package/dist/layout.js +184 -0
- package/dist/layout.js.map +1 -0
- package/dist/scaffold.d.ts +42 -0
- package/dist/scaffold.js +402 -0
- package/dist/scaffold.js.map +1 -0
- package/package.json +41 -0
package/dist/commands.js
ADDED
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { APP_DIR, INTERNAL_DIR, INTERNAL_ENTRIES, LAYOUT_VERSION, disposableEntries, gitignoreContents, globalCacheDir, layoutFor, } from "./layout.js";
|
|
4
|
+
import { ConfigError, defaultConfig, readConfig, writeConfig } from "./config.js";
|
|
5
|
+
import { ScaffoldError, ensureInternal, scaffoldProject } from "./scaffold.js";
|
|
6
|
+
import { discoverProject } from "./discover.js";
|
|
7
|
+
export const defaultIO = {
|
|
8
|
+
out: (text) => process.stdout.write(`${text}\n`),
|
|
9
|
+
err: (text) => process.stderr.write(`${text}\n`),
|
|
10
|
+
cwd: () => process.cwd(),
|
|
11
|
+
env: process.env,
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Exit codes, stable across releases.
|
|
15
|
+
*
|
|
16
|
+
* Separated so a script can tell "you called it wrong" from "the project is
|
|
17
|
+
* unhealthy". Collapsing both into 1 forces callers to parse stderr, which is
|
|
18
|
+
* the thing `--json` exists to avoid.
|
|
19
|
+
*/
|
|
20
|
+
export const EXIT_OK = 0;
|
|
21
|
+
export const EXIT_USAGE = 1;
|
|
22
|
+
export const EXIT_UNHEALTHY = 2;
|
|
23
|
+
function packageVersion() {
|
|
24
|
+
const pkg = JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
25
|
+
return pkg.version;
|
|
26
|
+
}
|
|
27
|
+
/** Flags that take a value. Everything else is boolean, so `--json doctor` parses. */
|
|
28
|
+
const VALUE_FLAGS = new Set(["into", "project", "brief"]);
|
|
29
|
+
function parseArgs(argv) {
|
|
30
|
+
const positionals = [];
|
|
31
|
+
const flags = new Set();
|
|
32
|
+
const values = new Map();
|
|
33
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
34
|
+
const token = argv[i];
|
|
35
|
+
if (!token.startsWith("--")) {
|
|
36
|
+
positionals.push(token);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const body = token.slice(2);
|
|
40
|
+
const eq = body.indexOf("=");
|
|
41
|
+
if (eq >= 0) {
|
|
42
|
+
values.set(body.slice(0, eq), body.slice(eq + 1));
|
|
43
|
+
}
|
|
44
|
+
else if (VALUE_FLAGS.has(body) && i + 1 < argv.length && !argv[i + 1].startsWith("--")) {
|
|
45
|
+
values.set(body, argv[i + 1]);
|
|
46
|
+
i += 1;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
flags.add(body);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return { command: positionals.shift() ?? "", positionals, flags, values };
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Every command, declared once.
|
|
56
|
+
*
|
|
57
|
+
* Dispatch, `help`, and shell completions all read this table — the same
|
|
58
|
+
* arrangement as `INTERNAL_ENTRIES` in layout.ts, for the same reason. Help
|
|
59
|
+
* text maintained separately from the parser drifts, and the drift is invisible
|
|
60
|
+
* until someone follows the documentation and gets an error.
|
|
61
|
+
*/
|
|
62
|
+
const COMMANDS = [
|
|
63
|
+
{
|
|
64
|
+
name: "new",
|
|
65
|
+
usage: "ios-agent new <Name>",
|
|
66
|
+
summary: "Scaffold a project",
|
|
67
|
+
flags: [
|
|
68
|
+
{ name: "brief", takesValue: true, summary: "Save an app implementation brief (no AI generation)" },
|
|
69
|
+
{ name: "xcodegen", takesValue: false, summary: "Write App/project.yml and editable icon layer starters" },
|
|
70
|
+
{ name: "minimal", takesValue: false, summary: "Only App/; .ios-agent/ appears when first needed" },
|
|
71
|
+
{ name: "into", takesValue: true, summary: "Parent directory (default: cwd)" },
|
|
72
|
+
{ name: "no-license", takesValue: false, summary: "Skip LICENSE" },
|
|
73
|
+
{ name: "force", takesValue: false, summary: "Scaffold into a non-empty directory" },
|
|
74
|
+
],
|
|
75
|
+
run: commandNew,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "init",
|
|
79
|
+
usage: "ios-agent init [dir]",
|
|
80
|
+
summary: "Adopt an existing directory",
|
|
81
|
+
flags: [],
|
|
82
|
+
run: commandInit,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "where",
|
|
86
|
+
usage: "ios-agent where",
|
|
87
|
+
summary: "Print resolved paths",
|
|
88
|
+
flags: [
|
|
89
|
+
{ name: "json", takesValue: false, summary: "Machine-readable output" },
|
|
90
|
+
{ name: "project", takesValue: true, summary: "Use this root instead of discovering one" },
|
|
91
|
+
],
|
|
92
|
+
run: commandWhere,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "info",
|
|
96
|
+
usage: "ios-agent info",
|
|
97
|
+
summary: "Summarise the project",
|
|
98
|
+
flags: [
|
|
99
|
+
{ name: "json", takesValue: false, summary: "Machine-readable output" },
|
|
100
|
+
{ name: "project", takesValue: true, summary: "Use this root instead of discovering one" },
|
|
101
|
+
],
|
|
102
|
+
run: commandInfo,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "clean",
|
|
106
|
+
usage: "ios-agent clean",
|
|
107
|
+
summary: "Delete disposable internal files",
|
|
108
|
+
flags: [
|
|
109
|
+
{ name: "dry-run", takesValue: false, summary: "Report without deleting" },
|
|
110
|
+
{ name: "json", takesValue: false, summary: "Machine-readable output" },
|
|
111
|
+
{ name: "project", takesValue: true, summary: "Use this root instead of discovering one" },
|
|
112
|
+
],
|
|
113
|
+
run: commandClean,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "doctor",
|
|
117
|
+
usage: "ios-agent doctor",
|
|
118
|
+
summary: "Check the layout",
|
|
119
|
+
flags: [
|
|
120
|
+
{ name: "fix", takesValue: false, summary: "Repair what can be repaired safely" },
|
|
121
|
+
{ name: "json", takesValue: false, summary: "Machine-readable output" },
|
|
122
|
+
{ name: "project", takesValue: true, summary: "Use this root instead of discovering one" },
|
|
123
|
+
],
|
|
124
|
+
run: commandDoctor,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "completions",
|
|
128
|
+
usage: "ios-agent completions <bash|zsh>",
|
|
129
|
+
summary: "Print a shell completion script",
|
|
130
|
+
flags: [],
|
|
131
|
+
run: commandCompletions,
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
export function run(argv, io = defaultIO) {
|
|
135
|
+
const args = parseArgs(argv);
|
|
136
|
+
if (args.command === "--version" || args.command === "-v" || args.flags.has("version")) {
|
|
137
|
+
io.out(packageVersion());
|
|
138
|
+
return EXIT_OK;
|
|
139
|
+
}
|
|
140
|
+
if (args.command === "" || args.command === "help" || args.command === "--help") {
|
|
141
|
+
io.out(helpText());
|
|
142
|
+
return EXIT_OK;
|
|
143
|
+
}
|
|
144
|
+
const spec = COMMANDS.find((command) => command.name === args.command);
|
|
145
|
+
if (!spec) {
|
|
146
|
+
io.err(`Unknown command "${args.command}". Run \`ios-agent help\`.`);
|
|
147
|
+
return EXIT_USAGE;
|
|
148
|
+
}
|
|
149
|
+
try {
|
|
150
|
+
return spec.run(args, io);
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
if (error instanceof ScaffoldError || error instanceof ConfigError) {
|
|
154
|
+
io.err(error.message);
|
|
155
|
+
return EXIT_USAGE;
|
|
156
|
+
}
|
|
157
|
+
throw error;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// MARK: - Shared
|
|
161
|
+
/** Resolve the project, or explain precisely why not. */
|
|
162
|
+
function requireProject(args, io) {
|
|
163
|
+
const discovery = discoverProject(io.cwd(), io.env, args.values.get("project"));
|
|
164
|
+
if (!discovery) {
|
|
165
|
+
io.err(`No ${INTERNAL_DIR}/ found in ${io.cwd()} or any parent. Run \`ios-agent init\` here, or pass --project.`);
|
|
166
|
+
return undefined;
|
|
167
|
+
}
|
|
168
|
+
return discovery;
|
|
169
|
+
}
|
|
170
|
+
function emit(args, io, body, lines) {
|
|
171
|
+
if (args.flags.has("json")) {
|
|
172
|
+
io.out(JSON.stringify(body, null, 2));
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
for (const line of lines)
|
|
176
|
+
io.out(line);
|
|
177
|
+
}
|
|
178
|
+
// MARK: - new
|
|
179
|
+
function commandNew(args, io) {
|
|
180
|
+
const name = args.positionals[0];
|
|
181
|
+
if (!name) {
|
|
182
|
+
io.err("Usage: ios-agent new <Name> [--minimal] [--no-license] [--force]");
|
|
183
|
+
return EXIT_USAGE;
|
|
184
|
+
}
|
|
185
|
+
if (args.flags.has("brief") || (args.values.has("brief") && !args.values.get("brief")?.trim())) {
|
|
186
|
+
throw new ScaffoldError("--brief requires a non-empty description.");
|
|
187
|
+
}
|
|
188
|
+
if (args.values.has("xcodegen"))
|
|
189
|
+
throw new ScaffoldError("--xcodegen is a boolean flag; omit its value.");
|
|
190
|
+
const minimal = args.flags.has("minimal");
|
|
191
|
+
const result = scaffoldProject({
|
|
192
|
+
name,
|
|
193
|
+
parentDir: args.values.get("into") ?? io.cwd(),
|
|
194
|
+
minimal,
|
|
195
|
+
brief: args.values.get("brief"),
|
|
196
|
+
xcodegen: args.flags.has("xcodegen"),
|
|
197
|
+
license: args.flags.has("no-license") ? "none" : "MIT",
|
|
198
|
+
force: args.flags.has("force"),
|
|
199
|
+
});
|
|
200
|
+
emit(args, io, { project_root: result.layout.root, created: result.created }, [
|
|
201
|
+
`Created ${result.layout.root}`,
|
|
202
|
+
"",
|
|
203
|
+
renderTree(result.layout, minimal),
|
|
204
|
+
"",
|
|
205
|
+
args.flags.has("xcodegen")
|
|
206
|
+
? `Next: in ${path.join(result.layout.root, "App")}, run xcodegen generate, then open ${name}.xcodeproj. Requires macOS, Xcode, and XcodeGen installed separately.`
|
|
207
|
+
: `Next: open Xcode, create an App project inside App/, and add App/${name}/ to it.`,
|
|
208
|
+
...(args.values.has("brief") ? ["Implementation brief: App/APP_BRIEF.md. The starter does not implement the description."] : []),
|
|
209
|
+
]);
|
|
210
|
+
return EXIT_OK;
|
|
211
|
+
}
|
|
212
|
+
// MARK: - init
|
|
213
|
+
function commandInit(args, io) {
|
|
214
|
+
const root = path.resolve(args.positionals[0] ?? io.cwd());
|
|
215
|
+
const layout = layoutFor(root);
|
|
216
|
+
if (fs.existsSync(layout.config)) {
|
|
217
|
+
emit(args, io, { project_root: root, already_initialised: true }, [`Already initialised: ${layout.config}`]);
|
|
218
|
+
return EXIT_OK;
|
|
219
|
+
}
|
|
220
|
+
ensureInternal(layout);
|
|
221
|
+
writeConfig(layout, defaultConfig(path.basename(root), APP_DIR));
|
|
222
|
+
emit(args, io, { project_root: root, already_initialised: false }, [`Initialised ${INTERNAL_DIR}/ in ${root}`]);
|
|
223
|
+
return EXIT_OK;
|
|
224
|
+
}
|
|
225
|
+
// MARK: - where
|
|
226
|
+
/**
|
|
227
|
+
* Print resolved paths — the interop contract.
|
|
228
|
+
*
|
|
229
|
+
* `--json` exists so other tools (the MCP server, an editor plugin, a CI
|
|
230
|
+
* script) ask the CLI where things are instead of hardcoding `.ios-agent`.
|
|
231
|
+
* One process owns the layout; everything else queries it, which is what keeps
|
|
232
|
+
* a future rename from being a coordinated multi-repo change.
|
|
233
|
+
*/
|
|
234
|
+
function commandWhere(args, io) {
|
|
235
|
+
const discovery = requireProject(args, io);
|
|
236
|
+
if (!discovery)
|
|
237
|
+
return EXIT_USAGE;
|
|
238
|
+
const { layout, source } = discovery;
|
|
239
|
+
const payload = {
|
|
240
|
+
project_root: layout.root,
|
|
241
|
+
resolved_from: source,
|
|
242
|
+
layout_version: LAYOUT_VERSION,
|
|
243
|
+
internal_dir: INTERNAL_DIR,
|
|
244
|
+
global_cache: globalCacheDir(io.env),
|
|
245
|
+
paths: {
|
|
246
|
+
app: layout.app,
|
|
247
|
+
internal: layout.internal,
|
|
248
|
+
config: layout.config,
|
|
249
|
+
state: layout.state,
|
|
250
|
+
metadata: layout.metadata,
|
|
251
|
+
cache: layout.cache,
|
|
252
|
+
logs: layout.logs,
|
|
253
|
+
build: layout.build,
|
|
254
|
+
screenshots: layout.screenshots,
|
|
255
|
+
templates: layout.templates,
|
|
256
|
+
plugins: layout.plugins,
|
|
257
|
+
tmp: layout.tmp,
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
emit(args, io, payload, [
|
|
261
|
+
`root ${payload.project_root} (${source})`,
|
|
262
|
+
`app ${layout.app}`,
|
|
263
|
+
`internal ${layout.internal}`,
|
|
264
|
+
`global cache ${payload.global_cache}`,
|
|
265
|
+
]);
|
|
266
|
+
return EXIT_OK;
|
|
267
|
+
}
|
|
268
|
+
// MARK: - info
|
|
269
|
+
function commandInfo(args, io) {
|
|
270
|
+
const discovery = requireProject(args, io);
|
|
271
|
+
if (!discovery)
|
|
272
|
+
return EXIT_USAGE;
|
|
273
|
+
const config = readConfig(discovery.layout);
|
|
274
|
+
emit(args, io, {
|
|
275
|
+
project_root: discovery.layout.root,
|
|
276
|
+
resolved_from: discovery.source,
|
|
277
|
+
name: config.name,
|
|
278
|
+
created_at: config.createdAt,
|
|
279
|
+
layout_version: config.layoutVersion,
|
|
280
|
+
current_layout_version: LAYOUT_VERSION,
|
|
281
|
+
apps: config.apps,
|
|
282
|
+
plugins: config.plugins,
|
|
283
|
+
}, [
|
|
284
|
+
`${config.name}`,
|
|
285
|
+
` root ${discovery.layout.root}`,
|
|
286
|
+
` created ${config.createdAt || "unknown"}`,
|
|
287
|
+
` layout v${config.layoutVersion}${config.layoutVersion < LAYOUT_VERSION ? ` (current is v${LAYOUT_VERSION} — run \`ios-agent doctor --fix\`)` : ""}`,
|
|
288
|
+
` apps ${config.apps.map((app) => `${app.name} (${app.path})`).join(", ") || "none"}`,
|
|
289
|
+
` plugins ${config.plugins.join(", ") || "none"}`,
|
|
290
|
+
]);
|
|
291
|
+
return EXIT_OK;
|
|
292
|
+
}
|
|
293
|
+
// MARK: - clean
|
|
294
|
+
/**
|
|
295
|
+
* Delete every disposable internal entry.
|
|
296
|
+
*
|
|
297
|
+
* Non-interactive by construction: the set comes from `disposableEntries()`,
|
|
298
|
+
* which is the complement of what the generated gitignore tracks. There is no
|
|
299
|
+
* path by which this removes something a human wrote, so there is nothing to
|
|
300
|
+
* confirm — the guarantee is structural rather than a promise in the help text.
|
|
301
|
+
*/
|
|
302
|
+
function commandClean(args, io) {
|
|
303
|
+
const discovery = requireProject(args, io);
|
|
304
|
+
if (!discovery)
|
|
305
|
+
return EXIT_USAGE;
|
|
306
|
+
const dryRun = args.flags.has("dry-run");
|
|
307
|
+
const removed = [];
|
|
308
|
+
for (const entry of disposableEntries()) {
|
|
309
|
+
const target = path.join(discovery.layout.internal, entry.name);
|
|
310
|
+
if (!fs.existsSync(target))
|
|
311
|
+
continue;
|
|
312
|
+
if (!dryRun)
|
|
313
|
+
fs.rmSync(target, { recursive: true, force: true });
|
|
314
|
+
removed.push(target);
|
|
315
|
+
}
|
|
316
|
+
const relative = removed.map((target) => path.relative(discovery.layout.root, target));
|
|
317
|
+
emit(args, io, { project_root: discovery.layout.root, dry_run: dryRun, removed: relative }, removed.length === 0
|
|
318
|
+
? ["Nothing to clean."]
|
|
319
|
+
: [`${dryRun ? "Would remove" : "Removed"} ${removed.length} entries:`, ...relative.map((r) => ` ${r}`)]);
|
|
320
|
+
return EXIT_OK;
|
|
321
|
+
}
|
|
322
|
+
function commandDoctor(args, io) {
|
|
323
|
+
const discovery = requireProject(args, io);
|
|
324
|
+
if (!discovery)
|
|
325
|
+
return EXIT_USAGE;
|
|
326
|
+
const layout = discovery.layout;
|
|
327
|
+
let results = diagnose(layout, io.env);
|
|
328
|
+
const applied = [];
|
|
329
|
+
if (args.flags.has("fix")) {
|
|
330
|
+
for (const remedy of new Set(results.filter((r) => !r.ok && r.remedy).map((r) => r.remedy))) {
|
|
331
|
+
if (applyRemedy(layout, remedy))
|
|
332
|
+
applied.push(remedy);
|
|
333
|
+
}
|
|
334
|
+
results = diagnose(layout, io.env);
|
|
335
|
+
}
|
|
336
|
+
const failures = results.filter((r) => !r.ok);
|
|
337
|
+
emit(args, io, {
|
|
338
|
+
project_root: layout.root,
|
|
339
|
+
healthy: failures.length === 0,
|
|
340
|
+
applied_fixes: applied,
|
|
341
|
+
checks: results.map((r) => ({ check: r.check, ok: r.ok, message: r.message, fixable: r.remedy !== null })),
|
|
342
|
+
}, [
|
|
343
|
+
...applied.map((remedy) => `fix applied ${remedy}`),
|
|
344
|
+
...results.map((r) => `${r.ok ? "ok " : "FAIL"} ${r.message}${!r.ok && r.remedy ? " (fixable: --fix)" : ""}`),
|
|
345
|
+
"",
|
|
346
|
+
failures.length === 0
|
|
347
|
+
? `All ${results.length} checks passed.`
|
|
348
|
+
: `${failures.length} of ${results.length} checks failed.`,
|
|
349
|
+
]);
|
|
350
|
+
return failures.length === 0 ? EXIT_OK : EXIT_UNHEALTHY;
|
|
351
|
+
}
|
|
352
|
+
function applyRemedy(layout, remedy) {
|
|
353
|
+
switch (remedy) {
|
|
354
|
+
case "regenerate-internal":
|
|
355
|
+
ensureInternal(layout);
|
|
356
|
+
return true;
|
|
357
|
+
case "migrate-config": {
|
|
358
|
+
// Only forward, and only field-by-field. There is nothing to migrate at
|
|
359
|
+
// layout v1; the branch exists so the first real migration has a place to
|
|
360
|
+
// go that is already wired into doctor, info, and the tests.
|
|
361
|
+
const config = readConfig(layout);
|
|
362
|
+
writeConfig(layout, { ...config, layoutVersion: LAYOUT_VERSION });
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
default:
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
export function diagnose(layout, env = process.env) {
|
|
370
|
+
const results = [];
|
|
371
|
+
results.push({
|
|
372
|
+
check: "app-dir",
|
|
373
|
+
ok: fs.existsSync(layout.app),
|
|
374
|
+
message: `${APP_DIR}/ exists — the directory the user actually works in`,
|
|
375
|
+
remedy: null,
|
|
376
|
+
});
|
|
377
|
+
const configExists = fs.existsSync(layout.config);
|
|
378
|
+
results.push({
|
|
379
|
+
check: "config-exists",
|
|
380
|
+
ok: configExists,
|
|
381
|
+
message: `${INTERNAL_DIR}/config.json exists`,
|
|
382
|
+
remedy: null,
|
|
383
|
+
});
|
|
384
|
+
if (configExists) {
|
|
385
|
+
try {
|
|
386
|
+
const config = readConfig(layout);
|
|
387
|
+
const current = config.layoutVersion === LAYOUT_VERSION;
|
|
388
|
+
results.push({
|
|
389
|
+
check: "config-parses",
|
|
390
|
+
ok: true,
|
|
391
|
+
message: `config parses (layout v${config.layoutVersion})`,
|
|
392
|
+
remedy: null,
|
|
393
|
+
});
|
|
394
|
+
results.push({
|
|
395
|
+
check: "layout-version",
|
|
396
|
+
ok: current,
|
|
397
|
+
message: current
|
|
398
|
+
? `layout is current (v${LAYOUT_VERSION})`
|
|
399
|
+
: `layout is v${config.layoutVersion}, current is v${LAYOUT_VERSION}`,
|
|
400
|
+
remedy: current ? null : "migrate-config",
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
catch (error) {
|
|
404
|
+
results.push({
|
|
405
|
+
check: "config-parses",
|
|
406
|
+
ok: false,
|
|
407
|
+
message: `config unreadable: ${error.message}`,
|
|
408
|
+
remedy: null,
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
// A stale gitignore is the failure that silently commits a cache directory,
|
|
413
|
+
// so it is checked against the generated contents rather than for existence.
|
|
414
|
+
const expected = gitignoreContents();
|
|
415
|
+
const actual = fs.existsSync(layout.gitignore) ? fs.readFileSync(layout.gitignore, "utf8") : "";
|
|
416
|
+
results.push({
|
|
417
|
+
check: "gitignore",
|
|
418
|
+
ok: actual === expected,
|
|
419
|
+
message: actual === expected
|
|
420
|
+
? `${INTERNAL_DIR}/.gitignore matches the current layout`
|
|
421
|
+
: `${INTERNAL_DIR}/.gitignore does not match the current layout`,
|
|
422
|
+
remedy: actual === expected ? null : "regenerate-internal",
|
|
423
|
+
});
|
|
424
|
+
// Nothing tool-owned may sit at the project root: that is the whole point of
|
|
425
|
+
// the design, and a stray directory is how it erodes one release at a time.
|
|
426
|
+
const strays = INTERNAL_ENTRIES.filter((entry) => fs.existsSync(path.join(layout.root, entry.name)));
|
|
427
|
+
results.push({
|
|
428
|
+
check: "no-root-leak",
|
|
429
|
+
ok: strays.length === 0,
|
|
430
|
+
message: strays.length === 0
|
|
431
|
+
? "no tool-owned files at the project root"
|
|
432
|
+
: `tool-owned entries leaked to the project root: ${strays.map((e) => e.name).join(", ")}`,
|
|
433
|
+
// Moving or deleting a root directory the user may have created themselves
|
|
434
|
+
// is exactly the guess a --fix flag must not make.
|
|
435
|
+
remedy: null,
|
|
436
|
+
});
|
|
437
|
+
if (process.platform === "win32") {
|
|
438
|
+
results.push({
|
|
439
|
+
check: "windows-hidden",
|
|
440
|
+
ok: true,
|
|
441
|
+
message: `note: a leading dot does not hide ${INTERNAL_DIR} on Windows — run \`attrib +h ${INTERNAL_DIR}\` if you want it hidden in Explorer`,
|
|
442
|
+
remedy: null,
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
results.push({
|
|
446
|
+
check: "global-cache",
|
|
447
|
+
ok: true,
|
|
448
|
+
message: `global cache: ${globalCacheDir(env)}`,
|
|
449
|
+
remedy: null,
|
|
450
|
+
});
|
|
451
|
+
return results;
|
|
452
|
+
}
|
|
453
|
+
// MARK: - completions
|
|
454
|
+
function commandCompletions(args, io) {
|
|
455
|
+
const shell = args.positionals[0];
|
|
456
|
+
if (shell !== "bash" && shell !== "zsh") {
|
|
457
|
+
io.err("Usage: ios-agent completions <bash|zsh>");
|
|
458
|
+
return EXIT_USAGE;
|
|
459
|
+
}
|
|
460
|
+
io.out(shell === "bash" ? bashCompletions() : zshCompletions());
|
|
461
|
+
return EXIT_OK;
|
|
462
|
+
}
|
|
463
|
+
function allFlagTokens(command) {
|
|
464
|
+
return command.flags.map((flag) => `--${flag.name}`);
|
|
465
|
+
}
|
|
466
|
+
function bashCompletions() {
|
|
467
|
+
const names = COMMANDS.map((c) => c.name).join(" ");
|
|
468
|
+
const cases = COMMANDS.map((command) => ` ${command.name}) opts="${allFlagTokens(command).join(" ")}" ;;`).join("\n");
|
|
469
|
+
return `# ios-agent bash completion — generated by \`ios-agent completions bash\`
|
|
470
|
+
_ios_agent() {
|
|
471
|
+
local cur prev opts
|
|
472
|
+
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
473
|
+
if [ "$COMP_CWORD" -eq 1 ]; then
|
|
474
|
+
COMPREPLY=( $(compgen -W "${names} help" -- "$cur") )
|
|
475
|
+
return
|
|
476
|
+
fi
|
|
477
|
+
case "\${COMP_WORDS[1]}" in
|
|
478
|
+
${cases}
|
|
479
|
+
*) opts="" ;;
|
|
480
|
+
esac
|
|
481
|
+
COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
|
|
482
|
+
}
|
|
483
|
+
complete -F _ios_agent ios-agent`;
|
|
484
|
+
}
|
|
485
|
+
function zshCompletions() {
|
|
486
|
+
const commandLines = COMMANDS.map((c) => ` '${c.name}:${c.summary}'`).join("\n");
|
|
487
|
+
const flagCases = COMMANDS.map((command) => {
|
|
488
|
+
const flags = command.flags.map((flag) => `'--${flag.name}[${flag.summary}]'`).join(" ");
|
|
489
|
+
return ` ${command.name}) _arguments ${flags || "'*:'"} ;;`;
|
|
490
|
+
}).join("\n");
|
|
491
|
+
return `#compdef ios-agent
|
|
492
|
+
# generated by \`ios-agent completions zsh\`
|
|
493
|
+
_ios_agent() {
|
|
494
|
+
local -a commands
|
|
495
|
+
commands=(
|
|
496
|
+
${commandLines}
|
|
497
|
+
)
|
|
498
|
+
if (( CURRENT == 2 )); then
|
|
499
|
+
_describe 'command' commands
|
|
500
|
+
return
|
|
501
|
+
fi
|
|
502
|
+
case "\${words[2]}" in
|
|
503
|
+
${flagCases}
|
|
504
|
+
esac
|
|
505
|
+
}
|
|
506
|
+
_ios_agent "$@"`;
|
|
507
|
+
}
|
|
508
|
+
// MARK: - Rendering
|
|
509
|
+
function renderTree(layout, minimal) {
|
|
510
|
+
const name = path.basename(layout.root);
|
|
511
|
+
if (minimal) {
|
|
512
|
+
return [`${name}/`, `└── ${APP_DIR}/`].join("\n");
|
|
513
|
+
}
|
|
514
|
+
return [
|
|
515
|
+
`${name}/`,
|
|
516
|
+
`├── ${APP_DIR}/`,
|
|
517
|
+
"├── README.md",
|
|
518
|
+
"├── LICENSE",
|
|
519
|
+
"└── .ios-agent/ # tool-managed, safe to delete",
|
|
520
|
+
].join("\n");
|
|
521
|
+
}
|
|
522
|
+
/** Generated from COMMANDS, so it cannot drift from what the parser accepts. */
|
|
523
|
+
function helpText() {
|
|
524
|
+
const width = Math.max(...COMMANDS.map((c) => c.usage.length));
|
|
525
|
+
const blocks = COMMANDS.map((command) => {
|
|
526
|
+
const head = ` ${command.usage.padEnd(width)} ${command.summary}`;
|
|
527
|
+
const flags = command.flags.map((flag) => ` --${flag.name.padEnd(width - 4)} ${flag.summary}`);
|
|
528
|
+
return [head, ...flags].join("\n");
|
|
529
|
+
});
|
|
530
|
+
return `ios-agent — scaffolding and project management for iOS work
|
|
531
|
+
|
|
532
|
+
USAGE
|
|
533
|
+
${blocks.join("\n\n")}
|
|
534
|
+
|
|
535
|
+
LAYOUT
|
|
536
|
+
App/ your source — the only directory you edit
|
|
537
|
+
.ios-agent/ caches, logs, state, build artifacts, metadata
|
|
538
|
+
only config.json is tracked; the rest regenerates
|
|
539
|
+
|
|
540
|
+
EXIT CODES
|
|
541
|
+
${EXIT_OK} success
|
|
542
|
+
${EXIT_USAGE} usage error, or no project found
|
|
543
|
+
${EXIT_UNHEALTHY} doctor found problems
|
|
544
|
+
|
|
545
|
+
ENVIRONMENT
|
|
546
|
+
IOS_AGENT_HOME Override project root discovery
|
|
547
|
+
IOS_AGENT_CACHE_DIR Override the user-level cache location`;
|
|
548
|
+
}
|
|
549
|
+
/** Exposed for tests: help and completions must cover every dispatchable command. */
|
|
550
|
+
export function commandNames() {
|
|
551
|
+
return COMMANDS.map((command) => command.name);
|
|
552
|
+
}
|
|
553
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,cAAc,EAEd,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAShD,MAAM,CAAC,MAAM,SAAS,GAAO;IAC3B,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC;IAChD,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC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KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,CACpE,CAAC;QACF,OAAO,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,OAAO;;;EAGP,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;;;;;;;;IAQjB,OAAO;IACP,UAAU;IACV,cAAc;;;;+DAI6C,CAAC;AAChE,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,YAAY;IAC1B,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ProjectLayout } from "./layout.js";
|
|
2
|
+
/**
|
|
3
|
+
* `.ios-agent/config.json` — the one tracked file the tool owns.
|
|
4
|
+
*
|
|
5
|
+
* Tool-managed but hand-editable, the same bargain `.git/config` makes: normal
|
|
6
|
+
* use goes through the CLI, and a human who opens it finds something they can
|
|
7
|
+
* read and change. That is why it is JSON with no computed fields — anything
|
|
8
|
+
* derived lives in `metadata.json`, which is disposable.
|
|
9
|
+
*/
|
|
10
|
+
export interface ProjectConfig {
|
|
11
|
+
/** On-disk layout version. Lets a future release migrate instead of guessing. */
|
|
12
|
+
layoutVersion: number;
|
|
13
|
+
/** Schema of this file. Separate from layoutVersion so either can move alone. */
|
|
14
|
+
configVersion: number;
|
|
15
|
+
name: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
/**
|
|
18
|
+
* Source directories, relative to the project root.
|
|
19
|
+
*
|
|
20
|
+
* A list from day one even though `ios-agent new` writes exactly one. The
|
|
21
|
+
* alternative — a `sourceDir` string widened to an array later — is a
|
|
22
|
+
* breaking change to every consumer, for a feature that was always coming.
|
|
23
|
+
*/
|
|
24
|
+
apps: AppEntry[];
|
|
25
|
+
plugins: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface AppEntry {
|
|
28
|
+
name: string;
|
|
29
|
+
/** POSIX-style relative path. Normalised on read so Windows and macOS agree. */
|
|
30
|
+
path: string;
|
|
31
|
+
platforms: string[];
|
|
32
|
+
}
|
|
33
|
+
export declare const CONFIG_VERSION = 1;
|
|
34
|
+
export declare function defaultConfig(name: string, appPath: string, now?: Date): ProjectConfig;
|
|
35
|
+
export declare function writeConfig(layout: ProjectLayout, config: ProjectConfig): void;
|
|
36
|
+
export declare class ConfigError extends Error {
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Read and validate the config.
|
|
40
|
+
*
|
|
41
|
+
* Throws with the offending file named rather than returning a partial object:
|
|
42
|
+
* a config that is present but malformed is a different problem from one that
|
|
43
|
+
* is missing, and collapsing the two sends people looking in the wrong place.
|
|
44
|
+
*/
|
|
45
|
+
export declare function readConfig(layout: ProjectLayout): ProjectConfig;
|
|
46
|
+
/**
|
|
47
|
+
* Store paths POSIX-style regardless of the platform that wrote them.
|
|
48
|
+
*
|
|
49
|
+
* A Windows-authored config carrying `App\MyApp` is unreadable on the macOS
|
|
50
|
+
* machine that builds the app — and this file is tracked, so it crosses
|
|
51
|
+
* machines by design.
|
|
52
|
+
*/
|
|
53
|
+
export declare function toPosix(value: string): string;
|