mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-06-22 04:11:55 +10:00
chore: remove react-doctor from package scripts and update task dependencies in turbo.json
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
"dev": "tsx watch src/index.ts",
|
||||
"build": "tsdown",
|
||||
"start": "node dist/index.mjs",
|
||||
"doctor": "react-doctor",
|
||||
"typecheck": "tsgo --noEmit",
|
||||
"test": "vitest run --passWithNoTests",
|
||||
"test:coverage": "vitest run --coverage --passWithNoTests",
|
||||
@@ -81,7 +80,6 @@
|
||||
"@types/pg": "^8.20.0",
|
||||
"@types/react": "^19.2.15",
|
||||
"@typescript/native-preview": "7.0.0-dev.20260527.1",
|
||||
"react-doctor": "^0.2.9",
|
||||
"tsdown": "^0.22.0",
|
||||
"tsx": "^4.22.3",
|
||||
"typescript": "^6.0.3",
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
"dev": "vite dev",
|
||||
"serve": "vite preview",
|
||||
"start": "vite preview",
|
||||
"doctor": "react-doctor",
|
||||
"typecheck": "tsgo --noEmit",
|
||||
"test": "vitest run --passWithNoTests",
|
||||
"test:coverage": "vitest run --coverage --passWithNoTests",
|
||||
@@ -100,7 +99,6 @@
|
||||
"@vitejs/plugin-react": "^6.0.2",
|
||||
"babel-plugin-macros": "^3.1.0",
|
||||
"babel-plugin-react-compiler": "^1.0.0",
|
||||
"react-doctor": "^0.2.9",
|
||||
"typescript": "^6.0.3",
|
||||
"vite": "^8.0.14"
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ vi.mock("pdfjs-dist", () => {
|
||||
|
||||
vi.mock("pdfjs-dist/legacy/build/pdf.mjs", () => pdfjsMock.legacyModule);
|
||||
|
||||
const pdfCanvasModule = import("./pdf-canvas");
|
||||
|
||||
describe("PDF.js browser entrypoints", () => {
|
||||
beforeEach(() => {
|
||||
pdfjsMock.legacyModule.GlobalWorkerOptions.workerSrc = undefined;
|
||||
@@ -59,7 +61,7 @@ describe("PDF.js browser entrypoints", () => {
|
||||
});
|
||||
|
||||
it("loads the canvas preview renderer from the legacy PDF.js runtime", async () => {
|
||||
await expect(import("./pdf-canvas")).resolves.toEqual(
|
||||
await expect(pdfCanvasModule).resolves.toEqual(
|
||||
expect.objectContaining({
|
||||
PdfCanvasDocument: expect.any(Function),
|
||||
PdfCanvasPage: expect.any(Function),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { StateStorage } from "zustand/middleware";
|
||||
import type { SidebarSection } from "@/libs/resume/section";
|
||||
import { createJSONStorage, persist } from "zustand/middleware";
|
||||
import { immer } from "zustand/middleware/immer";
|
||||
@@ -20,6 +21,18 @@ type SectionStoreActions = {
|
||||
|
||||
type SectionStore = SectionStoreState & SectionStoreActions;
|
||||
|
||||
const noopStorage: StateStorage = {
|
||||
getItem: () => null,
|
||||
removeItem: () => {},
|
||||
setItem: () => {},
|
||||
};
|
||||
|
||||
const getSectionStoreStorage = () => {
|
||||
if (typeof window === "undefined") return noopStorage;
|
||||
|
||||
return window.localStorage ?? noopStorage;
|
||||
};
|
||||
|
||||
export const useSectionStore = create<SectionStore>()(
|
||||
persist(
|
||||
immer((set) => ({
|
||||
@@ -46,7 +59,7 @@ export const useSectionStore = create<SectionStore>()(
|
||||
})),
|
||||
{
|
||||
name: "section-store",
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
storage: createJSONStorage(getSectionStoreStorage),
|
||||
partialize: (state) => ({
|
||||
sections: state.sections,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user