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 Apr 22, 2024
1 parent 40bc2c2 commit dee407e
Show file tree
Hide file tree
Showing 18 changed files with 2,259 additions and 7,666 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: ['zustand-valtio'] }],
'@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.

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.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

### Changed

- Module-first setup

## [0.0.1] - 2024-03-25

### Added

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

This file was deleted.

13 changes: 4 additions & 9 deletions examples/01_counter/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "zustand-valtio-example",
"version": "0.1.0",
"name": "example",
"version": "0.0.0",
"private": true,
"type": "commonjs",
"dependencies": {
"@types/react": "latest",
"@types/react-dom": "latest",
Expand All @@ -18,11 +19,5 @@
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
}
8 changes: 8 additions & 0 deletions examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler"
},
"exclude": []
}
78 changes: 41 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,84 @@
"name": "zustand-valtio",
"description": "A sweet combination of Zustand and Valtio",
"version": "0.0.1",
"type": "module",
"author": "Daishi Kato",
"repository": {
"type": "git",
"url": "https://github.com/zustandjs/zustand-valtio.git"
},
"source": "./src/index.ts",
"main": "./dist/index.umd.js",
"module": "./dist/index.modern.js",
"types": "./dist/src/index.d.ts",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/src/index.d.ts",
"import": "./dist/index.modern.mjs",
"default": "./dist/index.umd.js"
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
},
"default": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"sideEffects": false,
"files": [
"src",
"dist"
],
"packageManager": "[email protected]",
"scripts": {
"compile": "microbundle build -f modern,umd --globals react=React",
"postcompile": "cp dist/index.modern.mjs dist/index.modern.js && cp dist/index.modern.mjs.map dist/index.modern.js.map",
"test": "run-s eslint tsc-test jest",
"eslint": "eslint --ext .js,.ts,.tsx .",
"jest": "jest",
"tsc-test": "tsc --project . --noEmit",
"examples:01_counter": "DIR=01_counter EXT=tsx webpack serve"
},
"jest": {
"testEnvironment": "jsdom",
"preset": "ts-jest/presets/js-with-ts"
"compile": "rm -rf dist && pnpm run '/^compile:.*/'",
"compile:esm": "tsc -p tsconfig.esm.json",
"compile:cjs": "tsc -p tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
"test": "pnpm run '/^test:.*/'",
"test:format": "prettier -c .",
"test:lint": "eslint .",
"test:types": "tsc -p . --noEmit",
"test:types:examples": "tsc -p examples --noEmit",
"test:spec": "vitest run",
"examples:01_counter": "DIR=01_counter vite"
},
"keywords": [
"react",
"valtio",
"zustand"
],
"license": "MIT",
"prettier": {
"singleQuote": true
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^20.11.30",
"@types/react": "^18.2.69",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^15.0.2",
"@testing-library/user-event": "^14.5.2",
"@types/node": "^20.12.7",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
"html-webpack-plugin": "^5.6.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"microbundle": "^0.15.1",
"npm-run-all": "^4.1.5",
"eslint-plugin-react-hooks": "^4.6.0",
"jsdom": "^24.0.0",
"prettier": "^3.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"ts-jest": "^29.1.2",
"ts-loader": "^9.5.1",
"typescript": "^5.4.3",
"ts-expect": "^1.3.0",
"typescript": "^5.4.5",
"valtio": "^1.13.2",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4",
"vite": "^5.2.10",
"vitest": "^1.5.0",
"zustand": "^4.5.2"
},
"peerDependencies": {
"react": "*",
"react": ">=18.0.0",
"valtio": ">=1.0.0",
"zustand": ">=4.0.0"
}
Expand Down
Loading

0 comments on commit dee407e

Please sign in to comment.