Skip to content

Commit

Permalink
Merge pull request #56 from dreamsicle-io/release/4.0.0
Browse files Browse the repository at this point in the history
Release/4.0.0
  • Loading branch information
theenoahmason committed May 29, 2024
2 parents 132b3dc + f8baaf1 commit df32d09
Show file tree
Hide file tree
Showing 57 changed files with 1,088 additions and 1,039 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lock files

/package/package-lock.json
/package/composer.lock
/package/composer.lock
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": "3.1.3",
"version": "4.0.0",
"description": "WP Theme Assets",
"repository": {
"type": "git",
Expand Down
26 changes: 17 additions & 9 deletions package/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
{
"extends": [
"plugin:@wordpress/eslint-plugin/recommended"
],
"env": {
"browser": true
},
"extends": [
"eslint:recommended"
"ignorePatterns": [
"build/**",
"vendor/**",
"node_modules/**/*",
"package-lock.json",
"composer.lock"
],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"overrides": [
{
"files": "./gulpfile.js",
"files": ["./webpack.config.js"],
"env": {
"node": true
}
}
],
"rules": {
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }]
"eol-last": ["error", "always"],
"no-console": [
"error",
{
"allow": ["info", "warn", "error"]
}
]
}
}

13 changes: 12 additions & 1 deletion package/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ jobs:
release:
runs-on: ubuntu-latest
steps:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- name: Checkout Repo
id: checkout_repo
Expand All @@ -23,11 +22,23 @@ jobs:
- name: Set Theme Version
id: set_theme_version
run: echo "THEME_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV

# Gets the PHP version from composer.json and sets it as an environment variable.
- name: Set PHP Version
id: set_php_version
run: echo "PHP_VERSION=$(jq -r '.require["php"]' composer.json) >> $GITHUB_ENV

# Gets the Node version from .nvmrc and sets it as an environment variable.
- name: Set Node Version
id: set_node_version
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV

# Setup PHP.
- name: Setup PHP
id: setup_php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}

# Setup Node.
- name: Setup Node
Expand Down
4 changes: 2 additions & 2 deletions package/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

# Build

