Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version v1.0.0-134 #2183

Merged
merged 52 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
a1b6db1
Merge pull request #2174 from undb-io/main
nichenqin Dec 2, 2024
a35c2db
feat: try to add sql.js
nichenqin Dec 2, 2024
c6654ff
feat: allow to migrate sql js
nichenqin Dec 2, 2024
b214393
chore: sql-js create init db
nichenqin Dec 2, 2024
6048ba4
fix: fix type issue
nichenqin Dec 2, 2024
ba1372e
feat: add data service package
nichenqin Dec 2, 2024
4f450c4
refactor: add frontend di
nichenqin Dec 3, 2024
dac47eb
fix: fix lock file
nichenqin Dec 3, 2024
93fabe9
feat: template sqlite
nichenqin Dec 4, 2024
34dca3f
fix: fix oauth
nichenqin Dec 4, 2024
224922e
fix: fix oauth
nichenqin Dec 4, 2024
4b48570
chore: add dummy qb
nichenqin Dec 4, 2024
dd17abb
Revert "fix: fix oauth"
nichenqin Dec 4, 2024
95eb3c9
Revert "chore: add dummy qb"
nichenqin Dec 4, 2024
1816df5
fix: fix oauth
nichenqin Dec 4, 2024
f5066f2
Merge pull request #2178 from undb-io/main
nichenqin Dec 4, 2024
46bb169
fix: fix lock file
nichenqin Dec 4, 2024
b59b0dd
fix: fix aggregate count
nichenqin Dec 5, 2024
52ac118
chore: data service aggregate
nichenqin Dec 5, 2024
ec1fccf
chore: view widget readonly
nichenqin Dec 5, 2024
f850988
chore: view widget readonly
nichenqin Dec 5, 2024
d807e88
fix: fix export
nichenqin Dec 5, 2024
cd29a27
fix: fix template dashbord default value
nichenqin Dec 5, 2024
113a7e8
chore: default not include data
nichenqin Dec 5, 2024
8d58d71
fix: remove magic string
nichenqin Dec 5, 2024
ad19393
fix: fix template url
nichenqin Dec 5, 2024
16a95b7
fix: fix reference cell readonly
nichenqin Dec 5, 2024
c371276
fix: fix template i18n
nichenqin Dec 5, 2024
51e3ac7
chore: i18n
nichenqin Dec 5, 2024
d7ffb2e
chore: template header redirect to home page
nichenqin Dec 5, 2024
4c23da1
fix: readonly select cell
nichenqin Dec 5, 2024
899ee50
fix: readonly long text cell
nichenqin Dec 5, 2024
dbdacb0
fix: remove everything template
nichenqin Dec 5, 2024
b0408ae
fix: fix sortable number
nichenqin Dec 8, 2024
00a89ba
chore: fix create kanban view
nichenqin Dec 8, 2024
640718c
feat: init playground
nichenqin Dec 7, 2024
86bfd7a
chore: add more data service impl
nichenqin Dec 8, 2024
25f2d09
fix: fix vite config
nichenqin Dec 8, 2024
f996759
fix: fix vite config
nichenqin Dec 9, 2024
ce1c141
chore: add playground alert
nichenqin Dec 9, 2024
8454032
style: make playground style nice
nichenqin Dec 9, 2024
1f77040
chore: add some playground menu button
nichenqin Dec 9, 2024
77864ca
chore: add some playground command handler
nichenqin Dec 9, 2024
8a7b75e
fix: delete records clear selection
nichenqin Dec 9, 2024
239066e
chore: playground
nichenqin Dec 9, 2024
93ba25a
chore: playground
nichenqin Dec 10, 2024
4087238
chore: upgrade dependencies
nichenqin Dec 10, 2024
b8ad341
chore: change base
nichenqin Dec 10, 2024
4b56f67
refactor: data service
nichenqin Dec 12, 2024
79669f7
chore: playground
nichenqin Dec 13, 2024
ebe24b2
Merge pull request #2179 from undb-io/feature/playground
nichenqin Dec 13, 2024
97a8eb7
Prepare release v1.0.0-134
web-flow Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading