Skip to content

Commit

Permalink
✨ Move compile steps into config for #218 (#292)
Browse files Browse the repository at this point in the history
* 📝 changelog for #218

* ✨ moved compile steps into config from service provider

* 🚨 Apply fixes from StyleCI (#293)
  • Loading branch information
carbontwelve authored Jan 4, 2018
1 parent adf2736 commit da1d36c
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 74 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Tapestry currently operates a one month release cycle between releases, see the

### Added
- #290 Organised Unit tests and updated third party requirements
- #218 Moved compile steps to configuration

## [1.0.12] - 2018-01-03

Expand Down
38 changes: 30 additions & 8 deletions src/Modules/Config/DefaultConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/*
* The site kernel to be loaded during site building
*/
'kernel' => \Tapestry\Modules\Kernel\DefaultKernel::class,
'kernel' => Tapestry\Modules\Kernel\DefaultKernel::class,

/*
* Enable / Disable pretty permalink, if enabled then /about.md will be written as /about/index.md.
Expand Down Expand Up @@ -39,19 +39,41 @@
],

'content_renderers' => [
\Tapestry\Entities\Renderers\PlatesRenderer::class,
\Tapestry\Entities\Renderers\HTMLRenderer::class,
\Tapestry\Entities\Renderers\MarkdownRenderer::class,
\Tapestry\Entities\Renderers\DefaultRenderer::class,
Tapestry\Entities\Renderers\PlatesRenderer::class,
Tapestry\Entities\Renderers\HTMLRenderer::class,
Tapestry\Entities\Renderers\MarkdownRenderer::class,
Tapestry\Entities\Renderers\DefaultRenderer::class,
],

'content_generators' => [
\Tapestry\Entities\Generators\PaginationGenerator::class,
\Tapestry\Entities\Generators\TaxonomyArchiveGenerator::class,
\Tapestry\Entities\Generators\TaxonomyIndexGenerator::class,
Tapestry\Entities\Generators\PaginationGenerator::class,
Tapestry\Entities\Generators\TaxonomyArchiveGenerator::class,
Tapestry\Entities\Generators\TaxonomyIndexGenerator::class,
Tapestry\Entities\Generators\CollectionItemGenerator::class,
],

/*
* Compile steps that the build command will process.
*/
'steps' => [
Tapestry\Modules\Kernel\BootKernel::class,
Tapestry\Modules\Content\ReadCache::class,
Tapestry\Modules\Scripts\Before::class,
Tapestry\Modules\Content\Clear::class,
Tapestry\Modules\ContentTypes\LoadContentTypes::class,
Tapestry\Modules\Renderers\LoadContentRenderers::class,
Tapestry\Modules\Generators\LoadContentGenerators::class,
Tapestry\Modules\Content\LoadSourceFiles::class,
Tapestry\Modules\Api\Json::class,
Tapestry\Modules\ContentTypes\ParseContentTypes::class,
Tapestry\Modules\Content\Compile::class,
Tapestry\Modules\Content\WriteFiles::class,
Tapestry\Modules\Content\WriteCache::class,
Tapestry\Modules\Content\Copy::class,
Tapestry\Modules\Content\Clean::class,
Tapestry\Modules\Scripts\After::class,
],

/*
* Paths to ignore and not parse, any path matching those listed here will not be loaded.
*/
Expand Down
3 changes: 1 addition & 2 deletions src/Providers/CommandServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,10 @@ protected function registerServeCommand()
*/
protected function registerBuildCommand()
{
$steps = $this->getContainer()->get('Compile.Steps');
$this->getContainer()->add(BuildCommand::class)
->withArguments([
Tapestry::class,
$steps,
config('steps', []),
]);
}

Expand Down
62 changes: 0 additions & 62 deletions src/Providers/CompileStepsServiceProvider.php

This file was deleted.

1 change: 0 additions & 1 deletion src/Tapestry.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ public function boot()
$this->register(\Tapestry\Providers\CommandServiceProvider::class);
$this->register(\Tapestry\Providers\ProjectConfigurationServiceProvider::class);
$this->register(\Tapestry\Providers\ProjectServiceProvider::class);
$this->register(\Tapestry\Providers\CompileStepsServiceProvider::class);
$this->register(\Tapestry\Providers\PlatesServiceProvider::class);
$this->register(\Tapestry\Providers\ProjectKernelServiceProvider::class);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/TaxonomyArchiveGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testGenerator()
'--site-dir' => $this->tmpPath(),
'--env' => 'testing'
], $definitions));
$generator = new Generator($tapestry->getContainer()->get('Compile.Steps'), $tapestry);
$generator = new Generator(config('steps', []), $tapestry);

/** @var Project $project */
$project = $tapestry->getContainer()->get(Project::class);
Expand Down

0 comments on commit da1d36c

Please sign in to comment.