Skip to content

Commit

Permalink
Merge pull request #5722 from pods-framework/release/2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark authored Oct 18, 2021
2 parents bbe5a84 + 30eea68 commit 6f79abd
Show file tree
Hide file tree
Showing 1,222 changed files with 320,095 additions and 87,147 deletions.
36 changes: 29 additions & 7 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
{
"presets": [ "env" ],
"plugins": [
[ "module-resolver", {
"alias": { "pods-dfv": "./ui/js/pods-dfv" }
} ],
"transform-html-import-to-string"
]
"presets": [
[ "@babel/preset-env" ],
[ "@babel/preset-react" ]
],
"plugins": [
[
"babel-plugin-module-resolver",
{
"alias": {
"dfv": "./ui/js/dfv"
}
}
],
"babel-plugin-transform-html-import-to-string",
"@babel/plugin-transform-strict-mode",
"@babel/plugin-proposal-optional-chaining"
],
"env": {
"development": {
"presets": [
[ "@babel/preset-react", { "development": true } ]
]
},
"production": {
"plugins": [
"transform-react-remove-prop-types"
]
}
}
}
63 changes: 63 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Custom vars for Pods.
PODS_LOAD_DATA=true
PODS_REBUILD_DATA=false

# This file will be consumed by both the CI and the tests.
# Some environment variables might not apply to one but might apply to the other: modify with care.

# What version of WordPress we want to install and test against.
# This has to be compatible with the `wp core download` command, see https://developer.wordpress.org/cli/commands/core/download/.
# WP_VERSION=latest # NOTE: Already defined in .travis.yml matrix.

# A space-separated list of plugin repositories that will be cloned in the WordPress installation folder and that are
# required for the plugin tests.
# E.g. "acme/plugin-one acme/plugin-two pirates/plugin-three".
# This value will be used in a bash array declaration to iterate and clone the plugins one by one; validate locally the
# format of this array using this bash command after exporting the var:
# declare -a plugins=(`echo ${REQUIRED_PLUGIN_REPOS}`); for p in "${plugins[@]}"; do echo "$p"; done
REQUIRED_PLUGIN_REPOS=""

# This is where, in the context of the CI, we'll install and configure WordPress.
# See `.travis.yml` for more information.
WP_ROOT_FOLDER=/tmp/wordpress

# The WordPress installation will be served from the Docker container.
# See `dev/docker/ci-compose.yml` for more information.
WP_URL=http://localhost:8080
WP_DOMAIN=localhost:8080

# The credentials that will be used to access the site in acceptance tests
# in methods like `$I->loginAsAdmin();`.
WP_ADMIN_USERNAME=admin
WP_ADMIN_PASSWORD=password

WP_DB_PORT=4306

# The database is served from the Docker `db` container.
# See `dev/docker/ci-compose.yml` for more information.
WP_TABLE_PREFIX=wp_
WP_DB_HOST=127.0.0.1:4306
WP_DB_NAME=wordpress
WP_DB_USER=root
WP_DB_PASSWORD=

# The test database is served from the Docker `db` container.
# See `dev/docker/ci-compose.yml` for more information.
WP_TEST_DB_HOST=127.0.0.1:4306
WP_TEST_DB_NAME=test
WP_TEST_DB_USER=root
WP_TEST_DB_PASSWORD=

# We're using Selenium and Chrome for acceptance testing.
# In CI context we're starting a Docker container to handle that.
# See the `dev/docker/ci-compose.yml` file.
CHROMEDRIVER_HOST=localhost
CHROMEDRIVER_PORT=4444

# The URL of the WordPress installation from the point of view of the Chromedriver container.
# Why not just use `wordpress`? While Chrome will accept an `http://wordpress` address WordPress
# will not, we call the WordPress container with a seemingly looking legit URL and leverage the
# lines that, in the `wp-config.php` file, will make it so that WordPress will use as its home
# URL whatever URL we reach it with.
# See the `dev/docker/wp-config.php` template for more information.
WP_CHROMEDRIVER_URL="wp.test"
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
WP_ROOT_FOLDER="/Users/you/Local Sites/test-pods-dev/app/public"
WP_DOMAIN="test.pods.dev"
WP_URL="http://test.pods.dev"
WP_ADMIN_USERNAME="admin"
WP_ADMIN_PASSWORD="password"
DB_HOST="192.168.95.100:1234"
DB_NAME="local"
DB_USER="root"
DB_PASSWORD="root"
TEST_DB_HOST="192.168.95.100:1234"
TEST_DB_NAME="local"
TEST_DB_USER="root"
TEST_DB_PASSWORD="root"
PODS_LOAD_DATA=true
PODS_REBUILD_DATA=false
66 changes: 66 additions & 0 deletions .env.testing.tric
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Custom vars for Pods.
PODS_LOAD_DATA=true
PODS_REBUILD_DATA=false

