Merge pull request #1869 from roots/src-to-app

Rename src/ to app/
This commit is contained in:
Ben Word
2017-04-03 22:16:37 -06:00
committed by GitHub
18 changed files with 17 additions and 16 deletions

View File

@@ -1,4 +1,5 @@
### HEAD
* Move `src/` to `app/` ([#1868](https://github.com/roots/sage/pull/1868))
* Move `templates/` to `resources/views/`, move `assets/` to `resources/assets/`, rename `base.blade.php` to `app.blade.php` ([#1864](https://github.com/roots/sage/pull/1864))
* Add option to configure build settings ([#1822](https://github.com/roots/sage/pull/1822))
* Add support for HTML injection ([#1817](https://github.com/roots/sage/pull/1817))

View File

@@ -53,7 +53,13 @@ During theme installation you will have the options to:
```shell
themes/your-theme-name/ # → Root of your Sage based theme
├── composer.json # → Autoloading for `src/` files
├── app/ # → Theme PHP
│   ├── lib/Sage/ # → Blade implementation, asset manifest
│   ├── admin.php # → Theme customizer setup
│   ├── filters.php # → Theme filters
│   ├── helpers.php # → Helper functions
│   └── setup.php # → Theme setup
├── composer.json # → Autoloading for `app/` files
├── composer.lock # → Composer lock file (never edit)
├── dist/ # → Built theme assets (never edit)
├── functions.php # → Composer autoloader, theme includes
@@ -61,12 +67,6 @@ themes/your-theme-name/ # → Root of your Sage based theme
├── node_modules/ # → Node.js packages (never edit)
├── package.json # → Node.js dependencies and scripts
├── screenshot.png # → Theme screenshot for WP admin
├── src/ # → Theme PHP
│   ├── lib/Sage/ # → Blade implementation, asset manifest
│   ├── admin.php # → Theme customizer setup
│   ├── filters.php # → Theme filters
│   ├── helpers.php # → Helper functions
│   └── setup.php # → Theme setup
├── style.css # → Theme meta information
├── resources/ # → Theme assets and templates
├── ├── assets/ # → Front-end assets
@@ -84,7 +84,7 @@ themes/your-theme-name/ # → Root of your Sage based theme
## Theme setup
Edit `src/setup.php` to enable or disable theme features, setup navigation menus, post thumbnail sizes, and sidebars.
Edit `app/setup.php` to enable or disable theme features, setup navigation menus, post thumbnail sizes, and sidebars.
## Theme development
@@ -134,14 +134,14 @@ If you are not using [Bedrock](https://roots.io/bedrock/), update `publicPath` t
By default, Browsersync will use webpack's [HMR](https://webpack.github.io/docs/hot-module-replacement.html), which won't trigger a page reload in your browser.
If you would like to force Browsersync to reload the page whenever certain file types are edited, then add them to `watch` in `assets/config.json`.
If you would like to force Browsersync to reload the page whenever certain file types are edited, then add them to `watch` in `resources/assets/config.json`.
```json
...
"watch": [
"assets/scripts/**/*.js",
"templates/**/*.php",
"src/**/*.php"
"resources/assets/scripts/**/*.js",
"resources/views/**/*.php",
"app/**/*.php"
],
...
```

View File

@@ -25,7 +25,7 @@
},
"autoload": {
"psr-4": {
"Roots\\Sage\\": "src/lib/Sage/"
"Roots\\Sage\\": "app/lib/Sage/"
}
},
"require": {

View File

@@ -51,7 +51,7 @@ if (!class_exists('Roots\\Sage\\Container')) {
* Add or remove files to the array as needed. Supports child theme overrides.
*/
array_map(function ($file) use ($sage_error) {
$file = "src/{$file}.php";
$file = "app/{$file}.php";
if (!locate_template($file, true, true)) {
$sage_error(sprintf(__('Error locating <code>%s</code> for inclusion.', 'sage'), $file), 'File not found');
}

View File

@@ -5,7 +5,7 @@
<!-- Scan these files -->
<file>functions.php</file>
<file>index.php</file>
<file>src</file>
<file>app</file>
<file>resources/views</file>
<!-- Show colors in console -->

View File

@@ -13,7 +13,7 @@
"proxyUrl": "http://localhost:3000",
"cacheBusting": "[name]_[hash:8]",
"watch": [
"{src,resources/views}/**/*.php"
"{app,resources/views}/**/*.php"
],
"browsers": [
"last 2 versions",