Skip to content

Commit

Permalink
Add more logging to the user console
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Nov 6, 2020
1 parent d8c2cdb commit 1e73571
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/create-block/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ program
( { name } ) =>
! Object.keys( optionsValues ).includes( name )
);
log.info( '' );
log.info( "Let's customize your block:" );
const answers = await inquirer.prompt( prompts );
await scaffold( blockTemplate, {
...defaultValues,
Expand Down
2 changes: 1 addition & 1 deletion packages/create-block/lib/init-wp-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = async ( { slug } ) => {
const cwd = join( process.cwd(), slug );

info( '' );
info( 'Installing packages. It might take a couple of minutes.' );
info( 'Installing packages. It might take a couple of minutes...' );
await command( 'npm install @wordpress/scripts --save-dev', {
cwd,
} );
Expand Down
5 changes: 5 additions & 0 deletions packages/create-block/lib/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const lazyImport = require( '@wordpress/lazy-import' );
* Internal dependencies
*/
const CLIError = require( './cli-error' );
const { info } = require( './log' );
const prompts = require( './prompts' );

const predefinedBlockTemplates = {
Expand Down Expand Up @@ -94,12 +95,16 @@ const getBlockTemplate = async ( templateName ) => {
}

try {
info( '' );
info( 'Downloading template files. It might take some time...' );

const { defaultValues = {}, templatesPath } = await lazyImport(
templateName
);
if ( ! isObject( defaultValues ) || ! templatesPath ) {
throw new Error();
}

return {
defaultValues,
outputTemplates: await getOutputTemplates( templatesPath ),
Expand Down

0 comments on commit 1e73571

Please sign in to comment.