/assets/dist
/build
/languages/*.pot
/README.md
/README.txt
/style.css
/*.zip

Expand Down
3 changes: 3 additions & 0 deletions package/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Disable the Prettier config that comes bundled with wp-scripts.

**
28 changes: 19 additions & 9 deletions package/.stylelintrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
{
"extends": [
"stylelint-config-standard-scss"
"@wordpress/stylelint-config/scss"
],
"ignoreFiles": [
"build/**",
"node_modules/**",
"vendor/**"
],
"rules": {
"color-hex-case": "upper",
"color-hex-length": "long",
"color-named": "never",
"declaration-no-important": true,
"font-weight-notation": "numeric",
"no-empty-source": null,
"declaration-empty-line-before": null,
"rule-empty-line-before": "always",
"selector-class-pattern": null,
"number-max-precision": 5
"at-rule-empty-line-before": [
"always",
{
"except": [
"first-nested",
"blockless-after-blockless"
],
"ignoreAtRules": [
"else"
]
}
]
}
}
41 changes: 11 additions & 30 deletions package/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,28 @@
{
"[php]": {
"editor.defaultFormatter": "wongjn.php-sniffer",
"editor.formatOnSave": true,
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"editor.defaultFormatter": "wongjn.php-sniffer",
"editor.formatOnSave": true
},
"[javascript][typescript][javascriptreact][typescriptreact]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"[json]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"[css][scss]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
"source.fixAll.stylelint": "explicit"
}
},
"[css]": {
"editor.defaultFormatter": "stylelint.vscode-stylelint",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": "explicit"
}
},
"[scss]": {
"editor.defaultFormatter": "stylelint.vscode-stylelint",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": "explicit"
}
},
"files.insertFinalNewline": true,
"files.eol": "\n",
"eslint.validate": ["js", "jsx", "ts", "tsx", "mjs"],
"eslint.enable": true,
"eslint.format.enable": true,
"stylelint.enable": true,
"stylelint.validate": [
"scss",
"css"
],
"stylelint.validate": ["scss", "css"],
"phpSniffer.run": "onType",
"phpSniffer.autoDetect": true,
"phpSniffer.onTypeDelay": 500,
"intelephense.environment.phpVersion": "8.1.23",
"intelephense.environment.phpVersion": "8",
"intelephense.format.braces": "k&r",
"intelephense.stubs": [
"apache",
Expand Down
142 changes: 142 additions & 0 deletions package/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# WP Theme

Just another WordPress site.

## Getting Started

### Set the node version

```shell
nvm use
```

### Install dependencies

```shell
npm install
```

### Run a development build and watch for changes

```shell
npm start
```

### Run a production build

```shell
npm run build
```

## Development Commands

The theme's build and lint system is powered by Webpack, wp-scripts, and wp-cli.

### Set Node Version

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

```shell
nvm use
```

### Install

Install all `npm` and `composer` dependencies.

```shell
npm install
```

### Start

Run a development build and watch for changes.

```shell
npm start
```

### Build

Run a production build.

```shell
npm run build
```

### Lint

Lint all files with phpcs, eslint, and stylelint.

```shell
npm run lint
```

### fix

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

```shell
npm run fix
```

## Build File Structure

This gulp setup expects that the project root's `package.json` is setup properly, and that an opinionated file structure is followed.

### Source Files

```
root
―――― /src
―――― ―――― /js
―――― ―――― ―――― /modules
―――― ―――― ―――― site.js
―――― ―――― ―――― admin.js
―――― ―――― ―――― login.js
―――― ―――― ―――― customizer-preview.js
―――― ―――― ―――― customizer-controls.js
―――― ―――― /scss
―――― ―――― ―――― /modules
―――― ―――― ―――― site.scss
―――― ―――― ―――― admin.scss
―――― ―――― ―――― login.scss
―――― ―――― ―――― editor.scss
―――― ―――― ―――― customizer-preview.scss
―――― ―――― ―――― customizer-controls.scss
```

### Build Files

```
root
―――― /build
―――― ―――― /js
―――― ―――― ―――― site.min.js
―――― ―――― ―――― site.min.js.map
―――― ―――― ―――― admin.min.js
―――― ―――― ―――― admin.min.js.map
―――― ―――― ―――― login.min.js
―――― ―――― ―――― login.min.js.map
―――― ―――― ―――― customizer-preview.min.js
―――― ―――― ―――― customizer-preview.min.js.map
―――― ―――― ―――― customizer-controls.min.js
―――― ―――― ―――― customizer-controls.min.js.map
―――― ―――― /css
―――― ―――― ―――― site.min.css
―――― ―――― ―――― site.min.css.map
―――― ―――― ―――― admin.min.css
―――― ―――― ―――― admin.min.css.map
―――― ―――― ―――― login.min.css
―――― ―――― ―――― login.min.css.map
―――― ―――― ―――― editor.min.css
―――― ―――― ―――― editor.min.css.map
―――― ―――― ―――― customizer-preview.min.css
―――― ―――― ―――― customizer-preview.min.css.map
―――― ―――― ―――― customizer-controls.min.css
―――― ―――― ―――― customizer-controls.min.css.map
―――― /languages
―――― ―――― {textdomain}.pot
―――― README.txt
―――― style.css
```
4 changes: 0 additions & 4 deletions package/assets/src/images/expand.svg

This file was deleted.

3 changes: 0 additions & 3 deletions package/assets/src/js/modules/utils.js

This file was deleted.

3 changes: 0 additions & 3 deletions package/assets/src/md/CHANGELOG.md

This file was deleted.

3 changes: 0 additions & 3 deletions package/assets/src/md/COPYRIGHT.md

This file was deleted.

3 changes: 0 additions & 3 deletions package/assets/src/md/DESCRIPTION.md

This file was deleted.

3 changes: 0 additions & 3 deletions package/assets/src/md/FAQ.md

This file was deleted.

10 changes: 0 additions & 10 deletions package/assets/src/sass/_functions.scss

This file was deleted.

Loading

0 comments on commit df32d09

Please sign in to comment.