mirror of
https://github.com/get-drexa/drive.git
synced 2025-11-30 21:41:39 +00:00
refactor: add import maps for generated code
- Add export mappings in @fileone/convex package.json for cleaner imports - Map @fileone/convex/dataModel to _generated/dataModel.d.ts - Map @fileone/convex/api to _generated/api.js - Map @fileone/convex/server to _generated/server.js - Update all imports across packages/convex and apps/drive-web - Maintain backward compatibility with _generated/* exports Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { createClient, type GenericCtx } from "@convex-dev/better-auth"
|
||||
import { convex, crossDomain } from "@convex-dev/better-auth/plugins"
|
||||
import { betterAuth } from "better-auth"
|
||||
import { components } from "./_generated/api"
|
||||
import type { DataModel } from "./_generated/dataModel"
|
||||
import { components } from "@fileone/convex/api"
|
||||
import type { DataModel } from "@fileone/convex/dataModel"
|
||||
import authSchema from "./betterauth/schema"
|
||||
|
||||
const siteUrl = process.env.SITE_URL!
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { v } from "convex/values"
|
||||
import type { Id } from "./_generated/dataModel"
|
||||
import type { Id } from "@fileone/convex/dataModel"
|
||||
import { authenticatedMutation, authenticatedQuery, authorizedGet } from "./functions"
|
||||
import * as Directories from "./model/directories"
|
||||
import * as Files from "./model/files"
|
||||
|
||||
@@ -9,9 +9,9 @@ import {
|
||||
customMutation,
|
||||
customQuery,
|
||||
} from "convex-helpers/server/customFunctions"
|
||||
import type { DataModel } from "./_generated/dataModel"
|
||||
import type { MutationCtx, QueryCtx } from "./_generated/server"
|
||||
import { mutation, query } from "./_generated/server"
|
||||
import type { DataModel } from "@fileone/convex/dataModel"
|
||||
import type { MutationCtx, QueryCtx } from "@fileone/convex/server"
|
||||
import { mutation, query } from "@fileone/convex/server"
|
||||
import { type AuthUser, userIdentityOrThrow, userOrThrow } from "./model/user"
|
||||
|
||||
export type AuthenticatedQueryCtx = QueryCtx & {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Doc, Id } from "../_generated/dataModel"
|
||||
import type { Doc, Id } from "@fileone/convex/dataModel"
|
||||
import type {
|
||||
AuthenticatedMutationCtx,
|
||||
AuthenticatedQueryCtx,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Doc, Id } from "../_generated/dataModel"
|
||||
import type { Doc, Id } from "@fileone/convex/dataModel"
|
||||
import { type AuthenticatedMutationCtx, authorizedGet } from "../functions"
|
||||
import * as Err from "../shared/error"
|
||||
import type { DirectoryHandle, FileHandle } from "../shared/filesystem"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { v } from "convex/values"
|
||||
import type { Doc, Id } from "../_generated/dataModel"
|
||||
import type { Doc, Id } from "@fileone/convex/dataModel"
|
||||
import {
|
||||
type AuthenticatedMutationCtx,
|
||||
type AuthenticatedQueryCtx,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MutationCtx, QueryCtx } from "../_generated/server"
|
||||
import type { MutationCtx, QueryCtx } from "@fileone/convex/server"
|
||||
import { authComponent } from "../auth"
|
||||
import * as Err from "../shared/error"
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
"./filesystem": "./shared/filesystem.ts",
|
||||
"./error": "./shared/error.ts",
|
||||
"./types": "./shared/types.ts",
|
||||
"./dataModel": "./_generated/dataModel.d.ts",
|
||||
"./api": "./_generated/api.js",
|
||||
"./server": "./_generated/server.js",
|
||||
"./_generated/*": "./_generated/*",
|
||||
"./model/*": "./model/*",
|
||||
"./shared/*": "./shared/*"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* NO server-only dependencies should be imported here.
|
||||
*/
|
||||
|
||||
import type { Doc, Id } from "../_generated/dataModel"
|
||||
import type { Doc, Id } from "@fileone/convex/dataModel"
|
||||
import type * as Err from "./error"
|
||||
|
||||
export enum FileType {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file should NOT import any server-only dependencies.
|
||||
*/
|
||||
|
||||
import type { Doc } from "../_generated/dataModel"
|
||||
import type { Doc } from "@fileone/convex/dataModel"
|
||||
import type { DirectoryPath } from "./filesystem"
|
||||
|
||||
export type DirectoryInfo = Doc<"directories"> & { path: DirectoryPath }
|
||||
|
||||
Reference in New Issue
Block a user