Skip to content

Commit

Permalink
Merge branch 'trunk' into feature/339-filename-based-entrypoint-for-b…
Browse files Browse the repository at this point in the history
…lock-specific-CSS
  • Loading branch information
fabiankaegy committed Sep 24, 2024
2 parents 290815e + e98f1be commit 43181d0
Show file tree
Hide file tree
Showing 15 changed files with 4,687 additions and 4,611 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ It contains a bare bones theme and must use plugin for you to base your developm

## How to Use

*The best way to use the scaffold is to simply run `npx 10up-toolkit project init` in your terminal.*

You can also use the scaffold manually by doing the following:

1. [Download a zip](https://github.com/10up/wp-scaffold/archive/trunk.zip) of the repository into your project. At 10up, by default we version control the `wp-content` directory (ignoring obvious things like `uploads`). This enables us to have plugins, theme, etc. all in one repository. Having separate repositories for each plugin and theme only happens in rare circumstances that are outside of our control.
2. Take what you need. If your project doesn't have a theme, remove the theme. If your project doesn't need any plugin functionality, remove the MU plugin. If your plugin doesn't need CSS/JS, remove it. If your plugin doesn't need to be translated, remove all the translation functionality.
3. Compiling, minifying, bundling, etc. of JavaScript and CSS is all done by [10up Toolkit](https://github.com/10up/10up-toolkit). 10up Toolkit is included as a dev dependency in both the plugin and theme. If you want to develop on the theme (and vice-versa the plugin), you would navigate to the theme directory in your console and run `npm run start` (after running `npm install` first of course). Inside `package.json` edit `10up-toolkit.devURL` to your local development URL for if you're not using a `.test`. `10up-toolkit.entry` are the paths to CSS/JS files that need to be bundled. Edit these as needed.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
@import url("colors.css");
@import url("media-queries.css");
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,13 @@ public function get_labels() {
$plural_label = $this->get_plural_label();
$singular_label = $this->get_singular_label();

// phpcs:disable -- ignoring template strings without translators placeholder since this is dynamic
// phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment -- ignoring template strings without translators placeholder since this is dynamic
$labels = [
'name' => $plural_label,
// Already translated via get_plural_label().
'singular_name' => $singular_label,
// Already translated via get_singular_label().
'add_new' => sprintf( __( 'Add New %s', 'tenup-plugin' ), $singular_label ),
'add_new_item' => sprintf( __( 'Add New %s', 'tenup-plugin' ), $singular_label ),
'edit_item' => sprintf( __( 'Edit %s', 'tenup-plugin' ), $singular_label ),
'new_item' => sprintf( __( 'New %s', 'tenup-plugin' ), $singular_label ),
Expand All @@ -168,7 +169,7 @@ public function get_labels() {
'menu_name' => $plural_label,
'name_admin_bar' => $singular_label,
];
// phpcs:enable
// phpcs:enable WordPress.WP.I18n.MissingTranslatorsComment

return $labels;
}
Expand Down
8 changes: 6 additions & 2 deletions mu-plugins/10up-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"node": ">=18.0.0"
},
"devDependencies": {
"10up-toolkit": "^6.0.0"
"10up-toolkit": "^6.2.0"
},
"dependencies": {
"prop-types": "^15.7.2"
Expand All @@ -25,6 +25,10 @@
"admin": "./assets/js/admin/admin.js",
"frontend": "./assets/js/frontend/frontend.js",
"shared": "./assets/js/shared/shared.js"
}
},
"paths": {
"globalStylesDir": "../../themes/10up-theme/assets/css/globals/",
"globalMixinsDir": "../../themes/10up-theme/assets/css/globals/mixins/"
}
}
}
Loading

0 comments on commit 43181d0

Please sign in to comment.