@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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @foundrykit/cli
2
2
 
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - changes to cli update logic for old repos
8
+ - Updated dependencies
9
+ - @foundrykit/types@2.0.0
10
+
3
11
  ## 2.0.0
4
12
 
5
13
  ### Major Changes
package/dist/cli.js CHANGED
@@ -1604,11 +1604,38 @@ function updateCommand() {
1604
1604
  process.exit(1);
1605
1605
  }
1606
1606
  const config = await fs4.readJson(configPath);
1607
- const installed = config.installedComponents ?? {};
1608
- const installedIds = Object.keys(installed);
1607
+ let installed = config.installedComponents ?? {};
1608
+ let installedIds = Object.keys(installed);
1609
1609
  if (installedIds.length === 0) {
1610
- console.log(chalk5.yellow('No installed components found. Use "foundrykit add" to install components.'));
1611
- return;
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)...`));