Merge pull request #1919 (Sage 9.0.0-beta.4)

This commit is contained in:
QWp6t
2017-07-25 08:58:39 -07:00
committed by GitHub
53 changed files with 17527 additions and 6978 deletions

View File

@@ -1,43 +0,0 @@
{
"root": true,
"extends": "eslint:recommended",
"globals": {
"wp": true
},
"env": {
"node": true,
"es6": true,
"amd": true,
"browser": true,
"jquery": true
},
"parserOptions": {
"ecmaFeatures": {
"globalReturn": true,
"generators": false,
"objectLiteralDuplicateProperties": false,
"experimentalObjectRestSpread": true
},
"ecmaVersion": 2017,
"sourceType": "module"
},
"plugins": [
"import",
],
"settings": {
"import/core-modules": [],
"import/ignore": [
"node_modules",
"\\.(coffee|scss|css|less|hbs|svg|json)$"
]
},
"rules": {
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "ignore"
}]
}
}

2
.gitignore vendored
View File

@@ -1,8 +1,10 @@
# Include your project-specific ignores in this file # Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files # Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
.cache-loader
dist dist
bower_components bower_components
node_modules node_modules
npm-debug.log npm-debug.log
yarn-error.log yarn-error.log
vendor vendor
resources/assets/config-local.json

View File

@@ -1,3 +0,0 @@
{
"extends": "stylelint-config-standard"
}

View File

@@ -40,16 +40,7 @@ collect([
'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date', 'home', 'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date', 'home',
'frontpage', 'page', 'paged', 'search', 'single', 'singular', 'attachment' 'frontpage', 'page', 'paged', 'search', 'single', 'singular', 'attachment'
])->map(function ($type) { ])->map(function ($type) {
add_filter("{$type}_template_hierarchy", function ($templates) { add_filter("{$type}_template_hierarchy", __NAMESPACE__.'\\filter_templates');
return collect($templates)->flatMap(function ($template) {
$transforms = [
'%^/?(resources[\\/]views)?[\\/]?%' => '',
'%(\.blade)?(\.php)?$%' => ''
];
$normalizedTemplate = preg_replace(array_keys($transforms), array_values($transforms), $template);
return ["{$normalizedTemplate}.blade.php", "{$normalizedTemplate}.php"];
})->toArray();
});
}); });
/** /**
@@ -59,12 +50,21 @@ add_filter('template_include', function ($template) {
$data = collect(get_body_class())->reduce(function ($data, $class) use ($template) { $data = collect(get_body_class())->reduce(function ($data, $class) use ($template) {
return apply_filters("sage/template/{$class}/data", $data, $template); return apply_filters("sage/template/{$class}/data", $data, $template);
}, []); }, []);
echo template($template, $data); if ($template) {
// Return a blank file to make WordPress happy echo template($template, $data);
return get_theme_file_path('index.php'); return get_stylesheet_directory().'/index.php';
}
return $template;
}, PHP_INT_MAX); }, PHP_INT_MAX);
/** /**
* Tell WordPress how to find the compiled path of comments.blade.php * Tell WordPress how to find the compiled path of comments.blade.php
*/ */
add_filter('comments_template', 'App\\template_path'); add_filter('comments_template', function ($comments_template) {
$comments_template = str_replace(
[get_stylesheet_directory(), get_template_directory()],
'',
$comments_template
);
return template_path(locate_template(["views/{$comments_template}", $comments_template]) ?: $comments_template);
});

View File

