@kubb/cli 3.17.1 → 3.18.1

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.
@@ -6603,6 +6603,7 @@ async function generate({ input, config, progressCache, args }) {
6603
6603
  write: true,
6604
6604
  barrelType: "named",
6605
6605
  extension: { ".ts": ".ts" },
6606
+ format: "prettier",
6606
6607
  ...userConfig.output
6607
6608
  }
6608
6609
  };
@@ -6647,6 +6648,68 @@ async function generate({ input, config, progressCache, args }) {
6647
6648
  logger.consola?.error(error);
6648
6649
  process$1.exit(1);
6649
6650
  }
6651
+ if (config.output.format === "prettier") {
6652
+ logger?.emit("start", `Formatting with ${config.output.format}`);
6653
+ try {
6654
+ await execa("prettier", [
6655
+ "--ignore-unknown",
6656
+ "--write",
6657
+ path.resolve(definedConfig.root, definedConfig.output.path)
6658
+ ]);
6659
+ } catch (e) {
6660
+ logger.consola?.warn("Prettier not found");
6661
+ logger.consola?.error(e);
6662
+ }
6663
+ logger?.emit("success", `Formatted with ${config.output.format}`);
6664
+ }
6665
+ if (config.output.format === "biome") {
6666
+ logger?.emit("start", `Formatting with ${config.output.format}`);
6667
+ try {
6668
+ await execa("biome", [
6669
+ "format",
6670
+ "--write",
6671
+ path.resolve(definedConfig.root, definedConfig.output.path)
6672
+ ]);
6673
+ } catch (e) {
6674
+ logger.consola?.warn("Biome not found");
6675
+ logger.consola?.error(e);
6676
+ }
6677
+ logger?.emit("success", `Formatted with ${config.output.format}`);
6678
+ }
6679
+ if (config.output.lint === "eslint") {
6680
+ logger?.emit("start", `Linting with ${config.output.format}`);
6681
+ try {
6682
+ await execa("eslint", [path.resolve(definedConfig.root, definedConfig.output.path), "--fix"]);
6683
+ } catch (e) {
6684
+ logger.consola?.warn("Eslint not found");
6685
+ logger.consola?.error(e);
6686
+ }
6687
+ logger?.emit("success", `Linted with ${config.output.format}`);
6688
+ }
6689
+ if (config.output.lint === "biome") {
6690
+ logger?.emit("start", `Linting with ${config.output.format}`);
6691
+ try {
6692
+ await execa("biome", [
6693
+ "lint",
6694
+ "--fix",
6695
+ path.resolve(definedConfig.root, definedConfig.output.path)
6696
+ ]);
6697
+ } catch (e) {
6698
+ logger.consola?.warn("Biome not found");
6699
+ logger.consola?.error(e);
6700
+ }
6701
+ logger?.emit("success", `Linted with ${config.output.format}`);
6702
+ }
6703
+ if (config.output.lint === "oxlint") {
6704
+ logger?.emit("start", `Linting with ${config.output.format}`);
6705
+ try {
6706
+ await execa("oxlint", ["--fix", path.resolve(definedConfig.root, definedConfig.output.path)]);
6707
+ } catch (e) {
6708
+ logger.consola?.warn("Oxlint not found");
6709
+ logger.consola?.error(e);
6710
+ }
6711
+ logger?.emit("success", `Linted with ${config.output.format}`);
6712
+ }
6650
6713
  if (config.hooks) await executeHooks({
6651
6714
  hooks: config.hooks,
6652
6715
  logger
@@ -6665,4 +6728,4 @@ async function generate({ input, config, progressCache, args }) {
6665
6728
 
6666
6729
  //#endregion
6667
6730
  export { generate };
6668
- //# sourceMappingURL=generate-DAJRIO7l.js.map
6731
+ //# sourceMappingURL=generate-B5KogiFG.js.map