durable-db 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ import { type } from "arktype";
2
+ //#region src/arktypeConfig.d.ts
3
+ declare const type$1: typeof type;
4
+ //#endregion
5
+ export { type$1 as t };
@@ -1,7 +1,7 @@
1
1
  import { t as DatabaseSource } from "../discovery-gHeLq8jk.js";
2
2
  import { t as Snapshot } from "../snapshot-CaG5xnE2.js";
3
- import { l as DatabaseInfo } from "../defineDatabase-CHmTgZTx.js";
4
- import "../index-M4Jp_PFM.js";
3
+ import { l as DatabaseInfo } from "../defineDatabase-IUthY3Ex.js";
4
+ import "../index-BdrcuAU7.js";
5
5
  import { Command } from "commander";
6
6
  //#region src/cli/command.d.ts
7
7
  /**
@@ -1,4 +1,4 @@
1
- import { t as type } from "../arktypeConfig-DdIO8VV1.js";
2
- import { a as ActionInfo, c as DatabaseDefinition, d as InferArgs, f as ParsedDatabaseFile, i as ActionContext, l as DatabaseInfo, n as Action, o as ArgsSchema, r as ActionConfig, s as DatabaseConfig, t as defineDatabase, u as DrizzleToKysely } from "../defineDatabase-CHmTgZTx.js";
3
- import { _ as CreateKyselyOptions, a as QueryResult, c as DrizzleDefaultsPlugin, d as dateSerializers, f as Migration, g as SqliteDurableObject, h as Migrations, i as KyselyPlugin, l as SchemaPlugin, m as MigrationSchemaConflictError, n as CompiledQuery, o as studio, p as MigrationAttemptInfo, r as Kysely, s as DateSerializePlugin, t as CamelCasePlugin, u as createDrizzlePlugins, v as SqlExecutor, y as createKyselyFromSql } from "../index-M4Jp_PFM.js";
1
+ import { t as type } from "../arktypeConfig-AXvobTPL.js";
2
+ import { a as ActionInfo, c as DatabaseDefinition, d as InferArgs, f as ParsedDatabaseFile, i as ActionContext, l as DatabaseInfo, n as Action, o as ArgsSchema, r as ActionConfig, s as DatabaseConfig, t as defineDatabase, u as DrizzleToKysely } from "../defineDatabase-IUthY3Ex.js";
3
+ import { _ as CreateKyselyOptions, a as QueryResult, c as DrizzleDefaultsPlugin, d as dateSerializers, f as Migration, g as SqliteDurableObject, h as Migrations, i as KyselyPlugin, l as SchemaPlugin, m as MigrationSchemaConflictError, n as CompiledQuery, o as studio, p as MigrationAttemptInfo, r as Kysely, s as DateSerializePlugin, t as CamelCasePlugin, u as createDrizzlePlugins, v as SqlExecutor, y as createKyselyFromSql } from "../index-BdrcuAU7.js";
4
4
  export { type Action, type ActionConfig, type ActionContext, type ActionInfo, type ArgsSchema, CamelCasePlugin, type CompiledQuery, type CreateKyselyOptions, type DatabaseConfig, type DatabaseDefinition, type DatabaseInfo, DateSerializePlugin, DrizzleDefaultsPlugin, type DrizzleToKysely, type InferArgs, type Kysely, type KyselyPlugin, type Migration, type MigrationAttemptInfo, MigrationSchemaConflictError, type Migrations, type ParsedDatabaseFile, type QueryResult, SchemaPlugin, type SqlExecutor, SqliteDurableObject, createDrizzlePlugins, createKyselyFromSql, dateSerializers, defineDatabase, studio, type };
@@ -1,4 +1,5 @@
1
- import { n as type } from "./arktypeConfig-DdIO8VV1.js";
1
+ import "./arktypeConfig-AXvobTPL.js";
2
+ import { type } from "arktype";
2
3
  import { SQLiteTableWithColumns } from "drizzle-orm/sqlite-core";
3
4
  import { Kysely } from "kysely";
4
5
  import { Kyselify } from "drizzle-orm/kysely";
@@ -1,10 +1,10 @@
1
- import "./arktypeConfig-DdIO8VV1.js";
2
- import "./defineDatabase-CHmTgZTx.js";
1
+ import "./arktypeConfig-AXvobTPL.js";
2
+ import "./defineDatabase-IUthY3Ex.js";
3
3
  import { SQLiteTableWithColumns } from "drizzle-orm/sqlite-core";
4
- import { DurableObject } from "cloudflare:workers";
5
4
  import { CamelCasePlugin, CamelCasePlugin as CamelCasePlugin$1, CompiledQuery, Kysely, Kysely as Kysely$1, KyselyPlugin, KyselyPlugin as KyselyPlugin$1, PluginTransformQueryArgs, PluginTransformResultArgs, QueryResult, QueryResult as QueryResult$1, RootOperationNode, UnknownRow } from "kysely";
6
- import { Table } from "drizzle-orm";
5
+ import { DurableObject } from "cloudflare:workers";
7
6
  import { studio } from "@outerbase/browsable-durable-object";
7
+ import { Table } from "drizzle-orm";
8
8
  //#region src/db/kysely.d.ts
9
9
  /**
10
10
  * SQL executor function type
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { t as type } from "./arktypeConfig-DdIO8VV1.js";
2
- import { c as DatabaseDefinition, d as InferArgs, i as ActionContext, n as Action, r as ActionConfig, s as DatabaseConfig, t as defineDatabase, u as DrizzleToKysely } from "./defineDatabase-CHmTgZTx.js";
1
+ import { t as type } from "./arktypeConfig-AXvobTPL.js";
2
+ import { c as DatabaseDefinition, d as InferArgs, i as ActionContext, n as Action, r as ActionConfig, s as DatabaseConfig, t as defineDatabase, u as DrizzleToKysely } from "./defineDatabase-IUthY3Ex.js";
3
3
  import { getTenantId, hasTenantId, setTenantIdResolver } from "./context/index.js";
4
4
  import { AnySQLiteColumn, blob, foreignKey, index, integer, numeric, primaryKey, real, table, text, uniqueIndex } from "./schema.js";
5
5
  import { Kysely } from "kysely";
@@ -1,4 +1,4 @@
1
- import { t as type } from "./arktypeConfig-DdIO8VV1.js";
1
+ import { t as type } from "./arktypeConfig-AXvobTPL.js";
2
2
  //#region src/registry.d.ts
3
3
  export interface ActionDefinition {
4
4
  validator: (args: unknown) => unknown;
@@ -1061,7 +1061,10 @@ function durableDb(options = {}) {
1061
1061
  registryImport: state.options.registryImport
1062
1062
  });
1063
1063
  if (result && parsed.actions.length > 0 && state.config.command === "serve") state.invalidateDOModule();
1064
- return result;
1064
+ return result ? {
1065
+ code: result.code,
1066
+ map: result.map
1067
+ } : null;
1065
1068
  }
1066
1069
  const parsed = parseDatabaseFile(cleanId, code, { aliases: state.aliases });
1067
1070
  if (parsed.actions.length === 0) return null;
@@ -1080,7 +1083,10 @@ function durableDb(options = {}) {
1080
1083
  registryImport: state.options.registryImport
1081
1084
  });
1082
1085
  if (result && state.config.command === "serve") state.invalidateDOModule();
1083
- return result;
1086
+ return result ? {
1087
+ code: result.code,
1088
+ map: result.map
1089
+ } : null;
1084
1090
  },
1085
1091
  buildEnd() {
1086
1092
  if (state.actions.size > 0) debugVite("Discovered %d action(s)", state.actions.size);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "durable-db",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/eagerpatch/durable-db.git"
@@ -78,15 +78,15 @@
78
78
  "changeset": "changeset"
79
79
  },
80
80
  "dependencies": {
81
- "@babel/generator": "^7.0.0",
82
- "@babel/parser": "^7.0.0",
83
- "@babel/traverse": "^7.0.0",
84
- "@babel/types": "^7.0.0",
81
+ "@babel/generator": "^8.0.6",
82
+ "@babel/parser": "^8.0.7",
83
+ "@babel/traverse": "^8.0.7",
84
+ "@babel/types": "^8.0.6",
85
85
  "@outerbase/browsable-durable-object": "^0.1.0",
86
86
  "arktype": "^2.2.8",
87
87
  "commander": "^15.0.0",
88
88
  "drizzle-kit": "^0.31.11",
89
- "drizzle-orm": "^0.38.0",
89
+ "drizzle-orm": "^0.45.4",
90
90
  "esbuild": "^0.27.1",
91
91
  "kysely": "^0.29.6",
92
92
  "libsql": "^0.5.0",
@@ -96,21 +96,21 @@
96
96
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
97
97
  },
98
98
  "devDependencies": {
99
- "@babel/generator": "^7.26.0",
100
- "@babel/parser": "^7.26.0",
101
- "@babel/traverse": "^7.26.0",
102
- "@babel/types": "^7.26.0",
99
+ "@babel/generator": "^8.0.6",
100
+ "@babel/parser": "^8.0.7",
101
+ "@babel/traverse": "^8.0.7",
102
+ "@babel/types": "^8.0.6",
103
103
  "@changesets/cli": "^3.0.3",
104
- "@cloudflare/vitest-pool-workers": "^0.23.0",
105
104
  "@cloudflare/workers-types": "^5.20261016.1",
106
105
  "@types/babel__generator": "^7.6.8",
107
106
  "@types/babel__traverse": "^7.20.6",
108
107
  "@types/node": "^26.6.5",
109
- "drizzle-kit": "^0.30.0",
108
+ "drizzle-kit": "^0.31.11",
110
109
  "esbuild": "^0.27.1",
111
110
  "tsdown": "^0.23.1",
112
111
  "typescript": "^7.0.2",
113
112
  "vite": "^8.3.4",
114
- "vitest": "^5.0.5"
113
+ "vitest": "^5.0.5",
114
+ "@cloudflare/vitest-plugin": "^1.4.4"
115
115
  }
116
116
  }