From 707d9ec923afe13f02511640eb5edb5b251daed7 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Mon, 18 Oct 2021 10:15:06 -0400 Subject: [PATCH] prettier --- .prettierignore | 5 +++++ .travis.yml | 14 +++++++------- CHANGELOG.md | 28 ++++++++++++++++------------ CODE_OF_CONDUCT.md | 33 ++++++++++++++++----------------- Taskfile.yml | 9 ++++++--- babel.config.cjs | 8 ++++---- jest.config.ts | 4 ++-- jsdoc.json | 3 +-- src/types.ts | 8 +++++--- tsconfig.json | 32 +++++++++++++++----------------- typedoc.json | 24 +++++++++++------------- 11 files changed, 88 insertions(+), 80 deletions(-) diff --git a/.prettierignore b/.prettierignore index 121f06b..7b893ae 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,7 @@ +dist +out +pnpm-lock.yaml +types +docs Changes .prettierignore diff --git a/.travis.yml b/.travis.yml index 24d97a7..cf91d1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,16 @@ language: node_js node_js: - - 'node' - - 'lts/*' + - 'node' + - 'lts/*' install: - - npm uninstall typescript --no-save - - npm install + - npm uninstall typescript --no-save + - npm install cache: - directories: - - node_modules + directories: + - node_modules git: - depth: 1 + depth: 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fc34ab..60ea61f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,54 +6,58 @@ All notable changes to this project will be documented in this file. See [standa ### ⚠ BREAKING CHANGES -* Upgrade to Typescript 4. -* Switch from 'updeep' to '@yanick/updeep'. - +- Upgrade to Typescript 4. +- Switch from 'updeep' to '@yanick/updeep'. ## [2.1.0](https://github.com/yanick/updux/compare/v2.0.0...v2.1.0) (2020-06-19) ### Features -* add support for subscriptions ([9c45ee7](https://github.com/yanick/updux/commit/9c45ee7efcb623defb9da5d01165fbad0e4424f9)) +- add support for subscriptions ([9c45ee7](https://github.com/yanick/updux/commit/9c45ee7efcb623defb9da5d01165fbad0e4424f9)) ## [2.0.0](https://github.com/yanick/updux/compare/v1.2.0...v2.0.0) (2020-06-13) ### ⚠ BREAKING CHANGES -* use ts-action for action creation -* middleware support refined +- use ts-action for action creation +- middleware support refined ### Features -* allow adding actionCreators via addAction() ([27ae46d](https://github.com/yanick/updux/commit/27ae46dbab289b27ea99aca149aaa3b7c90ee7d0)) -* middleware support refined ([d90d721](https://github.com/yanick/updux/commit/d90d72148c2d4ba186a19650d961c64df5791c55)) -* moving documentation to docsify ([fa55762](https://github.com/yanick/updux/commit/fa55762efcbd4db356150f6022fd62750adc27a9)) -* use ts-action for action creation ([6349d72](https://github.com/yanick/updux/commit/6349d720b8aba4b443a7225d6a377c5c929a3021)) - +- allow adding actionCreators via addAction() ([27ae46d](https://github.com/yanick/updux/commit/27ae46dbab289b27ea99aca149aaa3b7c90ee7d0)) +- middleware support refined ([d90d721](https://github.com/yanick/updux/commit/d90d72148c2d4ba186a19650d961c64df5791c55)) +- moving documentation to docsify ([fa55762](https://github.com/yanick/updux/commit/fa55762efcbd4db356150f6022fd62750adc27a9)) +- use ts-action for action creation ([6349d72](https://github.com/yanick/updux/commit/6349d720b8aba4b443a7225d6a377c5c929a3021)) ### Bug Fixes -* state is a PreloadedState ([93bebc5](https://github.com/yanick/updux/commit/93bebc5acf193752aa6b4857507f05d52b1b7665)) +- state is a PreloadedState ([93bebc5](https://github.com/yanick/updux/commit/93bebc5acf193752aa6b4857507f05d52b1b7665)) ## 1.2.0 2019-11-06 + - The middleware's 'getState' returns the local state of its updux, instead of the root state. Plus we add `getRootState` to get the root state. ## 1.1.0 2019-11-05 + - Document mapping behavior of the '*' subdux. - add subduxUpreducer. - add sink mutations. ## 1.0.0 2019-11-04 + - Pretty big rework. - Better documentation. ## 0.2.0 2019-10-24 + - Converted everything to Typescript. ## 0.1.0 2019-10-22 + - Add 'actions' in the config. ## 0.0.1 2019-10-22 + - Initial release. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 8466400..92fae6b 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -17,24 +17,24 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +- Focusing on what is best not just for us as individuals, but for the + overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting +- The use of sexualized language or imagery, and sexual attention or + advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email + address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting ## Enforcement Responsibilities @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an +standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within @@ -126,4 +126,3 @@ enforcement ladder](https://github.com/mozilla/diversity). For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. - diff --git a/Taskfile.yml b/Taskfile.yml index 05923f2..8bea088 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -3,15 +3,18 @@ version: '3' vars: - GREETING: Hello, World! + GREETING: Hello, World! tasks: tsc: tsc test: jest - check: - deps: [tsc, test] + 'check:prettier': prettier --check . + 'check:prettier:fix': prettier --write . + + check: + deps: [tsc, test, 'check:prettier'] 'test:types': tsd docs: diff --git a/babel.config.cjs b/babel.config.cjs index 79d2391..faa86eb 100644 --- a/babel.config.cjs +++ b/babel.config.cjs @@ -1,6 +1,6 @@ module.exports = { - presets: [ - ['@babel/preset-env', {targets: {node: 'current'}}], - '@babel/preset-typescript', - ], + presets: [ + ['@babel/preset-env', { targets: { node: 'current' } }], + '@babel/preset-typescript', + ], }; diff --git a/jest.config.ts b/jest.config.ts index 3f11958..5e48057 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -1,3 +1,3 @@ export default { - roots: [ './src' ] -} + roots: ['./src'], +}; diff --git a/jsdoc.json b/jsdoc.json index 41ca59f..c233153 100644 --- a/jsdoc.json +++ b/jsdoc.json @@ -8,7 +8,7 @@ "sourceType": "module", "tags": { "allowUnknownTags": true, - "dictionaries": ["jsdoc","closure"] + "dictionaries": ["jsdoc", "closure"] }, "templates": { "cleverLinks": false, @@ -19,4 +19,3 @@ "tutorials": "./tutorials" } } - diff --git a/src/types.ts b/src/types.ts index 8d8cf48..d969524 100644 --- a/src/types.ts +++ b/src/types.ts @@ -11,9 +11,11 @@ type Subdux = { }; type StateOf = D extends { initial: infer I } ? I : unknown; -type ActionsOf = C extends { actions: infer A } ? { - [K in keyof A]: Function -} : {}; +type ActionsOf = C extends { actions: infer A } + ? { + [K in keyof A]: Function; + } + : {}; type Subduxes = Record; diff --git a/tsconfig.json b/tsconfig.json index daa9702..a48c5c5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,19 +1,17 @@ { - "include": [ "./src" ], - "exclude": [ "./docs", "./dist" ], - "compilerOptions": { - "rootDir": "src", - "outDir": "dist", - "target": "es2020", - "lib": [ - "es2020" - ], - "module": "ES2020", - "moduleResolution": "Node", - "strict": false, - "sourceMap": true, - "allowSyntheticDefaultImports": true, - "declaration": true, - "allowJs": true - } + "include": ["./src"], + "exclude": ["./docs", "./dist"], + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "target": "es2020", + "lib": ["es2020"], + "module": "ES2020", + "moduleResolution": "Node", + "strict": false, + "sourceMap": true, + "allowSyntheticDefaultImports": true, + "declaration": true, + "allowJs": true + } } diff --git a/typedoc.json b/typedoc.json index 91a2cf5..ecaa99a 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,15 +1,13 @@ { - "name": "Updux", - "entryPoints": [ - "./types/index.d.ts" - ], - "out": "docs/API", - "excludeExternals": true, - "excludePrivate": true, - "excludeProtected": true, - "disableSources": true, - "listInvalidSymbolLinks": true, - "markedOptions": { - "mangle": false - } + "name": "Updux", + "entryPoints": ["./types/index.d.ts"], + "out": "docs/API", + "excludeExternals": true, + "excludePrivate": true, + "excludeProtected": true, + "disableSources": true, + "listInvalidSymbolLinks": true, + "markedOptions": { + "mangle": false + } }