@arkv/temporal 0.2.0
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/README.md +492 -0
- package/dist/cjs/constants.js +7 -0
- package/dist/cjs/dayjs.js +319 -0
- package/dist/cjs/diff.js +60 -0
- package/dist/cjs/format.js +84 -0
- package/dist/cjs/index.js +49 -0
- package/dist/cjs/locale.js +73 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/parse.js +46 -0
- package/dist/cjs/start-end.js +111 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/units.js +56 -0
- package/dist/esm/constants.js +4 -0
- package/dist/esm/dayjs.js +315 -0
- package/dist/esm/diff.js +57 -0
- package/dist/esm/format.js +81 -0
- package/dist/esm/index.js +45 -0
- package/dist/esm/locale.js +66 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/parse.js +43 -0
- package/dist/esm/start-end.js +107 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/units.js +52 -0
- package/dist/types/constants.d.ts +3 -0
- package/dist/types/dayjs.d.ts +61 -0
- package/dist/types/diff.d.ts +2 -0
- package/dist/types/format.d.ts +2 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/locale.d.ts +15 -0
- package/dist/types/parse.d.ts +2 -0
- package/dist/types/start-end.d.ts +4 -0
- package/dist/types/types.d.ts +12 -0
- package/dist/types/units.d.ts +4 -0
- package/package.json +60 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const en = {
|
|
2
|
+
name: 'en',
|
|
3
|
+
months: [
|
|
4
|
+
'January',
|
|
5
|
+
'February',
|
|
6
|
+
'March',
|
|
7
|
+
'April',
|
|
8
|
+
'May',
|
|
9
|
+
'June',
|
|
10
|
+
'July',
|
|
11
|
+
'August',
|
|
12
|
+
'September',
|
|
13
|
+
'October',
|
|
14
|
+
'November',
|
|
15
|
+
'December',
|
|
16
|
+
],
|
|
17
|
+
monthsShort: [
|
|
18
|
+
'Jan',
|
|
19
|
+
'Feb',
|
|
20
|
+
'Mar',
|
|
21
|
+
'Apr',
|
|
22
|
+
'May',
|
|
23
|
+
'Jun',
|
|
24
|
+
'Jul',
|
|
25
|
+
'Aug',
|
|
26
|
+
'Sep',
|
|
27
|
+
'Oct',
|
|
28
|
+
'Nov',
|
|
29
|
+
'Dec',
|
|
30
|
+
],
|
|
31
|
+
weekdays: [
|
|
32
|
+
'Sunday',
|
|
33
|
+
'Monday',
|
|
34
|
+
'Tuesday',
|
|
35
|
+
'Wednesday',
|
|
36
|
+
'Thursday',
|
|
37
|
+
'Friday',
|
|
38
|
+
'Saturday',
|
|
39
|
+
],
|
|
40
|
+
weekdaysShort: [
|
|
41
|
+
'Sun',
|
|
42
|
+
'Mon',
|
|
43
|
+
'Tue',
|
|
44
|
+
'Wed',
|
|
45
|
+
'Thu',
|
|
46
|
+
'Fri',
|
|
47
|
+
'Sat',
|
|
48
|
+
],
|
|
49
|
+
weekdaysMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
|
|
50
|
+
weekStart: 0,
|
|
51
|
+
};
|
|
52
|
+
const Ls = { en };
|
|
53
|
+
let globalLocale = 'en';
|
|
54
|
+
export function getLocaleObj(name) {
|
|
55
|
+
return Ls[name] ?? en;
|
|
56
|
+
}
|
|
57
|
+
export function getGlobalLocale() {
|
|
58
|
+
return globalLocale;
|
|
59
|
+
}
|
|
60
|
+
export function setGlobalLocale(name) {
|
|
61
|
+
globalLocale = name;
|
|
62
|
+
}
|
|
63
|
+
export function registerLocale(locale) {
|
|
64
|
+
Ls[locale.name] = locale;
|
|
65
|
+
}
|
|
66
|
+
export { Ls };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
2
|
+
const HAS_OFFSET = /Z|[+-]\d{2}:\d{2}/;
|
|
3
|
+
const HAS_ANNOTATION = /\[/;
|
|
4
|
+
function parseString(s, tz) {
|
|
5
|
+
try {
|
|
6
|
+
if (HAS_ANNOTATION.test(s)) {
|
|
7
|
+
return Temporal.ZonedDateTime.from(s);
|
|
8
|
+
}
|
|
9
|
+
if (HAS_OFFSET.test(s)) {
|
|
10
|
+
return Temporal.Instant.from(s).toZonedDateTimeISO(tz);
|
|
11
|
+
}
|
|
12
|
+
if (DATE_ONLY.test(s)) {
|
|
13
|
+
return Temporal.PlainDate.from(s).toZonedDateTime(tz);
|
|
14
|
+
}
|
|
15
|
+
return Temporal.PlainDateTime.from(s).toZonedDateTime(tz);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function isTDayjsLike(d) {
|
|
22
|
+
return d !== null && typeof d === 'object' && '$zdt' in d;
|
|
23
|
+
}
|
|
24
|
+
export function parseInput(date, tz) {
|
|
25
|
+
if (date === null)
|
|
26
|
+
return null;
|
|
27
|
+
if (date === undefined) {
|
|
28
|
+
return Temporal.Now.zonedDateTimeISO(tz);
|
|
29
|
+
}
|
|
30
|
+
if (isTDayjsLike(date)) {
|
|
31
|
+
return date.$zdt;
|
|
32
|
+
}
|
|
33
|
+
if (typeof date === 'number') {
|
|
34
|
+
return Temporal.Instant.fromEpochMilliseconds(date).toZonedDateTimeISO(tz);
|
|
35
|
+
}
|
|
36
|
+
if (date instanceof Date) {
|
|
37
|
+
return Temporal.Instant.fromEpochMilliseconds(date.getTime()).toZonedDateTimeISO(tz);
|
|
38
|
+
}
|
|
39
|
+
if (typeof date === 'string') {
|
|
40
|
+
return parseString(date, tz);
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
const ZERO_TIME = {
|
|
2
|
+
hour: 0,
|
|
3
|
+
minute: 0,
|
|
4
|
+
second: 0,
|
|
5
|
+
millisecond: 0,
|
|
6
|
+
microsecond: 0,
|
|
7
|
+
nanosecond: 0,
|
|
8
|
+
};
|
|
9
|
+
const MAX_TIME = {
|
|
10
|
+
hour: 23,
|
|
11
|
+
minute: 59,
|
|
12
|
+
second: 59,
|
|
13
|
+
millisecond: 999,
|
|
14
|
+
microsecond: 999,
|
|
15
|
+
nanosecond: 999,
|
|
16
|
+
};
|
|
17
|
+
function startWeek(zdt, weekStart) {
|
|
18
|
+
// dayOfWeek: 1=Mon...7=Sun → convert to 0=Sun..6=Sat
|
|
19
|
+
const dow = zdt.dayOfWeek % 7;
|
|
20
|
+
const diff = (dow - weekStart + 7) % 7;
|
|
21
|
+
return zdt.subtract({ days: diff }).with(ZERO_TIME);
|
|
22
|
+
}
|
|
23
|
+
function endWeek(zdt, weekStart) {
|
|
24
|
+
const dow = zdt.dayOfWeek % 7;
|
|
25
|
+
const diff = (dow - weekStart + 7) % 7;
|
|
26
|
+
return zdt
|
|
27
|
+
.subtract({ days: diff })
|
|
28
|
+
.add({ days: 6 })
|
|
29
|
+
.with(MAX_TIME);
|
|
30
|
+
}
|
|
31
|
+
export function startOfHelper(zdt, unit, locale) {
|
|
32
|
+
const weekStart = locale.weekStart ?? 0;
|
|
33
|
+
switch (unit) {
|
|
34
|
+
case 'year':
|
|
35
|
+
return zdt.with({ month: 1, day: 1, ...ZERO_TIME });
|
|
36
|
+
case 'month':
|
|
37
|
+
return zdt.with({ day: 1, ...ZERO_TIME });
|
|
38
|
+
case 'week':
|
|
39
|
+
return startWeek(zdt, weekStart);
|
|
40
|
+
case 'day':
|
|
41
|
+
case 'date':
|
|
42
|
+
return zdt.with(ZERO_TIME);
|
|
43
|
+
case 'hour':
|
|
44
|
+
return zdt.with({
|
|
45
|
+
minute: 0,
|
|
46
|
+
second: 0,
|
|
47
|
+
millisecond: 0,
|
|
48
|
+
microsecond: 0,
|
|
49
|
+
nanosecond: 0,
|
|
50
|
+
});
|
|
51
|
+
case 'minute':
|
|
52
|
+
return zdt.with({
|
|
53
|
+
second: 0,
|
|
54
|
+
millisecond: 0,
|
|
55
|
+
microsecond: 0,
|
|
56
|
+
nanosecond: 0,
|
|
57
|
+
});
|
|
58
|
+
case 'second':
|
|
59
|
+
return zdt.with({
|
|
60
|
+
millisecond: 0,
|
|
61
|
+
microsecond: 0,
|
|
62
|
+
nanosecond: 0,
|
|
63
|
+
});
|
|
64
|
+
default:
|
|
65
|
+
return zdt;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export function endOfHelper(zdt, unit, locale) {
|
|
69
|
+
const weekStart = locale.weekStart ?? 0;
|
|
70
|
+
switch (unit) {
|
|
71
|
+
case 'year':
|
|
72
|
+
return zdt.with({ month: 12, day: 31, ...MAX_TIME });
|
|
73
|
+
case 'month':
|
|
74
|
+
return zdt.with({
|
|
75
|
+
day: zdt.daysInMonth,
|
|
76
|
+
...MAX_TIME,
|
|
77
|
+
});
|
|
78
|
+
case 'week':
|
|
79
|
+
return endWeek(zdt, weekStart);
|
|
80
|
+
case 'day':
|
|
81
|
+
case 'date':
|
|
82
|
+
return zdt.with(MAX_TIME);
|
|
83
|
+
case 'hour':
|
|
84
|
+
return zdt.with({
|
|
85
|
+
minute: 59,
|
|
86
|
+
second: 59,
|
|
87
|
+
millisecond: 999,
|
|
88
|
+
microsecond: 999,
|
|
89
|
+
nanosecond: 999,
|
|
90
|
+
});
|
|
91
|
+
case 'minute':
|
|
92
|
+
return zdt.with({
|
|
93
|
+
second: 59,
|
|
94
|
+
millisecond: 999,
|
|
95
|
+
microsecond: 999,
|
|
96
|
+
nanosecond: 999,
|
|
97
|
+
});
|
|
98
|
+
case 'second':
|
|
99
|
+
return zdt.with({
|
|
100
|
+
millisecond: 999,
|
|
101
|
+
microsecond: 999,
|
|
102
|
+
nanosecond: 999,
|
|
103
|
+
});
|
|
104
|
+
default:
|
|
105
|
+
return zdt;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const UNIT_MAP = {
|
|
2
|
+
y: 'year',
|
|
3
|
+
yr: 'year',
|
|
4
|
+
year: 'year',
|
|
5
|
+
years: 'year',
|
|
6
|
+
M: 'month',
|
|
7
|
+
month: 'month',
|
|
8
|
+
months: 'month',
|
|
9
|
+
Q: 'quarter',
|
|
10
|
+
quarter: 'quarter',
|
|
11
|
+
quarters: 'quarter',
|
|
12
|
+
w: 'week',
|
|
13
|
+
week: 'week',
|
|
14
|
+
weeks: 'week',
|
|
15
|
+
d: 'day',
|
|
16
|
+
day: 'day',
|
|
17
|
+
days: 'day',
|
|
18
|
+
D: 'date',
|
|
19
|
+
date: 'date',
|
|
20
|
+
dates: 'date',
|
|
21
|
+
h: 'hour',
|
|
22
|
+
hour: 'hour',
|
|
23
|
+
hours: 'hour',
|
|
24
|
+
m: 'minute',
|
|
25
|
+
min: 'minute',
|
|
26
|
+
minute: 'minute',
|
|
27
|
+
minutes: 'minute',
|
|
28
|
+
s: 'second',
|
|
29
|
+
sec: 'second',
|
|
30
|
+
second: 'second',
|
|
31
|
+
seconds: 'second',
|
|
32
|
+
ms: 'millisecond',
|
|
33
|
+
millisecond: 'millisecond',
|
|
34
|
+
milliseconds: 'millisecond',
|
|
35
|
+
};
|
|
36
|
+
export function normalizeUnit(u) {
|
|
37
|
+
return (UNIT_MAP[u] ??
|
|
38
|
+
UNIT_MAP[u.toLowerCase()] ??
|
|
39
|
+
'millisecond');
|
|
40
|
+
}
|
|
41
|
+
export const DURATION_KEY = {
|
|
42
|
+
year: 'years',
|
|
43
|
+
month: 'months',
|
|
44
|
+
quarter: null,
|
|
45
|
+
week: 'weeks',
|
|
46
|
+
day: 'days',
|
|
47
|
+
date: 'days',
|
|
48
|
+
hour: 'hours',
|
|
49
|
+
minute: 'minutes',
|
|
50
|
+
second: 'seconds',
|
|
51
|
+
millisecond: 'milliseconds',
|
|
52
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type ILocale } from './locale.js';
|
|
2
|
+
import type { ConfigType, ManipulateType, OpUnitType, QUnitType, UnitType } from './types.js';
|
|
3
|
+
interface InternalConfig {
|
|
4
|
+
date?: ConfigType;
|
|
5
|
+
zdt?: Temporal.ZonedDateTime | null;
|
|
6
|
+
locale?: string;
|
|
7
|
+
tz?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const DEFAULT_TZ: string;
|
|
10
|
+
export declare class TDayjs {
|
|
11
|
+
readonly $zdt: Temporal.ZonedDateTime | null;
|
|
12
|
+
readonly $L: string;
|
|
13
|
+
readonly $tz: string;
|
|
14
|
+
constructor(cfg: InternalConfig);
|
|
15
|
+
private _clone;
|
|
16
|
+
isValid(): this is this & {
|
|
17
|
+
$zdt: Temporal.ZonedDateTime;
|
|
18
|
+
};
|
|
19
|
+
clone(): TDayjs;
|
|
20
|
+
year(): number;
|
|
21
|
+
year(value: number): TDayjs;
|
|
22
|
+
month(): number;
|
|
23
|
+
month(value: number): TDayjs;
|
|
24
|
+
date(): number;
|
|
25
|
+
date(value: number): TDayjs;
|
|
26
|
+
day(): number;
|
|
27
|
+
day(value: number): TDayjs;
|
|
28
|
+
hour(): number;
|
|
29
|
+
hour(value: number): TDayjs;
|
|
30
|
+
minute(): number;
|
|
31
|
+
minute(value: number): TDayjs;
|
|
32
|
+
second(): number;
|
|
33
|
+
second(value: number): TDayjs;
|
|
34
|
+
millisecond(): number;
|
|
35
|
+
millisecond(value: number): TDayjs;
|
|
36
|
+
get(unit: UnitType): number;
|
|
37
|
+
private _getByUnit;
|
|
38
|
+
set(unit: UnitType, value: number): TDayjs;
|
|
39
|
+
private _setByUnit;
|
|
40
|
+
add(value: number, unit?: ManipulateType): TDayjs;
|
|
41
|
+
subtract(value: number, unit?: ManipulateType): TDayjs;
|
|
42
|
+
startOf(unit: OpUnitType): TDayjs;
|
|
43
|
+
endOf(unit: OpUnitType): TDayjs;
|
|
44
|
+
private _toZdt;
|
|
45
|
+
isBefore(date?: ConfigType, unit?: OpUnitType): boolean;
|
|
46
|
+
isAfter(date?: ConfigType, unit?: OpUnitType): boolean;
|
|
47
|
+
isSame(date?: ConfigType, unit?: OpUnitType): boolean;
|
|
48
|
+
format(template?: string): string;
|
|
49
|
+
diff(date?: ConfigType, unit?: QUnitType | OpUnitType, float?: boolean): number;
|
|
50
|
+
valueOf(): number;
|
|
51
|
+
unix(): number;
|
|
52
|
+
daysInMonth(): number;
|
|
53
|
+
utcOffset(): number;
|
|
54
|
+
toDate(): Date;
|
|
55
|
+
toISOString(): string;
|
|
56
|
+
toJSON(): string | null;
|
|
57
|
+
toString(): string;
|
|
58
|
+
locale(): string;
|
|
59
|
+
locale(preset: string | ILocale, object?: Partial<ILocale>): TDayjs;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import 'temporal-polyfill/global';
|
|
2
|
+
import { TDayjs } from './dayjs.js';
|
|
3
|
+
import { type ILocale } from './locale.js';
|
|
4
|
+
import type { ConfigType } from './types.js';
|
|
5
|
+
export { TDayjs } from './dayjs.js';
|
|
6
|
+
export type { ILocale } from './locale.js';
|
|
7
|
+
export type { ConfigType, ManipulateType, OpUnitType, QUnitType, UnitType, UnitTypeLong, UnitTypeLongPlural, UnitTypeShort, } from './types.js';
|
|
8
|
+
type PluginFunc<T = unknown> = (option: T, c: typeof TDayjs, d: typeof tdayjs) => void;
|
|
9
|
+
declare function tdayjs(date?: ConfigType): TDayjs;
|
|
10
|
+
declare namespace tdayjs {
|
|
11
|
+
var extend: <T>(plugin: PluginFunc<T>, option?: T) => typeof tdayjs;
|
|
12
|
+
var isDayjs: (d: unknown) => d is TDayjs;
|
|
13
|
+
var unix: (t: number) => TDayjs;
|
|
14
|
+
var locale: (preset?: string | ILocale, object?: Partial<ILocale>) => string;
|
|
15
|
+
}
|
|
16
|
+
export default tdayjs;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ILocale {
|
|
2
|
+
name: string;
|
|
3
|
+
months: string[];
|
|
4
|
+
monthsShort: string[];
|
|
5
|
+
weekdays: string[];
|
|
6
|
+
weekdaysShort: string[];
|
|
7
|
+
weekdaysMin: string[];
|
|
8
|
+
weekStart: number;
|
|
9
|
+
}
|
|
10
|
+
declare const Ls: Record<string, ILocale>;
|
|
11
|
+
export declare function getLocaleObj(name: string): ILocale;
|
|
12
|
+
export declare function getGlobalLocale(): string;
|
|
13
|
+
export declare function setGlobalLocale(name: string): void;
|
|
14
|
+
export declare function registerLocale(locale: ILocale): void;
|
|
15
|
+
export { Ls };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ILocale } from './locale.js';
|
|
2
|
+
import type { NormalizedUnit } from './units.js';
|
|
3
|
+
export declare function startOfHelper(zdt: Temporal.ZonedDateTime, unit: NormalizedUnit, locale: ILocale): Temporal.ZonedDateTime;
|
|
4
|
+
export declare function endOfHelper(zdt: Temporal.ZonedDateTime, unit: NormalizedUnit, locale: ILocale): Temporal.ZonedDateTime;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface TDayjsLike {
|
|
2
|
+
readonly $zdt: Temporal.ZonedDateTime | null;
|
|
3
|
+
readonly $L: string;
|
|
4
|
+
}
|
|
5
|
+
export type ConfigType = string | number | Date | TDayjsLike | null | undefined;
|
|
6
|
+
export type UnitTypeShort = 'd' | 'D' | 'M' | 'y' | 'h' | 'm' | 's' | 'ms';
|
|
7
|
+
export type UnitTypeLong = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'date';
|
|
8
|
+
export type UnitTypeLongPlural = 'milliseconds' | 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years' | 'dates';
|
|
9
|
+
export type UnitType = UnitTypeLong | UnitTypeLongPlural | UnitTypeShort;
|
|
10
|
+
export type OpUnitType = UnitType | 'week' | 'weeks' | 'w';
|
|
11
|
+
export type QUnitType = UnitType | 'quarter' | 'quarters' | 'Q';
|
|
12
|
+
export type ManipulateType = Exclude<OpUnitType, 'date' | 'dates'> | 'quarter' | 'quarters' | 'Q';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type NormalizedUnit = 'year' | 'month' | 'quarter' | 'week' | 'day' | 'date' | 'hour' | 'minute' | 'second' | 'millisecond';
|
|
2
|
+
export type DurationKey = 'years' | 'months' | 'weeks' | 'days' | 'hours' | 'minutes' | 'seconds' | 'milliseconds';
|
|
3
|
+
export declare function normalizeUnit(u: string): NormalizedUnit;
|
|
4
|
+
export declare const DURATION_KEY: Record<NormalizedUnit, DurationKey | null>;
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@arkv/temporal",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Drop-in Day.js-compatible API powered by the native Temporal API. Same chainable interface, zero timezone bugs.",
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/types/index.d.ts",
|
|
11
|
+
"import": "./dist/esm/index.js",
|
|
12
|
+
"require": "./dist/cjs/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"LICENSE",
|
|
17
|
+
"README.md",
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"temporal",
|
|
25
|
+
"dayjs",
|
|
26
|
+
"date",
|
|
27
|
+
"time",
|
|
28
|
+
"timezone",
|
|
29
|
+
"typescript",
|
|
30
|
+
"javascript",
|
|
31
|
+
"node",
|
|
32
|
+
"browser"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"prebuild": "rm -rf dist",
|
|
36
|
+
"build:esm": "tsc -p tsconfig.build.esm.json",
|
|
37
|
+
"build:cjs": "tsc -p tsconfig.build.cjs.json",
|
|
38
|
+
"build:types": "tsc -p tsconfig.build.types.json",
|
|
39
|
+
"build": "bun run --parallel build:esm build:cjs build:types",
|
|
40
|
+
"postbuild": "echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json && echo '{\"type\":\"module\"}' > dist/esm/package.json",
|
|
41
|
+
"test": "bun test --bail",
|
|
42
|
+
"test:cov": "bun test --coverage",
|
|
43
|
+
"typecheck": "tsc --noEmit"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"temporal-polyfill": "0.3.0"
|
|
47
|
+
},
|
|
48
|
+
"author": {
|
|
49
|
+
"name": "Petar Zarkov",
|
|
50
|
+
"email": "pzarko1@gmail.com",
|
|
51
|
+
"url": "https://github.com/petarzarkov"
|
|
52
|
+
},
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"homepage": "https://github.com/petarzarkov/arkv/tree/main/packages/temporal#readme",
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "https://github.com/petarzarkov/arkv",
|
|
58
|
+
"directory": "packages/temporal"
|
|
59
|
+
}
|
|
60
|
+
}
|