Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .github/workflows/check-published-scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Check Published
uses: checkdigit/github-actions/check-published@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH }}
DEBUG: '*'
SLACK_PUBLISH_MISMATCH: ${{ secrets.SLACK_PUBLISH_MISMATCH }}
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['22.x', '24.x']
node-version: ['24.x', '26.x']
steps:
Comment thread
carlansley marked this conversation as resolved.
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Compile
Expand All @@ -39,17 +39,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['22.x', '24.x']
node-version: ['24.x', '26.x']
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Compile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v4
76 changes: 53 additions & 23 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,69 @@ name: Coverage

on:
pull_request:
branches:
- 'main'
branches: [main]

env:
CI: true
concurrency:
group: coverage-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
coverage:
name: Coverage
base:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.base.sha }}
- uses: actions/setup-node@v7
with:
node-version: '26.x'
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run coverage
run: npm run ci:coverage
- uses: actions/upload-artifact@v7
with:
name: base-coverage
path: coverage/lcov.info
if-no-files-found: error

pr:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v7
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
node-version: '26.x'
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Calculate Code Coverage
- name: Run coverage
run: npm run ci:coverage
- name: Create Coverage Report for base branch
run: |
mv coverage/lcov.info coverage/lcov_head.info
git fetch
git checkout origin/${{ github.event.pull_request.base.ref }}
npm ci --ignore-scripts && npm run ci:coverage
- name: Post Coverage Report
- uses: actions/upload-artifact@v7
with:
name: pr-coverage
path: coverage/lcov.info
if-no-files-found: error

report:
name: Coverage
needs: [base, pr]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Require successful coverage jobs
if: ${{ needs.base.result != 'success' || needs.pr.result != 'success' }}
run: exit 1
- uses: actions/download-artifact@v8
with: { name: base-coverage, path: coverage }
- uses: actions/download-artifact@v8
with: { name: pr-coverage, path: coverage-pr }
- name: Post coverage report
uses: checkdigit/github-actions/coverage-reporter@main
with:
lcov-file: 'coverage/lcov_head.info'
lcov-base: 'coverage/lcov.info'
coverage-results-folder-pr: 'coverage-pr'
coverage-results-folder-base: 'coverage'
delete-old-comments: true
46 changes: 0 additions & 46 deletions .github/workflows/publish-beta.yml

This file was deleted.

52 changes: 46 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,64 @@ name: Publish
on:
release:
types: [created]
pull_request:
branches:
- 'main'

jobs:
publish:
name: Publish to NPM
name: ${{ github.event_name == 'release' && 'Publish Release' || 'Publish Beta' }}
if: >-
(github.event_name == 'release' && github.event.action == 'created') ||
(github.event_name == 'pull_request' &&
github.event.pull_request.base.ref == 'main' &&
github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-latest
environment: npm-publish
permissions:
contents: read
id-token: write
pull-requests: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: '24.x'
node-version: '26.x'
package-manager-cache: false
registry-url: 'https://registry.npmjs.org'
- name: Check Label
if: github.event_name == 'pull_request'
uses: checkdigit/github-actions/check-label@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check Imports
if: github.event_name == 'pull_request'
uses: checkdigit/github-actions/check-imports@main
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Audit Signatures
run: npm audit signatures
- name: Publish
- name: Run Test
if: github.event_name == 'pull_request'
run: npm run ci:test
- name: Prepare Beta
if: github.event_name == 'pull_request'
id: prepare-beta
uses: checkdigit/github-actions/prepare-beta@main
- name: Publish Release
if: github.event_name == 'release'
run: npm publish
- name: Publish Beta
if: github.event_name == 'pull_request'
run: npm publish --tag beta
- name: Comment npm publish result
if: github.event_name == 'pull_request'
uses: checkdigit/github-actions/comment-npm-publish@main
with:
betaPackage: ${{ steps.prepare-beta.outputs.betaPackage }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2022-2025 Check Digit, LLC.
Copyright (c) 2022-2026 Check Digit, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Check Digit Time Library

Copyright (c) 2022-2025 [Check Digit, LLC](https://checkdigit.com)
Copyright © 2022-2026 [Check Digit, LLC](https://checkdigit.com)

The Check Digit time library is the officially sanctioned method for Check Digit services to deal with time. It has date manipulation functions provided by date-fns. Features:

Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ These versions of `@checkdigit/time` are currently being supported with security

| Version | Supported |
| ------- | ------------------ |
| \>= 2.x | :white_check_mark: |
| < 2.0 | :x: |
| \>= 6.0 | :white_check_mark: |
| \< 6.0 | :x: |

## Reporting a Vulnerability

Expand Down
15 changes: 15 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
import checkdigitConfig from '@checkdigit/eslint-config';

const eslintCommentsPlugin = checkdigitConfig.find(
(config) =>
config.plugins?.['@eslint-community/eslint-comments'] !== undefined,
)?.plugins?.['@eslint-community/eslint-comments'];

if (eslintCommentsPlugin === undefined) {
throw new Error('Unable to find the ESLint comments plugin');
}

export default [
...checkdigitConfig,
{
files: ['src/date-fns/**', 'src/date-fns-tz/**'],
plugins: {
'eslint-comments': eslintCommentsPlugin,
},
rules: {
'@eslint-community/eslint-comments/no-unlimited-disable': 'off',
'@checkdigit/file-path-comment': 'off',
'markdown/no-missing-label-refs': 'off',
'markdown/no-space-in-emphasis': 'off',
'markdown/no-unused-definitions': 'off',
'markdown/fenced-code-language': 'off',
'unicorn/filename-case': 'off',
},
Expand Down
Loading
Loading