@@ -3,18 +3,16 @@
namespace App; namespace App;
use Roots\Sage\Container; use Roots\Sage\Container;
use Illuminate\Contracts\Container\Container as ContainerContract;
/** /**
* Get the sage container. * Get the sage container.
* *
* @param string $abstract * @param string $abstract
* @param array $parameters * @param array $parameters
* @param ContainerContract $container * @param Container $container
* @return ContainerContract|mixed * @return Container|mixed
* @SuppressWarnings(PHPMD.StaticAccess)
*/ */
function sage($abstract = null, $parameters = [], ContainerContract $container = null) function sage($abstract = null, $parameters = [], Container $container = null)
{ {
$container = $container ?: Container::getInstance(); $container = $container ?: Container::getInstance();
if (!$abstract) { if (!$abstract) {
@@ -77,6 +75,42 @@ function asset_path($asset)
return sage('assets')->getUri($asset); return sage('assets')->getUri($asset);
} }
/**
* @param string|string[] $templates Possible template files
* @return array
*/
function filter_templates($templates)
{
return collect($templates)
->map(function ($template) {
return preg_replace('#\.(blade\.)?php$#', '', ltrim($template));
})
->flatMap(function ($template) {
$paths = apply_filters('sage/filter_templates/paths', ['views', 'resources/views']);
return collect($paths)
->flatMap(function ($path) use ($template) {
return [
"{$path}/{$template}.blade.php",
"{$path}/{$template}.php",
"{$template}.blade.php",
"{$template}.php",
];
});
})
->filter()
->unique()
->all();
}
/**
* @param string|string[] $templates Relative path to possible template files
* @return string Location of the template
*/
function locate_template($templates)
{
return \locate_template(filter_templates($templates));
}
/** /**
* Determine whether to show the sidebar * Determine whether to show the sidebar
* @return bool * @return bool

View File

@@ -1,41 +0,0 @@
<?php
namespace Roots\Sage\Assets;
/**
* Class JsonManifest
* @package Roots\Sage
* @author QWp6t
*/
class JsonManifest implements ManifestInterface
{
/** @var array */
public $manifest;
/** @var string */
public $dist;
/**
* JsonManifest constructor
*
* @param string $manifestPath Local filesystem path to JSON-encoded manifest
* @param string $distUri Remote URI to assets root
*/
public function __construct($manifestPath, $distUri)
{
$this->manifest = file_exists($manifestPath) ? json_decode(file_get_contents($manifestPath), true) : [];
$this->dist = $distUri;
}
/** @inheritdoc */
public function get($asset)
{
return isset($this->manifest[$asset]) ? $this->manifest[$asset] : $asset;
}
/** @inheritdoc */
public function getUri($asset)
{
return "{$this->dist}/{$this->get($asset)}";
}
}

View File

@@ -1,31 +0,0 @@
<?php
namespace Roots\Sage\Assets;
/**
* Interface ManifestInterface
* @package Roots\Sage
* @author QWp6t
*/
interface ManifestInterface
{
/**
* Get the cache-busted filename
*
* If the manifest does not have an entry for $asset, then return $asset
*
* @param string $asset The original name of the file before cache-busting
* @return string
*/
public function get($asset);
/**
* Get the cache-busted URI
*
* If the manifest does not have an entry for $asset, then return URI for $asset
*
* @param string $asset The original name of the file before cache-busting
* @return string
*/
public function getUri($asset);
}

View File

@@ -1,8 +0,0 @@
<?php
namespace Roots\Sage;
class Config extends \Illuminate\Config\Repository
{
}

View File

@@ -1,10 +0,0 @@
<?php
namespace Roots\Sage;
use Illuminate\Container\Container as BaseContainer;
class Container extends BaseContainer
{
}

View File

@@ -1,148 +0,0 @@
<?php
namespace Roots\Sage;
use Composer\Script\Event;
class PostCreateProject
{
public static function updateHeaders(Event $event)
{
// @codingStandardsIgnoreStart
$io = $event->getIO();
if ($io->isInteractive()) {
$io->write('<info>Define theme headers. Press enter key for default.</info>');
$theme_headers_default = [
'name' => 'Sage Starter Theme',
'uri' => 'https://roots.io/sage/',
'description' => 'Sage is a WordPress starter theme.',
'version' => '9.0.0-beta.3',
'author' => 'Roots',
'author_uri' => 'https://roots.io/'
];
$theme_headers = [
'name' => $io->ask('<info>Theme Name [<comment>'.$theme_headers_default['name'].'</comment>]:</info> ', $theme_headers_default['name']),
'uri' => $io->ask('<info>Theme URI [<comment>'.$theme_headers_default['uri'].'</comment>]:</info> ', $theme_headers_default['uri']),
'description' => $io->ask('<info>Theme Description [<comment>'.$theme_headers_default['description'].'</comment>]:</info> ', $theme_headers_default['description']),
'version' => $io->ask('<info>Theme Version [<comment>'.$theme_headers_default['version'].'</comment>]:</info> ', $theme_headers_default['version']),
'author' => $io->ask('<info>Theme Author [<comment>'.$theme_headers_default['author'].'</comment>]:</info> ', $theme_headers_default['author']),
'author_uri' => $io->ask('<info>Theme Author URI [<comment>'.$theme_headers_default['author_uri'].'</comment>]:</info> ', $theme_headers_default['author_uri'])
];
file_put_contents('resources/style.css', str_replace($theme_headers_default, $theme_headers, file_get_contents('resources/style.css')));
}
}
public static function selectFramework(Event $event)
{
$io = $event->getIO();
$default_framework_pattern = '"bootstrap": ".*"';
$files_to_clear = [
'resources/assets/styles/components/_comments.scss',
'resources/assets/styles/components/_forms.scss',
'resources/assets/styles/components/_wp-classes.scss',
'resources/assets/styles/layouts/_header.scss',
];
if ($io->isInteractive()) {
$frameworks = [
'Bootstrap',
'Foundation',
'Tachyons',
'None'
];
$framework = $io->select('<info>Select a CSS framework</info> <comment>(Default: Bootstrap)</comment>', $frameworks, 0);
switch($framework) {
case 0:
break;
case 1:
file_put_contents('package.json', preg_replace("/{$default_framework_pattern}/", '"foundation-sites": "6.3.0"', file_get_contents('package.json')));
file_put_contents('resources/assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '@import "~foundation-sites/scss/foundation";' . "\n" . '@include foundation-everything;' . "\n", file_get_contents('resources/assets/styles/main.scss')));
file_put_contents('resources/assets/scripts/main.js', str_replace("import 'bootstrap';\n", "import 'foundation-sites/dist/js/foundation';\n", file_get_contents('resources/assets/scripts/main.js')));
static::clearFiles($files_to_clear);
break;
case 2:
file_put_contents('package.json', preg_replace("/{$default_framework_pattern}/", '"tachyons-sass": "^4.7.1"', file_get_contents('package.json')));
file_put_contents('resources/assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '@import "~tachyons-sass/tachyons";' . "\n", file_get_contents('resources/assets/styles/main.scss')));
file_put_contents('resources/assets/scripts/main.js', str_replace("import 'bootstrap';\n", '', file_get_contents('resources/assets/scripts/main.js')));
static::clearFiles($files_to_clear);
break;
case 3:
file_put_contents('package.json', preg_replace("/\s+{$default_framework_pattern},/", '', file_get_contents('package.json')));
file_put_contents('resources/assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '', file_get_contents('resources/assets/styles/main.scss')));
file_put_contents('resources/assets/scripts/main.js', str_replace("import 'bootstrap';\n", '', file_get_contents('resources/assets/scripts/main.js')));
static::clearFiles($files_to_clear);
break;
}
}
}
public static function clearFiles(array $files)
{
foreach($files as $file) {
// First, we will pull the comment from the first line of each file
// we want to empty. Stylelint does not allow empty files.
if ($handle = fopen($file, 'r')) {
$comment = fgets($handle);
fclose($handle);
}
// Finally, we will replace the file's contents with just the comment.
file_put_contents($file, $comment);
}
}
public static function addFontAwesome(Event $event)
{
$io = $event->getIO();
if ($io->isInteractive()) {
if ($io->askConfirmation('<info>Add Font Awesome?</info> [<comment>y,N</comment>]? ', false)) {
$package = json_decode(file_get_contents('package.json'), true);
$dependencies = $package['dependencies'];
$dependencies = array_merge($dependencies, ['font-awesome' => '^4.7.0']);
$package['dependencies'] = $dependencies;
$package = str_replace(' ', ' ', json_encode($package, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n");
file_put_contents('package.json', $package);
$import_dep_str = '// Import npm dependencies' . "\n";
file_put_contents('resources/assets/styles/main.scss', str_replace($import_dep_str, $import_dep_str . '@import "~font-awesome/scss/font-awesome";' . "\n", file_get_contents('resources/assets/styles/main.scss')));
file_put_contents('resources/assets/styles/common/_variables.scss', "\n" . '$fa-font-path: \'~font-awesome/fonts\';' . "\n", FILE_APPEND);
}
}
}
public static function buildOptions(Event $event)
{
$io = $event->getIO();
if ($io->isInteractive()) {
$io->write('<info>Configure build settings. Press enter key for default.</info>');
$browsersync_settings_default = [
'publicPath' => '/app/themes/'.basename(getcwd()),
'devUrl' => 'http://example.dev'
];
$browsersync_settings = [
'publicPath' => $io->ask('<info>Path to theme directory (eg. /wp-content/themes/sage) [<comment>'.$browsersync_settings_default['publicPath'].'</comment>]:</info> ', $browsersync_settings_default['publicPath']),
'devUrl' => $io->ask('<info>Local development URL of WP site [<comment>'.$browsersync_settings_default['devUrl'].'</comment>]:</info> ', $browsersync_settings_default['devUrl'])
];
file_put_contents('resources/assets/config.json', str_replace('/app/themes/sage', $browsersync_settings['publicPath'], file_get_contents('resources/assets/config.json')));
file_put_contents('resources/assets/config.json', str_replace($browsersync_settings_default['devUrl'], $browsersync_settings['devUrl'], file_get_contents('resources/assets/config.json')));
}
}
// @codingStandardsIgnoreEnd
}

View File

@@ -1,129 +0,0 @@
<?php
namespace Roots\Sage\Template;
use Illuminate\Contracts\Container\Container as ContainerContract;
use Illuminate\Contracts\View\Factory as FactoryContract;
use Illuminate\View\Engines\CompilerEngine;
use Illuminate\View\Engines\EngineInterface;
use Illuminate\View\ViewFinderInterface;
/**
* Class BladeProvider
* @method \Illuminate\View\View file($file, $data = [], $mergeData = [])
* @method \Illuminate\View\View make($file, $data = [], $mergeData = [])
*/
class Blade
{
/** @var ContainerContract */
protected $app;
public function __construct(FactoryContract $env, ContainerContract $app)
{
$this->env = $env;
$this->app = $app;
}
/**
* Get the compiler
*
* @return \Illuminate\View\Compilers\BladeCompiler
*/
public function compiler()
{
static $engineResolver;
if (!$engineResolver) {
$engineResolver = $this->app->make('view.engine.resolver');
}
return $engineResolver->resolve('blade')->getCompiler();
}
/**
* @param string $view
* @param array $data
* @param array $mergeData
* @return string
*/
public function render($view, $data = [], $mergeData = [])
{
/** @var \Illuminate\Contracts\Filesystem\Filesystem $filesystem */
$filesystem = $this->app['files'];
return $this->{$filesystem->exists($view) ? 'file' : 'make'}($view, $data, $mergeData)->render();
}
/**
* @param string $file
* @param array $data
* @param array $mergeData
* @return string
*/
public function compiledPath($file, $data = [], $mergeData = [])
{
$rendered = $this->file($file, $data, $mergeData);
/** @var EngineInterface $engine */
$engine = $rendered->getEngine();
if (!($engine instanceof CompilerEngine)) {
// Using PhpEngine, so just return the file
return $file;
}
$compiler = $engine->getCompiler();
$compiledPath = $compiler->getCompiledPath($rendered->getPath());
if ($compiler->isExpired($compiledPath)) {
$compiler->compile($file);
}
return $compiledPath;
}
/**
* @param string $file
* @return string
*/
public function normalizeViewPath($file)
{
// Convert `\` to `/`
$view = str_replace('\\', '/', $file);
// Add namespace to path if necessary
$view = $this->applyNamespaceToPath($view);
// Remove unnecessary parts of the path
$view = str_replace(array_merge($this->app['config']['view.paths'], ['.blade.php', '.php']), '', $view);
// Remove superfluous and leading slashes
return ltrim(preg_replace('%//+%', '/', $view), '/');
}
/**
* Convert path to view namespace
* @param string $path
* @return string
*/
public function applyNamespaceToPath($path)
{
/** @var ViewFinderInterface $finder */
$finder = $this->app['view.finder'];
if (!method_exists($finder, 'getHints')) {
return $path;
}
$delimiter = $finder::HINT_PATH_DELIMITER;
$hints = $finder->getHints();
$view = array_reduce(array_keys($hints), function ($view, $namespace) use ($delimiter, $hints) {
return str_replace($hints[$namespace], $namespace.$delimiter, $view);
}, $path);
return preg_replace("%{$delimiter}[\\/]*%", $delimiter, $view);
}
/**
* Pass any method to the view Factory instance.
*
* @param string $method
* @param array $params
* @return mixed
*/
public function __call($method, $params)
{
return call_user_func_array([$this->env, $method], $params);
}
}

View File

@@ -1,91 +0,0 @@
<?php
namespace Roots\Sage\Template;
use Illuminate\Container\Container;
use Illuminate\Contracts\Container\Container as ContainerContract;
use Illuminate\Events\Dispatcher;
use Illuminate\Filesystem\Filesystem;
use Illuminate\View\ViewServiceProvider;
/**
* Class BladeProvider
*/
class BladeProvider extends ViewServiceProvider
{
/**
* @param ContainerContract $container
* @param array $config
* @SuppressWarnings(PHPMD.StaticAccess)
*/
public function __construct(ContainerContract $container = null, $config = [])
{
/** @noinspection PhpParamsInspection */
parent::__construct($container ?: Container::getInstance());
$this->app->bindIf('config', function () use ($config) {
return $config;
}, true);
}
/**
* Bind required instances for the service provider.
*/
public function register()
{
$this->registerFilesystem();
$this->registerEvents();
$this->registerEngineResolver();
$this->registerViewFinder();
$this->registerFactory();
return $this;
}
/**
* Register Filesystem
*/
public function registerFilesystem()
{
$this->app->bindIf('files', Filesystem::class, true);
return $this;
}
/**
* Register the events dispatcher
*/
public function registerEvents()
{
$this->app->bindIf('events', Dispatcher::class, true);
return $this;
}
/** @inheritdoc */
public function registerEngineResolver()
{
parent::registerEngineResolver();
return $this;
}
/** @inheritdoc */
public function registerFactory()
{
parent::registerFactory();
return $this;
}
/**
* Register the view finder implementation.
*/
public function registerViewFinder()
{
$this->app->bindIf('view.finder', function ($app) {
$config = $this->app['config'];
$paths = $config['view.paths'];
$namespaces = $config['view.namespaces'];
$finder = new FileViewFinder($app['files'], $paths);
array_map([$finder, 'addNamespace'], array_keys($namespaces), $namespaces);
return $finder;
}, true);
return $this;
}
}

View File

@@ -1,40 +0,0 @@
<?php
namespace Roots\Sage\Template;
class FileViewFinder extends \Illuminate\View\FileViewFinder
{
const FALLBACK_PARTS_DELIMITER = '-';
/**
* Get an array of possible view files from a single file name.
*
* @param string $name
* @return array
*/
public function getPossibleViewFiles($name)
{
$parts = explode(self::FALLBACK_PARTS_DELIMITER, $name);
$templates[] = array_shift($parts);
foreach ($parts as $i => $part) {
$templates[] = $templates[$i].self::FALLBACK_PARTS_DELIMITER.$part;
}
rsort($templates);
return $this->getPossibleViewFilesFromTemplates($templates);
}
/**
* Get an array of possible view files from an array of templates
*
* @param array $templates
* @return array
*/
public function getPossibleViewFilesFromTemplates($templates)
{
return call_user_func_array('array_merge', array_map(function ($template) {
return array_map(function ($extension) use ($template) {
return str_replace('.', '/', $template).'.'.$extension;
}, $this->extensions);
}, $templates));
}
}

View File

@@ -2,9 +2,8 @@
namespace App; namespace App;
use Illuminate\Contracts\Container\Container as ContainerContract; use Roots\Sage\Container;
use Roots\Sage\Assets\JsonManifest; use Roots\Sage\Assets\JsonManifest;
use Roots\Sage\Config;
use Roots\Sage\Template\Blade; use Roots\Sage\Template\Blade;
use Roots\Sage\Template\BladeProvider; use Roots\Sage\Template\BladeProvider;
@@ -101,29 +100,6 @@ add_action('the_post', function ($post) {
* Setup Sage options * Setup Sage options
*/ */
add_action('after_setup_theme', function () { add_action('after_setup_theme', function () {
/**
* Sage config
*/
$paths = [
'dir.stylesheet' => get_stylesheet_directory(),
'dir.template' => get_template_directory(),
'dir.upload' => wp_upload_dir()['basedir'],
'uri.stylesheet' => get_stylesheet_directory_uri(),
'uri.template' => get_template_directory_uri(),
];
$viewPaths = collect(preg_replace('%[\/]?(resources/views)?[\/.]*?$%', '', [STYLESHEETPATH, TEMPLATEPATH]))
->flatMap(function ($path) {
return ["{$path}/resources/views", $path];
})->unique()->toArray();
config([
'assets.manifest' => "{$paths['dir.stylesheet']}/../dist/assets.json",
'assets.uri' => "{$paths['uri.stylesheet']}/dist",
'view.compiled' => "{$paths['dir.upload']}/cache/compiled",
'view.namespaces' => ['App' => WP_CONTENT_DIR],
'view.paths' => $viewPaths,
] + $paths);
/** /**
* Add JsonManifest to Sage container * Add JsonManifest to Sage container
*/ */
@@ -134,24 +110,19 @@ add_action('after_setup_theme', function () {
/** /**
* Add Blade to Sage container * Add Blade to Sage container
*/ */
sage()->singleton('sage.blade', function (ContainerContract $app) { sage()->singleton('sage.blade', function (Container $app) {
$cachePath = config('view.compiled'); $cachePath = config('view.compiled');
if (!file_exists($cachePath)) { if (!file_exists($cachePath)) {
wp_mkdir_p($cachePath); wp_mkdir_p($cachePath);
} }
(new BladeProvider($app))->register(); (new BladeProvider($app))->register();
return new Blade($app['view'], $app); return new Blade($app['view']);
}); });
/** /**
* Create @asset() Blade directive * Create @asset() Blade directive
*/ */
sage('blade')->compiler()->directive('asset', function ($asset) { sage('blade')->compiler()->directive('asset', function ($asset) {
return "<?= App\\asset_path({$asset}); ?>"; return "<?= " . __NAMESPACE__ . "\\asset_path({$asset}); ?>";
}); });
}); });
/**
* Init config
*/
sage()->bindIf('config', Config::class, true);

View File

@@ -25,28 +25,26 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Roots\\Sage\\": "app/lib/Sage/" "App\\": "app/"
} }
}, },
"require": { "require": {
"php": ">=5.6.4", "php": ">=5.6.4",
"composer/installers": "~1.0", "composer/installers": "~1.0",
"illuminate/view": "~5.4.0", "illuminate/support": "~5.4",
"illuminate/config": "~5.4.0", "roots/sage-lib": "~9.0.0-beta.3",
"soberwp/controller": "dev-master" "soberwp/controller": "dev-master"
}, },
"require-dev": { "require-dev": {
"squizlabs/php_codesniffer": "^2.8.0" "squizlabs/php_codesniffer": "^2.8.0",
"roots/sage-installer": "~1.1"
}, },
"scripts": { "scripts": {
"test": [ "test": [
"phpcs" "phpcs"
], ],
"post-create-project-cmd": [ "post-create-project-cmd": [
"Roots\\Sage\\PostCreateProject::updateHeaders", "Roots\\Sage\\Installer\\ComposerScript::postCreateProject"
"Roots\\Sage\\PostCreateProject::selectFramework",
"Roots\\Sage\\PostCreateProject::addFontAwesome",
"Roots\\Sage\\PostCreateProject::buildOptions"
] ]
} }
} }

596
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "0b1470920d1b38f8ed13b807488e729e", "content-hash": "9a56b0654d7dff65e2aebe6ed81833f3",
"packages": [ "packages": [
{ {
"name": "brain/hierarchy", "name": "brain/hierarchy",
@@ -64,16 +64,16 @@
}, },
{ {
"name": "composer/installers", "name": "composer/installers",
"version": "v1.2.0", "version": "v1.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/composer/installers.git", "url": "https://github.com/composer/installers.git",
"reference": "d78064c68299743e0161004f2de3a0204e33b804" "reference": "79ad876c7498c0bbfe7eed065b8651c93bfd6045"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/composer/installers/zipball/d78064c68299743e0161004f2de3a0204e33b804", "url": "https://api.github.com/repos/composer/installers/zipball/79ad876c7498c0bbfe7eed065b8651c93bfd6045",
"reference": "d78064c68299743e0161004f2de3a0204e33b804", "reference": "79ad876c7498c0bbfe7eed065b8651c93bfd6045",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -115,12 +115,16 @@
"keywords": [ "keywords": [
"Craft", "Craft",
"Dolibarr", "Dolibarr",
"Eliasis",
"Hurad", "Hurad",
"ImageCMS", "ImageCMS",
"Kanboard",
"MODX Evo", "MODX Evo",
"Mautic", "Mautic",
"Maya",
"OXID", "OXID",
"Plentymarkets", "Plentymarkets",
"Porto",
"RadPHP", "RadPHP",
"SMF", "SMF",
"Thelia", "Thelia",
@@ -143,9 +147,11 @@
"fuelphp", "fuelphp",
"grav", "grav",
"installer", "installer",
"itop",
"joomla", "joomla",
"kohana", "kohana",
"laravel", "laravel",
"lavalite",
"lithium", "lithium",
"magento", "magento",
"mako", "mako",
@@ -160,6 +166,7 @@
"roundcube", "roundcube",
"shopware", "shopware",
"silverstripe", "silverstripe",
"sydes",
"symfony", "symfony",
"typo3", "typo3",
"wordpress", "wordpress",
@@ -167,7 +174,7 @@
"zend", "zend",
"zikula" "zikula"
], ],
"time": "2016-08-13T20:53:52+00:00" "time": "2017-04-24T06:37:16+00:00"
}, },
{ {
"name": "doctrine/inflector", "name": "doctrine/inflector",
@@ -295,7 +302,7 @@
}, },
{ {
"name": "illuminate/config", "name": "illuminate/config",
"version": "v5.4.17", "version": "v5.4.27",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/config.git", "url": "https://github.com/illuminate/config.git",
@@ -339,16 +346,16 @@
}, },
{ {
"name": "illuminate/container", "name": "illuminate/container",
"version": "v5.4.17", "version": "v5.4.27",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/container.git", "url": "https://github.com/illuminate/container.git",
"reference": "1fc0d2451e23d2ea73c10462d74add4767e2b74c" "reference": "c5b8a02a34a52c307f16922334c355c5eef725a6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/container/zipball/1fc0d2451e23d2ea73c10462d74add4767e2b74c", "url": "https://api.github.com/repos/illuminate/container/zipball/c5b8a02a34a52c307f16922334c355c5eef725a6",
"reference": "1fc0d2451e23d2ea73c10462d74add4767e2b74c", "reference": "c5b8a02a34a52c307f16922334c355c5eef725a6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -378,20 +385,20 @@
], ],
"description": "The Illuminate Container package.", "description": "The Illuminate Container package.",
"homepage": "https://laravel.com", "homepage": "https://laravel.com",
"time": "2017-03-13T14:14:19+00:00" "time": "2017-05-24T14:15:53+00:00"
}, },
{ {
"name": "illuminate/contracts", "name": "illuminate/contracts",
"version": "v5.4.17", "version": "v5.4.27",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/contracts.git", "url": "https://github.com/illuminate/contracts.git",
"reference": "ab2825726bee46a67c8cc66789852189dbef74a9" "reference": "31f0193eb14aa3ee07841dc254081425616e79f0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/contracts/zipball/ab2825726bee46a67c8cc66789852189dbef74a9", "url": "https://api.github.com/repos/illuminate/contracts/zipball/31f0193eb14aa3ee07841dc254081425616e79f0",
"reference": "ab2825726bee46a67c8cc66789852189dbef74a9", "reference": "31f0193eb14aa3ee07841dc254081425616e79f0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -420,20 +427,20 @@
], ],
"description": "The Illuminate Contracts package.", "description": "The Illuminate Contracts package.",
"homepage": "https://laravel.com", "homepage": "https://laravel.com",
"time": "2017-03-29T13:17:47+00:00" "time": "2017-04-19T20:17:43+00:00"
}, },
{ {
"name": "illuminate/events", "name": "illuminate/events",
"version": "v5.4.17", "version": "v5.4.27",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/events.git", "url": "https://github.com/illuminate/events.git",
"reference": "e8337bde9cc65409d5fa7548ff11d360a4b4ae2b" "reference": "ebdca3b0305e9fc954afb9e422c4559482cd11e6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/events/zipball/e8337bde9cc65409d5fa7548ff11d360a4b4ae2b", "url": "https://api.github.com/repos/illuminate/events/zipball/ebdca3b0305e9fc954afb9e422c4559482cd11e6",
"reference": "e8337bde9cc65409d5fa7548ff11d360a4b4ae2b", "reference": "ebdca3b0305e9fc954afb9e422c4559482cd11e6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -465,20 +472,20 @@
], ],
"description": "The Illuminate Events package.", "description": "The Illuminate Events package.",
"homepage": "https://laravel.com", "homepage": "https://laravel.com",
"time": "2017-03-16T14:12:50+00:00" "time": "2017-05-02T12:57:00+00:00"
}, },
{ {
"name": "illuminate/filesystem", "name": "illuminate/filesystem",
"version": "v5.4.17", "version": "v5.4.27",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/filesystem.git", "url": "https://github.com/illuminate/filesystem.git",
"reference": "3ed8b9a35880a9619141e2965fd5cbbe2e1c0da1" "reference": "e0ee832f625fbfadb816a972655b1a66af1a5bda"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/filesystem/zipball/3ed8b9a35880a9619141e2965fd5cbbe2e1c0da1", "url": "https://api.github.com/repos/illuminate/filesystem/zipball/e0ee832f625fbfadb816a972655b1a66af1a5bda",
"reference": "3ed8b9a35880a9619141e2965fd5cbbe2e1c0da1", "reference": "e0ee832f625fbfadb816a972655b1a66af1a5bda",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -515,20 +522,20 @@
], ],
"description": "The Illuminate Filesystem package.", "description": "The Illuminate Filesystem package.",
"homepage": "https://laravel.com", "homepage": "https://laravel.com",
"time": "2017-03-01T21:44:04+00:00" "time": "2017-05-18T14:37:58+00:00"
}, },
{ {
"name": "illuminate/support", "name": "illuminate/support",
"version": "v5.4.17", "version": "v5.4.27",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/support.git", "url": "https://github.com/illuminate/support.git",
"reference": "c7e7c9daf5044e76b46085b8351f8235a3e979c6" "reference": "a42393b56d0ec75f55e760f2a47bcf85a17a278d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/support/zipball/c7e7c9daf5044e76b46085b8351f8235a3e979c6", "url": "https://api.github.com/repos/illuminate/support/zipball/a42393b56d0ec75f55e760f2a47bcf85a17a278d",
"reference": "c7e7c9daf5044e76b46085b8351f8235a3e979c6", "reference": "a42393b56d0ec75f55e760f2a47bcf85a17a278d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -572,20 +579,20 @@
], ],
"description": "The Illuminate Support package.", "description": "The Illuminate Support package.",
"homepage": "https://laravel.com", "homepage": "https://laravel.com",
"time": "2017-03-28T12:49:45+00:00" "time": "2017-06-15T12:35:32+00:00"
}, },
{ {
"name": "illuminate/view", "name": "illuminate/view",
"version": "v5.4.17", "version": "v5.4.27",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/view.git", "url": "https://github.com/illuminate/view.git",
"reference": "45932749b21aeee7a5f60601a2ceafb36d032a94" "reference": "423652ea1c4c4c2f6494bd6b8cfb6eb943c5ba75"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/view/zipball/45932749b21aeee7a5f60601a2ceafb36d032a94", "url": "https://api.github.com/repos/illuminate/view/zipball/423652ea1c4c4c2f6494bd6b8cfb6eb943c5ba75",
"reference": "45932749b21aeee7a5f60601a2ceafb36d032a94", "reference": "423652ea1c4c4c2f6494bd6b8cfb6eb943c5ba75",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -620,7 +627,7 @@
], ],
"description": "The Illuminate View package.", "description": "The Illuminate View package.",
"homepage": "https://laravel.com", "homepage": "https://laravel.com",
"time": "2017-03-30T14:26:45+00:00" "time": "2017-06-07T13:32:57+00:00"
}, },
{ {
"name": "paragonie/random_compat", "name": "paragonie/random_compat",
@@ -717,18 +724,70 @@
], ],
"time": "2016-10-10T12:19:37+00:00" "time": "2016-10-10T12:19:37+00:00"
}, },
{
"name": "roots/sage-lib",
"version": "9.0.0-beta.3",
"source": {
"type": "git",
"url": "https://github.com/roots/sage-lib.git",
"reference": "d7789609eae857e910812cf62ae55355b836ad58"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/roots/sage-lib/zipball/d7789609eae857e910812cf62ae55355b836ad58",
"reference": "d7789609eae857e910812cf62ae55355b836ad58",
"shasum": ""
},
"require": {
"composer/installers": "~1.0",
"illuminate/config": "~5.4",
"illuminate/view": "~5.4",
"php": ">=5.6.4"
},
"require-dev": {
"squizlabs/php_codesniffer": "^2.8.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Roots\\Sage\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ben Word",
"email": "ben@benword.com",
"homepage": "https://github.com/retlehs"
},
{
"name": "QWp6t",
"email": "hi@qwp6t.me",
"homepage": "https://github.com/qwp6t"
}
],
"description": "Library files for Sage Starter Theme",
"homepage": "https://roots.io/sage/",
"keywords": [
"wordpress"
],
"time": "2017-07-09T11:48:17+00:00"
},
{ {
"name": "soberwp/controller", "name": "soberwp/controller",
"version": "dev-master", "version": "dev-master",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/soberwp/controller.git", "url": "https://github.com/soberwp/controller.git",
"reference": "6b3a28840845261822cdc31c2359db6901e9e209" "reference": "e9358ff900d6065f5252a114fb187403fbc594ec"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/soberwp/controller/zipball/6b3a28840845261822cdc31c2359db6901e9e209", "url": "https://api.github.com/repos/soberwp/controller/zipball/e9358ff900d6065f5252a114fb187403fbc594ec",
"reference": "6b3a28840845261822cdc31c2359db6901e9e209", "reference": "e9358ff900d6065f5252a114fb187403fbc594ec",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -767,20 +826,20 @@
"keywords": [ "keywords": [
"wordpress" "wordpress"
], ],
"time": "2017-06-12 18:41:19" "time": "2017-06-25T13:13:49+00:00"
}, },
{ {
"name": "symfony/debug", "name": "symfony/debug",
"version": "v3.2.7", "version": "v3.3.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/debug.git", "url": "https://github.com/symfony/debug.git",
"reference": "56f613406446a4a0a031475cfd0a01751de22659" "reference": "63b85a968486d95ff9542228dc2e4247f16f9743"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/56f613406446a4a0a031475cfd0a01751de22659", "url": "https://api.github.com/repos/symfony/debug/zipball/63b85a968486d95ff9542228dc2e4247f16f9743",
"reference": "56f613406446a4a0a031475cfd0a01751de22659", "reference": "63b85a968486d95ff9542228dc2e4247f16f9743",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -791,13 +850,12 @@
"symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
}, },
"require-dev": { "require-dev": {
"symfony/class-loader": "~2.8|~3.0",
"symfony/http-kernel": "~2.8|~3.0" "symfony/http-kernel": "~2.8|~3.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.2-dev" "dev-master": "3.3-dev"
} }
}, },
"autoload": { "autoload": {
@@ -824,20 +882,20 @@
], ],
"description": "Symfony Debug Component", "description": "Symfony Debug Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-03-28T21:38:24+00:00" "time": "2017-07-05T13:02:37+00:00"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v3.2.7", "version": "v3.3.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",
"reference": "b20900ce5ea164cd9314af52725b0bb5a758217a" "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/b20900ce5ea164cd9314af52725b0bb5a758217a", "url": "https://api.github.com/repos/symfony/finder/zipball/baea7f66d30854ad32988c11a09d7ffd485810c4",
"reference": "b20900ce5ea164cd9314af52725b0bb5a758217a", "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -846,7 +904,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.2-dev" "dev-master": "3.3-dev"
} }
}, },
"autoload": { "autoload": {
@@ -873,20 +931,20 @@
], ],
"description": "Symfony Finder Component", "description": "Symfony Finder Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-03-20T09:32:19+00:00" "time": "2017-06-01T21:01:25+00:00"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v3.3.2", "version": "v3.3.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "9752a30000a8ca9f4b34b5227d15d0101b96b063" "reference": "1f93a8d19b8241617f5074a123e282575b821df8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/9752a30000a8ca9f4b34b5227d15d0101b96b063", "url": "https://api.github.com/repos/symfony/yaml/zipball/1f93a8d19b8241617f5074a123e282575b821df8",
"reference": "9752a30000a8ca9f4b34b5227d15d0101b96b063", "reference": "1f93a8d19b8241617f5074a123e282575b821df8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -928,22 +986,185 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-06-02T22:05:06+00:00" "time": "2017-06-15T12:58:50+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
{ {
"name": "squizlabs/php_codesniffer", "name": "illuminate/console",
"version": "2.8.1", "version": "v5.4.27",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git", "url": "https://github.com/illuminate/console.git",
"reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d" "reference": "bdc5c6f53cb474e2aeec46b6a9999fcedfb62a4e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", "url": "https://api.github.com/repos/illuminate/console/zipball/bdc5c6f53cb474e2aeec46b6a9999fcedfb62a4e",
"reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", "reference": "bdc5c6f53cb474e2aeec46b6a9999fcedfb62a4e",
"shasum": ""
},
"require": {
"illuminate/contracts": "5.4.*",
"illuminate/support": "5.4.*",
"nesbot/carbon": "~1.20",
"php": ">=5.6.4",
"symfony/console": "~3.2"
},
"suggest": {
"guzzlehttp/guzzle": "Required to use the ping methods on schedules (~6.0).",
"mtdowling/cron-expression": "Required to use scheduling component (~1.0).",
"symfony/process": "Required to use scheduling component (~3.2)."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.4-dev"
}
},
"autoload": {
"psr-4": {
"Illuminate\\Console\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Console package.",
"homepage": "https://laravel.com",
"time": "2017-06-10T13:11:18+00:00"
},
{
"name": "nesbot/carbon",
"version": "1.22.1",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc",
"reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"symfony/translation": "~2.6 || ~3.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2",
"phpunit/phpunit": "~4.0 || ~5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.23-dev"
}
},
"autoload": {
"psr-4": {
"Carbon\\": "src/Carbon/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Brian Nesbitt",
"email": "brian@nesbot.com",
"homepage": "http://nesbot.com"
}
],
"description": "A simple API extension for DateTime.",
"homepage": "http://carbon.nesbot.com",
"keywords": [
"date",
"datetime",
"time"
],
"time": "2017-01-16T07:55:07+00:00"
},
{
"name": "roots/sage-installer",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/roots/sage-installer.git",
"reference": "837411acf1337d35e1b497c4ba3a8ed7cf6077fa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/roots/sage-installer/zipball/837411acf1337d35e1b497c4ba3a8ed7cf6077fa",
"reference": "837411acf1337d35e1b497c4ba3a8ed7cf6077fa",
"shasum": ""
},
"require": {
"illuminate/console": "~5.4",
"illuminate/filesystem": "~5.4",
"symfony/process": "~3.3"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.0"
},
"bin": [
"bin/sage"
],
"type": "library",
"autoload": {
"psr-4": {
"Roots\\Sage\\Installer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ben Word",
"email": "ben@benword.com",
"homepage": "https://github.com/retlehs"
},
{
"name": "QWp6t",
"email": "hi@qwp6t.me",
"homepage": "https://github.com/qwp6t"
}
],
"description": "Sage installer.",
"keywords": [
"FontAwesome",
"bootstrap",
"foundation",
"sage",
"tachyons",
"theme",
"wordpress"
],
"time": "2017-07-04T17:57:47+00:00"
},
{
"name": "squizlabs/php_codesniffer",
"version": "2.9.1",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "dcbed1074f8244661eecddfc2a675430d8d33f62"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62",
"reference": "dcbed1074f8244661eecddfc2a675430d8d33f62",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1008,12 +1229,255 @@
"phpcs", "phpcs",
"standards" "standards"
], ],
"time": "2017-03-01T22:17:45+00:00" "time": "2017-05-22T02:43:20+00:00"
},
{
"name": "symfony/console",
"version": "v3.3.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "a97e45d98c59510f085fa05225a1acb74dfe0546"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/a97e45d98c59510f085fa05225a1acb74dfe0546",
"reference": "a97e45d98c59510f085fa05225a1acb74dfe0546",
"shasum": ""
},
"require": {
"php": ">=5.5.9",
"symfony/debug": "~2.8|~3.0",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
"symfony/dependency-injection": "<3.3"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~3.3",
"symfony/dependency-injection": "~3.3",
"symfony/event-dispatcher": "~2.8|~3.0",
"symfony/filesystem": "~2.8|~3.0",
"symfony/http-kernel": "~2.8|~3.0",
"symfony/process": "~2.8|~3.0"
},
"suggest": {
"psr/log": "For using the console logger",
"symfony/event-dispatcher": "",
"symfony/filesystem": "",
"symfony/process": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Console\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2017-07-03T13:19:36+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "f29dca382a6485c3cbe6379f0c61230167681937"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937",
"reference": "f29dca382a6485c3cbe6379f0c61230167681937",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"time": "2017-06-09T14:24:12+00:00"
},
{
"name": "symfony/process",
"version": "v3.3.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "5ab8949b682b1bf9d4511a228b5e045c96758c30"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/5ab8949b682b1bf9d4511a228b5e045c96758c30",
"reference": "5ab8949b682b1bf9d4511a228b5e045c96758c30",
"shasum": ""
},
"require": {
"php": ">=5.5.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Process\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2017-07-03T08:12:02+00:00"
},
{
"name": "symfony/translation",
"version": "v3.3.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "35dd5fb003c90e8bd4d8cabdf94bf9c96d06fdc3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/35dd5fb003c90e8bd4d8cabdf94bf9c96d06fdc3",
"reference": "35dd5fb003c90e8bd4d8cabdf94bf9c96d06fdc3",
"shasum": ""
},
"require": {
"php": ">=5.5.9",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
"symfony/config": "<2.8",
"symfony/yaml": "<3.3"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~2.8|~3.0",
"symfony/intl": "^2.8.18|^3.2.5",
"symfony/yaml": "~3.3"
},
"suggest": {
"psr/log": "To use logging capability in translator",
"symfony/config": "",
"symfony/yaml": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Translation\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"time": "2017-06-24T16:45:30+00:00"
} }
], ],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": { "stability-flags": {
"roots/sage-lib": 10,
"soberwp/controller": 20 "soberwp/controller": 20
}, },
"prefer-stable": false, "prefer-stable": false,

