diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 90f0b24..8d9f034 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -576,9 +576,9 @@ async function cmdRender(args: string[]): Promise { // Otherwise, use renderDirect for inline rendering of the envelope value. if (typeof envelope.value === "string" && isHash(envelope.value)) { const output = await renderAsync(store, envelope.value as Hash, { - resolution, - decay, - epsilon, + ...(resolution !== undefined && { resolution }), + ...(decay !== undefined && { decay }), + ...(epsilon !== undefined && { epsilon }), varStore, }); process.stdout.write(output + "\n"); @@ -588,9 +588,9 @@ async function cmdRender(args: string[]): Promise { envelope.value, store, { - resolution, - decay, - epsilon, + ...(resolution !== undefined && { resolution }), + ...(decay !== undefined && { decay }), + ...(epsilon !== undefined && { epsilon }), }, ); process.stdout.write(output + "\n"); @@ -598,9 +598,9 @@ async function cmdRender(args: string[]): Promise { } else { const hash = resolveHash(input as string, varStore); const output = await renderAsync(store, hash, { - resolution, - decay, - epsilon, + ...(resolution !== undefined && { resolution }), + ...(decay !== undefined && { decay }), + ...(epsilon !== undefined && { epsilon }), varStore, }); // Output to stdout without JSON wrapping (raw output) @@ -767,9 +767,9 @@ async function cmdVarTag(args: string[]): Promise { const { tags, labels, deleteNames } = parseTagsLabels(tagArgs); const variable = varStore.tag(name, schema, { - add: Object.keys(tags).length > 0 ? tags : undefined, - addLabels: labels.length > 0 ? labels : undefined, - delete: deleteNames.length > 0 ? deleteNames : undefined, + ...(Object.keys(tags).length > 0 && { add: tags }), + ...(labels.length > 0 && { addLabels: labels }), + ...(deleteNames.length > 0 && { delete: deleteNames }), }); await out( @@ -1040,7 +1040,7 @@ async function cmdTemplateDelete(args: string[]): Promise { ); } catch (e) { if (e instanceof VariableNotFoundError) { - die(`Error: Template not found for schema: ${schemaHash}`); + die(`Error: Template not found for schema: ${schemaInput}`); } throw e; } finally { diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 75eba9f..fb5a197 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -1,8 +1,10 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "rootDir": "src", - "outDir": "dist" + "composite": false, + "declaration": false, + "declarationMap": false, + "noEmit": true }, "include": ["src"] }