Skip to content

Commit

Permalink
Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Oct 16, 2023
2 parents dcb9abe + b7fdc28 commit f95c07f
Show file tree
Hide file tree
Showing 24 changed files with 2,371 additions and 7,601 deletions.
9 changes: 1 addition & 8 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@
/tests

# Files
.distignore
.editorconfig
.eslintrc
.gitignore
.nvmrc
.phpcs.xml
.wp-env.json
.wp-env.override.json
.*
CHANGELOG.md
CODE_OF_CONDUCT.md
composer.json
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-release-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}

- name: Install Composer dependencies
run: composer install --no-dev

- name: Setup node version and npm cache
uses: actions/setup-node@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- develop
jobs:
build:
build:
uses: 10up/maps-block-apple/.github/workflows/build-release-zip.yml@develop
cypress:
needs: build
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm install
- name: Set the core version and plugins config
- name: Set the core version and plugins config
run: ./tests/bin/set-wp-config.js --core=${{ matrix.core.version }} --plugins=./${{ github.event.repository.name }}
- name: Set up WP environment
run: npm run env:start
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/deploy-to-wordpress-org.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Install Composer dependencies
run: composer install --no-dev
- name: Build
run: |
npm install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ on:
schedule:
- cron: '0 0 * * 1'

permissions:
issues: write

jobs:
wordpress-version-checker:
runs-on: ubuntu-latest
steps:
- name: WordPress version checker
uses: skaut/wordpress-version-checker@v1.2.0
uses: skaut/wordpress-version-checker@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ tests/cypress/downloads
tests/cypress/screenshots
tests/cypress/videos
tests/cypress/reports