31
config/assets.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Assets Manifest
|--------------------------------------------------------------------------
|
| Your asset manifest is used by Sage to assist WordPress and your views
| with rendering the correct URLs for your assets. This is especially
| useful for statically referencing assets with dynamically changing names
| as in the case of cache-busting.
|
*/
'manifest' => get_theme_file_path().'/dist/assets.json',
/*
|--------------------------------------------------------------------------
| Assets Path URI
|--------------------------------------------------------------------------
|
| The asset manifest contains relative paths to your assets. This URI will
| be prepended when using Sage's asset management system. Change this if
| you are using a CDN.
|
*/
'uri' => get_theme_file_uri().'/dist',
];

32
config/theme.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Theme Directory
|--------------------------------------------------------------------------
|
| This is the absolute path to your theme directory.
|
| Example:
| /srv/www/example.com/current/web/app/themes/sage
|
*/
'dir' => get_theme_file_path(),
/*
|--------------------------------------------------------------------------
| Theme Directory URI
|--------------------------------------------------------------------------
|
| This is the web server URI to your theme directory.
|
| Example:
| https://example.com/app/themes/sage
|
*/
'uri' => get_theme_file_uri(),
];

51
config/view.php Normal file
View File

@@ -0,0 +1,51 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most template systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views.
|
*/
'paths' => [
get_theme_file_path().'/resources/views',
get_parent_theme_file_path().'/resources/views',
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the uploads
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => wp_upload_dir()['basedir'].'/cache',
/*
|--------------------------------------------------------------------------
| View Namespaces
|--------------------------------------------------------------------------
|
| Blade has an underutilized feature that allows developers to add
| supplemental view paths that may contain conflictingly named views.
| These paths are prefixed with a namespace to get around the conflicts.
| A use case might be including views from within a plugin folder.
|
*/
'namespaces' => [
/* Given the below example, in your views use something like: @include('WC::some.view.or.partial.here') */
// 'WC' => WP_PLUGIN_DIR.'/woocommerce/templates/',
],
];

