bearnie 0.1.1 → 0.1.3

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -390,7 +390,7 @@ async function add(components, options) {
390
390
  try {
391
391
  registryIndex = await getRegistryIndex();
392
392
  indexSpinner.succeed(messages.foundComponents(registryIndex.components.length));
393
- } catch (error) {
393
+ } catch {
394
394
  indexSpinner.fail(messages.networkError());
395
395
  print.hint(messages.networkErrorHelp());
396
396
  process.exit(1);
@@ -446,7 +446,7 @@ async function add(components, options) {
446
446
  `Adding ${chalk3.bold(allComponents.length)} component${allComponents.length > 1 ? "s" : ""}`
447
447
  );
448
448
  }
449
- } catch (error) {
449
+ } catch {
450
450
  resolveSpinner.fail("Couldn't resolve dependencies");
451
451
  process.exit(1);
452
452
  }
@@ -465,7 +465,10 @@ async function add(components, options) {
465
465
  component.dependencies?.forEach((d) => npmDeps.add(d));
466
466
  component.devDependencies?.forEach((d) => npmDevDeps.add(d));
467
467
  for (const file of component.files) {
468
- const filePath = path4.join(cwd, config.componentsDir, file.path);
468
+ const isUtilityFile = component.type === "utility" || file.path.startsWith("utils/");
469
+ const relativePath = isUtilityFile ? file.path.replace(/^utils\//, "") : file.path;
470
+ const baseDir = isUtilityFile ? config.utilsDir : config.componentsDir;
471
+ const filePath = path4.join(cwd, baseDir, relativePath);
469
472
  const exists = await fs4.pathExists(filePath);
470
473
  if (exists && !options.yes) {
471
474
  skippedFiles.push(file.path);
@@ -503,7 +506,7 @@ async function add(components, options) {
503
506
  await execa2("npm", ["install", "-D", ...newDevDeps], { cwd });
504
507
  }
505
508
  depsSpinner.succeed("Dependencies installed");
506
- } catch (error) {
509
+ } catch {
507
510
  depsSpinner.fail("Some dependencies couldn't be installed");
508
511
  print.hint("You might need to install them manually.");
509
512
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bearnie",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "CLI for installing Bearnie UI components",
5
5
  "type": "module",
6
6
  "license": "MIT",