Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,25 @@
/.git
/.github
/.wordpress-org
/artifacts
/assets
/node_modules
/release
/src
/tests
/bin

# Files
.distignore
.DS_Store
.eslintignore
.eslintrc.js
eslint.config.js
.gitignore
.nvmrc
.wordpress-version-checker.json
.wp-env.json
.wp-env.override.json
.wp-env.test.json
.wp-env.test.override.json
CHANGELOG.md
CODE_OF_CONDUCT.md
composer.json
Expand All @@ -27,6 +30,7 @@ CREDITS.md
LICENSE.md
package-lock.json
package.json
phpunit.xml.dist
phpcs.xml
README.md
webpack.config.js
Expand Down
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

42 changes: 0 additions & 42 deletions .eslintrc.js

This file was deleted.

88 changes: 0 additions & 88 deletions .github/workflows/cypress.yml

This file was deleted.

102 changes: 102 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Test

on:
workflow_dispatch:
push:
branches: [ develop, trunk ]
pull_request:
types: [ opened, synchronize, reopened ]

# Cancel superseded runs on the same PR.
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

# Disable permissions for all available scopes by default.
# Any needed permissions should be configured at the job level.
permissions: {}

jobs:
# The release zip, built once and shared by every E2E job.
build:
uses: ./.github/workflows/build-release-zip.yml
permissions:
contents: read

# Runs against the release zip rather than the source tree, so packaging
# bugs (a runtime file caught by .distignore) fail here, not after release.
e2e:
name: E2E / WP ${{ matrix.wp }}
needs: build
runs-on: ubuntu-24.04
permissions:
contents: read
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
wp: [ '6.9', latest, trunk ]
env:
WP_ENV_CORE: ${{ matrix.wp == 'trunk' && 'WordPress/WordPress' || format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wp ) }}

steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Download the release zip
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ github.event.repository.name }}
path: release/insert-special-characters

# Mount the unzipped release in place of the checkout. Both entries must
# name the same source, or wp-env mounts two sources on one path.
- name: Point the test environment at the release zip
run: |
echo '{"plugins":["./release/insert-special-characters"],"mappings":{"/wp-content/plugins/insert-special-characters":"./release/insert-special-characters"}}' > .wp-env.test.override.json

- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install npm dependencies
run: npm ci

- name: Start the test environment
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 10
max_attempts: 3
command: npm run wp-env:test start

- name: Get Playwright version
id: playwright-version
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT"

- name: Cache Playwright browsers
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}

# Only the chromium project runs.
- name: Install Playwright Chromium
run: npx playwright install --with-deps chromium

- name: Run E2E tests
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: npm run test:e2e

- name: Upload E2E artifacts
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: playwright-results-wp-${{ matrix.wp }}
path: artifacts/test-results
retention-days: 7
if-no-files-found: ignore
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

.DS_Store
.wp-env.override.json
.wp-env.test.override.json
/release

