Skip to content

Commit

Permalink
upgrade typescript & typedoc (#51)
Browse files Browse the repository at this point in the history
* upgrade typescript & typedoc

* use node 16.x instead of 10.x for ci
  • Loading branch information
nighca authored Aug 21, 2021
1 parent a452b5c commit 1fc6cd0
Show file tree
Hide file tree
Showing 9 changed files with 7,959 additions and 146 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v1
Expand Down
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
src
docs
jest.config.js
tsconfig.json
8,083 changes: 7,949 additions & 134 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"coverage": "rm -rf coverage && jest --coverage",
"build:esm": "rm -rf ./esm && tsc --module es6 --outDir ./esm",
"build:lib": "rm -rf ./lib && tsc",
"build:doc": "rm -rf ./docs && typedoc",
"build:doc": "rm -rf ./docs && typedoc && cp -r ./assets ./docs",
"build": "npm run build:esm && npm run build:lib",
"prepublishOnly": "npm run test && npm run build",
"ci": "tsc --noEmit && npm run coverage && npm run build && npm run build:doc"
Expand All @@ -37,9 +37,9 @@
"jest": "~26.6.1",
"mobx": "^6.0.4",
"ts-jest": "~26.4.2",
"typedoc": "~0.16.11",
"typedoc": "~0.21.6",
"typedoc-twilio-theme": "^1.0.0",
"typescript": "~4.0.3"
"typescript": "~4.1.5"
},
"dependencies": {}
}
2 changes: 1 addition & 1 deletion src/adapter/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { xify, getValue, getValidateStatus, getDirty, getActivated } from '.'
const stableDelay = 200 * 2 + 10 // [onChange debounce] + [async validate] + [buffer]

async function delay(millisecond: number = stableDelay) {
await new Promise(resolve => setTimeout(() => resolve(), millisecond))
await new Promise<void>(resolve => setTimeout(() => resolve(), millisecond))
}

describe('xify', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/fieldState.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const defaultDelay = 10
const stableDelay = defaultDelay * 3 // [onChange debounce] + [async validate] + [buffer]

async function delay(millisecond: number = stableDelay) {
await new Promise(resolve => setTimeout(() => resolve(), millisecond))
await new Promise<void>(resolve => setTimeout(() => resolve(), millisecond))
}

async function delayValue<T>(value: T, millisecond: number = defaultDelay) {
Expand Down
2 changes: 1 addition & 1 deletion src/formState.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const defaultDelay = 10
const stableDelay = defaultDelay * 3 // [onChange debounce] + [async validate] + [buffer]

async function delay(millisecond: number = stableDelay) {
await new Promise(resolve => setTimeout(() => resolve(), millisecond))
await new Promise<void>(resolve => setTimeout(() => resolve(), millisecond))
}

async function delayValue<T>(value: T, millisecond: number = defaultDelay) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { asyncResponsesAnd, isEmpty, isArrayLike } from './utils'

const defaultDelay = 10

function delay<T>(value?: T, delay: number = defaultDelay + 10): Promise<T> {
return new Promise(
function delay<T>(value?: T, delay: number = defaultDelay + 10): Promise<T | undefined> {
return new Promise<T | undefined>(
resolve => setTimeout(() => resolve(value), delay)
)
}
Expand Down
3 changes: 1 addition & 2 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"mode": "file",
"packages": ".",
"out": "docs",
"exclude": "src/utils.ts",
"excludeNotExported": true,
"excludePrivate": true,
"excludeProtected": true,
"theme": "./node_modules/typedoc-twilio-theme/bin"
Expand Down

0 comments on commit 1fc6cd0

Please sign in to comment.