10up-lib/
3 changes: 2 additions & 1 deletion .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<exclude-pattern>build</exclude-pattern>
<exclude-pattern>node_modules</exclude-pattern>
<exclude-pattern>vendor</exclude-pattern>
</ruleset>
<exclude-pattern>10up-lib</exclude-pattern>
</ruleset>
4 changes: 4 additions & 0 deletions .wordpress-version-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"readme": "readme.txt",
"channel": "rc"
}
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file, per [the Ke

## [Unreleased] - TBD

## [1.1.2] - 2023-10-16
### Changed
- Bump WordPress "tested up to" version to 6.3 (props [@QAharshalkadu](https://github.com/QAharshalkadu), [@jeffpaul](https://github.com/jeffpaul) via [#179](https://github.com/10up/maps-block-apple/pull/179)).

### Fixed
- Ensure our Mapkit JS only loads when a Map block is in place (props [@jayedul](https://github.com/jayedul), [@fabiankaegy](https://github.com/fabiankaegy), [@faisal-alvi](https://github.com/faisal-alvi) via [#161](https://github.com/10up/maps-block-apple/pull/161)).
- Better error handling for environments that don't match our minimum PHP version (props [@rahulsprajapati](https://github.com/rahulsprajapati), [@dkotter](https://github.com/dkotter), [@ravinderk](https://github.com/ravinderk) via [#174](https://github.com/10up/maps-block-apple/pull/174)).
- Ensure that the Apple Maps block works fine in WordPress 6.4 (props [@iamdharmesh](https://github.com/iamdharmesh), [@fabiankaegy](https://github.com/fabiankaegy), [@faisal-alvi](https://github.com/faisal-alvi) via [#183](https://github.com/10up/maps-block-apple/pull/183)).
- Ensure that our Cypress E2E tests pass (props [@iamdharmesh](https://github.com/iamdharmesh), [@Sidsector9](https://github.com/Sidsector9) via [#181](https://github.com/10up/maps-block-apple/pull/181)).

### Security
- Bump `word-wrap` from 1.2.3 to 1.2.4 (props [@dependabot](https://github.com/apps/dependabot), [@ravinderk](https://github.com/apps/ravinderk) via [#173](https://github.com/10up/maps-block-apple/pull/173)).
- Bump `tough-cookie` from 4.1.2 to 4.1.3 (props [@dependabot](https://github.com/apps/dependabot), [@faisal-alvi](https://github.com/apps/faisal-alvi) via [#176](https://github.com/10up/maps-block-apple/pull/176)).
- Bump `cypress` from 11.2.0 to 13.2.0 and `@cypress/request` from 2.88.11 to 3.0.0 (props [@dependabot](https://github.com/apps/dependabot), [@ravinderk](https://github.com/apps/ravinderk), [@faisal-alvi](https://github.com/apps/faisal-alvi), [@iamdharmesh](https://github.com/iamdharmesh), [@Sidsector9](https://github.com/Sidsector9) via [#176](https://github.com/10up/maps-block-apple/pull/176), [#180](https://github.com/10up/maps-block-apple/pull/180), [#181](https://github.com/10up/maps-block-apple/pull/181)).
- Bump `postcss` from 8.4.23 to 8.4.31 (props [@dependabot](https://github.com/apps/dependabot), [@ravinderk](https://github.com/apps/ravinderk) via [#184](https://github.com/10up/maps-block-apple/pull/184)).
- Bump `@10up/cypress-wp-utils` from 0.1.0 to 0.2.0, `@wordpress/env` from 5.6.0 to 8.7.0 and `cypress-mochawesome-reporter` from 3.4.0 to 3.6.0 (props [@iamdharmesh](https://github.com/iamdharmesh), [@Sidsector9](https://github.com/Sidsector9) via [#181](https://github.com/10up/maps-block-apple/pull/181)).

## [1.1.1] - 2023-06-21
**Note that this release bumps the PHP minimum supported version from 5.6 to 7.4.**

Expand Down Expand Up @@ -126,6 +143,7 @@ All notable changes to this project will be documented in this file, per [the Ke
- Initial private release of Block for Apple Maps plugin.

[Unreleased]: https://github.com/10up/maps-block-apple/compare/trunk...develop
[1.1.2]: https://github.com/10up/maps-block-apple/compare/1.1.1...1.1.2
[1.1.1]: https://github.com/10up/maps-block-apple/compare/1.1.0...1.1.1
[1.1.0]: https://github.com/10up/maps-block-apple/compare/1.0.3...1.1.0
[1.0.3]: https://github.com/10up/maps-block-apple/compare/1.0.2...1.0.3
Expand Down
2 changes: 1 addition & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The following individuals are responsible for curating the list of issues, respo

Thank you to all the people who have already contributed to this repository via bug reports, code, design, ideas, project management, translation, testing, etc.

[Helen Hou-Sandi (@helen)](https://github.com/helen), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [Justin Kopepasah (@kopepasah)](https://github.com/kopepasah), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Fabian Kägy (@fabiankaegy)](https://github.com/fabiankaegy), [Jackie Kjome (@JackieKjome)](https://github.com/JackieKjome), [GitHub Dependabot (@dependabot)](https://github.com/apps/dependabot), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Joshua Abenazer (@joshuaabenazer)](https://github.com/joshuaabenazer), [Barney Jeffries (@barneyjeffries)](https://github.com/barneyjeffries), [Ankit K. Gupta (@ankitguptaindia)](https://github.com/ankitguptaindia), [Crisoforo Gaspar Hernández (@mitogh)](https://github.com/mitogh), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi), [Max Lyuchin (@cadic)](https://github.com/cadic), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Jayedul Kabir (@jayedul)](https://github.com/jayedul), [Curtis Loisel (@csloisel)](https://github.com/csloisel)
[Helen Hou-Sandi (@helen)](https://github.com/helen), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [Justin Kopepasah (@kopepasah)](https://github.com/kopepasah), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Fabian Kägy (@fabiankaegy)](https://github.com/fabiankaegy), [Jackie Kjome (@JackieKjome)](https://github.com/JackieKjome), [GitHub Dependabot (@dependabot)](https://github.com/apps/dependabot), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Joshua Abenazer (@joshuaabenazer)](https://github.com/joshuaabenazer), [Barney Jeffries (@barneyjeffries)](https://github.com/barneyjeffries), [Ankit K. Gupta (@ankitguptaindia)](https://github.com/ankitguptaindia), [Crisoforo Gaspar Hernández (@mitogh)](https://github.com/mitogh), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi), [Max Lyuchin (@cadic)](https://github.com/cadic), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Jayedul Kabir (@jayedul)](https://github.com/jayedul), [Curtis Loisel (@csloisel)](https://github.com/csloisel), [Harshal Kadu (@QAharshalkadu)](https://github.com/QAharshalkadu), [Rahul Prajapati (@rahulsprajapati)](https://github.com/rahulsprajapati), [Ravinder Kumar (@ravinderk)](https://github.com/ravinderk).

## Libraries

Expand Down
1 change: 0 additions & 1 deletion block.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@
},
"editorScript":"maps-block-apple-block",
"viewScript":"maps-block-apple-frontend",
"script": "apple-mapkit-js",
"editorStyle": "file:build/index.css"
}
77 changes: 49 additions & 28 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,51 @@
{
"name": "10up/maps-block-apple",
"description": "WordPress editor block for Apple Maps",
"version": "1.0.1",
"type": "wordpress-plugin",
"homepage": "https://10up.com",
"license": "GPLv2 or later",
"authors": [
{
"name": "10up",
"email": "[email protected]",
"homepage": "https://10up.com",
"role": "Developer"
}
],
"require-dev": {
"10up/phpcs-composer": "dev-master"
},
"scripts": {
"lint": "./vendor/bin/phpcs",
"lint-fix": "./vendor/bin/phpcbf --extensions=php .",
"phpcs:compat": "vendor/bin/phpcs maps-block-apple.php includes/ -p --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 7.4-"
},
"minimum-stability": "dev",
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
"name": "10up/maps-block-apple",
"description": "WordPress editor block for Apple Maps",
"version": "1.0.1",
"type": "wordpress-plugin",
"homepage": "https://10up.com",
"license": "GPLv2 or later",
"authors": [
{
"name": "10up",
"email": "[email protected]",
"homepage": "https://10up.com",
"role": "Developer"
}
],
"require": {
"10up/wp-compat-validation-tool": "dev-trunk"
},
"require-dev": {
"10up/phpcs-composer": "dev-master"
},
"scripts": {
"lint": "./vendor/bin/phpcs",
"lint-fix": "./vendor/bin/phpcbf --extensions=php .",
"phpcs:compat": "vendor/bin/phpcs maps-block-apple.php includes/ -p --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 7.4-",
"post-install-cmd": [
"./10up-lib/wp-compat-validation-tool/replace-namespace.sh TenUP_Maps_Block_Apple_Environment_Validation_Tools"
],
"post-update-cmd": [
"./10up-lib/wp-compat-validation-tool/replace-namespace.sh TenUP_Maps_Block_Apple_Environment_Validation_Tools"
]
},
"minimum-stability": "dev",
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true
}
},
"repositories": [
{
"type": "git",
"url": "https://github.com/10up/wp-compat-validation-tool.git"
}
],
"extra": {
"installer-paths": {
"./{$name}/": ["10up/wp-compat-validation-tool"]
}
}
}
2 changes: 1 addition & 1 deletion includes/block-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function register_block_assets() {
wp_register_script(
'maps-block-apple-block',
MAPS_BLOCK_APPLE_URL . "build/$block_file_name.js",
$block_dependencies['dependencies'],
array_merge( $block_dependencies['dependencies'], [ 'apple-mapkit-js' ] ),
$block_dependencies['version'],
false
);
Expand Down
29 changes: 29 additions & 0 deletions includes/environment-validation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* This file is used to validate the environment.
*
* @package tenup\Maps_Block_Apple
* @since 1.2.0
*/

namespace tenup\Maps_Block_Apple;

use TenUP_Maps_Block_Apple_Environment_Validation_Tools\Validator;

$tenup_lib_path = __DIR__ . '/../10up-lib/';
if ( ! is_readable( $tenup_lib_path . 'wp-compat-validation-tool/src/Validator.php' ) ) {
return false;
}

require_once $tenup_lib_path . 'wp-compat-validation-tool/src/Validator.php';

$compat_checker = new Validator();
$compat_checker
->set_plugin_name( 'Block for Apple Maps' )
->set_php_min_required_version( '7.4' );

if ( ! $compat_checker->is_plugin_compatible() ) {
return false;
}

return true;
26 changes: 9 additions & 17 deletions maps-block-apple.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Block for Apple Maps
* Plugin URI: https://github.com/10up/maps-block-apple
* Description: An Apple Maps block for the WordPress block editor (Gutenberg).
* Version: 1.1.1
* Version: 1.1.2
* Requires at least: 5.8
* Requires PHP: 7.4
* Author: 10up
Expand All @@ -18,27 +18,19 @@
namespace tenup\Maps_Block_Apple;

// Useful global constants.
define( 'MAPS_BLOCK_APPLE_VERSION', '1.1.1' );
define( 'MAPS_BLOCK_APPLE_VERSION', '1.1.2' );
define( 'MAPS_BLOCK_APPLE_URL', plugin_dir_url( __FILE__ ) );
define( 'MAPS_BLOCK_APPLE_PATH', dirname( __FILE__ ) . '/' );
define( 'MAPS_BLOCK_APPLE_INC', MAPS_BLOCK_APPLE_PATH . 'includes/' );
define( 'MAPS_BLOCK_APPLE_BASENAME', plugin_basename( __FILE__ ) );

/**
* Require WP version >=5.8
* PHP 7.4 errors should be caught in the sandbox during activation.
*/
register_activation_hook(
__FILE__,
function() {
if ( ! version_compare( $GLOBALS['wp_version'], '5.8', '>=' ) ) {
wp_die(
esc_html__( 'Block for Apple Maps requires WordPress version 5.8 or greater.', 'maps-block-apple' ),
esc_html__( 'Error Activating', 'maps-block-apple' )
);
}
}
);

// Validate Environment.
$is_environment_satisfy = require MAPS_BLOCK_APPLE_INC . 'environment-validation.php';
if ( ! $is_environment_satisfy ) {
return;
}


/**
* Add options
Expand Down
Loading

0 comments on commit f95c07f

Please sign in to comment.