mirror of
https://github.com/strapi/strapi.git
synced 2025-11-13 16:52:18 +00:00
Replace 'debug' mode by a 'verbose' one
This commit is contained in:
parent
6e0e9d3526
commit
870318b05a
@ -221,7 +221,7 @@ program
|
|||||||
'Specify a relative directory in which the schemas definitions will be generated'
|
'Specify a relative directory in which the schemas definitions will be generated'
|
||||||
)
|
)
|
||||||
.option('-f, --file <file>', 'Specify a filename to store the schemas definitions')
|
.option('-f, --file <file>', 'Specify a filename to store the schemas definitions')
|
||||||
.option('-d, --debug', `Display debug information`, false)
|
.option('-v, --verbose', `Display more information about the types generation`, false)
|
||||||
.action(getLocalScript('content-types/generate-types'));
|
.action(getLocalScript('content-types/generate-types'));
|
||||||
|
|
||||||
program
|
program
|
||||||
|
|||||||
@ -4,7 +4,7 @@ const tsUtils = require('@strapi/typescript-utils');
|
|||||||
|
|
||||||
const strapi = require('../../index');
|
const strapi = require('../../index');
|
||||||
|
|
||||||
module.exports = async function({ outDir, file, debug }) {
|
module.exports = async function({ outDir, file, verbose }) {
|
||||||
const appContext = await strapi.compile();
|
const appContext = await strapi.compile();
|
||||||
const app = await strapi(appContext).register();
|
const app = await strapi(appContext).register();
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ module.exports = async function({ outDir, file, debug }) {
|
|||||||
outDir: outDir || appContext.appDir,
|
outDir: outDir || appContext.appDir,
|
||||||
file,
|
file,
|
||||||
dirs: appContext,
|
dirs: appContext,
|
||||||
debug,
|
verbose,
|
||||||
});
|
});
|
||||||
|
|
||||||
app.destroy();
|
app.destroy();
|
||||||
|
|||||||
@ -31,10 +31,10 @@ const DEFAULT_OUT_FILENAME = 'schemas.d.ts';
|
|||||||
* @param {{ distDir: string; appDir: string; }} options.dirs
|
* @param {{ distDir: string; appDir: string; }} options.dirs
|
||||||
* @param {string} [options.outDir]
|
* @param {string} [options.outDir]
|
||||||
* @param {string} [options.file]
|
* @param {string} [options.file]
|
||||||
* @param {boolean} [options.debug]
|
* @param {boolean} [options.verbose]
|
||||||
*/
|
*/
|
||||||
const generateSchemasDefinitions = async (options = {}) => {
|
const generateSchemasDefinitions = async (options = {}) => {
|
||||||
const { strapi, outDir = process.cwd(), file = DEFAULT_OUT_FILENAME, debug = false } = options;
|
const { strapi, outDir = process.cwd(), file = DEFAULT_OUT_FILENAME, verbose = false } = options;
|
||||||
|
|
||||||
const schemas = getAllStrapiSchemas(strapi);
|
const schemas = getAllStrapiSchemas(strapi);
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ const generateSchemasDefinitions = async (options = {}) => {
|
|||||||
|
|
||||||
const definitionFilepath = await saveDefinitionToFileSystem(outDir, file, formattedOutput);
|
const definitionFilepath = await saveDefinitionToFileSystem(outDir, file, formattedOutput);
|
||||||
|
|
||||||
if (debug) {
|
if (verbose) {
|
||||||
logDebugInformation(schemasDefinitions, { filepath: definitionFilepath });
|
logDebugInformation(schemasDefinitions, { filepath: definitionFilepath });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user