bizdays-toolkit 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,27 @@
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.1] - 2026-10-18
8
+
9
+ ライブラリのコードは 0.8.0 と同じ。動作を確かめる環境を広げ、README の記述を確かめた範囲に合わせた。
10
+
11
+ ### Changed
12
+
13
+ - README の動作環境の記述を、CI で確かめた範囲に合わせた。「Node.js・ブラウザー・エッジランタイムで動作」を、確かめている環境(Node.js・Chrome・Firefox・Edge・Safari・Cloudflare Workers)の明記に改め、確かめていない環境(Deno・Bun・Vercel の Edge Runtime など)も書いた。Temporal は形で判別していることと、本物の Temporal を備えた環境では CI で確かめていることを書いた。サイズの値に測った版(0.8.1)を添えた。エラーコードの一覧に `invalid-input` を足した
14
+ - README に、CI で確かめている Node.js の版(22.12・22・24・26)と、CommonJS の `require()` で読み込めることを CI で確かめていることを書いた。Node.js 22.12 では `require()` での読み込みに実験的な機能の警告が出ることも書いた(結果には影響しない)。`engines`(`>=22.12`)は変わらない
15
+
16
+ ### 開発
17
+
18
+ - 公開する `dist` を ESM(`import`)と CommonJS(`require()`)で確かめるテスト(`test/compat`、`pnpm test:compat`)を追加し、`pnpm check` に含めた。CI に `compat` ジョブを追加し、engines の下限の Node.js 22.12.0 と 26.12.0 でも確かめる(これらの版ではテストの `.ts` と npm 12 が動かないため、ビルドは Node.js 24 で行い、Node.js を切り替えて `dist` だけを確かめる)
19
+
20
+ - CI に、公開する `dist` をブラウザーと Cloudflare Workers で確かめるジョブを追加した。`browsers`(Chrome・Firefox・Edge。ランナーのドライバーを WebDriver で操作する `scripts/test-browsers.ts`)・`safari`(macOS)・`workerd`(版と SHA-256 を固定した公式のリリースの workerd で動かす `scripts/test-workerd.ts`)。確認の中身は `test/compat/smoke.mjs` に共通化し、本物の Temporal を備えた環境では Temporal のオブジェクトでも確かめる
21
+ - `pnpm check` で、README(英語・日本語)のコード例を実行し、コメントに書いた結果と比べるようにした(`scripts/check-readme-examples.ts`)
22
+ - `pnpm check`(`scripts/check-package.ts`)で、`src` が Node.js 固有の機能(`node:` のモジュール・`process`・`Buffer` など)を使っていないことを確かめるようにした
23
+ - 自前のスクリプトとテストで Node.js の警告が出たら失敗にするようにした(`scripts/strict-warnings.ts`。`test/compat` は対象外)
24
+ - `pnpm check` の最初に、開発用のツールの版を確かめる `scripts/check-toolchain.ts` を追加した(ワークフローどうしの Node.js の版、compat の行列の engines の下限、実行している Node.js・npm・pnpm と固定版の比較。固定版との違いは CI ではエラー、手元では注意の表示)
25
+ - GOV.UK の監視のワークフローに、手動実行の入力 `simulate` を追加した。架空の祝日を 1 件足して照合し(`pnpm verify:govuk --simulate`)、ラベル `govuk-data-simulation` の issue で差分の経路を確かめられる
26
+ - `pnpm check` のパッケージの中身の検査(`npm pack --dry-run`)を、Windows で Node.js の非推奨の警告(DEP0190)が出ない形で npm を起動するようにした
27
+
7
28
  ## [0.8.0] - 2026-10-17
8
29
 
9
30
  ### Added
@@ -179,7 +200,8 @@
179
200
 
180
201
  - 日本: 2026 年 2 月の官報(2027 年の春分・秋分の日)まで反映(`dataVersion: "2026-02"`、`confirmedThrough: 2027`)
181
202
 
182
- [Unreleased]: https://github.com/inohan77/bizdays-toolkit/compare/v0.8.0...HEAD
203
+ [Unreleased]: https://github.com/inohan77/bizdays-toolkit/compare/v0.8.1...HEAD
204
+ [0.8.1]: https://github.com/inohan77/bizdays-toolkit/compare/v0.8.0...v0.8.1
183
205
  [0.8.0]: https://github.com/inohan77/bizdays-toolkit/compare/v0.7.0...v0.8.0
184
206
  [0.7.0]: https://github.com/inohan77/bizdays-toolkit/compare/v0.6.0...v0.7.0
185
207
  [0.6.0]: https://github.com/inohan77/bizdays-toolkit/compare/v0.5.0...v0.6.0
package/README.md CHANGED
@@ -26,7 +26,7 @@ A business-day calendar that combines public holidays with company or store clos
26
26
  - **Month-based due dates**: due dates such as "closing on the 20th, paid on the 10th of the next month (next business day if closed)" or "the last business day of the month", with the four adjustment conventions used in finance (following, preceding, modified-following, modified-preceding)
27
27
  - **Business-day arithmetic**: closed weekdays, annual closures (including ranges across the new year), specific closed and open dates, and holidays combine to compute "N business days later", "next business day after the cut-off time" and more
28
28
  - **Time-zone safe**: instants such as `Date` are converted to a civil date in the calendar's time zone (`Asia/Tokyo` for Japan, `Europe/London` for the UK) before evaluation. A server running in UTC does not treat 00:00–09:00 in Japan as the previous day
