conjure-lite
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -57,8 +57,9 @@ "use strict"; | ||
switch (a.type.type) { | ||
case "list": | ||
case "map": | ||
case "set": | ||
throw new Error( | ||
`Unsupported type ${a.type.type} while generating ${endpoint.endpointName}` | ||
); | ||
case "list": | ||
case "set": | ||
return `"${a.paramType.query.paramId}": ${a.argName}.join(",")`; | ||
case "reference": | ||
@@ -344,3 +345,5 @@ return `"${a.paramType.query.paramId}": ${a.argName}`; | ||
const { typeName: { name }, docs } = this.def; | ||
const fields = this.def.fields.map((f) => ` ${f.fieldName}: ${this.getTypeForCode(f.type)};`).join( | ||
const fields = this.def.fields.map( | ||
(f) => ` ${f.fieldName.includes("-") || f.fieldName.includes("_") ? `"${f.fieldName}"` : f.fieldName}: ${this.getTypeForCode(f.type)};` | ||
).join( | ||
"\n" | ||
@@ -396,5 +399,10 @@ ); | ||
); | ||
const childPackages = Array.from(this.codeGen.packages).filter( | ||
(p) => p.startsWith(`${this.def.packageName}.`) | ||
).map((p) => p.substring(this.def.packageName.length + 1).split(".")[0]); | ||
const childPackagesSet = /* @__PURE__ */ new Set(); | ||
this.codeGen.packages.forEach((p) => { | ||
if (p.startsWith(`${this.def.packageName}.`)) { | ||
const childPackage = p.substring(this.def.packageName.length + 1).split(".")[0]; | ||
childPackagesSet.add(childPackage); | ||
} | ||
}); | ||
const childPackages = Array.from(childPackagesSet); | ||
const source = services.map(getServiceExport).join("\n") + "\n\n" + types.map(getTypeExport).join("\n") + "\n\n" + childPackages.map( | ||
@@ -401,0 +409,0 @@ (p) => `export * as ${p} from "./${p}/index${this.codeGen.includeExtensions ? ".js" : ""}"` |
{ | ||
"name": "conjure-lite", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"exports": { | ||
@@ -24,3 +24,2 @@ ".": { | ||
"prepack": "npm run clean && tsup && tsc", | ||
"foo": "&& tsc --emitDeclarationOnly --declaration", | ||
"clean": "rm -rf lib tsconfig.tsbuildinfo dist", | ||
@@ -27,0 +26,0 @@ "generateExamples": "npm run prepack && rm -rf examples/widget/src/generated examples/widget/lib examples/widget/tsconfig.tsbuildinfo && ./bin/conjure-lite.mjs generate --ir examples/widget/ir.json --outDir examples/widget/src/generated && tsc --build examples/widget" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
128359
1520
2