diff --git a/package-lock.json b/package-lock.json index 63ccd1fa..9872dca3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "MIT", "dependencies": { "@hebcal/core": "^5.6.1", + "@hebcal/hdate": "^0.11.5", "@hebcal/leyning": "^8.2.9", "normalize.css": "^8.0.1" }, diff --git a/package.json b/package.json index 60be7dbe..17d40c75 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "homepage": "https://github.com/akivajgordon/tikkun.io#readme", "dependencies": { "@hebcal/core": "^5.6.1", + "@hebcal/hdate": "^0.11.5", "@hebcal/leyning": "^8.2.9", "normalize.css": "^8.0.1" }, diff --git a/src/calendar-model/generator.test.ts b/src/calendar-model/generator.test.ts index e914c00d..ef30c954 100644 --- a/src/calendar-model/generator.test.ts +++ b/src/calendar-model/generator.test.ts @@ -1,12 +1,14 @@ import test from 'ava' import type { UserSettings } from './user-settings.ts' import { LeiningGenerator } from './generator.ts' -import { HDate, HebrewCalendar, Locale, months } from '@hebcal/core' +import { Locale } from '@hebcal/leyning/dist/esm/locale' +import { HDate, months } from '@hebcal/hdate' import type { LeiningAliyah, LeiningDate, LeiningRun } from './model-types.ts' import hebrewNumeralFromInteger from '../hebrew-numeral.ts' import type { Ref } from '../ref.ts' import { getBookName } from './hebcal-conversions.ts' import { last, toISODateString } from './utils.ts' +import { getHolidaysOnDate } from '@hebcal/core/dist/esm/holidays' const testSettings: UserSettings = { ashkenazi: true, @@ -60,7 +62,7 @@ test('4 פרשיות always get separate runs', (t) => { const start = new HDate(20, months.SHVAT, year) for (let day = 0; day < 100; day++) { const date = start.add(day, 'days') - const events = HebrewCalendar.getHolidaysOnDate(date) + const events = getHolidaysOnDate(date) if (!events?.some((d) => fourParshaDescriptions.includes(d.desc))) continue diff --git a/src/calendar-model/generator.ts b/src/calendar-model/generator.ts index 6ac5bcf9..a169a672 100644 --- a/src/calendar-model/generator.ts +++ b/src/calendar-model/generator.ts @@ -1,4 +1,4 @@ -import { HDate, HebrewCalendar, Locale, months } from '@hebcal/core' +import { HDate, months } from '@hebcal/hdate' import type { LeiningAliyah, LeiningDate, @@ -7,14 +7,13 @@ import type { } from './model-types.ts' import { LeiningInstanceId, LeiningRunType } from './model-types.ts' import type { UserSettings } from './user-settings.ts' -import { +import type { Aliyah, AliyotMap, - getLeyningOnDate, LeyningBase, LeyningParshaHaShavua, LeyningShabbatHoliday, -} from '@hebcal/leyning' +} from '@hebcal/leyning/dist/types.d.ts' import { invert, fromISODateString, @@ -24,6 +23,9 @@ import { } from './utils.ts' import { toLeiningAliyah, toAliyahIndex } from './hebcal-conversions.ts' import { isSameRun } from './ref-utils.ts' +import { getSedra } from '@hebcal/core/dist/esm/sedra' +import { getLeyningOnDate } from '@hebcal/leyning/dist/esm/getLeyningOnDate' +import { Locale } from '@hebcal/leyning/dist/esm/locale' export function isSameLeiningDate(a: LeiningDate, b: LeiningDate) { return arrayEquals(a.leinings, b.leinings, isSameLeiningInstance) @@ -97,10 +99,7 @@ export class LeiningGenerator { until = new HDate(untilDay, months.TISHREI, 1 + containing.getFullYear()) // Get בראשית from the previous year. - const parshaFinder = HebrewCalendar.getSedra( - until.getFullYear() - 1, - this.settings.israel - ) + const parshaFinder = getSedra(until.getFullYear() - 1, this.settings.israel) return this.generateCalendar({ start: parshaFinder.find('Bereshit')!, until, diff --git a/src/calendar-model/hebcal-conversions.ts b/src/calendar-model/hebcal-conversions.ts index 5f01aa3b..9b1b83dd 100644 --- a/src/calendar-model/hebcal-conversions.ts +++ b/src/calendar-model/hebcal-conversions.ts @@ -1,6 +1,7 @@ /** @fileoverview Contains generic helpers to convert between @hebcal types and our model types. */ -import { Aliyah, BOOK, calculateNumVerses } from '@hebcal/leyning' +import type { Aliyah } from '@hebcal/leyning/dist/esm/types' +import { BOOK, calculateNumVerses } from '@hebcal/leyning/dist/esm/common' import type { RefWithScroll, ScrollName } from '../ref.ts' import type { LeiningAliyah } from './model-types.ts' diff --git a/src/components/ParshaPicker.ts b/src/components/ParshaPicker.ts index 6d3bf19c..8b81dc7b 100644 --- a/src/components/ParshaPicker.ts +++ b/src/components/ParshaPicker.ts @@ -4,7 +4,7 @@ import ParshaResult, { NoResults } from './ParshaResult.ts' import Search, { SearchEmitter } from './Search.ts' import EventEmitter from '../event-emitter.ts' import { LeiningGenerator } from '../calendar-model/generator.ts' -import { HDate, Locale } from '@hebcal/core' +import { HDate, Locale } from '@hebcal/hdate' import { LeiningInstance, LeiningInstanceId, diff --git a/src/view-model/scroll-view-model.ts b/src/view-model/scroll-view-model.ts index 25b08550..08862d4a 100644 --- a/src/view-model/scroll-view-model.ts +++ b/src/view-model/scroll-view-model.ts @@ -10,7 +10,7 @@ import { LeiningRunType, } from '../calendar-model/model-types.ts' import IntegerIterator from '../integer-iterator.ts' -import { HDate } from '@hebcal/core' +import { HDate } from '@hebcal/hdate' import { containsRef } from '../calendar-model/ref-utils.ts' import { fromISODateString,