Replace 'debug' mode by a 'verbose' one

This commit is contained in:
Convly 2022-07-06 14:56:26 +02:00
parent 6e0e9d3526
commit 870318b05a
3 changed files with 6 additions and 6 deletions

View File

@ -221,7 +221,7 @@ program
'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('-d, --debug', `Display debug information`, false)
.option('-v, --verbose', `Display more information about the types generation`, false)
.action(getLocalScript('content-types/generate-types'));
program

View File

@ -4,7 +4,7 @@ const tsUtils = require('@strapi/typescript-utils');
const strapi = require('../../index');
module.exports = async function({ outDir, file, debug }) {
module.exports = async function({ outDir, file, verbose }) {
const appContext = await strapi.compile();
const app = await strapi(appContext).register();
@ -13,7 +13,7 @@ module.exports = async function({ outDir, file, debug }) {
outDir: outDir || appContext.appDir,
file,
dirs: appContext,
debug,
verbose,
});
app.destroy();

View File

@ -31,10 +31,10 @@ const DEFAULT_OUT_FILENAME = 'schemas.d.ts';
* @param {{ distDir: string; appDir: string; }} options.dirs
* @param {string} [options.outDir]
* @param {string} [options.file]
* @param {boolean} [options.debug]
* @param {boolean} [options.verbose]
*/
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);
@ -70,7 +70,7 @@ const generateSchemasDefinitions = async (options = {}) => {
const definitionFilepath = await saveDefinitionToFileSystem(outDir, file, formattedOutput);
if (debug) {
if (verbose) {
logDebugInformation(schemasDefinitions, { filepath: definitionFilepath });
}
};