@powerlines/plugin-prisma 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +294 -0
- package/dist/chunk-FBBMZ4NC.cjs +7 -0
- package/dist/chunk-UCUR73HG.js +7 -0
- package/dist/helpers/get-schema.cjs +7 -0
- package/dist/helpers/get-schema.d.cts +11 -0
- package/dist/helpers/get-schema.d.ts +11 -0
- package/dist/helpers/get-schema.js +7 -0
- package/dist/helpers/index.cjs +1 -0
- package/dist/helpers/index.d.cts +24 -0
- package/dist/helpers/index.d.ts +24 -0
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/schema-creator.cjs +20 -0
- package/dist/helpers/schema-creator.d.cts +23 -0
- package/dist/helpers/schema-creator.d.ts +23 -0
- package/dist/helpers/schema-creator.js +20 -0
- package/dist/index-CxPJK_7-.d.ts +1366 -0
- package/dist/index-PmSelLdL.d.cts +1366 -0
- package/dist/src/index.cjs +7 -0
- package/dist/src/index.d.cts +34 -0
- package/dist/src/index.d.ts +34 -0
- package/dist/src/index.js +7 -0
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.d.cts +23 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.js +1 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +23 -0
- package/dist/types/plugin.d.ts +23 -0
- package/dist/types/plugin.js +0 -0
- package/dist/types/prisma.cjs +1 -0
- package/dist/types/prisma.d.cts +71 -0
- package/dist/types/prisma.d.ts +71 -0
- package/dist/types/prisma.js +0 -0
- package/package.json +151 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import 'prisma-util/schema-creator';
|
|
2
|
+
export { P as PrismaSchemaCreator } from '../index-PmSelLdL.cjs';
|
|
3
|
+
import '../types/prisma.cjs';
|
|
4
|
+
import '@storm-software/build-tools/types';
|
|
5
|
+
import '@storm-software/config-tools/types';
|
|
6
|
+
import '@storm-software/config/types';
|
|
7
|
+
import '@stryke/types/base';
|
|
8
|
+
import '@stryke/types/configuration';
|
|
9
|
+
import '@stryke/types/file';
|
|
10
|
+
import 'vite';
|
|
11
|
+
import '@stryke/env/get-env-paths';
|
|
12
|
+
import '@stryke/types/package-json';
|
|
13
|
+
import 'jiti';
|
|
14
|
+
import 'oxc-parser';
|
|
15
|
+
import 'semver';
|
|
16
|
+
import 'unplugin';
|
|
17
|
+
import '@stryke/types/tsconfig';
|
|
18
|
+
import 'typescript';
|
|
19
|
+
import '@stryke/json/types';
|
|
20
|
+
import 'memfs';
|
|
21
|
+
import 'node:fs';
|
|
22
|
+
import 'unionfs';
|
|
23
|
+
import '@stryke/types/array';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import 'prisma-util/schema-creator';
|
|
2
|
+
export { P as PrismaSchemaCreator } from '../index-CxPJK_7-.js';
|
|
3
|
+
import '../types/prisma.js';
|
|
4
|
+
import '@storm-software/build-tools/types';
|
|
5
|
+
import '@storm-software/config-tools/types';
|
|
6
|
+
import '@storm-software/config/types';
|
|
7
|
+
import '@stryke/types/base';
|
|
8
|
+
import '@stryke/types/configuration';
|
|
9
|
+
import '@stryke/types/file';
|
|
10
|
+
import 'vite';
|
|
11
|
+
import '@stryke/env/get-env-paths';
|
|
12
|
+
import '@stryke/types/package-json';
|
|
13
|
+
import 'jiti';
|
|
14
|
+
import 'oxc-parser';
|
|
15
|
+
import 'semver';
|
|
16
|
+
import 'unplugin';
|
|
17
|
+
import '@stryke/types/tsconfig';
|
|
18
|
+
import 'typescript';
|
|
19
|
+
import '@stryke/json/types';
|
|
20
|
+
import 'memfs';
|
|
21
|
+
import 'node:fs';
|
|
22
|
+
import 'unionfs';
|
|
23
|
+
import '@stryke/types/array';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {a}from'../chunk-UCUR73HG.js';import {SchemaCreator}from'prisma-util/schema-creator';/*****************************************
|
|
2
|
+
*
|
|
3
|
+
* ⚡ Built by Storm Software
|
|
4
|
+
*
|
|
5
|
+
*****************************************/
|
|
6
|
+
|
|
7
|
+
class P extends SchemaCreator{static{a(this,"PrismaSchemaCreator");}#e;get generators(){return this.#e.prisma.schema.generators}set generators(r){this.#e.prisma.schema.generators=r;}constructor(r){super(),this.#e=r,this.#e.prisma??={},this.#e.prisma.schema??={generators:[],datasources:[],warnings:[]},this.#e.prisma.schema.generators.forEach(e=>{this.pushGenerator(e);});}pushGenerator(r){return this.generators.some(e=>e.name===r.name)?this.generators=[...this.generators.filter(e=>e.name!==r.name),r]:this.generators.push(r),this}build(){let r=super.build();for(const e of this.generators)r=`
|
|
8
|
+
generator ${e.name} {
|
|
9
|
+
provider = "${e.provider.value}"
|
|
10
|
+
output = "${e.output?.value}"${e.previewFeatures&&e.previewFeatures.length>0?`
|
|
11
|
+
previewFeatures = [${e.previewFeatures.map(t=>`"${t}"`).join(", ")}]`:""}${e.config&&Object.keys(e.config).length>0?Object.entries(e.config).map(([t,s])=>Array.isArray(s)?`${t} = [${s.map(i=>`"${i}"`).join(", ")}]`:`${t} = "${s}"`).join(`
|
|
12
|
+
`):""}${e.binaryTargets&&e.binaryTargets.length>0?`
|
|
13
|
+
binaryTargets = [${e.binaryTargets.map(t=>`"${t.value}"`).join(", ")}]`:""}${e.envPaths?.rootEnvPath||e.envPaths?.schemaEnvPath?`
|
|
14
|
+
env = {${e.envPaths?.rootEnvPath?`
|
|
15
|
+
root = "${e.envPaths.rootEnvPath}"`:""}${e.envPaths?.schemaEnvPath?`
|
|
16
|
+
schema = "${e.envPaths.schemaEnvPath}"`:""}
|
|
17
|
+
}`:""}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
${r}`;return r}async write(){await this.#e.fs.writeFile(this.#e.config.prisma.schema,this.build(),{mode:"fs"});}}export{P as PrismaSchemaCreator};
|