-
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/plugin-utils
& docs, redo #3328 off main
- Loading branch information
Showing
20 changed files
with
979 additions
and
171 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
11 changes: 0 additions & 11 deletions
11
packages/graphiql-plugin-code-exporter/resources/copy-types.mjs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,5 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ESNext", | ||
"useDefineForClassFields": true, | ||
"lib": ["DOM", "DOM.Iterable", "ESNext"], | ||
"allowJs": false, | ||
"skipLibCheck": true, | ||
"esModuleInterop": false, | ||
"allowSyntheticDefaultImports": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"declaration": true, | ||
"declarationDir": "types", | ||
"jsx": "react" | ||
}, | ||
"extends": "@graphiql/plugin-utils/base.tsconfig.json", | ||
"include": ["src"], | ||
"references": [{ "path": "./tsconfig.node.json" }] | ||
"exclude": ["node_modules"] | ||
} |
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 |
---|---|---|
@@ -1,9 +1,4 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"allowSyntheticDefaultImports": true | ||
}, | ||
"extends": "@graphiql/plugin-utils/vite.config.tsconfig.json", | ||
"include": ["vite.config.ts"] | ||
} |
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 |
---|---|---|
@@ -1,38 +1,7 @@ | ||
import { defineConfig } from 'vite'; | ||
import react from '@vitejs/plugin-react'; | ||
import packageJSON from './package.json'; | ||
|
||
const IS_UMD = process.env.UMD === 'true'; | ||
import { graphiqlVitePlugin } from '@graphiql/plugin-utils'; | ||
|
||
export default defineConfig({ | ||
plugins: [react({ jsxRuntime: 'classic' })], | ||
build: { | ||
// avoid clean cjs/es builds | ||
emptyOutDir: !IS_UMD, | ||
lib: { | ||
entry: 'src/index.tsx', | ||
fileName: 'index', | ||
name: 'GraphiQLPluginCodeExporter', | ||
formats: IS_UMD ? ['umd'] : ['cjs', 'es'], | ||
}, | ||
rollupOptions: { | ||
external: [ | ||
// Exclude peer dependencies and dependencies from bundle | ||
...Object.keys(packageJSON.peerDependencies), | ||
...(IS_UMD ? [] : Object.keys(packageJSON.dependencies)), | ||
], | ||
output: { | ||
chunkFileNames: '[name].[format].js', | ||
globals: { | ||
graphql: 'GraphiQL.GraphQL', | ||
react: 'React', | ||
'react-dom': 'ReactDOM', | ||
}, | ||
}, | ||
}, | ||
commonjsOptions: { | ||
esmExternals: true, | ||
requireReturnsDefault: 'auto', | ||
}, | ||
}, | ||
plugins: graphiqlVitePlugin({ umdExportName: 'GraphiQLPluginCodeExporter' }), | ||
}); |
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
11 changes: 0 additions & 11 deletions
11
packages/graphiql-plugin-explorer/resources/copy-types.mjs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,5 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ESNext", | ||
"useDefineForClassFields": true, | ||
"lib": ["DOM", "DOM.Iterable", "ESNext"], | ||
"allowJs": false, | ||
"skipLibCheck": true, | ||
"esModuleInterop": false, | ||
"allowSyntheticDefaultImports": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"declaration": true, | ||
"declarationDir": "types", | ||
"jsx": "react" | ||
}, | ||
"extends": "@graphiql/plugin-utils/base.tsconfig.json", | ||
"include": ["src"], | ||
"references": [{ "path": "./tsconfig.node.json" }] | ||
"exclude": ["node_modules"] | ||
} |
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 |
---|---|---|
@@ -1,9 +1,4 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"allowSyntheticDefaultImports": true | ||
}, | ||
"extends": "@graphiql/plugin-utils/vite.config.tsconfig.json", | ||
"include": ["vite.config.ts"] | ||
} |
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 |
---|---|---|
@@ -1,39 +1,7 @@ | ||
import { defineConfig } from 'vite'; | ||
import react from '@vitejs/plugin-react'; | ||
import packageJSON from './package.json'; | ||
|
||
const IS_UMD = process.env.UMD === 'true'; | ||
import { graphiqlVitePlugin } from '@graphiql/plugin-utils'; | ||
|
||
export default defineConfig({ | ||
plugins: [react({ jsxRuntime: 'classic' })], | ||
build: { | ||
// avoid clean cjs/es builds | ||
emptyOutDir: !IS_UMD, | ||
lib: { | ||
entry: 'src/index.tsx', | ||
fileName: 'index', | ||
name: 'GraphiQLPluginExplorer', | ||
formats: IS_UMD ? ['umd'] : ['cjs', 'es'], | ||
}, | ||
rollupOptions: { | ||
external: [ | ||
// Exclude peer dependencies and dependencies from bundle | ||
...Object.keys(packageJSON.peerDependencies), | ||
...(IS_UMD ? [] : Object.keys(packageJSON.dependencies)), | ||
], | ||
output: { | ||
chunkFileNames: '[name].[format].js', | ||
globals: { | ||
'@graphiql/react': 'GraphiQL.React', | ||
graphql: 'GraphiQL.GraphQL', | ||
react: 'React', | ||
'react-dom': 'ReactDOM', | ||
}, | ||
}, | ||
}, | ||
commonjsOptions: { | ||
esmExternals: true, | ||
requireReturnsDefault: 'auto', | ||
}, | ||
}, | ||
plugins: graphiqlVitePlugin({ umdExportName: 'GraphiQLPluginExplorer' }), | ||
}); |
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,25 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"compilerOptions": { | ||
"target": "ESNext", | ||
"useDefineForClassFields": true, | ||
"lib": ["DOM", "DOM.Iterable", "ESNext"], | ||
"allowJs": false, | ||
"skipLibCheck": true, | ||
"esModuleInterop": false, | ||
"allowSyntheticDefaultImports": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"declaration": true, | ||
"declarationDir": "types", | ||
"jsx": "react", | ||
"outDir": "dist", | ||
"baseUrl": "." | ||
}, | ||
"include": ["src"], | ||
"references": [{ "path": "./tsconfig.node.json" }] | ||
} |
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,44 @@ | ||
{ | ||
"name": "@graphiql/plugin-utils", | ||
"description": "shared tooling for building graphiql plugins", | ||
"version": "0.0.1", | ||
"license": "MIT", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Rikki Schulte", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
"./base.tsconfig.json": "./base.tsconfig.json", | ||
"./vite.config.tsconfig.json": "./vite.config.tsconfig.json", | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs" | ||
} | ||
}, | ||
"files": [ | ||
"*.json", | ||
"dist", | ||
"cjs" | ||
], | ||
"scripts": { | ||
"build": "tsup --dts --format esm,cjs src/index.ts" | ||
}, | ||
"dependencies": { | ||
"vite": "^4.3.9", | ||
"vite-plugin-dts": "^3.1.1", | ||
"vite-plugin-svgr": "^3.2.0", | ||
"postcss-nesting": "12.0.0", | ||
"@vitejs/plugin-react": "^4.0.2", | ||
"@graphiql/react": "^0.18.0", | ||
"tsup": "^7.1.0" | ||
} | ||
} |
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 @@ | ||
export * from './vite-plugin'; |
Oops, something went wrong.