@foundrykit/cli 2.0.1 → 2.0.2

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/dist/index.js CHANGED
@@ -756,14 +756,14 @@ Try again later or check your internet connection.`
756
756
  /**
757
757
  * Fetch a specific component by ID
758
758
  */
759
- async getComponent(id) {
759
+ async getComponent(id, force = false) {
760
760
  if (this.isSpecialDependency(id)) {
761
761
  return this.createSpecialDependency(id);
762
762
  }
763
763
  const cache = await this.loadCache();
764
764
  const cachedComponent = cache?.componentData?.[id];
765
765
  const hasValidCache = cache ? this.isCacheValid(cache) : false;
766
- if (cachedComponent && hasValidCache) {
766
+ if (!force && cachedComponent && hasValidCache) {
767
767
  console.log(chalk2.gray(`Using cached data for component: ${id}`));
768
768
  return cachedComponent;
769
769
  }
@@ -1234,7 +1234,7 @@ async function addSingleComponent(id, options) {
1234
1234
  await validateProject2();
1235
1235
  const registry = getRegistry();
1236
1236
  try {
1237
- const componentData = await registry.getComponent(id);
1237
+ const componentData = await registry.getComponent(id, options.force);
1238
1238
  if (!options.overwrite && await hasConflictingFiles(componentData, options)) {
1239
1239
  const { shouldContinue } = await inquirer2.prompt([
1240
1240
  {
@@ -1590,7 +1590,7 @@ function updateCommand() {
1590
1590
  if (id) {
1591
1591
  try {
1592
1592
  console.log(chalk5.blue(`\u{1F504} Updating ${id}...`));
1593
- await addSingleComponent(id, { ...options, overwrite: true });
1593
+ await addSingleComponent(id, { ...options, overwrite: true, force: true });
1594
1594
  } catch (error) {
1595
1595
  console.error(chalk5.red(`\u274C Failed to update ${id}:`));
1596
1596
  console.error(chalk5.red(error instanceof Error ? error.message : String(error)));
@@ -1709,7 +1709,7 @@ async function runUpdates(ids, options) {
1709
1709
  try {
1710
1710
  console.log(chalk5.blue(`
1711
1711
  \u{1F504} Updating ${compId}...`));
1712
- await addSingleComponent(compId, { ...options, overwrite: true });
1712
+ await addSingleComponent(compId, { ...options, overwrite: true, force: true });
1713
1713
  } catch (error) {
1714
1714
  console.error(chalk5.red(`\u274C Failed to update ${compId}:`));
1715
1715
  console.error(chalk5.red(error instanceof Error ? error.message : String(error)));