Skip to content

Commit 3ebd79a

Browse files
committed
fix(monorepo): Fixes for further circular dependency issues
1 parent c9096a1 commit 3ebd79a

22 files changed

+430
-195
lines changed

packages/date-time/src/constants.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*-------------------------------------------------------------------
2+
3+
⚡ Storm Software - Storm Stack
4+
5+
This code was released as part of the Storm Stack project. Storm Stack
6+
is maintained by Storm Software under the Apache-2.0 License, and is
7+
free for commercial and private use. For more information, please visit
8+
our licensing page.
9+
10+
Website: https://stormsoftware.com
11+
Repository: https://github.com/storm-software/storm-stack
12+
Documentation: https://stormsoftware.com/projects/storm-stack/docs
13+
Contact: https://stormsoftware.com/contact
14+
License: https://stormsoftware.com/projects/storm-stack/license
15+
16+
-------------------------------------------------------------------*/
17+
118
export const RFC_3339_DATETIME_REGEX =
219
/^(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])T([01]\d|2[0-3]):([0-5]\d):([0-5]\d|60))(\.\d+)?((Z)|([+|-]([01]\d|2[0-3]):[0-5]\d))$/;
320

packages/date-time/src/errors.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*-------------------------------------------------------------------
2+
3+
⚡ Storm Software - Storm Stack
4+
5+
This code was released as part of the Storm Stack project. Storm Stack
6+
is maintained by Storm Software under the Apache-2.0 License, and is
7+
free for commercial and private use. For more information, please visit
8+
our licensing page.
9+
10+
Website: https://stormsoftware.com
11+
Repository: https://github.com/storm-software/storm-stack
12+
Documentation: https://stormsoftware.com/projects/storm-stack/docs
13+
Contact: https://stormsoftware.com/contact
14+
License: https://stormsoftware.com/projects/storm-stack/license
15+
16+
-------------------------------------------------------------------*/
17+
118
import { ErrorCode } from "@storm-stack/errors";
219

320
export type DateTimeErrorCode =

packages/date-time/src/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*-------------------------------------------------------------------
2+
3+
⚡ Storm Software - Storm Stack
4+
5+
This code was released as part of the Storm Stack project. Storm Stack
6+
is maintained by Storm Software under the Apache-2.0 License, and is
7+
free for commercial and private use. For more information, please visit
8+
our licensing page.
9+
10+
Website: https://stormsoftware.com
11+
Repository: https://github.com/storm-software/storm-stack
12+
Documentation: https://stormsoftware.com/projects/storm-stack/docs
13+
Contact: https://stormsoftware.com/contact
14+
License: https://stormsoftware.com/projects/storm-stack/license
15+
16+
-------------------------------------------------------------------*/
17+
118
export * from "./constants";
219
export * from "./errors";
320
export * from "./storm-date";

