@ahoo-wang/fetcher-generator 3.8.2 → 3.8.3

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/cli.cjs CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("commander"),l=require("./index.cjs");require("@ahoo-wang/fetcher");require("yaml");require("fs");require("path");class h{getTimestamp(){return new Date().toTimeString().slice(0,8)}info(e,...t){const o=this.getTimestamp();t.length>0?console.log(`[${o}] ℹ️ ${e}`,...t):console.log(`[${o}] ℹ️ ${e}`)}success(e,...t){const o=this.getTimestamp();t.length>0?console.log(`[${o}] ✅ ${e}`,...t):console.log(`[${o}] ✅ ${e}`)}error(e,...t){const o=this.getTimestamp();t.length>0?console.error(`[${o}] ❌ ${e}`,...t):console.error(`[${o}] ❌ ${e}`)}progress(e,t=0,...o){const i=this.getTimestamp(),r=" ".repeat(t);o.length>0?console.log(`[${i}] 🔄 ${r}${e}`,...o):console.log(`[${i}] 🔄 ${r}${e}`)}progressWithCount(e,t,o,i=0,...r){const c=this.getTimestamp(),a=" ".repeat(i),p=`[${e}/${t}]`;r.length>0?console.log(`[${c}] 🔄 ${a}${p} ${o}`,...r):console.log(`[${c}] 🔄 ${a}${p} ${o}`)}}const f="@ahoo-wang/fetcher-generator",m="3.8.2",$="A powerful TypeScript code generation tool that automatically generates type-safe API client code based on OpenAPI specifications. It is designed for general use cases and is also deeply optimized for the [Wow](https://github.com/Ahoo-Wang/Wow) Domain-Driven Design framework, providing native support for the CQRS architectural pattern.",y=["fetch","http","client","openapi","openapi3","swagger","generator","typescript","codegen","api","rest"],v="Ahoo-Wang",w="Apache-2.0",T="https://github.com/Ahoo-Wang/fetcher/tree/master/packages/generator",b={type:"git",url:"https://github.com/Ahoo-Wang/fetcher.git",directory:"packages/generator"},A={url:"https://github.com/Ahoo-Wang/fetcher/issues"},I="module",x="./dist/index.umd.js",C="./dist/index.es.js",P="./dist/index.d.ts",S={"fetcher-generator":"./dist/cli.js"},j={".":{types:"./dist/index.d.ts",import:"./dist/index.es.js",require:"./dist/index.umd.js"}},k=["dist","README.md","README.zh-CN.md"],D={build:"vite build","test:ui":"vitest --ui",test:"vitest run --coverage --testTimeout=15000",lint:"eslint . --fix",clean:"rm -rf dist",analyze:"npx vite-bundle-analyzer -p auto",generate:"node dist/cli.js generate -i test/demo.spec.json -o test-output -t tsconfig.json"},L={"@ahoo-wang/fetcher":"workspace:^3.0.0","@ahoo-wang/fetcher-eventstream":"workspace:^3.0.0","@ahoo-wang/fetcher-decorator":"workspace:^3.0.0","@ahoo-wang/fetcher-openapi":"workspace:^3.0.0","@ahoo-wang/fetcher-wow":"workspace:^3.0.0"},O={"ts-morph":"catalog:",commander:"catalog:",yaml:"catalog:"},W={"@eslint/js":"catalog:","@types/node":"catalog:","@vitest/coverage-v8":"catalog:","@vitest/ui":"catalog:",eslint:"catalog:",globals:"catalog:",prettier:"catalog:",typescript:"catalog:","typescript-eslint":"catalog:","unplugin-dts":"catalog:",vite:"catalog:","vite-bundle-analyzer":"catalog:",vitest:"catalog:"},g={name:f,version:m,description:$,keywords:y,author:v,license:w,homepage:T,repository:b,bugs:A,type:I,main:x,module:C,types:P,bin:S,exports:j,files:k,scripts:D,peerDependencies:L,dependencies:O,devDependencies:W};function q(n){if(!n)return!1;try{const e=new URL(n);return e.protocol==="http:"||e.protocol==="https:"}catch{return n.length>0}}async function G(n){const e=new h;process.on("SIGINT",()=>{e.error("Generation interrupted by user"),process.exit(130)}),q(n.input)||(e.error("Invalid input: must be a valid file path or HTTP/HTTPS URL"),process.exit(2));try{e.info(`Fetcher Generator v${g.version}`),e.info("Starting code generation...");const t={inputPath:n.input,outputDir:n.output,configPath:n.config,tsConfigFilePath:n.tsConfigFilePath,logger:e};await new l.CodeGenerator(t).generate(),e.success(`Code generation completed successfully! Files generated in: ${n.output}`)}catch(t){e.error(`Error during code generation:
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("commander"),l=require("./index.cjs");require("@ahoo-wang/fetcher");require("yaml");require("fs");require("path");class h{getTimestamp(){return new Date().toTimeString().slice(0,8)}info(e,...t){const o=this.getTimestamp();t.length>0?console.log(`[${o}] ℹ️ ${e}`,...t):console.log(`[${o}] ℹ️ ${e}`)}success(e,...t){const o=this.getTimestamp();t.length>0?console.log(`[${o}] ✅ ${e}`,...t):console.log(`[${o}] ✅ ${e}`)}error(e,...t){const o=this.getTimestamp();t.length>0?console.error(`[${o}] ❌ ${e}`,...t):console.error(`[${o}] ❌ ${e}`)}progress(e,t=0,...o){const i=this.getTimestamp(),r=" ".repeat(t);o.length>0?console.log(`[${i}] 🔄 ${r}${e}`,...o):console.log(`[${i}] 🔄 ${r}${e}`)}progressWithCount(e,t,o,i=0,...r){const c=this.getTimestamp(),a=" ".repeat(i),p=`[${e}/${t}]`;r.length>0?console.log(`[${c}] 🔄 ${a}${p} ${o}`,...r):console.log(`[${c}] 🔄 ${a}${p} ${o}`)}}const f="@ahoo-wang/fetcher-generator",m="3.8.3",$="A powerful TypeScript code generation tool that automatically generates type-safe API client code based on OpenAPI specifications. It is designed for general use cases and is also deeply optimized for the [Wow](https://github.com/Ahoo-Wang/Wow) Domain-Driven Design framework, providing native support for the CQRS architectural pattern.",y=["fetch","http","client","openapi","openapi3","swagger","generator","typescript","codegen","api","rest"],v="Ahoo-Wang",w="Apache-2.0",T="https://github.com/Ahoo-Wang/fetcher/tree/master/packages/generator",b={type:"git",url:"https://github.com/Ahoo-Wang/fetcher.git",directory:"packages/generator"},A={url:"https://github.com/Ahoo-Wang/fetcher/issues"},I="module",x="./dist/index.umd.js",C="./dist/index.es.js",P="./dist/index.d.ts",S={"fetcher-generator":"./dist/cli.js"},j={".":{types:"./dist/index.d.ts",import:"./dist/index.es.js",require:"./dist/index.umd.js"}},k=["dist","README.md","README.zh-CN.md"],D={build:"vite build","test:ui":"vitest --ui",test:"vitest run --coverage --testTimeout=15000",lint:"eslint . --fix",clean:"rm -rf dist",analyze:"npx vite-bundle-analyzer -p auto",generate:"node dist/cli.js generate -i test/demo.spec.json -o test-output -t tsconfig.json"},L={"@ahoo-wang/fetcher":"workspace:^3.0.0","@ahoo-wang/fetcher-eventstream":"workspace:^3.0.0","@ahoo-wang/fetcher-decorator":"workspace:^3.0.0","@ahoo-wang/fetcher-openapi":"workspace:^3.0.0","@ahoo-wang/fetcher-wow":"workspace:^3.0.0"},O={"ts-morph":"catalog:",commander:"catalog:",yaml:"catalog:"},W={"@eslint/js":"catalog:","@types/node":"catalog:","@vitest/coverage-v8":"catalog:","@vitest/ui":"catalog:",eslint:"catalog:",globals:"catalog:",prettier:"catalog:",typescript:"catalog:","typescript-eslint":"catalog:","unplugin-dts":"catalog:",vite:"catalog:","vite-bundle-analyzer":"catalog:",vitest:"catalog:"},g={name:f,version:m,description:$,keywords:y,author:v,license:w,homepage:T,repository:b,bugs:A,type:I,main:x,module:C,types:P,bin:S,exports:j,files:k,scripts:D,peerDependencies:L,dependencies:O,devDependencies:W};function q(n){if(!n)return!1;try{const e=new URL(n);return e.protocol==="http:"||e.protocol==="https:"}catch{return n.length>0}}async function G(n){const e=new h;process.on("SIGINT",()=>{e.error("Generation interrupted by user"),process.exit(130)}),q(n.input)||(e.error("Invalid input: must be a valid file path or HTTP/HTTPS URL"),process.exit(2));try{e.info(`Fetcher Generator v${g.version}`),e.info("Starting code generation...");const t={inputPath:n.input,outputDir:n.output,configPath:n.config,tsConfigFilePath:n.tsConfigFilePath,logger:e};await new l.CodeGenerator(t).generate(),e.success(`Code generation completed successfully! Files generated in: ${n.output}`)}catch(t){e.error(`Error during code generation:
3
3
  `,t),process.exit(1)}}function u(){return s.program.name("fetcher-generator").description("OpenAPI Specification TypeScript code generator for Wow").version(g.version,"-v, --version"),s.program.command("generate").description("Generate TypeScript code from OpenAPI specification").requiredOption("-i, --input <file>","Input OpenAPI specification file path or URL (http/https)").option("-o, --output <path>","Output directory path","src/generated").option("-c, --config <file>","Configuration file path",l.DEFAULT_CONFIG_PATH).option("-t, --ts-config-file-path <file>","TypeScript configuration file path").action(G),s.program}function d(){u().parse()}d();exports.runCLI=d;exports.setupCLI=u;
4
4
  //# sourceMappingURL=cli.cjs.map
package/dist/cli.js CHANGED
@@ -33,7 +33,7 @@ class u {
33
33
  ) : console.log(`[${c}] 🔄 ${a}${p} ${o}`);
34
34
  }
35
35
  }
36
- const h = "@ahoo-wang/fetcher-generator", f = "3.8.2", m = "A powerful TypeScript code generation tool that automatically generates type-safe API client code based on OpenAPI specifications. It is designed for general use cases and is also deeply optimized for the [Wow](https://github.com/Ahoo-Wang/Wow) Domain-Driven Design framework, providing native support for the CQRS architectural pattern.", $ = ["fetch", "http", "client", "openapi", "openapi3", "swagger", "generator", "typescript", "codegen", "api", "rest"], v = "Ahoo-Wang", y = "Apache-2.0", w = "https://github.com/Ahoo-Wang/fetcher/tree/master/packages/generator", T = { type: "git", url: "https://github.com/Ahoo-Wang/fetcher.git", directory: "packages/generator" }, A = { url: "https://github.com/Ahoo-Wang/fetcher/issues" }, b = "module", x = "./dist/index.umd.js", I = "./dist/index.es.js", C = "./dist/index.d.ts", P = { "fetcher-generator": "./dist/cli.js" }, S = { ".": { types: "./dist/index.d.ts", import: "./dist/index.es.js", require: "./dist/index.umd.js" } }, k = ["dist", "README.md", "README.zh-CN.md"], D = { build: "vite build", "test:ui": "vitest --ui", test: "vitest run --coverage --testTimeout=15000", lint: "eslint . --fix", clean: "rm -rf dist", analyze: "npx vite-bundle-analyzer -p auto", generate: "node dist/cli.js generate -i test/demo.spec.json -o test-output -t tsconfig.json" }, j = { "@ahoo-wang/fetcher": "workspace:^3.0.0", "@ahoo-wang/fetcher-eventstream": "workspace:^3.0.0", "@ahoo-wang/fetcher-decorator": "workspace:^3.0.0", "@ahoo-wang/fetcher-openapi": "workspace:^3.0.0", "@ahoo-wang/fetcher-wow": "workspace:^3.0.0" }, W = { "ts-morph": "catalog:", commander: "catalog:", yaml: "catalog:" }, G = { "@eslint/js": "catalog:", "@types/node": "catalog:", "@vitest/coverage-v8": "catalog:", "@vitest/ui": "catalog:", eslint: "catalog:", globals: "catalog:", prettier: "catalog:", typescript: "catalog:", "typescript-eslint": "catalog:", "unplugin-dts": "catalog:", vite: "catalog:", "vite-bundle-analyzer": "catalog:", vitest: "catalog:" }, l = {
36
+ const h = "@ahoo-wang/fetcher-generator", f = "3.8.3", m = "A powerful TypeScript code generation tool that automatically generates type-safe API client code based on OpenAPI specifications. It is designed for general use cases and is also deeply optimized for the [Wow](https://github.com/Ahoo-Wang/Wow) Domain-Driven Design framework, providing native support for the CQRS architectural pattern.", $ = ["fetch", "http", "client", "openapi", "openapi3", "swagger", "generator", "typescript", "codegen", "api", "rest"], v = "Ahoo-Wang", y = "Apache-2.0", w = "https://github.com/Ahoo-Wang/fetcher/tree/master/packages/generator", T = { type: "git", url: "https://github.com/Ahoo-Wang/fetcher.git", directory: "packages/generator" }, A = { url: "https://github.com/Ahoo-Wang/fetcher/issues" }, b = "module", x = "./dist/index.umd.js", I = "./dist/index.es.js", C = "./dist/index.d.ts", P = { "fetcher-generator": "./dist/cli.js" }, S = { ".": { types: "./dist/index.d.ts", import: "./dist/index.es.js", require: "./dist/index.umd.js" } }, k = ["dist", "README.md", "README.zh-CN.md"], D = { build: "vite build", "test:ui": "vitest --ui", test: "vitest run --coverage --testTimeout=15000", lint: "eslint . --fix", clean: "rm -rf dist", analyze: "npx vite-bundle-analyzer -p auto", generate: "node dist/cli.js generate -i test/demo.spec.json -o test-output -t tsconfig.json" }, j = { "@ahoo-wang/fetcher": "workspace:^3.0.0", "@ahoo-wang/fetcher-eventstream": "workspace:^3.0.0", "@ahoo-wang/fetcher-decorator": "workspace:^3.0.0", "@ahoo-wang/fetcher-openapi": "workspace:^3.0.0", "@ahoo-wang/fetcher-wow": "workspace:^3.0.0" }, W = { "ts-morph": "catalog:", commander: "catalog:", yaml: "catalog:" }, G = { "@eslint/js": "catalog:", "@types/node": "catalog:", "@vitest/coverage-v8": "catalog:", "@vitest/ui": "catalog:", eslint: "catalog:", globals: "catalog:", prettier: "catalog:", typescript: "catalog:", "typescript-eslint": "catalog:", "unplugin-dts": "catalog:", vite: "catalog:", "vite-bundle-analyzer": "catalog:", vitest: "catalog:" }, l = {
37
37
  name: h,
38
38
  version: f,
39
39
  description: m,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahoo-wang/fetcher-generator",
3
- "version": "3.8.2",
3
+ "version": "3.8.3",
4
4
  "description": "A powerful TypeScript code generation tool that automatically generates type-safe API client code based on OpenAPI specifications. It is designed for general use cases and is also deeply optimized for the [Wow](https://github.com/Ahoo-Wang/Wow) Domain-Driven Design framework, providing native support for the CQRS architectural pattern.",
5
5
  "keywords": [
6
6
  "fetch",