@foundrykit/cli 2.0.0 → 2.0.1
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/CHANGELOG.md +8 -0
- package/dist/cli.js +31 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.js +31 -4
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/commands/update.ts +38 -5
package/dist/index.js
CHANGED
|
@@ -1604,11 +1604,38 @@ function updateCommand() {
|
|
|
1604
1604
|
process.exit(1);
|
|
1605
1605
|
}
|
|
1606
1606
|
const config = await fs4.readJson(configPath);
|
|
1607
|
-
|
|
1608
|
-
|
|
1607
|
+
let installed = config.installedComponents ?? {};
|
|
1608
|
+
let installedIds = Object.keys(installed);
|
|
1609
1609
|
if (installedIds.length === 0) {
|
|
1610
|
-
console.log(chalk5.
|
|
1611
|
-
|
|
1610
|
+
console.log(chalk5.gray("No install tracking found. Scanning filesystem for installed components..."));
|
|
1611
|
+
const registry = getRegistry();
|
|
1612
|
+
let allComponents;
|
|
1613
|
+
try {
|
|
1614
|
+
allComponents = await registry.getComponents();
|
|
1615
|
+
} catch (error) {
|
|
1616
|
+
console.error(chalk5.red("\u274C Failed to fetch registry:"));
|
|
1617
|
+
console.error(chalk5.red(error instanceof Error ? error.message : String(error)));
|
|
1618
|
+
process.exit(1);
|
|
1619
|
+
}
|
|
1620
|
+
for (const component of allComponents) {
|
|
1621
|
+
try {
|
|
1622
|
+
const componentData = await registry.getComponent(component.id);
|
|
1623
|
+
if (await hasConflictingFiles(componentData, options)) {
|
|
1624
|
+
installed[component.id] = {
|
|
1625
|
+
id: component.id,
|
|
1626
|
+
version: null,
|
|
1627
|
+
installedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1628
|
+
};
|
|
1629
|
+
}
|
|
1630
|
+
} catch {
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
installedIds = Object.keys(installed);
|
|
1634
|
+
if (installedIds.length === 0) {
|
|
1635
|
+
console.log(chalk5.yellow('No installed components found. Use "foundrykit add" to install components.'));
|
|
1636
|
+
return;
|
|
1637
|
+
}
|
|
1638
|
+
console.log(chalk5.gray(`Found ${installedIds.length} installed component(s) via filesystem scan.`));
|
|
1612
1639
|
}
|
|
1613
1640
|
if (options.opt) {
|
|
1614
1641
|
console.log(chalk5.blue(`\u{1F50D} Checking for updates across ${installedIds.length} installed component(s)...`));
|