Skip to content

Commit 117aa42

Browse files
authored
Module-first setup (#14)
* Module-first setup * update CHANGELOG
1 parent fe3cbca commit 117aa42

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2836
-7907
lines changed

.codesandbox/ci.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"buildCommand": "compile",
33
"sandboxes": ["new", "react-typescript-react-ts"],
4-
"node": "14"
4+
"node": "18"
55
}

.eslintignore

-3
This file was deleted.

.eslintrc.cjs

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* eslint-env node */
2+
module.exports = {
3+
root: true,
4+
parser: '@typescript-eslint/parser',
5+
plugins: ['@typescript-eslint'],
6+
extends: [
7+
'eslint:recommended',
8+
'plugin:@typescript-eslint/recommended',
9+
'plugin:import/recommended',
10+
'plugin:import/typescript',
11+
'plugin:react/recommended',
12+
'plugin:react/jsx-runtime',
13+
'plugin:react-hooks/recommended',
14+
'plugin:jsx-a11y/recommended',
15+
'prettier',
16+
],
17+
ignorePatterns: ['dist/'],
18+
settings: {
19+
'import/resolver': {
20+
typescript: true,
21+
},
22+
react: { version: 'detect' },
23+
},
24+
rules: {
25+
'import/no-unresolved': ['error', { ignore: ['jotai-signal'] }],
26+
'@typescript-eslint/no-unused-vars': [
27+
'error',
28+
{
29+
args: 'all',
30+
argsIgnorePattern: '^_',
31+
caughtErrors: 'all',
32+
caughtErrorsIgnorePattern: '^_',
33+
destructuredArrayIgnorePattern: '^_',
34+
varsIgnorePattern: '^_',
35+
ignoreRestSiblings: true,
36+
},
37+
],
38+
},
39+
};

.eslintrc.json

-64
This file was deleted.

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
*.swp
33
node_modules
44
/dist
5-
/jsx-runtime.d.ts

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/pnpm-lock.yaml
2+
/dist

.prettierrc

-4
This file was deleted.

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,66 @@
22

33
## [Unreleased]
44

5+
### Changed
6+
7+
- Module-first setup #14
8+
59
## [0.8.1] - 2023-02-26
10+
611
### Changed
12+
713
- fix(jsx-runtime): revert jsxDEV #12
814

915
## [0.8.0] - 2023-02-25
16+
1017
### Added
18+
1119
- feat: atomSignal #11
1220

1321
## [0.7.3] - 2023-01-25
22+
1423
### Changed
24+
1525
- use create-react-signals v0.6.2
1626

1727
## [0.7.2] - 2023-01-22
28+
1829
### Changed
30+
1931
- fix: infinite loop in some cases #8
2032

2133
## [0.7.1] - 2023-01-21
34+
2235
### Changed
36+
2337
- update create-react-signals v0.6.0 #7
2438

2539
## [0.7.0] - 2023-01-21
40+
2641
### Added
42+
2743
- feat: uncontrolled when possible #6
2844

2945
## [0.6.0] - 2023-01-09
46+
3047
### Changed
48+
3149
- feat: value prop in signal #5
3250

3351
## [0.5.0] - 2023-01-09
52+
3453
### Changed
54+
3555
- Use create react signals #4
3656

3757
## [0.4.0] - 2022-12-30
58+
3859
### Changed
60+
3961
- feat: use $ instead of signal as exported function name #3
4062

4163
## [0.3.0] - 2022-12-19
64+
4265
### Added
66+
4367
- Implementation with Jotai v2 API

__tests__/01_basic_spec.tsx

-9
This file was deleted.

examples/01_counter/index.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<html>
2+
<head>
3+
<title>example</title>
4+
</head>
5+
<body>
6+
<div id="root"></div>
7+
<script type="module" src="/src/main.tsx"></script>
8+
</body>
9+
</html>

examples/01_counter/package.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "example",
3+
"version": "0.0.0",
4+
"private": true,
5+
"type": "module",
6+
"dependencies": {
7+
"jotai": "latest",
8+
"jotai-signal": "latest",
9+
"react": "latest",
10+
"react-dom": "latest"
11+
},
12+
"devDependencies": {
13+
"@types/react": "latest",
14+
"@types/react-dom": "latest",
15+
"typescript": "latest",
16+
"vite": "latest"
17+
},
18+
"scripts": {
19+
"dev": "vite"
20+
}
21+
}
File renamed without changes.

examples/01_counter/src/main.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { StrictMode } from 'react';
2+
import { createRoot } from 'react-dom/client';
3+
4+
import App from './app';
5+
6+
createRoot(document.getElementById('root')!).render(
7+
<StrictMode>
8+
<App />
9+
</StrictMode>,
10+
);

examples/01_counter/tsconfig.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"compilerOptions": {
3+
"strict": true,
4+
"target": "es2018",
5+
"esModuleInterop": true,
6+
"module": "esnext",
7+
"moduleResolution": "bundler",
8+
"skipLibCheck": true,
9+
"allowJs": true,
10+
"noUncheckedIndexedAccess": true,
11+
"exactOptionalPropertyTypes": true,
12+
"jsx": "react-jsx"
13+
}
14+
}

examples/01_typescript/package.json

-27
This file was deleted.

examples/01_typescript/public/index.html

-8
This file was deleted.

examples/01_typescript/src/index.tsx

-13
This file was deleted.

examples/01_typescript/tsconfig.json

-6
This file was deleted.

examples/02_props/index.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<html>
2+
<head>
3+
<title>example</title>
4+
</head>
5+
<body>
6+
<div id="root"></div>
7+
<script type="module" src="/src/main.tsx"></script>
8+
</body>
9+
</html>

examples/02_props/package.json

+12-18
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
{
2-
"name": "jotai-signal-example",
3-
"version": "0.1.0",
2+
"name": "example",
3+
"version": "0.0.0",
44
"private": true,
5+
"type": "module",
56
"dependencies": {
6-
"@types/react": "latest",
7-
"@types/react-dom": "latest",
87
"jotai": "latest",
98
"jotai-signal": "latest",
109
"react": "latest",
11-
"react-dom": "latest",
12-
"react-scripts": "latest",
13-
"typescript": "latest"
10+
"react-dom": "latest"
1411
},
15-
"scripts": {
16-
"start": "react-scripts start",
17-
"build": "react-scripts build",
18-
"test": "react-scripts test",
19-
"eject": "react-scripts eject"
12+
"devDependencies": {
13+
"@types/react": "latest",
14+
"@types/react-dom": "latest",
15+
"typescript": "latest",
16+
"vite": "latest"
2017
},
21-
"browserslist": [
22-
">0.2%",
23-
"not dead",
24-
"not ie <= 11",
25-
"not op_mini all"
26-
]
18+
"scripts": {
19+
"dev": "vite"
20+
}
2721
}

examples/02_props/public/index.html

-8
This file was deleted.
File renamed without changes.

examples/02_props/src/index.tsx

-13
This file was deleted.

0 commit comments

Comments
 (0)