Skip to content

Commit d56ea24

Browse files
authored
dev: add support for lazy-loading description/deprecationReason config values (#121)
* chore: update strauss and deps * dev: use callable descriptions/deprecations * fix: dont prefix `NodeWithRankMathSeo` * chore: fix backcompat on connections * chore: update dep * chore: update deps * tests: ensure schema can build * chore: update and cleanup * fix: regenerate autoloader
1 parent 3bd3ede commit d56ea24

File tree

115 files changed

+3609
-1556
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+3609
-1556
lines changed

.phpcs.xml.dist

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<ruleset name="WordPress Coding Standards for WPGraphQL for RankMath SEO" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WordPress Coding Standards for WPGraphQL for RankMath SEO" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
33
<description>Sniffs for the WPGraphQL plugin ecosystem </description>
44

55
<!-- What to scan: include any root-level PHP files, and the /src folder -->
@@ -20,10 +20,12 @@
2020
<!-- Strip the file paths down to the relevant bit -->
2121
<arg name="colors"/>
2222
<arg name="extensions" value="php"/>
23-
<!-- Enables parallel processing when available for faster results. -->
24-
<arg name="parallel" value="20"/>
2523
<!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->
2624
<arg name="cache" value="tests/_output/phpcs-cache.json" />
25+
<!-- Enables parallel processing when available for faster results. -->
26+
<arg name="parallel" value="20"/>
27+
<!-- Set severity to 1 to see everything that isn't effectively turned off. -->
28+
<arg name="severity" value="1" />
2729

2830
<!-- Ruleset Config: set these to match your project constraints-->
2931

@@ -41,19 +43,31 @@
4143

4244
<!-- Rules: WPGraphQL Coding Standards -->
4345
<!-- https://github.com/AxeWP/WPGraphQL-Coding-Standards/WPGraphQL/ruleset.xml -->
44-
<rule ref="WPGraphQL" />
46+
<rule ref="WPGraphQL">
47+
<!-- @todo remove after PHPCS v4-->
48+
<exclude name="WordPressVIPMinimum.JS" />
49+
<exclude name="Generic.Functions.CallTimePassByReference" />
50+
</rule>
4551

4652
<!-- Individual rule configuration -->
4753
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
4854
<properties>
49-
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
50-
<property name="prefixes" type="array" value="WPGraphQL\RankMath, wp_graphql, graphql_seo, WPGRAPHQL_SEO, rank_math" />
55+
<!-- Value: replace the function, class, and variable prefixes used. -->
56+
<property name="prefixes" type="array">
57+
<element value="WPGraphQL\RankMath" />
58+
<element value="wp_graphql" />
59+
<element value="graphql_seo" />
60+
<element value="WPGRAPHQL_SEO" />
61+
<element value="rank_math" />
62+
</property>
5163
</properties>
5264
</rule>
5365
<rule ref="WordPress.WP.I18n">
5466
<properties>
5567
<!-- Value: replace the text domain used. -->
56-
<property name="text_domain" type="array" value="wp-graphql-rank-math"/>
68+
<property name="text_domain" type="array">
69+
<element value="wp-graphql-rank-math"/>
70+
</property>
5771
</properties>
5872
</rule>
5973

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [Unreleased]
44

55
- fix: Fix type conflicts on Product interfaces in WooGraphQL 0.21.1+. Props @robbiebel 🙌
6+
- dev: Add support for lazy-loading GraphQL descriptions and deprecation messages.
67
- chore: bump PHPStan to v2.0.x
78
- chore: Test compatibility with WordPress 6.8 and WPGraphQL 2.3.
89
- chore: Update Composer dev-dependencies and lint.

composer.json

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
],
2929
"require": {
3030
"php": ">=7.4",
31-
"axepress/wp-graphql-plugin-boilerplate": "^0.1.0"
31+
"axepress/wp-graphql-plugin-boilerplate": "^0.1.1"
3232
},
3333
"require-dev": {
34-
"axepress/wp-graphql-cs": "^2.0.0-beta",
34+
"axepress/wp-graphql-cs": "^2.0.0",
3535
"axepress/wp-graphql-stubs": "^2.0.0",
3636
"codeception/lib-innerbrowser": "^1.0",
3737
"codeception/module-asserts": "^1.0",
@@ -88,8 +88,13 @@
8888
"namespace_prefix": "WPGraphQL\\RankMath\\Vendor\\",
8989
"classmap_prefix": "WPGraphQL_RankMath_",
9090
"constant_prefix": "WPGRAPHQL_SEO_",
91-
"include_modified_date": false,
9291
"delete_vendor_packages": true,
92+
"include_modified_date": false,
93+
"update_call_sites": false,
94+
"exclude_from_prefix": {
95+
"namespaces": [],
96+
"file_patterns": []
97+
},
9398
"packages": [
9499
"axepress/wp-graphql-plugin-boilerplate"
95100
]
@@ -122,19 +127,25 @@
122127
"phpstan": [
123128
"vendor/bin/phpstan analyze --ansi --memory-limit=1G"
124129
],
125-
"strauss-install": [
126-
"test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/download/0.19.1/strauss.phar"
130+
"pre-prefix-namespaces": [
131+
"test -d vendor-prefixed || mkdir vendor-prefixed",
132+
"test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/download/0.22.2/strauss.phar"
127133
],
128-
"strauss": [
129-
"@strauss-install",
134+
"prefix-namespaces": [
130135
"@php bin/strauss.phar",
131-
"composer dump-autoload --optimize"
136+
"@composer dump-autoload"
137+
],
138+
"pre-install-cmd": [
139+
"@pre-prefix-namespaces"
140+
],
141+
"pre-update-cmd": [
142+
"@pre-install-cmd"
132143
],
133144
"post-install-cmd": [
134-
"@strauss"
145+
"@prefix-namespaces"
135146
],
136147
"post-update-cmd": [
137-
"@strauss"
148+
"@prefix-namespaces"
138149
]
139150
}
140151
}

0 commit comments

Comments
 (0)