From 9080769a0c39842981d10f6d021f6b2e051b607f Mon Sep 17 00:00:00 2001 From: Beef Date: Tue, 14 Feb 2023 18:33:42 +0000 Subject: [PATCH] [Metro > Common] Add moment to common modules --- package.json | 1 + src/def.d.ts | 2 ++ src/lib/metro/common.ts | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8fac1d9..9fc0d54 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "esbuild-plugin-alias": "^0.2.1", "esbuild-plugin-external-global": "^1.0.1", "esbuild-plugin-replace": "^1.3.0", + "moment": "2.22.2", "typescript": "^4.9.5" }, "dependencies": { diff --git a/src/def.d.ts b/src/def.d.ts index 85f8727..f8bd861 100644 --- a/src/def.d.ts +++ b/src/def.d.ts @@ -2,6 +2,7 @@ import * as _spitroast from "spitroast"; import _React from "react"; import _RN from "react-native"; import _Clipboard from "@react-native-clipboard/clipboard"; +import _moment from "moment"; type MetroModules = { [id: number]: any }; @@ -301,6 +302,7 @@ interface VendettaObject { FluxDispatcher: PropIntellisense<"_currentDispatchActionType">; React: typeof _React; ReactNative: typeof _RN; + moment: typeof _moment; }; }; constants: { diff --git a/src/lib/metro/common.ts b/src/lib/metro/common.ts index 12f678d..bb701f0 100644 --- a/src/lib/metro/common.ts +++ b/src/lib/metro/common.ts @@ -21,4 +21,7 @@ export const FluxDispatcher = findByProps("_currentDispatchActionType"); // React export const React = window.React as typeof import("react"); -export { ReactNative } from "@metro/hoist"; \ No newline at end of file +export { ReactNative } from "@metro/hoist"; + +// Moment +export { moment } from "@metro/hoist"; \ No newline at end of file