viberails 0.6.1 → 0.6.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.
package/dist/index.cjs CHANGED
@@ -3047,8 +3047,15 @@ function setupGithubAction(projectRoot, packageManager, options) {
3047
3047
  }
3048
3048
  }
3049
3049
  if (options?.linter) {
3050
- const lintCmd = options.linter === "biome" ? "biome check ." : "eslint .";
3051
- lines.push(` - run: ${runPrefix} ${lintCmd}`);
3050
+ const lintCmd = options.linter === "biome" ? "biome check" : "eslint";
3051
+ lines.push(
3052
+ ` - name: Lint changed files`,
3053
+ ` run: |`,
3054
+ ` FILES=$(git diff --name-only --diff-filter=ACMR origin/\${{ github.event.pull_request.base.ref }}...HEAD -- '*.js' '*.ts' '*.jsx' '*.tsx')`,
3055
+ ` if [ -n "$FILES" ]; then`,
3056
+ ` echo "$FILES" | xargs ${runPrefix} ${lintCmd}`,
3057
+ ` fi`
3058
+ );
3052
3059
  }
3053
3060
  lines.push(
3054
3061
  ` - run: npx viberails check --enforce --diff-base origin/\${{ github.event.pull_request.base.ref }}`,
@@ -3224,9 +3231,11 @@ async function initCommand(options, cwd) {
3224
3231
  await initInteractive(projectRoot, configPath, options);
3225
3232
  }
3226
3233
  async function initNonInteractive(projectRoot, configPath) {
3227
- console.log(import_chalk12.default.dim("Scanning project..."));
3234
+ const s = clack8.spinner();
3235
+ s.start("Scanning project...");
3228
3236
  const scanResult = await (0, import_scanner2.scan)(projectRoot);
3229
3237
  const config = (0, import_config8.generateConfig)(scanResult);
3238
+ s.stop("Scan complete");
3230
3239
  for (const pkg of config.packages) {
3231
3240
  const pkgMeta = config._meta?.packages?.[pkg.path]?.conventions;
3232
3241
  pkg.conventions = filterHighConfidence(pkg.conventions ?? {}, pkgMeta);
@@ -3241,7 +3250,8 @@ async function initNonInteractive(projectRoot, configPath) {
3241
3250
  );
3242
3251
  }
3243
3252
  if (config.packages.length > 1) {
3244
- console.log(import_chalk12.default.dim("Building import graph..."));
3253
+ const bs = clack8.spinner();
3254
+ bs.start("Building import graph...");
3245
3255
  const { buildImportGraph, inferBoundaries } = await import("@viberails/graph");
3246
3256
  const packages = resolveWorkspacePackages(projectRoot, config.packages);
3247
3257
  const graph = await buildImportGraph(projectRoot, { packages, ignore: config.ignore });
@@ -3250,7 +3260,9 @@ async function initNonInteractive(projectRoot, configPath) {
3250
3260
  if (denyCount > 0) {
3251
3261
  config.boundaries = inferred;
3252
3262
  config.rules.enforceBoundaries = true;
3253
- console.log(` Inferred ${denyCount} boundary rules`);
3263
+ bs.stop(`Inferred ${denyCount} boundary rules`);
3264
+ } else {
3265
+ bs.stop("No boundary rules inferred");
3254
3266
  }
3255
3267
  }
3256
3268
  const compacted = (0, import_config8.compactConfig)(config);
@@ -3372,11 +3384,14 @@ async function initInteractive(projectRoot, configPath, options) {
3372
3384
  clack8.outro("Aborted. No files were written.");
3373
3385
  return;
3374
3386
  }
3387
+ const ws = clack8.spinner();
3388
+ ws.start("Writing configuration...");
3375
3389
  const compacted = (0, import_config8.compactConfig)(config);
3376
3390
  fs19.writeFileSync(configPath, `${JSON.stringify(compacted, null, 2)}
3377
3391
  `);
3378
3392
  writeGeneratedFiles(projectRoot, config, scanResult);
3379
3393
  updateGitignore(projectRoot);
3394
+ ws.stop("Configuration written");
3380
3395
  const ok = import_chalk12.default.green("\u2713");
3381
3396
  clack8.log.step(`${ok} ${path19.basename(configPath)}`);
3382
3397
  clack8.log.step(`${ok} .viberails/context.md`);
@@ -3423,8 +3438,10 @@ async function syncCommand(options, cwd) {
3423
3438
  const configPath = path20.join(projectRoot, CONFIG_FILE6);
3424
3439
  const existing = await (0, import_config9.loadConfig)(configPath);
3425
3440
  const previousStats = loadPreviousStats(projectRoot);
3426
- console.log(import_chalk13.default.dim("Scanning project..."));
3441
+ const s = clack9.spinner();
3442
+ s.start("Scanning project...");
3427
3443
  const scanResult = await (0, import_scanner3.scan)(projectRoot);
3444
+ s.stop("Scan complete");
3428
3445
  const merged = (0, import_config9.mergeConfig)(existing, scanResult);
3429
3446
  const compacted = (0, import_config9.compactConfig)(merged);
3430
3447
  const compactedJson = JSON.stringify(compacted, null, 2);
@@ -3498,7 +3515,7 @@ ${import_chalk13.default.bold("Synced:")}`);
3498
3515
  }
3499
3516
 
3500
3517
  // src/index.ts
3501
- var VERSION = "0.6.1";
3518
+ var VERSION = "0.6.3";
3502
3519
  var program = new import_commander.Command();
3503
3520
  program.name("viberails").description("Guardrails for vibe coding").version(VERSION);
3504
3521
  program.command("init", { isDefault: true }).description("Scan your project and set up enforcement guardrails").option("-y, --yes", "Non-interactive mode (use defaults, high-confidence only)").option("-f, --force", "Re-initialize, replacing existing config").action(async (options) => {