Skip to content

Commit

Permalink
assets/ -> resources/assets/
Browse files Browse the repository at this point in the history
  • Loading branch information
retlehs committed Apr 4, 2017
1 parent a64f6f6 commit 0c559f1
Show file tree
Hide file tree
Showing 34 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
}
],
"scripts": {
"build": "webpack --progress --config assets/build/webpack.config.js",
"build:production": "webpack --progress -p --config assets/build/webpack.config.js",
"build:profile": "webpack --progress --profile --json --config assets/build/webpack.config.js",
"start": "webpack --hide-modules --watch --config 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:profile": "webpack --progress --profile --json --config resources/assets/build/webpack.config.js",
"start": "webpack --hide-modules --watch --config resources/assets/build/webpack.config.js",
"rmdist": "rimraf dist",
"lint": "eslint assets/scripts assets/build",
"lint": "eslint resources/assets/scripts resources/assets/build",
"test": "yarn run lint"
},
"engines": {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const config = merge({
cacheBusting: '[name]_[hash]',
paths: {
root: rootPath,
assets: path.join(rootPath, 'assets'),
assets: path.join(rootPath, 'resources/assets'),
dist: path.join(rootPath, 'dist'),
},
enabled: {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions src/lib/Sage/PostCreateProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public static function selectFramework(Event $event)
$default_framework_pattern = '"bootstrap": ".*"';

$files_to_clear = [
'assets/styles/components/_comments.scss',
'assets/styles/components/_forms.scss',
'assets/styles/components/_wp-classes.scss',
'assets/styles/layouts/_header.scss',
'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',
];


Expand All @@ -61,16 +61,16 @@ public static function selectFramework(Event $event)
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('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('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/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')));
foreach($files_to_clear as $file) {
file_put_contents($file, '');
}
break;
case 2:
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('assets/scripts/main.js', str_replace("import 'bootstrap';\n", '', file_get_contents('assets/scripts/main.js')));
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')));
foreach($files_to_clear as $file) {
file_put_contents($file, '');
}
Expand All @@ -93,8 +93,8 @@ public static function addFontAwesome(Event $event)
file_put_contents('package.json', $package);

$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('assets/styles/common/_variables.scss', "\n" . '$fa-font-path: \'~font-awesome/fonts\';' . "\n", FILE_APPEND);
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);
}
}
}
Expand All @@ -116,8 +116,8 @@ public static function buildOptions(Event $event)
'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('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('/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
Expand Down
2 changes: 1 addition & 1 deletion src/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

/**
* 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'));
}, 20);
Expand Down

0 comments on commit 0c559f1

Please sign in to comment.