Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
60f4a54
Initial commit with useCountdown hook
ndresx Oct 19, 2019
592fb26
Refine hook, implement tests, update docs
ndresx Nov 3, 2019
448fa7a
Rebase with master, update dependencies
ndresx Dec 27, 2019
05dc48c
Update React peer dependencies for hook support
ndresx Dec 27, 2019
b82fbe6
Re-add index
ndresx Dec 27, 2019
66f848a
Merge remote-tracking branch 'origin/master' into use-countdown-hook
ndresx Feb 22, 2020
259123f
Update packages
ndresx Feb 22, 2020
843d9a7
Migrate to ESLint
ndresx Feb 22, 2020
7cfec1c
Update ESLint rules
ndresx Feb 22, 2020
9bed99e
Merge branch 'master' into use-countdown-hook
ndresx Oct 13, 2020
5ee46b5
Remove span and classname prop
ndresx Oct 13, 2020
e32453d
Update tests, dependencies and other stuff
ndresx Oct 16, 2020
c800c9a
Add raf prop (temp)
ndresx Oct 17, 2020
fc129b9
Remove raf prop (experimental)
ndresx Oct 17, 2020
f6fa72d
Remove/deprecated children prop support
ndresx Oct 18, 2020
b0d7400
Update examples, lint commands, node modules
ndresx Oct 24, 2020
ffe8a6d
Merge remote-tracking branch 'origin/master' into use-countdown-hook
ndresx Oct 24, 2020
18dae65
Update travis cfg
ndresx Oct 24, 2020
91fe1e6
Update examples build
ndresx Oct 24, 2020
2a6d719
Merge remote-tracking branch 'origin/master' into use-countdown-hook
ndresx Aug 10, 2024
fad235a
Update with master, update of all dependencies
ndresx Aug 10, 2024
ab7a310
Update lint steps
ndresx Aug 10, 2024
91811c8
Remove PropTypes and update ESLint configuration for React component
ndresx Jun 11, 2026
cebd16f
Refactor countdown component and hook structure
ndresx Jun 12, 2026
59e4c5d
Enhance countdown functionality and update dependencies
ndresx Jun 12, 2026
59242b2
Refactor testing setup by removing unused react-hooks library and upd…
ndresx Jun 12, 2026
0a6f743
Implement structural updates and optimizations across multiple modules
ndresx Jun 12, 2026
ac51f24
Refactor code structure for improved readability and maintainability
ndresx Jun 12, 2026
23c7e95
Refactor Countdown component to expose control API via ref and update…
ndresx Jun 12, 2026
eca0ed6
Refactor Countdown component to utilize useCountdown hook and streaml…
ndresx Jun 12, 2026
043a13d
Refactor Countdown component to replace `pure` prop with `freezeProps…
ndresx Jun 12, 2026
27006c4
Refactor Countdown component to introduce resetKey prop for restartin…
ndresx Jun 12, 2026
6a5c12e
Update README to require React 18 or higher
ndresx Jun 12, 2026
600421b
Enhance CI workflow to support React 18 and 19 matrix testing
ndresx Jun 12, 2026
b3d9ee4
Update Node.js version in CI workflow to 24.x
ndresx Jun 12, 2026
ca5246e
Update CI workflow and dependencies for React 19 compatibility
ndresx Jun 12, 2026
557f22e
Update README to clarify server-side rendering hydration mismatch and…
ndresx Jun 12, 2026
9d88f55
Update dependencies to React 19 and add CountdownRef component for im…
ndresx Jun 12, 2026
44bdf0a
Add Stopwatch example component and related tests for overtime functi…
ndresx Jun 12, 2026
34233d5
Add Stopwatch component and update related examples and tests for imp…
ndresx Jun 12, 2026
5ce11c5
Refactor Countdown component and tests to expose CountdownStatus enum…
ndresx Jun 12, 2026
f80d452
Update README and tests to enhance documentation
ndresx Jun 12, 2026
fa160c3
Refactor code structure for improved readability and maintainability,…
ndresx Jun 12, 2026
fb30d76
Update README and Countdown component documentation for clarity and a…
ndresx Jun 12, 2026
de8a727
Enhance README and tests to clarify new onTick behavior and improve C…
ndresx Jun 13, 2026
ff2cfad
Add tests for controlled Countdown behavior and prevent paused value …
ndresx Jun 13, 2026
565e2f8
Add prepublishOnly script to ensure build before publishing
ndresx Jun 13, 2026
52d8f77
Add CHANGELOG.md for version 3.0.0 with breaking changes and new feat…
ndresx Jun 13, 2026
b11b413
Refactor CodeQL workflow and update README for clarity and changelog …
ndresx Jun 13, 2026
a307a9d
Enhance CI workflow to support React version matrix for testing and a…
ndresx Jun 13, 2026
d44dff2
Update README and CHANGELOG for v3 beta release information
ndresx Jun 13, 2026
9e2b712
Refactor
ndresx Jun 13, 2026
f29377c
Update README to clarify `useCountdown` Hook props and `total` value …
ndresx Jun 13, 2026
f964170
feat: add setState test for CountdownJs to ensure state merging and l…
ndresx Jun 13, 2026
b4e175f
docs: update README to include mention of useCountdown Hook
ndresx Jun 14, 2026
cd19ad0
feat: add caching and installation steps for Cypress binary in CI wor…
ndresx Jun 14, 2026
a1d6f4f
chore: update actions to v5 in workflows for consistency and improvem…
ndresx Jun 14, 2026
a7f2ed9
feat: add dry run script for package packing
ndresx Jun 14, 2026
6ae8255
feat: add refresh method to Countdown API and corresponding tests
ndresx Jun 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 12 additions & 48 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [master]
schedule:
- cron: '39 1 * * 5'
- cron: "39 1 * * 5"

jobs:
analyze:
Expand All @@ -32,40 +20,16 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
language: ["javascript-typescript"]

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v5

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
161 changes: 76 additions & 85 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,76 +4,93 @@ on:
push:
branches: [master]
pull_request:
branches: ['*']
branches: ["*"]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: pnpm/action-setup@v5

- uses: actions/cache@v4
id: yarn-cache
- name: Use Node.js 24.x
uses: actions/setup-node@v5
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 24
cache: "pnpm"

- name: Install
run: yarn install
run: pnpm install --frozen-lockfile

- name: 'Lint: Prettier'
run: yarn lint:prettier
- name: "Lint: oxlint"
run: pnpm lint:oxlint

- name: 'Lint: TypeScript'
run: yarn lint:tslint && yarn lint:tsc
- name: "Lint: oxfmt"
run: pnpm lint:oxfmt

- name: "Lint: TypeScript"
run: pnpm lint:tsc

test:
name: Test
name: Test (React ${{ matrix.react }})
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
strategy:
fail-fast: false
matrix:
react: ["18", "19"]

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
steps:
- uses: actions/checkout@v5

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: pnpm/action-setup@v5

- uses: actions/cache@v4
id: yarn-cache
- name: Use Node.js 24.x
uses: actions/setup-node@v5
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 24
cache: "pnpm"

- name: Install
run: yarn install
run: pnpm install --frozen-lockfile

# The lockfile pins React 19; override it to validate the matrix's other
# major against the actual runtime. Type-checking stays pinned to the
# lockfile in the lint job, since the @types/react 18/19 ref-variance
# differences are a DefinitelyTyped concern, not the library's.
- name: "Override React ${{ matrix.react }}"
if: matrix.react != '19'
run: pnpm add -D react@^${{ matrix.react }} react-dom@^${{ matrix.react }} @types/react@^${{ matrix.react }} @types/react-dom@^${{ matrix.react }}

- name: "Tests: Unit"
run: pnpm test:coverage

# pnpm's side-effects cache (restored via setup-node's pnpm cache) makes
# `pnpm install` skip Cypress's postinstall, but the binary it downloads
# lives in ~/.cache/Cypress, outside the pnpm store. Cache that path and
# install explicitly so the binary is present even when postinstall is
# skipped. See https://on.cypress.io/not-installed-ci-error
- name: Cache Cypress binary
if: matrix.react == '19'
uses: actions/cache@v5
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: cypress-${{ runner.os }}-

- name: 'Tests: Unit'
run: yarn test:coverage
- name: "Install: Cypress binary"
if: matrix.react == '19'
run: pnpm exec cypress install

- name: 'Tests: E2E'
run: yarn test:e2e
- name: "Tests: E2E"
if: matrix.react == '19'
run: pnpm test:e2e

- name: Coveralls
if: matrix.react == '19'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -84,69 +101,43 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: pnpm/action-setup@v5

- uses: actions/cache@v4
id: yarn-cache
- name: Use Node.js 24.x
uses: actions/setup-node@v5
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 24
cache: "pnpm"

- name: Install
run: yarn install
run: pnpm install --frozen-lockfile

- name: Build
run: yarn build
run: pnpm build

examples:
name: Build examples
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v5

- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: pnpm/action-setup@v5

- uses: actions/cache@v4
id: yarn-cache-examples
- name: Use Node.js 24.x
uses: actions/setup-node@v5
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-examples-${{ hashFiles('examples/**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-examples-
node-version: 24
cache: "pnpm"

- name: Install master
run: yarn install
run: pnpm install --frozen-lockfile

- name: Install
run: cd examples && yarn
run: cd examples && pnpm install --frozen-lockfile

- name: Build
run: yarn build
run: cd examples && pnpm build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ dist/
node_modules/
coverage/
.cache/
.parcel-cache/
*.DS_Store
*.log
*.idea
Expand Down
16 changes: 0 additions & 16 deletions .npmignore

This file was deleted.

10 changes: 10 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 100,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"tabWidth": 2,
"sortPackageJson": false,
"ignorePatterns": []
}
17 changes: 17 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "jest", "import", "jsx-a11y"],
"env": {
"browser": true,
"node": true,
"es2021": true,
"jest": true
},
"categories": {
"correctness": "error"
},
"rules": {
"no-unused-expressions": ["error", { "allowShortCircuit": true }],
"typescript/no-non-null-assertion": "off"
}
}
7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

Loading
Loading