Add monorepo support to project (#682)

* feat: add monorepo support

* fix: correct relatedProjects structure in vercel.json

* update github actions with monorepo support

* removed legacy dep

* moved jsr config into web package
This commit is contained in:
Dan Ditomaso
2025-06-25 21:56:55 -04:00
committed by GitHub
parent 85ee0747d1
commit 1c13343e8a
463 changed files with 7568 additions and 2196 deletions
+105
View File
@@ -0,0 +1,105 @@
import { afterEach, vi } from "vitest";
import { cleanup } from "@testing-library/react";
import { enableMapSet } from "immer";
import "@testing-library/jest-dom";
import "@testing-library/user-event";
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import channelsEN from "@public/i18n/locales/en/channels.json" with {
type: "json",
};
import commandPaletteEN from "@public/i18n/locales/en/commandPalette.json" with {
type: "json",
};
import commonEN from "@public/i18n/locales/en/common.json" with {
type: "json",
};
import deviceConfigEN from "@public/i18n/locales/en/deviceConfig.json" with {
type: "json",
};
import moduleConfigEN from "@public/i18n/locales/en/moduleConfig.json" with {
type: "json",
};
import dashboardEN from "@public/i18n/locales/en/dashboard.json" with {
type: "json",
};
import dialogEN from "@public/i18n/locales/en/dialog.json" with {
type: "json",
};
import messagesEN from "@public/i18n/locales/en/messages.json" with {
type: "json",
};
import nodesEN from "@public/i18n/locales/en/nodes.json" with {
type: "json",
};
import uiEN from "@public/i18n/locales/en/ui.json" with { type: "json" };
enableMapSet();
vi.mock("idb-keyval", () => ({
get: vi.fn(() => Promise.resolve(undefined)),
set: vi.fn(() => Promise.resolve()),
del: vi.fn(() => Promise.resolve()),
clear: vi.fn(() => Promise.resolve()),
keys: vi.fn(() => Promise.resolve([])),
createStore: vi.fn(() => ({})),
}));
globalThis.ResizeObserver = class {
observe() {}
unobserve() {}
disconnect() {}
};
const appNamespaces = [
"channels",
"commandPalette",
"common",
"deviceConfig",
"moduleConfig",
"dashboard",
"dialog",
"messages",
"nodes",
"ui",
];
const appFallbackNS = ["common", "ui", "dialog"];
const appDefaultNS = "common";
i18n
.use(initReactI18next)
.init({
lng: "en",
ns: appNamespaces,
defaultNS: appDefaultNS,
fallbackNS: appFallbackNS,
resources: {
en: {
channels: channelsEN,
commandPalette: commandPaletteEN,
common: commonEN,
deviceConfig: deviceConfigEN,
moduleConfig: moduleConfigEN,
dashboard: dashboardEN,
dialog: dialogEN,
messages: messagesEN,
nodes: nodesEN,
ui: uiEN,
},
},
interpolation: {
escapeValue: false,
},
react: {
useSuspense: false,
},
debug: false,
});
afterEach(() => {
cleanup();
});
+37
View File
@@ -0,0 +1,37 @@
import { ReactElement } from "react";
import { render, RenderOptions } from "@testing-library/react";
import {
createMemoryHistory,
createRouter,
RouterProvider,
} from "@tanstack/react-router";
import "@app/i18n-config.ts";
import { routeTree } from "../routeTree.gen.ts";
import { DeviceWrapper } from "@app/DeviceWrapper.tsx";
const Providers = () => {
const memoryHistory = createMemoryHistory({
initialEntries: ["/"],
});
const router = createRouter({
routeTree,
history: memoryHistory,
});
return (
<DeviceWrapper>
<RouterProvider router={router} />
</DeviceWrapper>
);
};
const renderWithProviders = (
ui: ReactElement,
options?: Omit<RenderOptions, "wrapper">,
) => render(ui, { wrapper: Providers, ...options });
export * from "@testing-library/react";
export { renderWithProviders as render };