bizdays-toolkit 0.21.1 → 0.21.3

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
@@ -1,9 +1,34 @@
1
1
  # Changelog
2
2
 
3
- この形式は [Keep a Changelog](https://keepachangelog.com/ja/1.1.0/) に、版の付け方は [Semantic Versioning](https://semver.org/lang/ja/) と [RELEASING.md](./RELEASING.md) の方針に従います。区分には Keep a Changelog の Added / Changed / Deprecated / Removed / Fixed / Security に加えて、祝日データの更新を表す **Data** を使います。
3
+ この形式は [Keep a Changelog](https://keepachangelog.com/ja/1.1.0/) に、版の付け方は [Semantic Versioning](https://semver.org/lang/ja/) と [RELEASING.md](./RELEASING.md) の方針に従います。区分には Keep a Changelog の Added / Changed / Deprecated / Removed / Fixed / Security に加えて、祝日データの更新を表す **Data**、マイナー版で利用者がする作業を書く **移行**(RELEASING.md)、公開物の変わらない品質の仕組み(検査・CI・リリースの手順)を書く **開発** を使います。
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.21.3] - 2026-10-26
8
+
9
+ ### Changed
10
+
11
+ - ドキュメントの食い違いを直した(公開物の動作は変わらない)。ガイド(英日)のフランスの対応年を 1974〜2099 年から正しい 2000〜2099 年に、README(英日)の minify + gzip のサイズを測り直して英国込み 12.8 → 13.2 KB・日本込み 12.9 → 12.8 KB・シンガポール込み 11.9 → 12.0 KB に(測り方を `scripts/measure-bundle.ts` に固定した。0.20.0 の値は日本とシンガポールで測り方が揃っていなかった)、ガイドの診断の表に `counting-basis` を、エラーコードの一覧に `invalid-argument`・`time-zone-conflict`・`unconfirmed-holiday` を足した。英国の `unverified` の理由を「The Gazette の索引の欠け」から、1986〜1990 年の北アイルランドの Order は「オンラインにない号(Missing Gazette issues)」、1987 年分の布告と 1975 年の北アイルランドの Order は「見つかっていない」に改めた(ガイド・README・出典の記録・フィクスチャの reason。README と decisions.md の 49 番は 13 日すべてをオンラインにない号としていた)。README の版の固定の例を英日で揃え、出典の記録に付いていた「テスト用フィクスチャのみ」の誤った括弧書きを外した
12
+ - ガイド(英日)の「同梱の祝日の提供元」の冒頭に、4 か国の比較表(週末に当たった祝日を返すか・振替・予測・`confirmedThrough`)を足した。英国の提供元は週末に当たった祝日を返さないので、`{ holiday: true, weekdays: [6] }` のような規則は当てはまらない
13
+ - `docs/decisions.md`: 決定の文書の現状に追いついていない記述を直した。18 番(対応年は 1974 年から。49 番)・6 番(契約の項目に `key`)・10 番(CI でだけ使う道具は actionlint のほかにもある)・29 番(古い TypeScript は 0.13.0 から CI で確かめている)・45 番(`docs/` のファイルの数の数え方と、README からガイドに移った説明)に追記し、12 番に判定の順番の番号(ガイドの 1〜8)を明記して 47 番の「12 番の 5・6」を「6(`"over-holiday"` なら 4)」に、13・31 番の「README に明記」を「ガイドに明記」に、28 番の監視の範囲を 4 か国に直した。22・49 番の脱字を直した。51 番(ドキュメントの数値の検査と、前の版との祝日データの差分)を追加した
14
+ - `RELEASING.md`: 「CI の版は次の 2 か所で管理」を直し(実際は 6 項目)、README のサイズの値の測り方を `scripts/measure-bundle.ts` に改めた。CHANGELOG の冒頭の区分の説明に「移行」「開発」を足した
15
+
16
+ ### 開発
17
+
18
+ - `pnpm check`(`scripts/check-package.ts`)に、ドキュメントの数値・一覧を `dist` とソースの型と照合する検査を足した(decisions.md の 51 番)。README の提供元の表とガイドの国の節・「対応年の外」の節の対応年とタイムゾーン・`confirmedThrough`、祝日の識別子の表の key、エラーコードの一覧と診断の表のコード、README の「測った版」が今のマイナー系列であること、英日の対の文書で節ごとの数値がそろうこと。0.21.2 の文書に当てると、ガイドのフランスの対応年・README のサイズの測った版・診断の表とエラーコードの一覧の抜け・版の固定の例の英日の違いを検出する
19
+ - CI に `data-compare` ジョブを足した。公開済みの前の版(npm の `latest`)と今回の `dist` の同梱の提供元を、対応年が重なるすべての年で 1 日ずつ比べ(`scripts/data-compare.ts`)、`key` が変わったとき、差分があるのに CHANGELOG に Data がないとき、提供元がなくなったか対応年が狭まったときに失敗する。照合のフィクスチャのない年(予測の年など)の安全網
20
+ - README のサイズを測る `scripts/measure-bundle.ts` を足した(esbuild は依存にせず、パスを引数で渡す。pnpm check・CI には含めない)
21
+
22
+ ## [0.21.2] - 2026-10-26
23
+
24
+ ### Changed
25
+
26
+ - `src/uk/rules.ts`: `SPECIAL_DAYS`・`RENAMED` の出典のコメントを、`docs/sources/` の記録の節への参照に短くした(根拠の本文は記録にあり、`dist` にはコメントが残るため)。`./uk` の gzip が 8,743 → 7,969 に減った(測定 7,969)。動作は変わらない
27
+
28
+ ### 開発
29
+
30
+ - 納品の検査を `pnpm check` に 3 つ足した(decisions.md の 50 番)。`check-size`: CHANGELOG の今の版の節に書いた「測定 N」が実際の測定と一致すること(測り直し忘れを検出)。`check-package`: `docs/sources/*.md` が README.md と docs/README.ja.md の両方からリンクされていること、テスト用フィクスチャの `record`(出典の記録の節へのパス#アンカー)が実在すること
31
+
7
32
  ## [0.21.1] - 2026-10-26
8
33
 
9
34
  ### Data
@@ -575,7 +600,9 @@
575
600
 
576
601
  - 日本: 2026 年 2 月の官報(2027 年の春分・秋分の日)まで反映(`dataVersion: "2026-02"`、`confirmedThrough: 2027`)
577
602
 
578
- [Unreleased]: https://github.com/inohan77/bizdays-toolkit/compare/v0.21.1...HEAD
603
+ [Unreleased]: https://github.com/inohan77/bizdays-toolkit/compare/v0.21.3...HEAD
604
+ [0.21.3]: https://github.com/inohan77/bizdays-toolkit/compare/v0.21.2...v0.21.3
605
+ [0.21.2]: https://github.com/inohan77/bizdays-toolkit/compare/v0.21.1...v0.21.2
579
606
  [0.21.1]: https://github.com/inohan77/bizdays-toolkit/compare/v0.21.0...v0.21.1
580
607
  [0.21.0]: https://github.com/inohan77/bizdays-toolkit/compare/v0.20.0...v0.21.0
581
608
  [0.20.0]: https://github.com/inohan77/bizdays-toolkit/compare/v0.19.0...v0.20.0
package/README.md CHANGED
@@ -24,7 +24,7 @@ A business-day calendar that combines public holidays with company or store clos
24
24
  - **Recurring rules**: "closed on the 3rd Wednesday", "every other Wednesday", "stocktaking on the last day of the month", "closed on Mondays, or the next weekday when Monday is a holiday", "the day after (or before) a holiday", each with its own behaviour on holidays and an optional effective period
25
25
  - **Day-by-day values and combined calendars**: store hours that change by weekday, holiday and date; a business-day calendar made from such a schedule; and the days on which all (or any) of several calendars are open
26
26
  - **Option diagnostics**: `bizdays-toolkit/diagnose` lists rules that never apply, rules that are shadowed or redundant, rules that have ended, typos in option names and options with no business day at all, without throwing. One line in a test keeps options honest
27
- - **Lightweight, zero dependencies, time-zone safe**: about 11.0 KB min+gzip (about 12.9 KB with Japanese holidays, about 12.8 KB with UK bank holidays, about 11.9 KB with French holidays, about 11.9 KB with Singapore holidays; measured for 0.20.0). Standard JavaScript and `Intl` only, ESM with bundled types; tested on Node.js, Chrome, Firefox, Edge, Safari, Cloudflare Workers, Bun and Deno. Instants such as `Date` are converted to a civil date in the calendar's time zone before evaluation
27
+ - **Lightweight, zero dependencies, time-zone safe**: about 11.0 KB min+gzip (about 12.8 KB with Japanese holidays, about 13.2 KB with UK bank holidays, about 11.9 KB with French holidays, about 12.0 KB with Singapore holidays; measured for 0.21.3). Standard JavaScript and `Intl` only, ESM with bundled types; tested on Node.js, Chrome, Firefox, Edge, Safari, Cloudflare Workers, Bun and Deno. Instants such as `Date` are converted to a civil date in the calendar's time zone before evaluation
28
28
  - **Extensible to other countries and regions**: holiday providers are pluggable through the `HolidayProvider` interface, and `bizdays-toolkit/provider` exposes the calendar arithmetic (nth weekday of a month, Easter, substitute days for holidays on a weekend) that most countries' holidays are built from
29
29
 
30
30
  ## Installation
@@ -130,7 +130,7 @@ A holiday provider is an object with `id`, `timeZone`, `supportedYears` and `hol
130
130
  Versioning follows [Semantic Versioning](https://semver.org/). See [RELEASING.md](https://github.com/inohan77/bizdays-toolkit/blob/main/RELEASING.md) (Japanese) for details.
131
131
 
132
132
  - Official data updates (new, moved and one-off holidays by law, Official Gazette or proclamation, fixed equinox days in Japan, newly published years on GOV.UK, changes to the French Labour Code, newly gazetted years and revised dates in Singapore) are released as **patch** versions, so they reach you with either `^` or `~`
133
- - To freeze the holiday results, pin an exact version (for example `"bizdays-toolkit": "0.8.0"`)
133
+ - To freeze the holiday results, pin an exact version (for example `"bizdays-toolkit": "0.21.3"`)
134
134
  - The reflected data is shown by the provider's `dataVersion` (for Japan, the year and month of the Official Gazette reflected; for the UK, France and Singapore, the year and month of the GOV.UK, data.gouv.fr or data.gov.sg data reflected) and `confirmedThrough` (`jp.dataVersion`, `england.confirmedThrough` and so on). The module-level constants `dataVersion` and `confirmedThrough` in `bizdays-toolkit/jp` and `bizdays-toolkit/uk` are deprecated since 0.12.0 and will be removed in 1.0.0
135
135
  - Before 1.0.0, minor versions may contain breaking changes. What you need to change when moving between minor versions is listed in the [migration guide](https://github.com/inohan77/bizdays-toolkit/blob/main/docs/migration.md) (Japanese) and in the "移行" (migration) part of each version in the CHANGELOG
136
136
  - Decision reasons (`reason`), holiday kinds (`kind`), error codes and diagnostic codes may gain values in future versions. When you branch on their values, handle "anything else" too (see "互換性の約束", the compatibility promise, in [RELEASING.md](https://github.com/inohan77/bizdays-toolkit/blob/main/RELEASING.md))
@@ -141,7 +141,7 @@ Japanese holidays are verified with the "National Holidays" CSV published on the
141
141
 
142
142
  UK bank holidays are verified with the GOV.UK bank holidays data (<https://www.gov.uk/bank-holidays.json>, and for earlier years the history of the official GOV.UK repositories [alphagov/calendars](https://github.com/alphagov/calendars) and [alphagov/frontend](https://github.com/alphagov/frontend)), and the Welsh names of the Wales holidays with the Welsh version of GOV.UK (the verification data is a test fixture only; not included in the package).
143
143
 
144
- For 2000–2011, which predate GOV.UK's data, the authority is the bank holiday lists the government published at the time (DTI and BERR, directgov, the Scottish Executive and Government, nidirect; captured by the Wayback Machine), checked against the Royal Proclamations and Northern Ireland Orders in The Gazette (<https://www.thegazette.co.uk/>); for 1974–1999 the proclamations are the authority. Thirteen days in 1975–1990 are returned by rule but could not be checked because the issues of The Gazette that carry them are not online (listed as `unverified` in the test fixture, with the reasons). The sources are listed in [docs/sources/uk-bank-holidays-1974-1999.md](https://github.com/inohan77/bizdays-toolkit/blob/main/docs/sources/uk-bank-holidays-1974-1999.md) and [docs/sources/uk-bank-holidays-2000-2011.md](https://github.com/inohan77/bizdays-toolkit/blob/main/docs/sources/uk-bank-holidays-2000-2011.md) (test fixture only; not included in the package).
144
+ For 2000–2011, which predate GOV.UK's data, the authority is the bank holiday lists the government published at the time (DTI and BERR, directgov, the Scottish Executive and Government, nidirect; captured by the Wayback Machine), checked against the Royal Proclamations and Northern Ireland Orders in The Gazette (<https://www.thegazette.co.uk/>); for 1974–1999 the proclamations are the authority. Thirteen days in 1975–1990 are returned by rule but could not be checked (listed as `unverified` in the test fixture, with the reasons): the Northern Ireland Orders of 1986–1990 are in issues of The Gazette that are not online, and the 1987 annual proclamation and the Northern Ireland Order of 1975 were not found. The sources are listed in [docs/sources/uk-bank-holidays-1974-1999.md](https://github.com/inohan77/bizdays-toolkit/blob/main/docs/sources/uk-bank-holidays-1974-1999.md) and [docs/sources/uk-bank-holidays-2000-2011.md](https://github.com/inohan77/bizdays-toolkit/blob/main/docs/sources/uk-bank-holidays-2000-2011.md) (not included in the package).
145
145
 
146
146
  French public holidays are verified with the "Jours fériés en France" dataset published by DINUM on data.gouv.fr (<https://www.data.gouv.fr/datasets/jours-feries-en-france>, JSON exports for the Métropole and Alsace-Moselle zones; the verification data is a test fixture only; not included in the package).
147
147
 
package/dist/uk/rules.js CHANGED
@@ -56,26 +56,17 @@ const MOVED = [
56
56
  ];
57
57
  /** 布告による臨時の祝日 */
58
58
  const SPECIAL_DAYS = [
59
- // 臨時の祝日の名称は布告にはなく(布告は日付だけを指定する)、政府の答弁の呼び方による。固有の呼び方が公式の文書にない日は
60
- // 中立の "Additional bank holiday" に、政府の答弁が述べた理由を括弧で添える(GOV.UK の 2020 年 "Early May bank holiday (VE day)" と同じ形。
61
- // docs/sources/uk-bank-holidays-1974-1999.md の名称の節)
62
- // 1977 年の Silver Jubilee: England・Wales・NI は 6 月 7 日を追加(Spring は 6 月 6 日に移動)。Scotland は 6 月 6 日だけを追加。
63
- // 名称は Hansard 1975-12-18 の公式プログラム "Tuesday 7th (Silver Jubilee Bank Holiday)" と 1977-01-19 "a special Silver Jubilee Bank Holiday"、
64
- // Scotland は 1976-06-28 "a Jubilee holiday in Scotland"
59
+ // 名称の根拠と、固有の名称のない日に理由を括弧で添える規則: docs/sources/uk-bank-holidays-1974-1999.md 第 5 節
60
+ // 1977 年 Silver Jubilee: England・Wales・NI は 6/7 を追加(Spring は 6/6 に移動)、Scotland は 6/6 だけ
65
61
  { date: "1977-06-06", name: "Silver Jubilee bank holiday", divisions: SCOTLAND },
66
62
  { date: "1977-06-07", name: "Silver Jubilee bank holiday", divisions: NOT_SCOTLAND },
67
- // 名称は The London Gazette 48690(1981-07-27)の告示の見出し "ROYAL WEDDING BANK HOLIDAY" と Hansard 1981-07-30 の答弁 "the public holiday on 29 July for the Royal Wedding"
68
63
  { date: "1981-07-29", name: "Royal Wedding bank holiday", divisions: ALL },
69
- // 1995 年の VE Day 50 周年: England・Wales・NI は Early May を 5 月 8 日に移動、Scotland は 5 月 1 日(附則)に加えて 8 日を追加。
70
- // 政府は Scotland の分を "an additional day's bank holiday" とだけ呼び(Hansard 1993-12-16・1995-03-02)、固有の名称はない。
71
- // 括弧は Hansard 1993-12-16 の理由 "commemorating the 50th anniversary of the ending of the second world war" による
64
+ // 1995 年: England・Wales・NI は Early May を 5/8 に移動、Scotland は附則の 5/1 に加えて 5/8 を追加
72
65
  {
73
66
  date: "1995-05-08",
74
67
  name: "Additional bank holiday (VE Day 50th anniversary)",
75
68
  divisions: SCOTLAND,
76
69
  },
77
- // 政府は "a one-off additional Bank Holiday throughout the United Kingdom on Friday, 31 December 1999" と呼び(Hansard 1998-06-03)、
78
- // 固有の名称はない。括弧は同じ答弁の "the year 2000 will be heralded by" と質問の "to mark the Millennium" による
79
70
  { date: "1999-12-31", name: "Additional bank holiday (Millennium)", divisions: ALL },
80
71
  { date: "2002-06-03", name: "Golden Jubilee bank holiday", divisions: ALL },
81
72
  { date: "2011-04-29", name: "Royal Wedding bank holiday", divisions: ALL },
@@ -99,13 +90,11 @@ const SPECIAL_DAYS = [
99
90
  * 同じ曜日の並びの 2012・2017 年は、附則どおり 1/2 が 2nd January、1/3 が New Year’s Day の振替
100
91
  */
101
92
  const RENAMED = [
102
- // 12 月 25 日が土曜日の年(1976・1982・1993・1999・2004): 27 日は附則の「25・26 日が日曜日の年の 27 日」(Boxing Day の代わり)、
103
- // 28 日は Christmas Day の代わり。割り当ての文言があるのは 1982・1999 年の Scotland の布告("in place of Saturday, 25th December")、
104
- // 2004 年の政府の一覧、1976 年の Hansard 1976-07-27 だけで、1993 年と England・Wales・NI の 28 日(布告はどの日の代わりかを書かない)は
105
- // それに揃えた(docs/sources/uk-bank-holidays-1974-1999.md の付録 C)
93
+ // 振替日の名称の割り当て。当時の一覧・布告・Hansard の文言に揃える(根拠: docs/sources/uk-bank-holidays-1974-1999.md 付録 C、
94
+ // docs/sources/uk-bank-holidays-2000-2011.md)。12/25 が土曜日の年: 27 日が Boxing Day、28 日が Christmas Day の代わり
106
95
  { divisions: ALL, date: "1976-12-27", name: BOXING, kind: "substitute", key: "boxing-day" },
107
96
  { divisions: ALL, date: "1976-12-28", name: CHRISTMAS, kind: "substitute", key: "christmas" },
108
- // 1 月 1 日が土曜日の年の Scotland(1977・1983・1994・2000・2005): 3 日は附則の「1 月 2 日が日曜日なら 3 日」、4 日は布告で New Year’s Day の代わり
97
+ // 1/1 が土曜日の年の Scotland: 3 日が 2nd January(附則)、4 日が New Year’s Day の代わり
109
98
  {
110
99
  divisions: SCOTLAND,
111
100
  date: "1977-01-03",
@@ -114,7 +103,7 @@ const RENAMED = [
114
103
  key: "2nd-january",
115
104
  },
116
105
  { divisions: SCOTLAND, date: "1977-01-04", name: NEW_YEAR, kind: "substitute", key: "new-year" },
117
- // 12 月 25 日が日曜日の年の Scotland(1977・1983・1988・1994・2005): 26 日は附則の Christmas Day の振替、27 日は布告で追加された Boxing Day
106
+ // 12/25 が日曜日の年の Scotland: 26 日が Christmas Day(附則)、27 日が Boxing Day(布告)
118
107
  {
119
108
  divisions: SCOTLAND,
120
109
  date: "1977-12-26",
@@ -169,7 +158,6 @@ const RENAMED = [
169
158
  { divisions: SCOTLAND, date: "1994-12-27", name: BOXING, kind: "substitute", key: "boxing-day" },
170
159
  { divisions: ALL, date: "1999-12-27", name: BOXING, kind: "substitute", key: "boxing-day" },
171
160
  { divisions: ALL, date: "1999-12-28", name: CHRISTMAS, kind: "substitute", key: "christmas" },
172
- // 2000 年・2005 年の Scotland: 布告は 1 月 4 日を「1 月 1 日(土)の代わり」とし、1 月 3 日は附則の「1 月 2 日が日曜日なら 3 日」
173
161
  {
174
162
  divisions: SCOTLAND,
175
163
  date: "2000-01-03",
@@ -178,7 +166,6 @@ const RENAMED = [
178
166
  key: "2nd-january",
179
167
  },
180
168
  { divisions: SCOTLAND, date: "2000-01-04", name: NEW_YEAR, kind: "substitute", key: "new-year" },
181
- // 2004 年: 12 月 27 日は附則の「25・26 日が日曜日の年の 27 日」(Boxing Day の代わり)、28 日は布告で Christmas Day の代わり
182
169
  { divisions: ALL, date: "2004-12-27", name: BOXING, kind: "substitute", key: "boxing-day" },
183
170
  { divisions: ALL, date: "2004-12-28", name: CHRISTMAS, kind: "substitute", key: "christmas" },
184
171
  {
@@ -189,7 +176,6 @@ const RENAMED = [
189
176
  key: "2nd-january",
190
177
  },
191
178
  { divisions: SCOTLAND, date: "2005-01-04", name: NEW_YEAR, kind: "substitute", key: "new-year" },
192
- // 2005 年の Scotland: 12 月 26 日は附則の「Christmas Day が日曜日なら 26 日」、27 日は布告で追加された Boxing Day
193
179
  {
194
180
  divisions: SCOTLAND,
195
181
  date: "2005-12-26",
@@ -198,7 +184,7 @@ const RENAMED = [
198
184
  key: "christmas",
199
185
  },
200
186
  { divisions: SCOTLAND, date: "2005-12-27", name: BOXING, kind: "substitute", key: "boxing-day" },
201
- // 2011 年: 当時の政府の一覧(directgov・Scottish Government・nidirect)は 26 日を Christmas Day、27 日を Boxing Day の振替とした
187
+ // 2011 年: 当時の政府の一覧は 26 日を Christmas Day、27 日を Boxing Day の振替とした
202
188
  { divisions: ALL, date: "2011-12-26", name: CHRISTMAS, kind: "substitute", key: "christmas" },
203
189
  { divisions: ALL, date: "2011-12-27", name: BOXING, kind: "substitute", key: "boxing-day" },
204
190
  // 2023 年の Scotland: GOV.UK の割り当て(1/2 が New Year’s Day、1/3 が 2nd January)に合わせる
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bizdays-toolkit",
3
- "version": "0.21.1",
3
+ "version": "0.21.3",
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 and The Gazette; French public holidays (metropole, Alsace-Moselle) verified against data.gouv.fr; Singapore public holidays verified against data.gov.sg. / 祝日と営業日のカレンダー(タイムゾーン対応・日本の祝日は内閣府、英国の bank holidays は GOV.UK と The Gazette、フランスの祝日は data.gouv.fr、シンガポールの祝日は data.gov.sg のデータで全日照合)",
5
5
  "keywords": [
6
6
  "bank-holidays",