From ad1a5000c471807e05ba0f631ba44892a570a89c Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Sat, 15 Nov 2025 09:24:56 -0800 Subject: [PATCH 1/2] refactor(orm): consolidate kysely dialects under /dialects exports --- packages/dialects/sql.js/README.md | 25 ----- packages/dialects/sql.js/eslint.config.js | 4 - packages/dialects/sql.js/package.json | 46 --------- packages/dialects/sql.js/src/index.ts | 4 - .../sql.js/test/getting-started/database.ts | 12 --- .../getting-started/person-repository.test.ts | 94 ------------------- .../test/getting-started/person-repository.ts | 48 ---------- .../sql.js/test/getting-started/types.ts | 53 ----------- packages/dialects/sql.js/tsconfig.json | 4 - packages/dialects/sql.js/tsup.config.ts | 13 --- packages/dialects/sql.js/vitest.config.ts | 4 - packages/orm/package.json | 49 +++++++--- packages/orm/src/dialects/postgres.ts | 1 + .../src/dialects/sql.js}/connection.ts | 0 .../src/dialects/sql.js}/dialect.ts | 0 .../src => orm/src/dialects/sql.js}/driver.ts | 0 packages/orm/src/dialects/sql.js/index.ts | 4 + .../src => orm/src/dialects/sql.js}/types.ts | 0 packages/orm/src/dialects/sqlite.ts | 1 + packages/orm/tsup.config.ts | 3 + pnpm-lock.yaml | 87 ++++++++++++----- pnpm-workspace.yaml | 1 + 22 files changed, 108 insertions(+), 345 deletions(-) delete mode 100644 packages/dialects/sql.js/README.md delete mode 100644 packages/dialects/sql.js/eslint.config.js delete mode 100644 packages/dialects/sql.js/package.json delete mode 100644 packages/dialects/sql.js/src/index.ts delete mode 100644 packages/dialects/sql.js/test/getting-started/database.ts delete mode 100644 packages/dialects/sql.js/test/getting-started/person-repository.test.ts delete mode 100644 packages/dialects/sql.js/test/getting-started/person-repository.ts delete mode 100644 packages/dialects/sql.js/test/getting-started/types.ts delete mode 100644 packages/dialects/sql.js/tsconfig.json delete mode 100644 packages/dialects/sql.js/tsup.config.ts delete mode 100644 packages/dialects/sql.js/vitest.config.ts create mode 100644 packages/orm/src/dialects/postgres.ts rename packages/{dialects/sql.js/src => orm/src/dialects/sql.js}/connection.ts (100%) rename packages/{dialects/sql.js/src => orm/src/dialects/sql.js}/dialect.ts (100%) rename packages/{dialects/sql.js/src => orm/src/dialects/sql.js}/driver.ts (100%) create mode 100644 packages/orm/src/dialects/sql.js/index.ts rename packages/{dialects/sql.js/src => orm/src/dialects/sql.js}/types.ts (100%) create mode 100644 packages/orm/src/dialects/sqlite.ts diff --git a/packages/dialects/sql.js/README.md b/packages/dialects/sql.js/README.md deleted file mode 100644 index e5ff101f..00000000 --- a/packages/dialects/sql.js/README.md +++ /dev/null @@ -1,25 +0,0 @@ -Forked from https://github.com/betarixm/kysely-sql-js - -## Usage - -```ts -import { type GeneratedAlways, Kysely } from 'kysely'; -import initSqlJs from 'sql.js'; - -import { SqlJsDialect } from '@zenstackhq/kysely-sql-js'; - -interface Database { - person: { - id: GeneratedAlways; - first_name: string | null; - last_name: string | null; - age: number; - }; -} - -const SqlJsStatic = await initSqlJs(); - -export const db = new Kysely({ - dialect: new SqlJsDialect({ sqlJs: new SqlJsStatic.Database() }), -}); -``` diff --git a/packages/dialects/sql.js/eslint.config.js b/packages/dialects/sql.js/eslint.config.js deleted file mode 100644 index 5698b991..00000000 --- a/packages/dialects/sql.js/eslint.config.js +++ /dev/null @@ -1,4 +0,0 @@ -import config from '@zenstackhq/eslint-config/base.js'; - -/** @type {import("eslint").Linter.Config} */ -export default config; diff --git a/packages/dialects/sql.js/package.json b/packages/dialects/sql.js/package.json deleted file mode 100644 index 1dbd834f..00000000 --- a/packages/dialects/sql.js/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "@zenstackhq/kysely-sql-js", - "version": "3.0.0-beta.23", - "description": "Kysely dialect for sql.js", - "type": "module", - "scripts": { - "build": "tsc --noEmit && tsup-node", - "watch": "tsup-node --watch", - "lint": "eslint src --ext ts", - "pack": "pnpm pack" - }, - "keywords": [], - "author": "ZenStack Team", - "license": "MIT", - "files": [ - "dist" - ], - "exports": { - ".": { - "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - }, - "require": { - "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" - } - }, - "./package.json": { - "import": "./package.json", - "require": "./package.json" - } - }, - "devDependencies": { - "@types/sql.js": "^1.4.9", - "@zenstackhq/eslint-config": "workspace:*", - "@zenstackhq/typescript-config": "workspace:*", - "@zenstackhq/vitest-config": "workspace:*", - "sql.js": "^1.13.0", - "kysely": "catalog:" - }, - "peerDependencies": { - "sql.js": "^1.13.0", - "kysely": "catalog:" - } -} diff --git a/packages/dialects/sql.js/src/index.ts b/packages/dialects/sql.js/src/index.ts deleted file mode 100644 index 096b4fc0..00000000 --- a/packages/dialects/sql.js/src/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './connection'; -export * from './dialect'; -export * from './driver'; -export * from './types'; diff --git a/packages/dialects/sql.js/test/getting-started/database.ts b/packages/dialects/sql.js/test/getting-started/database.ts deleted file mode 100644 index 7ab61248..00000000 --- a/packages/dialects/sql.js/test/getting-started/database.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Database } from './types'; - -import { Kysely } from 'kysely'; -import initSqlJs from 'sql.js'; - -import { SqlJsDialect } from '../../src'; - -const SqlJsStatic = await initSqlJs(); - -export const db = new Kysely({ - dialect: new SqlJsDialect({ sqlJs: new SqlJsStatic.Database() }), -}); diff --git a/packages/dialects/sql.js/test/getting-started/person-repository.test.ts b/packages/dialects/sql.js/test/getting-started/person-repository.test.ts deleted file mode 100644 index 4d00eb1f..00000000 --- a/packages/dialects/sql.js/test/getting-started/person-repository.test.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { sql } from 'kysely'; -import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from 'vitest'; -import { db } from './database'; -import * as PersonRepository from './person-repository'; - -describe('person-repository', () => { - beforeEach(async () => { - await db - .insertInto('person') - .values({ - id: 123, - first_name: 'Arnold', - last_name: 'Schwarzenegger', - gender: 'other', - }) - .executeTakeFirstOrThrow(); - }); - - beforeAll(async () => { - await db.schema - .createTable('person') - .addColumn('id', 'integer', (cb) => cb.primaryKey().autoIncrement().notNull()) - .addColumn('first_name', 'varchar(255)', (cb) => cb.notNull()) - .addColumn('last_name', 'varchar(255)') - .addColumn('gender', 'varchar(50)', (cb) => cb.notNull()) - .addColumn('created_at', 'timestamp', (cb) => cb.notNull().defaultTo(sql`current_timestamp`)) - .execute(); - }); - - afterEach(async () => { - await sql`delete from ${sql.table('person')}`.execute(db); - }); - - afterAll(async () => { - await db.schema.dropTable('person').execute(); - }); - - it('should find a person with a given id', async () => { - expect(await PersonRepository.findPersonById(123)).toMatchObject({ - id: 123, - first_name: 'Arnold', - last_name: 'Schwarzenegger', - gender: 'other', - }); - }); - - it('should find all people named Arnold', async () => { - const people = await PersonRepository.findPeople({ first_name: 'Arnold' }); - - expect(people).toHaveLength(1); - expect(people[0]).toMatchObject({ - id: 123, - first_name: 'Arnold', - last_name: 'Schwarzenegger', - gender: 'other', - }); - }); - - it('should update gender of a person with a given id', async () => { - await PersonRepository.updatePerson(123, { gender: 'woman' }); - - expect(await PersonRepository.findPersonById(123)).toMatchObject({ - id: 123, - first_name: 'Arnold', - last_name: 'Schwarzenegger', - gender: 'woman', - }); - }); - - it('should create a person', async () => { - await PersonRepository.createPerson({ - first_name: 'Jennifer', - last_name: 'Aniston', - gender: 'woman', - }); - - expect(await PersonRepository.findPeople({ first_name: 'Jennifer' })).toHaveLength(1); - }); - - it('should create multiple persons', async () => { - const created = await PersonRepository.createPersons([ - { first_name: 'Brad', last_name: 'Pitt', gender: 'man' }, - { first_name: 'Angelina', last_name: 'Jolie', gender: 'woman' }, - ]); - await expect(PersonRepository.findPeople({ first_name: 'Brad' })).resolves.toBeTruthy(); - await expect(PersonRepository.findPeople({ first_name: 'Angelina' })).resolves.toBeTruthy(); - }); - - it('should delete a person with a given id', async () => { - await PersonRepository.deletePerson(123); - - expect(await PersonRepository.findPersonById(123)).toBeUndefined(); - }); -}); diff --git a/packages/dialects/sql.js/test/getting-started/person-repository.ts b/packages/dialects/sql.js/test/getting-started/person-repository.ts deleted file mode 100644 index f062a816..00000000 --- a/packages/dialects/sql.js/test/getting-started/person-repository.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { PersonUpdate, Person, NewPerson } from './types'; - -import { db } from './database'; - -export async function findPersonById(id: number) { - return await db.selectFrom('person').where('id', '=', id).selectAll().executeTakeFirst(); -} - -export async function findPeople(criteria: Partial) { - let query = db.selectFrom('person'); - - if (criteria.id) { - query = query.where('id', '=', criteria.id); // Kysely is immutable, you must re-assign! - } - - if (criteria.first_name) { - query = query.where('first_name', '=', criteria.first_name); - } - - if (criteria.last_name !== undefined) { - query = query.where('last_name', criteria.last_name === null ? 'is' : '=', criteria.last_name); - } - - if (criteria.gender) { - query = query.where('gender', '=', criteria.gender); - } - - if (criteria.created_at) { - query = query.where('created_at', '=', criteria.created_at); - } - - return await query.selectAll().execute(); -} - -export async function updatePerson(id: number, updateWith: PersonUpdate) { - await db.updateTable('person').set(updateWith).where('id', '=', id).execute(); -} - -export async function createPerson(person: NewPerson) { - return await db.insertInto('person').values(person).returningAll().executeTakeFirstOrThrow(); -} - -export async function createPersons(persons: NewPerson[]) { - return await db.insertInto('person').values(persons).executeTakeFirstOrThrow(); -} -export async function deletePerson(id: number) { - return await db.deleteFrom('person').where('id', '=', id).returningAll().executeTakeFirst(); -} diff --git a/packages/dialects/sql.js/test/getting-started/types.ts b/packages/dialects/sql.js/test/getting-started/types.ts deleted file mode 100644 index abe8bee2..00000000 --- a/packages/dialects/sql.js/test/getting-started/types.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { ColumnType, Generated, Insertable, Selectable, Updateable } from 'kysely'; - -export interface Database { - person: PersonTable; - pet: PetTable; -} - -// This interface describes the `person` table to Kysely. Table -// interfaces should only be used in the `Database` type above -// and never as a result type of a query!. See the `Person`, -// `NewPerson` and `PersonUpdate` types below. -export interface PersonTable { - // Columns that are generated by the database should be marked - // using the `Generated` type. This way they are automatically - // made optional in inserts and updates. - id: Generated; - - first_name: string; - gender: 'man' | 'woman' | 'other'; - - // If the column is nullable in the database, make its type nullable. - // Don't use optional properties. Optionality is always determined - // automatically by Kysely. - last_name: string | null; - - // You can specify a different type for each operation (select, insert and - // update) using the `ColumnType` - // wrapper. Here we define a column `created_at` that is selected as - // a `Date`, can optionally be provided as a `string` in inserts and - // can never be updated: - created_at: ColumnType; -} - -// You should not use the table schema interfaces directly. Instead, you should -// use the `Selectable`, `Insertable` and `Updateable` wrappers. These wrappers -// make sure that the correct types are used in each operation. -// -// Most of the time you should trust the type inference and not use explicit -// types at all. These types can be useful when typing function arguments. -export type Person = Selectable; -export type NewPerson = Insertable; -export type PersonUpdate = Updateable; - -export interface PetTable { - id: Generated; - name: string; - owner_id: number; - species: 'dog' | 'cat'; -} - -export type Pet = Selectable; -export type NewPet = Insertable; -export type PetUpdate = Updateable; diff --git a/packages/dialects/sql.js/tsconfig.json b/packages/dialects/sql.js/tsconfig.json deleted file mode 100644 index 41472d08..00000000 --- a/packages/dialects/sql.js/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "@zenstackhq/typescript-config/base.json", - "include": ["src/**/*"] -} diff --git a/packages/dialects/sql.js/tsup.config.ts b/packages/dialects/sql.js/tsup.config.ts deleted file mode 100644 index 5a74a9dd..00000000 --- a/packages/dialects/sql.js/tsup.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: { - index: 'src/index.ts', - }, - outDir: 'dist', - splitting: false, - sourcemap: true, - clean: true, - dts: true, - format: ['cjs', 'esm'], -}); diff --git a/packages/dialects/sql.js/vitest.config.ts b/packages/dialects/sql.js/vitest.config.ts deleted file mode 100644 index 23c01e72..00000000 --- a/packages/dialects/sql.js/vitest.config.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { defineConfig, mergeConfig } from 'vitest/config'; -import base from '@zenstackhq/vitest-config/base'; - -export default mergeConfig(base, defineConfig({})); diff --git a/packages/orm/package.json b/packages/orm/package.json index 4e8ff9e0..d50acfbc 100644 --- a/packages/orm/package.json +++ b/packages/orm/package.json @@ -36,24 +36,44 @@ "default": "./dist/schema.cjs" } }, - "./helpers": { + "./dialects/sqlite": { "import": { - "types": "./dist/helpers.d.ts", - "default": "./dist/helpers.js" + "types": "./dist/dialects/sqlite.d.ts", + "default": "./dist/dialects/sqlite.js" }, "require": { - "types": "./dist/helpers.d.cts", - "default": "./dist/helpers.cjs" + "types": "./dist/dialects/sqlite.d.cts", + "default": "./dist/dialects/sqlite.cjs" + } + }, + "./dialects/postgres": { + "import": { + "types": "./dist/dialects/postgres.d.ts", + "default": "./dist/dialects/postgres.js" + }, + "require": { + "types": "./dist/dialects/postgres.d.cts", + "default": "./dist/dialects/postgres.cjs" + } + }, + "./dialects/sql.js": { + "import": { + "types": "./dist/dialects/sql.js.d.ts", + "default": "./dist/dialects/sql.js.js" + }, + "require": { + "types": "./dist/dialects/sql.js.d.cts", + "default": "./dist/dialects/sql.js.cjs" } }, - "./plugins/policy": { + "./helpers": { "import": { - "types": "./dist/plugins/policy/index.d.ts", - "default": "./dist/plugins/policy/index.js" + "types": "./dist/helpers.d.ts", + "default": "./dist/helpers.js" }, "require": { - "types": "./dist/plugins/policy/index.d.cts", - "default": "./dist/plugins/policy/index.cjs" + "types": "./dist/helpers.d.cts", + "default": "./dist/helpers.cjs" } }, "./package.json": { @@ -73,12 +93,14 @@ "ts-pattern": "catalog:", "ulid": "^3.0.0", "uuid": "^11.0.5", - "zod-validation-error": "catalog:" + "zod-validation-error": "catalog:", + "@types/sql.js": "^1.4.9" }, "peerDependencies": { "better-sqlite3": "catalog:", "pg": "catalog:", - "zod": "catalog:" + "zod": "catalog:", + "sql.js": "catalog:" }, "peerDependenciesMeta": { "better-sqlite3": { @@ -86,6 +108,9 @@ }, "pg": { "optional": true + }, + "sql.js": { + "optional": true } }, "devDependencies": { diff --git a/packages/orm/src/dialects/postgres.ts b/packages/orm/src/dialects/postgres.ts new file mode 100644 index 00000000..0c52590b --- /dev/null +++ b/packages/orm/src/dialects/postgres.ts @@ -0,0 +1 @@ +export { PostgresDialect, type PostgresDialectConfig } from 'kysely'; diff --git a/packages/dialects/sql.js/src/connection.ts b/packages/orm/src/dialects/sql.js/connection.ts similarity index 100% rename from packages/dialects/sql.js/src/connection.ts rename to packages/orm/src/dialects/sql.js/connection.ts diff --git a/packages/dialects/sql.js/src/dialect.ts b/packages/orm/src/dialects/sql.js/dialect.ts similarity index 100% rename from packages/dialects/sql.js/src/dialect.ts rename to packages/orm/src/dialects/sql.js/dialect.ts diff --git a/packages/dialects/sql.js/src/driver.ts b/packages/orm/src/dialects/sql.js/driver.ts similarity index 100% rename from packages/dialects/sql.js/src/driver.ts rename to packages/orm/src/dialects/sql.js/driver.ts diff --git a/packages/orm/src/dialects/sql.js/index.ts b/packages/orm/src/dialects/sql.js/index.ts new file mode 100644 index 00000000..d28411d4 --- /dev/null +++ b/packages/orm/src/dialects/sql.js/index.ts @@ -0,0 +1,4 @@ +// This module is ported from https://github.com/betarixm/kysely-sql-js by @betarixm + +export { SqlJsDialect } from './dialect'; +export type { SqlJsDialectConfig } from './types'; diff --git a/packages/dialects/sql.js/src/types.ts b/packages/orm/src/dialects/sql.js/types.ts similarity index 100% rename from packages/dialects/sql.js/src/types.ts rename to packages/orm/src/dialects/sql.js/types.ts diff --git a/packages/orm/src/dialects/sqlite.ts b/packages/orm/src/dialects/sqlite.ts new file mode 100644 index 00000000..2a3e6e68 --- /dev/null +++ b/packages/orm/src/dialects/sqlite.ts @@ -0,0 +1 @@ +export { SqliteDialect, type SqliteDialectConfig } from 'kysely'; diff --git a/packages/orm/tsup.config.ts b/packages/orm/tsup.config.ts index f4168f61..14ebdca2 100644 --- a/packages/orm/tsup.config.ts +++ b/packages/orm/tsup.config.ts @@ -5,6 +5,9 @@ export default defineConfig({ index: 'src/index.ts', schema: 'src/schema.ts', helpers: 'src/helpers.ts', + 'dialects/sqlite': 'src/dialects/sqlite.ts', + 'dialects/postgres': 'src/dialects/postgres.ts', + 'dialects/sql.js': 'src/dialects/sql.js/index.ts', }, outDir: 'dist', splitting: false, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f2fdc5a..a7726733 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,6 +54,9 @@ catalogs: react-dom: specifier: 19.2.0 version: 19.2.0 + sql.js: + specifier: ^1.13.0 + version: 1.13.0 svelte: specifier: 5.43.3 version: 5.43.3 @@ -382,6 +385,9 @@ importers: '@paralleldrive/cuid2': specifier: ^2.2.2 version: 2.2.2 + '@types/sql.js': + specifier: ^1.4.9 + version: 1.4.9 '@zenstackhq/common-helpers': specifier: workspace:* version: link:../common-helpers @@ -406,6 +412,9 @@ importers: pg: specifier: 'catalog:' version: 8.16.3 + sql.js: + specifier: 'catalog:' + version: 1.13.0 toposort: specifier: ^2.0.2 version: 2.0.2 @@ -599,7 +608,7 @@ importers: version: 16.0.1(@babel/core@7.28.5)(react-dom@19.2.0(react@19.2.0))(react@19.2.0) nuxt: specifier: ^4.2.0 - version: 4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1) + version: 4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1) supertest: specifier: ^7.1.4 version: 7.1.4 @@ -7774,10 +7783,10 @@ snapshots: '@csstools/css-tokenizer@3.0.4': optional: true - '@dxup/nuxt@0.2.0(magicast@0.3.5)': + '@dxup/nuxt@0.2.0(magicast@0.5.0)': dependencies: '@dxup/unimport': 0.1.0 - '@nuxt/kit': 4.2.0(magicast@0.3.5) + '@nuxt/kit': 4.2.0(magicast@0.5.0) chokidar: 4.0.3 pathe: 2.0.3 tinyglobby: 0.2.15 @@ -8272,9 +8281,9 @@ snapshots: '@nolyfill/is-core-module@1.0.39': {} - '@nuxt/cli@3.29.3(magicast@0.3.5)': + '@nuxt/cli@3.29.3(magicast@0.5.0)': dependencies: - c12: 3.3.1(magicast@0.3.5) + c12: 3.3.1(magicast@0.5.0) citty: 0.1.6 clipboardy: 5.0.0 confbox: 0.2.2 @@ -8392,9 +8401,35 @@ snapshots: transitivePeerDependencies: - magicast - '@nuxt/kit@4.2.0(magicast@0.3.5)': + '@nuxt/kit@3.20.0(magicast@0.5.0)': dependencies: - c12: 3.3.1(magicast@0.3.5) + c12: 3.3.1(magicast@0.5.0) + consola: 3.4.2 + defu: 6.1.4 + destr: 2.0.5 + errx: 0.1.0 + exsolve: 1.0.7 + ignore: 7.0.5 + jiti: 2.6.1 + klona: 2.0.6 + knitwork: 1.2.0 + mlly: 1.8.0 + ohash: 2.0.11 + pathe: 2.0.3 + pkg-types: 2.3.0 + rc9: 2.1.2 + scule: 1.3.0 + semver: 7.7.3 + tinyglobby: 0.2.15 + ufo: 1.6.1 + unctx: 2.4.1 + untyped: 2.0.0 + transitivePeerDependencies: + - magicast + + '@nuxt/kit@4.2.0(magicast@0.5.0)': + dependencies: + c12: 3.3.1(magicast@0.5.0) consola: 3.4.2 defu: 6.1.4 destr: 2.0.5 @@ -8417,10 +8452,10 @@ snapshots: transitivePeerDependencies: - magicast - '@nuxt/nitro-server@4.2.0(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(ioredis@5.8.2)(magicast@0.3.5)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(typescript@5.8.3)': + '@nuxt/nitro-server@4.2.0(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(ioredis@5.8.2)(magicast@0.5.0)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(typescript@5.8.3)': dependencies: '@nuxt/devalue': 2.0.2 - '@nuxt/kit': 4.2.0(magicast@0.3.5) + '@nuxt/kit': 4.2.0(magicast@0.5.0) '@unhead/vue': 2.0.19(vue@3.5.22(typescript@5.8.3)) '@vue/shared': 3.5.22 consola: 3.4.2 @@ -8435,7 +8470,7 @@ snapshots: klona: 2.0.6 mocked-exports: 0.1.1 nitropack: 2.12.9(better-sqlite3@12.2.0) - nuxt: 4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1) + nuxt: 4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1) pathe: 2.0.3 pkg-types: 2.3.0 radix3: 1.1.2 @@ -8489,9 +8524,9 @@ snapshots: pkg-types: 2.3.0 std-env: 3.10.0 - '@nuxt/telemetry@2.6.6(magicast@0.3.5)': + '@nuxt/telemetry@2.6.6(magicast@0.5.0)': dependencies: - '@nuxt/kit': 3.20.0(magicast@0.3.5) + '@nuxt/kit': 3.20.0(magicast@0.5.0) citty: 0.1.6 consola: 3.4.2 destr: 2.0.5 @@ -8506,9 +8541,9 @@ snapshots: transitivePeerDependencies: - magicast - '@nuxt/vite-builder@4.2.0(@types/node@20.19.24)(eslint@9.29.0(jiti@2.6.1))(lightningcss@1.30.2)(magicast@0.3.5)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vue@3.5.22(typescript@5.8.3))(yaml@2.8.1)': + '@nuxt/vite-builder@4.2.0(@types/node@20.19.24)(eslint@9.29.0(jiti@2.6.1))(lightningcss@1.30.2)(magicast@0.5.0)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vue@3.5.22(typescript@5.8.3))(yaml@2.8.1)': dependencies: - '@nuxt/kit': 4.2.0(magicast@0.3.5) + '@nuxt/kit': 4.2.0(magicast@0.5.0) '@rollup/plugin-replace': 6.0.3(rollup@4.52.5) '@vitejs/plugin-vue': 6.0.1(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(vue@3.5.22(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': 5.1.1(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(vue@3.5.22(typescript@5.8.3)) @@ -8526,7 +8561,7 @@ snapshots: magic-string: 0.30.21 mlly: 1.8.0 mocked-exports: 0.1.1 - nuxt: 4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1) + nuxt: 4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1) pathe: 2.0.3 pkg-types: 2.3.0 postcss: 8.5.6 @@ -10901,7 +10936,7 @@ snapshots: eslint: 9.29.0(jiti@2.6.1) eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.29.0(jiti@2.6.1)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.29.0(jiti@2.6.1)) eslint-plugin-react: 7.37.5(eslint@9.29.0(jiti@2.6.1)) eslint-plugin-react-hooks: 7.0.1(eslint@9.29.0(jiti@2.6.1)) @@ -10934,7 +10969,7 @@ snapshots: tinyglobby: 0.2.15 unrs-resolver: 1.11.1 optionalDependencies: - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.29.0(jiti@2.6.1)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)) transitivePeerDependencies: - supports-color @@ -10949,7 +10984,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.29.0(jiti@2.6.1)): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -12487,19 +12522,19 @@ snapshots: dependencies: boolbase: 1.0.0 - nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1): + nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1): dependencies: - '@dxup/nuxt': 0.2.0(magicast@0.3.5) - '@nuxt/cli': 3.29.3(magicast@0.3.5) + '@dxup/nuxt': 0.2.0(magicast@0.5.0) + '@nuxt/cli': 3.29.3(magicast@0.5.0) '@nuxt/devtools': 2.7.0(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(vue@3.5.22(typescript@5.8.3)) - '@nuxt/kit': 4.2.0(magicast@0.3.5) - '@nuxt/nitro-server': 4.2.0(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(ioredis@5.8.2)(magicast@0.3.5)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(typescript@5.8.3) + '@nuxt/kit': 4.2.0(magicast@0.5.0) + '@nuxt/nitro-server': 4.2.0(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(ioredis@5.8.2)(magicast@0.5.0)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(typescript@5.8.3) '@nuxt/schema': 4.2.0 - '@nuxt/telemetry': 2.6.6(magicast@0.3.5) - '@nuxt/vite-builder': 4.2.0(@types/node@20.19.24)(eslint@9.29.0(jiti@2.6.1))(lightningcss@1.30.2)(magicast@0.3.5)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vue@3.5.22(typescript@5.8.3))(yaml@2.8.1) + '@nuxt/telemetry': 2.6.6(magicast@0.5.0) + '@nuxt/vite-builder': 4.2.0(@types/node@20.19.24)(eslint@9.29.0(jiti@2.6.1))(lightningcss@1.30.2)(magicast@0.5.0)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.8.3)(vue@3.5.22(typescript@5.8.3))(yaml@2.8.1) '@unhead/vue': 2.0.19(vue@3.5.22(typescript@5.8.3)) '@vue/shared': 3.5.22 - c12: 3.3.1(magicast@0.3.5) + c12: 3.3.1(magicast@0.5.0) chokidar: 4.0.3 compatx: 0.2.0 consola: 3.4.2 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 50f3e3fb..11104af6 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -17,6 +17,7 @@ catalog: 'better-sqlite3': ^12.2.0 '@types/better-sqlite3': ^7.6.13 'pg': ^8.13.1 + 'sql.js': ^1.13.0 'decimal.js': '^10.4.3' react: 19.2.0 '@types/react': 19.2.0 From db54f4982221bb95542714afa590f33bbff0ee3e Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Sat, 15 Nov 2025 09:54:11 -0800 Subject: [PATCH 2/2] update --- packages/orm/package.json | 6 +++--- pnpm-lock.yaml | 27 +++------------------------ 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/packages/orm/package.json b/packages/orm/package.json index d50acfbc..5e20ce35 100644 --- a/packages/orm/package.json +++ b/packages/orm/package.json @@ -93,8 +93,7 @@ "ts-pattern": "catalog:", "ulid": "^3.0.0", "uuid": "^11.0.5", - "zod-validation-error": "catalog:", - "@types/sql.js": "^1.4.9" + "zod-validation-error": "catalog:" }, "peerDependencies": { "better-sqlite3": "catalog:", @@ -121,6 +120,7 @@ "@zenstackhq/typescript-config": "workspace:*", "@zenstackhq/vitest-config": "workspace:*", "tsx": "^4.19.2", - "zod": "^4.1.0" + "zod": "^4.1.0", + "@types/sql.js": "^1.4.9" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a7726733..5b01cfd8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -291,27 +291,6 @@ importers: specifier: workspace:* version: link:../config/typescript-config - packages/dialects/sql.js: - devDependencies: - '@types/sql.js': - specifier: ^1.4.9 - version: 1.4.9 - '@zenstackhq/eslint-config': - specifier: workspace:* - version: link:../../config/eslint-config - '@zenstackhq/typescript-config': - specifier: workspace:* - version: link:../../config/typescript-config - '@zenstackhq/vitest-config': - specifier: workspace:* - version: link:../../config/vitest-config - kysely: - specifier: 'catalog:' - version: 0.28.8 - sql.js: - specifier: ^1.13.0 - version: 1.13.0 - packages/ide/vscode: dependencies: '@zenstackhq/language': @@ -385,9 +364,6 @@ importers: '@paralleldrive/cuid2': specifier: ^2.2.2 version: 2.2.2 - '@types/sql.js': - specifier: ^1.4.9 - version: 1.4.9 '@zenstackhq/common-helpers': specifier: workspace:* version: link:../common-helpers @@ -437,6 +413,9 @@ importers: '@types/pg': specifier: ^8.0.0 version: 8.11.11 + '@types/sql.js': + specifier: ^1.4.9 + version: 1.4.9 '@types/toposort': specifier: ^2.0.7 version: 2.0.7