Skip to content

Commit

Permalink
change style.css imports (#3709)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina authored Aug 9, 2024
1 parent db181b2 commit 9baf1f0
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 10 deletions.
12 changes: 12 additions & 0 deletions .changeset/breezy-chicken-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@graphiql/plugin-code-exporter': major
---

`style.css` import was changed

## Migration

```diff
-import '@graphiql/plugin-code-exporter/dist/style.css';
+import '@graphiql/plugin-code-exporter/style.css';
```
12 changes: 12 additions & 0 deletions .changeset/good-vans-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@graphiql/react': major
---

`style.css` import was changed

## Migration

```diff
-import '@graphiql/react/dist/style.css';
+import '@graphiql/react/style.css';
```
13 changes: 13 additions & 0 deletions .changeset/poor-ghosts-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@graphiql/plugin-code-exporter': major
---

`style.css` import was changed

## Migration

```diff
-import '@graphiql/plugin-code-exporter/dist/style.css';
+import '@graphiql/plugin-code-exporter/style.css';
```

4 changes: 2 additions & 2 deletions examples/graphiql-webpack/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { explorerPlugin } from '@graphiql/plugin-explorer';
import { getSnippets } from './snippets';
import { codeExporterPlugin } from '@graphiql/plugin-code-exporter';
import 'graphiql/style.css';
import '@graphiql/plugin-explorer/dist/style.css';
import '@graphiql/plugin-code-exporter/dist/style.css';
import '@graphiql/plugin-explorer/style.css';
import '@graphiql/plugin-code-exporter/style.css';
import { createGraphiQLFetcher } from '@graphiql/toolkit';
import { useStorageContext } from '@graphiql/react';

Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-plugin-code-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { GraphiQL } from 'graphiql';
import { createGraphiQLFetcher } from '@graphiql/toolkit';
import { codeExporterPlugin } from '@graphiql/plugin-code-exporter';
import 'graphiql/style.css';
import '@graphiql/plugin-code-exporter/dist/style.css';
import '@graphiql/plugin-code-exporter/style.css';

const fetcher = createGraphiQLFetcher({
url: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
Expand Down
9 changes: 9 additions & 0 deletions packages/graphiql-plugin-code-exporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
"files": [
"dist"
],
"exports": {
"./package.json": "./package.json",
"./style.css": "./dist/style.css",
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/types/index.d.ts"
}
},
"scripts": {
"dev": "vite build --watch",
"build": "vite build && UMD=true vite build",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-plugin-explorer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { GraphiQL } from 'graphiql';
import { createGraphiQLFetcher } from '@graphiql/toolkit';
import { explorerPlugin } from '@graphiql/plugin-explorer';
import 'graphiql/style.css';
import '@graphiql/plugin-explorer/dist/style.css';
import '@graphiql/plugin-explorer/style.css';

const fetcher = createGraphiQLFetcher({
url: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
Expand Down
9 changes: 9 additions & 0 deletions packages/graphiql-plugin-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
"files": [
"dist"
],
"exports": {
"./package.json": "./package.json",
"./style.css": "./dist/style.css",
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/types/index.d.ts"
}
},
"scripts": {
"dev": "vite build --watch",
"build": "vite build && UMD=true vite build",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function MyGraphQLIDE() {
```

The package also ships the necessary CSS that all its UI components need. You
can import them from `@graphiql/react/dist/style.css`.
can import them from `@graphiql/react/style.css`.

> **Note**: In order for these styles to apply, the UI components need to be
> rendered inside an element that has a class name `graphiql-container`.
Expand Down
7 changes: 3 additions & 4 deletions packages/graphiql-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
"module": "dist/index.mjs",
"exports": {
"./package.json": "./package.json",
"./style.css": "./dist/style.css",
"./font/*": "./font/*",
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/types/index.d.ts"
},
"./font/roboto.css": "./font/roboto.css",
"./font/fira-code.css": "./font/fira-code.css",
"./dist/style.css": "./dist/style.css"
}
},
"types": "dist/types/index.d.ts",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql/src/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import '@graphiql/react/font/roboto.css';
@import '@graphiql/react/font/fira-code.css';
@import '@graphiql/react/dist/style.css';
@import '@graphiql/react/style.css';

/* Everything */
.graphiql-container {
Expand Down

0 comments on commit 9baf1f0

Please sign in to comment.