chore: rename utils package to shared

This commit is contained in:
Henry
2025-01-29 16:21:30 +00:00
parent 8addf952a9
commit 34f8ad4def
26 changed files with 96 additions and 80 deletions

View File

@@ -37,8 +37,8 @@
"dependencies": {
"@kan/db": "workspace:*",
"@kan/email": "workspace:^",
"@kan/shared": "workspace:^",
"@kan/supabase": "workspace:^",
"@kan/utils": "workspace:^",
"@trpc/server": "catalog:",
"superjson": "2.2.1",
"trpc-to-openapi": "^2.1.0",

View File

@@ -6,7 +6,7 @@ import * as cardRepo from "@kan/db/repository/card.repo";
import * as activityRepo from "@kan/db/repository/cardActivity.repo";
import * as listRepo from "@kan/db/repository/list.repo";
import * as workspaceRepo from "@kan/db/repository/workspace.repo";
import { generateSlug, generateUID } from "@kan/utils";
import { generateSlug, generateUID } from "@kan/shared/utils";
import { createTRPCRouter, protectedProcedure, publicProcedure } from "../trpc";

View File

@@ -3,7 +3,7 @@ import { z } from "zod";
import * as workspaceRepo from "@kan/db/repository/workspace.repo";
import * as workspaceSlugRepo from "@kan/db/repository/workspaceSlug.repo";
import { generateUID } from "@kan/utils";
import { generateUID } from "@kan/shared/utils";
import { createTRPCRouter, protectedProcedure, publicProcedure } from "../trpc";

View File

@@ -38,7 +38,7 @@
"with-env": "dotenv -e ../../.env --"
},
"dependencies": {
"@kan/utils": "workspace:^",
"@kan/shared": "workspace:^",
"@vercel/postgres": "^0.10.0",
"drizzle-orm": "^0.36.4",
"drizzle-zod": "^0.5.1",

View File

@@ -1,7 +1,7 @@
import type { SupabaseClient } from "@supabase/supabase-js";
import type { Database } from "@kan/db/types/database.types";
import { generateUID } from "@kan/utils";
import { generateUID } from "@kan/shared/utils";
export const getAllByWorkspaceId = async (
db: SupabaseClient<Database>,

View File

@@ -1,7 +1,7 @@
import type { SupabaseClient } from "@supabase/supabase-js";
import type { Database } from "@kan/db/types/database.types";
import { generateUID } from "@kan/utils";
import { generateUID } from "@kan/shared/utils";
export const create = async (
db: SupabaseClient<Database>,

View File

@@ -1,7 +1,7 @@
import type { SupabaseClient } from "@supabase/supabase-js";
import type { Database } from "@kan/db/types/database.types";
import { generateUID } from "@kan/utils";
import { generateUID } from "@kan/shared/utils";
export const create = async (
db: SupabaseClient<Database>,

View File

@@ -1,7 +1,7 @@
import type { SupabaseClient } from "@supabase/supabase-js";
import type { Database } from "@kan/db/types/database.types";
import { generateUID } from "@kan/utils";
import { generateUID } from "@kan/shared/utils";
export const create = async (
db: SupabaseClient<Database>,

View File

@@ -1,7 +1,7 @@
import type { SupabaseClient } from "@supabase/supabase-js";
import type { Database } from "@kan/db/types/database.types";
import { generateUID } from "@kan/utils";
import { generateUID } from "@kan/shared/utils";
export const create = async (
db: SupabaseClient<Database>,

View File

@@ -1,7 +1,7 @@
import type { SupabaseClient } from "@supabase/supabase-js";
import type { Database } from "@kan/db/types/database.types";
import { generateUID } from "@kan/utils";
import { generateUID } from "@kan/shared/utils";
export const create = async (
db: SupabaseClient<Database>,

View File

@@ -1,7 +1,7 @@
import type { SupabaseClient } from "@supabase/supabase-js";
import type { Database } from "@kan/db/types/database.types";
import { generateUID } from "@kan/utils";
import { generateUID } from "@kan/shared/utils";
export const create = async (
db: SupabaseClient<Database>,

View File

@@ -1,10 +1,21 @@
{
"name": "@kan/utils",
"name": "@kan/shared",
"private": true,
"version": "0.1.0",
"type": "module",
"exports": {
".": "./src/index.ts"
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./utils": {
"types": "./dist/utils/index.d.ts",
"default": "./dist/utils/index.js"
},
"./constants": {
"types": "./dist/constants/index.d.ts",
"default": "./dist/constants/index.js"
}
},
"license": "MIT",
"scripts": {

View File

@@ -0,0 +1,12 @@
export const colours: { name: string; code: string }[] = [
{ name: "Teal", code: "#0d9488" },
{ name: "Green", code: "#65a30d" },
{ name: "Blue", code: "#0284c7" },
{ name: "Purple", code: "#4f46e5" },
{ name: "Yellow", code: "#ca8a04" },
{ name: "Orange", code: "#ea580c" },
{ name: "Red", code: "#dc2626" },
{ name: "Pink", code: "#db2777" },
] as const;
export type Colour = (typeof colours)[number];

View File

@@ -0,0 +1 @@
export * from "./colours";

View File

@@ -0,0 +1,4 @@
export const name = "shared";
export * from "./constants";
export * from "./utils";

View File

@@ -0,0 +1,2 @@
export * from "./generateUID";
export * from "./generateSlug";

View File

@@ -1,4 +0,0 @@
export const name = "utils";
export { generateUID } from "./generateUID";
export { generateSlug } from "./generateSlug";