Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Jun 19, 2024
1 parent d9805b1 commit 2fc3603
Show file tree
Hide file tree
Showing 18 changed files with 99 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
react: { version: 'detect' },
},
rules: {
'import/no-unresolved': ['error', { ignore: ['jotai-zustand'] }],
'import/no-unresolved': ['error', { ignore: ['jotai-relay'] }],
'@typescript-eslint/no-unused-vars': [
'error',
{
Expand Down
1 change: 1 addition & 0 deletions examples/01_minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"devDependencies": {
"@types/react": "latest",
"@types/react-dom": "latest",
"@types/relay-runtime": "latest",
"typescript": "latest",
"vite": "latest"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
graphql,
} from 'relay-runtime';

import type { AppCountriesQuery } from './__generated__/AppCountriesQuery.graphql';

const myEnvironment = new Environment({
network: Network.create(async (params, variables) => {
const response = await fetch('https://countries.trevorblades.com/', {
Expand All @@ -27,7 +29,7 @@ const myEnvironment = new Environment({
store: new Store(new RecordSource()),
});

const countriesAtom = atomWithQuery(
const countriesAtom = atomWithQuery<AppCountriesQuery>(
graphql`
query AppCountriesQuery {
countries {
Expand Down
5 changes: 0 additions & 5 deletions examples/01_minimal/src/index.js

This file was deleted.

10 changes: 10 additions & 0 deletions examples/01_minimal/src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';

import App from './app';

createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
);
2 changes: 1 addition & 1 deletion examples/02_typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"type": "module",
"private": true,
"dependencies": {
"@types/relay-runtime": "latest",
"babel-plugin-relay": "latest",
"jotai": "latest",
"jotai-relay": "latest",
Expand All @@ -15,6 +14,7 @@
"devDependencies": {
"@types/react": "latest",
"@types/react-dom": "latest",
"@types/relay-runtime": "latest",
"typescript": "latest",
"vite": "latest"
},
Expand Down
3 changes: 3 additions & 0 deletions examples/02_typescript/relay.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// eslint-disable-next-line no-undef
module.exports = {
language: 'typescript',
// eslint-disable-next-line no-undef
src: `${__dirname}/src`,
// eslint-disable-next-line no-undef
schema: `${__dirname}/data/schema.graphql`,
exclude: ['**/node_modules/**', '**/__mocks__/**', '**/__generated__/**'],
};
File renamed without changes.
8 changes: 0 additions & 8 deletions examples/02_typescript/src/index.tsx

This file was deleted.

10 changes: 10 additions & 0 deletions examples/02_typescript/src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';

import App from './app';

createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
);
2 changes: 1 addition & 1 deletion examples/03_errorhandling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"type": "module",
"private": true,
"dependencies": {
"@types/relay-runtime": "latest",
"babel-plugin-relay": "latest",
"jotai": "latest",
"jotai-relay": "latest",
Expand All @@ -16,6 +15,7 @@
"devDependencies": {
"@types/react": "latest",
"@types/react-dom": "latest",
"@types/relay-runtime": "latest",
"typescript": "latest",
"vite": "latest"
},
Expand Down
1 change: 1 addition & 0 deletions examples/03_errorhandling/relay.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line no-undef
module.exports = {
language: 'typescript',
// eslint-disable-next-line no-undef
Expand Down
File renamed without changes.
8 changes: 0 additions & 8 deletions examples/03_errorhandling/src/index.tsx

This file was deleted.

10 changes: 10 additions & 0 deletions examples/03_errorhandling/src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';

import App from './app';

createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.12",
"@types/node": "^20.14.5",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-relay": "^16.0.6",
"@types/relay-runtime": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"babel-loader": "^9.1.3",
Expand Down
Loading

0 comments on commit 2fc3603

Please sign in to comment.