Skip to content

Commit

Permalink
Module-first setup
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed May 23, 2024
1 parent e4609d6 commit 65bc84c
Show file tree
Hide file tree
Showing 33 changed files with 2,290 additions and 7,932 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

39 changes: 39 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* eslint-env node */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
'prettier',
],
ignorePatterns: ['dist/'],
settings: {
'import/resolver': {
typescript: true,
},
react: { version: 'detect' },
},
rules: {
'import/no-unresolved': ['error', { ignore: ['jotai-trpc'] }],
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
},
};
61 changes: 0 additions & 61 deletions .eslintrc.json

This file was deleted.

2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/pnpm-lock.yaml
/dist
4 changes: 0 additions & 4 deletions .prettierrc

This file was deleted.

20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,62 @@
## [Unreleased]

## [0.6.1] - 2024-04-09

### Changed

- Fix refresh query atom type #22

## [0.6.0] - 2024-03-11

### Changed

- feat: refreshable query atom #19

## [0.5.1] - 2023-04-26

### Changed

- feat: disabled option in atomWithQuery, support async input #14

## [0.5.0] - 2023-01-31

### Added

- Migrate to Jotai v2 API #8

## [0.4.1] - 2022-11-29

### Changed

- fix: should be mutate method, instead of mutation #10

## [0.4.0] - 2022-11-22

### Added

- trpc 10 migration #6

## [0.3.0] - 2022-09-24

### Added

- feat: atomWithSubscription #7
- feat: atomWithMutation #5

## [0.2.0] - 2022-08-29

### Changed

- breaking: split path from args #2

## [0.1.1] - 2022-08-26

### Changed

- fix types #1

## [0.1.0] - 2022-08-25

### Added

- Initial release
7 changes: 0 additions & 7 deletions __tests__/01_basic_spec.tsx

This file was deleted.

9 changes: 9 additions & 0 deletions examples/01_typescript/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<html>
<head>
<title>example</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
30 changes: 12 additions & 18 deletions examples/01_typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
{
"name": "jotai-trpc-example",
"version": "0.1.0",
"name": "example",
"version": "0.0.0",
"private": true,
"type": "module",
"dependencies": {
"@trpc/client": "latest",
"@trpc/server": "latest",
"@types/react": "latest",
"@types/react-dom": "latest",
"jotai": "latest",
"jotai-trpc": "latest",
"react": "latest",
"react-dom": "latest",
"react-scripts": "latest",
"trpc-pokemon": "latest",
"typescript": "latest"
"trpc-pokemon": "latest"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"devDependencies": {
"@types/react": "latest",
"@types/react-dom": "latest",
"typescript": "latest",
"vite": "latest"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
"scripts": {
"dev": "vite"
}
}
8 changes: 0 additions & 8 deletions examples/01_typescript/public/index.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Suspense } from 'react';
import { Suspense } from 'react';
import { useAtom } from 'jotai/react';
import { atom } from 'jotai/vanilla';
import { httpLink } from '@trpc/client';
Expand Down
9 changes: 0 additions & 9 deletions examples/01_typescript/src/index.tsx

This file was deleted.

10 changes: 10 additions & 0 deletions examples/01_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>,
);
14 changes: 14 additions & 0 deletions examples/01_typescript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"strict": true,
"target": "es2018",
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"skipLibCheck": true,
"allowJs": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"jsx": "react-jsx"
}
}
9 changes: 9 additions & 0 deletions examples/02_authtoken/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<html>
<head>
<title>example</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
30 changes: 12 additions & 18 deletions examples/02_authtoken/package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
{
"name": "jotai-trpc-example",
"version": "0.1.0",
"name": "example",
"version": "0.0.0",
"private": true,
"type": "module",
"dependencies": {
"@trpc/client": "latest",
"@trpc/server": "latest",
"@types/react": "latest",
"@types/react-dom": "latest",
"jotai": "latest",
"jotai-trpc": "latest",
"react": "latest",
"react-dom": "latest",
"react-error-boundary": "latest",
"react-scripts": "latest",
"trpc-pokemon": "latest",
"typescript": "latest"
"trpc-pokemon": "latest"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"devDependencies": {
"@types/react": "latest",
"@types/react-dom": "latest",
"typescript": "latest",
"vite": "latest"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
"scripts": {
"dev": "vite"
}
}
8 changes: 0 additions & 8 deletions examples/02_authtoken/public/index.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Suspense } from 'react';
import { Suspense } from 'react';
import { useAtom } from 'jotai/react';
import { atom } from 'jotai/vanilla';
import { createTRPCProxyClient, httpLink } from '@trpc/client';
Expand Down Expand Up @@ -42,7 +42,7 @@ const Pokemon = () => {
return (
<ul>
{data.map((item) => (
<li>
<li key={item.id}>
<div>ID: {item.id}</div>
<div>Height: {item.height}</div>
<div>Weight: {item.weight}</div>
Expand Down
9 changes: 0 additions & 9 deletions examples/02_authtoken/src/index.tsx

This file was deleted.

10 changes: 10 additions & 0 deletions examples/02_authtoken/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>,
);
Loading

0 comments on commit 65bc84c

Please sign in to comment.