Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
updated PR for postcss-preset-env
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Wright committed Jun 14, 2018
2 parents 8ed5aa3 + 34c8b00 commit 14ac67d
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 31 deletions.
3 changes: 1 addition & 2 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Browsers that we support

> 0.5%
> 1%
last 2 versions
Firefox ESR
not dead
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,30 @@ We don't know everything! We welcome pull requests and spirited, but respectful,
3. Commit your changes: `git commit -am 'Added some great feature!'`
4. Push to the branch: `git push origin feature/my-new-feature`
5. Submit a pull request

## Learn more about the default packages used with this project

- [Babel core](https://www.npmjs.com/package/babel-core)
- [Babel eslint](https://www.npmjs.com/package/babel-eslint)
- [Babel loader](https://www.npmjs.com/package/babel-loader)
- [Babel preset env](https://www.npmjs.com/package/babel-preset-env)
- [Browserslist](https://www.npmjs.com/package/browserslist)
- [Can I Use DB](https://www.npmjs.com/package/caniuse-db)
- [Del](https://www.npmjs.com/package/del)
- [Eslint](https://www.npmjs.com/package/eslint)
- [Eslint loader](https://www.npmjs.com/package/eslint-loader)
- [Gulp](https://www.npmjs.com/package/gulp)
- [Gulp CSSNano](https://www.npmjs.com/package/gulp-cssnano)
- [Gulp filter](https://www.npmjs.com/package/gulp-filter)
- [Gulp Live Reload](https://www.npmjs.com/package/gulp-livereload)
- [Gulp PostCSS](https://www.npmjs.com/package/gulp-postcss)
- [Gulp Rename](https://www.npmjs.com/package/gulp-rename)
- [Gulp Sourcemaps](https://www.npmjs.com/package/gulp-sourcemaps)
- [PostCSS CSSNext](https://www.npmjs.com/package/gulp-postcss)
- [PostCSS Import](https://www.npmjs.com/package/postcss-import)
- [Pump](https://www.npmjs.com/package/pump)
- [Require DIR](https://www.npmjs.com/package/require-dir)
- [Run Sequence](https://www.npmjs.com/package/run-sequence)
- [Webpack](https://www.npmjs.com/package/webpack)
- [Webpack CLI](https://www.npmjs.com/package/webpack-cli)
- [Webpack Stream](https://www.npmjs.com/package/webpack-stream)
1 change: 1 addition & 0 deletions gulp-tasks/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ gulp.task( 'css', ( cb ) => {
'./assets/css/shared/shared-style.css'
];
const fileDest = './dist';

const cssOpts = {
stage: 0
};
Expand Down
6 changes: 6 additions & 0 deletions gulp-tasks/setenv.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import gulp from 'gulp';

gulp.task( 'set-prod-node-env', ( cb ) => {
process.env.NODE_ENV = 'production';
cb();
} );
8 changes: 5 additions & 3 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ gulp.task( 'js', () => {
);
} );

gulp.task( 'css', () => {
gulp.task( 'cssprocess', () => {
runSequence(
'css',
'cssnano',
Expand All @@ -20,14 +20,16 @@ gulp.task( 'css', () => {
} );

gulp.task( 'watch', () => {
process.env.NODE_ENV = 'development';
livereload.listen( { basePath: 'dist' } );
gulp.watch( ['./assets/css/**/*.css', '!./assets/css/src/**/*.css'], ['css'] );
gulp.watch( ['./assets/css/**/*.css', '!./assets/css/src/**/*.css'], ['cssprocess'] );
gulp.watch( './assets/js/**/*.js', ['js'] );
} );

gulp.task( 'default', () => {
runSequence(
'css',
'set-prod-node-env',
'cssprocess',
'webpack'
);
} );
16 changes: 7 additions & 9 deletions includes/functions/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,17 @@ function admin_styles() {
}

/**
* Enqueue editor styles
* Enqueue editor styles. Filters the comma-delimited list of stylesheets to load in TinyMCE.
*
* @param string $stylesheets Comma-delimited list of stylesheets.
* @return string
*/
function mce_css( $stylesheets ) {

function style_url() {

return TENUP_SCAFFOLD_URL . ( ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ?
"assets/css/frontend/editor-style.css" :
"dist/css/editor-style.min.css" );

if ( ! empty( $stylesheets ) ) {
$stylesheets .= ',';
}

return $stylesheets . ',' . style_url();
return $stylesheets . TENUP_SCAFFOLD_URL . ( ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ?
'assets/css/frontend/editor-style.css' :
'dist/css/editor-style.min.css' );
}
27 changes: 16 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenup-scaffold",
"name": "plugin-scaffold",
"version": "1.0.0",
"description": "10up Scaffold",
"description": "10up Plugin Scaffold",
"author": {
"name": "10up",
"email": "info@10up.com",
Expand All @@ -17,31 +17,36 @@
},
"repository": {
"type": "git",
"url": "https://project-git-repo.tld"
"url": "https://github.com/10up/plugin-scaffold"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-core": "^6.26.3",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.1.3",
"babel-preset-env": "^1.6.1",
"caniuse-db": "^1.0.30000798",
"babel-preset-env": "^1.7.0",
"browserslist": "^3.2.8",
"caniuse-db": "^1.0.30000855",
"del": "^3.0.0",
"eslint": "^4.18.2",
"eslint": "^4.19.1",
"eslint-loader": "^2.0.0",
"gulp": "^3.9.1",
"gulp-cssnano": "^2.1.2",
"gulp-cssnano": "^2.1.3",
"gulp-filter": "^5.1.0",
"gulp-livereload": "^3.8.1",
"gulp-postcss": "^7.0.1",
"gulp-rename": "^1.2.2",
"gulp-rename": "^1.3.0",
"gulp-sourcemaps": "^2.6.4",
"postcss-import": "^10.0.0",
"postcss-preset-env": "^5.1.0",
"pump": "^1.0.3",
"require-dir": "^0.3.2",
"run-sequence": "^1.2.2",
"webpack": "^4.0.1",
"webpack-cli": "^2.0.10",
"webpack": "^4.12.0",
"webpack-cli": "^2.1.5",
"webpack-stream": "^3.2.0"
},
"engineStrict": true,
"engines": {
"node": "~8.11"
}
}
11 changes: 6 additions & 5 deletions tests/phpunit/test-tools/Core_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ public function test_setup() {
*/
public function test_i18n() {
// Setup
\WP_Mock::wpFunction( 'get_locale', array(
\WP_Mock::userFunction( 'get_locale', array(
'times' => 1,
'args' => array(),
'return' => 'en_US',
) );
\WP_Mock::onFilter( 'plugin_locale' )->with( 'en_US', 'tenup-scaffold' )->reply( 'en_US' );
\WP_Mock::wpFunction( 'load_textdomain', array(
\WP_Mock::userFunction( 'load_textdomain', array(
'times' => 1,
'args' => array( 'tenup-scaffold', 'lang_dir/tenup-scaffold/tenup-scaffold-en_US.mo' ),
) );
\WP_Mock::wpFunction( 'plugin_basename', array(
\WP_Mock::userFunction( 'plugin_basename', array(
'times' => 1,
'args' => array( 'path' ),
'return' => 'path',
) );
\WP_Mock::wpFunction( 'load_plugin_textdomain', array(
\WP_Mock::userFunction( 'load_plugin_textdomain', array(
'times' => 1,
'args' => array( 'tenup-scaffold', false, 'path/languages/' ),
) );
Expand Down Expand Up @@ -88,7 +88,7 @@ public function test_init() {
*/
public function test_activate() {
// Setup
\WP_Mock::wpFunction( 'flush_rewrite_rules', array(
\WP_Mock::userFunction( 'flush_rewrite_rules', array(
'times' => 1
) );

Expand All @@ -109,5 +109,6 @@ public function test_deactivate() {
deactivate();

// Verify
$this->assertTrue( true ); // Replace with actual assertion
}
}
2 changes: 1 addition & 1 deletion webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const config = {
}
]
},
mode: 'production',
mode: process.env.NODE_ENV,
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
],
Expand Down

0 comments on commit 14ac67d

Please sign in to comment.