@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/CHANGELOG.md +6 -0
- package/dist/cli.js +5 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/commands/add.ts +2 -1
- package/src/commands/update.ts +2 -2
- package/src/lib/registry.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foundrykit/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"tsup": "^8.0.0",
|
|
36
36
|
"typescript": "^5.9.2",
|
|
37
37
|
"vitest": "^1.2.0",
|
|
38
|
-
"@foundrykit/
|
|
39
|
-
"@foundrykit/
|
|
38
|
+
"@foundrykit/eslint-config": "1.0.5",
|
|
39
|
+
"@foundrykit/typescript-config": "1.0.5"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "tsup",
|
package/src/commands/add.ts
CHANGED
|
@@ -25,6 +25,7 @@ interface AddOptions {
|
|
|
25
25
|
withAnimation?: boolean;
|
|
26
26
|
path?: string;
|
|
27
27
|
overwrite?: boolean;
|
|
28
|
+
force?: boolean;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
export type { AddOptions };
|
|
@@ -164,7 +165,7 @@ export async function addSingleComponent(
|
|
|
164
165
|
|
|
165
166
|
try {
|
|
166
167
|
// Fetch component data from registry
|
|
167
|
-
const componentData = await registry.getComponent(id);
|
|
168
|
+
const componentData = await registry.getComponent(id, options.force);
|
|
168
169
|
|
|
169
170
|
// Check for existing files
|
|
170
171
|
if (
|
package/src/commands/update.ts
CHANGED
|
@@ -22,7 +22,7 @@ export function updateCommand() {
|
|
|
22
22
|
// Update single named component
|
|
23
23
|
try {
|
|
24
24
|
console.log(chalk.blue(`š Updating ${id}...`));
|
|
25
|
-
await addSingleComponent(id, { ...options, overwrite: true });
|
|
25
|
+
await addSingleComponent(id, { ...options, overwrite: true, force: true });
|
|
26
26
|
} catch (error) {
|
|
27
27
|
console.error(chalk.red(`ā Failed to update ${id}:`));
|
|
28
28
|
console.error(chalk.red(error instanceof Error ? error.message : String(error)));
|
|
@@ -168,7 +168,7 @@ async function runUpdates(ids: string[], options: AddOptions): Promise<void> {
|
|
|
168
168
|
for (const compId of ids) {
|
|
169
169
|
try {
|
|
170
170
|
console.log(chalk.blue(`\nš Updating ${compId}...`));
|
|
171
|
-
await addSingleComponent(compId, { ...options, overwrite: true });
|
|
171
|
+
await addSingleComponent(compId, { ...options, overwrite: true, force: true });
|
|
172
172
|
} catch (error) {
|
|
173
173
|
console.error(chalk.red(`ā Failed to update ${compId}:`));
|
|
174
174
|
console.error(chalk.red(error instanceof Error ? error.message : String(error)));
|
package/src/lib/registry.ts
CHANGED
|
@@ -90,7 +90,7 @@ export class RegistryService {
|
|
|
90
90
|
/**
|
|
91
91
|
* Fetch a specific component by ID
|
|
92
92
|
*/
|
|
93
|
-
async getComponent(id: string): Promise<ComponentData> {
|
|
93
|
+
async getComponent(id: string, force = false): Promise<ComponentData> {
|
|
94
94
|
// Check if it's a special dependency first
|
|
95
95
|
if (this.isSpecialDependency(id)) {
|
|
96
96
|
return this.createSpecialDependency(id);
|
|
@@ -100,7 +100,7 @@ export class RegistryService {
|
|
|
100
100
|
const cachedComponent = cache?.componentData?.[id];
|
|
101
101
|
const hasValidCache = cache ? this.isCacheValid(cache) : false;
|
|
102
102
|
|
|
103
|
-
if (cachedComponent && hasValidCache) {
|
|
103
|
+
if (!force && cachedComponent && hasValidCache) {
|
|
104
104
|
console.log(chalk.gray(`Using cached data for component: ${id}`));
|
|
105
105
|
return cachedComponent;
|
|
106
106
|
}
|