diff --git a/.changesets/archive/2025-03-28-pr-18.md b/.changesets/archive/2025-03-28-pr-18.md new file mode 100644 index 000000000..e04117630 --- /dev/null +++ b/.changesets/archive/2025-03-28-pr-18.md @@ -0,0 +1,25 @@ +--- +title: "chore: update content type descriptions" +pr: 18 +author: jasonbahl +type: chore +breaking: false +--- + +## What does this implement/fix? Explain your changes. + +This adds support for passing `graphql_description` when registering a Post Type or Taxonomy. This field will be used as the description in the Schema for the Type representing the Post Type or Taxonomy. + +In addition to adding support for the `graphql_description` arg, this also updates the descriptions for the built in post types and taxonomies, as well as the User, Menu and Comment types. + +|GraphQL Type | Current Description | Improved Description | +|---------------|---------------------|----------------------| +| Category | "The category type" | "A taxonomy term that classifies content. Categories support hierarchy and can be used to create a nested structure." | +| Post | "The post type" | "A chronological content entry typically used for blog posts, news articles, or similar date-based content." | +| Page | "The page type" | "A standalone content entry generally used for static, non-chronological content such as About Us or Contact pages." | +| MediaItem | "The mediaItem type" | "Represents uploaded media, including images, videos, documents, and audio files." | +| User | "A User object" | "A registered user account. Users can be assigned roles, author content, and have various capabilities within the site." | +| Comment | "A Comment object" | "A response or reaction to content submitted by users. Comments are typically associated with a specific content entry." | +| Tag | "The tag type" | "A taxonomy term used to organize and classify content. Tags do not have a hierarchy and are generally used for more specific classifications." | +| PostFormat | "The postFormat type" | "A standardized classification system for content presentation styles. These formats can be used to display content differently based on type, such as "standard", "gallery", "video", etc." | +| Menu | "Menus are the containers for navigation items. Menus can be assigned to menu locations, which are typically registered by the active theme." | "Collections of navigation links. Menus can be assigned to designated locations and used to build site navigation structures." | diff --git a/.github/workflows/changeset-generation.yml b/.github/workflows/changeset-generation.yml index b54c8f391..1d4acb107 100644 --- a/.github/workflows/changeset-generation.yml +++ b/.github/workflows/changeset-generation.yml @@ -123,16 +123,18 @@ jobs: if [[ -n "$EXISTING_CHANGESETS" ]]; then echo "Found existing changeset(s) for PR #${{ steps.pr_info.outputs.pr_number }}, updating..." - # Remove existing changesets for this PR rm $EXISTING_CHANGESETS fi + # Write PR body to a temporary file to avoid shell interpretation issues + echo '${{ steps.pr_info.outputs.pr_body }}' > /tmp/pr_body.txt + # Generate/regenerate the changeset node scripts/generate-changeset.js \ --pr="${{ steps.pr_info.outputs.pr_number }}" \ --title="${{ steps.pr_info.outputs.pr_title }}" \ --author="${{ steps.pr_info.outputs.pr_author }}" \ - --body="${{ steps.pr_info.outputs.pr_body }}" + --body="$(cat /tmp/pr_body.txt)" # Commit and push the changeset git config --global user.name "GitHub Actions" @@ -187,10 +189,21 @@ jobs: - name: Check for existing release PR id: check_pr run: | + # Debug info + echo "Checking for PRs from develop to master..." + echo "Repository: ${{ github.repository }}" + echo "Owner: ${{ github.repository_owner }}" + # Check if there's already a PR from develop to master - PR_LIST=$(curl -s --max-time 30 -H "Authorization: token ${{ secrets.REPO_PAT }}" \ + # Note: Removed the owner prefix from head as it's already in the repo context + PR_LIST=$(curl -s --max-time 30 \ + -H "Authorization: token ${{ secrets.REPO_PAT }}" \ -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/${{ github.repository }}/pulls?state=open&head=${{ github.repository_owner }}:develop&base=master") + "https://api.github.com/repos/${{ github.repository }}/pulls?state=open&head=develop&base=master") + + # Debug the response + echo "API Response:" + echo "$PR_LIST" | jq '.' # Add error handling for API response if [[ $(echo "$PR_LIST" | jq -r 'if type=="array" then "valid" else "invalid" end') != "valid" ]]; then @@ -200,12 +213,15 @@ jobs: fi PR_COUNT=$(echo "$PR_LIST" | jq length) + echo "Found $PR_COUNT matching PRs" if [[ "$PR_COUNT" -gt 0 ]]; then PR_NUMBER=$(echo "$PR_LIST" | jq -r '.[0].number') + echo "Found existing PR #${PR_NUMBER}" echo "exists=true" >> $GITHUB_OUTPUT echo "number=${PR_NUMBER}" >> $GITHUB_OUTPUT else + echo "No existing PR found" echo "exists=false" >> $GITHUB_OUTPUT fi diff --git a/CHANGELOG.md b/CHANGELOG.md index fc3a24d2c..0aeac4c0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v2.1.2 - 2025-11-01 + +### Other Changes + +- chore: update content type descriptions ([#18](https://github.com/jasonbahl/automation-tests/pull/18)) + ## v2.1.1 - 2025-03-19 ### Bug Fixes diff --git a/constants.php b/constants.php index f91ad3889..aed6b455e 100644 --- a/constants.php +++ b/constants.php @@ -18,7 +18,7 @@ function graphql_setup_constants() { // Plugin version. if ( ! defined( 'WPGRAPHQL_VERSION' ) ) { - define( 'WPGRAPHQL_VERSION', '2.1.1' ); + define( 'WPGRAPHQL_VERSION', '2.1.2' ); } // Plugin Folder Path. diff --git a/package-lock.json b/package-lock.json index 0bce29eec..519676a80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wp-graphql", - "version": "2.1.0", + "version": "2.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wp-graphql", - "version": "2.1.0", + "version": "2.1.1", "license": "GPL-3.0", "dependencies": { "@ant-design/icons": "5.6.1", @@ -21,6 +21,7 @@ "antd": "5.23.4", "graphiql": "1.11.5", "graphql": "16.10.0", + "js-yaml": "^4.1.0", "lz-string": "1.5.0", "query-string": "7.1.3", "styled-components": "5.3.11", @@ -2239,11 +2240,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/argparse": { - "version": "2.0.1", - "dev": true, - "license": "Python-2.0" - }, "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { "version": "1.1.11", "dev": true, @@ -2267,17 +2263,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@eslint/eslintrc/node_modules/js-yaml": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { "version": "3.1.2", "dev": true, @@ -2926,6 +2911,16 @@ "node": ">=8" } }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, "node_modules/@istanbuljs/load-nyc-config/node_modules/camelcase": { "version": "5.3.1", "dev": true, @@ -2934,6 +2929,27 @@ "node": ">=6" } }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause" + }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "dev": true, @@ -5924,6 +5940,30 @@ "npm": ">=8.19.2" } }, + "node_modules/@wordpress/env/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@wordpress/env/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@wordpress/env/node_modules/rimraf": { "version": "5.0.10", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", @@ -5940,6 +5980,13 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/@wordpress/env/node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause" + }, "node_modules/@wordpress/escape-html": { "version": "3.17.0", "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-3.17.0.tgz", @@ -7130,17 +7177,10 @@ } }, "node_modules/argparse": { - "version": "1.0.10", - "dev": true, - "license": "MIT", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/argparse/node_modules/sprintf-js": { - "version": "1.0.3", - "dev": true, - "license": "BSD-3-Clause" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" }, "node_modules/aria-query": { "version": "5.3.2", @@ -8998,22 +9038,6 @@ } } }, - "node_modules/cosmiconfig/node_modules/argparse": { - "version": "2.0.1", - "dev": true, - "license": "Python-2.0" - }, - "node_modules/cosmiconfig/node_modules/js-yaml": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/crc-32": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", @@ -11021,11 +11045,6 @@ "node": ">=10" } }, - "node_modules/eslint/node_modules/argparse": { - "version": "2.0.1", - "dev": true, - "license": "Python-2.0" - }, "node_modules/eslint/node_modules/brace-expansion": { "version": "1.1.11", "dev": true, @@ -11090,17 +11109,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/js-yaml": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/eslint/node_modules/locate-path": { "version": "6.0.0", "dev": true, @@ -14520,12 +14528,12 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "3.14.1", - "dev": true, + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "license": "MIT", "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" @@ -15634,10 +15642,6 @@ "markdown-it": "bin/markdown-it.js" } }, - "node_modules/markdown-it/node_modules/argparse": { - "version": "2.0.1", - "license": "Python-2.0" - }, "node_modules/markdown-it/node_modules/entities": { "version": "2.1.0", "license": "BSD-2-Clause", @@ -15679,11 +15683,6 @@ "node": ">=12" } }, - "node_modules/markdownlint-cli/node_modules/argparse": { - "version": "2.0.1", - "dev": true, - "license": "Python-2.0" - }, "node_modules/markdownlint-cli/node_modules/brace-expansion": { "version": "1.1.11", "dev": true, @@ -15744,17 +15743,6 @@ "node": ">= 4" } }, - "node_modules/markdownlint-cli/node_modules/js-yaml": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/markdownlint-cli/node_modules/minimatch": { "version": "3.0.8", "dev": true, diff --git a/package.json b/package.json index 2409c774e..f8315e829 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "wp-graphql", "private": true, - "version": "2.1.1", + "version": "2.1.2", "description": "GraphQL API for WordPress", "homepage": "https://github.com/wp-graphql/wp-graphql#readme", "author": "WPGraphQL (https://www.wpgraphql.com)", @@ -65,7 +65,8 @@ "query-string": "7.1.3", "styled-components": "5.3.11", "use-error-boundary": "2.0.6", - "use-query-params": "1.2.3" + "use-query-params": "1.2.3", + "js-yaml": "^4.1.0" }, "devDependencies": { "@babel/preset-env": "^7.26.8", diff --git a/readme.txt b/readme.txt index 8dbf4365a..5e5426983 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: GraphQL, Headless, REST API, Decoupled, React Requires at least: 6.0 Tested up to: 6.7.1 Requires PHP: 7.4 -Stable tag: 2.1.1 +Stable tag: 2.1.2 License: GPL-3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -284,6 +284,12 @@ Composer dependencies are no longer versioned in Github. Recommended install sou == Changelog == += 2.1.2 = + +**Other Changes** + +* chore: update content type descriptions (https://github.com/jasonbahl/automation-tests/pull/18) + = 2.1.1 = **Bug Fixes** diff --git a/release_notes.md b/release_notes.md deleted file mode 100644 index fb5915001..000000000 --- a/release_notes.md +++ /dev/null @@ -1,12 +0,0 @@ -## Release Notes - - - -No .changesets directory found. Creating one... -No changes to release at this time. - -### `@since` Tag / Deprecation Placeholder Updates - -Updated 1 version placeholder in the following files: - -* `src/Request.php` (1 update) diff --git a/scripts/generate-changeset.js b/scripts/generate-changeset.js index 01688b112..c015248e5 100755 --- a/scripts/generate-changeset.js +++ b/scripts/generate-changeset.js @@ -29,7 +29,7 @@ const yargs = require('yargs/yargs'); const { hideBin } = require('yargs/helpers'); const { getEnvVar } = require('./utils/env'); const chalk = require('chalk'); -const yaml = require('yaml'); +const yaml = require('js-yaml'); // Get GitHub token from environment variables // This will work with both GitHub Actions (GITHUB_TOKEN) and local .env file @@ -130,13 +130,18 @@ const getMilestoneName = (branchRef) => { /** * Generate a changeset file */ -async function generateChangeset() { +const generateChangeset = async ({ + pr, + title, + author, + body, + branchRef +}) => { // Create .changesets directory if it doesn't exist const changesetDir = path.join(process.cwd(), '.changesets'); await fs.ensureDir(changesetDir); // Extract PR information - const { pr, title, author, body, branchRef } = argv; const changeType = extractChangeType(title); const breaking = isBreakingChange(title, body); const milestone = getMilestoneName(branchRef); @@ -151,7 +156,7 @@ async function generateChangeset() { }; const content = `--- -${yaml.dump(changesetData)}--- +${yaml.dump(changesetData, { quotingType: '"' })}--- ${body || title} `; @@ -161,12 +166,13 @@ ${body || title} const filename = path.join(changesetDir, `${timestamp}-pr-${pr}.md`); // Write changeset file - await fs.writeFile(filename, content); + await fs.promises.writeFile(filename, content, 'utf8'); console.log(`Changeset created: ${filename}`); -} + return filename; +}; // Run the script -generateChangeset().catch(err => { +generateChangeset(argv).catch(err => { console.error('Error generating changeset:', err); process.exit(1); }); \ No newline at end of file diff --git a/src/Request.php b/src/Request.php index fb9b0021c..5f09aca73 100644 --- a/src/Request.php +++ b/src/Request.php @@ -730,7 +730,7 @@ private function is_valid_http_content_type(): bool { * @param bool $is_valid Whether the content type is valid * @param string $content_type The content type header value that was received * - * @since next-version + * @since 2.1.2 */ return (bool) apply_filters( 'graphql_is_valid_http_content_type', $is_valid, $content_type ); } diff --git a/wp-graphql.php b/wp-graphql.php index b5c02b194..67abb116b 100644 --- a/wp-graphql.php +++ b/wp-graphql.php @@ -6,7 +6,7 @@ * Description: GraphQL API for WordPress * Author: WPGraphQL * Author URI: http://www.wpgraphql.com - * Version: 2.1.1 + * Version: 2.1.2 * Text Domain: wp-graphql * Domain Path: /languages/ * Requires at least: 6.0 @@ -18,7 +18,7 @@ * @package WPGraphQL * @category Core * @author WPGraphQL - * @version 2.1.1 + * @version 2.1.2 */ // Exit if accessed directly.