@contember/client-content-generator
Advanced tools
Comparing version 1.3.0-alpha.5 to 1.3.0-alpha.6
@@ -9,6 +9,26 @@ #!/usr/bin/env node | ||
if (!schemaPath || !outDir) { | ||
console.error(`Usage: yarn contember-client-generator <schema.json> <out-dir>`); | ||
console.error(`Usage: | ||
From file: | ||
yarn contember-client-generator <schema.json> <out-dir> | ||
From stdin: | ||
yarn run --silent contember project:print-schema --format=schema | yarn contember-client-generator - <out-dir> | ||
`); | ||
process.exit(1); | ||
} | ||
const source = JSON.parse(await fs.readFile(resolve(process.cwd(), process.argv[2]), "utf8")); | ||
const sourceData = await (async () => { | ||
if (schemaPath === "-") { | ||
if (process.stdin.isTTY) { | ||
throw new Error("Cannot read from stdin in TTY mode"); | ||
} | ||
const buffer = []; | ||
for await (const chunk of process.stdin) { | ||
buffer.push(chunk); | ||
} | ||
return Buffer.concat(buffer).toString("utf8"); | ||
} | ||
return await fs.readFile(resolve(process.cwd(), process.argv[2]), "utf8"); | ||
})(); | ||
const source = JSON.parse(sourceData); | ||
const dir = resolve(process.cwd(), process.argv[3]); | ||
@@ -15,0 +35,0 @@ const generator = new ContemberClientGenerator(); |
@@ -9,6 +9,26 @@ #!/usr/bin/env node | ||
if (!schemaPath || !outDir) { | ||
console.error(`Usage: yarn contember-client-generator <schema.json> <out-dir>`); | ||
console.error(`Usage: | ||
From file: | ||
yarn contember-client-generator <schema.json> <out-dir> | ||
From stdin: | ||
yarn run --silent contember project:print-schema --format=schema | yarn contember-client-generator - <out-dir> | ||
`); | ||
process.exit(1); | ||
} | ||
const source = JSON.parse(await fs.readFile(resolve(process.cwd(), process.argv[2]), "utf8")); | ||
const sourceData = await (async () => { | ||
if (schemaPath === "-") { | ||
if (process.stdin.isTTY) { | ||
throw new Error("Cannot read from stdin in TTY mode"); | ||
} | ||
const buffer = []; | ||
for await (const chunk of process.stdin) { | ||
buffer.push(chunk); | ||
} | ||
return Buffer.concat(buffer).toString("utf8"); | ||
} | ||
return await fs.readFile(resolve(process.cwd(), process.argv[2]), "utf8"); | ||
})(); | ||
const source = JSON.parse(sourceData); | ||
const dir = resolve(process.cwd(), process.argv[3]); | ||
@@ -15,0 +35,0 @@ const generator = new ContemberClientGenerator(); |
{ | ||
"name": "@contember/client-content-generator", | ||
"license": "Apache-2.0", | ||
"version": "1.3.0-alpha.5", | ||
"version": "1.3.0-alpha.6", | ||
"type": "module", | ||
@@ -41,3 +41,3 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@contember/client-content": "1.3.0-alpha.5", | ||
"@contember/client-content": "1.3.0-alpha.6", | ||
"@contember/schema": "^1.3.6", | ||
@@ -44,0 +44,0 @@ "@contember/schema-utils": "^1.3.6" |
@@ -10,7 +10,29 @@ import * as fs from 'node:fs/promises' | ||
if (!schemaPath || !outDir) { | ||
console.error(`Usage: yarn contember-client-generator <schema.json> <out-dir>`) | ||
console.error(`Usage: | ||
From file: | ||
yarn contember-client-generator <schema.json> <out-dir> | ||
From stdin: | ||
yarn run --silent contember project:print-schema --format=schema | yarn contember-client-generator - <out-dir> | ||
`) | ||
process.exit(1) | ||
} | ||
const source = JSON.parse(await fs.readFile(resolve(process.cwd(), process.argv[2]), 'utf8')) | ||
const sourceData = await (async () => { | ||
if (schemaPath === '-') { | ||
if (process.stdin.isTTY) { | ||
throw new Error('Cannot read from stdin in TTY mode') | ||
} | ||
const buffer = [] | ||
for await (const chunk of process.stdin) { | ||
buffer.push(chunk) | ||
} | ||
return Buffer.concat(buffer).toString('utf8') | ||
} | ||
return await fs.readFile(resolve(process.cwd(), process.argv[2]), 'utf8') | ||
})() | ||
const source = JSON.parse(sourceData) | ||
const dir = resolve(process.cwd(), process.argv[3]) | ||
@@ -17,0 +39,0 @@ const generator = new ContemberClientGenerator() |
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
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
Sorry, the diff of this file is not supported yet
176802
1640
+ Added@contember/client-content@1.3.0-alpha.6(transitive)
+ Added@contember/graphql-builder@1.3.0-alpha.6(transitive)
+ Added@contember/graphql-client@1.3.0-alpha.6(transitive)
- Removed@contember/client-content@1.3.0-alpha.5(transitive)
- Removed@contember/graphql-builder@1.3.0-alpha.5(transitive)
- Removed@contember/graphql-client@1.3.0-alpha.5(transitive)