Skip to content

Commit

Permalink
Merge pull request #12 from tarosky/feature/wp-env
Browse files Browse the repository at this point in the history
Default Changelist
  • Loading branch information
fumikito authored Apr 25, 2024
2 parents 95d7665 + c507136 commit 36a2b47
Show file tree
Hide file tree
Showing 555 changed files with 921 additions and 7,942 deletions.
23 changes: 23 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.browserslistrc
.editorconfig
.eslintrc
.distignore
.git
.github
.gitignore
.node-version
.stylelintrc.json
.wordpress_org
.wp-env.json
node_modules
composer.lock
package-lock.json
phpcs.ruleset.xml
phpunit.xml.dist
README.md
webpack.config.js
wordpress
bin
tests
render-faster.php.bak
readme.txt.bak
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
tab_width = 4

[*.yml]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[{*.txt,wp-config-sample.php}]
end_of_line = crlf
41 changes: 41 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"parser": "@babel/eslint-parser",
"env": {
"browser": true,
"jquery": true
},
"globals": {
"wp": false,
"jQuery": false,
"angular": false,
"Hametuha": true,
"wpApiSettings": false,
"ga": false,
"Hashboard": true,
"Vue": false
},
"extends": [
"plugin:@wordpress/eslint-plugin/recommended-with-formatting"
],
"rules": {
"no-alert": "off",
"prettier/prettier": "off",
"object-shorthand": "off",
"jsdoc/require-jsdoc": "off",
"jsdoc/no-undefined-types": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-sort-props": "off",
"jsdoc/check-tag-names": "off",
"import/order": "off",
"no-prototype-builtins": "off",
"object-curly-newline": "off",
"object-property-newline": "off",
"yoda": "off",
"strict": "off"
},
"settings": {
"react": {
"version": "16.9.0"
}
}
}
164 changes: 164 additions & 0 deletions .github/workflows/wordpress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
name: Deploy Plugin

on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '7.4', '8.0' ] # PHP versions to check.
wp: [ 'latest', '5.9' ] # WordPress version to check.
services:
mysql:
image: mysql:5.7
options: --health-cmd "mysqladmin ping --host 127.0.0.1 --port 3306" --health-interval 20s --health-timeout 10s --health-retries 10
ports:
- 3306/tcp
env:
MYSQL_ROOT_PASSWORD: root
name: WordPress ${{ matrix.wp }} in PHP ${{ matrix.php }} UnitTest
steps:
- uses: actions/checkout@master

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
run: composer install --prefer-dist

- name: Start MySQL
run: sudo systemctl start mysql

- name: Install WordPress
run: bash bin/install-wp-tests.sh wordpress root root 127.0.0.1:3306 ${{ matrix.wp }}

- name: Check PHP Unit
run: composer test

lint:
runs-on: ubuntu-latest
name: WordPress Syntax Check
steps:
- uses: actions/checkout@master

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
run: composer install --prefer-dist

- name: Check PHP syntax
run: composer lint

assets:
name: Check Assets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: '14'

- name: Install NPM Packages
run: npm install

- name: Check JS & CSS syntax
run: npm run lint

pre_release:
name: Create Release
needs: [ test, assets ]
if: contains(github.ref, 'tags/')
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.export.outputs.upload_url }}
steps:
- uses: actions/checkout@master

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release Render Faster ${{ github.ref }}
body: |
Release Render FAster version ${{ github.ref }}.
draft: false
prerelease: false

- name: Export Upload URL
id: export
run: echo "::set-output name=upload_url::${{ steps.create_release.outputs.upload_url }}"

release:
name: Deploy GitHub Release
needs: pre_release
if: contains(github.ref, 'tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Confirm
run: echo ${{ needs.pre_release.outputs.upload_url }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install NPM
uses: actions/setup-node@v1
with:
node-version: '14'

- name: Build package.
run: bash bin/build.sh ${{ github.ref }}

- name: Cleanup package.
run: bash bin/clean.sh

- name: Create Zip
run: zip -r tscf.zip ./

- name: Upload Release Zip
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.pre_release.outputs.upload_url }}
asset_path: ./tscf.zip
asset_name: tscf.zip
asset_content_type: application/zip
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
/node_modules/
npm-debug.log
composer.lock

/wordpress
package-lock.json
/assets/js/dist/
/assets/css/
/assets/lib/
16 changes: 16 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": [
"stylelint-config-wordpress/scss"
],
"rules": {
"value-keyword-case": [ "lower", {
"ignoreProperties": [ "font-family" ]
} ],
"number-leading-zero": null,
"rule-empty-line-before": null,
"declaration-property-unit-whitelist": null,
"selector-class-pattern": null,
"at-rule-empty-line-before": null,
"no-descending-specificity": null
}
}
12 changes: 12 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"core": null,
"plugins": [ "." ],
"themes": [
"https://downloads.wordpress.org/theme/twentytwenty.latest-stable.zip"
],
"config": {
"WP_DEBUG": true,
"SCRIPT_DEBUG": true,
"WP_DEBUG_LOG": true
}
}
9 changes: 5 additions & 4 deletions readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ TSCF - Tarosky Custom Field manager

Contributors: Takahashi_Fumiki, tarosky
Tags: custom field
Requires at least: 4.7.0
Tested up to: 4.9.4
Stable tag: 1.1.5
Requires at least: 5.9.0
Requires PHP: 7.4
Tested up to: 6.5
Stable tag: 1.2.0
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.txt

Expand Down Expand Up @@ -79,4 +80,4 @@ W.I.P

### 1.0.0

* Initial release.
* Initial release.
21 changes: 0 additions & 21 deletions assets/.jshintrc

This file was deleted.

3 changes: 0 additions & 3 deletions assets/css/livepreview.css

This file was deleted.

1 change: 0 additions & 1 deletion assets/css/map/livepreview.css.map

This file was deleted.

Loading

0 comments on commit 36a2b47

Please sign in to comment.