diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3fe7eb2..45c5396 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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))
diff --git a/README.md b/README.md
index b6f8a1b..f77cfa2 100644
--- a/README.md
+++ b/README.md
@@ -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"
],
...
```
diff --git a/src/admin.php b/app/admin.php
similarity index 100%
rename from src/admin.php
rename to app/admin.php
diff --git a/src/filters.php b/app/filters.php
similarity index 100%
rename from src/filters.php
rename to app/filters.php
diff --git a/src/helpers.php b/app/helpers.php
similarity index 100%
rename from src/helpers.php
rename to app/helpers.php
diff --git a/src/lib/Sage/Assets/JsonManifest.php b/app/lib/Sage/Assets/JsonManifest.php
similarity index 100%
rename from src/lib/Sage/Assets/JsonManifest.php
rename to app/lib/Sage/Assets/JsonManifest.php
diff --git a/src/lib/Sage/Assets/ManifestInterface.php b/app/lib/Sage/Assets/ManifestInterface.php
similarity index 100%
rename from src/lib/Sage/Assets/ManifestInterface.php
rename to app/lib/Sage/Assets/ManifestInterface.php
diff --git a/src/lib/Sage/Config.php b/app/lib/Sage/Config.php
similarity index 100%
rename from src/lib/Sage/Config.php
rename to app/lib/Sage/Config.php
diff --git a/src/lib/Sage/Container.php b/app/lib/Sage/Container.php
similarity index 100%
rename from src/lib/Sage/Container.php
rename to app/lib/Sage/Container.php
diff --git a/src/lib/Sage/PostCreateProject.php b/app/lib/Sage/PostCreateProject.php
similarity index 100%
rename from src/lib/Sage/PostCreateProject.php
rename to app/lib/Sage/PostCreateProject.php
diff --git a/src/lib/Sage/Template/Blade.php b/app/lib/Sage/Template/Blade.php
similarity index 100%
rename from src/lib/Sage/Template/Blade.php
rename to app/lib/Sage/Template/Blade.php
diff --git a/src/lib/Sage/Template/BladeProvider.php b/app/lib/Sage/Template/BladeProvider.php
similarity index 100%
rename from src/lib/Sage/Template/BladeProvider.php
rename to app/lib/Sage/Template/BladeProvider.php
diff --git a/src/lib/Sage/Template/FileViewFinder.php b/app/lib/Sage/Template/FileViewFinder.php
similarity index 100%
rename from src/lib/Sage/Template/FileViewFinder.php
rename to app/lib/Sage/Template/FileViewFinder.php
diff --git a/src/setup.php b/app/setup.php
similarity index 100%
rename from src/setup.php
rename to app/setup.php
diff --git a/composer.json b/composer.json
index 47b53e0..a57ec66 100644
--- a/composer.json
+++ b/composer.json
@@ -25,7 +25,7 @@
},
"autoload": {
"psr-4": {
- "Roots\\Sage\\": "src/lib/Sage/"
+ "Roots\\Sage\\": "app/lib/Sage/"
}
},
"require": {
diff --git a/functions.php b/functions.php
index 3329747..b2ee7c2 100644
--- a/functions.php
+++ b/functions.php
@@ -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 %s for inclusion.', 'sage'), $file), 'File not found');
}
diff --git a/phpcs.xml b/phpcs.xml
index df22395..e3a334d 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -5,7 +5,7 @@
functions.php
index.php
- src
+ app
resources/views
diff --git a/resources/assets/config.json b/resources/assets/config.json
index cce31fa..6beda62 100644
--- a/resources/assets/config.json
+++ b/resources/assets/config.json
@@ -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",