@devbie/fewbie-cli 1.1.1 → 1.3.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.
Files changed (65) hide show
  1. package/README.md +129 -36
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/commands/apits.js +1 -1
  4. package/dist/commands/apits.js.map +1 -1
  5. package/dist/commands/create.d.ts +1 -0
  6. package/dist/commands/create.js +10 -2
  7. package/dist/commands/create.js.map +1 -1
  8. package/dist/commands/doctor.d.ts +1 -1
  9. package/dist/commands/doctor.js +49 -64
  10. package/dist/commands/doctor.js.map +1 -1
  11. package/dist/commands/modules/add.d.ts +10 -0
  12. package/dist/commands/modules/add.js +57 -0
  13. package/dist/commands/modules/add.js.map +1 -0
  14. package/dist/commands/modules/apply.d.ts +24 -0
  15. package/dist/commands/modules/apply.js +195 -0
  16. package/dist/commands/modules/apply.js.map +1 -0
  17. package/dist/commands/modules/default.d.ts +7 -0
  18. package/dist/commands/modules/default.js +90 -0
  19. package/dist/commands/modules/default.js.map +1 -0
  20. package/dist/commands/modules/remove.d.ts +7 -0
  21. package/dist/commands/modules/remove.js +49 -0
  22. package/dist/commands/modules/remove.js.map +1 -0
  23. package/dist/commands/modules/update.d.ts +8 -0
  24. package/dist/commands/modules/update.js +81 -0
  25. package/dist/commands/modules/update.js.map +1 -0
  26. package/dist/commands/status.d.ts +4 -0
  27. package/dist/commands/status.js +46 -0
  28. package/dist/commands/status.js.map +1 -0
  29. package/dist/commands/template/update.d.ts +9 -0
  30. package/dist/commands/template/update.js +121 -0
  31. package/dist/commands/template/update.js.map +1 -0
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +4 -90
  34. package/dist/index.js.map +1 -1
  35. package/dist/lib/confirm.d.ts +6 -0
  36. package/dist/lib/confirm.js +21 -0
  37. package/dist/lib/confirm.js.map +1 -0
  38. package/dist/lib/fs-util.d.ts +2 -0
  39. package/dist/lib/fs-util.js +23 -0
  40. package/dist/lib/fs-util.js.map +1 -0
  41. package/dist/lib/modules-file.d.ts +5 -0
  42. package/dist/lib/modules-file.js +55 -0
  43. package/dist/lib/modules-file.js.map +1 -0
  44. package/dist/lib/npm-spec.d.ts +3 -0
  45. package/dist/lib/npm-spec.js +26 -0
  46. package/dist/lib/npm-spec.js.map +1 -0
  47. package/dist/lib/project.d.ts +1 -0
  48. package/dist/lib/project.js +15 -0
  49. package/dist/lib/project.js.map +1 -0
  50. package/dist/lib/template-ownership.d.ts +22 -0
  51. package/dist/lib/template-ownership.js +117 -0
  52. package/dist/lib/template-ownership.js.map +1 -0
  53. package/dist/program.d.ts +3 -0
  54. package/dist/program.js +169 -0
  55. package/dist/program.js.map +1 -0
  56. package/dist/registry/store.d.ts +2 -0
  57. package/dist/registry/store.js +21 -1
  58. package/dist/registry/store.js.map +1 -1
  59. package/package.json +5 -3
  60. package/dist/commands/add.d.ts +0 -9
  61. package/dist/commands/add.js +0 -102
  62. package/dist/commands/add.js.map +0 -1
  63. package/dist/commands/update.d.ts +0 -6
  64. package/dist/commands/update.js +0 -99
  65. package/dist/commands/update.js.map +0 -1
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.runRemove = runRemove;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const colorette_1 = require("colorette");
9
+ const store_1 = require("../../registry/store");
10
+ const confirm_1 = require("../../lib/confirm");
11
+ const errors_1 = require("../../lib/errors");
12
+ const modules_file_1 = require("../../lib/modules-file");
13
+ const project_1 = require("../../lib/project");
14
+ const apply_1 = require("./apply");
15
+ async function runRemove(options) {
16
+ const projectRoot = node_path_1.default.resolve(options.cwd);
17
+ await (0, project_1.assertProjectRoot)(projectRoot);
18
+ const declared = await (0, modules_file_1.requireModulesFile)(projectRoot);
19
+ const removing = [...new Set(options.names)];
20
+ const notDeclared = removing.filter((name) => !declared.includes(name));
21
+ if (notDeclared.length > 0) {
22
+ throw new errors_1.CliError(`Module(s) not declared in fewbie.json: ${notDeclared.join(", ")}. ` +
23
+ `Declared: ${declared.join(", ") || "(none)"}.`);
24
+ }
25
+ const remaining = declared.filter((name) => !removing.includes(name));
26
+ const registryRoot = await (0, store_1.resolveRegistryRoot)();
27
+ const closure = await (0, store_1.resolveInstallSet)(registryRoot, remaining);
28
+ const revived = removing.filter((name) => closure.some((item) => item.manifest.name === name));
29
+ if (revived.length > 0) {
30
+ const details = revived.map((name) => {
31
+ const dependents = closure
32
+ .filter((item) => (item.manifest.registryDependencies ?? []).includes(name))
33
+ .map((item) => item.manifest.name);
34
+ return `${name} (required by ${dependents.join(", ")})`;
35
+ });
36
+ throw new errors_1.CliError(`Cannot remove module(s) still required by the declared set: ${details.join("; ")}.`);
37
+ }
38
+ const confirmed = await (0, confirm_1.confirm)(`Do you want to REMOVE ${removing.join(", ")}?`, options);
39
+ if (!confirmed) {
40
+ console.info("[info] Cancelled.");
41
+ return;
42
+ }
43
+ await (0, apply_1.applyModuleSelection)({ projectRoot, current: declared, next: remaining, dryRun: options.dryRun });
44
+ if (options.dryRun)
45
+ console.info("[dry-run] no files were modified");
46
+ else
47
+ console.info((0, colorette_1.bold)((0, colorette_1.green)("\n✓ Modules removed.")));
48
+ }
49
+ //# sourceMappingURL=remove.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../src/commands/modules/remove.ts"],"names":[],"mappings":";;;;;AAkBA,8BAyCC;AA3DD,0DAA6B;AAC7B,yCAAwC;AAExC,gDAA8E;AAC9E,+CAA4C;AAC5C,6CAA4C;AAC5C,yDAA4D;AAC5D,+CAAsD;AACtD,mCAA+C;AAUxC,KAAK,UAAU,SAAS,CAAC,OAA6B;IAC3D,MAAM,WAAW,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9C,MAAM,IAAA,2B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,CAAC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;iBAC3E,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrC,OAAO,GAAG,IAAI,iBAAiB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QAC1D,CAAC,CAAC,CAAC;QACH,MAAM,IAAI,iBAAQ,CAAC,+DAA+D,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3G,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,IAAA,iBAAO,EAAC,yBAAyB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAClC,OAAO;IACT,CAAC;IAED,MAAM,IAAA,4BAAoB,EAAC,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAExG,IAAI,OAAO,CAAC,MAAM;QAAE,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;;QAChE,OAAO,CAAC,IAAI,CAAC,IAAA,gBAAI,EAAC,IAAA,iBAAK,EAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,8 @@
1
+ export interface ModulesUpdateOptions {
2
+ cwd: string;
3
+ names?: string[];
4
+ check?: boolean;
5
+ yes?: boolean;
6
+ dryRun?: boolean;
7
+ }
8
+ export declare function runUpdate(options: ModulesUpdateOptions): Promise<void>;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.runUpdate = runUpdate;
7
+ const promises_1 = __importDefault(require("node:fs/promises"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ const colorette_1 = require("colorette");
10
+ const store_1 = require("../../registry/store");
11
+ const confirm_1 = require("../../lib/confirm");
12
+ const errors_1 = require("../../lib/errors");
13
+ const fs_util_1 = require("../../lib/fs-util");
14
+ const modules_file_1 = require("../../lib/modules-file");
15
+ const project_1 = require("../../lib/project");
16
+ const diff_1 = require("../../lib/diff");
17
+ async function runUpdate(options) {
18
+ const projectRoot = node_path_1.default.resolve(options.cwd);
19
+ await (0, project_1.assertProjectRoot)(projectRoot);
20
+ if (options.check && options.names && options.names.length > 0) {
21
+ throw new errors_1.CliError("`modules update --check` inspects every declared module and does not accept module names.");
22
+ }
23
+ const declared = await (0, modules_file_1.requireModulesFile)(projectRoot);
24
+ const selected = await selectItems(projectRoot, declared, options.names ?? []);
25
+ const missing = [];
26
+ const outdated = [];
27
+ for (const item of selected) {
28
+ for (const file of item.files) {
29
+ const current = await (0, fs_util_1.readTextIfExists)(node_path_1.default.join(projectRoot, file.target));
30
+ if (current === null) {
31
+ missing.push(`${item.manifest.name}: ${file.target}`);
32
+ continue;
33
+ }
34
+ const latest = await (0, store_1.readItemFileContent)(file);
35
+ if (current !== latest)
36
+ outdated.push({ item: item.manifest.name, target: file.target, current, latest });
37
+ }
38
+ }
39
+ if (outdated.length === 0) {
40
+ console.info((0, colorette_1.green)((0, colorette_1.bold)("✓ Declared module files are up to date.")));
41
+ if (missing.length > 0) {
42
+ console.info((0, colorette_1.yellow)(`Missing file(s); run 'fewbie modules apply' to restore them:\n ${missing.join("\n ")}`));
43
+ }
44
+ return;
45
+ }
46
+ console.info((0, colorette_1.cyan)(`${outdated.length} file(s) differ from the registry:\n`));
47
+ for (const file of outdated) {
48
+ console.info((0, colorette_1.bold)(`# ${file.item} → ${file.target}`));
49
+ process.stdout.write((0, diff_1.unifiedDiff)(file.current, file.latest, `a/${file.target}`, `b/${file.target}`));
50
+ console.info("");
51
+ }
52
+ if (options.check) {
53
+ throw new errors_1.CliError(`${outdated.length} file(s) drift from the registry. Run \`fewbie modules update\` to adopt the registry version.`);
54
+ }
55
+ if (options.dryRun) {
56
+ console.info("[dry-run] no files were modified");
57
+ return;
58
+ }
59
+ const confirmed = await (0, confirm_1.confirm)(`Do you want to UPDATE ${outdated.length} file(s)?`, options);
60
+ if (!confirmed) {
61
+ console.info("[info] Update cancelled.");
62
+ return;
63
+ }
64
+ for (const file of outdated) {
65
+ const target = node_path_1.default.join(projectRoot, file.target);
66
+ await promises_1.default.mkdir(node_path_1.default.dirname(target), { recursive: true });
67
+ await promises_1.default.writeFile(target, file.latest);
68
+ console.info(`${(0, colorette_1.green)("updated")} ${file.target}`);
69
+ }
70
+ console.info((0, colorette_1.green)((0, colorette_1.bold)(`\n✓ Updated ${outdated.length} file(s). Review with git diff.`)));
71
+ }
72
+ async function selectItems(projectRoot, declared, names) {
73
+ if (names.length === 0)
74
+ return (0, store_1.resolveInstallSet)(await (0, store_1.resolveRegistryRoot)(), declared);
75
+ const unknown = names.filter((name) => !declared.includes(name));
76
+ if (unknown.length > 0) {
77
+ throw new errors_1.CliError(`Module(s) not declared in fewbie.json: ${unknown.join(", ")}. Declared: ${declared.join(", ") || "(none)"}.`);
78
+ }
79
+ return (0, store_1.resolveInstallSet)(await (0, store_1.resolveRegistryRoot)(), names);
80
+ }
81
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/modules/update.ts"],"names":[],"mappings":";;;;;AA8BA,8BAiEC;AA/FD,gEAAkC;AAClC,0DAA6B;AAC7B,yCAAsD;AAEtD,gDAA+G;AAC/G,+CAA4C;AAC5C,6CAA4C;AAC5C,+CAAqD;AACrD,yDAA4D;AAC5D,+CAAsD;AACtD,yCAA6C;AAoBtC,KAAK,UA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C,eAAe,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ,GAAG,CAC9G,CAAC;IACJ,CAAC;IACD,OAAO,IAAA,yBAAiB,EAAC,MAAM,IAAA,2BAAmB,GAAE,EAAE,KAAK,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,4 @@
1
+ export interface StatusOptions {
2
+ cwd?: string;
3
+ }
4
+ export declare function runStatus(options: StatusOptions): Promise<void>;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.runStatus = runStatus;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const store_1 = require("../registry/store");
9
+ const fs_util_1 = require("../lib/fs-util");
10
+ const modules_file_1 = require("../lib/modules-file");
11
+ const project_1 = require("../lib/project");
12
+ async function runStatus(options) {
13
+ const projectRoot = node_path_1.default.resolve(options.cwd ?? process.cwd());
14
+ await (0, project_1.assertProjectRoot)(projectRoot);
15
+ const declaration = await (0, modules_file_1.readModulesFile)(projectRoot);
16
+ const declared = declaration ?? [];
17
+ const warnings = [];
18
+ const registryRoot = await (0, store_1.resolveRegistryRoot)();
19
+ const available = new Set(await (0, store_1.listRegistryItemNames)(registryRoot));
20
+ const missing = [];
21
+ for (const name of declared) {
22
+ if (!available.has(name)) {
23
+ warnings.push(`Declared module '${name}' is not present in the registry.`);
24
+ continue;
25
+ }
26
+ const item = await (0, store_1.loadItem)(registryRoot, name);
27
+ const absent = [];
28
+ for (const file of item.files) {
29
+ if (!(await (0, fs_util_1.pathExists)(node_path_1.default.join(projectRoot, file.target))))
30
+ absent.push(file.target);
31
+ }
32
+ if (absent.length > 0)
33
+ missing.push({ name, files: absent });
34
+ }
35
+ const installed = declared.filter((name) => available.has(name) && !missing.some((entry) => entry.name === name));
36
+ console.info(JSON.stringify({
37
+ projectRoot,
38
+ declarationFile: modules_file_1.MODULES_FILE,
39
+ declarationPresent: declaration !== null,
40
+ declared,
41
+ installed,
42
+ missing,
43
+ warnings,
44
+ }, null, 2));
45
+ }
46
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":";;;;;AAgBA,8BA0CC;AA1DD,0DAA6B;AAE7B,6CAAyF;AACzF,4CAA4C;AAC5C,sDAAoE;AACpE,4CAAmD;AAW5C,KAAK,UAAU,SAAS,CAAC,OAAsB;IACpD,MAAM,WAAW,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/D,MAAM,IAAA,2BAAiB,EAAC,WAAW,CAAC,CAAC;IAErC,MAAM,WAAW,GAAG,MAAM,IAAA,8BAAe,EAAC,WAAW,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,WAAW,IAAI,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,MAAM,YAAY,GAAG,MAAM,IAAA,2BAAmB,GAAE,CAAC;IACjD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,IAAA,6BAAqB,EAAC,YAAY,CAAC,CAAC,CAAC;IACrE,MAAM,OAAO,GAA6C,EAAE,CAAC;IAE7D,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACzB,QAAQ,CAAC,IAAI,CAAC,oBAAoB,IAAI,mCAAmC,CAAC,CAAC;YAC3E,SAAS;QACX,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,IAAA,gBAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAChD,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,CAAC,CAAC,MAAM,IAAA,oBAAU,EAAC,mBAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzF,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC;IAElH,OAAO,CAAC,IAAI,CACV,IAAI,CAAC,SAAS,CACZ;QACE,WAAW;QACX,eAAe,EAAE,2BAAY;QAC7B,kBAAkB,EAAE,WAAW,KAAK,IAAI;QACxC,QAAQ;QACR,SAAS;QACT,OAAO;QACP,QAAQ;KACT,EACD,IAAI,EACJ,CAAC,CACF,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ export interface TemplateUpdateOptions {
2
+ cwd: string;
3
+ paths?: string[];
4
+ check?: boolean;
5
+ dryRun?: boolean;
6
+ templatePath?: string;
7
+ templateRef?: string;
8
+ }
9
+ export declare function runTemplateUpdate(options: TemplateUpdateOptions): Promise<void>;
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.runTemplateUpdate = runTemplateUpdate;
7
+ const promises_1 = __importDefault(require("node:fs/promises"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ const colorette_1 = require("colorette");
10
+ const store_1 = require("../../registry/store");
11
+ const errors_1 = require("../../lib/errors");
12
+ const fs_util_1 = require("../../lib/fs-util");
13
+ const template_ownership_1 = require("../../lib/template-ownership");
14
+ const diff_1 = require("../../lib/diff");
15
+ const create_1 = require("../create");
16
+ function matchesPathFilter(filePath, filter) {
17
+ const normalized = filter.replace(/^\.\//, "").replace(/\/+$/, "");
18
+ if (normalized === "")
19
+ return true;
20
+ return filePath === normalized || filePath.startsWith(`${normalized}/`);
21
+ }
22
+ function filterAssets(paths) {
23
+ if (!paths || paths.length === 0)
24
+ return template_ownership_1.SYNCABLE_ASSETS;
25
+ const selected = template_ownership_1.SYNCABLE_ASSETS.filter((asset) => paths.some((prefix) => matchesPathFilter(asset.path, prefix)));
26
+ if (selected.length === 0) {
27
+ throw new errors_1.CliError(`No framework-managed template files match the path filter: ${paths.join(", ")}`);
28
+ }
29
+ return selected;
30
+ }
31
+ async function collectRegistryTargets() {
32
+ const registryRoot = await (0, store_1.resolveRegistryRoot)();
33
+ const names = await (0, store_1.listRegistryItemNames)(registryRoot);
34
+ const targets = new Set();
35
+ for (const name of names) {
36
+ const item = await (0, store_1.loadItem)(registryRoot, name);
37
+ for (const file of item.files)
38
+ targets.add(file.target);
39
+ }
40
+ return targets;
41
+ }
42
+ function printChange(change) {
43
+ if (change.kind === "missing-markers") {
44
+ console.warn((0, colorette_1.yellow)(`! ${change.asset.path}: framework markers (${template_ownership_1.FRAMEWORK_MARKER_START} / ${template_ownership_1.FRAMEWORK_MARKER_END}) ` +
45
+ "not found; cannot update this file. Add them back to re-enable template update."));
46
+ return;
47
+ }
48
+ const label = change.asset.path;
49
+ const kindLabel = change.kind === "create" ? "missing in project" : "differs from template";
50
+ console.info((0, colorette_1.bold)(`\n# ${label} (${kindLabel})`));
51
+ const aLabel = change.currentComparable === null ? "/dev/null" : `a/${label}`;
52
+ process.stdout.write((0, diff_1.unifiedDiff)(change.currentComparable ?? "", change.templateComparable ?? "", aLabel, `b/${label}`));
53
+ }
54
+ async function runTemplateUpdate(options) {
55
+ const projectRoot = node_path_1.default.resolve(options.cwd);
56
+ const assets = filterAssets(options.paths);
57
+ const scope = options.paths && options.paths.length > 0 ? options.paths.join(", ") : null;
58
+ const template = await (0, create_1.resolveTemplate)({
59
+ templatePath: options.templatePath,
60
+ templateRef: options.templateRef,
61
+ });
62
+ try {
63
+ console.info((0, colorette_1.cyan)(`Template source: ${template.source}`));
64
+ if (scope)
65
+ console.info((0, colorette_1.cyan)(`Scope: ${scope} (${assets.length} template files)`));
66
+ const registryTargets = await collectRegistryTargets();
67
+ const overlap = assets.filter((asset) => registryTargets.has(asset.path));
68
+ if (overlap.length > 0) {
69
+ throw new errors_1.CliError(`Template update and the registry both own: ${overlap.map((asset) => asset.path).join(", ")}. ` +
70
+ "Reclassify them in ADR-025 before updating.");
71
+ }
72
+ const projectFiles = new Map();
73
+ const templateFiles = new Map();
74
+ for (const asset of assets) {
75
+ projectFiles.set(asset.path, await (0, fs_util_1.readTextIfExists)(node_path_1.default.join(projectRoot, asset.path)));
76
+ templateFiles.set(asset.path, await (0, fs_util_1.readTextIfExists)(node_path_1.default.join(template.root, asset.path)));
77
+ }
78
+ let changes;
79
+ try {
80
+ changes = (0, template_ownership_1.planTemplateUpdate)(projectFiles, templateFiles, assets);
81
+ }
82
+ catch (error) {
83
+ throw new errors_1.CliError(error.message);
84
+ }
85
+ if (changes.length === 0) {
86
+ const suffix = scope ? ` (scope: ${scope})` : "";
87
+ console.info((0, colorette_1.green)((0, colorette_1.bold)(`✓ Project template files are up to date with the template${suffix}.`)));
88
+ return;
89
+ }
90
+ const actionable = changes.filter((change) => change.kind !== "missing-markers");
91
+ for (const change of changes)
92
+ printChange(change);
93
+ console.info(`\n${actionable.length} template file(s) to update: ` +
94
+ actionable.map((change) => `${change.asset.path} (${change.kind})`).join(", "));
95
+ if (options.check) {
96
+ const command = scope ? `fewbie template update ${scope}` : "fewbie template update";
97
+ throw new errors_1.CliError(`${changes.length} template file(s) drift from the template (${actionable.length} auto-fixable). ` +
98
+ `Run \`${command}\` to apply the template version.`);
99
+ }
100
+ if (options.dryRun) {
101
+ console.info("[dry-run] no files were modified");
102
+ return;
103
+ }
104
+ for (const change of actionable) {
105
+ if (change.nextContent === null)
106
+ continue;
107
+ const target = node_path_1.default.join(projectRoot, change.asset.path);
108
+ await promises_1.default.mkdir(node_path_1.default.dirname(target), { recursive: true });
109
+ await promises_1.default.writeFile(target, change.nextContent);
110
+ }
111
+ const skipped = changes.length - actionable.length;
112
+ if (skipped > 0)
113
+ console.warn((0, colorette_1.yellow)(`\n${skipped} file(s) left untouched (missing markers).`));
114
+ console.info((0, colorette_1.green)((0, colorette_1.bold)("\n✓ Template files updated.")));
115
+ console.info("Review with `git diff`, then commit on a branch and open a PR.");
116
+ }
117
+ finally {
118
+ await template.cleanup?.();
119
+ }
120
+ }
121
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/template/update.ts"],"names":[],"mappings":";;;;;AAiFA,8CA4EC;AA7JD,gEAAkC;AAClC,0DAA6B;AAC7B,yCAAsD;AAEtD,gDAA4F;AAC5F,6CAA4C;AAC5C,+CAAqD;AACrD,qEAOsC;AACtC,yCAA6C;AAC7C,sCAA4C;AAe5C,SAAS,iBAAiB,CAAC,QAAgB,EAAE,MAAc;IACzD,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACnE,IAAI,UAAU,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO,QAAQ,KAAK,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,YAAY,CAAC,KAA2B;IAC/C,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,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E,SAAS;YAC1C,MAAM,MAAM,GAAG,mBAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACzD,MAAM,kBAAE,CAAC,KAAK,CAAC,mBAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1D,MAAM,kBAAE,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QACjD,CAAC;QACD,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QACnD,IAAI,OAAO,GAAG,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,IAAA,kBAAM,EAAC,KAAK,OAAO,4CAA4C,CAAC,CAAC,CAAC;QAChG,OAAO,CAAC,IAAI,CAAC,IAAA,iBAAK,EAAC,IAAA,gBAAI,EAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,gEAAgE,CAAC,CAAC;IACjF,CAAC;YAAS,CAAC;QACT,MAAM,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;IAC7B,CAAC;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export declare const VERSION: string;
2
+ export {};
package/dist/index.js CHANGED
@@ -1,97 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.VERSION = void 0;
5
- const commander_1 = require("commander");
6
4
  const colorette_1 = require("colorette");
7
- const create_1 = require("./commands/create");
8
- const add_1 = require("./commands/add");
9
- const apits_1 = require("./commands/apits");
10
- const doctor_1 = require("./commands/doctor");
11
- const update_1 = require("./commands/update");
12
- exports.VERSION = require("../package.json").version;
13
- const program = new commander_1.Command();
14
- program
15
- .name("fewbie")
16
- .description("Fewbie frontend framework CLI: scaffold Next.js projects and install business components from the fewbie registry")
17
- .version(exports.VERSION)
18
- .option("-C, --cwd <dir>", "project root directory", process.cwd())
19
- .action(() => {
20
- program.outputHelp();
21
- console.log(`\n${(0, colorette_1.bold)("@devbie/fewbie-cli")} ${exports.VERSION}`);
22
- });
23
- program
24
- .command("create <project-name>")
25
- .description("create a new project from the fewbie basic template")
26
- .option("--template-path <dir>", "use a local template directory instead of cloning fewbie-starter")
27
- .option("--template-ref <ref>", "git ref of fewbie-starter to clone the template from")
28
- .option("--no-git-init", "skip 'git init' in the new project", undefined)
29
- .action(async function (projectName) {
30
- const flags = this.optsWithGlobals();
31
- await (0, create_1.runCreate)({
32
- name: projectName,
33
- cwd: flags.cwd ?? process.cwd(),
34
- templatePath: flags.templatePath,
35
- templateRef: flags.templateRef,
36
- gitInit: flags.gitInit,
37
- });
38
- });
39
- program
40
- .command("add <names...>")
41
- .description("add one or more components or logic utils from the fewbie registry")
42
- .option("-f, --force", "overwrite files that already exist", false)
43
- .option("--skip-install", "do not run npm install for missing dependencies", false)
44
- .option("--with-login-form", "also install the login-form block (e.g. `fewbie add auth --with-login-form`)", false)
45
- .action(async function (names) {
46
- const flags = this.optsWithGlobals();
47
- await (0, add_1.runAdd)({
48
- names,
49
- cwd: flags.cwd ?? process.cwd(),
50
- force: Boolean(flags.force),
51
- skipInstall: Boolean(flags.skipInstall),
52
- withLoginForm: Boolean(flags.withLoginForm),
53
- });
54
- });
55
- program
56
- .command("apits [input]")
57
- .description("generate typed API request code from an OpenAPI document (URL or local JSON/YAML); the first run scaffolds apits.config.ts")
58
- .option("-n, --name <name>", "only generate the config source with this name")
59
- .option("-w, --watch", "watch a local OpenAPI document and regenerate on change", false)
60
- .option("--skip-install", "do not install the generator dev dependency", false)
61
- .action(async function (input) {
62
- const flags = this.optsWithGlobals();
63
- await (0, apits_1.runApits)({
64
- input,
65
- name: flags.name,
66
- watch: Boolean(flags.watch),
67
- skipInstall: Boolean(flags.skipInstall),
68
- cwd: flags.cwd ?? process.cwd(),
69
- });
70
- });
71
- program
72
- .command("doctor")
73
- .description("check project health (structure, registry items, dependencies, tokens)")
74
- .option("--json", "emit machine-readable JSON", false)
75
- .action(async function () {
76
- const flags = this.optsWithGlobals();
77
- await (0, doctor_1.doctorCommand)({
78
- cwd: flags.cwd ?? process.cwd(),
79
- json: Boolean(flags.json),
80
- });
81
- });
82
- program
83
- .command("update [names...]")
84
- .description("show (or apply with --write) updates for installed registry items")
85
- .option("-w, --write", "apply the updates instead of only printing diffs", false)
86
- .action(async function (names) {
87
- const flags = this.optsWithGlobals();
88
- await (0, update_1.runUpdate)({
89
- cwd: flags.cwd ?? process.cwd(),
90
- write: Boolean(flags.write),
91
- names: names.length > 0 ? names : undefined,
92
- });
93
- });
94
- program.parseAsync(process.argv).catch((error) => {
5
+ const program_1 = require("./program");
6
+ (0, program_1.buildProgram)()
7
+ .parseAsync(process.argv)
8
+ .catch((error) => {
95
9
  const message = error instanceof Error ? error.message : String(error);
96
10
  console.error(`${(0, colorette_1.red)("error")} ${message}`);
97
11
  process.exit(1);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AACA,yCAAoC;AACpC,yCAAsC;AAEtC,8CAA8C;AAC9C,wCAAwC;AACxC,4CAA4C;AAC5C,8CAAkD;AAClD,8CAA8C;AAKjC,QAAA,OAAO,GAAI,OAAO,CAAC,iBAAiB,CAAyB,CAAC,OAAO,CAAC;AAEnF,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CACV,mHAAmH,CACpH;KACA,OAAO,CAAC,eAAO,CAAC;KAChB,MAAM,CAAC,iBAAiB,EAAE,wBAAwB,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;KAIlE,MAAM,CAAC,GAAG,EAAE;IACX,OAAO,CAAC,UAAU,EAAE,CAAC;IACrB,OA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AAO,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC;IAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare function isInteractive(): boolean;
2
+ export interface ConfirmOptions {
3
+ yes?: boolean;
4
+ dryRun?: boolean;
5
+ }
6
+ export declare function confirm(message: string, options?: ConfirmOptions): Promise<boolean>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isInteractive = isInteractive;
4
+ exports.confirm = confirm;
5
+ const prompts_1 = require("@inquirer/prompts");
6
+ function isInteractive() {
7
+ return Boolean(process.stdin.isTTY && process.stdout.isTTY);
8
+ }
9
+ async function confirm(message, options = {}) {
10
+ if (options.yes || options.dryRun || !isInteractive())
11
+ return true;
12
+ const answer = await (0, prompts_1.select)({
13
+ message,
14
+ choices: [
15
+ { name: "Yes", value: "yes" },
16
+ { name: "No", value: "no" },
17
+ ],
18
+ });
19
+ return answer === "yes";
20
+ }
21
+ //# sourceMappingURL=confirm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirm.js","sourceRoot":"","sources":["../../src/lib/confirm.ts"],"names":[],"mappings":";;AAGA,sCAEC;AAUD,0BAUC;AAzBD,+CAA2C;AAG3C,SAAgB,aAAa;IAC3B,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC;AAUM,KAAK,UAAU,OAAO,CAAC,OAAe,EAAE,UAA0B,EAAE;IACzE,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE;QAAE,OAAO,IAAI,CAAC;IACnE,MAAM,MAAM,GAAG,MAAM,IAAA,gBAAM,EAAC;QAC1B,OAAO;QACP,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;YAC7B,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;SAC5B;KACF,CAAC,CAAC;IACH,OAAO,MAAM,KAAK,KAAK,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function pathExists(absolutePath: string): Promise<boolean>;
2
+ export declare function readTextIfExists(absolutePath: string): Promise<string | null>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.pathExists = pathExists;
7
+ exports.readTextIfExists = readTextIfExists;
8
+ const promises_1 = __importDefault(require("node:fs/promises"));
9
+ async function pathExists(absolutePath) {
10
+ return promises_1.default
11
+ .access(absolutePath)
12
+ .then(() => true)
13
+ .catch(() => false);
14
+ }
15
+ async function readTextIfExists(absolutePath) {
16
+ try {
17
+ return await promises_1.default.readFile(absolutePath, "utf8");
18
+ }
19
+ catch {
20
+ return null;
21
+ }
22
+ }
23
+ //# sourceMappingURL=fs-util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs-util.js","sourceRoot":"","sources":["../../src/lib/fs-util.ts"],"names":[],"mappings":";;;;;AAGA,gCAKC;AAGD,4CAMC;AAjBD,gEAAkC;AAG3B,KAAK,UAAU,UAAU,CAAC,YAAoB;IACnD,OAAO,kBAAE;SACN,MAAM,CAAC,YAAY,CAAC;SACpB,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;SAChB,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AAGM,KAAK,UAAU,gBAAgB,CAAC,YAAoB;IACzD,IAAI,CAAC;QACH,OAAO,MAAM,kBAAE,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const MODULES_FILE = "fewbie.json";
2
+ export declare function readModulesFile(projectRoot: string): Promise<string[] | null>;
3
+ export declare function requireModulesFile(projectRoot: string): Promise<string[]>;
4
+ export declare function modulesFileContent(names: string[]): string;
5
+ export declare function writeModulesFile(projectRoot: string, names: string[]): Promise<void>;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MODULES_FILE = void 0;
7
+ exports.readModulesFile = readModulesFile;
8
+ exports.requireModulesFile = requireModulesFile;
9
+ exports.modulesFileContent = modulesFileContent;
10
+ exports.writeModulesFile = writeModulesFile;
11
+ const promises_1 = __importDefault(require("node:fs/promises"));
12
+ const node_path_1 = __importDefault(require("node:path"));
13
+ const errors_1 = require("./errors");
14
+ exports.MODULES_FILE = "fewbie.json";
15
+ async function readModulesFile(projectRoot) {
16
+ const target = node_path_1.default.join(projectRoot, exports.MODULES_FILE);
17
+ let raw;
18
+ try {
19
+ raw = await promises_1.default.readFile(target, "utf8");
20
+ }
21
+ catch (error) {
22
+ if (error.code === "ENOENT")
23
+ return null;
24
+ throw error;
25
+ }
26
+ let parsed;
27
+ try {
28
+ parsed = JSON.parse(raw);
29
+ }
30
+ catch (error) {
31
+ throw new errors_1.CliError(`Invalid JSON in ${exports.MODULES_FILE}: ${error.message}`);
32
+ }
33
+ const names = parsed.modules;
34
+ if (!Array.isArray(names) || names.some((name) => typeof name !== "string")) {
35
+ throw new errors_1.CliError(`${exports.MODULES_FILE} must be an object of the form { "modules": ["name", ...] }.`);
36
+ }
37
+ return normalizeNames(names);
38
+ }
39
+ async function requireModulesFile(projectRoot) {
40
+ const declared = await readModulesFile(projectRoot);
41
+ if (declared === null) {
42
+ throw new errors_1.CliError(`No ${exports.MODULES_FILE} found in ${projectRoot}. Run 'fewbie create' or add { "modules": [] } to the project root.`);
43
+ }
44
+ return declared;
45
+ }
46
+ function modulesFileContent(names) {
47
+ return `${JSON.stringify({ modules: normalizeNames(names) }, null, 2)}\n`;
48
+ }
49
+ async function writeModulesFile(projectRoot, names) {
50
+ await promises_1.default.writeFile(node_path_1.default.join(projectRoot, exports.MODULES_FILE), modulesFileContent(names));
51
+ }
52
+ function normalizeNames(names) {
53
+ return [...new Set(names)].sort();
54
+ }
55
+ //# sourceMappingURL=modules-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules-file.js","sourceRoot":"","sources":["../../src/lib/modules-file.ts"],"names":[],"mappings":";;;;;;AAaA,0CAsBC;AAGD,gDAQC;AAGD,gDAEC;AAED,4CAEC;AAvDD,gEAAkC;AAClC,0DAA6B;AAE7B,qCAAoC;AAGvB,QAAA,YAAY,GAAG,aAAa,CAAC;AAOnC,KAAK,UAAU,eAAe,CAAC,WAAmB;IACvD,MAAM,MAAM,GAAG,mBAAI,CAAC,IAAI,CAAC,WAAW,EAAE,oBAAY,CAAC,CAAC;IACpD,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QACpE,MAAM,KAAK,CAAC;IACd,CAAC;IAED,IAAI,MAAmB,CAAC;IACxB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAgB,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,iBAAQ,CAAC,mBAAmB,oBAAY,KAAM,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC;IAC7B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,EAAE,CAAC;QAC5E,MAAM,IAAI,iBAAQ,CAAC,GAAG,oBAAY,8DAA8D,CAAC,CAAC;IACpG,CAAC;IACD,OAAO,cAAc,CAAC,KAAiB,CAAC,CAAC;AAC3C,CAAC;AAGM,KAAK,UAAU,kBAAkB,CAAC,WAAmB;IAC1D,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,WAAW,CAAC,CAAC;IACpD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,iBAAQ,CAChB,MAAM,oBAAY,aAAa,WAAW,qEAAqE,CAChH,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAGD,SAAgB,kBAAkB,CAAC,KAAe;IAChD,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;AAC5E,CAAC;AAEM,KAAK,UAAU,gBAAgB,CAAC,WAAmB,EAAE,KAAe;IACzE,MAAM,kBAAE,CAAC,SAAS,CAAC,mBAAI,CAAC,IAAI,CAAC,WAAW,EAAE,oBAAY,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;AACtF,CAAC;AAED,SAAS,cAAc,CAAC,KAAe;IACrC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACpC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function packageNameOf(spec: string): string;
2
+ export declare function declaredPackageNames(projectRoot: string): Promise<Set<string>>;
3
+ export declare function missingPackages(projectRoot: string, specs: string[]): Promise<string[]>;