-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[@graphiql/react]: exclude peer dependencies and dependencies from bu…
…ndle (#3228)
- Loading branch information
1 parent
5c3268a
commit 67bf93a
Showing
7 changed files
with
831 additions
and
705 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@graphiql/react': patch | ||
--- | ||
|
||
exclude peer dependencies and dependencies from bundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,7 @@ wsrun | |
lezer | ||
buildhelper | ||
sonarjs | ||
|
||
svgr | ||
|
||
// identifiers used in code and configs | ||
acmerc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { ComponentProps, FC } from 'react'; | ||
|
||
import _ArgumentIcon from './argument.svg'; | ||
import _ChevronDownIcon from './chevron-down.svg'; | ||
import _ChevronLeftIcon from './chevron-left.svg'; | ||
import _ChevronUpIcon from './chevron-up.svg'; | ||
import _CloseIcon from './close.svg'; | ||
import _CopyIcon from './copy.svg'; | ||
import _DeprecatedArgumentIcon from './deprecated-argument.svg'; | ||
import _DeprecatedEnumValueIcon from './deprecated-enum-value.svg'; | ||
import _DeprecatedFieldIcon from './deprecated-field.svg'; | ||
import _DirectiveIcon from './directive.svg'; | ||
import _DocsFilledIcon from './docs-filled.svg'; | ||
import _DocsIcon from './docs.svg'; | ||
import _EnumValueIcon from './enum-value.svg'; | ||
import _FieldIcon from './field.svg'; | ||
import _HistoryIcon from './history.svg'; | ||
import _ImplementsIcon from './implements.svg'; | ||
import _KeyboardShortcutIcon from './keyboard-shortcut.svg'; | ||
import _MagnifyingGlassIcon from './magnifying-glass.svg'; | ||
import _MergeIcon from './merge.svg'; | ||
import _PenIcon from './pen.svg'; | ||
import _PlayIcon from './play.svg'; | ||
import _PlusIcon from './plus.svg'; | ||
import _PrettifyIcon from './prettify.svg'; | ||
import _ReloadIcon from './reload.svg'; | ||
import _RootTypeIcon from './root-type.svg'; | ||
import _SettingsIcon from './settings.svg'; | ||
import _StarFilledIcon from './star-filled.svg'; | ||
import _StarIcon from './star.svg'; | ||
import _StopIcon from './stop.svg'; | ||
import _TypeIcon from './type.svg'; | ||
|
||
export const ArgumentIcon = generateIcon(_ArgumentIcon); | ||
export const ChevronDownIcon = generateIcon(_ChevronDownIcon); | ||
export const ChevronLeftIcon = generateIcon(_ChevronLeftIcon); | ||
export const ChevronUpIcon = generateIcon(_ChevronUpIcon); | ||
export const CloseIcon = generateIcon(_CloseIcon); | ||
export const CopyIcon = generateIcon(_CopyIcon); | ||
export const DeprecatedArgumentIcon = generateIcon(_DeprecatedArgumentIcon); | ||
export const DeprecatedEnumValueIcon = generateIcon(_DeprecatedEnumValueIcon); | ||
export const DeprecatedFieldIcon = generateIcon(_DeprecatedFieldIcon); | ||
export const DirectiveIcon = generateIcon(_DirectiveIcon); | ||
export const DocsFilledIcon = generateIcon(_DocsFilledIcon, 'filled docs icon'); | ||
export const DocsIcon = generateIcon(_DocsIcon); | ||
export const EnumValueIcon = generateIcon(_EnumValueIcon); | ||
export const FieldIcon = generateIcon(_FieldIcon); | ||
export const HistoryIcon = generateIcon(_HistoryIcon); | ||
export const ImplementsIcon = generateIcon(_ImplementsIcon); | ||
export const KeyboardShortcutIcon = generateIcon(_KeyboardShortcutIcon); | ||
export const MagnifyingGlassIcon = generateIcon(_MagnifyingGlassIcon); | ||
export const MergeIcon = generateIcon(_MergeIcon); | ||
export const PenIcon = generateIcon(_PenIcon); | ||
export const PlayIcon = generateIcon(_PlayIcon); | ||
export const PlusIcon = generateIcon(_PlusIcon); | ||
export const PrettifyIcon = generateIcon(_PrettifyIcon); | ||
export const ReloadIcon = generateIcon(_ReloadIcon); | ||
export const RootTypeIcon = generateIcon(_RootTypeIcon); | ||
export const SettingsIcon = generateIcon(_SettingsIcon); | ||
export const StarFilledIcon = generateIcon(_StarFilledIcon, 'filled star icon'); | ||
export const StarIcon = generateIcon(_StarIcon); | ||
export const StopIcon = generateIcon(_StopIcon); | ||
export const TypeIcon = generateIcon(_TypeIcon); | ||
|
||
function generateIcon( | ||
RawComponent: any, | ||
title = RawComponent.name | ||
// Icon component name starts with `Svg${CamelCaseFilename without .svg}` | ||
.replace('Svg', '') | ||
// Insert a space before all caps | ||
.replaceAll(/([A-Z])/g, ' $1') | ||
.trimStart() | ||
.toLowerCase() + ' icon', | ||
): FC<ComponentProps<'svg'>> { | ||
RawComponent.defaultProps = { title }; | ||
return RawComponent; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.