@powerlines/plugin-prisma 0.4.242 → 0.4.244

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.
@@ -1,4 +1,3 @@
1
- import { t as __exportAll } from "./chunk-w6R9maHv.mjs";
2
1
  import { findFileExtension } from "@stryke/path/find";
3
2
  import { buildClient } from "@prisma/client-generator-ts";
4
3
  import { enginesVersion } from "@prisma/engines-version";
@@ -8,11 +7,10 @@ import { isBuffer } from "@stryke/type-checks/is-buffer";
8
7
  import { isString } from "@stryke/type-checks/is-string";
9
8
 
10
9
  //#region package.json
11
- var version = "0.4.241";
10
+ var version = "0.4.244";
12
11
 
13
12
  //#endregion
14
13
  //#region src/helpers/client-generator.ts
15
- var client_generator_exports = /* @__PURE__ */ __exportAll({ PowerlinesClientGenerator: () => PowerlinesClientGenerator });
16
14
  var PowerlinesClientGenerator = class {
17
15
  context;
18
16
  #options;
@@ -146,4 +144,4 @@ var PowerlinesClientGenerator = class {
146
144
  };
147
145
 
148
146
  //#endregion
149
- export { client_generator_exports as n, PowerlinesClientGenerator as t };
147
+ export { PowerlinesClientGenerator as t };
@@ -1,4 +1,3 @@
1
- const require_chunk = require('./chunk-CEeaYzDW.cjs');
2
1
  let _stryke_path_find = require("@stryke/path/find");
3
2
  let _prisma_client_generator_ts = require("@prisma/client-generator-ts");
4
3
  let _prisma_engines_version = require("@prisma/engines-version");
@@ -8,11 +7,10 @@ let _stryke_type_checks_is_buffer = require("@stryke/type-checks/is-buffer");
8
7
  let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
9
8
 
10
9
  //#region package.json
11
- var version = "0.4.241";
10
+ var version = "0.4.244";
12
11
 
13
12
  //#endregion
14
13
  //#region src/helpers/client-generator.ts
15
- var client_generator_exports = /* @__PURE__ */ require_chunk.__exportAll({ PowerlinesClientGenerator: () => PowerlinesClientGenerator });
16
14
  var PowerlinesClientGenerator = class {
17
15
  context;
18
16
  #options;
@@ -151,10 +149,4 @@ Object.defineProperty(exports, 'PowerlinesClientGenerator', {
151
149
  get: function () {
152
150
  return PowerlinesClientGenerator;
153
151
  }
154
- });
155
- Object.defineProperty(exports, 'client_generator_exports', {
156
- enumerable: true,
157
- get: function () {
158
- return client_generator_exports;
159
- }
160
152
  });
@@ -0,0 +1,147 @@
1
+ import { findFileExtension } from "@stryke/path/find";
2
+ import { buildClient } from "@prisma/client-generator-ts";
3
+ import { enginesVersion } from "@prisma/engines-version";
4
+ import { bufferToString } from "@stryke/convert/buffer-to-string";
5
+ import { replaceExtension } from "@stryke/path/replace";
6
+ import { isBuffer } from "@stryke/type-checks/is-buffer";
7
+ import { isString } from "@stryke/type-checks/is-string";
8
+
9
+ //#region package.json
10
+ var version = "0.4.243";
11
+
12
+ //#endregion
13
+ //#region src/helpers/client-generator.ts
14
+ var PowerlinesClientGenerator = class {
15
+ context;
16
+ #options;
17
+ name = "powerlines-client";
18
+ constructor(context) {
19
+ this.context = context;
20
+ this.#options = {
21
+ name: this.name,
22
+ output: null,
23
+ config: {},
24
+ provider: {
25
+ fromEnvVar: "POWERLINES_CLIENT_PROVIDER",
26
+ value: this.name
27
+ },
28
+ binaryTargets: [],
29
+ previewFeatures: this.context.prisma.previewFeatures,
30
+ sourceFilePath: this.context.prisma.schema.schemaRootDir
31
+ };
32
+ }
33
+ async getManifest(_config) {
34
+ return Promise.resolve({
35
+ defaultOutput: "./generated",
36
+ prettyName: "Powerlines Client",
37
+ version,
38
+ requiresEngines: [],
39
+ requiresEngineVersion: enginesVersion
40
+ });
41
+ }
42
+ async generate() {
43
+ const { prismaClientDmmf, fileMap } = buildClient({
44
+ datamodel: this.context.prisma.schema.schemas.map((s) => s.content).join("\n"),
45
+ schemaPath: this.context.prisma.schema.schemaPath,
46
+ binaryPaths: {},
47
+ datasources: this.context.prisma.schema.datasources,
48
+ outputDir: this.context.config.prisma.outputPath,
49
+ runtimeBase: "@prisma/client/runtime",
50
+ dmmf: this.context.prisma.dmmf,
51
+ generator: this.#options,
52
+ engineVersion: enginesVersion,
53
+ clientVersion: version,
54
+ activeProvider: this.context.prisma.schema.primaryDatasource?.activeProvider,
55
+ typedSql: this.context.prisma.typedSql,
56
+ target: this.context.config.prisma.runtime,
57
+ generatedFileExtension: "ts",
58
+ importFileExtension: "ts",
59
+ moduleFormat: "esm",
60
+ tsNoCheckPreamble: true,
61
+ compilerBuild: "fast"
62
+ });
63
+ const errorArray = [];
64
+ const denylists = {
65
+ models: [
66
+ "PrismaClient",
67
+ "Prisma",
68
+ "async",
69
+ "await",
70
+ "break",
71
+ "case",
72
+ "catch",
73
+ "class",
74
+ "const",
75
+ "continue",
76
+ "debugger",
77
+ "default",
78
+ "delete",
79
+ "do",
80
+ "else",
81
+ "enum",
82
+ "export",
83
+ "extends",
84
+ "false",
85
+ "finally",
86
+ "for",
87
+ "function",
88
+ "if",
89
+ "implements",
90
+ "import",
91
+ "in",
92
+ "instanceof",
93
+ "interface",
94
+ "let",
95
+ "new",
96
+ "null",
97
+ "package",
98
+ "private",
99
+ "protected",
100
+ "public",
101
+ "return",
102
+ "super",
103
+ "switch",
104
+ "this",
105
+ "throw",
106
+ "true",
107
+ "try",
108
+ "using",
109
+ "typeof",
110
+ "var",
111
+ "void",
112
+ "while",
113
+ "with",
114
+ "yield"
115
+ ],
116
+ fields: [
117
+ "AND",
118
+ "OR",
119
+ "NOT"
120
+ ],
121
+ dynamic: []
122
+ };
123
+ if (prismaClientDmmf.datamodel.enums) {
124
+ for (const it of prismaClientDmmf.datamodel.enums) if (denylists.models.includes(it.name) || denylists.fields.includes(it.name)) errorArray.push(/* @__PURE__ */ new Error(`"enum ${it.name}"`));
125
+ }
126
+ if (prismaClientDmmf.datamodel.models) {
127
+ for (const it of prismaClientDmmf.datamodel.models) if (denylists.models.includes(it.name) || denylists.fields.includes(it.name)) errorArray.push(/* @__PURE__ */ new Error(`"model ${it.name}"`));
128
+ }
129
+ if (errorArray.length > 0) {
130
+ let message = `Error: The schema at "${this.context.prisma.schema.schemaPath}" contains reserved keywords.\n Rename the following items:`;
131
+ for (const error of errorArray) message += `\n - ${error.message}`;
132
+ throw new Error(`${message}\nTo learn more about how to rename models, check out https://pris.ly/d/naming-models`);
133
+ }
134
+ await this.writeFileMap(fileMap);
135
+ }
136
+ stop() {}
137
+ async writeFileMap(fileMap) {
138
+ return Promise.all(Object.entries(fileMap).map(async ([fileName, content]) => {
139
+ if (isString(content)) this.context.emitBuiltinSync(content, `prisma/${replaceExtension(fileName)}`, { extension: findFileExtension(fileName) || "ts" });
140
+ else if (isBuffer(content)) this.context.emitBuiltinSync(bufferToString(content), `prisma/${replaceExtension(fileName)}`, { extension: findFileExtension(fileName) || "ts" });
141
+ else await this.writeFileMap(content);
142
+ }));
143
+ }
144
+ };
145
+
146
+ //#endregion
147
+ export { PowerlinesClientGenerator as t };
@@ -0,0 +1,152 @@
1
+ let _stryke_path_find = require("@stryke/path/find");
2
+ let _prisma_client_generator_ts = require("@prisma/client-generator-ts");
3
+ let _prisma_engines_version = require("@prisma/engines-version");
4
+ let _stryke_convert_buffer_to_string = require("@stryke/convert/buffer-to-string");
5
+ let _stryke_path_replace = require("@stryke/path/replace");
6
+ let _stryke_type_checks_is_buffer = require("@stryke/type-checks/is-buffer");
7
+ let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
8
+
9
+ //#region package.json
10
+ var version = "0.4.243";
11
+
12
+ //#endregion
13
+ //#region src/helpers/client-generator.ts
14
+ var PowerlinesClientGenerator = class {
15
+ context;
16
+ #options;
17
+ name = "powerlines-client";
18
+ constructor(context) {
19
+ this.context = context;
20
+ this.#options = {
21
+ name: this.name,
22
+ output: null,
23
+ config: {},
24
+ provider: {
25
+ fromEnvVar: "POWERLINES_CLIENT_PROVIDER",
26
+ value: this.name
27
+ },
28
+ binaryTargets: [],
29
+ previewFeatures: this.context.prisma.previewFeatures,
30
+ sourceFilePath: this.context.prisma.schema.schemaRootDir
31
+ };
32
+ }
33
+ async getManifest(_config) {
34
+ return Promise.resolve({
35
+ defaultOutput: "./generated",
36
+ prettyName: "Powerlines Client",
37
+ version,
38
+ requiresEngines: [],
39
+ requiresEngineVersion: _prisma_engines_version.enginesVersion
40
+ });
41
+ }
42
+ async generate() {
43
+ const { prismaClientDmmf, fileMap } = (0, _prisma_client_generator_ts.buildClient)({
44
+ datamodel: this.context.prisma.schema.schemas.map((s) => s.content).join("\n"),
45
+ schemaPath: this.context.prisma.schema.schemaPath,
46
+ binaryPaths: {},
47
+ datasources: this.context.prisma.schema.datasources,
48
+ outputDir: this.context.config.prisma.outputPath,
49
+ runtimeBase: "@prisma/client/runtime",
50
+ dmmf: this.context.prisma.dmmf,
51
+ generator: this.#options,
52
+ engineVersion: _prisma_engines_version.enginesVersion,
53
+ clientVersion: version,
54
+ activeProvider: this.context.prisma.schema.primaryDatasource?.activeProvider,
55
+ typedSql: this.context.prisma.typedSql,
56
+ target: this.context.config.prisma.runtime,
57
+ generatedFileExtension: "ts",
58
+ importFileExtension: "ts",
59
+ moduleFormat: "esm",
60
+ tsNoCheckPreamble: true,
61
+ compilerBuild: "fast"
62
+ });
63
+ const errorArray = [];
64
+ const denylists = {
65
+ models: [
66
+ "PrismaClient",
67
+ "Prisma",
68
+ "async",
69
+ "await",
70
+ "break",
71
+ "case",
72
+ "catch",
73
+ "class",
74
+ "const",
75
+ "continue",
76
+ "debugger",
77
+ "default",
78
+ "delete",
79
+ "do",
80
+ "else",
81
+ "enum",
82
+ "export",
83
+ "extends",
84
+ "false",
85
+ "finally",
86
+ "for",
87
+ "function",
88
+ "if",
89
+ "implements",
90
+ "import",
91
+ "in",
92
+ "instanceof",
93
+ "interface",
94
+ "let",
95
+ "new",
96
+ "null",
97
+ "package",
98
+ "private",
99
+ "protected",
100
+ "public",
101
+ "return",
102
+ "super",
103
+ "switch",
104
+ "this",
105
+ "throw",
106
+ "true",
107
+ "try",
108
+ "using",
109
+ "typeof",
110
+ "var",
111
+ "void",
112
+ "while",
113
+ "with",
114
+ "yield"
115
+ ],
116
+ fields: [
117
+ "AND",
118
+ "OR",
119
+ "NOT"
120
+ ],
121
+ dynamic: []
122
+ };
123
+ if (prismaClientDmmf.datamodel.enums) {
124
+ for (const it of prismaClientDmmf.datamodel.enums) if (denylists.models.includes(it.name) || denylists.fields.includes(it.name)) errorArray.push(/* @__PURE__ */ new Error(`"enum ${it.name}"`));
125
+ }
126
+ if (prismaClientDmmf.datamodel.models) {
127
+ for (const it of prismaClientDmmf.datamodel.models) if (denylists.models.includes(it.name) || denylists.fields.includes(it.name)) errorArray.push(/* @__PURE__ */ new Error(`"model ${it.name}"`));
128
+ }
129
+ if (errorArray.length > 0) {
130
+ let message = `Error: The schema at "${this.context.prisma.schema.schemaPath}" contains reserved keywords.\n Rename the following items:`;
131
+ for (const error of errorArray) message += `\n - ${error.message}`;
132
+ throw new Error(`${message}\nTo learn more about how to rename models, check out https://pris.ly/d/naming-models`);
133
+ }
134
+ await this.writeFileMap(fileMap);
135
+ }
136
+ stop() {}
137
+ async writeFileMap(fileMap) {
138
+ return Promise.all(Object.entries(fileMap).map(async ([fileName, content]) => {
139
+ if ((0, _stryke_type_checks_is_string.isString)(content)) this.context.emitBuiltinSync(content, `prisma/${(0, _stryke_path_replace.replaceExtension)(fileName)}`, { extension: (0, _stryke_path_find.findFileExtension)(fileName) || "ts" });
140
+ else if ((0, _stryke_type_checks_is_buffer.isBuffer)(content)) this.context.emitBuiltinSync((0, _stryke_convert_buffer_to_string.bufferToString)(content), `prisma/${(0, _stryke_path_replace.replaceExtension)(fileName)}`, { extension: (0, _stryke_path_find.findFileExtension)(fileName) || "ts" });
141
+ else await this.writeFileMap(content);
142
+ }));
143
+ }
144
+ };
145
+
146
+ //#endregion
147
+ Object.defineProperty(exports, 'PowerlinesClientGenerator', {
148
+ enumerable: true,
149
+ get: function () {
150
+ return PowerlinesClientGenerator;
151
+ }
152
+ });
@@ -0,0 +1,138 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+ let _prisma_get_platform = require("@prisma/get-platform");
29
+ let _prisma_prisma_schema_wasm = require("@prisma/prisma-schema-wasm");
30
+ _prisma_prisma_schema_wasm = __toESM(_prisma_prisma_schema_wasm, 1);
31
+ let fp_ts_Either = require("fp-ts/Either");
32
+ fp_ts_Either = __toESM(fp_ts_Either, 1);
33
+ let fp_ts_lib_function = require("fp-ts/lib/function");
34
+ let ts_pattern = require("ts-pattern");
35
+
36
+ //#region src/helpers/get-schema.ts
37
+ async function resolveBinaryTargets(generator) {
38
+ for (const binaryTarget of generator.binaryTargets) {
39
+ if (binaryTarget.fromEnvVar && process.env[binaryTarget.fromEnvVar]) {
40
+ const value = JSON.parse(process.env[binaryTarget.fromEnvVar]);
41
+ if (Array.isArray(value)) {
42
+ generator.binaryTargets = value.map((v) => ({
43
+ fromEnvVar: null,
44
+ value: v
45
+ }));
46
+ await resolveBinaryTargets(generator);
47
+ } else binaryTarget.value = value;
48
+ }
49
+ if (binaryTarget.value === "native") {
50
+ binaryTarget.value = await (0, _prisma_get_platform.getBinaryTargetForCurrentPlatform)();
51
+ binaryTarget.native = true;
52
+ }
53
+ }
54
+ if (generator.binaryTargets.length === 0) generator.binaryTargets = [{
55
+ fromEnvVar: null,
56
+ value: await (0, _prisma_get_platform.getBinaryTargetForCurrentPlatform)(),
57
+ native: true
58
+ }];
59
+ }
60
+ /**
61
+ * Retrieves the Prisma schema using the provided options.
62
+ *
63
+ * @param schemaPath - The path to the Prisma schema file.
64
+ * @returns The Prisma schema.
65
+ */
66
+ async function resolveDataModel(schemaPath) {
67
+ const configEither = (0, fp_ts_lib_function.pipe)(fp_ts_Either.tryCatch(() => {
68
+ if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) _prisma_prisma_schema_wasm.default.debug_panic();
69
+ const params = JSON.stringify({
70
+ prismaSchema: schemaPath,
71
+ datasourceOverrides: {},
72
+ ignoreEnvVarErrors: true,
73
+ env: process.env
74
+ });
75
+ return _prisma_prisma_schema_wasm.default.get_config(params);
76
+ }, (e) => ({
77
+ type: "wasm-error",
78
+ reason: "(get-config wasm)",
79
+ error: e
80
+ })), fp_ts_Either.map((result) => ({ result })), fp_ts_Either.chainW(({ result }) => fp_ts_Either.tryCatch(() => JSON.parse(result), (e) => ({
81
+ type: "parse-json",
82
+ reason: "Unable to parse JSON",
83
+ error: e
84
+ }))), fp_ts_Either.chainW((response) => {
85
+ if (response.errors.length > 0) return fp_ts_Either.left({
86
+ type: "validation-error",
87
+ reason: "(get-config wasm)",
88
+ error: response.errors
89
+ });
90
+ return fp_ts_Either.right(response.config);
91
+ }));
92
+ if (fp_ts_Either.isRight(configEither)) {
93
+ const { right: data } = configEither;
94
+ for (const generator of data.generators) await resolveBinaryTargets(generator);
95
+ return Promise.resolve(data);
96
+ }
97
+ throw (0, ts_pattern.match)(configEither.left).with({ type: "wasm-error" }, (e) => {
98
+ return /* @__PURE__ */ new Error(`Prisma get-config Wasm runtime error: ${e.error.message}`);
99
+ }).with({ type: "validation-error" }, (e) => {
100
+ return /* @__PURE__ */ new Error(`Prisma get-config validation error: ${e.error.map((err) => err.message).join(", ")}`);
101
+ }).otherwise((e) => {
102
+ return /* @__PURE__ */ new Error(`Prisma get-config unknown error: ${e.reason} - ${e.error.message}`);
103
+ });
104
+ }
105
+ /**
106
+ * Retrieves the Prisma schema using the provided path.
107
+ *
108
+ * @param path - The path to the Prisma schema file.
109
+ * @returns The Prisma schema.
110
+ */
111
+ async function getSchema(path) {
112
+ const schema = {
113
+ path,
114
+ content: "",
115
+ generators: [],
116
+ datasources: [],
117
+ warnings: []
118
+ };
119
+ const dataModel = await resolveDataModel(path);
120
+ return {
121
+ ...schema,
122
+ ...dataModel
123
+ };
124
+ }
125
+
126
+ //#endregion
127
+ Object.defineProperty(exports, '__toESM', {
128
+ enumerable: true,
129
+ get: function () {
130
+ return __toESM;
131
+ }
132
+ });
133
+ Object.defineProperty(exports, 'getSchema', {
134
+ enumerable: true,
135
+ get: function () {
136
+ return getSchema;
137
+ }
138
+ });
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_client_generator = require('../client-generator-C1G5jFmH.cjs');
2
+ const require_client_generator = require('../client-generator-CNwLFHpf.cjs');
3
3
 
