Skip to content

Commit

Permalink
Fix date type exportes
Browse files Browse the repository at this point in the history
  • Loading branch information
f-elix committed May 14, 2024
1 parent 0b93f30 commit 4e6e7f9
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 46 deletions.
6 changes: 6 additions & 0 deletions packages/dates/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @288-toolkit/dates

## 4.0.10

### Patch Changes

- Fix type exports

## 4.0.9

### Patch Changes
Expand Down
1 change: 0 additions & 1 deletion packages/dates/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './parseLocalDate.js';
export * from './today.js';
export * from './types.js';
1 change: 0 additions & 1 deletion packages/dates/dist/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './parseLocalDate.js';
export * from './today.js';
export * from './types.js';
2 changes: 1 addition & 1 deletion packages/dates/dist/parseLocalDate.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DatePartString } from './types.js';
import type { DatePartString } from './today.js';
/**
* Converts a date, in the yyyy-mm-dd format, into a Date object, in the user's
* timezone, at midnight.
Expand Down
14 changes: 13 additions & 1 deletion packages/dates/dist/today.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@
* Timezone aware day
*/
import type { TimeZone } from '@288-toolkit/types/timezones';
import type { DatePart } from './types.js';
/**
* The minimal date-like interface we need to represent a date without a time.
*/
export interface DatePart {
getTime: () => number;
getFullYear: () => number;
getMonth: () => number;
getDate: () => number;
}
/**
* The string representation of a date without a time.
*/
export type DatePartString = `${number}-${number}-${number}`;
export type TodayOptions = {
now: DatePart;
hourOfStartOfDay: number;
Expand Down
18 changes: 0 additions & 18 deletions packages/dates/dist/types.d.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/dates/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@288-toolkit/dates",
"version": "4.0.9",
"version": "4.0.10",
"author": "DeuxHuitHuit",
"license": "MIT",
"type": "module",
"scripts": {
"build": "svelte-package",
"build": "svelte-package -i src",
"test": "vitest run",
"test:watch": "vitest",
"format:prettier": "prettier --config ./.prettierrc",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './parseLocalDate.js';
export * from './today.js';
export * from './types.js';
18 changes: 0 additions & 18 deletions packages/dates/src/lib/types.d.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DatePartString } from './types.js';
import type { DatePartString } from './today.js';

/**
* Converts a date, in the yyyy-mm-dd format, into a Date object, in the user's
Expand Down
16 changes: 15 additions & 1 deletion packages/dates/src/lib/today.ts → packages/dates/src/today.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,21 @@

import { ISO_LOCALE } from '@288-toolkit/format';
import type { TimeZone } from '@288-toolkit/types/timezones';
import type { DatePart } from './types.js';

/**
* The minimal date-like interface we need to represent a date without a time.
*/
export interface DatePart {
getTime: () => number;
getFullYear: () => number;
getMonth: () => number;
getDate: () => number;
}

/**
* The string representation of a date without a time.
*/
export type DatePartString = `${number}-${number}-${number}`;

export type TodayOptions = {
now: DatePart;
Expand Down
2 changes: 1 addition & 1 deletion packages/dates/test/today.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { TimeZone } from '@288-toolkit/types/timezones';
import { describe, expect, test } from 'vitest';
import { computeTimezoneOffset, today } from '../src/lib/today';
import { computeTimezoneOffset, today } from '../src/today';

const timeZone = 'America/Toronto' as const;

Expand Down

0 comments on commit 4e6e7f9

Please sign in to comment.