At 10up, we strive to provide digital products that yield a top-notch user experience. In order to improve both our efficiency and consistency, we need to standardize what we use and how we use it. This plugin scaffold allows us to share initial set up procedures to make sure all projects can get up and running as quickly as possible while closely adhering to 10up's high quality standards.
- Node >= 8.11 & NPM - Build packages and 3rd party dependencies are managed through NPM, so you will need that installed globally.
- Webpack - Webpack is used to process the JavaScript, CSS, and other assets.
- Composer - Composer is used to manage PHP.
Install 10up's command line tool for scaffolding new projects. You can download it from the Project Scaffold repository. Setting up a new plugin is as easy as running create-10up plugin plugin-name-here
in the terminal!
Browsersync requires a local development URL. This is currently set in the package.json
, as proxyUrl
.
- Clone the repository
- Rename folder plugin-scaffold -> your project's name
- If copying files manually to an existing plugin directory instead of cloning directly from the repository, make sure to include the following files which may be hidden:
.babelrc
.browserslistrc
.editorconfig
.eslintignore
.eslintrc
.gitignore
The NPM commands will fail without these files present.
-
Do case-sensitive search/replace for the following:
- TenUpScaffold
- TENUP_SCAFFOLD
- tenup-scaffold
- tenup_scaffold
-
cd
into the plugin folder -
run
npm run start
to build the front-end assets
Webpack config files can be found in config
folder:
webpack.config.dev.js
webpack.config.common.js
webpack.config.prod.js
webpack.settings.js
In most cases webpack.settings.js
is the main file which would change from project to project. For example adding or removing entry points for JS and CSS.
npm run test
(runs phpunit)npm run start
(install dependencies)npm run watch
(watch)npm run build
(build all files)npm run build-release
(build all files for release)npm run dev
(build all files for development)npm run lint-release
(install dependencies and run linting)npm run lint-css
(lint CSS)npm run lint-js
(lint JS)npm run lint-php
(lint PHP)npm run lint
(run all lints)npm run format-js
(format JS using eslint)npm run format
(alias fornpm run format-js
)npm run test-a11y
(run accessibility tests)
composer lint
(lint PHP files)
composer lint-fix
(lint PHP files and automatically correct coding standard violations)
We don't know everything! We welcome pull requests and spirited, but respectful, debates. Please contribute via pull requests on GitHub.
- Fork it!
- Create your feature branch:
git checkout -b feature/my-new-feature
- Commit your changes:
git commit -am 'Added some great feature!'
- Push to the branch:
git push origin feature/my-new-feature
- Submit a pull request
- 10up Eslint config
- 10up Stylelint config
- Babel core
- Babel Eslint
- Babel loader
- Babel preset env
- Babel register
- Browsersync
- Browsersync Webpack plugin
- Browserslist
- Can I Use DB
- Clean Webpack plugin
- Copy Webpack plugin
- CSS loader
- CSS nano
- Eslint
- Eslint loader
- Husky@next
- Imagemin plugin for Webpack
- Lint Staged
- Mini CSS extract plugin
- PostCSS Import
- PostCSS loader
- PostCSS preset-env
- Stylelint
- Stylelint config WordPress
- Stylelint declaration use variable
- Stylelint order
- Stylelint Webpack plugin
- Terser
- Webpack
- Webpack CLI
- Webpack fix style only entries
- Webpack merge
- Webpackbar
- PHPCS
An answer to that question.
Active: 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.