tests/cypress/downloads
tests/cypress/screenshots
tests/cypress/videos
tests/cypress/reports
/artifacts
tests/.phpunit.result.cache
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
22
17 changes: 9 additions & 8 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"plugins": ["."],
"env": {
"tests": {
"mappings": {
"wp-cli.yml": "./tests/bin/wp-cli.yml"
}
}
}
"$schema": "https://schemas.wp.org/trunk/wp-env.json",
"testsEnvironment": false,
"core": null,
"plugins": [ "." ],
"config": {
"WP_DEVELOPMENT_MODE": "plugin",
"WP_ENVIRONMENT_TYPE": "development",
"WP_DEBUG": true
}
}
14 changes: 14 additions & 0 deletions .wp-env.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://schemas.wp.org/trunk/wp-env.json",
"testsEnvironment": false,
"port": 8889,
"core": null,
"plugins": [ "." ],
"config": {
"FS_METHOD": "direct",
"WP_DEBUG": true
},
"mappings": {
"/wp-content/plugins/insert-special-characters": "."
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Insert Special Characters](https://github.com/10up/insert-special-characters/blob/develop/.wordpress-org/banner-1544x500.png)

[![Support Level](https://img.shields.io/badge/support-stable-blue.svg)](#support-level) ![Required PHP Version](https://img.shields.io/wordpress/plugin/required-php/insert-special-characters?label=Requires%20PHP) ![Required WP Version](https://img.shields.io/wordpress/plugin/wp-version/insert-special-characters?label=Requires%20WordPress) ![WordPress tested up to version](https://img.shields.io/wordpress/plugin/tested/insert-special-characters?label=WordPress) [![GPLv2 License](https://img.shields.io/github/license/10up/insert-special-characters.svg)](https://github.com/10up/insert-special-characters/blob/develop/LICENSE.md) [![Dependency Review](https://github.com/10up/insert-special-characters/actions/workflows/dependency-review.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/dependency-review.yml) [![E2E test](https://github.com/10up/insert-special-characters/actions/workflows/cypress.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/cypress.yml) [![ESLint](https://github.com/10up/insert-special-characters/actions/workflows/eslint.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/eslint.yml) [![PHPCS](https://github.com/10up/insert-special-characters/actions/workflows/phpcs.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/phpcs.yml) [![PHP Compatibility](https://github.com/10up/insert-special-characters/actions/workflows/php-compatibility.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/php-compatibility.yml) [![CodeQL](https://github.com/10up/insert-special-characters/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/codeql-analysis.yml) [![WordPress Plugin Version](https://img.shields.io/wordpress/plugin/v/insert-special-characters?logo=wordpress&logoColor=FFFFFF&label=Playground%20Demo&labelColor=3858E9&color=3858E9)](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/10up/insert-special-characters/develop/.wordpress-org/blueprints/blueprint.json)
[![Support Level](https://img.shields.io/badge/support-stable-blue.svg)](#support-level) ![Required PHP Version](https://img.shields.io/wordpress/plugin/required-php/insert-special-characters?label=Requires%20PHP) ![Required WP Version](https://img.shields.io/wordpress/plugin/wp-version/insert-special-characters?label=Requires%20WordPress) ![WordPress tested up to version](https://img.shields.io/wordpress/plugin/tested/insert-special-characters?label=WordPress) [![GPLv2 License](https://img.shields.io/github/license/10up/insert-special-characters.svg)](https://github.com/10up/insert-special-characters/blob/develop/LICENSE.md) [![Dependency Review](https://github.com/10up/insert-special-characters/actions/workflows/dependency-review.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/dependency-review.yml) [![Test](https://github.com/10up/insert-special-characters/actions/workflows/test.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/test.yml) [![ESLint](https://github.com/10up/insert-special-characters/actions/workflows/eslint.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/eslint.yml) [![PHPCS](https://github.com/10up/insert-special-characters/actions/workflows/phpcs.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/phpcs.yml) [![PHP Compatibility](https://github.com/10up/insert-special-characters/actions/workflows/php-compatibility.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/php-compatibility.yml) [![CodeQL](https://github.com/10up/insert-special-characters/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/codeql-analysis.yml) [![WordPress Plugin Version](https://img.shields.io/wordpress/plugin/v/insert-special-characters?logo=wordpress&logoColor=FFFFFF&label=Playground%20Demo&labelColor=3858E9&color=3858E9)](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/10up/insert-special-characters/develop/.wordpress-org/blueprints/blueprint.json)

> A Special Character inserter for the WordPress block editor (Gutenberg).

Expand Down
37 changes: 37 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const defaultConfig = require( '@wordpress/scripts/config/eslint.config.cjs' );

module.exports = [
...defaultConfig,
{
ignores: [ 'eslint.config.js', 'webpack.config.js' ],
},
{
languageOptions: {
globals: {
tenupIscVars: 'readonly',
tenupIscAdminVars: 'readonly',
localStorage: 'readonly',
jQuery: 'readonly',
Node: 'readonly',
},
},
settings: {
'import/core-modules': [
'@wordpress/api-fetch',
'@wordpress/block-editor',
'@wordpress/components',
'@wordpress/compose',
'@wordpress/data',
'@wordpress/date',
'@wordpress/edit-post',
'@wordpress/element',
'@wordpress/hooks',
'@wordpress/i18n',
'@wordpress/keycodes',
'@wordpress/plugins',
'@wordpress/primitives',
'@wordpress/rich-text',
],
},
},
];
Loading
Loading