9705
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -22,52 +22,108 @@
"android 4", "android 4",
"opera 12" "opera 12"
], ],
"eslintConfig": {
"root": true,
"extends": "eslint:recommended",
"globals": {
"wp": true
},
"env": {
"node": true,
"es6": true,
"amd": true,
"browser": true,
"jquery": true
},
"parserOptions": {
"ecmaFeatures": {
"globalReturn": true,
"generators": false,
"objectLiteralDuplicateProperties": false,
"experimentalObjectRestSpread": true
},
"ecmaVersion": 2017,
"sourceType": "module"
},
"plugins": [
"import"
],
"settings": {
"import/core-modules": [],
"import/ignore": [
"node_modules",
"\\.(coffee|scss|css|less|hbs|svg|json)$"
]
},
"rules": {
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "ignore"
}
]
}
},
"stylelint": {
"extends": "stylelint-config-standard",
"rules": {
"no-empty-source": null
}
},
"scripts": { "scripts": {
"build": "webpack --progress --config resources/assets/build/webpack.config.js", "build": "webpack --progress --config resources/assets/build/webpack.config.js",
"build:production": "webpack --progress -p --config resources/assets/build/webpack.config.js", "build:production": "webpack --progress -p --config resources/assets/build/webpack.config.js",
"build:profile": "webpack --progress --profile --json --config resources/assets/build/webpack.config.js", "build:profile": "webpack --progress --profile --json --config resources/assets/build/webpack.config.js",
"start": "webpack --hide-modules --watch --config resources/assets/build/webpack.config.js", "start": "webpack --hide-modules --watch --config resources/assets/build/webpack.config.js",
"rmdist": "rimraf dist", "rmdist": "rimraf dist",
"lint": "eslint resources/assets/scripts resources/assets/build", "lint": "npm run -s lint:scripts && npm run -s lint:styles",
"test": "yarn run lint" "lint:scripts": "eslint resources/assets/scripts resources/assets/build",
"lint:styles": "stylelint resources/assets/styles/**/*.{css,sass,scss,sss,less}",
"test": "npm run -s lint"
}, },
"engines": { "engines": {
"node": ">= 6.9.4" "node": ">= 6.9.4"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^7.1.1", "autoprefixer": "~7.1",
"browser-sync": "^2.18.8", "browser-sync": "~2.18",
"browsersync-webpack-plugin": "^0.5.3", "browsersync-webpack-plugin": "^0.6.0",
"bs-html-injector": "^3.0.3", "bs-html-injector": "~3.0",
"buble-loader": "^0.4.1", "buble-loader": "^0.4.1",
"cache-loader": "~1.0",
"clean-webpack-plugin": "^0.1.16", "clean-webpack-plugin": "^0.1.16",
"copy-globs-webpack-plugin": "^0.2.0", "copy-globs-webpack-plugin": "^0.2.0",
"css-loader": "^0.28.0", "css-loader": "^0.28.4",
"cssnano": "^3.10.0", "cssnano": "~4.0.0-rc.1",
"eslint": "^3.19.0", "eslint": "~4.2",
"eslint-loader": "^1.7.1", "eslint-loader": "~1.9",
"eslint-plugin-import": "^2.2.0", "eslint-plugin-import": "~2.7",
"extract-text-webpack-plugin": "^2.1.0", "extract-text-webpack-plugin": "~3.0",
"file-loader": "^0.11.1", "file-loader": "^0.11.2",
"imagemin-mozjpeg": "^6.0.0", "imagemin-mozjpeg": "~6.0",
"imagemin-webpack-plugin": "^1.4.4", "imagemin-webpack-plugin": "~1.5.0-beta.0",
"node-sass": "^4.5.1", "import-glob": "~1.5",
"optimize-css-assets-webpack-plugin": "^1.3.1", "node-sass": "~4.5",
"postcss-loader": "^1.3.3", "postcss-loader": "~2.0",
"resolve-url-loader": "^2.0.2", "postcss-safe-parser": "~3.0",
"rimraf": "^2.6.1", "resolve-url-loader": "~2.1",
"sass-loader": "^6.0.3", "rimraf": "~2.6",
"style-loader": "^0.16.0", "sass-loader": "~6.0",
"stylelint": "^7.10.1", "style-loader": "^0.18.2",
"stylelint-config-standard": "^16.0.0", "stylelint": "~7.12",
"stylelint-webpack-plugin": "^0.5.1", "stylelint-config-standard": "~16.0",
"url-loader": "^0.5.8", "stylelint-webpack-plugin": "^0.8.0",
"webpack": "^2.4.1", "url-loader": "^0.5.9",
"webpack-assets-manifest": "^0.6.2", "webpack": "~3.3",
"webpack-dev-middleware": "^1.10.1", "webpack-assets-manifest": "^0.7.0",
"webpack-hot-middleware": "^2.18.0", "webpack-dev-middleware": "~1.11",
"webpack-merge": "^4.1.0", "webpack-hot-middleware": "~2.18",
"yargs": "^7.1.0" "webpack-merge": "~4.1",
"yargs": "~8.0"
}, },
"dependencies": { "dependencies": {
"bootstrap": "^4.0.0-alpha.6", "bootstrap": "^4.0.0-alpha.6",

View File

@@ -2,7 +2,9 @@ const path = require('path');
const { argv } = require('yargs'); const { argv } = require('yargs');
const merge = require('webpack-merge'); const merge = require('webpack-merge');
const userConfig = require('../config'); const desire = require('./util/desire');
const userConfig = merge(desire(`${__dirname}/../config`), desire(`${__dirname}/../config-local`));
const isProduction = !!((argv.env && argv.env.production) || argv.p); const isProduction = !!((argv.env && argv.env.production) || argv.p);
const rootPath = (userConfig.paths && userConfig.paths.root) const rootPath = (userConfig.paths && userConfig.paths.root)
@@ -10,6 +12,7 @@ const rootPath = (userConfig.paths && userConfig.paths.root)
: process.cwd(); : process.cwd();
const config = merge({ const config = merge({
open: true,
copy: 'images/**/*', copy: 'images/**/*',
proxyUrl: 'http://localhost:3000', proxyUrl: 'http://localhost:3000',
cacheBusting: '[name]_[hash]', cacheBusting: '[name]_[hash]',
@@ -33,6 +36,10 @@ module.exports = merge(config, {
manifest: {}, manifest: {},
}); });
if (process.env.NODE_ENV === undefined) {
process.env.NODE_ENV = isProduction ? 'production' : 'development';
}
/** /**
* If your publicPath differs between environments, but you know it at compile time, * If your publicPath differs between environments, but you know it at compile time,
* then set SAGE_DIST_PATH as an environment variable before compiling. * then set SAGE_DIST_PATH as an environment variable before compiling.
@@ -50,4 +57,4 @@ if (process.env.SAGE_DIST_PATH) {
* wp_localize_script('sage/main.js', 'SAGE_DIST_PATH', get_theme_file_uri('dist/')) * wp_localize_script('sage/main.js', 'SAGE_DIST_PATH', get_theme_file_uri('dist/'))
*/ */
// Object.keys(module.exports.entry).forEach(id => // Object.keys(module.exports.entry).forEach(id =>
// module.exports.entry[id].unshift(path.join(__dirname, 'public-path.js'))); // module.exports.entry[id].unshift(path.join(__dirname, 'helpers/public-path.js')));

View File

@@ -0,0 +1,7 @@
const hotMiddlewareScript = require('webpack-hot-middleware/client?noInfo=true&timeout=20000&reload=true');
hotMiddlewareScript.subscribe(event => {
if (event.action === 'reload') {
window.location.reload();
}
});

View File

@@ -0,0 +1,15 @@
/* eslint-disable */
const cssnanoConfig = {
preset: ['default', { discardComments: { removeAll: true } }]
};
module.exports = ({ file, options }) => {
return {
parser: options.enabled.optimize ? 'postcss-safe-parser' : undefined,
plugins: {
cssnano: options.enabled.optimize ? cssnanoConfig : false,
autoprefixer: true,
},
};
};

View File

@@ -6,11 +6,10 @@
*/ */
module.exports = (entry) => { module.exports = (entry) => {
const results = {}; const results = {};
const hotMiddlewareScript = 'webpack-hot-middleware/client?timeout=20000&reload=true';
Object.keys(entry).forEach((name) => { Object.keys(entry).forEach((name) => {
results[name] = Array.isArray(entry[name]) ? entry[name].slice(0) : [entry[name]]; results[name] = Array.isArray(entry[name]) ? entry[name].slice(0) : [entry[name]];
results[name].unshift(hotMiddlewareScript); results[name].unshift(`${__dirname}/../helpers/hmr-client.js`);
}); });
return results; return results;
}; };

View File

@@ -0,0 +1,14 @@
/**
* @export
* @param {string} dependency
* @param {any} [fallback]
* @return {any}
*/
module.exports = (dependency, fallback) => {
try {
require.resolve(dependency);
} catch (err) {
return fallback;
}
return require(dependency); // eslint-disable-line import/no-dynamic-require
};

View File

@@ -2,16 +2,14 @@
const webpack = require('webpack'); const webpack = require('webpack');
const merge = require('webpack-merge'); const merge = require('webpack-merge');
const autoprefixer = require('autoprefixer');
const CleanPlugin = require('clean-webpack-plugin'); const CleanPlugin = require('clean-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin');
const StyleLintPlugin = require('stylelint-webpack-plugin'); const StyleLintPlugin = require('stylelint-webpack-plugin');
const CopyGlobsPlugin = require('copy-globs-webpack-plugin'); const CopyGlobsPlugin = require('copy-globs-webpack-plugin');
const config = require('./config'); const config = require('./config');
const assetsFilenames = (config.enabled.cacheBusting) ? config.cacheBusting : '[name]'; const assetsFilenames = (config.enabled.cacheBusting) ? config.cacheBusting : '[name]';
const sourceMapQueryStr = (config.enabled.sourceMaps) ? '+sourceMap' : '-sourceMap';
let webpackConfig = { let webpackConfig = {
context: config.paths.assets, context: config.paths.assets,
@@ -22,29 +20,56 @@ let webpackConfig = {
publicPath: config.publicPath, publicPath: config.publicPath,
filename: `scripts/${assetsFilenames}.js`, filename: `scripts/${assetsFilenames}.js`,
}, },
stats: {
hash: false,
version: false,
timings: false,
children: false,
errors: false,
errorDetails: false,
warnings: false,
chunks: false,
modules: false,
reasons: false,
source: false,
publicPath: false,
},
module: { module: {
rules: [ rules: [
{ {
enforce: 'pre', enforce: 'pre',
test: /\.js?$/, test: /\.js$/,
include: config.paths.assets, include: config.paths.assets,
use: 'eslint', use: 'eslint',
}, },
{
enforce: 'pre',
test: /\.(js|s?[ca]ss)$/,
include: config.paths.assets,
loader: 'import-glob',
},
{ {
test: /\.js$/, test: /\.js$/,
exclude: [/(node_modules|bower_components)(?![/|\\](bootstrap|foundation-sites))/], exclude: [/(node_modules|bower_components)(?![/|\\](bootstrap|foundation-sites))/],
loader: 'buble', use: [
options: { objectAssign: 'Object.assign' }, { loader: 'cache' },
{ loader: 'buble', options: { objectAssign: 'Object.assign' } },
],
}, },
{ {
test: /\.css$/, test: /\.css$/,
include: config.paths.assets, include: config.paths.assets,
use: ExtractTextPlugin.extract({ use: ExtractTextPlugin.extract({
fallback: 'style', fallback: 'style',
publicPath: '../',
use: [ use: [
`css?${sourceMapQueryStr}`, { loader: 'cache' },
'postcss', { loader: 'css', options: { sourceMap: config.enabled.sourceMaps } },
{
loader: 'postcss', options: {
config: { path: __dirname, ctx: config },
sourceMap: config.enabled.sourceMaps,
},
},
], ],
}), }),
}, },
@@ -53,39 +78,37 @@ let webpackConfig = {
include: config.paths.assets, include: config.paths.assets,
use: ExtractTextPlugin.extract({ use: ExtractTextPlugin.extract({
fallback: 'style', fallback: 'style',
publicPath: '../',
use: [ use: [
`css?${sourceMapQueryStr}`, { loader: 'cache' },
'postcss', { loader: 'css', options: { sourceMap: config.enabled.sourceMaps } },
`resolve-url?${sourceMapQueryStr}`, {
`sass?${sourceMapQueryStr}`, loader: 'postcss', options: {
config: { path: __dirname, ctx: config },
sourceMap: config.enabled.sourceMaps,
},
},
{ loader: 'resolve-url', options: { sourceMap: config.enabled.sourceMaps } },
{ loader: 'sass', options: { sourceMap: config.enabled.sourceMaps } },
], ],
}), }),
}, },
{ {
test: /\.(ttf|eot|png|jpe?g|gif|svg|ico)$/, test: /\.(ttf|eot|woff2?|png|jpe?g|gif|svg|ico)$/,
include: config.paths.assets,
loader: 'file',
options: {
name: `[path]${assetsFilenames}.[ext]`,
},
},
{
test: /\.woff2?$/,
include: config.paths.assets, include: config.paths.assets,
loader: 'url', loader: 'url',
options: { options: {
limit: 10000, limit: 4096,
mimetype: 'application/font-woff',
name: `[path]${assetsFilenames}.[ext]`, name: `[path]${assetsFilenames}.[ext]`,
}, },
}, },
{ {
test: /\.(ttf|eot|woff2?|png|jpe?g|gif|svg)$/, test: /\.(ttf|eot|woff2?|png|jpe?g|gif|svg|ico)$/,
include: /node_modules|bower_components/, include: /node_modules|bower_components/,
loader: 'file', loader: 'url',
options: { options: {
name: `vendor/${config.cacheBusting}.[ext]`, limit: 4096,
outputPath: 'vendor/',
name: `${config.cacheBusting}.[ext]`,
}, },
}, },
], ],
@@ -141,9 +164,6 @@ let webpackConfig = {
options: { options: {
output: { path: config.paths.dist }, output: { path: config.paths.dist },
context: config.paths.assets, context: config.paths.assets,
postcss: [
autoprefixer(),
],
}, },
}), }),
new webpack.LoaderOptionsPlugin({ new webpack.LoaderOptionsPlugin({
@@ -153,7 +173,7 @@ let webpackConfig = {
}, },
}), }),
new StyleLintPlugin({ new StyleLintPlugin({
failOnError: ! config.enabled.watcher, failOnError: !config.enabled.watcher,
syntax: 'scss', syntax: 'scss',
}), }),
], ],

