Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
6438856
Add npmDevDependencies as a template variable. Update messaging to sh…
ryanwelcher Mar 24, 2022
6f24eb8
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Mar 25, 2022
0b691cc
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Apr 4, 2022
c847911
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Apr 9, 2022
b0b836e
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Apr 22, 2022
cdb77bc
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher May 19, 2022
e8d6cc3
Remove extra code block.
ryanwelcher May 24, 2022
2b4e90c
Add --is-dynamic flag and some conditional logic as a first pass at m…
ryanwelcher May 24, 2022
df813af
Update templates and tutorial packages to use new templates.
ryanwelcher May 24, 2022
8a59dff
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher May 24, 2022
b52fd0b
Merge branch 'trunk' into try/adding-is-dynamic-flag
ryanwelcher May 24, 2022
505db7d
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Jun 1, 2022
85af639
Merge branch 'trunk' of github.com:ryanwelcher/gutenberg into trunk
ryanwelcher Jun 1, 2022
c69e955
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Jun 8, 2022
5363d2c
Merge branch 'trunk' into try/adding-is-dynamic-flag
ryanwelcher Jun 8, 2022
7a2fd82
Revert code to check the slug of a file.
ryanwelcher Jun 8, 2022
a353949
Check for empty template files before writing them into the filesystem.
ryanwelcher Jun 8, 2022
4bae818
Remove files with block type in the name.
ryanwelcher Jun 8, 2022
211ae27
Add the {{isDynamic}} placeholders to the templates bundled with the …
ryanwelcher Jun 8, 2022
2a1b2bf
Add readme and changelog entries.
ryanwelcher Jun 8, 2022
9ab2889
Render the output files will whitespace maintained.
ryanwelcher Jun 9, 2022
567a22c
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Jun 9, 2022
898d8e8
Updating the create-block-tutorial-template to use the mustache condi…
ryanwelcher Jun 14, 2022
430a9f0
Add the --webpack-copy-php to the scripts based on the the --is-dynam…
ryanwelcher Jun 14, 2022
1e7a1d5
Move the .trim call into the context of the if statement. Proof that …
ryanwelcher Jun 14, 2022
c3de411
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Jun 14, 2022
969eac8
Update packages/create-block/CHANGELOG.md
gziolo Jun 15, 2022
b31ab37
Update packages/create-block/lib/index.js
gziolo Jun 15, 2022
9d61058
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Jun 22, 2022
ffc4a63
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Jun 23, 2022
ce4613d
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Jun 28, 2022
614bb81
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Jun 29, 2022
7d39306
Merge branch 'trunk' of github.com:ryanwelcher/gutenberg into trunk
ryanwelcher Jun 29, 2022
5b079b5
Remove extra code block added in error.
ryanwelcher Jun 29, 2022
c809657
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Jun 30, 2022
7f680ab
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Jul 22, 2022
a729ae0
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Aug 8, 2022
08488a0
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Aug 11, 2022
682510d
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Aug 16, 2022
dc4dbfc
Merge branch 'trunk' into try/adding-is-dynamic-flag
ryanwelcher Aug 16, 2022
2c52e09
Merge branch 'try/adding-is-dynamic-flag' of github.com:ryanwelcher/g…
ryanwelcher Aug 16, 2022
ba0c060
Adding variants array to the template and generating template variabl…
ryanwelcher Aug 16, 2022
d4388d7
Add isStatic check to save.js
ryanwelcher Aug 16, 2022
6cdfed1
Add logic to return empty object if no variants are defined in the te…
ryanwelcher Aug 16, 2022
903b0c9
Update the template variable names to be is{variantName}Variant.
ryanwelcher Aug 16, 2022
c841b26
Update templates to use new variable name convention and look for the…
ryanwelcher Aug 16, 2022
987d7f8
If no variant is select via CLI, use the first one in the array of de…
ryanwelcher Aug 16, 2022
689041b
Check that the passed variant is a valid variant and exit if not.
ryanwelcher Aug 16, 2022
352869e
Define a single variant for the create-block-tutorial-template. Remov…
ryanwelcher Aug 16, 2022
2db5457
Add template selection to interactive mode.
ryanwelcher Aug 16, 2022
8c74ad2
Update changelog.
ryanwelcher Aug 16, 2022
7a3dbab
Update isDynamic to isDynamicVariant
ryanwelcher Aug 18, 2022
ae65dee
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher Aug 18, 2022
2ebd8f8
Merge branch 'trunk' into try/adding-is-dynamic-flag
ryanwelcher Aug 18, 2022
ca0b38b
Replace variantTypes with variantVars
ryanwelcher Aug 18, 2022
5349b5f
Update isDynamic to isDynamicVariant... again.
ryanwelcher Aug 18, 2022
fb27be1
Update readme to use --variant flag.
ryanwelcher Aug 18, 2022
6aae5e6
Add logic to conditionally show the variant prompt only if there are …
ryanwelcher Aug 18, 2022
d406438
Adds variants to the es5 block and removes "static" from various prop…
ryanwelcher Aug 18, 2022
4149c35
Change "static" template to "standard".
ryanwelcher Aug 18, 2022
4e304ad
Convert variants to an object where the property is the variant name …
ryanwelcher Aug 18, 2022
50bb648
Define a dynamic variant for the create-block-tutorial and override t…
ryanwelcher Aug 18, 2022
07d0614
Get the variant first and then retrieve the defaults based on that va…
ryanwelcher Aug 19, 2022
1c0b85c
Update templates.js
gziolo Aug 22, 2022
e700c55
Update templates.js
gziolo Aug 22, 2022
11a27c0
Update packages/create-block/lib/prompts.js
gziolo Aug 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update templates.js
  • Loading branch information
gziolo authored Aug 22, 2022
commit 1c0b85c67e81b0e2750e2fec207734ffb0a2b7fd
18 changes: 6 additions & 12 deletions packages/create-block/lib/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const prompts = require( './prompts' );
const predefinedPluginTemplates = {
es5: {
defaultValues: {
slug: 'example-es5',
title: 'Example (ES5)',
slug: 'example-static-es5',
title: 'Example Static Block (ES5)',
description:
'Example block scaffolded with Create Block tool – no build step required.',
dashicon: 'smiley',
Expand All @@ -33,10 +33,7 @@ const predefinedPluginTemplates = {
},
templatesPath: join( __dirname, 'templates', 'es5' ),
variants: {
static: {
slug: 'example-static-es5',
title: 'Example Static Block (ES5)',
},
static: {},
dynamic: {
slug: 'example-dynamic-es5',
title: 'Example Dynamic Block (ES5)',
Expand All @@ -45,19 +42,16 @@ const predefinedPluginTemplates = {
},
standard: {
defaultValues: {
slug: 'example-block',
title: 'Example Block',
slug: 'example-static-block',
title: 'Example Static Block',
description: 'Example block scaffolded with Create Block tool.',
dashicon: 'smiley',
supports: {
html: false,
},
},
variants: {
static: {
slug: 'example-static-block',
title: 'Example Static Block',
},
static: {},
dynamic: {
slug: 'example-dynamic-block',
title: 'Example Dynamic Block',
Expand Down