@sdk-it/cli 0.14.5 → 0.15.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/dist/index.js CHANGED
@@ -1,23 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // packages/cli/src/lib/cli.ts
4
- import { Command as Command2, program } from "commander";
4
+ import { Command as Command3, program } from "commander";
5
5
 
6
- // packages/cli/src/lib/generate.ts
7
- import { Command, Option } from "commander";
8
- import { execFile } from "node:child_process";
6
+ // packages/cli/src/lib/langs/dart.ts
7
+ import { Command } from "commander";
8
+ import { execFile, execSync } from "node:child_process";
9
+ import { generate } from "@sdk-it/dart";
10
+
11
+ // packages/cli/src/lib/loader.ts
9
12
  import { readFile } from "node:fs/promises";
10
13
  import { extname } from "node:path";
11
14
  import { parse } from "yaml";
12
- import { generate } from "@sdk-it/typescript";
13
- var specOption = new Option(
14
- "-s, --spec <spec>",
15
- "Path to OpenAPI specification file"
16
- );
17
- var outputOption = new Option(
18
- "-o, --output <output>",
19
- "Output directory for the generated SDK"
20
- );
21
15
  async function loadRemote(location) {
22
16
  const extName = extname(location);
23
17
  const response = await fetch(location);
@@ -42,7 +36,9 @@ async function loadLocal(location) {
42
36
  const extName = extname(location);
43
37
  switch (extName) {
44
38
  case ".json":
45
- return import(location);
39
+ return import(location, { with: { type: "json" } }).then(
40
+ (mod) => mod.default
41
+ );
46
42
  case ".yaml":
47
43
  case ".yml": {
48
44
  const text = await await readFile(location, "utf-8");
@@ -59,7 +55,44 @@ function loadSpec(location) {
59
55
  }
60
56
  return loadLocal(location);
61
57
  }
62
- var generate_default = new Command("generate").description(`Generate SDK out of a openapi spec file.`).addOption(specOption.makeOptionMandatory(true)).addOption(outputOption.makeOptionMandatory(true)).option(
58
+
59
+ // packages/cli/src/lib/options.ts
60
+ import { Option } from "commander";
61
+ var specOption = new Option(
62
+ "-s, --spec <spec>",
63
+ "Path to OpenAPI specification file"
64
+ );
65
+ var outputOption = new Option(
66
+ "-o, --output <output>",
67
+ "Output directory for the generated SDK"
68
+ );
69
+
70
+ // packages/cli/src/lib/langs/dart.ts
71
+ var dart_default = new Command("dart").description("Generate Dart SDK").addOption(specOption.makeOptionMandatory(true)).addOption(outputOption.makeOptionMandatory(true)).option("-l, --language <language>", "Programming language for the SDK").option("-n, --name <name>", "Name of the generated client", "Client").option("-v, --verbose", "Verbose output", false).action(async (options) => {
72
+ const spec = await loadSpec(options.spec);
73
+ await generate(spec, {
74
+ output: options.output,
75
+ mode: options.mode || "minimal",
76
+ name: options.name,
77
+ formatCode: ({ env, output }) => {
78
+ if (options.formatter) {
79
+ const [command, ...args] = options.formatter.split(" ");
80
+ execFile(command, args, { env: { ...env, SDK_IT_OUTPUT: output } });
81
+ } else {
82
+ execSync("dart format $SDK_IT_OUTPUT", {
83
+ env: { ...process.env, SDK_IT_OUTPUT: output },
84
+ stdio: options.verbose ? "inherit" : "pipe"
85
+ });
86
+ }
87
+ }
88
+ });
89
+ });
90
+
91
+ // packages/cli/src/lib/langs/typescript.ts
92
+ import { Command as Command2 } from "commander";
93
+ import { execFile as execFile2, execSync as execSync2 } from "node:child_process";
94
+ import { generate as generate2 } from "@sdk-it/typescript";
95
+ var typescript_default = new Command2("typescript").alias("ts").description("Generate TypeScript SDK").addOption(specOption.makeOptionMandatory(true)).addOption(outputOption.makeOptionMandatory(true)).option(
63
96
  "--useTsExtension [value]",
64
97
  "Use .ts extension for generated files",
65
98
  (value) => value === "false" ? false : true,
@@ -70,9 +103,13 @@ var generate_default = new Command("generate").description(`Generate SDK out of
70
103
  ).option("-n, --name <name>", "Name of the generated client", "Client").option(
71
104
  "-f, --framework <framework>",
72
105
  "Framework that is integrating with the SDK"
73
- ).option("--formatter <formatter>", "Formatter to use for the generated code").action(async (options) => {
106
+ ).option("--formatter <formatter>", "Formatter to use for the generated code").option(
107
+ "--install",
108
+ "Install dependencies using npm (only in full mode)",
109
+ true
110
+ ).option("--no-default-formatter", "Do not use the default formatter").option("--no-install", "Do not install dependencies").option("-v, --verbose", "Verbose output", false).action(async (options) => {
74
111
  const spec = await loadSpec(options.spec);
75
- await generate(spec, {
112
+ await generate2(spec, {
76
113
  output: options.output,
77
114
  mode: options.mode || "minimal",
78
115
  name: options.name,
@@ -80,15 +117,32 @@ var generate_default = new Command("generate").description(`Generate SDK out of
80
117
  formatCode: ({ env, output }) => {
81
118
  if (options.formatter) {
82
119
  const [command, ...args] = options.formatter.split(" ");
83
- execFile(command, args, { env: { ...env, SDK_IT_OUTPUT: output } });
120
+ execFile2(command, args, { env: { ...env, SDK_IT_OUTPUT: output } });
121
+ } else if (options.defaultFormatter) {
122
+ execSync2("npx -y prettier $SDK_IT_OUTPUT --write", {
123
+ env: {
124
+ ...env,
125
+ SDK_IT_OUTPUT: output,
126
+ NODE_OPTIONS: "--experimental-strip-types"
127
+ },
128
+ stdio: options.verbose ? "inherit" : "pipe"
129
+ });
84
130
  }
85
131
  }
86
132
  });
133
+ if (options.install && options.mode === "full") {
134
+ console.log("Installing dependencies...");
135
+ execSync2("npm install", {
136
+ cwd: options.output,
137
+ stdio: options.verbose ? "inherit" : "pipe"
138
+ });
139
+ }
87
140
  });
88
141
 
89
142
  // packages/cli/src/lib/cli.ts
90
- var cli = program.description(`CLI tool to interact with SDK-IT.`).addCommand(generate_default, { isDefault: true }).addCommand(
91
- new Command2("_internal").action(() => {
143
+ var generate3 = new Command3("generate").addCommand(typescript_default).addCommand(dart_default);
144
+ var cli = program.description(`CLI tool to interact with SDK-IT.`).addCommand(generate3, { isDefault: true }).addCommand(
145
+ new Command3("_internal").action(() => {
92
146
  }),
93
147
  { hidden: true }
94
148
  ).parse(process.argv);
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/lib/cli.ts", "../src/lib/generate.ts"],
4
- "sourcesContent": ["#!/usr/bin/env node\nimport { Command, program } from 'commander';\n\nimport generate from './generate.ts';\n\nconst cli = program\n .description(`CLI tool to interact with SDK-IT.`)\n .addCommand(generate, { isDefault: true })\n .addCommand(\n new Command('_internal').action(() => {\n // do nothing\n }),\n { hidden: true },\n )\n .parse(process.argv);\n\nexport default cli;\n", "import { Command, Option } from 'commander';\nimport { execFile } from 'node:child_process';\nimport { readFile } from 'node:fs/promises';\nimport { extname } from 'node:path';\nimport { parse } from 'yaml';\n\nimport { generate } from '@sdk-it/typescript';\n\ninterface Options {\n spec: string;\n output: string;\n language: string;\n mode?: 'full' | 'minimal';\n name?: string;\n useTsExtension: boolean;\n /**\n * Command to run the formatter.\n * @example 'biome check $SDK_IT_OUTPUT --write'\n * @example 'prettier $SDK_IT_OUTPUT --write'\n */\n formatter?: string;\n framework?: string;\n}\n\nconst specOption = new Option(\n '-s, --spec <spec>',\n 'Path to OpenAPI specification file',\n);\n\nconst outputOption = new Option(\n '-o, --output <output>',\n 'Output directory for the generated SDK',\n);\n\nasync function loadRemote(location: string) {\n const extName = extname(location);\n const response = await fetch(location);\n switch (extName) {\n case '.json':\n return response.json();\n case '.yaml':\n case '.yml': {\n const text = await response.text();\n return parse(text);\n }\n default:\n try {\n // try to parse it as json first\n return response.json();\n } catch {\n // parse as yaml\n const text = await response.text();\n return parse(text);\n }\n }\n}\n\nasync function loadLocal(location: string) {\n const extName = extname(location);\n switch (extName) {\n case '.json':\n return import(location);\n case '.yaml':\n case '.yml': {\n const text = await await readFile(location, 'utf-8');\n return parse(text);\n }\n default:\n throw new Error(`Unsupported file extension: ${extName}`);\n }\n}\n\nfunction loadSpec(location: string) {\n const [protocol] = location.split(':');\n if (protocol === 'http' || protocol === 'https') {\n return loadRemote(location);\n }\n return loadLocal(location);\n}\n\nexport default new Command('generate')\n .description(`Generate SDK out of a openapi spec file.`)\n .addOption(specOption.makeOptionMandatory(true))\n .addOption(outputOption.makeOptionMandatory(true))\n .option(\n '--useTsExtension [value]',\n 'Use .ts extension for generated files',\n (value) => (value === 'false' ? false : true),\n true,\n )\n .option('-l, --language <language>', 'Programming language for the SDK')\n .option(\n '-m, --mode <mode>',\n 'full: generate a full project including package.json and tsconfig.json. useful for monorepo/workspaces minimal: generate only the client sdk',\n )\n .option('-n, --name <name>', 'Name of the generated client', 'Client')\n .option(\n '-f, --framework <framework>',\n 'Framework that is integrating with the SDK',\n )\n .option('--formatter <formatter>', 'Formatter to use for the generated code')\n .action(async (options: Options) => {\n const spec = await loadSpec(options.spec);\n await generate(spec, {\n output: options.output,\n mode: options.mode || 'minimal',\n name: options.name,\n useTsExtension: options.useTsExtension,\n formatCode: ({ env, output }) => {\n if (options.formatter) {\n const [command, ...args] = options.formatter.split(' ');\n execFile(command, args, { env: { ...env, SDK_IT_OUTPUT: output } });\n }\n },\n });\n });\n"],
5
- "mappings": ";;;AACA,SAAS,WAAAA,UAAS,eAAe;;;ACDjC,SAAS,SAAS,cAAc;AAChC,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,aAAa;AAEtB,SAAS,gBAAgB;AAkBzB,IAAM,aAAa,IAAI;AAAA,EACrB;AAAA,EACA;AACF;AAEA,IAAM,eAAe,IAAI;AAAA,EACvB;AAAA,EACA;AACF;AAEA,eAAe,WAAW,UAAkB;AAC1C,QAAM,UAAU,QAAQ,QAAQ;AAChC,QAAM,WAAW,MAAM,MAAM,QAAQ;AACrC,UAAQ,SAAS;AAAA,IACf,KAAK;AACH,aAAO,SAAS,KAAK;AAAA,IACvB,KAAK;AAAA,IACL,KAAK,QAAQ;AACX,YAAM,OAAO,MAAM,SAAS,KAAK;AACjC,aAAO,MAAM,IAAI;AAAA,IACnB;AAAA,IACA;AACE,UAAI;AAEF,eAAO,SAAS,KAAK;AAAA,MACvB,QAAQ;AAEN,cAAM,OAAO,MAAM,SAAS,KAAK;AACjC,eAAO,MAAM,IAAI;AAAA,MACnB;AAAA,EACJ;AACF;AAEA,eAAe,UAAU,UAAkB;AACzC,QAAM,UAAU,QAAQ,QAAQ;AAChC,UAAQ,SAAS;AAAA,IACf,KAAK;AACH,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AAC;AACH,CAAC;;;AD9GH,IAAM,MAAM,QACT,YAAY,mCAAmC,EAC/C,WAAW,kBAAU,EAAE,WAAW,KAAK,CAAC,EACxC;AAAA,EACC,IAAIC,SAAQ,WAAW,EAAE,OAAO,MAAM;AAAA,EAEtC,CAAC;AAAA,EACD,EAAE,QAAQ,KAAK;AACjB,EACC,MAAM,QAAQ,IAAI;",
6
- "names": ["Command", "Command"]
3
+ "sources": ["../src/lib/cli.ts", "../src/lib/langs/dart.ts", "../src/lib/loader.ts", "../src/lib/options.ts", "../src/lib/langs/typescript.ts"],
4
+ "sourcesContent": ["#!/usr/bin/env node\nimport { Command, program } from 'commander';\n\nimport dart from './langs/dart.ts';\nimport typescript from './langs/typescript.ts';\n\nconst generate = new Command('generate')\n .addCommand(typescript)\n .addCommand(dart);\nconst cli = program\n .description(`CLI tool to interact with SDK-IT.`)\n .addCommand(generate, { isDefault: true })\n .addCommand(\n new Command('_internal').action(() => {\n // do nothing\n }),\n { hidden: true },\n )\n .parse(process.argv);\n\nexport default cli;\n", "import { Command } from 'commander';\nimport { execFile, execSync } from 'node:child_process';\n\nimport { generate } from '@sdk-it/dart';\n\nimport { loadSpec } from '../loader.ts';\nimport { outputOption, specOption } from '../options.ts';\n\ninterface Options {\n spec: string;\n output: string;\n language: string;\n mode?: 'full' | 'minimal';\n name?: string;\n useTsExtension: boolean;\n /**\n * Command to run the formatter.\n * @example 'biome check $SDK_IT_OUTPUT --write'\n * @example 'prettier $SDK_IT_OUTPUT --write'\n */\n formatter?: string;\n verbose: boolean;\n}\n\nexport default new Command('dart')\n .description('Generate Dart SDK')\n .addOption(specOption.makeOptionMandatory(true))\n .addOption(outputOption.makeOptionMandatory(true))\n .option('-l, --language <language>', 'Programming language for the SDK')\n // .option(\n // '-m, --mode <mode>',\n // 'full: generate a full project including package.json and tsconfig.json. useful for monorepo/workspaces minimal: generate only the client sdk',\n // )\n .option('-n, --name <name>', 'Name of the generated client', 'Client')\n .option('-v, --verbose', 'Verbose output', false)\n // .option('--formatter <formatter>', 'Formatter to use for the generated code')\n .action(async (options: Options) => {\n const spec = await loadSpec(options.spec);\n await generate(spec, {\n output: options.output,\n mode: options.mode || 'minimal',\n name: options.name,\n formatCode: ({ env, output }) => {\n if (options.formatter) {\n const [command, ...args] = options.formatter.split(' ');\n execFile(command, args, { env: { ...env, SDK_IT_OUTPUT: output } });\n } else {\n execSync('dart format $SDK_IT_OUTPUT', {\n env: { ...process.env, SDK_IT_OUTPUT: output },\n stdio: options.verbose ? 'inherit' : 'pipe',\n });\n }\n },\n });\n });\n", "import { readFile } from 'node:fs/promises';\nimport { extname } from 'node:path';\nimport type { OpenAPIObject } from 'openapi3-ts/oas31';\nimport { parse } from 'yaml';\n\nexport async function loadRemote(location: string) {\n const extName = extname(location);\n const response = await fetch(location);\n switch (extName) {\n case '.json':\n return response.json();\n case '.yaml':\n case '.yml': {\n const text = await response.text();\n return parse(text);\n }\n default:\n try {\n // try to parse it as json first\n return response.json();\n } catch {\n // parse as yaml\n const text = await response.text();\n return parse(text);\n }\n }\n}\nexport async function loadLocal(location: string) {\n const extName = extname(location);\n switch (extName) {\n case '.json':\n return import(location, { with: { type: 'json' } }).then(\n (mod) => mod.default,\n );\n case '.yaml':\n case '.yml': {\n const text = await await readFile(location, 'utf-8');\n return parse(text);\n }\n default:\n throw new Error(`Unsupported file extension: ${extName}`);\n }\n}\n\nexport function loadSpec(location: string): Promise<OpenAPIObject> {\n const [protocol] = location.split(':');\n if (protocol === 'http' || protocol === 'https') {\n return loadRemote(location);\n }\n return loadLocal(location);\n}\n", "import { Option } from 'commander';\n\nexport const specOption = new Option(\n '-s, --spec <spec>',\n 'Path to OpenAPI specification file',\n);\n\nexport const outputOption = new Option(\n '-o, --output <output>',\n 'Output directory for the generated SDK',\n);\n", "import { Command } from 'commander';\nimport { execFile, execSync } from 'node:child_process';\n\nimport { generate } from '@sdk-it/typescript';\n\nimport { loadSpec } from '../loader.ts';\nimport { outputOption, specOption } from '../options.ts';\n\ninterface Options {\n spec: string;\n output: string;\n language: string;\n mode?: 'full' | 'minimal';\n name?: string;\n useTsExtension: boolean;\n /**\n * Command to run the formatter.\n * @example 'biome check $SDK_IT_OUTPUT --write'\n * @example 'prettier $SDK_IT_OUTPUT --write'\n */\n formatter?: string;\n framework?: string;\n install: boolean;\n verbose: boolean;\n defaultFormatter: boolean;\n}\n\nexport default new Command('typescript')\n .alias('ts')\n .description('Generate TypeScript SDK')\n .addOption(specOption.makeOptionMandatory(true))\n .addOption(outputOption.makeOptionMandatory(true))\n .option(\n '--useTsExtension [value]',\n 'Use .ts extension for generated files',\n (value) => (value === 'false' ? false : true),\n true,\n )\n .option('-l, --language <language>', 'Programming language for the SDK')\n .option(\n '-m, --mode <mode>',\n 'full: generate a full project including package.json and tsconfig.json. useful for monorepo/workspaces minimal: generate only the client sdk',\n )\n .option('-n, --name <name>', 'Name of the generated client', 'Client')\n .option(\n '-f, --framework <framework>',\n 'Framework that is integrating with the SDK',\n )\n .option('--formatter <formatter>', 'Formatter to use for the generated code')\n .option(\n '--install',\n 'Install dependencies using npm (only in full mode)',\n true,\n )\n .option('--no-default-formatter', 'Do not use the default formatter')\n .option('--no-install', 'Do not install dependencies')\n .option('-v, --verbose', 'Verbose output', false)\n .action(async (options: Options) => {\n const spec = await loadSpec(options.spec);\n await generate(spec, {\n output: options.output,\n mode: options.mode || 'minimal',\n name: options.name,\n useTsExtension: options.useTsExtension,\n formatCode: ({ env, output }) => {\n if (options.formatter) {\n const [command, ...args] = options.formatter.split(' ');\n execFile(command, args, { env: { ...env, SDK_IT_OUTPUT: output } });\n } else if (options.defaultFormatter) {\n execSync('npx -y prettier $SDK_IT_OUTPUT --write', {\n env: {\n ...env,\n SDK_IT_OUTPUT: output,\n NODE_OPTIONS: '--experimental-strip-types',\n },\n stdio: options.verbose ? 'inherit' : 'pipe',\n });\n }\n },\n });\n\n // Install dependencies if in full mode and install option is enabled\n\n if (options.install && options.mode === 'full') {\n console.log('Installing dependencies...');\n execSync('npm install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,EACH;AACF,CAAC;;;AJpFH,IAAMC,YAAW,IAAIC,SAAQ,UAAU,EACpC,WAAW,kBAAU,EACrB,WAAW,YAAI;AAClB,IAAM,MAAM,QACT,YAAY,mCAAmC,EAC/C,WAAWD,WAAU,EAAE,WAAW,KAAK,CAAC,EACxC;AAAA,EACC,IAAIC,SAAQ,WAAW,EAAE,OAAO,MAAM;AAAA,EAEtC,CAAC;AAAA,EACD,EAAE,QAAQ,KAAK;AACjB,EACC,MAAM,QAAQ,IAAI;",
6
+ "names": ["Command", "Command", "execFile", "execSync", "generate", "Command", "generate", "execFile", "execSync", "generate", "Command"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/lib/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAW,MAAM,WAAW,CAAC;AAI7C,QAAA,MAAM,GAAG,SASa,CAAC;AAEvB,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/lib/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAW,MAAM,WAAW,CAAC;AAQ7C,QAAA,MAAM,GAAG,SASa,CAAC;AAEvB,eAAe,GAAG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/lib/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;;AAgF5C,wBAmCK"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/lib/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;;AAIpC,wBAA8D"}
@@ -0,0 +1,4 @@
1
+ import { Command } from 'commander';
2
+ declare const _default: Command;
3
+ export default _default;
4
+ //# sourceMappingURL=dart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dart.d.ts","sourceRoot":"","sources":["../../../src/lib/langs/dart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;;AAwBpC,wBA8BK"}
@@ -0,0 +1,4 @@
1
+ import { Command } from 'commander';
2
+ declare const _default: Command;
3
+ export default _default;
4
+ //# sourceMappingURL=typescript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../src/lib/langs/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;;AA2BpC,wBA+DK"}
@@ -0,0 +1,5 @@
1
+ import type { OpenAPIObject } from 'openapi3-ts/oas31';
2
+ export declare function loadRemote(location: string): Promise<any>;
3
+ export declare function loadLocal(location: string): Promise<any>;
4
+ export declare function loadSpec(location: string): Promise<OpenAPIObject>;
5
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/lib/loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,gBAqBhD;AACD,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,gBAe/C;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAMjE"}
@@ -0,0 +1,4 @@
1
+ import { Option } from 'commander';
2
+ export declare const specOption: Option;
3
+ export declare const outputOption: Option;
4
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/lib/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,eAAO,MAAM,UAAU,QAGtB,CAAC;AAEF,eAAO,MAAM,YAAY,QAGxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdk-it/cli",
3
- "version": "0.14.5",
3
+ "version": "0.15.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -20,8 +20,10 @@
20
20
  ],
21
21
  "dependencies": {
22
22
  "commander": "^13.1.0",
23
- "@sdk-it/typescript": "0.14.5",
24
- "yaml": "^2.7.0"
23
+ "@sdk-it/typescript": "0.15.0",
24
+ "yaml": "^2.7.0",
25
+ "@sdk-it/dart": "0.15.0",
26
+ "openapi3-ts": "4.4.0"
25
27
  },
26
28
  "publishConfig": {
27
29
  "access": "public"