4
4
  exports.PowerlinesClientGenerator = require_client_generator.PowerlinesClientGenerator;
@@ -1,3 +1,3 @@
1
- import { t as PowerlinesClientGenerator } from "../client-generator-W_Ly3nqA.mjs";
1
+ import { t as PowerlinesClientGenerator } from "../client-generator-BH-vK3UD.mjs";
2
2
 
3
3
  export { PowerlinesClientGenerator };
@@ -1,109 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_chunk = require('../chunk-CEeaYzDW.cjs');
3
- let _prisma_get_platform = require("@prisma/get-platform");
4
- let _prisma_prisma_schema_wasm = require("@prisma/prisma-schema-wasm");
5
- _prisma_prisma_schema_wasm = require_chunk.__toESM(_prisma_prisma_schema_wasm, 1);
6
- let fp_ts_Either = require("fp-ts/Either");
7
- fp_ts_Either = require_chunk.__toESM(fp_ts_Either, 1);
8
- let fp_ts_lib_function = require("fp-ts/lib/function");
9
- let ts_pattern = require("ts-pattern");
2
+ const require_get_schema = require('../get-schema-Ddq6Y5_l.cjs');
10
3
 
11
- //#region src/helpers/get-schema.ts
12
- var get_schema_exports = /* @__PURE__ */ require_chunk.__exportAll({ getSchema: () => getSchema });
13
- async function resolveBinaryTargets(generator) {
14
- for (const binaryTarget of generator.binaryTargets) {
15
- if (binaryTarget.fromEnvVar && process.env[binaryTarget.fromEnvVar]) {
16
- const value = JSON.parse(process.env[binaryTarget.fromEnvVar]);
17
- if (Array.isArray(value)) {
18
- generator.binaryTargets = value.map((v) => ({
19
- fromEnvVar: null,
20
- value: v
21
- }));
22
- await resolveBinaryTargets(generator);
23
- } else binaryTarget.value = value;
24
- }
25
- if (binaryTarget.value === "native") {
26
- binaryTarget.value = await (0, _prisma_get_platform.getBinaryTargetForCurrentPlatform)();
27
- binaryTarget.native = true;
28
- }
29
- }
30
- if (generator.binaryTargets.length === 0) generator.binaryTargets = [{
31
- fromEnvVar: null,
32
- value: await (0, _prisma_get_platform.getBinaryTargetForCurrentPlatform)(),
33
- native: true
34
- }];
35
- }
36
- /**
37
- * Retrieves the Prisma schema using the provided options.
38
- *
39
- * @param schemaPath - The path to the Prisma schema file.
40
- * @returns The Prisma schema.
41
- */
42
- async function resolveDataModel(schemaPath) {
43
- const configEither = (0, fp_ts_lib_function.pipe)(fp_ts_Either.tryCatch(() => {
44
- if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) _prisma_prisma_schema_wasm.default.debug_panic();
45
- const params = JSON.stringify({
46
- prismaSchema: schemaPath,
47
- datasourceOverrides: {},
48
- ignoreEnvVarErrors: true,
49
- env: process.env
50
- });
51
- return _prisma_prisma_schema_wasm.default.get_config(params);
52
- }, (e) => ({
53
- type: "wasm-error",
54
- reason: "(get-config wasm)",
55
- error: e
56
- })), fp_ts_Either.map((result) => ({ result })), fp_ts_Either.chainW(({ result }) => fp_ts_Either.tryCatch(() => JSON.parse(result), (e) => ({
57
- type: "parse-json",
58
- reason: "Unable to parse JSON",
59
- error: e
60
- }))), fp_ts_Either.chainW((response) => {
61
- if (response.errors.length > 0) return fp_ts_Either.left({
62
- type: "validation-error",
63
- reason: "(get-config wasm)",
64
- error: response.errors
65
- });
66
- return fp_ts_Either.right(response.config);
67
- }));
68
- if (fp_ts_Either.isRight(configEither)) {
69
- const { right: data } = configEither;
70
- for (const generator of data.generators) await resolveBinaryTargets(generator);
71
- return Promise.resolve(data);
72
- }
73
- throw (0, ts_pattern.match)(configEither.left).with({ type: "wasm-error" }, (e) => {
74
- return /* @__PURE__ */ new Error(`Prisma get-config Wasm runtime error: ${e.error.message}`);
75
- }).with({ type: "validation-error" }, (e) => {
76
- return /* @__PURE__ */ new Error(`Prisma get-config validation error: ${e.error.map((err) => err.message).join(", ")}`);
77
- }).otherwise((e) => {
78
- return /* @__PURE__ */ new Error(`Prisma get-config unknown error: ${e.reason} - ${e.error.message}`);
79
- });
80
- }
81
- /**
82
- * Retrieves the Prisma schema using the provided path.
83
- *
84
- * @param path - The path to the Prisma schema file.
85
- * @returns The Prisma schema.
86
- */
87
- async function getSchema(path) {
88
- const schema = {
89
- path,
90
- content: "",
91
- generators: [],
92
- datasources: [],
93
- warnings: []
94
- };
95
- const dataModel = await resolveDataModel(path);
96
- return {
97
- ...schema,
98
- ...dataModel
99
- };
100
- }
101
-
102
- //#endregion
103
- exports.getSchema = getSchema;
104
- Object.defineProperty(exports, 'get_schema_exports', {
105
- enumerable: true,
106
- get: function () {
107
- return get_schema_exports;
108
- }
109
- });
4
+ exports.getSchema = require_get_schema.getSchema;
@@ -1,4 +1,3 @@
1
- import { t as __exportAll } from "../chunk-w6R9maHv.mjs";
2
1
  import { getBinaryTargetForCurrentPlatform } from "@prisma/get-platform";
