refactor: move convex into packages
This commit is contained in:
18
bun.lock
18
bun.lock
@@ -8,11 +8,25 @@
|
|||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"packages/convex": {
|
||||||
|
"name": "@fileone/convex",
|
||||||
|
"peerDependencies": {
|
||||||
|
"convex": "^1.27.0",
|
||||||
|
"typescript": "^5",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"packages/path": {
|
||||||
|
"name": "@fileone/path",
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": "^5",
|
||||||
|
},
|
||||||
|
},
|
||||||
"packages/web": {
|
"packages/web": {
|
||||||
"name": "@fileone/web",
|
"name": "@fileone/web",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@convex-dev/workos": "^0.0.1",
|
"@convex-dev/workos": "^0.0.1",
|
||||||
|
"@fileone/convex": "workspace:*",
|
||||||
"@radix-ui/react-checkbox": "^1.3.3",
|
"@radix-ui/react-checkbox": "^1.3.3",
|
||||||
"@radix-ui/react-context-menu": "^2.2.16",
|
"@radix-ui/react-context-menu": "^2.2.16",
|
||||||
"@radix-ui/react-dialog": "^1.1.15",
|
"@radix-ui/react-dialog": "^1.1.15",
|
||||||
@@ -180,6 +194,10 @@
|
|||||||
|
|
||||||
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.25.4", "", { "os": "win32", "cpu": "x64" }, "sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ=="],
|
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.25.4", "", { "os": "win32", "cpu": "x64" }, "sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ=="],
|
||||||
|
|
||||||
|
"@fileone/convex": ["@fileone/convex@workspace:packages/convex"],
|
||||||
|
|
||||||
|
"@fileone/path": ["@fileone/path@workspace:packages/path"],
|
||||||
|
|
||||||
"@fileone/web": ["@fileone/web@workspace:packages/web"],
|
"@fileone/web": ["@fileone/web@workspace:packages/web"],
|
||||||
|
|
||||||
"@floating-ui/core": ["@floating-ui/core@1.7.3", "", { "dependencies": { "@floating-ui/utils": "^0.2.10" } }, "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w=="],
|
"@floating-ui/core": ["@floating-ui/core@1.7.3", "", { "dependencies": { "@floating-ui/utils": "^0.2.10" } }, "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w=="],
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import type { Id } from "@convex/_generated/dataModel"
|
import type { Id } from "@fileone/convex/_generated/dataModel"
|
||||||
import { v } from "convex/values"
|
import { v } from "convex/values"
|
||||||
import { authenticatedMutation, authenticatedQuery } from "./functions"
|
import { authenticatedMutation, authenticatedQuery } from "./functions"
|
||||||
import type { DirectoryItem } from "./model/directories"
|
import type { DirectoryItem } from "./model/directories"
|
@@ -1,4 +1,4 @@
|
|||||||
import type { Doc, Id } from "@convex/_generated/dataModel"
|
import type { Doc, Id } from "@fileone/convex/_generated/dataModel"
|
||||||
import type {
|
import type {
|
||||||
AuthenticatedMutationCtx,
|
AuthenticatedMutationCtx,
|
||||||
AuthenticatedQueryCtx,
|
AuthenticatedQueryCtx,
|
9
packages/convex/package.json
Normal file
9
packages/convex/package.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "@fileone/convex",
|
||||||
|
"module": "index.ts",
|
||||||
|
"type": "module",
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": "^5",
|
||||||
|
"convex": "^1.27.0"
|
||||||
|
}
|
||||||
|
}
|
@@ -10,6 +10,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@convex-dev/workos": "^0.0.1",
|
"@convex-dev/workos": "^0.0.1",
|
||||||
|
"@fileone/convex": "workspace:*",
|
||||||
"@radix-ui/react-checkbox": "^1.3.3",
|
"@radix-ui/react-checkbox": "^1.3.3",
|
||||||
"@radix-ui/react-context-menu": "^2.2.16",
|
"@radix-ui/react-context-menu": "^2.2.16",
|
||||||
"@radix-ui/react-dialog": "^1.1.15",
|
"@radix-ui/react-dialog": "^1.1.15",
|
||||||
@@ -42,4 +43,4 @@
|
|||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
"@types/react-dom": "^19"
|
"@types/react-dom": "^19"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import { api } from "@convex/_generated/api"
|
import { api } from "@fileone/convex/_generated/api"
|
||||||
import type { Id } from "@convex/_generated/dataModel"
|
import type { DirectoryItem } from "@fileone/convex/model/directories"
|
||||||
import type { DirectoryItem } from "@convex/model/directories"
|
|
||||||
import { useMutation } from "@tanstack/react-query"
|
import { useMutation } from "@tanstack/react-query"
|
||||||
import {
|
import {
|
||||||
type ColumnDef,
|
type ColumnDef,
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { api } from "@convex/_generated/api"
|
import { api } from "@fileone/convex/_generated/api"
|
||||||
import { useMutation } from "@tanstack/react-query"
|
import { useMutation } from "@tanstack/react-query"
|
||||||
import { useMutation as useConvexMutation } from "convex/react"
|
import { useMutation as useConvexMutation } from "convex/react"
|
||||||
import { useSetAtom } from "jotai"
|
import { useSetAtom } from "jotai"
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import { atom } from "jotai"
|
import type { Id } from "@fileone/convex/_generated/dataModel"
|
||||||
import type { Id } from "@convex/_generated/dataModel"
|
|
||||||
import type {
|
import type {
|
||||||
DirectoryItem,
|
DirectoryItem,
|
||||||
DirectoryItemKind,
|
DirectoryItemKind,
|
||||||
} from "@convex/model/directories"
|
} from "@fileone/convex/model/directories"
|
||||||
|
import { atom } from "jotai"
|
||||||
|
|
||||||
export const contextMenuTargeItemAtom = atom<DirectoryItem | null>(null)
|
export const contextMenuTargeItemAtom = atom<DirectoryItem | null>(null)
|
||||||
export const optimisticDeletedItemsAtom = atom(
|
export const optimisticDeletedItemsAtom = atom(
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
|
import {
|
||||||
|
Code as ErrorCode,
|
||||||
|
isApplicationError,
|
||||||
|
} from "@fileone/convex/model/error"
|
||||||
import { toast } from "sonner"
|
import { toast } from "sonner"
|
||||||
import { Code as ErrorCode, isApplicationError } from "@convex/model/error"
|
|
||||||
|
|
||||||
const ERROR_MESSAGE = {
|
const ERROR_MESSAGE = {
|
||||||
[ErrorCode.DirectoryExists]: "Directory already exists",
|
[ErrorCode.DirectoryExists]: "Directory already exists",
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { api } from "@convex/_generated/api"
|
import { api } from "@fileone/convex/_generated/api"
|
||||||
import { useMutation } from "@tanstack/react-query"
|
import { useMutation } from "@tanstack/react-query"
|
||||||
import { createFileRoute, useNavigate } from "@tanstack/react-router"
|
import { createFileRoute, useNavigate } from "@tanstack/react-router"
|
||||||
import { useConvexAuth, useMutation as useConvexMutation } from "convex/react"
|
import { useConvexAuth, useMutation as useConvexMutation } from "convex/react"
|
||||||
|
@@ -23,8 +23,7 @@
|
|||||||
|
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"],
|
"@/*": ["./src/*"]
|
||||||
"@convex/*": ["../../convex/*"]
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Some stricter flags (disabled by default)
|
// Some stricter flags (disabled by default)
|
||||||
|
Reference in New Issue
Block a user