Skip to content

Commit

Permalink
Merge pull request #58 from dreamsicle-io/release/4.1.0-RC4
Browse files Browse the repository at this point in the history
Release/4.1.0 rc4
  • Loading branch information
theenoahmason authored Jun 1, 2024
2 parents db497be + ac977e8 commit b75f05f
Show file tree
Hide file tree
Showing 10 changed files with 199 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- name: Checkout Repo
id: checkout_repo
uses: actions/checkout@v2
uses: actions/checkout@v4

# Gets the version from package.json and sets it as an environment variable.
- name: Set Package Version
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wp-theme-assets",
"version": "4.0.1",
"version": "4.1.0",
"description": "WP Theme Assets",
"repository": {
"type": "git",
Expand Down
6 changes: 4 additions & 2 deletions package/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"browser": true
},
"ignorePatterns": [
"build/**",
"vendor/**",
"build/**/*",
"vendor/**/*",
"node_modules/**/*",
"tmp/**/*",
"package-lock.json",
"composer.lock"
],
Expand All @@ -21,6 +22,7 @@
}
],
"rules": {
"indent": ["error", "tab"],
"eol-last": ["error", "always"],
"no-console": [
"error",
Expand Down
4 changes: 2 additions & 2 deletions package/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- name: Checkout Repo
id: checkout_repo
uses: actions/checkout@v2
uses: actions/checkout@v4

# Gets the name from package.json and sets it as an environment variable.
- name: Set Theme Name
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
# Setup Node.
- name: Setup Node
id: setup_node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

Expand Down
20 changes: 12 additions & 8 deletions package/.gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# Deps

/node_modules
/vendor
node_modules/
vendor/

# Build

/build
/languages/*.pot
/README.txt
/style.css
/*.zip
build/
languages/*.pot
README.txt
style.css
*.zip

# Temporary files

tmp/

# Logs

/logs
logs/
8 changes: 5 additions & 3 deletions package/.stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
"@wordpress/stylelint-config/scss"
],
"ignoreFiles": [
"build/**",
"node_modules/**",
"vendor/**"
"build/**/*",
"node_modules/**/*",
"vendor/**/*",
"tmp/**/*"
],
"rules": {
"indentation": "tab",
"color-hex-case": "upper",
"color-hex-length": "long",
"at-rule-empty-line-before": [
Expand Down
5 changes: 4 additions & 1 deletion package/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
"phpSniffer.run": "onType",
"phpSniffer.autoDetect": true,
"phpSniffer.onTypeDelay": 500,
"intelephense.environment.phpVersion": "8",
"intelephense.environment.phpVersion": "^8",
"intelephense.format.braces": "k&r",
"intelephense.environment.includePaths": [
"../../plugins/wp-backstage"
],
"intelephense.stubs": [
"apache",
"bcmath",
Expand Down
62 changes: 46 additions & 16 deletions package/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WP Theme

Just another WordPress site.
This theme was scaffolded using the [Create WP Theme](https://github.com/dreamsicle-io/create-wp-theme) CLI and the [WP Theme Assets](https://github.com/dreamsicle-io/wp-theme-assets) package.

## Getting Started

Expand All @@ -10,17 +10,23 @@ Just another WordPress site.
nvm use
```

### Install dependencies

```shell
npm install
```

### Run a development build and watch for changes

```shell
npm start
```

## Development Commands
## Development commands

The theme's build and lint system is powered by Webpack, wp-scripts, and wp-cli.
The theme's build system is powered by [Webpack](https://webpack.js.org/), [wp-scripts](https://www.npmjs.com/package/@wordpress/scripts), and [wp-cli](https://wp-cli.org/), while linting and fixing is powered by [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer), [ESLint](https://eslint.org/), and [StyleLint](https://stylelint.io/)

### Set Node Version
### Set Node version

Uses `nvm` to set the node version as defined in the `.nvmrc` file.

Expand All @@ -38,39 +44,63 @@ npm install

### Start

Run a development build and watch for changes. This command will run `npm install` on the `prestart` hook.
Run a development build and watch for changes. This command will watch for changes in `package.json` to generate required `style.css` and `README.txt` headers, as well as generate `*.pot` files.

```shell
npm start
```

### Build

Run a production build.
Run a production build. This command will zip the theme for production, while installing production Composer dependencies and caching development composer dependencies to restore them once zipping the theme has finished.

```shell
npm run build
```

### Lint

Lint all files with phpcs, eslint, and stylelint.
Lint all files with `phpcs`, `eslint`, and `stylelint`.

```shell
npm run lint
```

### fix
### Fix

Fix all fixable issues with phpcbf, eslint, and stylelint.
Fix all fixable issues with `phpcbf`, `eslint`, and `stylelint`.

```shell
npm run fix
```

## Build File Structure
### Clean dependencies

Clean all Composer and npm dependencies, including lock files. This is useful for debugging dependency issues, allowing for all dependencies to be installed fresh and new lock files to be generated.

```shell
npm run clean-deps
```

### Clean build

Clean all built files, including the `/build` directory, the translation `*.pot` file in the `/languages` directory, the `README.txt` file, and the `style.css` file. This command will also clear the `/tmp` file that is used for build utilities, should it be left around for whatever reason.

```shell
npm run clean-build
```

### Clean

Clean all dependencies, and build files.

```shell
npm run clean
```

## File Structure

This Webpack setup expects that the project root's `package.json`, and `composer.json` is setup properly, and that an opinionated file structure is followed.
This Webpack setup expects that the project root's `package.json`, and `composer.json` files are set up properly, and that an opinionated file structure is followed.

### Source Files

Expand All @@ -79,11 +109,11 @@ root
―――― /src
―――― ―――― /js
―――― ―――― ―――― /modules
―――― ―――― ―――― site.js
―――― ―――― ―――― admin.js
―――― ―――― ―――― login.js
―――― ―――― ―――― customizer-preview.js
―――― ―――― ―――― customizer-controls.js
―――― ―――― ―――― site.ts
―――― ―――― ―――― admin.ts
―――― ―――― ―――― login.ts
―――― ―――― ―――― customizer-preview.ts
―――― ―――― ―――― customizer-controls.ts
―――― ―――― /scss
―――― ―――― ―――― /modules
―――― ―――― ―――― site.scss
Expand Down
10 changes: 6 additions & 4 deletions package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@
},
"devDependencies": {
"@wordpress/scripts": "~27.9.0",
"dir-archiver": "~2.1.0",
"archiver": "~7.0.1",
"webpack-remove-empty-scripts": "~1.0.4"
},
"scripts": {
"prepare": "composer update",
"prestart": "npm install",
"prepare": "composer install",
"start": "wp-scripts start --webpack-no-externals --webpack-src-dir='.'",
"build": "wp-scripts build --webpack-no-externals --webpack-src-dir='.'",
"lint": "composer run lint && wp-scripts lint-style && wp-scripts lint-js",
"fix": "composer run fix && wp-scripts lint-style --fix && wp-scripts lint-js --fix"
"fix": "composer run fix && wp-scripts lint-style --fix && wp-scripts lint-js --fix",
"clean-deps": "rm -rf vendor/ node_modules/ composer.lock package-lock.json",
"clean-build": "rm -rf build/ tmp/ README.txt style.css languages/*.pot *.zip",
"clean": "npm run clean-deps && npm run clean-build"
}
}
Loading

0 comments on commit b75f05f

Please sign in to comment.