3
2
  import prismaSchemaWasm from "@prisma/prisma-schema-wasm";
4
3
  import * as E from "fp-ts/Either";
@@ -6,7 +5,6 @@ import { pipe } from "fp-ts/lib/function";
6
5
  import { match } from "ts-pattern";
7
6
 
8
7
  //#region src/helpers/get-schema.ts
9
- var get_schema_exports = /* @__PURE__ */ __exportAll({ getSchema: () => getSchema });
10
8
  async function resolveBinaryTargets(generator) {
11
9
  for (const binaryTarget of generator.binaryTargets) {
12
10
  if (binaryTarget.fromEnvVar && process.env[binaryTarget.fromEnvVar]) {
@@ -97,4 +95,4 @@ async function getSchema(path) {
97
95
  }
98
96
 
99
97
  //#endregion
100
- export { getSchema, get_schema_exports as t };
98
+ export { getSchema };
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_client_generator = require('../client-generator-C1G5jFmH.cjs');
3
- const require_helpers_get_schema = require('./get-schema.cjs');
2
+ const require_get_schema = require('../get-schema-Ddq6Y5_l.cjs');
3
+ const require_client_generator = require('../client-generator-CNwLFHpf.cjs');
4
4
  const require_helpers_schema_creator = require('./schema-creator.cjs');
5
5
  const require_helpers_typed_sql = require('./typed-sql.cjs');
6
6
 
7
7
  exports.PowerlinesClientGenerator = require_client_generator.PowerlinesClientGenerator;
8
8
  exports.PrismaSchemaCreator = require_helpers_schema_creator.PrismaSchemaCreator;
9
- exports.getSchema = require_helpers_get_schema.getSchema;
9
+ exports.getSchema = require_get_schema.getSchema;
10
10
  exports.introspectSql = require_helpers_typed_sql.introspectSql;
@@ -1,4 +1,4 @@
1
- import { t as PowerlinesClientGenerator } from "../client-generator-W_Ly3nqA.mjs";
1
+ import { t as PowerlinesClientGenerator } from "../client-generator-BH-vK3UD.mjs";
2
2
  import { getSchema } from "./get-schema.mjs";
3
3
  import { PrismaSchemaCreator } from "./schema-creator.mjs";
4
4
  import { introspectSql } from "./typed-sql.mjs";
@@ -1,9 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_chunk = require('../chunk-CEeaYzDW.cjs');
3
2
  let prisma_util_schema_creator = require("prisma-util/schema-creator");
4
3
 
5
4
  //#region src/helpers/schema-creator.ts
6
- var schema_creator_exports = /* @__PURE__ */ require_chunk.__exportAll({ PrismaSchemaCreator: () => PrismaSchemaCreator });
7
5
  /**
8
6
  * Prisma schema creator that allows building a schema via code.
9
7
  */
@@ -60,10 +58,4 @@ ${schema}`;
60
58
  };
61
59
 
62
60
  //#endregion
63
- exports.PrismaSchemaCreator = PrismaSchemaCreator;
64
- Object.defineProperty(exports, 'schema_creator_exports', {
65
- enumerable: true,
66
- get: function () {
67
- return schema_creator_exports;
68
- }
69
- });
61
+ exports.PrismaSchemaCreator = PrismaSchemaCreator;
@@ -1,8 +1,6 @@
1
- import { t as __exportAll } from "../chunk-w6R9maHv.mjs";
2
1
  import { SchemaCreator } from "prisma-util/schema-creator";
3
2
 
4
3
  //#region src/helpers/schema-creator.ts
5
- var schema_creator_exports = /* @__PURE__ */ __exportAll({ PrismaSchemaCreator: () => PrismaSchemaCreator });
6
4
  /**
7
5
  * Prisma schema creator that allows building a schema via code.
8
6
  */
@@ -59,4 +57,4 @@ ${schema}`;
59
57
  };
60
58
 
61
59
  //#endregion
62
- export { PrismaSchemaCreator, schema_creator_exports as t };
60
+ export { PrismaSchemaCreator };
@@ -1,12 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_chunk = require('../chunk-CEeaYzDW.cjs');
3
2
  let _prisma_internals = require("@prisma/internals");
4
3
  let _prisma_migrate = require("@prisma/migrate");
5
4
  let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
6
5
  let _stryke_path_join = require("@stryke/path/join");
7
6
 
8
7
  //#region src/helpers/typed-sql.ts
9
- var typed_sql_exports = /* @__PURE__ */ require_chunk.__exportAll({ introspectSql: () => introspectSql });
10
8
  async function readTypedSqlFiles(context, typedSqlDirPath) {
11
9
  const files = await context.fs.list(typedSqlDirPath);
12
10
  const results = [];
@@ -36,10 +34,4 @@ async function introspectSql(context) {
36
34
  }
37
35
 
38
36
  //#endregion
39
- exports.introspectSql = introspectSql;
40
- Object.defineProperty(exports, 'typed_sql_exports', {
41
- enumerable: true,
42
- get: function () {
43
- return typed_sql_exports;
44
- }
45
- });
37
+ exports.introspectSql = introspectSql;
@@ -1,11 +1,9 @@
1
- import { t as __exportAll } from "../chunk-w6R9maHv.mjs";
2
1
  import { inferDirectoryConfig, isValidJsIdentifier } from "@prisma/internals";
3
2
  import { introspectSql as introspectSql$1 } from "@prisma/migrate";
4
3
  import { findFileExtension, findFileName, relativePath } from "@stryke/path/file-path-fns";
5
4
  import { joinPaths } from "@stryke/path/join";
6
5
 
7
6
  //#region src/helpers/typed-sql.ts
8
- var typed_sql_exports = /* @__PURE__ */ __exportAll({ introspectSql: () => introspectSql });
9
7
  async function readTypedSqlFiles(context, typedSqlDirPath) {
10
8
  const files = await context.fs.list(typedSqlDirPath);
11
9
  const results = [];
@@ -35,4 +33,4 @@ async function introspectSql(context) {
35
33
  }
36
34
 
37
35
  //#endregion
38
- export { introspectSql, typed_sql_exports as t };
36
+ export { introspectSql };
package/dist/index.cjs CHANGED
@@ -1,16 +1,15 @@
1
1
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_chunk = require('./chunk-CEeaYzDW.cjs');
3
- const require_client_generator = require('./client-generator-C1G5jFmH.cjs');
4
- const require_helpers_get_schema = require('./helpers/get-schema.cjs');
2
+ const require_get_schema = require('./get-schema-Ddq6Y5_l.cjs');
3
+ const require_client_generator = require('./client-generator-CNwLFHpf.cjs');
5
4
  const require_helpers_schema_creator = require('./helpers/schema-creator.cjs');
6
5
  const require_helpers_typed_sql = require('./helpers/typed-sql.cjs');
7
6
  let _powerlines_plugin_pulumi = require("@powerlines/plugin-pulumi");
8
- _powerlines_plugin_pulumi = require_chunk.__toESM(_powerlines_plugin_pulumi, 1);
7
+ _powerlines_plugin_pulumi = require_get_schema.__toESM(_powerlines_plugin_pulumi, 1);
9
8
  let _prisma_client_generator_registry = require("@prisma/client-generator-registry");
10
9
  let _prisma_engines = require("@prisma/engines");
11
10
  let _prisma_internals = require("@prisma/internals");
12
11
  let _pulumi_prisma_postgres = require("@pulumi/prisma-postgres");
13
- _pulumi_prisma_postgres = require_chunk.__toESM(_pulumi_prisma_postgres, 1);
12
+ _pulumi_prisma_postgres = require_get_schema.__toESM(_pulumi_prisma_postgres, 1);
14
13
  let _stryke_convert_to_array = require("@stryke/convert/to-array");
15
14
  let _stryke_path_append = require("@stryke/path/append");
16
15
  let _stryke_path_common = require("@stryke/path/common");
@@ -19,7 +18,7 @@ let _stryke_path_join_paths = require("@stryke/path/join-paths");
19
18
  let _stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
20
19
  let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
21
20
  let defu = require("defu");
22
- defu = require_chunk.__toESM(defu, 1);
21
+ defu = require_get_schema.__toESM(defu, 1);
23
22
  let powerlines_plugin_utils = require("powerlines/plugin-utils");
24
23
 
25
24
  //#region src/index.ts
@@ -68,7 +67,7 @@ const plugin = (options = {}) => {
68
67
  warnings: [],
69
68
  primaryDatasource: void 0
70
69
  };
71
- this.prisma.schema.schemas = await Promise.all((await this.fs.glob(this.config.prisma.schema.map((schema) => schema.includes("*") || this.fs.isFileSync(schema) ? schema : (0, _stryke_path_join_paths.joinPaths)(schema, "**/*.prisma")))).map(async (schema) => require_helpers_get_schema.getSchema(schema)));
70
+ this.prisma.schema.schemas = await Promise.all((await this.fs.glob(this.config.prisma.schema.map((schema) => schema.includes("*") || this.fs.isFileSync(schema) ? schema : (0, _stryke_path_join_paths.joinPaths)(schema, "**/*.prisma")))).map(async (schema) => require_get_schema.getSchema(schema)));
72
71
  this.prisma.schema = this.prisma.schema.schemas.reduce((ret, schema) => {
73
72
  ret.datasources.push(...schema.datasources);
74
73
  ret.generators.push(...schema.generators);
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PowerlinesClientGenerator } from "./client-generator-W_Ly3nqA.mjs";
1
+ import { t as PowerlinesClientGenerator } from "./client-generator-BH-vK3UD.mjs";
2
2
  import { getSchema } from "./helpers/get-schema.mjs";
3
3
  import { PrismaSchemaCreator } from "./helpers/schema-creator.mjs";
4
4
  import { introspectSql } from "./helpers/typed-sql.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-prisma",
3
- "version": "0.4.242",
3
+ "version": "0.4.244",
4
4
  "private": false,
5
5
  "description": "A Powerlines plugin to generate project code and a Prisma client from a Prisma schema (PSL).",
6
6
  "keywords": ["prisma", "powerlines", "storm-software", "powerlines-plugin"],
@@ -82,20 +82,6 @@
82
82
  "default": "./dist/helpers/client-generator.mjs"
83
83
  }
84
84
  },
85
- "./helpers/client-generator.test": {
86
- "require": {
87
- "types": "./dist/helpers/client-generator.test.d.cts",
88
- "default": "./dist/helpers/client-generator.test.cjs"
89
- },
90
- "import": {
91
- "types": "./dist/helpers/client-generator.test.d.mts",
92
- "default": "./dist/helpers/client-generator.test.mjs"
93
- },
94
- "default": {
95
- "types": "./dist/helpers/client-generator.test.d.mts",
96
- "default": "./dist/helpers/client-generator.test.mjs"
97
- }
98
- },
99
85
  "./helpers/get-schema": {
100
86
  "require": {
101
87
  "types": "./dist/helpers/get-schema.d.cts",
@@ -110,20 +96,6 @@
110
96
  "default": "./dist/helpers/get-schema.mjs"
111
97
  }
112
98
  },
113
- "./helpers/get-schema.test": {
114
- "require": {
115
- "types": "./dist/helpers/get-schema.test.d.cts",
116
- "default": "./dist/helpers/get-schema.test.cjs"
117
- },
118
- "import": {
119
- "types": "./dist/helpers/get-schema.test.d.mts",
120
- "default": "./dist/helpers/get-schema.test.mjs"
121
- },
122
- "default": {
123
- "types": "./dist/helpers/get-schema.test.d.mts",
124
- "default": "./dist/helpers/get-schema.test.mjs"
125
- }
126
- },
127
99
  "./helpers/schema-creator": {
128
100
  "require": {
129
101
  "types": "./dist/helpers/schema-creator.d.cts",
@@ -138,20 +110,6 @@
138
110
  "default": "./dist/helpers/schema-creator.mjs"
139
111
  }
140
112
  },
141
- "./helpers/schema-creator.test": {
142
- "require": {
143
- "types": "./dist/helpers/schema-creator.test.d.cts",
144
- "default": "./dist/helpers/schema-creator.test.cjs"
145
- },
146
- "import": {
147
- "types": "./dist/helpers/schema-creator.test.d.mts",
148
- "default": "./dist/helpers/schema-creator.test.mjs"
149
- },
150
- "default": {
151
- "types": "./dist/helpers/schema-creator.test.d.mts",
152
- "default": "./dist/helpers/schema-creator.test.mjs"
153
- }
154
- },
155
113
  "./helpers/typed-sql": {
156
114
  "require": {
157
115
  "types": "./dist/helpers/typed-sql.d.cts",
@@ -166,34 +124,6 @@
166
124
  "default": "./dist/helpers/typed-sql.mjs"
167
125
  }
168
126
  },
169
- "./helpers/typed-sql.test": {
170
- "require": {
171
- "types": "./dist/helpers/typed-sql.test.d.cts",
172
- "default": "./dist/helpers/typed-sql.test.cjs"
173
- },
174
- "import": {
175
- "types": "./dist/helpers/typed-sql.test.d.mts",
176
- "default": "./dist/helpers/typed-sql.test.mjs"
177
- },
178
- "default": {
179
- "types": "./dist/helpers/typed-sql.test.d.mts",
180
- "default": "./dist/helpers/typed-sql.test.mjs"
181
- }
182
- },
183
- "./index.test": {
184
- "require": {
185
- "types": "./dist/index.test.d.cts",
186
- "default": "./dist/index.test.cjs"
187
- },
188
- "import": {
189
- "types": "./dist/index.test.d.mts",
190
- "default": "./dist/index.test.mjs"
191
- },
192
- "default": {
193
- "types": "./dist/index.test.d.mts",
194
- "default": "./dist/index.test.mjs"
195
- }
196
- },
197
127
  "./package.json": "./package.json",
198
128
  "./types": {
199
129
  "require": {
@@ -244,7 +174,7 @@
244
174
  "typings": "dist/index.d.mts",
245
175
  "files": ["dist/**/*"],
246
176
  "dependencies": {
247
- "@powerlines/plugin-pulumi": "0.6.201",
177
+ "@powerlines/plugin-pulumi": "^0.6.203",
248
178
  "@prisma/client-generator-registry": "7.6.0",
249
179
  "@prisma/config": "7.6.0",
250
180
  "@prisma/dmmf": "7.6.0",
@@ -252,9 +182,9 @@
252
182
  "@prisma/get-platform": "6.19.3",
253
183
  "@prisma/migrate": "7.6.0",
254
184
  "@prisma/prisma-schema-wasm": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773",
255
- "@stryke/cli": "^0.13.54",
185
+ "@stryke/cli": "^0.13.55",
256
186
  "@stryke/convert": "^0.7.13",
257
- "@stryke/fs": "^0.33.82",
187
+ "@stryke/fs": "^0.33.83",
258
188
  "@stryke/path": "^0.29.9",
259
189
  "@stryke/string-format": "^0.17.24",
260
190
  "@stryke/type-checks": "^0.6.15",
@@ -262,16 +192,16 @@
262
192
  "defu": "^6.1.7",
263
193
  "fp-ts": "^2.16.11",
264
194
  "jiti": "^2.7.0",
265
- "powerlines": "0.47.99",
195
+ "powerlines": "^0.47.101",
266
196
  "prisma-util": "^2.1.1",
267
197
  "ts-pattern": "^5.9.0"
268
198
  },
269
199
  "devDependencies": {
270
- "@powerlines/plugin-plugin": "0.12.511",
200
+ "@powerlines/plugin-plugin": "^0.12.513",
271
201
  "@prisma/client-generator-ts": "7.6.0",
272
202
  "@pulumi/pulumi": "^3.244.0",
273
203
  "@types/node": "^25.9.1"
274
204
  },
275
205
  "publishConfig": { "access": "public" },
276
- "gitHead": "11b392585b2086772822dd103176c9d58e30dc9c"
206
+ "gitHead": "64a604fd5da7312baeeb58dfcef0fd3ace15174e"
277
207
  }
@@ -1,53 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __exportAll = (all, no_symbols) => {
9
- let target = {};
10
- for (var name in all) {
11
- __defProp(target, name, {
12
- get: all[name],
13
- enumerable: true
14
- });
15
- }
16
- if (!no_symbols) {
17
- __defProp(target, Symbol.toStringTag, { value: "Module" });
18
- }
19
- return target;
20
- };
21
- var __copyProps = (to, from, except, desc) => {
22
- if (from && typeof from === "object" || typeof from === "function") {
23
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
24
- key = keys[i];
25
- if (!__hasOwnProp.call(to, key) && key !== except) {
26
- __defProp(to, key, {
27
- get: ((k) => from[k]).bind(null, key),
28
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
29
- });
30
- }
31
- }
32
- }
33
- return to;
34
- };
35
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
36
- value: mod,
37
- enumerable: true
38
- }) : target, mod));
39
-
40
- //#endregion
41
-
42
- Object.defineProperty(exports, '__exportAll', {
43
- enumerable: true,
44
- get: function () {
45
- return __exportAll;
46
- }
47
- });
48
- Object.defineProperty(exports, '__toESM', {
49
- enumerable: true,
50
- get: function () {
51
- return __toESM;
52
- }
53
- });
@@ -1,18 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __defProp = Object.defineProperty;
3
- var __exportAll = (all, no_symbols) => {
4
- let target = {};
5
- for (var name in all) {
6
- __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
10
- }
11
- if (!no_symbols) {
12
- __defProp(target, Symbol.toStringTag, { value: "Module" });
13
- }
14
- return target;
15
- };
16
-
17
- //#endregion
18
- export { __exportAll as t };
@@ -1,15 +0,0 @@
1
- const require_client_generator = require('../client-generator-C1G5jFmH.cjs');
2
- let vitest = require("vitest");
3
-
4
- //#region src/helpers/client-generator.test.ts
5
- (0, vitest.describe)("plugins/plugin-prisma/src/helpers/client-generator.ts", () => {
6
- (0, vitest.it)("loads module exports", () => {
7
- (0, vitest.expect)(require_client_generator.client_generator_exports).toBeDefined();
8
- (0, vitest.expect)(typeof require_client_generator.client_generator_exports).toBe("object");
9
- });
10
- (0, vitest.it)("has at least one runtime export", () => {
11
- (0, vitest.expect)(Object.keys(require_client_generator.client_generator_exports).length).toBeGreaterThan(0);
12
- });
13
- });
14
-
15
- //#endregion
@@ -1,16 +0,0 @@
1
- import { n as client_generator_exports } from "../client-generator-W_Ly3nqA.mjs";
2
- import { describe, expect, it } from "vitest";
3
-
4
- //#region src/helpers/client-generator.test.ts
5
- describe("plugins/plugin-prisma/src/helpers/client-generator.ts", () => {
6
- it("loads module exports", () => {
7
- expect(client_generator_exports).toBeDefined();
8
- expect(typeof client_generator_exports).toBe("object");
9
- });
10
- it("has at least one runtime export", () => {
11
- expect(Object.keys(client_generator_exports).length).toBeGreaterThan(0);
12
- });
13
- });
14
-
15
- //#endregion
16
- export { };
@@ -1,15 +0,0 @@
1
- const require_helpers_get_schema = require('./get-schema.cjs');
2
- let vitest = require("vitest");
3
-
4
- //#region src/helpers/get-schema.test.ts
5
- (0, vitest.describe)("plugins/plugin-prisma/src/helpers/get-schema.ts", () => {
6
- (0, vitest.it)("loads module exports", () => {
7
- (0, vitest.expect)(require_helpers_get_schema.get_schema_exports).toBeDefined();
8
- (0, vitest.expect)(typeof require_helpers_get_schema.get_schema_exports).toBe("object");
9
- });
10
- (0, vitest.it)("has at least one runtime export", () => {
11
- (0, vitest.expect)(Object.keys(require_helpers_get_schema.get_schema_exports).length).toBeGreaterThan(0);
12
- });
13
- });
14
-
15
- //#endregion
@@ -1,16 +0,0 @@
1
- import { t as get_schema_exports } from "./get-schema.mjs";
2
- import { describe, expect, it } from "vitest";
3
-
4
- //#region src/helpers/get-schema.test.ts
5
- describe("plugins/plugin-prisma/src/helpers/get-schema.ts", () => {
6
- it("loads module exports", () => {
7
- expect(get_schema_exports).toBeDefined();
8
- expect(typeof get_schema_exports).toBe("object");
9
- });
10
- it("has at least one runtime export", () => {
11
- expect(Object.keys(get_schema_exports).length).toBeGreaterThan(0);
12
- });
13
- });
14
-
15
- //#endregion
16
- export { };
@@ -1,15 +0,0 @@
1
- const require_helpers_schema_creator = require('./schema-creator.cjs');
2
- let vitest = require("vitest");
3
-
4
- //#region src/helpers/schema-creator.test.ts
5
- (0, vitest.describe)("plugins/plugin-prisma/src/helpers/schema-creator.ts", () => {
6
- (0, vitest.it)("loads module exports", () => {
7
- (0, vitest.expect)(require_helpers_schema_creator.schema_creator_exports).toBeDefined();
8
- (0, vitest.expect)(typeof require_helpers_schema_creator.schema_creator_exports).toBe("object");
9
- });
10
- (0, vitest.it)("has at least one runtime export", () => {
11
- (0, vitest.expect)(Object.keys(require_helpers_schema_creator.schema_creator_exports).length).toBeGreaterThan(0);
12
- });
13
- });
14
-
15
- //#endregion
@@ -1,16 +0,0 @@
1
- import { t as schema_creator_exports } from "./schema-creator.mjs";
2
- import { describe, expect, it } from "vitest";
3
-
4
- //#region src/helpers/schema-creator.test.ts
5
- describe("plugins/plugin-prisma/src/helpers/schema-creator.ts", () => {
6
- it("loads module exports", () => {
7
- expect(schema_creator_exports).toBeDefined();
8
- expect(typeof schema_creator_exports).toBe("object");
9
- });
10
- it("has at least one runtime export", () => {
11
- expect(Object.keys(schema_creator_exports).length).toBeGreaterThan(0);
12
- });
13
- });
14
-
15
- //#endregion
16
- export { };
@@ -1,15 +0,0 @@
1
- const require_helpers_typed_sql = require('./typed-sql.cjs');
2
- let vitest = require("vitest");
3
-
4
- //#region src/helpers/typed-sql.test.ts
5
- (0, vitest.describe)("plugins/plugin-prisma/src/helpers/typed-sql.ts", () => {
6
- (0, vitest.it)("loads module exports", () => {
7
- (0, vitest.expect)(require_helpers_typed_sql.typed_sql_exports).toBeDefined();
8
- (0, vitest.expect)(typeof require_helpers_typed_sql.typed_sql_exports).toBe("object");
9
- });
10
- (0, vitest.it)("has at least one runtime export", () => {
11
- (0, vitest.expect)(Object.keys(require_helpers_typed_sql.typed_sql_exports).length).toBeGreaterThan(0);
12
- });
13
- });
14
-
15
- //#endregion
@@ -1,16 +0,0 @@
1
- import { t as typed_sql_exports } from "./typed-sql.mjs";
2
- import { describe, expect, it } from "vitest";
3
-
4
- //#region src/helpers/typed-sql.test.ts
5
- describe("plugins/plugin-prisma/src/helpers/typed-sql.ts", () => {
6
- it("loads module exports", () => {
7
- expect(typed_sql_exports).toBeDefined();
8
- expect(typeof typed_sql_exports).toBe("object");
9
- });
10
- it("has at least one runtime export", () => {
11
- expect(Object.keys(typed_sql_exports).length).toBeGreaterThan(0);
12
- });
13
- });
14
-
15
- //#endregion
16
- export { };
@@ -1,29 +0,0 @@
1
- const require_index = require('./index.cjs');
2
- let vitest = require("vitest");
3
-
4
- //#region src/index.test.ts
5
- (0, vitest.describe)("prisma plugin", () => {
6
- (0, vitest.it)("plugin is a function", () => {
7
- (0, vitest.expect)(typeof require_index.default).toBe("function");
8
- });
9
- (0, vitest.it)("plugin() returns an object", () => {
10
- const result = require_index.default();
11
- (0, vitest.expect)(typeof result).toBe("object");
12
- (0, vitest.expect)(result).not.toBeNull();
13
- });
14
- (0, vitest.it)("plugin() returns an object with a name property", () => {
15
- const result = require_index.default();
16
- (0, vitest.expect)(result).toHaveProperty("name");
17
- (0, vitest.expect)(typeof result.name).toBe("string");
18
- });
19
- (0, vitest.it)("plugin() accepts an empty options object", () => {
20
- (0, vitest.expect)(() => require_index.default({})).not.toThrow();
21
- });
22
- (0, vitest.it)("plugin() returns the same name for all calls", () => {
23
- const r1 = require_index.default();
24
- const r2 = require_index.default({});
25
- (0, vitest.expect)(r1.name).toBe(r2.name);
26
- });
27
- });
28
-
29
- //#endregion
@@ -1,30 +0,0 @@
1
- import plugin from "./index.mjs";
2
- import { describe, expect, it } from "vitest";
3
-
4
- //#region src/index.test.ts
5
- describe("prisma plugin", () => {
6
- it("plugin is a function", () => {
7
- expect(typeof plugin).toBe("function");
8
- });
9
- it("plugin() returns an object", () => {
10
- const result = plugin();
11
- expect(typeof result).toBe("object");
12
- expect(result).not.toBeNull();
13
- });
14
- it("plugin() returns an object with a name property", () => {
15
- const result = plugin();
16
- expect(result).toHaveProperty("name");
17
- expect(typeof result.name).toBe("string");
18
- });
19
- it("plugin() accepts an empty options object", () => {
20
- expect(() => plugin({})).not.toThrow();
21
- });
22
- it("plugin() returns the same name for all calls", () => {
23
- const r1 = plugin();
24
- const r2 = plugin({});
25
- expect(r1.name).toBe(r2.name);
26
- });
27
- });
28
-
29
- //#endregion
30
- export { };