@prisma/client-generator-js 6.19.0-integration-next.2 → 6.19.0-integration-next.3
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);
|
|
@@ -7222,13 +7189,6 @@ async function buildClient({
|
|
|
7222
7189
|
reusedTs: "index",
|
|
7223
7190
|
reusedJs: "."
|
|
7224
7191
|
});
|
|
7225
|
-
const edgeClient = new TSClient({
|
|
7226
|
-
...baseClientOptions,
|
|
7227
|
-
runtimeNameJs: "edge",
|
|
7228
|
-
runtimeNameTs: "library.js",
|
|
7229
|
-
reusedTs: "default",
|
|
7230
|
-
edge: true
|
|
7231
|
-
});
|
|
7232
7192
|
const rnTsClient = new TSClient({
|
|
7233
7193
|
...baseClientOptions,
|
|
7234
7194
|
runtimeNameJs: "react-native",
|
|
@@ -7279,28 +7239,20 @@ async function buildClient({
|
|
|
7279
7239
|
fileMap["default.js"] = JS(defaultClient);
|
|
7280
7240
|
fileMap["default.d.ts"] = TS(defaultClient);
|
|
7281
7241
|
fileMap["index-browser.js"] = BrowserJS(nodeClient);
|
|
7282
|
-
fileMap["edge.js"] = JS(edgeClient);
|
|
7283
|
-
fileMap["edge.d.ts"] = TS(edgeClient);
|
|
7284
7242
|
fileMap["client.js"] = JS(defaultClient);
|
|
7285
7243
|
fileMap["client.d.ts"] = TS(defaultClient);
|
|
7286
7244
|
if (generator.previewFeatures.includes("reactNative")) {
|
|
7287
7245
|
fileMap["react-native.js"] = JS(rnTsClient);
|
|
7288
7246
|
fileMap["react-native.d.ts"] = TS(rnTsClient);
|
|
7289
7247
|
}
|
|
7290
|
-
const usesClientEngine = clientEngineType === import_internals10.ClientEngineType.Client;
|
|
7291
7248
|
fileMap["default.js"] = JS(trampolineTsClient);
|
|
7292
7249
|
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
|
-
}
|
|
7250
|
+
fileMap["wasm-worker-loader.mjs"] = `export default import('./query_compiler_bg.wasm')`;
|
|
7251
|
+
fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_compiler_bg.wasm?module')`;
|
|
7300
7252
|
pkgJson["browser"] = "default.js";
|
|
7301
7253
|
pkgJson["imports"] = {
|
|
7302
|
-
// when `import('#wasm-
|
|
7303
|
-
|
|
7254
|
+
// when `import('#wasm-compiler-loader')` is called, it will be resolved to the correct file
|
|
7255
|
+
"#wasm-compiler-loader": {
|
|
7304
7256
|
// Keys reference: https://runtime-keys.proposal.wintercg.org/#keys
|
|
7305
7257
|
/**
|
|
7306
7258
|
* Vercel Edge Functions / Next.js Middlewares
|
|
@@ -7325,7 +7277,7 @@ async function buildClient({
|
|
|
7325
7277
|
};
|
|
7326
7278
|
const wasmClient = new TSClient({
|
|
7327
7279
|
...baseClientOptions,
|
|
7328
|
-
runtimeNameJs:
|
|
7280
|
+
runtimeNameJs: "wasm-compiler-edge",
|
|
7329
7281
|
runtimeNameTs: "library.js",
|
|
7330
7282
|
reusedTs: "default",
|
|
7331
7283
|
edge: true,
|
|
@@ -7334,7 +7286,7 @@ async function buildClient({
|
|
|
7334
7286
|
fileMap["wasm.js"] = JS(wasmClient);
|
|
7335
7287
|
fileMap["wasm.d.ts"] = TS(wasmClient);
|
|
7336
7288
|
if (typedSql && typedSql.length > 0) {
|
|
7337
|
-
const edgeRuntimeName =
|
|
7289
|
+
const edgeRuntimeName = "wasm-compiler-edge";
|
|
7338
7290
|
const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`;
|
|
7339
7291
|
const esmEdgeIndex = `./sql/index.${edgeRuntimeName}.mjs`;
|
|
7340
7292
|
pkgJson.exports["./sql"] = {
|
|
@@ -7488,7 +7440,7 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
|
|
|
7488
7440
|
const runtimeNeedsWasmEngine = clientEngineType === import_internals10.ClientEngineType.Client || copyEngine;
|
|
7489
7441
|
if (runtimeNeedsWasmEngine && isWasmEngineSupported(provider) && !testMode) {
|
|
7490
7442
|
const suffix = provider === "postgres" ? "postgresql" : provider;
|
|
7491
|
-
const filename =
|
|
7443
|
+
const filename = "query_compiler_bg";
|
|
7492
7444
|
const wasmJsBundlePath = import_path3.default.join(runtimeSourcePath, `${filename}.${suffix}.wasm-base64.js`);
|
|
7493
7445
|
const wasmBase64 = require(wasmJsBundlePath).wasm;
|
|
7494
7446
|
await import_promises.default.writeFile(import_path3.default.join(outputDir, `${filename}.wasm`), Buffer.from(wasmBase64, "base64"));
|
|
@@ -7689,10 +7641,7 @@ async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
|
|
|
7689
7641
|
"library.d.ts",
|
|
7690
7642
|
"index-browser.js",
|
|
7691
7643
|
"index-browser.d.ts",
|
|
7692
|
-
"edge.js",
|
|
7693
|
-
"edge-esm.js",
|
|
7694
7644
|
"react-native.js",
|
|
7695
|
-
"wasm-engine-edge.js",
|
|
7696
7645
|
"wasm-compiler-edge.js"
|
|
7697
7646
|
];
|
|
7698
7647
|
files.push(`${runtimeName}.js`);
|
|
@@ -7728,7 +7677,7 @@ async function deleteOutputDir(outputDir) {
|
|
|
7728
7677
|
}
|
|
7729
7678
|
}
|
|
7730
7679
|
function getUniquePackageName(datamodel) {
|
|
7731
|
-
const hash = (0,
|
|
7680
|
+
const hash = (0, import_crypto.createHash)("sha256");
|
|
7732
7681
|
hash.write(datamodel);
|
|
7733
7682
|
return `${GENERATED_PACKAGE_NAME_PREFIX}${hash.digest().toString("hex")}`;
|
|
7734
7683
|
}
|
|
@@ -7742,7 +7691,7 @@ var import_internals12 = require("@prisma/internals");
|
|
|
7742
7691
|
var import_ts_pattern = require("ts-pattern");
|
|
7743
7692
|
|
|
7744
7693
|
// package.json
|
|
7745
|
-
var version = "6.19.0-integration-next.
|
|
7694
|
+
var version = "6.19.0-integration-next.3";
|
|
7746
7695
|
|
|
7747
7696
|
// src/resolvePrismaClient.ts
|
|
7748
7697
|
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);
|
|
@@ -7220,13 +7187,6 @@ async function buildClient({
|
|
|
7220
7187
|
reusedTs: "index",
|
|
7221
7188
|
reusedJs: "."
|
|
7222
7189
|
});
|
|
7223
|
-
const edgeClient = new TSClient({
|
|
7224
|
-
...baseClientOptions,
|
|
7225
|
-
runtimeNameJs: "edge",
|
|
7226
|
-
runtimeNameTs: "library.js",
|
|
7227
|
-
reusedTs: "default",
|
|
7228
|
-
edge: true
|
|
7229
|
-
});
|
|
7230
7190
|
const rnTsClient = new TSClient({
|
|
7231
7191
|
...baseClientOptions,
|
|
7232
7192
|
runtimeNameJs: "react-native",
|
|
@@ -7277,28 +7237,20 @@ async function buildClient({
|
|
|
7277
7237
|
fileMap["default.js"] = JS(defaultClient);
|
|
7278
7238
|
fileMap["default.d.ts"] = TS(defaultClient);
|
|
7279
7239
|
fileMap["index-browser.js"] = BrowserJS(nodeClient);
|
|
7280
|
-
fileMap["edge.js"] = JS(edgeClient);
|
|
7281
|
-
fileMap["edge.d.ts"] = TS(edgeClient);
|
|
7282
7240
|
fileMap["client.js"] = JS(defaultClient);
|
|
7283
7241
|
fileMap["client.d.ts"] = TS(defaultClient);
|
|
7284
7242
|
if (generator.previewFeatures.includes("reactNative")) {
|
|
7285
7243
|
fileMap["react-native.js"] = JS(rnTsClient);
|
|
7286
7244
|
fileMap["react-native.d.ts"] = TS(rnTsClient);
|
|
7287
7245
|
}
|
|
7288
|
-
const usesClientEngine = clientEngineType === ClientEngineType3.Client;
|
|
7289
7246
|
fileMap["default.js"] = JS(trampolineTsClient);
|
|
7290
7247
|
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
|
-
}
|
|
7248
|
+
fileMap["wasm-worker-loader.mjs"] = `export default import('./query_compiler_bg.wasm')`;
|
|
7249
|
+
fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_compiler_bg.wasm?module')`;
|
|
7298
7250
|
pkgJson["browser"] = "default.js";
|
|
7299
7251
|
pkgJson["imports"] = {
|
|
7300
|
-
// when `import('#wasm-
|
|
7301
|
-
|
|
7252
|
+
// when `import('#wasm-compiler-loader')` is called, it will be resolved to the correct file
|
|
7253
|
+
"#wasm-compiler-loader": {
|
|
7302
7254
|
// Keys reference: https://runtime-keys.proposal.wintercg.org/#keys
|
|
7303
7255
|
/**
|
|
7304
7256
|
* Vercel Edge Functions / Next.js Middlewares
|
|
@@ -7323,7 +7275,7 @@ async function buildClient({
|
|
|
7323
7275
|
};
|
|
7324
7276
|
const wasmClient = new TSClient({
|
|
7325
7277
|
...baseClientOptions,
|
|
7326
|
-
runtimeNameJs:
|
|
7278
|
+
runtimeNameJs: "wasm-compiler-edge",
|
|
7327
7279
|
runtimeNameTs: "library.js",
|
|
7328
7280
|
reusedTs: "default",
|
|
7329
7281
|
edge: true,
|
|
@@ -7332,7 +7284,7 @@ async function buildClient({
|
|
|
7332
7284
|
fileMap["wasm.js"] = JS(wasmClient);
|
|
7333
7285
|
fileMap["wasm.d.ts"] = TS(wasmClient);
|
|
7334
7286
|
if (typedSql && typedSql.length > 0) {
|
|
7335
|
-
const edgeRuntimeName =
|
|
7287
|
+
const edgeRuntimeName = "wasm-compiler-edge";
|
|
7336
7288
|
const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`;
|
|
7337
7289
|
const esmEdgeIndex = `./sql/index.${edgeRuntimeName}.mjs`;
|
|
7338
7290
|
pkgJson.exports["./sql"] = {
|
|
@@ -7486,7 +7438,7 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
|
|
|
7486
7438
|
const runtimeNeedsWasmEngine = clientEngineType === ClientEngineType3.Client || copyEngine;
|
|
7487
7439
|
if (runtimeNeedsWasmEngine && isWasmEngineSupported(provider) && !testMode) {
|
|
7488
7440
|
const suffix = provider === "postgres" ? "postgresql" : provider;
|
|
7489
|
-
const filename =
|
|
7441
|
+
const filename = "query_compiler_bg";
|
|
7490
7442
|
const wasmJsBundlePath = path3.join(runtimeSourcePath, `${filename}.${suffix}.wasm-base64.js`);
|
|
7491
7443
|
const wasmBase64 = __require(wasmJsBundlePath).wasm;
|
|
7492
7444
|
await fs.writeFile(path3.join(outputDir, `${filename}.wasm`), Buffer.from(wasmBase64, "base64"));
|
|
@@ -7687,10 +7639,7 @@ async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
|
|
|
7687
7639
|
"library.d.ts",
|
|
7688
7640
|
"index-browser.js",
|
|
7689
7641
|
"index-browser.d.ts",
|
|
7690
|
-
"edge.js",
|
|
7691
|
-
"edge-esm.js",
|
|
7692
7642
|
"react-native.js",
|
|
7693
|
-
"wasm-engine-edge.js",
|
|
7694
7643
|
"wasm-compiler-edge.js"
|
|
7695
7644
|
];
|
|
7696
7645
|
files.push(`${runtimeName}.js`);
|
|
@@ -7740,7 +7689,7 @@ import { ClientEngineType as ClientEngineType4, getClientEngineType as getClient
|
|
|
7740
7689
|
import { match } from "ts-pattern";
|
|
7741
7690
|
|
|
7742
7691
|
// package.json
|
|
7743
|
-
var version = "6.19.0-integration-next.
|
|
7692
|
+
var version = "6.19.0-integration-next.3";
|
|
7744
7693
|
|
|
7745
7694
|
// src/resolvePrismaClient.ts
|
|
7746
7695
|
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.3",
|
|
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/
|
|
38
|
-
"@prisma/
|
|
39
|
-
"@prisma/
|
|
40
|
-
"@prisma/
|
|
41
|
-
"@prisma/get-platform": "6.19.0-integration-next.
|
|
42
|
-
"@prisma/
|
|
43
|
-
"@prisma/
|
|
36
|
+
"@prisma/client-common": "6.19.0-integration-next.3",
|
|
37
|
+
"@prisma/dmmf": "6.19.0-integration-next.3",
|
|
38
|
+
"@prisma/fetch-engine": "6.19.0-integration-next.3",
|
|
39
|
+
"@prisma/debug": "6.19.0-integration-next.3",
|
|
40
|
+
"@prisma/generator": "6.19.0-integration-next.3",
|
|
41
|
+
"@prisma/get-platform": "6.19.0-integration-next.3",
|
|
42
|
+
"@prisma/internals": "6.19.0-integration-next.3",
|
|
43
|
+
"@prisma/ts-builders": "6.19.0-integration-next.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/pluralize": "0.0.33",
|