Skip to content

Commit

Permalink
Merge pull request #2183 from undb-io/release/v1.0.0-134
Browse files Browse the repository at this point in the history
Release version v1.0.0-134
  • Loading branch information
nichenqin authored Dec 13, 2024
2 parents ce4e3aa + 97a8eb7 commit 9395354
Show file tree
Hide file tree
Showing 198 changed files with 2,934 additions and 1,072 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

## v1.0.0-134

## v1.0.0-133


Expand Down
8 changes: 4 additions & 4 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"build:docker": "bun build --compile src/index.ts --target=bun --packages=external --sourcemap --outfile undb"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.701.0",
"@aws-sdk/s3-request-presigner": "^3.701.0",
"@aws-sdk/client-s3": "^3.705.0",
"@aws-sdk/s3-request-presigner": "^3.705.0",
"@elysiajs/cors": "1.1.0",
"@elysiajs/cron": "1.1.0",
"@elysiajs/html": "1.1.0",
Expand Down Expand Up @@ -42,7 +42,7 @@
"@undb/trpc": "workspace:*",
"@undb/webhook": "workspace:*",
"arctic": "^2.3.0",
"bun": "^1.1.37",
"bun": "^1.1.38",
"core-js": "^3.39.0",
"elysia": "1.1.7",
"got": "^14.4.5",
Expand All @@ -62,7 +62,7 @@
"@types/nodemailer": "^6.4.17",
"@types/uuid": "^10.0.0",
"bun-types": "latest",
"kysely": "^0.27.4"
"kysely": "^0.27.5"
},
"types": "./src/app.d.ts",
"exports": {
Expand Down
41 changes: 21 additions & 20 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test": "vitest",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
"format": "prettier --write .",
"clean": "bunx rimraf node_modules"
},
"devDependencies": {
"@fontsource/fira-mono": "^5.1.0",
Expand All @@ -20,16 +21,16 @@
"@svelte-put/copy": "^4.0.0",
"@svelte-put/shortcut": "^4.0.0",
"@sveltejs/adapter-static": "^3.0.6",
"@sveltejs/kit": "^2.8.5",
"@sveltejs/kit": "^2.9.1",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@tailwindcss/typography": "^0.5.15",
"@tanstack/eslint-plugin-query": "^5.61.6",
"@tanstack/eslint-plugin-query": "^5.62.1",
"@types/eslint": "^9.6.1",
"@types/lodash.unzip": "^3.4.9",
"@types/papaparse": "^5.3.15",
"@types/sortablejs": "latest",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@typescript-eslint/parser": "^8.16.0",
"@typescript-eslint/eslint-plugin": "^8.18.0",
"@typescript-eslint/parser": "^8.18.0",
"@undb/commands": "workspace:*",
"@undb/command-handlers": "workspace:*",
"@undb/query-handlers": "workspace:*",
Expand All @@ -49,52 +50,52 @@
"array-move": "^4.0.0",
"autoprefixer": "^10.4.20",
"date-fns": "^4.1.0",
"eslint": "^9.15.0",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.46.0",
"eslint-plugin-svelte": "^2.46.1",
"houdini": "^1.3.1",
"houdini-svelte": "^2.0.1",
"lodash.unzip": "^3.4.0",
"papaparse": "^5.4.1",
"postcss": "^8.4.49",
"postcss-load-config": "^6.0.1",
"prettier": "^3.4.1",
"prettier": "^3.4.2",
"prettier-plugin-svelte": "^3.3.2",
"prettier-plugin-tailwindcss": "^0.6.9",
"radash": "^12.1.0",
"rollup-plugin-visualizer": "^5.12.0",
"safe-flat": "^2.1.0",
"sortablejs": "^1.15.6",
"svelte": "^5.2.10",
"svelte-check": "^4.1.0",
"svelte": "^5.10.0",
"svelte-check": "^4.1.1",
"svelte-headless-table": "^0.18.3",
"svelte-inview": "^4.0.4",
"svelte-jsoneditor": "^2.3.1",
"svelte-jsoneditor": "^2.3.2",
"svelte-persisted-store": "^0.12.0",
"sveltekit-search-params": "^3.0.0",
"svelvet": "^10.0.2",
"tailwindcss": "^3.4.15",
"tailwindcss": "^3.4.16",
"timeago.js": "^4.0.2",
"tslib": "^2.8.1",
"type-fest": "^4.29.0",
"type-fest": "^4.30.0",
"typescript": "^5.7.2",
"vite": "^5.4.11",
"vite-plugin-node-polyfills": "^0.22.0",
"vitest": "^2.1.6",
"vitest": "^2.1.8",
"xlsx": "^0.18.5"
},
"type": "module",
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
"@codemirror/commands": "^6.7.1",
"@codemirror/language": "^6.10.5",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.35.0",
"@codemirror/language": "^6.10.6",
"@codemirror/state": "^6.5.0",
"@codemirror/view": "^6.35.3",
"@floating-ui/dom": "^1.6.12",
"@formkit/auto-animate": "^0.8.2",
"@internationalized/date": "^3.6.0",
"@svelte-put/clickoutside": "^4.0.0",
"@tanstack/svelte-query": "^5.61.5",
"@tanstack/svelte-query": "^5.62.3",
"@tanstack/svelte-virtual": "^3.10.9",
"@tiptap/core": "^2.10.3",
"@tiptap/pm": "^2.10.3",
Expand All @@ -107,15 +108,15 @@
"embla-carousel-svelte": "^8.5.1",
"formsnap": "^1.0.1",
"fuse.js": "^7.0.0",
"lucide-svelte": "^0.462.0",
"lucide-svelte": "^0.468.0",
"mode-watcher": "^0.5.0",
"paneforge": "^0.0.6",
"reflect-metadata": "^0.2.2",
"svelte-grid": "^5.1.2",
"svelte-qrcode": "^1.0.1",
"svelte-radix": "^2.0.1",
"svelte-sonner": "^0.3.28",
"sveltekit-superforms": "^2.20.1",
"sveltekit-superforms": "^2.21.1",
"tailwind-merge": "^2.5.5",
"tailwind-variants": "^0.3.0",
"trpc-svelte-query-adapter": "^2.3.15",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,26 @@
import { TriangleAlertIcon } from "lucide-svelte"
import * as Tooltip from "$lib/components/ui/tooltip"
import type { TableDo } from "@undb/table"
import { getDataService } from "$lib/store/data-service.store"
export let tableId: string | undefined
export let table: TableDo | undefined
export let viewId: string | undefined
export let shareId: string | undefined
export let ignoreView: boolean = false
export let readonly = false
export let widget: IWidgetDTO
export let aggregate: IAggregate
$: isValid = isValidWidget(widget) && !!tableId
const dataService = getDataService()
const getAggregate = createQuery({
queryKey: ["aggregate", widget.id],
enabled: !!tableId,
queryFn: () => {
queryFn: async () => {
const agg =
aggregate.type === "count"
? ({ [ID_TYPE]: "count" } as const)
Expand All @@ -37,7 +41,7 @@
ignoreView,
})
}
return trpc.record.aggregate.query({
return dataService.records.getAggregates({
tableId: tableId!,
viewId,
aggregate: agg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
import * as Form from "$lib/components/ui/form"
import * as Alert from "$lib/components/ui/alert/index.js"
import { PencilIcon } from "lucide-svelte"
import type { IBulkUpdateRecordsCommandOutput } from "@undb/commands"
import type { IBulkUpdateRecordsCommand, IBulkUpdateRecordsCommandOutput } from "@undb/commands"
import * as AlertDialog from "$lib/components/ui/alert-dialog"
import FiltersEditor from "../filters-editor/filters-editor.svelte"
import { writable, type Writable } from "svelte/store"
import autoAnimate from "@formkit/auto-animate"
import type { Readable } from "svelte/store"
import { LL } from "@undb/i18n/client"
import { getDataService } from "$lib/store/data-service.store"
const table = getTable()
export let viewId: Readable<string | undefined>
Expand All @@ -46,8 +47,12 @@
const client = useQueryClient()
const dataService = getDataService()
const updateRecordMutation = createMutation({
mutationFn: trpc.record.bulkUpdate.mutate,
mutationFn: async (command: IBulkUpdateRecordsCommand) => {
return dataService.records.updateRecords(command)
},
onSuccess: async (data) => {
if (!data.modifiedCount) {
toast.warning($LL.table.record.bulkUpdate.noRecordsUpdated())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import { type RecordDO, CalendarView, DateFieldValue, FieldIdVo } from "@undb/table"
import { getRecordsStore } from "$lib/store/records.store"
import { getTable } from "$lib/store/table.store"
import { trpc } from "$lib/trpc/client"
import { createMutation } from "@tanstack/svelte-query"
import { useQueryClient } from "@tanstack/svelte-query"
import { cn } from "$lib/utils"
import { calendarStore } from "$lib/store/calendar.store"
import { getDataService } from "$lib/store/data-service.store"
import { type IUpdateRecordCommand } from "@undb/commands"
export let view: CalendarView
Expand All @@ -19,8 +20,12 @@
let field = fieldId ? $t.schema.getFieldById(new FieldIdVo(fieldId)).into(undefined) : undefined
const dataService = getDataService()
const updateRecord = createMutation({
mutationFn: trpc.record.update.mutate,
mutationFn: async (command: IUpdateRecordCommand) => {
return dataService.records.updateRecord(command)
},
})
const client = useQueryClient()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
import { defaults, superForm } from "sveltekit-superforms"
import { zodClient } from "sveltekit-superforms/adapters"
import CreateFieldButton from "../create-field/create-field-button.svelte"
import { trpc } from "$lib/trpc/client"
import { createMutation } from "@tanstack/svelte-query"
import { toast } from "svelte-sonner"
import { invalidate } from "$app/navigation"
import { hasPermission } from "$lib/store/space-member.store"
import { CircleCheckBigIcon } from "lucide-svelte"
import { LL } from "@undb/i18n/client"
import { getDataService } from "$lib/store/data-service.store"
import { type IUpdateViewCommand } from "@undb/commands"
export let readonly = false
Expand Down Expand Up @@ -49,8 +50,12 @@
const { enhance, form: formData } = form
const dataService = getDataService()
const updateViewMutation = createMutation({
mutationFn: trpc.table.view.update.mutate,
mutationFn: async (command: IUpdateViewCommand) => {
return dataService.table.view.updateView(command)
},
mutationKey: ["updateView"],
async onSuccess(data, variables, context) {
toast.success($LL.table.view.updated())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import { LL } from "@undb/i18n/client"
import { calendarTimeScales, type CalendarTimeScale, type CalendarView } from "@undb/table"
import { createMutation } from "@tanstack/svelte-query"
import { trpc } from "$lib/trpc/client"
import { toast } from "svelte-sonner"
import { getTable } from "$lib/store/table.store"
import { invalidate } from "$app/navigation"
import { type ICalendarViewDTO } from "@undb/table"
import { getDataService } from "$lib/store/data-service.store"
import { type IUpdateViewCommand } from "@undb/commands"
export let view: CalendarView
const table = getTable()
Expand All @@ -38,8 +38,12 @@
})
}
const dataService = getDataService()
const updateViewMutation = createMutation({
mutationFn: trpc.table.view.update.mutate,
mutationFn: async (command: IUpdateViewCommand) => {
return dataService.table.view.updateView(command)
},
mutationKey: ["updateView"],
async onSuccess(data, variables, context) {
await invalidate(`undb:table:${$table.id.value}`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
import { CREATE_RECORD_MODAL, openModal } from "$lib/store/modal.store"
import { tick } from "svelte"
import { hasPermission } from "$lib/store/space-member.store"
import { getIsLocal, getDataService } from "$lib/store/data-service.store"
import { getDataService } from "$lib/store/data-service.store"
import { type IUpdateRecordCommand } from "@undb/commands"
export let viewId: Readable<string | undefined>
export let view: CalendarView
Expand Down Expand Up @@ -104,7 +105,7 @@
const t = getTable()
const q = queryParam("q")
const isLocal = getIsLocal()
const dataService = getDataService()
const getRecords = createQuery(
derived([t, viewId, q, date], ([$table, $viewId, $q, $date]) => {
Expand All @@ -113,7 +114,6 @@
queryKey: ["records", $table?.id.value, $viewId, $q, $date.toISOString()],
enabled: view?.type === "calendar" && !disableRecordQuery,
queryFn: async () => {
const dataService = await getDataService(isLocal)
const value = format($date, "yyyy-MM-dd")
if (shareId) {
return trpc.shareData.records.query({
Expand Down Expand Up @@ -255,7 +255,7 @@
let overMinutes: number | undefined = undefined
const updateRecord = createMutation({
mutationFn: trpc.record.update.mutate,
mutationFn: dataService.records.updateRecord,
})
const client = useQueryClient()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import { isToday } from "date-fns/isToday"
import { isWeekend } from "date-fns/isWeekend"
import { createMutation, useQueryClient } from "@tanstack/svelte-query"
import { trpc } from "$lib/trpc/client"
import { dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter"
import { format } from "date-fns/format"
import { cn } from "$lib/utils"
import { CREATE_RECORD_MODAL, openModal } from "$lib/store/modal.store"
import { defaultRecordValues } from "$lib/store/records.store"
import { type Readable } from "svelte/store"
import { getDataService } from "$lib/store/data-service.store"
export let field: DateField | DateRangeField
export let date: Date
Expand All @@ -33,6 +33,8 @@
const isSelected = calendarStore.isSelected
const getIsSameMonth = calendarStore.getIsSameMonth
const dataService = getDataService()
$: color = $viewId ? $table.views.getViewById($viewId)?.color.into(undefined) : undefined
$: day = getDate(date)
Expand Down Expand Up @@ -84,7 +86,7 @@
}
const updateRecord = createMutation({
mutationFn: trpc.record.update.mutate,
mutationFn: dataService.records.updateRecord,
})
const client = useQueryClient()
Expand Down
Loading

0 comments on commit 9395354

Please sign in to comment.