Skip to content

extract doc-explorer plugin from @graphiql/react and publish as @graphiql/plugin-doc-explorer package #3916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

dimaMachina
Copy link
Collaborator

@dimaMachina dimaMachina commented May 4, 2025

similar to #3911

related #2904
part of #3874

can be published as @graphiql/react 0.32.0 since according semver 0.x treated as major changes

closes #3393

cc @acao I used your approach from #3393 with referencePlugin, schemaReference and setSchemaReference

Copy link

changeset-bot bot commented May 4, 2025

🦋 Changeset detected

Latest commit: 8c6762f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@graphiql/plugin-doc-explorer Patch
@graphiql/react Minor
graphiql Patch
@graphiql/plugin-code-exporter Major
@graphiql/plugin-explorer Major
@graphiql/plugin-history Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented May 4, 2025

The latest changes of this PR are available as canary in npm (based on the declared changesets):

@dimaMachina dimaMachina marked this pull request as ready for review May 4, 2025 20:56
Copy link

codecov bot commented May 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.92%. Comparing base (2b5d200) to head (8c6762f).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3916      +/-   ##
==========================================
- Coverage   63.93%   63.92%   -0.02%     
==========================================
  Files          35       35              
  Lines        3086     3085       -1     
  Branches      935      949      +14     
==========================================
- Hits         1973     1972       -1     
  Misses       1108     1108              
  Partials        5        5              
Files with missing lines Coverage Δ
packages/graphiql/test/schema.js 36.76% <100.00%> (-0.92%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dimaMachina dimaMachina requested a review from Copilot May 4, 2025 21:29
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extracts the doc-explorer plugin from @graphiql/react into its own package (@graphiql/plugin-doc-explorer) and updates related references accordingly. Key changes include updating import paths for various components and tests, updating the schema file extension in functions/graphql.ts, and adding a new ESLint rule for array operations.

Reviewed Changes

Copilot reviewed 61 out of 62 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/graphiql-plugin-doc-explorer/src/components/deprecation-reason.tsx Updated MarkdownContent import to use the published package
packages/graphiql-plugin-doc-explorer/src/components/argument.tsx Updated MarkdownContent import to use the published package
packages/graphiql-plugin-doc-explorer/src/components/tests/type-documentation.spec.tsx Updated SchemaContext import to use the published package
packages/graphiql-plugin-doc-explorer/src/components/tests/doc-explorer.spec.tsx Updated SchemaContext import to use the published package
packages/graphiql-plugin-doc-explorer/README.md Added header for the new package
functions/graphql.ts Changed schema import from a JavaScript to a CommonJS file
.eslintrc.js Added ESLint rule for preferring Array.some
.changeset/gentle-houses-add.md Documented version bumps and export removals
Files not reviewed (1)
  • packages/graphiql-plugin-doc-explorer/package.json: Language not supported
Comments suppressed due to low confidence (2)

functions/graphql.ts:13

  • Verify that switching the schema import from '.js' to '.cjs' is intentional and that all build and runtime configurations support loading CommonJS modules.
import schema from '../packages/graphiql/test/schema.cjs';

.eslintrc.js:361

  • [nitpick] Ensure that the new 'unicorn/prefer-array-some' rule is consistent with the project's code style guidelines and does not conflict with other ESLint rules in use.
'unicorn/prefer-array-some': 'error',

@dimaMachina dimaMachina requested a review from Copilot May 4, 2025 23:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extracts the doc-explorer plugin from the @graphiql/react package into its own package (@graphiql/plugin-doc-explorer). It updates import paths across source and test files, adjusts the schema import in the GraphQL function, adds a new ESLint rule, and introduces a basic README for the new package.

Reviewed Changes

Copilot reviewed 61 out of 62 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/graphiql-plugin-doc-explorer/src/components/deprecation-reason.tsx Updated import to use '@graphiql/react'.
packages/graphiql-plugin-doc-explorer/src/components/argument.tsx Updated import to use '@graphiql/react'.
packages/graphiql-plugin-doc-explorer/src/components/tests/type-documentation.spec.tsx Updated import to use '@graphiql/react'.
packages/graphiql-plugin-doc-explorer/src/components/tests/doc-explorer.spec.tsx Updated import to use '@graphiql/react'.
packages/graphiql-plugin-doc-explorer/README.md Added initial README for the new package.
functions/graphql.ts Changed schema import from schema to testSchema.
.eslintrc.js Added the unicorn/prefer-array-some ESLint rule.
.changeset/gentle-houses-add.md Documented version changes for affected packages.
Files not reviewed (1)
  • packages/graphiql-plugin-doc-explorer/package.json: Language not supported
Comments suppressed due to low confidence (1)

functions/graphql.ts:13

  • Confirm that using 'testSchema' as the schema in the handler is intentional for production usage. If it is meant only for testing, consider providing a separate production schema to avoid any unintended behavior.
import { testSchema } from '../packages/graphiql/test/schema.js';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant