Skip to content

Commit

Permalink
Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwilsoncc committed Jun 28, 2023
2 parents bb84b8d + ba8834c commit c8e600d
Show file tree
Hide file tree
Showing 135 changed files with 42,561 additions and 44,588 deletions.
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
release/*
dist/*
docs-built/*
vendor/*
gulp-tasks/*
8 changes: 7 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"extends": "@10up/eslint-config"
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ],
"settings": {
"import/core-modules": [ "jquery", "underscore" ]
},
"rules": {
"import/no-extraneous-dependencies": ["error", {"packageDir": ["./", "./node_modules/@wordpress/scripts"] }]
}
}
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# These owners will be the default owners for everything in the repo. Unless a later match takes precedence, @10up/open-source-practice, as primary maintainers will be requested for review when someone opens a Pull Request.
* @10up/open-source-practice

# GitHub and WordPress.org specifics
/.github/ @jeffpaul
/assets/img/ @jeffpaul
CODE_OF_CONDUCT.md @jeffpaul
LICENSE.md @jeffpaul
41 changes: 40 additions & 1 deletion .github/hookdoc-tmpl/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
# Welcome to the Distributor Plugin Hook Documentation
# Welcome to the Distributor Developer Documentation

This resource is generated documentation on actions and filters found in the Distributor plugin. Use the sidebar to browse and navigate.

For more information about using Distributor with WordPress, please see the [Distributor website](https://distributorplugin.com/).

## Migrating to version 2.0

Version 2.0 of Distributor contains breaking changes. Please review the <a href="./tutorial-migration-guide-version-1-to-version-2.html">migration guide</a> tutorial and follow any steps required.

To report an issue with Distributor or contribute back to the project, please visit the [GitHub repository](https://github.com/10up/distributor/).

## Developers

### Running Locally

If you are compiling Distributor locally, note that the recommended version of Node.js is version 16.x. The minimum version required is Node.js 12.x.

An `.nvmrc` file is included in the plugin repository. It's recommended you install [fnm (fast node manager)](https://github.com/Schniz/fnm/), [nvm (node version manager)](https://github.com/nvm-sh/nvm) or similar when developing locally.

### Testing

The plugin contains a standard test suite compatible with PHPUnit. If you want to test across multiple PHP versions, a [Dockunit](https://github.com/dockunit/dockunit) file is included.

### Debugging

You can define a constant `DISTRIBUTOR_DEBUG` to `true` to increase the ease of debugging in Distributor. This will make all remote requests blocking and expose the subscription post type.

Enabling this will also provide more debugging information in your error log for image side loading issues. The specific logging method may change in the future.

### Application Passwords

Application passwords are only available for live sites running over an HTTPS connection.

For your local development environment, you will need these snippets to enable application passwords without the need for an HTTPS connection. A local development environment is one that "can reach the internet but **is not reachable from the internet**".

```php
// In your local environment's wp-config.php file.
define( 'WP_ENVIRONMENT_TYPE', 'local' );

// In a custom plugin on your local environment.
add_filter( 'wp_is_application_passwords_available', '__return_true' );

add_action( 'wp_authorize_application_password_request_errors', function( $error ) {
$error->remove( 'invalid_redirect_scheme' );
} );
```
<a href="http://10up.com/contact/" class="banner"><img src="https://10updotcom-wpengine.s3.amazonaws.com/uploads/2016/10/10up-Github-Banner.png" width="850"></a>
13 changes: 10 additions & 3 deletions .github/hookdoc-tmpl/layout.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title><?js= title ?> - 10up Distributor Hook Docs</title>
<title><?js= title ?> - 10up Distributor Developer Documentation</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
Expand Down Expand Up @@ -32,11 +32,18 @@
<a href="https://10up.com/careers">Careers at 10up</a>
</footer>


</div>

<nav>
<?js= this.nav ?>
<?js
// Re-order tutorials to the top of the nav. The nav is hard-coded in wp-hooksdoc.
const indexOfFirstSubHeading = this.nav.indexOf('<h3');
const indexOfTutorial = this.nav.indexOf('<h3>Tutorials');
const headingLink = this.nav.substr(0, indexOfFirstSubHeading);
const hooksSection = this.nav.substr(indexOfFirstSubHeading, indexOfTutorial - indexOfFirstSubHeading);
const tutorialSection = this.nav.substr(indexOfTutorial);
?>
<?js= headingLink + tutorialSection+ hooksSection ?>
</nav>

<br class="clear">
Expand Down
10 changes: 4 additions & 6 deletions .github/release-pull-request-template.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
**Release checklist for the version 1.x branch.**

- [x] Branch: Starting from `develop-v1`, create a release branch named `release/X.Y.Z` for your changes.
- [ ] Version bump: Bump the version number in `distributor.php`, `package.json`, and `readme.txt` if it does not already reflect the version being released. In `distributor.php` update both the plugin "Version:" property and the plugin `DT_VERSION` constant.
- [ ] New files: Ensure any new files, especially in the vendor folder, are correctly included in `gulp-tasks/copy.js`.
- [x] Branch: Starting from `develop`, create a release branch named `release/X.Y.Z` for your changes.
- [ ] Version bump: Bump the version number in `distributor.php`, `package.json`, `readme.txt` and `tests/php/bootstrap.php` if it does not already reflect the version being released. In `distributor.php` update both the plugin "Version:" property and the plugin `DT_VERSION` constant.
- [ ] New files: Ensure any new files, especially in the vendor folder, are correctly included in `webpack.config.release.js`.
- [ ] Changelog: Add/update the changelog in `CHANGELOG.md`.
- [ ] Props: Update `CREDITS.md` file with any new contributors, confirm maintainers are accurate.
- [ ] Readme updates: Make any other readme changes as necessary. `README.md` is geared toward GitHub and `readme.txt` contains WordPress.org-specific content. The two are slightly different.
- [ ] Since tag updates: ensure `@since` tags indicate the new version, replacing `x.x.x`, `n.e.x.t` and other placeholders.
- [ ] Merge: Make a non-fast-forward merge from your release branch to `develop-v1` (or merge the Pull Request), then do the same for `develop-v1` into `trunk` (`git checkout trunk && git merge --no-ff develop-v1`). `trunk` contains the stable development version.
- [ ] Merge: Make a non-fast-forward merge from your release branch to `develop` (or merge the Pull Request), then do the same for `develop` into `trunk` (`git checkout trunk && git merge --no-ff develop`). `trunk` contains the stable development version.
- [ ] Build: Wait for the [Build Stable Release Action](https://github.com/10up/distributor/actions?query=workflow%3A%22Build+Stable+Release%22) to finish running.
- [ ] Update this pull request's status from `draft` to `ready to merge`.
- [ ] Review: Do a review of the commit to the `stable` branch to ensure the contents of the diffs are as expected.
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/build-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,22 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Set PHP version
uses: shivammathur/setup-php@2.17.0
with:
php-version: 7.4
tools: composer:v2
- name: Check versions
run: npm -v; node -v
run: |
npm -v
node -v
php -v
composer -v
- name: Install and build
run: |
composer install --no-dev
npm install
npm run makepot
npm run release
- name: Push to Stable
env:
Expand Down
64 changes: 57 additions & 7 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,80 @@ on:
- develop
- develop-v1
jobs:
build:
name: NPM Install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use desired version of NodeJS
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Cache Node
uses: actions/cache@v3
with:
path: |
node_modules
~/.cache
~/.npm
key: ${{ hashFiles('package-lock.json') }}

- name: Install dependencies
run: npm install

cypress:
name: ${{ matrix.core.name }} / ${{ matrix.php.name }}
needs: [build]
## Pending upgrade of `@wordpress/env` package.
continue-on-error: ${{ matrix.core.version == 'WordPress/WordPress#master' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- {name: 'PHP Default', version: null}
core:
- {name: 'WP latest', version: 'latest'}
- {name: 'WP stable', version: 'latest'}
- {name: 'WP 5.7', version: 'WordPress/WordPress#5.7'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
include:
- php: {name: 'PHP 7.4', version: '7.4'}
core: {name: 'WP 5.7', version: 'WordPress/WordPress#5.7'}
- php: {name: 'PHP 8.1', version: '8.1'}
core: {name: 'WP stable', version: 'latest'}
- php: {name: 'PHP 7.4', version: '7.4' }
core: {name: 'WP minimum', version: 'WordPress/WordPress#5.2'}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use desired version of NodeJS
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Check versions
run: npm -v; node -v

- name: Cache Node
uses: actions/cache@v3
with:
path: |
node_modules
~/.cache
~/.npm
key: ${{ hashFiles('package-lock.json') }}

- name: Install dependencies
run: npm install

- name: Composer install
run: composer install

- name: Build
run: npm run build

- name: Set the core version
run: |
./tests/bin/set-core-version.js ${{ matrix.core.version }} ${{ matrix.php.version }}
Expand All @@ -54,11 +97,18 @@ jobs:
npx wp-env run cli "wp core version"
npx wp-env run cli "php --version"
- name: Convert to multisite
run: npm run to-multisite

- name: Copy .htaccess
run: npm run copy-htaccess

- name: Test
run: npm run cypress:run
run: npm run cypress:run --config-file tests/cypress/config.js

- name: Upload artifacts
uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-artifact
retention-days: 2
path: |
${{ github.workspace }}/tests/cypress/screenshots/
${{ github.workspace }}/tests/cypress/videos/
8 changes: 6 additions & 2 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ jobs:
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v1
- name: Dependency Review
uses: actions/dependency-review-action@v3
with:
license-check: true
vulnerability-check: false
config-file: 10up/.github/.github/dependency-review-config.yml@trunk
49 changes: 49 additions & 0 deletions .github/workflows/generate-zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Generate ZIP

on:
workflow_dispatch:
inputs:
ref:
description: 'Git Commit Ref (branch, tag, or hash)'
required: false
type: string

jobs:
generate_zip:
name: New ZIP file
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
with:
ref: ${{ inputs.ref }}
- name: Use desired version of NodeJS
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Set PHP version
uses: shivammathur/setup-php@2.17.0
with:
php-version: 7.4
tools: composer:v2, wp
- name: Check versions
run: |
npm -v
node -v
php -v
composer -v
- name: Install and build
run: |
composer install --no-dev
npm install
npm run release
npm run plugin-zip
rm -rf ./release && unzip ${{ github.event.repository.name }}.zip -d ./release
- name: Upload the ZIP file as an artifact
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: release
retention-days: 5
Loading

0 comments on commit c8e600d

Please sign in to comment.