Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# jsxpine

## 1.1.1

### Patch Changes

- [fix] exit process when component(s) not found

## 1.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jsxpine",
"description": "Add jsx components to your app.",
"version": "1.1.0",
"version": "1.1.1",
"publishConfig": {
"access": "public"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class AddCommand {
this.logger
);

await addCheckOptions.checkComponentsInRegistry();
await addCheckOptions.resolveComponentsInRegistry()
await addCheckOptions.checkPath();

this.config = await addCheckOptions.getConfig();
Expand Down
11 changes: 4 additions & 7 deletions packages/cli/src/commands/add/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ export class AddCheckOptions {
this.logger.error(
`The path ${this.cwd} does not exist. Please try again.`
);
process.exitCode = 1;
return;
process.exit(0);
}
}

public async getConfig() {
return await ConfigUtils.getConfig(this.cwd);
}

public async checkComponentsInRegistry() {
public async resolveComponentsInRegistry() {
const registryIndex = await RegistryUtils.getRegistryIndex();

let selectedComponents = this.components;
Expand All @@ -52,8 +51,7 @@ export class AddCheckOptions {

if (!selectedComponents?.length) {
this.logger.warn("No components selected. Exiting.");
process.exitCode = 0;
return;
process.exit(0);
}

this.registryTree = await RegistryUtils.resolveTree(
Expand All @@ -63,8 +61,7 @@ export class AddCheckOptions {

if (!this.registryTree?.length) {
this.logger.warn("Selected components not found. Exiting.");
process.exitCode = 0;
return;
process.exit(0);
}
}

Expand Down