Skip to content

Commit bab6fe3

Browse files
authored
v2.3.3 (#212)
* Make CountdownProps interface date required * Bump version number * Update test-related scripts * Update test-related scripts * Update docs * Update docs * Deprecate set-output workflow commands * Deprecate set-output workflow commands
1 parent 8a31928 commit bab6fe3

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

.github/workflows/main.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- name: Get yarn cache directory path
2323
id: yarn-cache-dir-path
24-
run: echo "::set-output name=dir::$(yarn cache dir)"
24+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
2525

2626
- uses: actions/cache@v3
2727
id: yarn-cache
@@ -54,7 +54,7 @@ jobs:
5454

5555
- name: Get yarn cache directory path
5656
id: yarn-cache-dir-path
57-
run: echo "::set-output name=dir::$(yarn cache dir)"
57+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
5858

5959
- uses: actions/cache@v3
6060
id: yarn-cache
@@ -68,7 +68,7 @@ jobs:
6868
run: yarn install
6969

7070
- name: "Tests: Unit"
71-
run: yarn test
71+
run: yarn test:coverage
7272

7373
- name: "Tests: E2E"
7474
run: yarn test:e2e
@@ -93,7 +93,7 @@ jobs:
9393

9494
- name: Get yarn cache directory path
9595
id: yarn-cache-dir-path
96-
run: echo "::set-output name=dir::$(yarn cache dir)"
96+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
9797

9898
- uses: actions/cache@v3
9999
id: yarn-cache
@@ -124,7 +124,7 @@ jobs:
124124

125125
- name: Get yarn cache directory path
126126
id: yarn-cache-dir-path
127-
run: echo "::set-output name=dir::$(yarn cache dir)"
127+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
128128

129129
- uses: actions/cache@v3
130130
id: yarn-cache

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ import Countdown, { zeroPad, calcTimeDelta, formatTimeDelta } from 'react-countd
275275
```
276276

277277
### `zeroPad(value, [length = 2])`
278-
The `zeroPad` function works similarly to other well-known pad-functions and takes two arguments into account. A `value` which can be a `string` or `number`, as well as a `length` parameter that defaults to `2` as you are most likely only going to use this function if you actually want to pad one of your values. Either returns a `number` if `length` equals `0`, or the zero-padded `string`.
278+
The `zeroPad` function transforms and returns a given `value` with padded zeros depending on the `length`. The `value` can be a `string` or `number`, while the `length` parameter can be a `number`, defaulting to `2`. Returns the zero-padded `string`, e.g., `zeroPad(5)` => `05`.
279279

280280
```js
281281
const renderer = ({ hours, minutes, seconds }) => (

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-countdown",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"description": "A customizable countdown component for React.",
55
"main": "./dist/index.js",
66
"module": "./dist/index.es.js",
@@ -35,7 +35,8 @@
3535
"lint:tsc": "tsc --noEmit",
3636
"prettier-check": "prettier --list-different ./src/**/*.{ts,tsx}",
3737
"prettier": "prettier --write ./src/**/*.{ts,tsx}",
38-
"test": "jest --coverage",
38+
"test": "jest",
39+
"test:coverage": "jest --coverage",
3940
"test:e2e": "yarn start-server-and-test test:e2e:server http://localhost:1234 \"cypress run\"",
4041
"test:e2e:clean": "rm -rf ./e2e/dist",
4142
"test:e2e:dev": "yarn start-server-and-test test:e2e:server http://localhost:1234 \"cypress open\"",

src/Countdown.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface CountdownProps
1616
extends React.Props<Countdown>,
1717
CountdownTimeDeltaFormatOptions,
1818
Omit<LegacyCountdownProps, 'onComplete'> {
19-
readonly date?: Date | number | string;
19+
readonly date: Date | number | string;
2020
readonly controlled?: boolean;
2121
readonly intervalDelay?: number;
2222
readonly precision?: number;

0 commit comments

Comments
 (0)