Skip to content

Commit

Permalink
Modernize the repo (#57)
Browse files Browse the repository at this point in the history
modernize the repo:
- update tsconfig
- update eslint
- replace webpack and jest with vite + vitest
- remove examples
- rename __tests__ to tests
- update package scripts
  • Loading branch information
dmaskasky authored Jan 23, 2025
1 parent 8c5a803 commit 99b065d
Show file tree
Hide file tree
Showing 23 changed files with 2,980 additions and 8,180 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/dist
/src/vendor
/node_modules
19 changes: 4 additions & 15 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
"react",
"prettier",
"react-hooks",
"import",
"jest"
"import"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
Expand All @@ -47,10 +46,6 @@
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"jest/consistent-test-it": [
"error",
{ "fn": "it", "withinDescribe": "it" }
],
"import/order": [
"error",
{
Expand Down Expand Up @@ -94,13 +89,10 @@
"@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx"]
},
"import/resolver": {
"typescript": true,
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx", ".json"],
"paths": ["src"]
},
"alias": {
"extensions": [".js", ".jsx", ".ts", ".tsx", ".json"],
"map": [["^jotai-effect$", "./src/index.ts"]]
}
}
},
Expand All @@ -112,10 +104,7 @@
}
},
{
"files": ["tests/**/*.tsx", "__tests__/**/*"],
"env": {
"jest/globals": true
}
"files": ["tests/**/*.tsx", "tests/**/*"]
},
{
"files": ["./*.js"],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.2.0
version: 9.15.0
- uses: actions/setup-node@v3
with:
node-version: 18
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.2.0
version: 9.15.0
- uses: actions/setup-node@v3
with:
node-version: 18
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*~
*.swp
node_modules
/dist
/jotai
.vscode
dist
jotai
node_modules
5 changes: 3 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.md
pnpm-lock.yaml
/pnpm-lock.yaml
/dist
README.md
5 changes: 0 additions & 5 deletions CHANGELOG.md

This file was deleted.

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.

40 changes: 0 additions & 40 deletions examples/01_typescript/src/App.tsx

This file was deleted.

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

This file was deleted.

116 changes: 57 additions & 59 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,53 @@
"name": "jotai-effect",
"description": "👻🔁",
"version": "1.0.7",
"type": "module",
"author": "David Maskasky",
"contributors": [
"Daishi Kato (https://github.com/dai-shi)"
],
"repository": {
"type": "git",
"url": "https://github.com/jotaijs/jotai-effect.git"
},
"bugs": {
"url": "https://github.com/jotaijs/jotai-effect/issues"
},
"homepage": "https://jotai.org/docs/extensions/effect",
"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",
"module": "./dist/index.modern.js",
"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_typescript": "DIR=01_typescript EXT=tsx webpack serve"
},
"jest": {
"testEnvironment": "jsdom",
"preset": "ts-jest/presets/js-with-ts",
"testMatch": [
"**/__tests__/**/*.test.ts?(x)"
],
"transform": {
"^.+\\.tsx?$": [
"ts-jest",
{
"tsconfig": "tsconfig.test.json"
}
]
}
"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",
"fix": "pnpm run '/^fix:.*/'",
"fix:format": "prettier --write .",
"fix:lint": "eslint . --fix",
"test": "pnpm run \"/^test:.*/\"",
"test:format": "prettier --list-different .",
"test:types": "tsc --noEmit",
"test:lint": "eslint .",
"test:spec": "vitest run"
},
"keywords": [
"jotai",
Expand All @@ -57,39 +58,36 @@
],
"license": "MIT",
"devDependencies": {
"@testing-library/react": "^14.0.0",
"@types/jest": "^29.5.5",
"@types/node": "^20.8.3",
"@types/react": "^18.2.25",
"@types/react-dom": "^18.2.11",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest": "^27.4.2",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"html-webpack-plugin": "^5.5.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jotai": "2.10.3",
"microbundle": "^0.15.1",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@testing-library/dom": "10.0.0",
"@testing-library/react": "^16.2.0",
"@testing-library/user-event": "^14.6.1",
"@types/node": "^22.10.2",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@typescript-eslint/eslint-plugin": "^8.18.1",
"@typescript-eslint/parser": "^8.18.1",
"eslint": "8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.1.0",
"happy-dom": "^15.11.7",
"jotai": "2.11.1",
"jotai-effect": "link:",
"prettier": "^3.4.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-error-boundary": "^4.0.11",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"typescript": "5.5.4",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
"typescript": "^5.7.2",
"vite": "^6.0.4",
"vitest": "^2.1.8"
},
"peerDependencies": {
"jotai": ">=2.5.0"
},
"engines": {
"node": ">=12.20.0"
}
}
Loading

0 comments on commit 99b065d

Please sign in to comment.