# This file will be consumed by both the CI and the tests.
# Some environment variables might not apply to one but might apply to the other: modify with care.

# What version of WordPress we want to install and test against.
# This has to be compatible with the `wp core download` command, see https://developer.wordpress.org/cli/commands/core/download/.
# WP_VERSION=latest # NOTE: Already defined in .travis.yml matrix.

# A space-separated list of plugin repositories that will be cloned in the WordPress installation folder and that are
# required for the plugin tests.
# E.g. "acme/plugin-one acme/plugin-two pirates/plugin-three".
# This value will be used in a bash array declaration to iterate and clone the plugins one by one; validate locally the
# format of this array using this bash command after exporting the var:
# declare -a plugins=(`echo ${REQUIRED_PLUGIN_REPOS}`); for p in "${plugins[@]}"; do echo "$p"; done
REQUIRED_PLUGIN_REPOS=""

# This is where, in the context of the CI, we'll install and configure WordPress.
# See `.travis.yml` for more information.
WP_ROOT_FOLDER=/var/www/html

# The WordPress installation will be served from the Docker container.
# See `dev/docker/ci-compose.yml` for more information.
WP_URL=http://wordpress.test
WP_DOMAIN=wordpress.test

# The credentials that will be used to access the site in acceptance tests
# in methods like `$I->loginAsAdmin();`.
WP_ADMIN_USERNAME=admin
WP_ADMIN_PASSWORD=password

WP_DB_PORT=3306

# The database is served from the Docker `db` container.
# See `dev/docker/ci-compose.yml` for more information.
WP_TABLE_PREFIX=wp_
WP_DB_HOST=db
WP_DB_NAME=test
WP_DB_USER=root
WP_DB_PASSWORD=password

# The test database is served from the Docker `db` container.
# See `dev/docker/ci-compose.yml` for more information.
WP_TEST_DB_HOST=db
WP_TEST_DB_NAME=test
WP_TEST_DB_USER=root
WP_TEST_DB_PASSWORD=password

# We're using Selenium and Chrome for acceptance testing.
# In CI context we're starting a Docker container to handle that.
# See the `dev/docker/ci-compose.yml` file.
CHROMEDRIVER_HOST=chrome
CHROMEDRIVER_PORT=4444

# The URL of the WordPress installation from the point of view of the Chromedriver container.
# Why not just use `wordpress`? While Chrome will accept an `http://wordpress` address WordPress
# will not, we call the WordPress container with a seemingly looking legit URL and leverage the
# lines that, in the `wp-config.php` file, will make it so that WordPress will use as its home
# URL whatever URL we reach it with.
# See the `dev/docker/wp-config.php` template for more information.
WP_CHROMEDRIVER_URL=http://wordpress.test

# We're using Docker to run the tests.
USING_CONTAINERS=1
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Ignore everything except `blocks` and `dfv`
ui/js/codemirror
ui/js/marionette
ui/js/selectWoo
ui/js/sprintf
ui/js/timepicker
ui/js/*.js

# Ignore minified files
**/*.min.js
44 changes: 23 additions & 21 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
{
"parser": "babel-eslint",

"parserOptions": {
"ecmaVersion": 2016,
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},

"extends": [
"wordpress",
"plugin:react/recommended"
"plugin:@wordpress/eslint-plugin/custom",
"plugin:@wordpress/eslint-plugin/esnext",
"plugin:@wordpress/eslint-plugin/es5",
"plugin:@wordpress/eslint-plugin/jsx-a11y",
"plugin:@wordpress/eslint-plugin/react",
"plugin:@wordpress/eslint-plugin/i18n",
"plugin:@wordpress/eslint-plugin/test-e2e",
"plugin:@wordpress/eslint-plugin/test-unit"
],

"rules": {
"object-curly-spacing": ["error", "always"],

"space-in-parens": ["error", "always"],

"space-before-function-paren": ["error", {
"anonymous": "always",
"named": "always",
"asyncArrow": "always"
}],

"lines-around-comment": [ "error", {
"beforeLineComment": false,
"beforeBlockComment": false
}],
"rules": {},

"space-unary-ops": [ "error", {
"nonwords": false
}]
}
"overrides": [
{
"excludedFiles": "*.min.js",
"files": [ "**/test/*.js" ],
"env": {
"jest": true
}
}
]
}
41 changes: 28 additions & 13 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,46 +1,61 @@
# Auto detect text files and perform LF normalization
* text=auto

