@ooneex/cli 1.17.6 → 1.17.8

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
@@ -5519,15 +5519,6 @@ import { decorator as decorator6 } from "@ooneex/command";
5519
5519
  import { TerminalLogger as TerminalLogger5 } from "@ooneex/logger";
5520
5520
  import { toKebabCase, toPascalCase } from "@ooneex/utils";
5521
5521
 
5522
- // src/templates/module/command.run.txt
5523
- var command_run_default = `#!/usr/bin/env bun
5524
-
5525
- import { run } from "@ooneex/command";
5526
- import "@/commands/commands";
5527
-
5528
- await run();
5529
- `;
5530
-
5531
5522
  // src/templates/module/module.txt
5532
5523
  var module_default = `import type { ModuleType } from "@ooneex/module";
5533
5524
 
@@ -5679,11 +5670,6 @@ class MakeModuleCommand {
5679
5670
  }
5680
5671
  if (!skipCommands) {
5681
5672
  await Bun.write(join5(srcDir, "commands", "commands.ts"), "");
5682
- const binCommandRunPath = join5(moduleDir, "bin", "command", "run.ts");
5683
- const binCommandRunFile = Bun.file(binCommandRunPath);
5684
- if (!await binCommandRunFile.exists()) {
5685
- await Bun.write(binCommandRunPath, command_run_default);
5686
- }
5687
5673
  }
5688
5674
  await Bun.write(join5(moduleDir, "package.json"), packageContent);
5689
5675
  await Bun.write(join5(moduleDir, "tsconfig.json"), tsconfig_default);
@@ -7041,9 +7027,6 @@ class MakeAppCommand {
7041
7027
  });
7042
7028
  const appModulePackagePath = join9(destination, "modules", "app", "package.json");
7043
7029
  const appModulePackageJson = await Bun.file(appModulePackagePath).json();
7044
- appModulePackageJson.scripts.dev = "docker compose up -d && bun --hot run ./src/index.ts";
7045
- appModulePackageJson.scripts.stop = "docker compose down";
7046
- appModulePackageJson.scripts.build = "bun build ./src/index.ts --outdir ./dist --target bun";
7047
7030
  await Bun.write(appModulePackagePath, JSON.stringify(appModulePackageJson, null, 2));
7048
7031
  const envContent = env_default.replace(/^DATABASE_URL=/m, 'DATABASE_URL="postgresql://ooneex:ooneex@localhost:5432/ooneex"').replace(/^CACHE_REDIS_URL=/m, 'CACHE_REDIS_URL="redis://localhost:6379"').replace(/^PUBSUB_REDIS_URL=/m, 'PUBSUB_REDIS_URL="redis://localhost:6379"').replace(/^RATE_LIMIT_REDIS_URL=/m, 'RATE_LIMIT_REDIS_URL="redis://localhost:6379"').replace(/^DATABASE_REDIS_URL=/m, 'DATABASE_REDIS_URL="redis://localhost:6379"');
7049
7032
  await Bun.write(join9(destination, "modules", "app", ".env"), envContent);
@@ -7556,6 +7539,17 @@ MakeClaudeSkillCommand = __legacyDecorateClassTS([
7556
7539
  import { join as join12 } from "path";
7557
7540
  import { commandCreate, decorator as decorator12 } from "@ooneex/command";
7558
7541
  import { TerminalLogger as TerminalLogger11 } from "@ooneex/logger";
7542
+
7543
+ // src/templates/module/command.run.txt
7544
+ var command_run_default = `#!/usr/bin/env bun
7545
+
7546
+ import { run } from "@ooneex/command";
7547
+ import "@/commands/commands";
7548
+
7549
+ await run();
7550
+ `;
7551
+
7552
+ // src/commands/MakeCommandCommand.ts
7559
7553
  class MakeCommandCommand {
7560
7554
  getName() {
7561
7555
  return "make:command";
@@ -7566,7 +7560,7 @@ class MakeCommandCommand {
7566
7560
  async run(options) {
7567
7561
  let { name, module } = options;
7568
7562
  if (!name) {
7569
- name = await askName({ message: "Enter name" });
7563
+ name = await askName({ message: "Enter command name" });
7570
7564
  }
7571
7565
  if (module) {
7572
7566
  await ensureModule(module);
@@ -7577,35 +7571,12 @@ class MakeCommandCommand {
7577
7571
  commandDir: join12(base, "src", "commands"),
7578
7572
  testsDir: join12(base, "tests", "commands")
7579
7573
  });
7580
- if (module && module !== "app") {
7581
- const appCommandsRootPath = join12(process.cwd(), "modules", "app", "src", "commands", "commands.ts");
7582
- const appCommandsRootFile = Bun.file(appCommandsRootPath);
7583
- const importLine = `import "@${module}/commands/commands";`;
7584
- if (await appCommandsRootFile.exists()) {
7585
- const appCommandsContent = await appCommandsRootFile.text();
7586
- if (!appCommandsContent.includes(importLine)) {
7587
- await Bun.write(appCommandsRootPath, `${appCommandsContent.trimEnd()}
7588
- ${importLine}
7589
- `);
7590
- }
7591
- } else {
7592
- await Bun.write(appCommandsRootPath, `${importLine}
7593
- `);
7594
- }
7595
- }
7596
- const binCommandRunPath = join12(process.cwd(), "modules", "app", "bin", "command", "run.ts");
7574
+ const binCommandRunPath = join12(process.cwd(), base, "bin", "command", "run.ts");
7597
7575
  const binCommandRunFile = Bun.file(binCommandRunPath);
7598
7576
  if (!await binCommandRunFile.exists()) {
7599
7577
  await Bun.write(binCommandRunPath, command_run_default);
7600
7578
  }
7601
- const packageJsonPath = join12(process.cwd(), "modules", "app", "package.json");
7602
- const packageJsonFile = Bun.file(packageJsonPath);
7603
- if (await packageJsonFile.exists()) {
7604
- const packageJson = await packageJsonFile.json();
7605
- packageJson.scripts = packageJson.scripts || {};
7606
- packageJson.scripts.command = "bun ./bin/command/run.ts";
7607
- await Bun.write(packageJsonPath, JSON.stringify(packageJson, null, 2));
7608
- }
7579
+ const packageJsonPath = join12(process.cwd(), base, "package.json");
7609
7580
  const logger = new TerminalLogger11;
7610
7581
  logger.success(`${commandPath} created successfully`, undefined, {
7611
7582
  showTimestamp: false,
@@ -7617,11 +7588,17 @@ ${importLine}
7617
7588
  showArrow: false,
7618
7589
  useSymbol: true
7619
7590
  });
7620
- logger.info("Run 'bun run command' to execute commands", undefined, {
7621
- showTimestamp: false,
7622
- showArrow: true,
7623
- showLevel: false
7624
- });
7591
+ const pkgJson = await Bun.file(packageJsonPath).json();
7592
+ const deps = pkgJson.dependencies ?? {};
7593
+ const devDeps = pkgJson.devDependencies ?? {};
7594
+ if (!deps["@ooneex/command"] && !devDeps["@ooneex/command"]) {
7595
+ const install = Bun.spawn(["bun", "add", "--dev", "@ooneex/command"], {
7596
+ cwd: process.cwd(),
7597
+ stdout: "ignore",
7598
+ stderr: "inherit"
7599
+ });
7600
+ await install.exited;
7601
+ }
7625
7602
  }
7626
7603
  }
7627
7604
  MakeCommandCommand = __legacyDecorateClassTS([
@@ -9599,7 +9576,7 @@ class MakeMigrationCommand {
9599
9576
  const devDeps = pkgJson.devDependencies ?? {};
9600
9577
  if (!deps["@ooneex/migrations"] && !devDeps["@ooneex/migrations"]) {
9601
9578
  const install = Bun.spawn(["bun", "add", "--dev", "@ooneex/migrations"], {
9602
- cwd: join21(process.cwd(), base),
9579
+ cwd: process.cwd(),
9603
9580
  stdout: "ignore",
9604
9581
  stderr: "inherit"
9605
9582
  });
@@ -9981,7 +9958,11 @@ class MakeReleaseCommand {
9981
9958
  const shouldPush = await askConfirm({ message: "Push commits and tags to remote?", initial: true });
9982
9959
  if (shouldPush) {
9983
9960
  try {
9984
- await $`git push && git push --tags`;
9961
+ await this.bunInstall();
9962
+ await this.gitAdd("bun.lock");
9963
+ await this.gitCommit("chore(common): Update bun.lock");
9964
+ logger.success("Updated and committed bun.lock", undefined, logOptions);
9965
+ await this.gitPush();
9985
9966
  logger.success("Pushed commits and tags to remote", undefined, logOptions);
9986
9967
  } catch {
9987
9968
  logger.error("Failed to push to remote", undefined, logOptions);
@@ -10127,6 +10108,12 @@ ${section}
10127
10108
  async gitTag(tag, message) {
10128
10109
  await $`git tag -a ${tag} -m ${message}`;
10129
10110
  }
10111
+ async bunInstall() {
10112
+ await $`bun install`;
10113
+ }
10114
+ async gitPush() {
10115
+ await $`git push && git push --tags`;
10116
+ }
10130
10117
  }
10131
10118
  MakeReleaseCommand = __legacyDecorateClassTS([
10132
10119
  decorator24.command()
@@ -11302,7 +11289,7 @@ class MakeSeedCommand {
11302
11289
  const devDeps = pkgJson.devDependencies ?? {};
11303
11290
  if (!deps["@ooneex/seeds"] && !devDeps["@ooneex/seeds"]) {
11304
11291
  const install = Bun.spawn(["bun", "add", "--dev", "@ooneex/seeds"], {
11305
- cwd: join28(process.cwd(), base),
11292
+ cwd: process.cwd(),
11306
11293
  stdout: "ignore",
11307
11294
  stderr: "inherit"
11308
11295
  });
@@ -11720,4 +11707,4 @@ SeedRunCommand = __legacyDecorateClassTS([
11720
11707
  // src/index.ts
11721
11708
  await run();
11722
11709
 
11723
- //# debugId=1317A3FF7CEC8E3164756E2164756E21
11710
+ //# debugId=8D3710B34E08707064756E2164756E21