@prisma/client-generator-js 6.19.0-integration-next.2 → 6.19.0-integration-next.4
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.
|
@@ -4,7 +4,7 @@ import { DMMFHelper } from '../dmmf';
|
|
|
4
4
|
import { GenerateClientOptions } from '../generateClient';
|
|
5
5
|
import { GenericArgsInfo } from '../GenericsArgsInfo';
|
|
6
6
|
import { type Generable } from './Generable';
|
|
7
|
-
type RuntimeName = 'binary' | 'library' | 'wasm-
|
|
7
|
+
type RuntimeName = 'binary' | 'library' | 'wasm-compiler-edge' | 'edge-esm' | 'index-browser' | 'react-native' | 'client' | (string & {});
|
|
8
8
|
export type TSClientOptions = O.Required<GenerateClientOptions, 'runtimeBase'> & {
|
|
9
9
|
/** More granular way to define JS runtime name */
|
|
10
10
|
runtimeNameJs: RuntimeName;
|
package/dist/index.js
CHANGED
|
@@ -2767,7 +2767,7 @@ function getMappings(mappings, datamodel) {
|
|
|
2767
2767
|
var import_debug = require("@prisma/debug");
|
|
2768
2768
|
var import_fetch_engine = require("@prisma/fetch-engine");
|
|
2769
2769
|
var import_internals10 = require("@prisma/internals");
|
|
2770
|
-
var
|
|
2770
|
+
var import_crypto = require("crypto");
|
|
2771
2771
|
var import_env_paths = __toESM(require("env-paths"));
|
|
2772
2772
|
var import_fs = require("fs");
|
|
2773
2773
|
var import_promises = __toESM(require("fs/promises"));
|
|
@@ -2882,12 +2882,6 @@ var package_default = {
|
|
|
2882
2882
|
},
|
|
2883
2883
|
default: "./default.js"
|
|
2884
2884
|
},
|
|
2885
|
-
"./edge": {
|
|
2886
|
-
types: "./edge.d.ts",
|
|
2887
|
-
require: "./edge.js",
|
|
2888
|
-
import: "./edge.js",
|
|
2889
|
-
default: "./edge.js"
|
|
2890
|
-
},
|
|
2891
2885
|
"./react-native": {
|
|
2892
2886
|
types: "./react-native.d.ts",
|
|
2893
2887
|
require: "./react-native.js",
|
|
@@ -2940,24 +2934,12 @@ var package_default = {
|
|
|
2940
2934
|
import: "./runtime/binary.mjs",
|
|
2941
2935
|
default: "./runtime/binary.mjs"
|
|
2942
2936
|
},
|
|
2943
|
-
"./runtime/wasm-engine-edge": {
|
|
2944
|
-
types: "./runtime/wasm-engine-edge.d.ts",
|
|
2945
|
-
require: "./runtime/wasm-engine-edge.js",
|
|
2946
|
-
import: "./runtime/wasm-engine-edge.mjs",
|
|
2947
|
-
default: "./runtime/wasm-engine-edge.mjs"
|
|
2948
|
-
},
|
|
2949
2937
|
"./runtime/wasm-compiler-edge": {
|
|
2950
2938
|
types: "./runtime/wasm-compiler-edge.d.ts",
|
|
2951
2939
|
require: "./runtime/wasm-compiler-edge.js",
|
|
2952
2940
|
import: "./runtime/wasm-compiler-edge.mjs",
|
|
2953
2941
|
default: "./runtime/wasm-compiler-edge.mjs"
|
|
2954
2942
|
},
|
|
2955
|
-
"./runtime/edge": {
|
|
2956
|
-
types: "./runtime/edge.d.ts",
|
|
2957
|
-
require: "./runtime/edge.js",
|
|
2958
|
-
import: "./runtime/edge-esm.js",
|
|
2959
|
-
default: "./runtime/edge-esm.js"
|
|
2960
|
-
},
|
|
2961
2943
|
"./runtime/react-native": {
|
|
2962
2944
|
types: "./runtime/react-native.d.ts",
|
|
2963
2945
|
require: "./runtime/react-native.js",
|
|
@@ -3023,8 +3005,6 @@ var package_default = {
|
|
|
3023
3005
|
"runtime",
|
|
3024
3006
|
"scripts",
|
|
3025
3007
|
"generator-build",
|
|
3026
|
-
"edge.js",
|
|
3027
|
-
"edge.d.ts",
|
|
3028
3008
|
"wasm.js",
|
|
3029
3009
|
"wasm.d.ts",
|
|
3030
3010
|
"index.js",
|
|
@@ -4928,7 +4908,6 @@ var import_dmmf = require("@prisma/dmmf");
|
|
|
4928
4908
|
var import_internals7 = require("@prisma/internals");
|
|
4929
4909
|
var ts12 = __toESM(require("@prisma/ts-builders"));
|
|
4930
4910
|
var import_ci_info = __toESM(require("ci-info"));
|
|
4931
|
-
var import_crypto = __toESM(require("crypto"));
|
|
4932
4911
|
var import_indent_string8 = __toESM(require("indent-string"));
|
|
4933
4912
|
var import_path2 = __toESM(require("path"));
|
|
4934
4913
|
|
|
@@ -5205,7 +5184,7 @@ var import_client_common12 = require("@prisma/client-common");
|
|
|
5205
5184
|
function buildRuntimeDataModel(datamodel, runtimeNameJs) {
|
|
5206
5185
|
const runtimeDataModel = (0, import_client_common12.dmmfToRuntimeDataModel)(datamodel);
|
|
5207
5186
|
let prunedDataModel;
|
|
5208
|
-
if (runtimeNameJs === "wasm-
|
|
5187
|
+
if (runtimeNameJs === "wasm-compiler-edge" || runtimeNameJs === "client") {
|
|
5209
5188
|
prunedDataModel = (0, import_client_common12.pruneRuntimeDataModel)(runtimeDataModel);
|
|
5210
5189
|
} else {
|
|
5211
5190
|
prunedDataModel = runtimeDataModel;
|
|
@@ -5255,16 +5234,6 @@ function buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs) {
|
|
|
5255
5234
|
}
|
|
5256
5235
|
}`;
|
|
5257
5236
|
}
|
|
5258
|
-
if (copyEngine && wasm === true && runtimeNameJs === "wasm-engine-edge") {
|
|
5259
|
-
return `config.engineWasm = {
|
|
5260
|
-
getRuntime: async () => require('./query_engine_bg.js'),
|
|
5261
|
-
getQueryEngineWasmModule: async () => {
|
|
5262
|
-
const loader = (await import('#wasm-engine-loader')).default
|
|
5263
|
-
const engine = (await loader).default
|
|
5264
|
-
return engine
|
|
5265
|
-
}
|
|
5266
|
-
}`;
|
|
5267
|
-
}
|
|
5268
5237
|
return `config.engineWasm = undefined`;
|
|
5269
5238
|
}
|
|
5270
5239
|
|
|
@@ -6607,7 +6576,6 @@ var TSClient = class {
|
|
|
6607
6576
|
const clientEngineType = (0, import_internals7.getClientEngineType)(generator);
|
|
6608
6577
|
generator.config.engineType = clientEngineType;
|
|
6609
6578
|
const binaryTargets = clientEngineType === import_internals7.ClientEngineType.Library ? Object.keys(binaryPaths.libqueryEngine ?? {}) : Object.keys(binaryPaths.queryEngine ?? {});
|
|
6610
|
-
const inlineSchemaHash = import_crypto.default.createHash("sha256").update(Buffer.from(inlineSchema, "utf8").toString("base64")).digest("hex");
|
|
6611
6579
|
const datasourceFilePath = datasources[0].sourceFilePath;
|
|
6612
6580
|
const config = {
|
|
6613
6581
|
generator,
|
|
@@ -6621,7 +6589,6 @@ var TSClient = class {
|
|
|
6621
6589
|
ciName: import_ci_info.default.name ?? void 0,
|
|
6622
6590
|
inlineDatasources: buildInlineDatasources(datasources),
|
|
6623
6591
|
inlineSchema,
|
|
6624
|
-
inlineSchemaHash,
|
|
6625
6592
|
copyEngine
|
|
6626
6593
|
};
|
|
6627
6594
|
const relativeOutdir = import_path2.default.relative(process.cwd(), outputDir);
|
|
@@ -7149,6 +7116,7 @@ function buildTypedSql({
|
|
|
7149
7116
|
var generatedCodePreamble = `
|
|
7150
7117
|
/* !!! This is code generated by Prisma. Do not edit directly. !!!
|
|
7151
7118
|
/* eslint-disable */
|
|
7119
|
+
// biome-ignore-all lint: generated file
|
|
7152
7120
|
`;
|
|
7153
7121
|
function addPreambleToJSFiles(fileMap) {
|
|
7154
7122
|
for (const [key, value] of Object.entries(fileMap)) {
|
|
@@ -7222,13 +7190,6 @@ async function buildClient({
|
|
|
7222
7190
|
reusedTs: "index",
|
|
7223
7191
|
reusedJs: "."
|
|
7224
7192
|
});
|
|
7225
|
-
const edgeClient = new TSClient({
|
|
7226
|
-
...baseClientOptions,
|
|
7227
|
-
runtimeNameJs: "edge",
|
|
7228
|
-
runtimeNameTs: "library.js",
|
|
7229
|
-
reusedTs: "default",
|
|
7230
|
-
edge: true
|
|
7231
|
-
});
|
|
7232
7193
|
const rnTsClient = new TSClient({
|
|
7233
7194
|
...baseClientOptions,
|
|
7234
7195
|
runtimeNameJs: "react-native",
|
|
@@ -7279,28 +7240,20 @@ async function buildClient({
|
|
|
7279
7240
|
fileMap["default.js"] = JS(defaultClient);
|
|
7280
7241
|
fileMap["default.d.ts"] = TS(defaultClient);
|
|
7281
7242
|
fileMap["index-browser.js"] = BrowserJS(nodeClient);
|
|
7282
|
-
fileMap["edge.js"] = JS(edgeClient);
|
|
7283
|
-
fileMap["edge.d.ts"] = TS(edgeClient);
|
|
7284
7243
|
fileMap["client.js"] = JS(defaultClient);
|
|
7285
7244
|
fileMap["client.d.ts"] = TS(defaultClient);
|
|
7286
7245
|
if (generator.previewFeatures.includes("reactNative")) {
|
|
7287
7246
|
fileMap["react-native.js"] = JS(rnTsClient);
|
|
7288
7247
|
fileMap["react-native.d.ts"] = TS(rnTsClient);
|
|
7289
7248
|
}
|
|
7290
|
-
const usesClientEngine = clientEngineType === import_internals10.ClientEngineType.Client;
|
|
7291
7249
|
fileMap["default.js"] = JS(trampolineTsClient);
|
|
7292
7250
|
fileMap["default.d.ts"] = TS(trampolineTsClient);
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_compiler_bg.wasm?module')`;
|
|
7296
|
-
} else {
|
|
7297
|
-
fileMap["wasm-worker-loader.mjs"] = `export default import('./query_engine_bg.wasm')`;
|
|
7298
|
-
fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_engine_bg.wasm?module')`;
|
|
7299
|
-
}
|
|
7251
|
+
fileMap["wasm-worker-loader.mjs"] = `export default import('./query_compiler_bg.wasm')`;
|
|
7252
|
+
fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_compiler_bg.wasm?module')`;
|
|
7300
7253
|
pkgJson["browser"] = "default.js";
|
|
7301
7254
|
pkgJson["imports"] = {
|
|
7302
|
-
// when `import('#wasm-
|
|
7303
|
-
|
|
7255
|
+
// when `import('#wasm-compiler-loader')` is called, it will be resolved to the correct file
|
|
7256
|
+
"#wasm-compiler-loader": {
|
|
7304
7257
|
// Keys reference: https://runtime-keys.proposal.wintercg.org/#keys
|
|
7305
7258
|
/**
|
|
7306
7259
|
* Vercel Edge Functions / Next.js Middlewares
|
|
@@ -7325,7 +7278,7 @@ async function buildClient({
|
|
|
7325
7278
|
};
|
|
7326
7279
|
const wasmClient = new TSClient({
|
|
7327
7280
|
...baseClientOptions,
|
|
7328
|
-
runtimeNameJs:
|
|
7281
|
+
runtimeNameJs: "wasm-compiler-edge",
|
|
7329
7282
|
runtimeNameTs: "library.js",
|
|
7330
7283
|
reusedTs: "default",
|
|
7331
7284
|
edge: true,
|
|
@@ -7334,7 +7287,7 @@ async function buildClient({
|
|
|
7334
7287
|
fileMap["wasm.js"] = JS(wasmClient);
|
|
7335
7288
|
fileMap["wasm.d.ts"] = TS(wasmClient);
|
|
7336
7289
|
if (typedSql && typedSql.length > 0) {
|
|
7337
|
-
const edgeRuntimeName =
|
|
7290
|
+
const edgeRuntimeName = "wasm-compiler-edge";
|
|
7338
7291
|
const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`;
|
|
7339
7292
|
const esmEdgeIndex = `./sql/index.${edgeRuntimeName}.mjs`;
|
|
7340
7293
|
pkgJson.exports["./sql"] = {
|
|
@@ -7488,7 +7441,7 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
|
|
|
7488
7441
|
const runtimeNeedsWasmEngine = clientEngineType === import_internals10.ClientEngineType.Client || copyEngine;
|
|
7489
7442
|
if (runtimeNeedsWasmEngine && isWasmEngineSupported(provider) && !testMode) {
|
|
7490
7443
|
const suffix = provider === "postgres" ? "postgresql" : provider;
|
|
7491
|
-
const filename =
|
|
7444
|
+
const filename = "query_compiler_bg";
|
|
7492
7445
|
const wasmJsBundlePath = import_path3.default.join(runtimeSourcePath, `${filename}.${suffix}.wasm-base64.js`);
|
|
7493
7446
|
const wasmBase64 = require(wasmJsBundlePath).wasm;
|
|
7494
7447
|
await import_promises.default.writeFile(import_path3.default.join(outputDir, `${filename}.wasm`), Buffer.from(wasmBase64, "base64"));
|
|
@@ -7689,10 +7642,7 @@ async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
|
|
|
7689
7642
|
"library.d.ts",
|
|
7690
7643
|
"index-browser.js",
|
|
7691
7644
|
"index-browser.d.ts",
|
|
7692
|
-
"edge.js",
|
|
7693
|
-
"edge-esm.js",
|
|
7694
7645
|
"react-native.js",
|
|
7695
|
-
"wasm-engine-edge.js",
|
|
7696
7646
|
"wasm-compiler-edge.js"
|
|
7697
7647
|
];
|
|
7698
7648
|
files.push(`${runtimeName}.js`);
|
|
@@ -7728,7 +7678,7 @@ async function deleteOutputDir(outputDir) {
|
|
|
7728
7678
|
}
|
|
7729
7679
|
}
|
|
7730
7680
|
function getUniquePackageName(datamodel) {
|
|
7731
|
-
const hash = (0,
|
|
7681
|
+
const hash = (0, import_crypto.createHash)("sha256");
|
|
7732
7682
|
hash.write(datamodel);
|
|
7733
7683
|
return `${GENERATED_PACKAGE_NAME_PREFIX}${hash.digest().toString("hex")}`;
|
|
7734
7684
|
}
|
|
@@ -7742,7 +7692,7 @@ var import_internals12 = require("@prisma/internals");
|
|
|
7742
7692
|
var import_ts_pattern = require("ts-pattern");
|
|
7743
7693
|
|
|
7744
7694
|
// package.json
|
|
7745
|
-
var version = "6.19.0-integration-next.
|
|
7695
|
+
var version = "6.19.0-integration-next.4";
|
|
7746
7696
|
|
|
7747
7697
|
// src/resolvePrismaClient.ts
|
|
7748
7698
|
var import_promises3 = __toESM(require("node:fs/promises"));
|
package/dist/index.mjs
CHANGED
|
@@ -2877,12 +2877,6 @@ var package_default = {
|
|
|
2877
2877
|
},
|
|
2878
2878
|
default: "./default.js"
|
|
2879
2879
|
},
|
|
2880
|
-
"./edge": {
|
|
2881
|
-
types: "./edge.d.ts",
|
|
2882
|
-
require: "./edge.js",
|
|
2883
|
-
import: "./edge.js",
|
|
2884
|
-
default: "./edge.js"
|
|
2885
|
-
},
|
|
2886
2880
|
"./react-native": {
|
|
2887
2881
|
types: "./react-native.d.ts",
|
|
2888
2882
|
require: "./react-native.js",
|
|
@@ -2935,24 +2929,12 @@ var package_default = {
|
|
|
2935
2929
|
import: "./runtime/binary.mjs",
|
|
2936
2930
|
default: "./runtime/binary.mjs"
|
|
2937
2931
|
},
|
|
2938
|
-
"./runtime/wasm-engine-edge": {
|
|
2939
|
-
types: "./runtime/wasm-engine-edge.d.ts",
|
|
2940
|
-
require: "./runtime/wasm-engine-edge.js",
|
|
2941
|
-
import: "./runtime/wasm-engine-edge.mjs",
|
|
2942
|
-
default: "./runtime/wasm-engine-edge.mjs"
|
|
2943
|
-
},
|
|
2944
2932
|
"./runtime/wasm-compiler-edge": {
|
|
2945
2933
|
types: "./runtime/wasm-compiler-edge.d.ts",
|
|
2946
2934
|
require: "./runtime/wasm-compiler-edge.js",
|
|
2947
2935
|
import: "./runtime/wasm-compiler-edge.mjs",
|
|
2948
2936
|
default: "./runtime/wasm-compiler-edge.mjs"
|
|
2949
2937
|
},
|
|
2950
|
-
"./runtime/edge": {
|
|
2951
|
-
types: "./runtime/edge.d.ts",
|
|
2952
|
-
require: "./runtime/edge.js",
|
|
2953
|
-
import: "./runtime/edge-esm.js",
|
|
2954
|
-
default: "./runtime/edge-esm.js"
|
|
2955
|
-
},
|
|
2956
2938
|
"./runtime/react-native": {
|
|
2957
2939
|
types: "./runtime/react-native.d.ts",
|
|
2958
2940
|
require: "./runtime/react-native.js",
|
|
@@ -3018,8 +3000,6 @@ var package_default = {
|
|
|
3018
3000
|
"runtime",
|
|
3019
3001
|
"scripts",
|
|
3020
3002
|
"generator-build",
|
|
3021
|
-
"edge.js",
|
|
3022
|
-
"edge.d.ts",
|
|
3023
3003
|
"wasm.js",
|
|
3024
3004
|
"wasm.d.ts",
|
|
3025
3005
|
"index.js",
|
|
@@ -4923,7 +4903,6 @@ import { datamodelEnumToSchemaEnum, datamodelSchemaEnumToSchemaEnum } from "@pri
|
|
|
4923
4903
|
import { ClientEngineType as ClientEngineType2, getClientEngineType, pathToPosix as pathToPosix3 } from "@prisma/internals";
|
|
4924
4904
|
import * as ts12 from "@prisma/ts-builders";
|
|
4925
4905
|
import ciInfo from "ci-info";
|
|
4926
|
-
import crypto from "crypto";
|
|
4927
4906
|
import indent8 from "indent-string";
|
|
4928
4907
|
import path2 from "path";
|
|
4929
4908
|
|
|
@@ -5203,7 +5182,7 @@ import {
|
|
|
5203
5182
|
function buildRuntimeDataModel(datamodel, runtimeNameJs) {
|
|
5204
5183
|
const runtimeDataModel = dmmfToRuntimeDataModel(datamodel);
|
|
5205
5184
|
let prunedDataModel;
|
|
5206
|
-
if (runtimeNameJs === "wasm-
|
|
5185
|
+
if (runtimeNameJs === "wasm-compiler-edge" || runtimeNameJs === "client") {
|
|
5207
5186
|
prunedDataModel = pruneRuntimeDataModel(runtimeDataModel);
|
|
5208
5187
|
} else {
|
|
5209
5188
|
prunedDataModel = runtimeDataModel;
|
|
@@ -5253,16 +5232,6 @@ function buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs) {
|
|
|
5253
5232
|
}
|
|
5254
5233
|
}`;
|
|
5255
5234
|
}
|
|
5256
|
-
if (copyEngine && wasm === true && runtimeNameJs === "wasm-engine-edge") {
|
|
5257
|
-
return `config.engineWasm = {
|
|
5258
|
-
getRuntime: async () => require('./query_engine_bg.js'),
|
|
5259
|
-
getQueryEngineWasmModule: async () => {
|
|
5260
|
-
const loader = (await import('#wasm-engine-loader')).default
|
|
5261
|
-
const engine = (await loader).default
|
|
5262
|
-
return engine
|
|
5263
|
-
}
|
|
5264
|
-
}`;
|
|
5265
|
-
}
|
|
5266
5235
|
return `config.engineWasm = undefined`;
|
|
5267
5236
|
}
|
|
5268
5237
|
|
|
@@ -6605,7 +6574,6 @@ var TSClient = class {
|
|
|
6605
6574
|
const clientEngineType = getClientEngineType(generator);
|
|
6606
6575
|
generator.config.engineType = clientEngineType;
|
|
6607
6576
|
const binaryTargets = clientEngineType === ClientEngineType2.Library ? Object.keys(binaryPaths.libqueryEngine ?? {}) : Object.keys(binaryPaths.queryEngine ?? {});
|
|
6608
|
-
const inlineSchemaHash = crypto.createHash("sha256").update(Buffer.from(inlineSchema, "utf8").toString("base64")).digest("hex");
|
|
6609
6577
|
const datasourceFilePath = datasources[0].sourceFilePath;
|
|
6610
6578
|
const config = {
|
|
6611
6579
|
generator,
|
|
@@ -6619,7 +6587,6 @@ var TSClient = class {
|
|
|
6619
6587
|
ciName: ciInfo.name ?? void 0,
|
|
6620
6588
|
inlineDatasources: buildInlineDatasources(datasources),
|
|
6621
6589
|
inlineSchema,
|
|
6622
|
-
inlineSchemaHash,
|
|
6623
6590
|
copyEngine
|
|
6624
6591
|
};
|
|
6625
6592
|
const relativeOutdir = path2.relative(process.cwd(), outputDir);
|
|
@@ -7147,6 +7114,7 @@ function buildTypedSql({
|
|
|
7147
7114
|
var generatedCodePreamble = `
|
|
7148
7115
|
/* !!! This is code generated by Prisma. Do not edit directly. !!!
|
|
7149
7116
|
/* eslint-disable */
|
|
7117
|
+
// biome-ignore-all lint: generated file
|
|
7150
7118
|
`;
|
|
7151
7119
|
function addPreambleToJSFiles(fileMap) {
|
|
7152
7120
|
for (const [key, value] of Object.entries(fileMap)) {
|
|
@@ -7220,13 +7188,6 @@ async function buildClient({
|
|
|
7220
7188
|
reusedTs: "index",
|
|
7221
7189
|
reusedJs: "."
|
|
7222
7190
|
});
|
|
7223
|
-
const edgeClient = new TSClient({
|
|
7224
|
-
...baseClientOptions,
|
|
7225
|
-
runtimeNameJs: "edge",
|
|
7226
|
-
runtimeNameTs: "library.js",
|
|
7227
|
-
reusedTs: "default",
|
|
7228
|
-
edge: true
|
|
7229
|
-
});
|
|
7230
7191
|
const rnTsClient = new TSClient({
|
|
7231
7192
|
...baseClientOptions,
|
|
7232
7193
|
runtimeNameJs: "react-native",
|
|
@@ -7277,28 +7238,20 @@ async function buildClient({
|
|
|
7277
7238
|
fileMap["default.js"] = JS(defaultClient);
|
|
7278
7239
|
fileMap["default.d.ts"] = TS(defaultClient);
|
|
7279
7240
|
fileMap["index-browser.js"] = BrowserJS(nodeClient);
|
|
7280
|
-
fileMap["edge.js"] = JS(edgeClient);
|
|
7281
|
-
fileMap["edge.d.ts"] = TS(edgeClient);
|
|
7282
7241
|
fileMap["client.js"] = JS(defaultClient);
|
|
7283
7242
|
fileMap["client.d.ts"] = TS(defaultClient);
|
|
7284
7243
|
if (generator.previewFeatures.includes("reactNative")) {
|
|
7285
7244
|
fileMap["react-native.js"] = JS(rnTsClient);
|
|
7286
7245
|
fileMap["react-native.d.ts"] = TS(rnTsClient);
|
|
7287
7246
|
}
|
|
7288
|
-
const usesClientEngine = clientEngineType === ClientEngineType3.Client;
|
|
7289
7247
|
fileMap["default.js"] = JS(trampolineTsClient);
|
|
7290
7248
|
fileMap["default.d.ts"] = TS(trampolineTsClient);
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_compiler_bg.wasm?module')`;
|
|
7294
|
-
} else {
|
|
7295
|
-
fileMap["wasm-worker-loader.mjs"] = `export default import('./query_engine_bg.wasm')`;
|
|
7296
|
-
fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_engine_bg.wasm?module')`;
|
|
7297
|
-
}
|
|
7249
|
+
fileMap["wasm-worker-loader.mjs"] = `export default import('./query_compiler_bg.wasm')`;
|
|
7250
|
+
fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_compiler_bg.wasm?module')`;
|
|
7298
7251
|
pkgJson["browser"] = "default.js";
|
|
7299
7252
|
pkgJson["imports"] = {
|
|
7300
|
-
// when `import('#wasm-
|
|
7301
|
-
|
|
7253
|
+
// when `import('#wasm-compiler-loader')` is called, it will be resolved to the correct file
|
|
7254
|
+
"#wasm-compiler-loader": {
|
|
7302
7255
|
// Keys reference: https://runtime-keys.proposal.wintercg.org/#keys
|
|
7303
7256
|
/**
|
|
7304
7257
|
* Vercel Edge Functions / Next.js Middlewares
|
|
@@ -7323,7 +7276,7 @@ async function buildClient({
|
|
|
7323
7276
|
};
|
|
7324
7277
|
const wasmClient = new TSClient({
|
|
7325
7278
|
...baseClientOptions,
|
|
7326
|
-
runtimeNameJs:
|
|
7279
|
+
runtimeNameJs: "wasm-compiler-edge",
|
|
7327
7280
|
runtimeNameTs: "library.js",
|
|
7328
7281
|
reusedTs: "default",
|
|
7329
7282
|
edge: true,
|
|
@@ -7332,7 +7285,7 @@ async function buildClient({
|
|
|
7332
7285
|
fileMap["wasm.js"] = JS(wasmClient);
|
|
7333
7286
|
fileMap["wasm.d.ts"] = TS(wasmClient);
|
|
7334
7287
|
if (typedSql && typedSql.length > 0) {
|
|
7335
|
-
const edgeRuntimeName =
|
|
7288
|
+
const edgeRuntimeName = "wasm-compiler-edge";
|
|
7336
7289
|
const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`;
|
|
7337
7290
|
const esmEdgeIndex = `./sql/index.${edgeRuntimeName}.mjs`;
|
|
7338
7291
|
pkgJson.exports["./sql"] = {
|
|
@@ -7486,7 +7439,7 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
|
|
|
7486
7439
|
const runtimeNeedsWasmEngine = clientEngineType === ClientEngineType3.Client || copyEngine;
|
|
7487
7440
|
if (runtimeNeedsWasmEngine && isWasmEngineSupported(provider) && !testMode) {
|
|
7488
7441
|
const suffix = provider === "postgres" ? "postgresql" : provider;
|
|
7489
|
-
const filename =
|
|
7442
|
+
const filename = "query_compiler_bg";
|
|
7490
7443
|
const wasmJsBundlePath = path3.join(runtimeSourcePath, `${filename}.${suffix}.wasm-base64.js`);
|
|
7491
7444
|
const wasmBase64 = __require(wasmJsBundlePath).wasm;
|
|
7492
7445
|
await fs.writeFile(path3.join(outputDir, `${filename}.wasm`), Buffer.from(wasmBase64, "base64"));
|
|
@@ -7687,10 +7640,7 @@ async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
|
|
|
7687
7640
|
"library.d.ts",
|
|
7688
7641
|
"index-browser.js",
|
|
7689
7642
|
"index-browser.d.ts",
|
|
7690
|
-
"edge.js",
|
|
7691
|
-
"edge-esm.js",
|
|
7692
7643
|
"react-native.js",
|
|
7693
|
-
"wasm-engine-edge.js",
|
|
7694
7644
|
"wasm-compiler-edge.js"
|
|
7695
7645
|
];
|
|
7696
7646
|
files.push(`${runtimeName}.js`);
|
|
@@ -7740,7 +7690,7 @@ import { ClientEngineType as ClientEngineType4, getClientEngineType as getClient
|
|
|
7740
7690
|
import { match } from "ts-pattern";
|
|
7741
7691
|
|
|
7742
7692
|
// package.json
|
|
7743
|
-
var version = "6.19.0-integration-next.
|
|
7693
|
+
var version = "6.19.0-integration-next.4";
|
|
7744
7694
|
|
|
7745
7695
|
// src/resolvePrismaClient.ts
|
|
7746
7696
|
import fs2 from "node:fs/promises";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SqlQueryOutput } from '@prisma/generator';
|
|
2
2
|
import { DbEnumsList } from './buildDbEnums';
|
|
3
3
|
export declare function buildIndexTs(queries: SqlQueryOutput[], enums: DbEnumsList): string;
|
|
4
|
-
export declare function buildIndexCjs(queries: SqlQueryOutput[], edgeRuntimeSuffix?: 'wasm-
|
|
5
|
-
export declare function buildIndexEsm(queries: SqlQueryOutput[], edgeRuntimeSuffix?: 'wasm-
|
|
4
|
+
export declare function buildIndexCjs(queries: SqlQueryOutput[], edgeRuntimeSuffix?: 'wasm-compiler-edge' | undefined): string;
|
|
5
|
+
export declare function buildIndexEsm(queries: SqlQueryOutput[], edgeRuntimeSuffix?: 'wasm-compiler-edge' | undefined): string;
|
|
@@ -4,7 +4,7 @@ import { FileMap } from '../generateClient';
|
|
|
4
4
|
type TypeSqlBuildOptions = {
|
|
5
5
|
runtimeBase: string;
|
|
6
6
|
mainRuntimeName: string;
|
|
7
|
-
edgeRuntimeName: 'wasm-
|
|
7
|
+
edgeRuntimeName: 'wasm-compiler-edge';
|
|
8
8
|
dmmf: DMMF.Document;
|
|
9
9
|
queries: SqlQueryOutput[];
|
|
10
10
|
};
|
|
@@ -3,4 +3,4 @@ import { TSClientOptions } from '../TSClient/TSClient';
|
|
|
3
3
|
* Builds the necessary glue code to load the query engine wasm module.
|
|
4
4
|
* @returns
|
|
5
5
|
*/
|
|
6
|
-
export declare function buildQueryEngineWasmModule(wasm: boolean, copyEngine: boolean, runtimeNameJs: TSClientOptions['runtimeNameJs']): "config.engineWasm = {\n getRuntime: async () => require('./query_engine_bg.js'),\n getQueryEngineWasmModule: async () => {\n const queryEngineWasmFilePath = require('path').join(config.dirname, 'query_engine_bg.wasm')\n const queryEngineWasmFileBytes = require('fs').readFileSync(queryEngineWasmFilePath)\n\n return new WebAssembly.Module(queryEngineWasmFileBytes)\n }\n }" | "config.engineWasm =
|
|
6
|
+
export declare function buildQueryEngineWasmModule(wasm: boolean, copyEngine: boolean, runtimeNameJs: TSClientOptions['runtimeNameJs']): "config.engineWasm = {\n getRuntime: async () => require('./query_engine_bg.js'),\n getQueryEngineWasmModule: async () => {\n const queryEngineWasmFilePath = require('path').join(config.dirname, 'query_engine_bg.wasm')\n const queryEngineWasmFileBytes = require('fs').readFileSync(queryEngineWasmFilePath)\n\n return new WebAssembly.Module(queryEngineWasmFileBytes)\n }\n }" | "config.engineWasm = undefined";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/client-generator-js",
|
|
3
|
-
"version": "6.19.0-integration-next.
|
|
3
|
+
"version": "6.19.0-integration-next.4",
|
|
4
4
|
"description": "This package is intended for Prisma's internal use",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"package-up": "5.0.0",
|
|
34
34
|
"pluralize": "8.0.0",
|
|
35
35
|
"ts-pattern": "5.6.2",
|
|
36
|
-
"@prisma/client-common": "6.19.0-integration-next.
|
|
37
|
-
"@prisma/debug": "6.19.0-integration-next.
|
|
38
|
-
"@prisma/
|
|
39
|
-
"@prisma/
|
|
40
|
-
"@prisma/
|
|
41
|
-
"@prisma/get-platform": "6.19.0-integration-next.
|
|
42
|
-
"@prisma/ts-builders": "6.19.0-integration-next.
|
|
43
|
-
"@prisma/internals": "6.19.0-integration-next.
|
|
36
|
+
"@prisma/client-common": "6.19.0-integration-next.4",
|
|
37
|
+
"@prisma/debug": "6.19.0-integration-next.4",
|
|
38
|
+
"@prisma/fetch-engine": "6.19.0-integration-next.4",
|
|
39
|
+
"@prisma/dmmf": "6.19.0-integration-next.4",
|
|
40
|
+
"@prisma/generator": "6.19.0-integration-next.4",
|
|
41
|
+
"@prisma/get-platform": "6.19.0-integration-next.4",
|
|
42
|
+
"@prisma/ts-builders": "6.19.0-integration-next.4",
|
|
43
|
+
"@prisma/internals": "6.19.0-integration-next.4"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/pluralize": "0.0.33",
|