# Ignore
*.css linguist-generated=true
*.min.css linguist-generated=true
*.min.js linguist-generated=true
*.snap linguist-generated=true
tests/_support/_generated/* linguist-generated=true

# Export ignore handling

# Directories
/.wordpress-org export-ignore
/.github export-ignore
/.wordpress-org export-ignore
/bin export-ignore
/dev export-ignore
/docs export-ignore
/tests export-ignore
/ui/js/pods-dfv/src export-ignore
/ui/js/pods-dfv/pods-dfv.min.js.map export-ignore
/ui/js/blocks/src export-ignore
/ui/js/dfv/pods-dfv.min.js.map export-ignore
/ui/js/dfv/src export-ignore
/ui/styles/src export-ignore

# Files
.gitattributes export-ignore
.gitignore export-ignore

# Dot-files
.babelrc export-ignore
.editorconfig export-ignore
.env export-ignore
.env.example export-ignore
.env.testing.tric export-ignore
.eslintignore export-ignore
.eslintrc.json export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.jshintrc export-ignore
.nvmrc export-ignore
.phpstorm.meta.php export-ignore
.scrutinizer.yml export-ignore
.travis.yml export-ignore

CODEOWNERS export-ignore
# Other files
CODE_OF_CONDUCT.md export-ignore
CONTRIBUTING.md export-ignore
Gruntfile.js export-ignore
README.md export-ignore
TESTS.md export-ignore
codeception.dist.yml export-ignore
codeception.example.yml export-ignore
codeception.tric.yml export-ignore
CODEOWNERS export-ignore
composer.json export-ignore
CONTRIBUTING.md export-ignore
Gruntfile.js export-ignore
jest-setup-wordpress-globals.js export-ignore
jest.config.json export-ignore
package-lock.json export-ignore
package.json export-ignore
phpcs.xml export-ignore
phpcs.xml.dist export-ignore
phpunit.xml.dist export-ignore
README.md export-ignore
rollup.config.js export-ignore
TESTS.md export-ignore
webpack.common.js export-ignore
webpack.dev.js export-ignore
webpack.prod.js export-ignore
7 changes: 7 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ name: "CodeQL"

on:
push:
# The branches below must be a subset of the branches above
branches: [ main, release/* ]
paths-ignore:
- 'tribe-common/*'
- 'vendor/*'
pull_request:
# The branches below must be a subset of the branches above
branches: [ main, release/* ]
paths-ignore:
- 'tribe-common/*'
- 'vendor/*'
schedule:
- cron: '41 15 * * 4'

Expand Down
26 changes: 15 additions & 11 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
name: 'PHP CodeSniffer'
on:
pull_request:
paths-ignore:
- 'lang/**'
- '**.txt'
- '**.md'
- '.editorconfig'
- 'CODEOWNERS'
paths:
- 'classes/**.php'
- 'components/**.php'
- 'includes/**.php'
- 'src/**.php'
- 'sql/**.php'
- 'ui/**.php'
- '*.php'
jobs:
phpcs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 100
ref: ${{ github.event.pull_request.head.sha }}
- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand All @@ -24,6 +26,8 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: the-events-calendar/action-tribe-phpcs@master
with:
github-bot-token: ${{ secrets.GH_BOT_TOKEN }}
- name: Run PHPCS inspection
uses: rtCamp/action-phpcs-code-review@v2
env:
GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
SKIP_FOLDERS: "tests,.github,tribe-common,vendor"
Loading

0 comments on commit 6f79abd

Please sign in to comment.