-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
4,072 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"parserOptions": { | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"extends": [ | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"rules": { | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-empty-interface": "off", | ||
"@typescript-eslint/no-use-before-define": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
"argsIgnorePattern": "^_\\d*$" | ||
} | ||
] | ||
}, | ||
"ignorePatterns": [ | ||
"**/dist/**" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# ⚠️ WARNING | ||
# This file is auto-generated by https://github.com/WesSouza/wes-cli | ||
|
||
name: Lint, Type Check, Test, Build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
check: | ||
|
@@ -13,29 +13,29 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
node: ['16.x', '18.x'] | ||
node: ['18.x', '20.x'] | ||
os: [ubuntu-latest, macOS-latest] | ||
|
||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install wes-cli | ||
run: | | ||
npm i -g [email protected] | ||
wes install | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'yarn' | ||
|
||
- name: Lint | ||
run: yarn lint | ||
- name: Install | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Check Types | ||
- name: Check types | ||
run: yarn check:types | ||
|
||
- name: Lint | ||
run: yarn lint | ||
|
||
- name: Test | ||
run: yarn test:ci | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Node & Yarn | ||
node_modules | ||
*.log* | ||
|
||
/dist | ||
/coverage | ||
|
||
# Visual Studio Code | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/*.code-snippets | ||
|
||
# Example | ||
/example/yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"name": "immer-state", | ||
"version": "0.8.0", | ||
"author": "Wes Souza", | ||
"license": "MIT", | ||
"files": [ | ||
"dist" | ||
], | ||
"type": "module", | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
}, | ||
"engines": { | ||
"node": ">=14" | ||
}, | ||
"dependencies": {}, | ||
"scripts": { | ||
"lint": "eslint .", | ||
"build": "rollup -c", | ||
"prepare": "yarn run build", | ||
"check:types": "tsc --noEmit", | ||
"coverage": "vitest run --coverage", | ||
"test": "vitest run", | ||
"test:ui": "vitest --ui", | ||
"test:watch": "vitest" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-typescript": "^11.1.5", | ||
"@testing-library/jest-dom": "^5.17.0", | ||
"@testing-library/react": "^14.1.2", | ||
"@testing-library/react-hooks": "^8.0.1", | ||
"@testing-library/user-event": "^14.5.1", | ||
"@types/node": "^18.19.3", | ||
"@types/react": "^18.2.45", | ||
"@types/react-dom": "^18.2.18", | ||
"@typescript-eslint/eslint-plugin": "^5.62.0", | ||
"@typescript-eslint/parser": "^5.62.0", | ||
"@vitejs/plugin-react": "^3.1.0", | ||
"@vitest/coverage-c8": "^0.28.5", | ||
"@vitest/ui": "^0.28.5", | ||
"esbuild": "^0.17.19", | ||
"eslint": "^8.56.0", | ||
"eslint-config-prettier": "^8.10.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"immer": "^9.0.21", | ||
"import-sort-style-wes": "^3.0.2", | ||
"jsdom": "^21.1.2", | ||
"prettier": "2.8.4", | ||
"prettier-plugin-import-sort": "^0.0.7", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"rollup": "^3.29.4", | ||
"rollup-plugin-esbuild": "^5.0.0", | ||
"rollup-plugin-replace": "^2.2.0", | ||
"ts-node-dev": "^2.0.0", | ||
"typescript": "^4.9.5", | ||
"vite": "^4.5.1", | ||
"vitest": "^0.28.5" | ||
}, | ||
"peerDependencies": { | ||
"fast-deep-equal": ">=3", | ||
"immer": ">=6", | ||
"react": ">=16" | ||
}, | ||
"importSort": { | ||
".js, .jsx": { | ||
"parser": "babylon", | ||
"style": "wes" | ||
}, | ||
".ts, .tsx": { | ||
"parser": "typescript", | ||
"style": "wes" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import typescript from '@rollup/plugin-typescript'; | ||
import esbuild from 'rollup-plugin-esbuild'; | ||
|
||
export default [ | ||
{ | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
dir: './dist', | ||
format: 'cjs', | ||
entryFileNames: '[name].cjs', | ||
exports: 'auto', | ||
preserveModules: true, | ||
sourcemap: true, | ||
}, | ||
{ | ||
dir: './dist', | ||
exports: 'auto', | ||
format: 'es', | ||
preserveModules: true, | ||
sourcemap: true, | ||
}, | ||
], | ||
external: (id) => !/^[./]/.test(id), | ||
plugins: [ | ||
esbuild(), | ||
typescript({ | ||
tsconfig: './tsconfig.build.json', | ||
declaration: true, | ||
declarationDir: 'dist', | ||
}), | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"rootDir": "./src" | ||
}, | ||
"include": [ | ||
"src/**/*.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"alwaysStrict": true, | ||
"declaration": true, | ||
"declarationMap": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"importHelpers": true, | ||
"jsx": "react-jsx", | ||
"lib": ["ESNext", "dom"], | ||
"module": "NodeNext", | ||
"moduleResolution": "NodeNext", | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitAny": true, | ||
"noImplicitReturns": true, | ||
"noImplicitThis": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"outDir": "dist", | ||
"resolveJsonModule": true, | ||
"rootDir": ".", | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"strictFunctionTypes": true, | ||
"strictNullChecks": true, | ||
"strictPropertyInitialization": true, | ||
"target": "ES2017" | ||
}, | ||
"exclude": ["dist", "node_modules", "example"], | ||
"include": ["**/*.ts", "**/*.tsx"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// <reference types="vitest" /> | ||
/// <reference types="vite/client" /> | ||
|
||
import { default as react } from '@vitejs/plugin-react'; | ||
import { defineConfig } from 'vite'; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [ | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore Somehow TypeScript is saying react is not callable | ||
react(), | ||
], | ||
test: { | ||
css: true, | ||
environment: 'jsdom', | ||
globals: true, | ||
setupFiles: './vitest.setup.ts', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import '@testing-library/jest-dom'; | ||
|
||
import { cleanup } from '@testing-library/react'; | ||
import { afterEach } from 'vitest'; | ||
|
||
afterEach(() => { | ||
cleanup(); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.