Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 5 additions & 3 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: alleyinteractive/action-test-general@develop

- name: Composer install and make
uses: alleyinteractive/action-test-php@develop
uses: alleyinteractive/action-test-php@v1
with:
php-version: '8.3'
github-token: ${{ secrets.COMPOSER_ACCESS_TOKEN}}
Expand All @@ -40,12 +40,14 @@ jobs:
skip-test: true

- name: Run Node Tests
uses: alleyinteractive/action-test-node@develop
uses: alleyinteractive/action-test-node@v1
with:
cache-dependency-path: 'package.json'
install-command: npm install
skip-audit: 'true'

- name: Run PHP Tests
uses: alleyinteractive/action-test-php@develop
uses: alleyinteractive/action-test-php@v1
with:
php-version: '8.3'
github-token: ${{ secrets.COMPOSER_ACCESS_TOKEN}}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# BEGIN DELETE AFTER INSTALL #
composer.lock
package-lock.json
# END DELETE AFTER INSTALL #

# Caches
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1 change: 1 addition & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<exclude-pattern>./plugin-templates/</exclude-pattern>
<exclude-pattern>./plugins/create-wordpress-plugin/blocks/</exclude-pattern>
</rule>
</ruleset>
4 changes: 4 additions & 0 deletions ci-templates/.github/workflows/all-pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ jobs:
- name: Run Node Tests
# See https://github.com/alleyinteractive/action-test-node for more options
uses: alleyinteractive/action-test-node@v1
with:
node-version: '22'

- name: Run PHP Tests
# See https://github.com/alleyinteractive/action-test-php for more options
uses: alleyinteractive/action-test-php@v1
with:
php-version: '8.3'
skip-wordpress-install: 'true'

# This required job ensures that all PR checks have passed before merging.
all-pr-checks-passed:
name: All PR checks passed
Expand Down
13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
"sort-packages": true,
"vendor-dir": "mu-plugins/vendor"
},
"autoload-dev": {
"psr-4": {
"Create_WordPress_Plugin\\Tests\\": "plugins/create-wordpress-plugin/tests",
"Create_WordPress_Theme\\Tests\\": "themes/create-wordpress-theme/tests"
}
},
"extra": {
"installer-paths": {
"mu-plugins/{$name}": [
Expand All @@ -60,9 +66,6 @@
"wordpress-autoloader": {
"autoload": {
"Create_WordPress_Plugin\\": "plugins/create-wordpress-plugin/src"
},
"autoload-dev": {
"Create_WordPress_Plugin\\Tests\\": "plugins/create-wordpress-plugin/tests"
}
}
},
Expand All @@ -81,9 +84,11 @@
"phpcs:theme": "cd themes/create-wordpress-theme && phpcs .",
"phpstan": "phpstan --memory-limit=1G",
"phpunit": [
"@phpunit:plugin"
"@phpunit:plugin",
"@phpunit:theme"
],
"phpunit:plugin": "cd plugins/create-wordpress-plugin && phpunit",
"phpunit:theme": "cd themes/create-wordpress-theme && phpunit",
"setup": [
"composer install --quiet --no-interaction"
],
Expand Down
26 changes: 16 additions & 10 deletions configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,11 +633,12 @@ function hoist_composer_dependencies_to_root( string $file ): void {
$search_and_replace = array_merge(
$search_and_replace,
[
'create-wordpress-theme' => $theme_slug,
'Create WordPress Theme' => str_replace( '_', ' ', title_case( $theme_slug ) ),
'CREATE_WORDPRESS_THEME' => strtoupper( str_replace( '-', '_', $theme_slug ) ),
'create_wordpress_theme' => str_replace( '-', '_', $theme_slug ),
'Create_WordPress_Theme' => $theme_namespace,
'create-wordpress-theme' => $theme_slug,
'Create WordPress Theme' => str_replace( '_', ' ', title_case( $theme_slug ) ),
'CREATE_WORDPRESS_THEME' => strtoupper( str_replace( '-', '_', $theme_slug ) ),
'create_wordpress_theme' => str_replace( '-', '_', $theme_slug ),
'Alley\\WP\\Create_WordPress_Theme' => $theme_namespace,
'Create_WordPress_Theme' => $theme_namespace,
],
);
}
Expand All @@ -646,11 +647,12 @@ function hoist_composer_dependencies_to_root( string $file ): void {
$search_and_replace = array_merge(
$search_and_replace,
[
'create-wordpress-plugin' => $plugin_slug,
'Create WordPress Plugin' => str_replace( '_', ' ', title_case( $plugin_slug ) ),
'CREATE_WORDPRESS_PLUGIN' => strtoupper( str_replace( '-', '_', $plugin_slug ) ),
'create_wordpress_plugin' => str_replace( '-', '_', $plugin_slug ),
'Create_WordPress_Plugin' => $plugin_namespace,
'create-wordpress-plugin' => $plugin_slug,
'Create WordPress Plugin' => str_replace( '_', ' ', title_case( $plugin_slug ) ),
'CREATE_WORDPRESS_PLUGIN' => strtoupper( str_replace( '-', '_', $plugin_slug ) ),
'create_wordpress_plugin' => str_replace( '-', '_', $plugin_slug ),
'Alley\\WP\\Create_WordPress_Plugin' => $plugin_namespace,
'Create_WordPress_Plugin' => $plugin_namespace,
]
);
}
Expand Down Expand Up @@ -851,11 +853,15 @@ function hoist_composer_dependencies_to_root( string $file ): void {
"plugins/{$plugin_slug}/.editorconfig",
"plugins/{$plugin_slug}/.eslintrc.json",
"plugins/{$plugin_slug}/.gitattributes",
"plugins/{$plugin_slug}/.github",
"plugins/{$plugin_slug}/.gitignore",
"plugins/{$plugin_slug}/.nvmrc",
"plugins/{$plugin_slug}/.phpcs",
"plugins/{$plugin_slug}/.stylelintrc.json",
"plugins/{$plugin_slug}/.wp-env.json",
"plugins/{$plugin_slug}/CHANGELOG.md",
"plugins/{$plugin_slug}/composer.json",
"plugins/{$plugin_slug}/features.txt",
"plugins/{$plugin_slug}/jest.config.js",
"plugins/{$plugin_slug}/package-lock.json",
"plugins/{$plugin_slug}/phpstan.neon",
Expand Down
3 changes: 1 addition & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { Config } from 'jest';

const config: Config = {
moduleNameMapper: {
'@/(.*)': '<rootDir>/$1',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
},
preset: 'ts-jest',
Expand All @@ -16,4 +15,4 @@ const config: Config = {
],
};

export default config;
export default config;
Loading
Loading