Skip to content

Commit 15d8430

Browse files
authored
Merge pull request #178 from alleyinteractive/chore/backport-fixes
Backport several fixes from latest usage
2 parents 2c7838d + e1d620a commit 15d8430

File tree

16 files changed

+107
-28381
lines changed

16 files changed

+107
-28381
lines changed

.github/workflows/action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
uses: alleyinteractive/action-test-general@develop
3131

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

4242
- name: Run Node Tests
43-
uses: alleyinteractive/action-test-node@develop
43+
uses: alleyinteractive/action-test-node@v1
4444
with:
45+
cache-dependency-path: 'package.json'
4546
install-command: npm install
47+
skip-audit: 'true'
4648

4749
- name: Run PHP Tests
48-
uses: alleyinteractive/action-test-php@develop
50+
uses: alleyinteractive/action-test-php@v1
4951
with:
5052
php-version: '8.3'
5153
github-token: ${{ secrets.COMPOSER_ACCESS_TOKEN}}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# BEGIN DELETE AFTER INSTALL #
22
composer.lock
3+
package-lock.json
34
# END DELETE AFTER INSTALL #
45

56
# Caches

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.phpcs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@
4242
</rule>
4343
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
4444
<exclude-pattern>./plugin-templates/</exclude-pattern>
45+
<exclude-pattern>./plugins/create-wordpress-plugin/blocks/</exclude-pattern>
4546
</rule>
4647
</ruleset>

ci-templates/.github/workflows/all-pr-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,16 @@ jobs:
3030
- name: Run Node Tests
3131
# See https://github.com/alleyinteractive/action-test-node for more options
3232
uses: alleyinteractive/action-test-node@v1
33+
with:
34+
node-version: '22'
3335

3436
- name: Run PHP Tests
3537
# See https://github.com/alleyinteractive/action-test-php for more options
3638
uses: alleyinteractive/action-test-php@v1
3739
with:
3840
php-version: '8.3'
41+
skip-wordpress-install: 'true'
42+
3943
# This required job ensures that all PR checks have passed before merging.
4044
all-pr-checks-passed:
4145
name: All PR checks passed

composer.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
"sort-packages": true,
4949
"vendor-dir": "mu-plugins/vendor"
5050
},
51+
"autoload-dev": {
52+
"psr-4": {
53+
"Create_WordPress_Plugin\\Tests\\": "plugins/create-wordpress-plugin/tests",
54+
"Create_WordPress_Theme\\Tests\\": "themes/create-wordpress-theme/tests"
55+
}
56+
},
5157
"extra": {
5258
"installer-paths": {
5359
"mu-plugins/{$name}": [
@@ -60,9 +66,6 @@
6066
"wordpress-autoloader": {
6167
"autoload": {
6268
"Create_WordPress_Plugin\\": "plugins/create-wordpress-plugin/src"
63-
},
64-
"autoload-dev": {
65-
"Create_WordPress_Plugin\\Tests\\": "plugins/create-wordpress-plugin/tests"
6669
}
6770
}
6871
},
@@ -81,9 +84,11 @@
8184
"phpcs:theme": "cd themes/create-wordpress-theme && phpcs .",
8285
"phpstan": "phpstan --memory-limit=1G",
8386
"phpunit": [
84-
"@phpunit:plugin"
87+
"@phpunit:plugin",
88+
"@phpunit:theme"
8589
],
8690
"phpunit:plugin": "cd plugins/create-wordpress-plugin && phpunit",
91+
"phpunit:theme": "cd themes/create-wordpress-theme && phpunit",
8792
"setup": [
8893
"composer install --quiet --no-interaction"
8994
],

configure.php

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -633,11 +633,12 @@ function hoist_composer_dependencies_to_root( string $file ): void {
633633
$search_and_replace = array_merge(
634634
$search_and_replace,
635635
[
636-
'create-wordpress-theme' => $theme_slug,
637-
'Create WordPress Theme' => str_replace( '_', ' ', title_case( $theme_slug ) ),
638-
'CREATE_WORDPRESS_THEME' => strtoupper( str_replace( '-', '_', $theme_slug ) ),
639-
'create_wordpress_theme' => str_replace( '-', '_', $theme_slug ),
640-
'Create_WordPress_Theme' => $theme_namespace,
636+
'create-wordpress-theme' => $theme_slug,
637+
'Create WordPress Theme' => str_replace( '_', ' ', title_case( $theme_slug ) ),
638+
'CREATE_WORDPRESS_THEME' => strtoupper( str_replace( '-', '_', $theme_slug ) ),
639+
'create_wordpress_theme' => str_replace( '-', '_', $theme_slug ),
640+
'Alley\\WP\\Create_WordPress_Theme' => $theme_namespace,
641+
'Create_WordPress_Theme' => $theme_namespace,
641642
],
642643
);
643644
}
@@ -646,11 +647,12 @@ function hoist_composer_dependencies_to_root( string $file ): void {
646647
$search_and_replace = array_merge(
647648
$search_and_replace,
648649
[
649-
'create-wordpress-plugin' => $plugin_slug,
650-
'Create WordPress Plugin' => str_replace( '_', ' ', title_case( $plugin_slug ) ),
651-
'CREATE_WORDPRESS_PLUGIN' => strtoupper( str_replace( '-', '_', $plugin_slug ) ),
652-
'create_wordpress_plugin' => str_replace( '-', '_', $plugin_slug ),
653-
'Create_WordPress_Plugin' => $plugin_namespace,
650+
'create-wordpress-plugin' => $plugin_slug,
651+
'Create WordPress Plugin' => str_replace( '_', ' ', title_case( $plugin_slug ) ),
652+
'CREATE_WORDPRESS_PLUGIN' => strtoupper( str_replace( '-', '_', $plugin_slug ) ),
653+
'create_wordpress_plugin' => str_replace( '-', '_', $plugin_slug ),
654+
'Alley\\WP\\Create_WordPress_Plugin' => $plugin_namespace,
655+
'Create_WordPress_Plugin' => $plugin_namespace,
654656
]
655657
);
656658
}
@@ -851,11 +853,15 @@ function hoist_composer_dependencies_to_root( string $file ): void {
851853
"plugins/{$plugin_slug}/.editorconfig",
852854
"plugins/{$plugin_slug}/.eslintrc.json",
853855
"plugins/{$plugin_slug}/.gitattributes",
856+
"plugins/{$plugin_slug}/.github",
854857
"plugins/{$plugin_slug}/.gitignore",
855858
"plugins/{$plugin_slug}/.nvmrc",
859+
"plugins/{$plugin_slug}/.phpcs",
856860
"plugins/{$plugin_slug}/.stylelintrc.json",
861+
"plugins/{$plugin_slug}/.wp-env.json",
857862
"plugins/{$plugin_slug}/CHANGELOG.md",
858863
"plugins/{$plugin_slug}/composer.json",
864+
"plugins/{$plugin_slug}/features.txt",
859865
"plugins/{$plugin_slug}/jest.config.js",
860866
"plugins/{$plugin_slug}/package-lock.json",
861867
"plugins/{$plugin_slug}/phpstan.neon",

jest.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { Config } from 'jest';
22

33
const config: Config = {
44
moduleNameMapper: {
5-
'@/(.*)': '<rootDir>/$1',
65
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
76
},
87
preset: 'ts-jest',
@@ -16,4 +15,4 @@ const config: Config = {
1615
],
1716
};
1817

19-
export default config;
18+
export default config;

0 commit comments

Comments
 (0)