Skip to content

Lunar Phase v2.0.0

Compare
Choose a tag to compare
@jasonsturges jasonsturges released this 27 Dec 06:38
· 32 commits to main since this release

Though the API is largely unchanged, major rework of the package has been implemented.

First, this project was ported to TypeScript and now features type declaration for inclusion in TypeScript projects.

Second, the build pipeline has been converted to Vite, now featuring CJS, ESM, UMD, and IIFE builds.

There are potentially three breaking changes.

Options params instead of Hemisphere

To better support features requests, this package is moving to an options pattern instead of individual parameters of functions.

This should only effect those who specify Hemisphere, such as Southern Hemisphere for lunar emoji.

Formerly called as:

import { Hemisphere, Moon } from "lunarphase-js";

Moon.lunarPhaseEmoji(new Date, Hemisphere.SOUTHERN);

Now called via options as:

import { Hemisphere, Moon } from "lunarphase-js";

Moon.lunarPhaseEmoji(new Date(), {
  hemisphere: Hemisphere.SOUTHERN,
});

Julian vs JulianDay

The JulianDay instance is now just Julian.

Formerly called as:

import { JulianDay } from "lunarphase-js";

JulianDay.fromDate();

Now called via Julian

import { Julian } from "lunarphase-js";

Julian.fromDate();

Emoji constants

Emoji per hemisphere are now just two constant enumerations.

Formerly these would be accessed via nested constants:

LunarEmoji.NorthernHemisphere
LunarEmoji.SouthernHemisphere

Now, each set is simply accessed individually:

import {
  NorthernHemisphereLunarEmoji,
  SouthernHemisphereLunarEmoji,
} from "lunarphase-js";

NorthernHemisphereLunarEmoji["FULL"]
SouthernHemisphereLunarEmoji["FULL"]

Log an issue and I will assist in any migration issues.

What's Changed

Full Changelog: v1.0.10...v2.0.0