@devkong/cli 0.0.17-0 → 0.0.18-0

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/index.js CHANGED
@@ -69866,6 +69866,10 @@ var PublishVersionCommand = class {
69866
69866
  constructor(profile, verbose = false) {
69867
69867
  this.verbose = verbose;
69868
69868
  this.isWin = process.platform === "win32";
69869
+ this.defaultRendererOptions = {
69870
+ bottomBar: this.verbose ? Infinity : true,
69871
+ persistentOutput: true
69872
+ };
69869
69873
  this.registryClient = new RegistryClient(profile.kongBaseUrl);
69870
69874
  this.managementClient = new ManagementClient(profile.kongBaseUrl);
69871
69875
  }
@@ -69873,10 +69877,6 @@ var PublishVersionCommand = class {
69873
69877
  return this.isWin ? "wsl" : "";
69874
69878
  }
69875
69879
  async execute(repoName, notes) {
69876
- const defaultRendererOptions = {
69877
- bottomBar: this.verbose ? Infinity : true,
69878
- persistentOutput: true
69879
- };
69880
69880
  await new Listr(
69881
69881
  [
69882
69882
  {
@@ -69898,7 +69898,7 @@ var PublishVersionCommand = class {
69898
69898
  new ListrTaskLogger(task, this.verbose ? 3 /* DEBUG */ : 0 /* INFO */)
69899
69899
  );
69900
69900
  },
69901
- rendererOptions: defaultRendererOptions
69901
+ rendererOptions: this.defaultRendererOptions
69902
69902
  },
69903
69903
  {
69904
69904
  title: "Docker build",
@@ -69911,7 +69911,7 @@ var PublishVersionCommand = class {
69911
69911
  new ListrTaskLogger(task, this.verbose ? 3 /* DEBUG */ : 0 /* INFO */)
69912
69912
  );
69913
69913
  },
69914
- rendererOptions: defaultRendererOptions
69914
+ rendererOptions: this.defaultRendererOptions
69915
69915
  },
69916
69916
  {
69917
69917
  title: "Docker push",
@@ -69922,16 +69922,9 @@ var PublishVersionCommand = class {
69922
69922
  new ListrTaskLogger(task, this.verbose ? 3 /* DEBUG */ : 0 /* INFO */)
69923
69923
  );
69924
69924
  },
69925
- rendererOptions: defaultRendererOptions
69926
- },
69927
- {
69928
- title: "Generate schema",
69929
- task: async (ctx, task) => {
69930
- const logger = new ListrTaskLogger(task, this.verbose ? 3 /* DEBUG */ : 0 /* INFO */);
69931
- ctx.schemaText = await spawnCommand(this.getSchemaCmdText(), logger);
69932
- },
69933
- rendererOptions: defaultRendererOptions
69925
+ rendererOptions: this.defaultRendererOptions
69934
69926
  },
69927
+ this.getSchemaTask(),
69935
69928
  {
69936
69929
  title: "Save publish details",
69937
69930
  task: async (ctx, task) => {
@@ -69959,7 +69952,7 @@ var PublishVersionCommand = class {
69959
69952
  );
69960
69953
  task.output = `The version ${ctx.publishDetails.imageVersion} has been successfully published!`;
69961
69954
  },
69962
- rendererOptions: defaultRendererOptions
69955
+ rendererOptions: this.defaultRendererOptions
69963
69956
  }
69964
69957
  ],
69965
69958
  {
@@ -69984,11 +69977,26 @@ var PublishVersionCommand = class {
69984
69977
  dockerLoginCmdText(username, password, registry3) {
69985
69978
  return `${this.wslPrefix} /bin/bash -c 'echo ${password} |docker login -u ${username} --password-stdin ${registry3}'`;
69986
69979
  }
69987
- getSchemaCmdText() {
69980
+ getPythonSchemaCmdText() {
69988
69981
  const engine = this.isWin ? ".\\.venv\\Scripts\\python.exe" : "./.venv/bin/python";
69989
69982
  const mainPyPath = resolveProjectPath("src/main.py");
69990
69983
  return `${engine} ${mainPyPath} --schema`;
69991
69984
  }
69985
+ getKotlinSchemaCmdTask(fullImageName) {
69986
+ return `${this.wslPrefix} docker run -it ${fullImageName} ./application --schema`;
69987
+ }
69988
+ getSchemaTask() {
69989
+ return {
69990
+ title: "Generate schema",
69991
+ task: async (ctx, task) => {
69992
+ const logger = new ListrTaskLogger(task, this.verbose ? 3 /* DEBUG */ : 0 /* INFO */);
69993
+ const kongJson = getKongJson();
69994
+ const cmdText = kongJson.sdk === "python" ? this.getPythonSchemaCmdText() : this.getKotlinSchemaCmdTask(ctx.fullImageName);
69995
+ ctx.schemaText = await spawnCommand(cmdText, logger);
69996
+ },
69997
+ rendererOptions: this.defaultRendererOptions
69998
+ };
69999
+ }
69992
70000
  };
69993
70001
 
69994
70002
  // packages/kong-cli/src/services/publicClient.ts
@@ -70093,7 +70101,7 @@ function getPresetVersion() {
70093
70101
  import_dotenv_expand.default.expand(import_dotenv.default.config({ path: import_path5.default.join(__dirname, ".env") }));
70094
70102
  async function main() {
70095
70103
  const generateCommand = new Command("generate").description("Generate new extension").argument("name", "Extension name").addOption(
70096
- new Option("--sdk", "Target sdk platform").choices(["python", "kotlin"]).default("python")
70104
+ new Option("--sdk <name>", "Target sdk platform for extension").choices(["python", "kotlin"]).default("python")
70097
70105
  ).addOption(new Option("--verbose", "Show full logs during command execution")).action(async (name, options) => {
70098
70106
  try {
70099
70107
  const presetVersion = getPresetVersion();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devkong/cli",
3
- "version": "0.0.17-0",
3
+ "version": "0.0.18-0",
4
4
  "type": "commonjs",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
@@ -4,6 +4,7 @@ export declare class PublishVersionCommand {
4
4
  private readonly isWin;
5
5
  private registryClient;
6
6
  private managementClient;
7
+ private defaultRendererOptions;
7
8
  private get wslPrefix();
8
9
  constructor(profile: Profile, verbose?: boolean);
9
10
  execute(repoName: string, notes: string): Promise<void>;
@@ -11,5 +12,7 @@ export declare class PublishVersionCommand {
11
12
  private dockerBuildCmdText;
12
13
  private dockerPushCmdText;
13
14
  private dockerLoginCmdText;
14
- private getSchemaCmdText;
15
+ private getPythonSchemaCmdText;
16
+ private getKotlinSchemaCmdTask;
17
+ private getSchemaTask;
15
18
  }