@ooneex/cli 1.17.7 → 1.17.9

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);
@@ -5710,18 +5696,6 @@ class MakeModuleCommand {
5710
5696
  useSymbol: true
5711
5697
  });
5712
5698
  }
5713
- const packageJsonPath = join5(process.cwd(), "package.json");
5714
- const packageJson = await Bun.file(packageJsonPath).json();
5715
- const deps = packageJson.dependencies ?? {};
5716
- const devDeps = packageJson.devDependencies ?? {};
5717
- if (!deps["@ooneex/module"] && !devDeps["@ooneex/module"]) {
5718
- const install = Bun.spawn(["bun", "add", "@ooneex/module"], {
5719
- cwd: process.cwd(),
5720
- stdout: "ignore",
5721
- stderr: "inherit"
5722
- });
5723
- await install.exited;
5724
- }
5725
5699
  }
5726
5700
  }
5727
5701
  MakeModuleCommand = __legacyDecorateClassTS([
@@ -7041,9 +7015,6 @@ class MakeAppCommand {
7041
7015
  });
7042
7016
  const appModulePackagePath = join9(destination, "modules", "app", "package.json");
7043
7017
  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
7018
  await Bun.write(appModulePackagePath, JSON.stringify(appModulePackageJson, null, 2));
7048
7019
  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
7020
  await Bun.write(join9(destination, "modules", "app", ".env"), envContent);
@@ -7556,6 +7527,17 @@ MakeClaudeSkillCommand = __legacyDecorateClassTS([
7556
7527
  import { join as join12 } from "path";
7557
7528
  import { commandCreate, decorator as decorator12 } from "@ooneex/command";
7558
7529
  import { TerminalLogger as TerminalLogger11 } from "@ooneex/logger";
7530
+
7531
+ // src/templates/module/command.run.txt
7532
+ var command_run_default = `#!/usr/bin/env bun
7533
+
7534
+ import { run } from "@ooneex/command";
7535
+ import "@/commands/commands";
7536
+
7537
+ await run();
7538
+ `;
7539
+
7540
+ // src/commands/MakeCommandCommand.ts
7559
7541
  class MakeCommandCommand {
7560
7542
  getName() {
7561
7543
  return "make:command";
@@ -7566,7 +7548,7 @@ class MakeCommandCommand {
7566
7548
  async run(options) {
7567
7549
  let { name, module } = options;
7568
7550
  if (!name) {
7569
- name = await askName({ message: "Enter name" });
7551
+ name = await askName({ message: "Enter command name" });
7570
7552
  }
7571
7553
  if (module) {
7572
7554
  await ensureModule(module);
@@ -7577,35 +7559,12 @@ class MakeCommandCommand {
7577
7559
  commandDir: join12(base, "src", "commands"),
7578
7560
  testsDir: join12(base, "tests", "commands")
7579
7561
  });
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");
7562
+ const binCommandRunPath = join12(process.cwd(), base, "bin", "command", "run.ts");
7597
7563
  const binCommandRunFile = Bun.file(binCommandRunPath);
7598
7564
  if (!await binCommandRunFile.exists()) {
7599
7565
  await Bun.write(binCommandRunPath, command_run_default);
7600
7566
  }
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
- }
7567
+ const packageJsonPath = join12(process.cwd(), base, "package.json");
7609
7568
  const logger = new TerminalLogger11;
7610
7569
  logger.success(`${commandPath} created successfully`, undefined, {
7611
7570
  showTimestamp: false,
@@ -7617,11 +7576,17 @@ ${importLine}
7617
7576
  showArrow: false,
7618
7577
  useSymbol: true
7619
7578
  });
7620
- logger.info("Run 'bun run command' to execute commands", undefined, {
7621
- showTimestamp: false,
7622
- showArrow: true,
7623
- showLevel: false
7624
- });
7579
+ const pkgJson = await Bun.file(packageJsonPath).json();
7580
+ const deps = pkgJson.dependencies ?? {};
7581
+ const devDeps = pkgJson.devDependencies ?? {};
7582
+ if (!deps["@ooneex/command"] && !devDeps["@ooneex/command"]) {
7583
+ const install = Bun.spawn(["bun", "add", "--dev", "@ooneex/command"], {
7584
+ cwd: process.cwd(),
7585
+ stdout: "ignore",
7586
+ stderr: "inherit"
7587
+ });
7588
+ await install.exited;
7589
+ }
7625
7590
  }
7626
7591
  }
7627
7592
  MakeCommandCommand = __legacyDecorateClassTS([
@@ -9981,11 +9946,11 @@ class MakeReleaseCommand {
9981
9946
  const shouldPush = await askConfirm({ message: "Push commits and tags to remote?", initial: true });
9982
9947
  if (shouldPush) {
9983
9948
  try {
9984
- await $`bun install`;
9949
+ await this.bunInstall();
9985
9950
  await this.gitAdd("bun.lock");
9986
9951
  await this.gitCommit("chore(common): Update bun.lock");
9987
9952
  logger.success("Updated and committed bun.lock", undefined, logOptions);
9988
- await $`git push && git push --tags`;
9953
+ await this.gitPush();
9989
9954
  logger.success("Pushed commits and tags to remote", undefined, logOptions);
9990
9955
  } catch {
9991
9956
  logger.error("Failed to push to remote", undefined, logOptions);
@@ -10131,6 +10096,12 @@ ${section}
10131
10096
  async gitTag(tag, message) {
10132
10097
  await $`git tag -a ${tag} -m ${message}`;
10133
10098
  }
10099
+ async bunInstall() {
10100
+ await $`bun install`;
10101
+ }
10102
+ async gitPush() {
10103
+ await $`git push && git push --tags`;
10104
+ }
10134
10105
  }
10135
10106
  MakeReleaseCommand = __legacyDecorateClassTS([
10136
10107
  decorator24.command()
@@ -11724,4 +11695,4 @@ SeedRunCommand = __legacyDecorateClassTS([
11724
11695
  // src/index.ts
11725
11696
  await run();
11726
11697
 
11727
- //# debugId=D4BC476D0273E3F064756E2164756E21
11698
+ //# debugId=88D51037C24C6F4664756E2164756E21