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 29, 2024
1 parent fa0f3aa commit b7fae50
Show file tree
Hide file tree
Showing 60 changed files with 2,397 additions and 8,081 deletions.
3 changes: 0 additions & 3 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: ['valtio-signal'] }],
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
},
};
64 changes: 0 additions & 64 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
*.swp
node_modules
/dist
/jsx-runtime.d.ts
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.

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

## [0.5.0] - 2024-03-23

### Added

- migrate to valtio v2-beta #10

## [0.4.3] - 2023-02-26

### Changed

- fix(jsx-runtime): revert jsxDEV #9

## [0.4.2] - 2023-02-25

### Changed

- update create-react-signals #7

## [0.4.1] - 2023-01-25

### Changed

- use create-react-signals v0.6.2

## [0.4.0] - 2023-01-21

### Added

- feat: uncontrolled when possible #3

## [0.3.0] - 2023-01-09

### Changed

- feat: value prop in signal #2

## [0.2.0] - 2023-01-09

### Changed

- Use create react signals #1

## [0.1.0] - 2023-01-01

### Added

- Initial release
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ setInterval(() => {
++state.count;
}, 100);

const Counter = () => (
<div>
Count: {$(state).count}
</div>
);
const Counter = () => <div>Count: {$(state).count}</div>;
```

## How it works
Expand Down Expand Up @@ -78,7 +74,7 @@ const Counter = () => {
}, []);
return (
<div>
{useMemo(() => 'Count: '), []}
{(useMemo(() => 'Count: '), [])}
{snapshot(state).count}
{useMemo(() => ` (${Math.random()})`, [])}
</div>
Expand Down
9 changes: 0 additions & 9 deletions __tests__/01_basic_spec.tsx

This file was deleted.

9 changes: 9 additions & 0 deletions examples/01_counter/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>
21 changes: 21 additions & 0 deletions examples/01_counter/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "example",
"version": "0.0.0",
"private": true,
"type": "module",
"dependencies": {
"react": "latest",
"react-dom": "latest",
"valtio": "latest",
"valtio-signal": "latest"
},
"devDependencies": {
"@types/react": "latest",
"@types/react-dom": "latest",
"typescript": "latest",
"vite": "latest"
},
"scripts": {
"dev": "vite"
}
}
File renamed without changes.
10 changes: 10 additions & 0 deletions examples/01_counter/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_counter/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"
}
}
27 changes: 0 additions & 27 deletions examples/01_typescript/package.json

This file was deleted.

8 changes: 0 additions & 8 deletions examples/01_typescript/public/index.html

This file was deleted.

13 changes: 0 additions & 13 deletions examples/01_typescript/src/index.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions examples/01_typescript/tsconfig.json

This file was deleted.

9 changes: 9 additions & 0 deletions examples/02_props/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_props/package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
{
"name": "valtio-signal-example",
"version": "0.1.0",
"name": "example",
"version": "0.0.0",
"private": true,
"type": "module",
"dependencies": {
"react": "latest",
"react-dom": "latest",
"valtio": "latest",
"valtio-signal": "latest"
},
"devDependencies": {
"@types/react": "latest",
"@types/react-dom": "latest",
"react": "canary",
"react-dom": "canary",
"react-scripts": "latest",
"typescript": "latest",
"valtio": "next",
"valtio-signal": "latest"
"vite": "latest"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
"dev": "vite"
}
}
8 changes: 0 additions & 8 deletions examples/02_props/public/index.html

This file was deleted.

File renamed without changes.
13 changes: 0 additions & 13 deletions examples/02_props/src/index.tsx

This file was deleted.

Loading

0 comments on commit b7fae50

Please sign in to comment.