Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] #1356: Add question to generate preview files for modules and blocks. #1377

Merged
merged 12 commits into from
May 25, 2022

Conversation

haringsrob
Copy link
Contributor

@haringsrob haringsrob commented Jan 14, 2022

Description

This adds a question to generate a module preview file and a block rendering file:

Screenshot 2022-01-14 at 13 34 29

Screenshot 2022-01-14 at 13 34 54

We should add this for:

  • a twill:make:block
  • a twill:install (to generate a block preview file)

Related Issues

fixes #1356

@haringsrob
Copy link
Contributor Author

If we keep this for 3.x we do not have to deal with Laravel < 6 errors.

@ifox
Copy link
Member

ifox commented Jan 18, 2022

If we keep this for 3.x we do not have to deal with Laravel < 6 errors.

works for me!

@ifox ifox changed the title #1356: Add question to generate preview files for modules and blocks. [3.x] #1356: Add question to generate preview files for modules and blocks. Jan 18, 2022
@haringsrob haringsrob changed the base branch from 2.x to 3.x February 2, 2022 12:15
@@ -54,12 +54,15 @@ public function getBlockMaker(): \A17\Twill\Services\Blocks\BlockMaker
*/
public function handle()
{
$generateView = $this->confirm('Should we also generate a view file for rendering the block?');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ifox Thinking since this is 3.x only, should we swap this with an option like --noPreview to skip preview generation and do it by default if no option is provided?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not do this as decoupled frontends have no use for this.

@haringsrob haringsrob added this to the 3.x initial release milestone Apr 26, 2022
@haringsrob
Copy link
Contributor Author

Hey @ifox,

Thinking, shouldn't we generate a site/layouts/block.blade.php file by default on install (3.x) as you effectively always need it?

@codecov
Copy link

codecov bot commented May 25, 2022

Codecov Report

Merging #1377 (e771137) into 3.x (f3d22e4) will increase coverage by 0.16%.
The diff coverage is 88.46%.

@@             Coverage Diff              @@
##                3.x    #1377      +/-   ##
============================================
+ Coverage     56.46%   56.63%   +0.16%     
- Complexity     3053     3058       +5     
============================================
  Files           242      241       -1     
  Lines          9301     9313      +12     
============================================
+ Hits           5252     5274      +22     
+ Misses         4049     4039      -10     
Impacted Files Coverage Δ
src/Commands/MakeCapsule.php 100.00% <ø> (ø)
src/TwillServiceProvider.php 82.53% <ø> (ø)
src/Services/Blocks/BlockMaker.php 90.24% <40.00%> (-1.64%) ⬇️
src/Commands/BlockMake.php 100.00% <100.00%> (ø)
src/Commands/Install.php 91.83% <100.00%> (+1.59%) ⬆️
src/Commands/ModuleMake.php 86.85% <100.00%> (+1.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3d22e4...e771137. Read the comment docs.

@haringsrob haringsrob merged commit 64c58ef into area17:3.x May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Allow to generate a preview blade file when generating blocks
2 participants