View File

@@ -1,23 +1,12 @@
'use strict'; // eslint-disable-line 'use strict'; // eslint-disable-line
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const { default: ImageminPlugin } = require('imagemin-webpack-plugin'); const { default: ImageminPlugin } = require('imagemin-webpack-plugin');
const imageminMozjpeg = require('imagemin-mozjpeg'); const imageminMozjpeg = require('imagemin-mozjpeg');
const cssnano = require('cssnano');
const config = require('./config'); const config = require('./config');
module.exports = { module.exports = {
plugins: [ plugins: [
new OptimizeCssAssetsPlugin({
cssProcessor: cssnano,
cssProcessorOptions: {
discardComments: { removeAll: true },
autoprefixer: {},
safe: true,
},
canPrint: true,
}),
new ImageminPlugin({ new ImageminPlugin({
optipng: { optimizationLevel: 7 }, optipng: { optimizationLevel: 7 },
gifsicle: { optimizationLevel: 3 }, gifsicle: { optimizationLevel: 3 },

View File

@@ -26,6 +26,7 @@ module.exports = {
new webpack.NoEmitOnErrorsPlugin(), new webpack.NoEmitOnErrorsPlugin(),
new BrowserSyncPlugin({ new BrowserSyncPlugin({
target, target,
open: config.open,
proxyUrl: config.proxyUrl, proxyUrl: config.proxyUrl,
watch: config.watch, watch: config.watch,
delay: 500, delay: 500,

View File

@@ -13,6 +13,9 @@
"proxyUrl": "http://localhost:3000", "proxyUrl": "http://localhost:3000",
"cacheBusting": "[name]_[hash:8]", "cacheBusting": "[name]_[hash:8]",
"watch": [ "watch": [
"{app,resources/views}/**/*.php" "app/**/*.php",
"config/**/*.php",
"resources/controllers/**/*.php",
"resources/views/**/*.php"
] ]
} }

View File

@@ -0,0 +1 @@
import 'bootstrap';

View File

@@ -1,25 +1,24 @@
/** import external dependencies */ // import external dependencies
import 'jquery'; import 'jquery';
import 'bootstrap';
/** import local dependencies */ // Import everything from autoload
import "./autoload/**/*"
// import local dependencies
import Router from './util/Router'; import Router from './util/Router';
import common from './routes/common'; import common from './routes/common';
import home from './routes/home'; import home from './routes/home';
import aboutUs from './routes/about'; import aboutUs from './routes/about';
/** /** Populate Router instance with DOM routes */
* Populate Router instance with DOM routes
* @type {Router} routes - An instance of our router
*/
const routes = new Router({ const routes = new Router({
/** All pages */ // All pages
common, common,
/** Home page */ // Home page
home, home,
/** About Us page, note the change from about-us to aboutUs. */ // About Us page, note the change from about-us to aboutUs.
aboutUs, aboutUs,
}); });
/** Load Events */ // Load Events
jQuery(document).ready(() => routes.loadEvents()); jQuery(document).ready(() => routes.loadEvents());

View File

@@ -1,27 +1,45 @@
/* ========================================================================
* DOM-based Routing
* Based on http://goo.gl/EUTi53 by Paul Irish
*
* Only fires on body classes that match. If a body class contains a dash,
* replace the dash with an underscore when adding it to the object below.
* ======================================================================== */
import camelCase from './camelCase'; import camelCase from './camelCase';
// The routing fires all common scripts, followed by the page specific scripts. /**
// Add additional events for more control over timing e.g. a finalize event * DOM-based Routing
export default class Router { *
* Based on {@link http://goo.gl/EUTi53|Markup-based Unobtrusive Comprehensive DOM-ready Execution} by Paul Irish
*
* The routing fires all common scripts, followed by the page specific scripts.
* Add additional events for more control over timing e.g. a finalize event
*/
class Router {
/**
* Create a new Router
* @param {Object} routes
*/
constructor(routes) { constructor(routes) {
this.routes = routes; this.routes = routes;
} }
fire(route, fn = 'init', args) { /**
const fire = route !== '' && this.routes[route] && typeof this.routes[route][fn] === 'function'; * Fire Router events
* @param {string} route DOM-based route derived from body classes (`<body class="...">`)
* @param {string} [event] Events on the route. By default, `init` and `finalize` events are called.
* @param {string} [arg] Any custom argument to be passed to the event.
*/
fire(route, event = 'init', arg) {
const fire = route !== '' && this.routes[route] && typeof this.routes[route][event] === 'function';
if (fire) { if (fire) {
this.routes[route][fn](args); this.routes[route][event](arg);
} }
} }
/**
* Automatically load and fire Router events
*
* Events are fired in the following order:
* * common init
* * page-specific init
* * page-specific finalize
* * common finalize
*/
loadEvents() { loadEvents() {
// Fire common init JS // Fire common init JS
this.fire('common'); this.fire('common');
@@ -41,3 +59,5 @@ export default class Router {
this.fire('common', 'finalize'); this.fire('common', 'finalize');
} }
} }
export default Router

View File

@@ -1,4 +1,8 @@
// the most terrible camelizer on the internet, guaranteed! /**
* the most terrible camelizer on the internet, guaranteed!
* @param {string} str String that isn't camel-case, e.g., CAMeL_CaSEiS-harD
* @return {string} String converted to camel-case, e.g., camelCaseIsHard
*/
export default str => `${str.charAt(0).toLowerCase()}${str.replace(/[\W_]/g, '|').split('|') export default str => `${str.charAt(0).toLowerCase()}${str.replace(/[\W_]/g, '|').split('|')
.map(part => `${part.charAt(0).toUpperCase()}${part.slice(1)}`) .map(part => `${part.charAt(0).toUpperCase()}${part.slice(1)}`)
.join('') .join('')

View File

@@ -0,0 +1 @@
@import "~bootstrap/scss/bootstrap";

View File

@@ -1 +0,0 @@
// Base styles

View File

@@ -1,4 +1,2 @@
// Variables /** Colors */
// Colors
$brand-primary: #27ae60; $brand-primary: #27ae60;

View File

@@ -1 +0,0 @@
// Buttons

View File

@@ -1,4 +1,3 @@
// Comments
.comment-list { .comment-list {
@extend .list-unstyled; @extend .list-unstyled;
} }

View File

@@ -1,4 +1,4 @@
// Search form /** Search form */
.search-form { .search-form {
@extend .form-inline; @extend .form-inline;
} }

View File

@@ -1,7 +1,9 @@
// WordPress Generated Classes /**
// http://codex.wordpress.org/CSS#WordPress_Generated_Classes * WordPress Generated Classes
* @see http://codex.wordpress.org/CSS#WordPress_Generated_Classes
*/
// Media alignment /** Media alignment */
.alignnone { .alignnone {
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
@@ -22,7 +24,6 @@
} }
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
// Only float if not on an extra small device
.alignleft { .alignleft {
float: left; float: left;
margin-right: ($spacer / 2); margin-right: ($spacer / 2);
@@ -34,7 +35,7 @@
} }
} }
// Captions /** Captions */
.wp-caption { .wp-caption {
@extend .figure; @extend .figure;
} }
@@ -48,7 +49,7 @@
@extend .figure-caption; @extend .figure-caption;
} }
// Text meant only for screen readers /** Text meant only for screen readers */
.screen-reader-text { .screen-reader-text {
@extend .sr-only; @extend .sr-only;
@extend .sr-only-focusable; @extend .sr-only-focusable;

View File

@@ -1 +0,0 @@
// Footer

View File

@@ -1,4 +1,3 @@
// Header
.banner .nav li { .banner .nav li {
@extend .nav-item; @extend .nav-item;
} }

View File

@@ -1 +0,0 @@
// Pages

View File

@@ -1 +0,0 @@
// Posts

View File

@@ -1 +0,0 @@
// Sidebar

View File

@@ -1,5 +1,3 @@
// TinyMCE Editor styles
body#tinymce { body#tinymce {
margin: 12px !important; margin: 12px !important;
} }

View File

@@ -1,9 +1,17 @@
@import "common/variables"; @import "common/variables";
// Import npm dependencies /** Import everything from autoload */
@import "~bootstrap/scss/bootstrap"; @import "./autoload/**/*";
// Import theme styles /**
* Import npm dependencies
*
* Prefix your imports with `~` to grab from node_modules/
* @see https://github.com/webpack-contrib/sass-loader#imports
*/
// @import "~some-node-module";
/** Import theme styles */
@import "common/global"; @import "common/global";
@import "components/buttons"; @import "components/buttons";
@import "components/comments"; @import "components/comments";

View File

@@ -4,6 +4,9 @@
* Do not edit anything in this file unless you know what you're doing * Do not edit anything in this file unless you know what you're doing
*/ */
use Roots\Sage\Config;
use Roots\Sage\Container;
/** /**
* Helper function for prettying up errors * Helper function for prettying up errors
* @param string $message * @param string $message
@@ -74,21 +77,16 @@ array_map(function ($file) use ($sage_error) {
* ├── STYLESHEETPATH -> /srv/www/example.com/current/web/app/themes/sage/resources/views * ├── STYLESHEETPATH -> /srv/www/example.com/current/web/app/themes/sage/resources/views
* └── TEMPLATEPATH -> /srv/www/example.com/current/web/app/themes/sage/resources * └── TEMPLATEPATH -> /srv/www/example.com/current/web/app/themes/sage/resources
*/ */
if (is_customize_preview() && isset($_GET['theme'])) { array_map(
$sage_error(__('Theme must be activated prior to using the customizer.', 'sage')); 'add_filter',
} ['theme_file_path', 'theme_file_uri', 'parent_theme_file_path', 'parent_theme_file_uri'],
$sage_views = basename(dirname(__DIR__)).'/'.basename(__DIR__).'/views'; array_fill(0, 4, 'dirname')
add_filter('stylesheet', function () use ($sage_views) { );
return dirname($sage_views); Container::getInstance()
}); ->bindIf('config', function () {
add_filter('stylesheet_directory_uri', function ($uri) { return new Config([
return dirname($uri); 'assets' => require dirname(__DIR__).'/config/assets.php',
}); 'theme' => require dirname(__DIR__).'/config/theme.php',
if ($sage_views !== get_option('stylesheet')) { 'view' => require dirname(__DIR__).'/config/view.php',
update_option('stylesheet', $sage_views); ]);
if (php_sapi_name() === 'cli') { }, true);
return;
}
wp_redirect($_SERVER['REQUEST_URI']);
exit();
}

View File

@@ -11,7 +11,7 @@
@endif @endif
@while (have_posts()) @php(the_post()) @while (have_posts()) @php(the_post())
@include ('partials.content-'.(get_post_type() === 'post' ?: get_post_type())) @include('partials.content-'.get_post_type())
@endwhile @endwhile
{!! get_the_posts_navigation() !!} {!! get_the_posts_navigation() !!}

12994
yarn.lock

File diff suppressed because it is too large Load Diff