29
- - **Lightweight, zero dependencies**: about 7.4 KB min+gzip (about 9.0 KB with Japanese holidays, about 9.0 KB with UK bank holidays). ESM, bundled types and `sideEffects: false`; runs on Node.js, browsers and edge runtimes
29
+ - **Lightweight, zero dependencies**: about 7.4 KB min+gzip (about 9.0 KB with Japanese holidays, about 9.0 KB with UK bank holidays; measured for 0.8.1). ESM, bundled types and `sideEffects: false`. Written in standard JavaScript and `Intl` only (no Node.js APIs); CI tests it on Node.js, Chrome, Firefox, Edge, Safari and Cloudflare Workers
30
30
  - **Extensible to other countries and regions**: holiday providers are pluggable through the `HolidayProvider` interface. Japan and the UK are bundled
31
31
 
32
32
  ## Installation
@@ -35,7 +35,7 @@ A business-day calendar that combines public holidays with company or store clos
35
35
  pnpm add bizdays-toolkit
36
36
  ```
37
37
 
38
- Node.js 22.12 or later. The package is ESM only, but Node.js 22.12 and later can also load it from CommonJS with `require()`.
38
+ Node.js 22.12 or later. CI tests the package on Node.js 22.12, 22, 24 and 26, on Chrome, Firefox and Edge (Linux) and Safari (macOS), and on Cloudflare Workers (workerd, the open-source Workers runtime). The browsers are the latest stable versions on GitHub's runners, so their versions change as the runners are updated. The package is ESM only, but it can also be loaded from CommonJS with `require()` (tested in CI as well; on Node.js 22.12, `require()` prints an experimental-feature warning, which does not affect the result, and Node.js 26 prints none). Other runtimes (such as Deno, Bun or Vercel's Edge Runtime) are not tested.
39
39
 
40
40
  ## Usage
41
41
 
@@ -315,6 +315,8 @@ Every method accepts the following inputs. Returned dates are always `"YYYY-MM-D
315
315
  | Temporal `PlainDate`, `PlainDateTime` | A civil date or date and time (no dependency on Temporal) |
316
316
  | Temporal `Instant`, `ZonedDateTime` | An instant |
317
317
 
318
+ Temporal objects are recognized by their shape, so the package does not depend on Temporal. CI also checks real Temporal objects in the runtimes that provide Temporal (the CI log shows whether each runtime had it).
319
+
318
320
  The calendar's time zone is the `timeZone` option, then the holiday provider's time zone, then `"UTC"`.
319
321
 
320
322
  ### Holidays of other countries and regions
@@ -379,7 +381,7 @@ try {
379
381
  }
380
382
  ```
381
383
 
382
- Main codes: `invalid-date`, `invalid-month`, `invalid-month-day`, `invalid-time`, `invalid-range`, `invalid-weekday`, `invalid-time-zone`, `invalid-option`, `out-of-range`, `invalid-provider`, `invalid-provider-data`, `no-business-day`. Future versions may add codes.
384
+ Main codes: `invalid-date`, `invalid-input`, `invalid-month`, `invalid-month-day`, `invalid-time`, `invalid-range`, `invalid-weekday`, `invalid-time-zone`, `invalid-option`, `out-of-range`, `invalid-provider`, `invalid-provider-data`, `no-business-day`. Future versions may add codes.
383
385
 
384
386
  ### Option diagnostics
385
387
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bizdays-toolkit",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Holidays, business-day calendar and day-by-day schedules (e.g. store hours) with time zone support. Japanese holidays verified against the Cabinet Office data; UK bank holidays (England, Wales, Scotland, Northern Ireland) verified against GOV.UK. / 祝日と営業日のカレンダー(タイムゾーン対応・日本の祝日は内閣府、英国の bank holidays は GOV.UK のデータで全日照合)",
5
5
  "keywords": [
6
6
  "bank-holidays",
@@ -56,12 +56,13 @@
56
56
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
57
57
  "typecheck": "tsc --noEmit",
58
58
  "lint": "oxlint --deny-warnings src scripts test",
59
- "test": "node --test \"test/**/*.test.ts\"",
59
+ "test": "node --import ./scripts/strict-warnings.ts --test \"test/**/*.test.ts\"",
60
60
  "test:tz": "node scripts/test-tz.ts",
61
+ "test:compat": "node --test test/compat/esm.test.mjs test/compat/cjs.test.cjs",
61
62
  "bench": "node scripts/bench.ts",
62
63
  "fmt": "oxfmt",
63
64
  "fmt:check": "oxfmt --check",
64
- "check": "pnpm typecheck && pnpm lint && pnpm test && pnpm test:tz && pnpm build && pnpm fmt:check && node scripts/check-package.ts && node scripts/check-size.ts && node scripts/api-report.ts",
65
+ "check": "node scripts/check-toolchain.ts && pnpm typecheck && pnpm lint && pnpm test && pnpm test:tz && pnpm build && pnpm test:compat && node scripts/check-readme-examples.ts && pnpm fmt:check && node scripts/check-package.ts && node scripts/check-size.ts && node scripts/api-report.ts",
65
66
  "verify:cao": "node scripts/verify-cao.ts",
66
67
  "verify:govuk": "node scripts/verify-govuk.ts",
67
68
  "prepublishOnly": "pnpm check",