assets/ -> resources/assets/

This commit is contained in:
Ben Word
2017-04-03 18:33:06 -06:00
parent 700a556c02
commit c3e6f1324e
35 changed files with 21 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
### HEAD ### HEAD
* Move `templates/` to `resources/views/`, rename `base.blade.php` to `app.blade.php`, ([#1864](https://github.com/roots/sage/pull/1864)) * 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 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)) * Add support for HTML injection ([#1817](https://github.com/roots/sage/pull/1817))

View File

@@ -18,12 +18,12 @@
} }
], ],
"scripts": { "scripts": {
"build": "webpack --progress --config assets/build/webpack.config.js", "build": "webpack --progress --config resources/assets/build/webpack.config.js",
"build:production": "webpack --progress -p --config assets/build/webpack.config.js", "build:production": "webpack --progress -p --config resources/assets/build/webpack.config.js",
"build:profile": "webpack --progress --profile --json --config assets/build/webpack.config.js", "build:profile": "webpack --progress --profile --json --config resources/assets/build/webpack.config.js",
"start": "webpack --hide-modules --watch --config 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 assets/scripts assets/build", "lint": "eslint resources/assets/scripts resources/assets/build",
"test": "yarn run lint" "test": "yarn run lint"
}, },
"engines": { "engines": {

View File

@@ -15,7 +15,7 @@ const config = merge({
cacheBusting: '[name]_[hash]', cacheBusting: '[name]_[hash]',
paths: { paths: {
root: rootPath, root: rootPath,
assets: path.join(rootPath, 'assets'), assets: path.join(rootPath, 'resources/assets'),
dist: path.join(rootPath, 'dist'), dist: path.join(rootPath, 'dist'),
}, },
enabled: { enabled: {

View File

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

View File

@@ -41,10 +41,10 @@ class PostCreateProject
$default_framework_pattern = '"bootstrap": ".*"'; $default_framework_pattern = '"bootstrap": ".*"';
$files_to_clear = [ $files_to_clear = [
'assets/styles/components/_comments.scss', 'resources/assets/styles/components/_comments.scss',
'assets/styles/components/_forms.scss', 'resources/assets/styles/components/_forms.scss',
'assets/styles/components/_wp-classes.scss', 'resources/assets/styles/components/_wp-classes.scss',
'assets/styles/layouts/_header.scss', 'resources/assets/styles/layouts/_header.scss',
]; ];
@@ -61,16 +61,16 @@ class PostCreateProject
break; break;
case 1: 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('package.json', preg_replace("/{$default_framework_pattern}/", '"foundation-sites": "6.3.0"', file_get_contents('package.json')));
file_put_contents('assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '@import "~foundation-sites/scss/foundation";' . "\n" . '@include foundation-everything;' . "\n", file_get_contents('assets/styles/main.scss'))); 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('assets/scripts/main.js', str_replace("import 'bootstrap';\n", "import 'foundation-sites/dist/js/foundation';\n", file_get_contents('assets/scripts/main.js'))); 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')));
foreach($files_to_clear as $file) { foreach($files_to_clear as $file) {
file_put_contents($file, ''); file_put_contents($file, '');
} }
break; break;
case 2: case 2:
file_put_contents('package.json', preg_replace("/\s+{$default_framework_pattern},/", '', file_get_contents('package.json'))); file_put_contents('package.json', preg_replace("/\s+{$default_framework_pattern},/", '', file_get_contents('package.json')));
file_put_contents('assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '', file_get_contents('assets/styles/main.scss'))); 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('assets/scripts/main.js', str_replace("import 'bootstrap';\n", '', file_get_contents('assets/scripts/main.js'))); file_put_contents('resources/assets/scripts/main.js', str_replace("import 'bootstrap';\n", '', file_get_contents('resources/assets/scripts/main.js')));
foreach($files_to_clear as $file) { foreach($files_to_clear as $file) {
file_put_contents($file, ''); file_put_contents($file, '');
} }
@@ -93,8 +93,8 @@ class PostCreateProject
file_put_contents('package.json', $package); file_put_contents('package.json', $package);
$import_dep_str = '// Import npm dependencies' . "\n"; $import_dep_str = '// Import npm dependencies' . "\n";
file_put_contents('assets/styles/main.scss', str_replace($import_dep_str, $import_dep_str . '@import "~font-awesome/scss/font-awesome";' . "\n", file_get_contents('assets/styles/main.scss'))); 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('assets/styles/common/_variables.scss', "\n" . '$fa-font-path: \'~font-awesome/fonts\';' . "\n", FILE_APPEND); file_put_contents('resources/assets/styles/common/_variables.scss', "\n" . '$fa-font-path: \'~font-awesome/fonts\';' . "\n", FILE_APPEND);
} }
} }
} }
@@ -116,8 +116,8 @@ class PostCreateProject
'devUrl' => $io->ask('<info>Local development URL of WP site [<comment>'.$browsersync_settings_default['devUrl'].'</comment>]:</info> ', $browsersync_settings_default['devUrl']) 'devUrl' => $io->ask('<info>Local development URL of WP site [<comment>'.$browsersync_settings_default['devUrl'].'</comment>]:</info> ', $browsersync_settings_default['devUrl'])
]; ];
file_put_contents('assets/config.json', str_replace('/app/themes/sage', $browsersync_settings['publicPath'], file_get_contents('assets/config.json'))); 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('assets/config.json', str_replace($browsersync_settings_default['devUrl'], $browsersync_settings['devUrl'], file_get_contents('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 // @codingStandardsIgnoreEnd

View File

@@ -64,7 +64,7 @@ add_action('after_setup_theme', function () {
/** /**
* Use main stylesheet for visual editor * Use main stylesheet for visual editor
* @see assets/styles/layouts/_tinymce.scss * @see resources/assets/styles/layouts/_tinymce.scss
*/ */
add_editor_style(asset_path('styles/main.css')); add_editor_style(asset_path('styles/main.css'));
}, 20); }, 20);