arkormx 1.3.0 → 1.3.2

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.
package/dist/index.mjs CHANGED
@@ -4,13 +4,14 @@ import { spawnSync } from "node:child_process";
4
4
  import { str } from "@h3ravel/support";
5
5
  import path, { dirname as dirname$1, extname as extname$1, join as join$1, relative } from "path";
6
6
  import { copyFileSync, existsSync as existsSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, rmSync as rmSync$1, writeFileSync as writeFileSync$1 } from "fs";
7
- import { fileURLToPath, pathToFileURL } from "url";
8
7
  import { AsyncLocalStorage } from "async_hooks";
8
+ import { createJiti } from "@rexxars/jiti";
9
+ import { pathToFileURL } from "node:url";
9
10
  import { createRequire } from "module";
11
+ import { fileURLToPath } from "url";
10
12
  import { Logger } from "@h3ravel/shared";
11
13
  import { Command } from "@h3ravel/musket";
12
14
  import { createHash } from "node:crypto";
13
- import { pathToFileURL as pathToFileURL$1 } from "node:url";
14
15
  import { Collection } from "@h3ravel/collect.js";
15
16
 
16
17
  //#region src/Attribute.ts
@@ -1525,6 +1526,18 @@ const runMigrationWithPrisma = async (migration, options = {}) => {
1525
1526
  };
1526
1527
  };
1527
1528
 
1529
+ //#endregion
1530
+ //#region src/helpers/runtime-module-loader.ts
1531
+ var RuntimeModuleLoader = class {
1532
+ static async load(filePath) {
1533
+ const resolvedPath = resolve(filePath);
1534
+ return await createJiti(pathToFileURL(resolvedPath).href, {
1535
+ interopDefault: false,
1536
+ tsconfigPaths: true
1537
+ }).import(resolvedPath);
1538
+ }
1539
+ };
1540
+
1528
1541
  //#endregion
1529
1542
  //#region src/Exceptions/UnsupportedAdapterFeatureException.ts