packages/date-time/src/storm-date-time.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*-------------------------------------------------------------------
2+
3+
⚡ Storm Software - Storm Stack
4+
5+
This code was released as part of the Storm Stack project. Storm Stack
6+
is maintained by Storm Software under the Apache-2.0 License, and is
7+
free for commercial and private use. For more information, please visit
8+
our licensing page.
9+
10+
Website: https://stormsoftware.com
11+
Repository: https://github.com/storm-software/storm-stack
12+
Documentation: https://stormsoftware.com/projects/storm-stack/docs
13+
Contact: https://stormsoftware.com/contact
14+
License: https://stormsoftware.com/projects/storm-stack/license
15+
16+
-------------------------------------------------------------------*/
17+
118
import { Temporal } from "@js-temporal/polyfill";
219
import { type JsonValue, Serializable } from "@storm-stack/serialization";
320
import {
@@ -305,7 +322,7 @@ export class StormDateTime extends Date {
305322
return value.isValid;
306323
}
307324
if (isInstant(value)) {
308-
return !!value.epochMilliseconds;
325+
return Boolean(value.epochMilliseconds);
309326
}
310327

311328
let datetime: string | undefined;
@@ -644,7 +661,12 @@ export class StormDateTime extends Date {
644661
): number {
645662
this.#instant = this.#instant
646663
.toZonedDateTimeISO("UTC")
647-
.with({ hour, minute, second, millisecond })
664+
.with({
665+
hour,
666+
minute,
667+
second,
668+
millisecond
669+
})
648670
.toInstant();
649671
this.#zonedDateTime = this.#instant.toZonedDateTime({
650672
timeZone: this.timeZoneId,

packages/date-time/src/storm-date.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
/*-------------------------------------------------------------------
2+
3+
⚡ Storm Software - Storm Stack
4+
5+
This code was released as part of the Storm Stack project. Storm Stack
6+
is maintained by Storm Software under the Apache-2.0 License, and is
7+
free for commercial and private use. For more information, please visit
8+
our licensing page.
9+
10+
Website: https://stormsoftware.com
11+
Repository: https://github.com/storm-software/storm-stack
12+
Documentation: https://stormsoftware.com/projects/storm-stack/docs
13+
Contact: https://stormsoftware.com/contact
14+
License: https://stormsoftware.com/projects/storm-stack/license
15+
16+
-------------------------------------------------------------------*/
17+
218
import { Temporal } from "@js-temporal/polyfill";
319
import { type JsonValue, Serializable } from "@storm-stack/serialization";
420
import { isBigInt, isDate, isNumber, isSetString } from "@storm-stack/types";
@@ -132,7 +148,7 @@ export class StormDate extends StormDateTime {
132148
return value.isValid;
133149
}
134150
if (isInstant(value)) {
135-
return !!value.epochMilliseconds;
151+
return Boolean(value.epochMilliseconds);
136152
}
137153

138154
let datetime: string | undefined;

packages/date-time/src/storm-time.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
/*-------------------------------------------------------------------
2+
3+
⚡ Storm Software - Storm Stack
4+
5+
This code was released as part of the Storm Stack project. Storm Stack
6+
is maintained by Storm Software under the Apache-2.0 License, and is
7+
free for commercial and private use. For more information, please visit
8+
our licensing page.
9+
10+
Website: https://stormsoftware.com
11+
Repository: https://github.com/storm-software/storm-stack
12+
Documentation: https://stormsoftware.com/projects/storm-stack/docs
13+
Contact: https://stormsoftware.com/contact
14+
License: https://stormsoftware.com/projects/storm-stack/license
15+
16+
-------------------------------------------------------------------*/
17+
218
import { Temporal } from "@js-temporal/polyfill";
319
import { type JsonValue, Serializable } from "@storm-stack/serialization";
420
import { isBigInt, isDate, isNumber, isSetString } from "@storm-stack/types";
521
import { RFC_3339_TIME_REGEX } from "./constants";
622
import type { DateTimeInput, DateTimeOptions } from "./storm-date-time";
723
import { StormDateTime } from "./storm-date-time";
8-
import { isInstant } from "./utilities";
24+
import { isInstant } from "./utilities/is-instant";
925

1026
/**
1127
* Serializes a StormTime into a string
@@ -108,7 +124,7 @@ export class StormTime extends StormDateTime {
108124
return value.isValid;
109125
}
110126
if (isInstant(value)) {
111-
return !!value.epochMilliseconds;
127+
return Boolean(value.epochMilliseconds);
112128
}
113129

114130
let datetime: string | undefined;

packages/date-time/src/utilities/format-date-time-iso.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*-------------------------------------------------------------------
2+
3+
⚡ Storm Software - Storm Stack
4+
5+
This code was released as part of the Storm Stack project. Storm Stack
6+
is maintained by Storm Software under the Apache-2.0 License, and is
7+
free for commercial and private use. For more information, please visit
8+
our licensing page.
9+
10+
Website: https://stormsoftware.com
11+
Repository: https://github.com/storm-software/storm-stack
12+
Documentation: https://stormsoftware.com/projects/storm-stack/docs
13+
Contact: https://stormsoftware.com/contact
14+
License: https://stormsoftware.com/projects/storm-stack/license
15+
16+
-------------------------------------------------------------------*/
17+
118
import type { Temporal } from "@js-temporal/polyfill";
219
import { EMPTY_STRING } from "@storm-stack/types";
320
import type { StormDateTime } from "../storm-date-time";

packages/date-time/src/utilities/format-date-time.ts

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*-------------------------------------------------------------------
2+
3+
⚡ Storm Software - Storm Stack
4+
5+
This code was released as part of the Storm Stack project. Storm Stack
6+
is maintained by Storm Software under the Apache-2.0 License, and is
7+
free for commercial and private use. For more information, please visit
8+
our licensing page.
9+
10+
Website: https://stormsoftware.com
11+
Repository: https://github.com/storm-software/storm-stack
12+
Documentation: https://stormsoftware.com/projects/storm-stack/docs
13+
Contact: https://stormsoftware.com/contact
14+
License: https://stormsoftware.com/projects/storm-stack/license
15+
16+
-------------------------------------------------------------------*/
17+
118
import type { Temporal } from "@js-temporal/polyfill";
219
import { EMPTY_STRING } from "@storm-stack/types";
320
import { StormDateTime } from "../storm-date-time";
@@ -21,13 +38,13 @@ export const formatDateTime = (
2138

2239
return dateTime
2340
? `${dateTime.zonedDateTime
24-
.toString({
25-
smallestUnit,
26-
roundingMode,
27-
calendarName,
28-
timeZoneName,
29-
offset
30-
})
31-
.replaceAll("T", " ")}`
41+
.toString({
42+
smallestUnit,
43+
roundingMode,
44+
calendarName,
45+
timeZoneName,
46+
offset
47+
})
48+
.replaceAll("T", " ")}`
3249
: EMPTY_STRING;
3350
};

packages/date-time/src/utilities/format-date.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*-------------------------------------------------------------------
2+
3+
⚡ Storm Software - Storm Stack
4+
5+
This code was released as part of the Storm Stack project. Storm Stack
6+
is maintained by Storm Software under the Apache-2.0 License, and is
7+
free for commercial and private use. For more information, please visit
8+
our licensing page.
9+
10+
Website: https://stormsoftware.com
11+
Repository: https://github.com/storm-software/storm-stack
12+
Documentation: https://stormsoftware.com/projects/storm-stack/docs
13+
Contact: https://stormsoftware.com/contact
14+
License: https://stormsoftware.com/projects/storm-stack/license
15+
16+
-------------------------------------------------------------------*/
17+
118
import type { Temporal } from "@js-temporal/polyfill";
219
import { StormDate } from "../storm-date";
320
import type { StormDateTime } from "../storm-date-time";

packages/date-time/src/utilities/format-since.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*-------------------------------------------------------------------
2+
3+
⚡ Storm Software - Storm Stack
4+
5+
This code was released as part of the Storm Stack project. Storm Stack
6+
is maintained by Storm Software under the Apache-2.0 License, and is
7+
free for commercial and private use. For more information, please visit
8+
our licensing page.
9+
10+
Website: https://stormsoftware.com
11+
Repository: https://github.com/storm-software/storm-stack
12+
Documentation: https://stormsoftware.com/projects/storm-stack/docs
13+
Contact: https://stormsoftware.com/contact
14+
License: https://stormsoftware.com/projects/storm-stack/license
15+
16+
-------------------------------------------------------------------*/
17+
118
import type { Temporal } from "@js-temporal/polyfill";
219
import { StormError } from "@storm-stack/errors";
320
import { DateTimeErrorCode } from "../errors";

0 commit comments

Comments
 (0)