Skip to content

Commit

Permalink
aa
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Dec 14, 2024
1 parent 51ce452 commit f9a5beb
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 24 deletions.
2 changes: 2 additions & 0 deletions packages/graphiql-react/setup-files.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
'use no memo';

import '@testing-library/jest-dom';
2 changes: 2 additions & 0 deletions packages/graphiql-react/src/editor/__tests__/common.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use no memo';

import { importCodeMirror } from '../common';

describe('importCodeMirror', () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/graphiql-react/src/editor/__tests__/tabs.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use no memo';

import { StorageAPI } from '@graphiql/toolkit';
import {
createTab,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use no memo';

import { invalidCharacters, normalizeWhitespace } from '../whitespace';

describe('normalizeWhitespace', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use no memo';

import { render } from '@testing-library/react';
import { GraphQLInt, GraphQLObjectType, GraphQLSchema } from 'graphql';
import { useContext, useEffect } from 'react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use no memo';

import { fireEvent, render } from '@testing-library/react';
import { GraphQLString, GraphQLObjectType, Kind } from 'graphql';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use no memo';

import { GraphQLNamedType, GraphQLType } from 'graphql';

import { ExplorerContextType, ExplorerNavStackItem } from '../../context';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use no memo';

import { fireEvent, render } from '@testing-library/react';
import {
GraphQLBoolean,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use no memo';

import { fireEvent, render } from '@testing-library/react';
import { GraphQLNonNull, GraphQLList, GraphQLString } from 'graphql';
import { ComponentProps } from 'react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Mock } from 'vitest'
'use no memo';

import { Mock } from 'vitest';
import { fireEvent, render } from '@testing-library/react';
import { ComponentProps } from 'react';
import { formatQuery, HistoryItem } from '../components';
Expand Down
30 changes: 16 additions & 14 deletions packages/graphiql-react/vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from 'vite';
import { defineConfig, PluginOption } from 'vite';
import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';
import postCssNestingPlugin from 'postcss-nesting';
Expand All @@ -7,24 +7,26 @@ import packageJSON from './package.json';
const ReactCompilerConfig = {
target: '17',
sources(filename) {
if (filename.includes('__tests__')) return false;
return filename.includes('graphiql-react');
},
};

export const plugins: PluginOption[] = [
react({
babel: {
plugins: [['babel-plugin-react-compiler', ReactCompilerConfig]],
},
}),
svgr({
svgrOptions: {
titleProp: true,
},
}),
];

export default defineConfig({
plugins: [
react({
babel: {
plugins: [['babel-plugin-react-compiler', ReactCompilerConfig]],
},
}),
svgr({
exportAsDefault: true,
svgrOptions: {
titleProp: true,
},
}),
],
plugins,
css: {
postcss: {
plugins: [postCssNestingPlugin()],
Expand Down
11 changes: 2 additions & 9 deletions packages/graphiql-react/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import { defineConfig } from 'vitest/config';
import svgr from 'vite-plugin-svgr';
import { plugins } from './vite.config.mjs';

export default defineConfig({
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./setup-files.ts'],
},
plugins: [
svgr({
exportAsDefault: true,
svgrOptions: {
titleProp: true,
},
}),
],
plugins,
});

0 comments on commit f9a5beb

Please sign in to comment.