1530
1543
  var UnsupportedAdapterFeatureException = class extends ArkormException {
@@ -1677,7 +1690,7 @@ const resolveAndApplyConfig = (imported) => {
1677
1690
  * @returns A promise that resolves to the imported configuration module.
1678
1691
  */
1679
1692
  const importConfigFile = (configPath) => {
1680
- return import(`${pathToFileURL(configPath).href}?arkorm_runtime=${Date.now()}`);
1693
+ return RuntimeModuleLoader.load(configPath);
1681
1694
  };
1682
1695
  const loadRuntimeConfigSync = () => {
1683
1696
  const require = createRequire(import.meta.url);
@@ -2117,10 +2130,225 @@ var CliApp = class {
2117
2130
  if (value === "String") return "string";
2118
2131
  if (value === "Boolean") return "boolean";
2119
2132
  if (value === "DateTime") return "Date";
2120
- if (value === "Json") return "Record<string, unknown>";
2133
+ if (value === "Json") return "Record<string, unknown> | unknown[]";
2121
2134
  if (value === "Bytes") return "Buffer";
2122
2135
  return "unknown";
2123
2136
  }
2137
+ splitTopLevel(value, delimiter) {
2138
+ const parts = [];
2139
+ let start = 0;
2140
+ let angleDepth = 0;
2141
+ let parenthesisDepth = 0;
2142
+ let quote = null;
2143
+ for (let index = 0; index < value.length; index += 1) {
2144
+ const character = value[index];
2145
+ const previous = index > 0 ? value[index - 1] : "";
2146
+ if (quote) {
2147
+ if (character === quote && previous !== "\\") quote = null;
2148
+ continue;
2149
+ }
2150
+ if (character === "'" || character === "\"") {
2151
+ quote = character;
2152
+ continue;
2153
+ }
2154
+ if (character === "<") {
2155
+ angleDepth += 1;
2156
+ continue;
2157
+ }
2158
+ if (character === ">") {
2159
+ angleDepth = Math.max(0, angleDepth - 1);
2160
+ continue;
2161
+ }
2162
+ if (character === "(") {
2163
+ parenthesisDepth += 1;
2164
+ continue;
2165
+ }
2166
+ if (character === ")") {
2167
+ parenthesisDepth = Math.max(0, parenthesisDepth - 1);
2168
+ continue;
2169
+ }
2170
+ if (character === delimiter && angleDepth === 0 && parenthesisDepth === 0) {
2171
+ parts.push(value.slice(start, index).trim());
2172
+ start = index + 1;
2173
+ }
2174
+ }
2175
+ parts.push(value.slice(start).trim());
2176
+ return parts.filter(Boolean);
2177
+ }
2178
+ hasWrappedParentheses(value) {
2179
+ if (!value.startsWith("(") || !value.endsWith(")")) return false;
2180
+ let depth = 0;
2181
+ let quote = null;
2182
+ for (let index = 0; index < value.length; index += 1) {
2183
+ const character = value[index];
2184
+ const previous = index > 0 ? value[index - 1] : "";
2185
+ if (quote) {
2186
+ if (character === quote && previous !== "\\") quote = null;
2187
+ continue;
2188
+ }
2189
+ if (character === "'" || character === "\"") {
2190
+ quote = character;
2191
+ continue;
2192
+ }
2193
+ if (character === "(") depth += 1;
2194
+ if (character === ")") {
2195
+ depth -= 1;
2196
+ if (depth === 0 && index < value.length - 1) return false;
2197
+ }
2198
+ }
2199
+ return depth === 0;
2200
+ }
2201
+ stripWrappedParentheses(value) {
2202
+ let nextValue = value.trim();
2203
+ while (this.hasWrappedParentheses(nextValue)) nextValue = nextValue.slice(1, -1).trim();
2204
+ return nextValue;
2205
+ }
2206
+ parseDeclarationType(value) {
2207
+ const trimmed = this.stripWrappedParentheses(value.trim());
2208
+ if (!trimmed) return null;
2209
+ const unionParts = this.splitTopLevel(trimmed, "|");
2210
+ if (unionParts.length > 1) {
2211
+ const types = unionParts.map((part) => this.parseDeclarationType(part)).filter((part) => part !== null);
2212
+ if (types.length !== unionParts.length) return null;
2213
+ return {
2214
+ kind: "union",
2215
+ types: types.flatMap((type) => type.kind === "union" ? type.types : [type])
2216
+ };
2217
+ }
2218
+ if (trimmed.endsWith("[]")) {
2219
+ const element = this.parseDeclarationType(trimmed.slice(0, -2));
2220
+ if (!element) return null;
2221
+ return {
2222
+ kind: "array",
2223
+ element
2224
+ };
2225
+ }
2226
+ const arrayMatch = trimmed.match(/^(Array|ReadonlyArray)<([\s\S]+)>$/);
2227
+ if (arrayMatch) {
2228
+ const element = this.parseDeclarationType(arrayMatch[2]);
2229
+ if (!element) return null;
2230
+ return {
2231
+ kind: "array",
2232
+ element
2233
+ };
2234
+ }
2235
+ if (trimmed === "null") return { kind: "null" };
2236
+ if (trimmed.startsWith("'") && trimmed.endsWith("'") || trimmed.startsWith("\"") && trimmed.endsWith("\"")) return {
2237
+ kind: "string-literal",
2238
+ value: trimmed.slice(1, -1)
2239
+ };
2240
+ if (trimmed === "Record<string, unknown>") return {
2241
+ kind: "named",
2242
+ name: trimmed
2243
+ };
2244
+ if (/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(trimmed)) return {
2245
+ kind: "named",
2246
+ name: trimmed
2247
+ };
2248
+ return null;
2249
+ }
2250
+ expandUnion(node) {
2251
+ return node.kind === "union" ? node.types : [node];
2252
+ }
2253
+ isEnumTypeName(value, enums) {
2254
+ return enums.has(value);
2255
+ }
2256
+ isDeclarationNodeAssignable(actual, expected, enums) {
2257
+ if (expected.kind === "named") {
2258
+ if (expected.name === "unknown") return true;
2259
+ if (actual.kind === "named") {
2260
+ if (actual.name === expected.name) return true;
2261
+ if (expected.name === "string" && this.isEnumTypeName(actual.name, enums)) return true;
2262
+ }
2263
+ if (actual.kind === "string-literal") {
2264
+ if (expected.name === "string") return true;
2265
+ if (enums.get(expected.name)?.includes(actual.value)) return true;
2266
+ }
2267
+ return false;
2268
+ }
2269
+ if (expected.kind === "array") return actual.kind === "array" && this.isDeclarationAssignable(actual.element, expected.element, enums);
2270
+ if (expected.kind === "null") return actual.kind === "null";
2271
+ if (expected.kind === "string-literal") return actual.kind === "string-literal" && actual.value === expected.value;
2272
+ return false;
2273
+ }
2274
+ isDeclarationAssignable(actual, expected, enums) {
2275
+ const actualTypes = this.expandUnion(actual);
2276
+ const expectedTypes = this.expandUnion(expected);
2277
+ return actualTypes.every((actualType) => {
2278
+ return expectedTypes.some((expectedType) => {
2279
+ return this.isDeclarationNodeAssignable(actualType, expectedType, enums);
2280
+ });
2281
+ });
2282
+ }
2283
+ isCompatibleDeclarationType(actualType, expectedType, enums) {
2284
+ const actual = this.parseDeclarationType(actualType);
2285
+ const expected = this.parseDeclarationType(expectedType);
2286
+ if (!actual || !expected) return actualType.replace(/\s+/g, " ").trim() === expectedType.replace(/\s+/g, " ").trim();
2287
+ return this.isDeclarationAssignable(actual, expected, enums);
2288
+ }
2289
+ collectEnumReferencesFromNode(node, enums, collected) {
2290
+ if (node.kind === "named" && enums.has(node.name)) {
2291
+ collected.add(node.name);
2292
+ return;
2293
+ }
2294
+ if (node.kind === "array") {
2295
+ this.collectEnumReferencesFromNode(node.element, enums, collected);
2296
+ return;
2297
+ }
2298
+ if (node.kind === "union") node.types.forEach((type) => this.collectEnumReferencesFromNode(type, enums, collected));
2299
+ }
2300
+ collectEnumReferences(type, enums) {
2301
+ const parsed = this.parseDeclarationType(type);
2302
+ if (!parsed) return [];
2303
+ const collected = /* @__PURE__ */ new Set();
2304
+ this.collectEnumReferencesFromNode(parsed, enums, collected);
2305
+ return [...collected].sort((left, right) => left.localeCompare(right));
2306
+ }
2307
+ syncPrismaEnumImports(modelSource, enumTypes) {
2308
+ if (enumTypes.length === 0) return modelSource;
2309
+ const importRegex = /^import\s+type\s+\{([^}]+)\}\s+from\s+['"]@prisma\/client['"]\s*;?$/m;
2310
+ const existingImport = modelSource.match(importRegex);
2311
+ if (existingImport) {
2312
+ const existingTypes = existingImport[1].split(",").map((value) => value.trim()).filter(Boolean);
2313
+ const mergedTypes = [...new Set([...existingTypes, ...enumTypes])].sort((left, right) => left.localeCompare(right));
2314
+ return modelSource.replace(importRegex, `import type { ${mergedTypes.join(", ")} } from '@prisma/client'`);
2315
+ }
2316
+ const lines = modelSource.split("\n");
2317
+ let insertionIndex = 0;
2318
+ while (insertionIndex < lines.length && lines[insertionIndex].trim().startsWith("import ")) insertionIndex += 1;
2319
+ lines.splice(insertionIndex, 0, `import type { ${enumTypes.join(", ")} } from '@prisma/client'`);
2320
+ return lines.join("\n");
2321
+ }
2322
+ /**
2323
+ * Parse Prisma enum definitions from a schema and return their member names.
2324
+ *
2325
+ * @param schema The Prisma schema source.
2326
+ * @returns A map of enum names to their declared member names.
2327
+ */
2328
+ parsePrismaEnums(schema) {
2329
+ const enums = /* @__PURE__ */ new Map();
2330
+ for (const match of schema.matchAll(PRISMA_ENUM_REGEX)) {
2331
+ const enumName = match[1];
2332
+ const values = match[0].split("\n").slice(1, -1).map((line) => line.trim()).filter((line) => Boolean(line) && !line.startsWith("//")).map((line) => {
2333
+ return line.match(/^([A-Za-z][A-Za-z0-9_]*)\b/)?.[1];
2334
+ }).filter((value) => Boolean(value));
2335
+ enums.set(enumName, values);
2336
+ }
2337
+ return enums;
2338
+ }
2339
+ /**
2340
+ * Resolve the generated TypeScript declaration type for a Prisma field.
2341
+ *
2342
+ * @param fieldType The Prisma field type token.
2343
+ * @param isList Whether the field is declared as a Prisma list.
2344
+ * @param enums Known Prisma enum definitions.
2345
+ * @returns The declaration type to emit, or null when unsupported.
2346
+ */
2347
+ prismaFieldTypeToTs(fieldType, isList, enums) {
2348
+ const baseType = enums.has(fieldType) ? fieldType : this.prismaTypeToTs(fieldType);
2349
+ if (baseType === "unknown" && !enums.has(fieldType)) return null;
2350
+ return isList ? `Array<${baseType}>` : baseType;
2351
+ }
2124
2352
  /**
2125
2353
  * Parse the Prisma schema to extract model definitions and their fields, focusing
2126
2354
  * on scalar types.
@@ -2130,6 +2358,7 @@ var CliApp = class {
2130
2358
  */
2131
2359
  parsePrismaModels(schema) {
2132
2360
  const models = [];
2361
+ const enumDefinitions = this.parsePrismaEnums(schema);
2133
2362
  const modelRegex = /model\s+(\w+)\s*\{([\s\S]*?)\n\}/g;
2134
2363
  const scalarTypes = new Set([
2135
2364
  "Int",
@@ -2150,14 +2379,16 @@ var CliApp = class {
2150
2379
  body.split("\n").forEach((rawLine) => {
2151
2380
  const line = rawLine.trim();
2152
2381
  if (!line || line.startsWith("@@") || line.startsWith("//")) return;
2153
- const fieldMatch = line.match(/^(\w+)\s+([A-Za-z]+)(\?)?(?:\s|$)/);
2382
+ const fieldMatch = line.match(/^(\w+)\s+([A-Za-z][A-Za-z0-9_]*)(\[\])?(\?)?(?:\s|$)/);
2154
2383
  if (!fieldMatch) return;
2155
2384
  const fieldType = fieldMatch[2];
2156
- if (!scalarTypes.has(fieldType)) return;
2385
+ if (!scalarTypes.has(fieldType) && !enumDefinitions.has(fieldType)) return;
2386
+ const declarationType = this.prismaFieldTypeToTs(fieldType, Boolean(fieldMatch[3]), enumDefinitions);
2387
+ if (!declarationType) return;
2157
2388
  fields.push({
2158
2389
  name: fieldMatch[1],
2159
- type: this.prismaTypeToTs(fieldType),
2160
- nullable: Boolean(fieldMatch[3])
2390
+ type: declarationType,
2391
+ nullable: Boolean(fieldMatch[4])
2161
2392
  });
2162
2393
  });
2163
2394
  models.push({
@@ -2178,7 +2409,7 @@ var CliApp = class {
2178
2409
  * @param declarations A list of attribute declarations to sync.
2179
2410
  * @returns An object containing the updated content and a flag indicating if it was updated.
2180
2411
  */
2181
- syncModelDeclarations(modelSource, declarations) {
2412
+ syncModelDeclarations(modelSource, declarations, enums) {
2182
2413
  const lines = modelSource.split("\n");
2183
2414
  const classIndex = lines.findIndex((line) => /export\s+class\s+\w+\s+extends\s+Model<.+>\s*\{/.test(line));
2184
2415
  if (classIndex < 0) return {
@@ -2200,16 +2431,38 @@ var CliApp = class {
2200
2431
  content: modelSource,
2201
2432
  updated: false
2202
2433
  };
2203
- const withoutDeclares = lines.slice(classIndex + 1, classEndIndex).filter((line) => !/^\s*declare\s+\w+\??:\s*[^\n]+$/.test(line));
2204
- const rebuiltClass = [...declarations.map((declaration) => ` ${declaration}`), ...withoutDeclares];
2434
+ const withinClass = lines.slice(classIndex + 1, classEndIndex);
2435
+ const existingDeclarations = /* @__PURE__ */ new Map();
2436
+ withinClass.forEach((line) => {
2437
+ const declarationMatch = line.match(/^\s*declare\s+(\w+)\??:\s*([^;\n]+);?\s*$/);
2438
+ if (!declarationMatch) return;
2439
+ existingDeclarations.set(declarationMatch[1], {
2440
+ name: declarationMatch[1],
2441
+ raw: line.trim(),
2442
+ type: declarationMatch[2].trim()
2443
+ });
2444
+ });
2445
+ const withoutDeclares = withinClass.filter((line) => !/^\s*declare\s+\w+\??:\s*[^\n]+$/.test(line));
2446
+ const chosenDeclarations = declarations.map((declaration) => {
2447
+ const expectedType = `${declaration.type}${declaration.nullable ? " | null" : ""}`;
2448
+ const existingDeclaration = existingDeclarations.get(declaration.name);
2449
+ if (existingDeclaration && this.isCompatibleDeclarationType(existingDeclaration.type, expectedType, enums)) return existingDeclaration.raw;
2450
+ return `declare ${declaration.name}: ${expectedType}`;
2451
+ });
2452
+ const rebuiltClass = [...chosenDeclarations.map((declaration) => ` ${declaration}`), ...withoutDeclares];
2205
2453
  const content = [
2206
2454
  ...lines.slice(0, classIndex + 1),
2207
2455
  ...rebuiltClass,
2208
2456
  ...lines.slice(classEndIndex)
2209
2457
  ].join("\n");
2458
+ const enumImports = [...new Set(chosenDeclarations.flatMap((declaration) => {
2459
+ const type = declaration.replace(/^declare\s+\w+\??:\s*/, "").replace(/;$/, "").trim();
2460
+ return this.collectEnumReferences(type, enums);
2461
+ }))].sort((left, right) => left.localeCompare(right));
2462
+ const contentWithImports = this.syncPrismaEnumImports(content, enumImports);
2210
2463
  return {
2211
- content,
2212
- updated: content !== modelSource
2464
+ content: contentWithImports,
2465
+ updated: contentWithImports !== modelSource
2213
2466
  };
2214
2467
  }
2215
2468
  /**
@@ -2229,6 +2482,7 @@ var CliApp = class {
2229
2482
  if (!existsSync$1(schemaPath)) throw new Error(`Prisma schema file not found: ${schemaPath}`);
2230
2483
  if (!existsSync$1(modelsDir)) throw new Error(`Models directory not found: ${modelsDir}`);
2231
2484
  const schema = readFileSync$1(schemaPath, "utf-8");
2485
+ const prismaEnums = this.parsePrismaEnums(schema);
2232
2486
  const prismaModels = this.parsePrismaModels(schema);
2233
2487
  const modelFiles = readdirSync$1(modelsDir).filter((file) => file.endsWith(".ts"));
2234
2488
  const updated = [];
@@ -2248,8 +2502,7 @@ var CliApp = class {
2248
2502
  skipped.push(filePath);
2249
2503
  return;
2250
2504
  }
2251
- const declarations = prismaModel.fields.map((field) => `declare ${field.name}: ${field.type}${field.nullable ? " | null" : ""}`);
2252
- const synced = this.syncModelDeclarations(source, declarations);
2505
+ const synced = this.syncModelDeclarations(source, prismaModel.fields, prismaEnums);
2253
2506
  if (!synced.updated) {
2254
2507
  skipped.push(filePath);
2255
2508
  return;
@@ -2671,7 +2924,7 @@ var MigrateCommand = class extends Command {
2671
2924
  * @returns
2672
2925
  */
2673
2926
  async loadMigrationClassesFromFile(filePath) {
2674
- const imported = await import(`${pathToFileURL$1(resolve(filePath)).href}?arkorm_migrate=${Date.now()}`);
2927
+ const imported = await RuntimeModuleLoader.load(filePath);
2675
2928
  return Object.values(imported).filter((value) => {
2676
2929
  if (typeof value !== "function") return false;
2677
2930
  const candidate = value;
@@ -2756,7 +3009,7 @@ var MigrateRollbackCommand = class extends Command {
2756
3009
  return (await Promise.all(files.map(async (file) => (await this.loadMigrationClassesFromFile(file)).map((cls) => [cls, file])))).flat();
2757
3010
  }
2758
3011
  async loadMigrationClassesFromFile(filePath) {
2759
- const imported = await import(`${pathToFileURL$1(resolve(filePath)).href}?arkorm_rollback=${Date.now()}`);
3012
+ const imported = await RuntimeModuleLoader.load(filePath);
2760
3013
  return Object.values(imported).filter((value) => {
2761
3014
  if (typeof value !== "function") return false;
2762
3015
  const candidate = value;
@@ -2966,7 +3219,7 @@ var SeedCommand = class extends Command {
2966
3219
  * @returns An array of seeder classes.
2967
3220
  */
2968
3221
  async loadSeederClassesFromFile(filePath) {
2969
- const imported = await import(`${pathToFileURL$1(resolve(filePath)).href}?arkorm_seed=${Date.now()}`);
3222
+ const imported = await RuntimeModuleLoader.load(filePath);
2970
3223
  return Object.values(imported).filter((value) => {
2971
3224
  if (typeof value !== "function") return false;
2972
3225
  const candidate = value;
@@ -6505,4 +6758,4 @@ var Model = class Model {
6505
6758
  };
6506
6759
 
6507
6760
  //#endregion
6508
- export { ArkormCollection, ArkormException, Attribute, CliApp, EnumBuilder, ForeignKeyBuilder, InitCommand, InlineFactory, LengthAwarePaginator, MIGRATION_BRAND, MakeFactoryCommand, MakeMigrationCommand, MakeModelCommand, MakeSeederCommand, MigrateCommand, MigrateRollbackCommand, Migration, MigrationHistoryCommand, MissingDelegateException, Model, ModelFactory, ModelNotFoundException, ModelsSyncCommand, PRISMA_ENUM_MEMBER_REGEX, PRISMA_ENUM_REGEX, PRISMA_MODEL_REGEX, Paginator, QueryBuilder, QueryConstraintException, RelationResolutionException, SEEDER_BRAND, SchemaBuilder, ScopeNotDefinedException, SeedCommand, Seeder, TableBuilder, URLDriver, UniqueConstraintResolutionException, UnsupportedAdapterFeatureException, applyAlterTableOperation, applyCreateTableOperation, applyDropTableOperation, applyMigrationRollbackToPrismaSchema, applyMigrationToPrismaSchema, applyOperationsToPrismaSchema, buildEnumBlock, buildFieldLine, buildIndexLine, buildInverseRelationLine, buildMigrationIdentity, buildMigrationRunId, buildMigrationSource, buildModelBlock, buildRelationLine, computeMigrationChecksum, configureArkormRuntime, createMigrationTimestamp, createPrismaAdapter, createPrismaDelegateMap, defineConfig, defineFactory, deriveCollectionFieldName, deriveInverseRelationAlias, deriveRelationAlias, deriveRelationFieldName, deriveSingularFieldName, ensureArkormConfigLoading, escapeRegex, findAppliedMigration, findEnumBlock, findModelBlock, formatDefaultValue, formatEnumDefaultValue, formatRelationAction, generateMigrationFile, getActiveTransactionClient, getDefaultStubsPath, getLastMigrationRun, getLatestAppliedMigrations, getMigrationPlan, getRuntimePaginationCurrentPageResolver, getRuntimePaginationURLDriverFactory, getRuntimePrismaClient, getUserConfig, inferDelegateName, isDelegateLike, isMigrationApplied, isTransactionCapableClient, loadArkormConfig, markMigrationApplied, markMigrationRun, pad, readAppliedMigrationsState, removeAppliedMigration, resetArkormRuntimeForTests, resolveCast, resolveEnumName, resolveMigrationClassName, resolveMigrationStateFilePath, resolvePrismaType, runArkormTransaction, runMigrationWithPrisma, runPrismaCommand, toMigrationFileSlug, toModelName, writeAppliedMigrationsState };
6761
+ export { ArkormCollection, ArkormException, Attribute, CliApp, EnumBuilder, ForeignKeyBuilder, InitCommand, InlineFactory, LengthAwarePaginator, MIGRATION_BRAND, MakeFactoryCommand, MakeMigrationCommand, MakeModelCommand, MakeSeederCommand, MigrateCommand, MigrateRollbackCommand, Migration, MigrationHistoryCommand, MissingDelegateException, Model, ModelFactory, ModelNotFoundException, ModelsSyncCommand, PRISMA_ENUM_MEMBER_REGEX, PRISMA_ENUM_REGEX, PRISMA_MODEL_REGEX, Paginator, QueryBuilder, QueryConstraintException, RelationResolutionException, RuntimeModuleLoader, SEEDER_BRAND, SchemaBuilder, ScopeNotDefinedException, SeedCommand, Seeder, TableBuilder, URLDriver, UniqueConstraintResolutionException, UnsupportedAdapterFeatureException, applyAlterTableOperation, applyCreateTableOperation, applyDropTableOperation, applyMigrationRollbackToPrismaSchema, applyMigrationToPrismaSchema, applyOperationsToPrismaSchema, buildEnumBlock, buildFieldLine, buildIndexLine, buildInverseRelationLine, buildMigrationIdentity, buildMigrationRunId, buildMigrationSource, buildModelBlock, buildRelationLine, computeMigrationChecksum, configureArkormRuntime, createMigrationTimestamp, createPrismaAdapter, createPrismaDelegateMap, defineConfig, defineFactory, deriveCollectionFieldName, deriveInverseRelationAlias, deriveRelationAlias, deriveRelationFieldName, deriveSingularFieldName, ensureArkormConfigLoading, escapeRegex, findAppliedMigration, findEnumBlock, findModelBlock, formatDefaultValue, formatEnumDefaultValue, formatRelationAction, generateMigrationFile, getActiveTransactionClient, getDefaultStubsPath, getLastMigrationRun, getLatestAppliedMigrations, getMigrationPlan, getRuntimePaginationCurrentPageResolver, getRuntimePaginationURLDriverFactory, getRuntimePrismaClient, getUserConfig, inferDelegateName, isDelegateLike, isMigrationApplied, isTransactionCapableClient, loadArkormConfig, markMigrationApplied, markMigrationRun, pad, readAppliedMigrationsState, removeAppliedMigration, resetArkormRuntimeForTests, resolveCast, resolveEnumName, resolveMigrationClassName, resolveMigrationStateFilePath, resolvePrismaType, runArkormTransaction, runMigrationWithPrisma, runPrismaCommand, toMigrationFileSlug, toModelName, writeAppliedMigrationsState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkormx",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Modern TypeScript-first ORM for Node.js.",
5
5
  "keywords": [
6
6
  "orm",
@@ -48,21 +48,21 @@
48
48
  "devDependencies": {
49
49
  "@eslint/js": "^10.0.1",
50
50
  "@eslint/markdown": "^7.5.1",
51
- "@prisma/adapter-pg": "^7.4.2",
51
+ "@prisma/adapter-pg": "^7.6.0",
52
52
  "@types/express": "^4.17.21",
53
53
  "@types/node": "^20.10.6",
54
- "@vitest/coverage-v8": "4.0.18",
54
+ "@vitest/coverage-v8": "4.1.2",
55
55
  "barrelize": "^1.7.3",
56
56
  "eslint": "^10.0.0",
57
57
  "pg": "^8.19.0",
58
- "prisma": "^7.4.2",
58
+ "prisma": "^7.6.0",
59
59
  "tsdown": "^0.20.3",
60
60
  "tsx": "^4.21.0",
61
61
  "typescript": "^5.3.3",
62
62
  "typescript-eslint": "^8.56.0",
63
- "vite-tsconfig-paths": "^6.1.1",
64
63
  "vitepress": "2.0.0-alpha.16",
65
- "vitest": "^4.0.18"
64
+ "vite-tsconfig-paths": "^6.1.1",
65
+ "vitest": "^4.1.2"
66
66
  },
67
67
  "engines": {
68
68
  "node": ">=20.0.0"
@@ -72,10 +72,11 @@
72
72
  "@h3ravel/musket": "^0.10.1",
73
73
  "@h3ravel/shared": "^0.27.13",
74
74
  "@h3ravel/support": "^0.15.11",
75
+ "@rexxars/jiti": "^2.6.1",
75
76
  "dotenv": "^17.3.1"
76
77
  },
77
78
  "peerDependencies": {
78
- "@prisma/client": "^7.4.2"
79
+ "@prisma/client": "^7.6.0"
79
80
  },
80
81
  "scripts": {
81
82
  "cmd": "tsx src/cli/index.ts",