@powerlines/plugin-prisma 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers/index.d.cts +1 -1
- package/dist/helpers/index.d.ts +1 -1
- package/dist/helpers/schema-creator.d.cts +1 -1
- package/dist/helpers/schema-creator.d.ts +1 -1
- package/dist/{index-PmSelLdL.d.cts → index-CG3S88IQ.d.cts} +3 -3
- package/dist/{index-CxPJK_7-.d.ts → index-CUlu9n5I.d.ts} +3 -3
- package/dist/src/index.cjs +2 -2
- package/dist/src/index.d.cts +2 -2
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +2 -2
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugin.d.cts +1 -1
- package/dist/types/plugin.d.ts +1 -1
- package/package.json +6 -6
package/dist/helpers/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { getSchema } from './get-schema.cjs';
|
|
2
|
-
export { P as PrismaSchemaCreator } from '../index-
|
|
2
|
+
export { P as PrismaSchemaCreator } from '../index-CG3S88IQ.cjs';
|
|
3
3
|
import '../types/prisma.cjs';
|
|
4
4
|
import '@storm-software/build-tools/types';
|
|
5
5
|
import '@storm-software/config-tools/types';
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { getSchema } from './get-schema.js';
|
|
2
|
-
export { P as PrismaSchemaCreator } from '../index-
|
|
2
|
+
export { P as PrismaSchemaCreator } from '../index-CUlu9n5I.js';
|
|
3
3
|
import '../types/prisma.js';
|
|
4
4
|
import '@storm-software/build-tools/types';
|
|
5
5
|
import '@storm-software/config-tools/types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'prisma-util/schema-creator';
|
|
2
|
-
export { P as PrismaSchemaCreator } from '../index-
|
|
2
|
+
export { P as PrismaSchemaCreator } from '../index-CG3S88IQ.cjs';
|
|
3
3
|
import '../types/prisma.cjs';
|
|
4
4
|
import '@storm-software/build-tools/types';
|
|
5
5
|
import '@storm-software/config-tools/types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'prisma-util/schema-creator';
|
|
2
|
-
export { P as PrismaSchemaCreator } from '../index-
|
|
2
|
+
export { P as PrismaSchemaCreator } from '../index-CUlu9n5I.js';
|
|
3
3
|
import '../types/prisma.js';
|
|
4
4
|
import '@storm-software/build-tools/types';
|
|
5
5
|
import '@storm-software/config-tools/types';
|
|
@@ -1340,7 +1340,7 @@ interface PrismaPluginOptions {
|
|
|
1340
1340
|
*
|
|
1341
1341
|
* @defaultValue "\{builtinPath\}/prisma"
|
|
1342
1342
|
*/
|
|
1343
|
-
|
|
1343
|
+
outputPath?: string;
|
|
1344
1344
|
/**
|
|
1345
1345
|
* Additional parameters to pass to the Prisma CLI
|
|
1346
1346
|
*/
|
|
@@ -1351,10 +1351,10 @@ interface PrismaPluginOptions {
|
|
|
1351
1351
|
prismaPath?: string;
|
|
1352
1352
|
}
|
|
1353
1353
|
type PrismaPluginUserConfig = UserConfig & {
|
|
1354
|
-
prisma?: Omit<PrismaPluginOptions, "schema" | "
|
|
1354
|
+
prisma?: Omit<PrismaPluginOptions, "schema" | "outputPath" | "configFile"> & Required<Pick<PrismaPluginOptions, "schema" | "outputPath" | "configFile">>;
|
|
1355
1355
|
};
|
|
1356
1356
|
type PrismaPluginResolvedConfig = ResolvedConfig & {
|
|
1357
|
-
prisma: Omit<PrismaPluginOptions, "schema" | "
|
|
1357
|
+
prisma: Omit<PrismaPluginOptions, "schema" | "outputPath" | "configFile"> & Required<Pick<PrismaPluginOptions, "schema" | "outputPath" | "configFile">>;
|
|
1358
1358
|
};
|
|
1359
1359
|
type PrismaPluginContext<TResolvedConfig extends PrismaPluginResolvedConfig = PrismaPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
1360
1360
|
prisma: {
|
|
@@ -1340,7 +1340,7 @@ interface PrismaPluginOptions {
|
|
|
1340
1340
|
*
|
|
1341
1341
|
* @defaultValue "\{builtinPath\}/prisma"
|
|
1342
1342
|
*/
|
|
1343
|
-
|
|
1343
|
+
outputPath?: string;
|
|
1344
1344
|
/**
|
|
1345
1345
|
* Additional parameters to pass to the Prisma CLI
|
|
1346
1346
|
*/
|
|
@@ -1351,10 +1351,10 @@ interface PrismaPluginOptions {
|
|
|
1351
1351
|
prismaPath?: string;
|
|
1352
1352
|
}
|
|
1353
1353
|
type PrismaPluginUserConfig = UserConfig & {
|
|
1354
|
-
prisma?: Omit<PrismaPluginOptions, "schema" | "
|
|
1354
|
+
prisma?: Omit<PrismaPluginOptions, "schema" | "outputPath" | "configFile"> & Required<Pick<PrismaPluginOptions, "schema" | "outputPath" | "configFile">>;
|
|
1355
1355
|
};
|
|
1356
1356
|
type PrismaPluginResolvedConfig = ResolvedConfig & {
|
|
1357
|
-
prisma: Omit<PrismaPluginOptions, "schema" | "
|
|
1357
|
+
prisma: Omit<PrismaPluginOptions, "schema" | "outputPath" | "configFile"> & Required<Pick<PrismaPluginOptions, "schema" | "outputPath" | "configFile">>;
|
|
1358
1358
|
};
|
|
1359
1359
|
type PrismaPluginContext<TResolvedConfig extends PrismaPluginResolvedConfig = PrismaPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
1360
1360
|
prisma: {
|
package/dist/src/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),execute=require('@stryke/cli/execute'),exists=require('@stryke/fs/exists'),packageFns=require('@stryke/fs/package-fns'),joinPaths=require('@stryke/path/join-paths'),replace=require('@stryke/path/replace'),
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),execute=require('@stryke/cli/execute'),exists=require('@stryke/fs/exists'),packageFns=require('@stryke/fs/package-fns'),joinPaths=require('@stryke/path/join-paths'),replace=require('@stryke/path/replace'),f=require('defu'),getConfigPath=require('powerlines/plugin-utils/get-config-path'),paths=require('powerlines/plugin-utils/paths'),getSchema=require('./helpers/get-schema'),schemaCreator=require('./helpers/schema-creator'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var f__default=/*#__PURE__*/_interopDefault(f);/*****************************************
|
|
2
2
|
*
|
|
3
3
|
* ⚡ Built by Storm Software
|
|
4
4
|
*
|
|
5
5
|
*****************************************/
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const P=chunkFBBMZ4NC_cjs.a((e={})=>({name:"prisma",config(){return {prisma:f__default.default(e,{schema:joinPaths.joinPaths(this.config.projectRoot,"prisma","schema.prisma"),configFile:e.configFile||getConfigPath.getConfigPath(this,"prisma.config"),outputPath:joinPaths.joinPaths("{builtinPath}","prisma")})}},async configResolved(){if(this.dependencies["@prisma/client"]="latest",this.config.prisma.configFile=paths.replacePathTokens(this,this.config.prisma.configFile),!this.config.prisma.schema)throw new Error("Prisma schema path is not defined. Please specify a valid path in the plugin configuration.");if(this.config.prisma.schema=paths.replacePathTokens(this,this.config.prisma.schema),!this.config.prisma.outputPath)throw new Error("Prisma generated path is not defined. Please specify a valid path in the plugin configuration.");this.config.prisma.outputPath=paths.replacePathTokens(this,this.config.prisma.outputPath),this.prisma??={},exists.existsSync(this.config.prisma.schema)?this.prisma.schema=await getSchema.getSchema({datamodel:this.config.prisma.schema}):this.prisma.schema??={generators:[],datasources:[],warnings:[]};const i=this.prisma.schema.generators.find(t=>t.provider.value==="prisma-client-js");i?i.output??={value:this.config.prisma.outputPath,fromEnvVar:null}:this.prisma.schema.generators.push({name:"prisma-client-js",provider:{value:"prisma-client-js",fromEnvVar:null},output:{value:this.config.prisma.outputPath,fromEnvVar:null},config:{},binaryTargets:[],previewFeatures:[],sourceFilePath:this.config.prisma.schema}),this.prisma.builder=new schemaCreator.PrismaSchemaCreator(this);},async prepare(){await this.prisma.builder.write();const i=["generate","--schema",this.config.prisma.schema];if(this.config.prisma.prismaPath){i.unshift(this.config.prisma.prismaPath);const t=await execute.execute(i.join(" "),this.config.projectRoot);if(t.failed)throw new Error(`Prisma process exited with code ${t.exitCode}.`)}else {const t=await packageFns.isPackageListed("prisma",this.config.projectRoot);i.unshift(t?replace.replacePath(this.config.sourceRoot,this.config.projectRoot):this.config.sourceRoot);const a=await execute.executePackage("prisma",i,joinPaths.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot));if(a.failed)throw new Error(`Prisma process exited with code ${a.exitCode}.`)}}}),"plugin");var U=P;exports.default=U;exports.plugin=P;Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
|
package/dist/src/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as PrismaPluginContext, b as PrismaPluginOptions, c as Plugin } from '../index-
|
|
2
|
-
export { e as PrismaPluginResolvedConfig, d as PrismaPluginUserConfig } from '../index-
|
|
1
|
+
import { a as PrismaPluginContext, b as PrismaPluginOptions, c as Plugin } from '../index-CG3S88IQ.cjs';
|
|
2
|
+
export { e as PrismaPluginResolvedConfig, d as PrismaPluginUserConfig } from '../index-CG3S88IQ.cjs';
|
|
3
3
|
export { ActiveConnectorType, BinaryTargetsEnvValue, ConnectorType, DataSource, EnvPaths, EnvValue, GeneratorConfig, GetSchemaOptions, GetSchemaResponse, MultipleSchemas, PrismaSchema, SchemaFileInput } from '../types/prisma.cjs';
|
|
4
4
|
import '@storm-software/build-tools/types';
|
|
5
5
|
import '@storm-software/config-tools/types';
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as PrismaPluginContext, b as PrismaPluginOptions, c as Plugin } from '../index-
|
|
2
|
-
export { e as PrismaPluginResolvedConfig, d as PrismaPluginUserConfig } from '../index-
|
|
1
|
+
import { a as PrismaPluginContext, b as PrismaPluginOptions, c as Plugin } from '../index-CUlu9n5I.js';
|
|
2
|
+
export { e as PrismaPluginResolvedConfig, d as PrismaPluginUserConfig } from '../index-CUlu9n5I.js';
|
|
3
3
|
export { ActiveConnectorType, BinaryTargetsEnvValue, ConnectorType, DataSource, EnvPaths, EnvValue, GeneratorConfig, GetSchemaOptions, GetSchemaResponse, MultipleSchemas, PrismaSchema, SchemaFileInput } from '../types/prisma.js';
|
|
4
4
|
import '@storm-software/build-tools/types';
|
|
5
5
|
import '@storm-software/config-tools/types';
|
package/dist/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {a}from'../chunk-UCUR73HG.js';import {execute,executePackage}from'@stryke/cli/execute';import {existsSync}from'@stryke/fs/exists';import {isPackageListed}from'@stryke/fs/package-fns';import {joinPaths}from'@stryke/path/join-paths';import {replacePath}from'@stryke/path/replace';import
|
|
1
|
+
import {a}from'../chunk-UCUR73HG.js';import {execute,executePackage}from'@stryke/cli/execute';import {existsSync}from'@stryke/fs/exists';import {isPackageListed}from'@stryke/fs/package-fns';import {joinPaths}from'@stryke/path/join-paths';import {replacePath}from'@stryke/path/replace';import f from'defu';import {getConfigPath}from'powerlines/plugin-utils/get-config-path';import {replacePathTokens}from'powerlines/plugin-utils/paths';import {getSchema}from'./helpers/get-schema';import {PrismaSchemaCreator}from'./helpers/schema-creator';export*from'./types';/*****************************************
|
|
2
2
|
*
|
|
3
3
|
* ⚡ Built by Storm Software
|
|
4
4
|
*
|
|
5
5
|
*****************************************/
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const P=a((e={})=>({name:"prisma",config(){return {prisma:f(e,{schema:joinPaths(this.config.projectRoot,"prisma","schema.prisma"),configFile:e.configFile||getConfigPath(this,"prisma.config"),outputPath:joinPaths("{builtinPath}","prisma")})}},async configResolved(){if(this.dependencies["@prisma/client"]="latest",this.config.prisma.configFile=replacePathTokens(this,this.config.prisma.configFile),!this.config.prisma.schema)throw new Error("Prisma schema path is not defined. Please specify a valid path in the plugin configuration.");if(this.config.prisma.schema=replacePathTokens(this,this.config.prisma.schema),!this.config.prisma.outputPath)throw new Error("Prisma generated path is not defined. Please specify a valid path in the plugin configuration.");this.config.prisma.outputPath=replacePathTokens(this,this.config.prisma.outputPath),this.prisma??={},existsSync(this.config.prisma.schema)?this.prisma.schema=await getSchema({datamodel:this.config.prisma.schema}):this.prisma.schema??={generators:[],datasources:[],warnings:[]};const i=this.prisma.schema.generators.find(t=>t.provider.value==="prisma-client-js");i?i.output??={value:this.config.prisma.outputPath,fromEnvVar:null}:this.prisma.schema.generators.push({name:"prisma-client-js",provider:{value:"prisma-client-js",fromEnvVar:null},output:{value:this.config.prisma.outputPath,fromEnvVar:null},config:{},binaryTargets:[],previewFeatures:[],sourceFilePath:this.config.prisma.schema}),this.prisma.builder=new PrismaSchemaCreator(this);},async prepare(){await this.prisma.builder.write();const i=["generate","--schema",this.config.prisma.schema];if(this.config.prisma.prismaPath){i.unshift(this.config.prisma.prismaPath);const t=await execute(i.join(" "),this.config.projectRoot);if(t.failed)throw new Error(`Prisma process exited with code ${t.exitCode}.`)}else {const t=await isPackageListed("prisma",this.config.projectRoot);i.unshift(t?replacePath(this.config.sourceRoot,this.config.projectRoot):this.config.sourceRoot);const a=await executePackage("prisma",i,joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot));if(a.failed)throw new Error(`Prisma process exited with code ${a.exitCode}.`)}}}),"plugin");var $=P;export{$ as default,P as plugin};
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as PrismaPluginContext, b as PrismaPluginOptions, e as PrismaPluginResolvedConfig, d as PrismaPluginUserConfig } from '../index-
|
|
1
|
+
export { a as PrismaPluginContext, b as PrismaPluginOptions, e as PrismaPluginResolvedConfig, d as PrismaPluginUserConfig } from '../index-CG3S88IQ.cjs';
|
|
2
2
|
export { ActiveConnectorType, BinaryTargetsEnvValue, ConnectorType, DataSource, EnvPaths, EnvValue, GeneratorConfig, GetSchemaOptions, GetSchemaResponse, MultipleSchemas, PrismaSchema, SchemaFileInput } from './prisma.cjs';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as PrismaPluginContext, b as PrismaPluginOptions, e as PrismaPluginResolvedConfig, d as PrismaPluginUserConfig } from '../index-
|
|
1
|
+
export { a as PrismaPluginContext, b as PrismaPluginOptions, e as PrismaPluginResolvedConfig, d as PrismaPluginUserConfig } from '../index-CUlu9n5I.js';
|
|
2
2
|
export { ActiveConnectorType, BinaryTargetsEnvValue, ConnectorType, DataSource, EnvPaths, EnvValue, GeneratorConfig, GetSchemaOptions, GetSchemaResponse, MultipleSchemas, PrismaSchema, SchemaFileInput } from './prisma.js';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as PrismaPluginContext, b as PrismaPluginOptions, e as PrismaPluginResolvedConfig, d as PrismaPluginUserConfig } from '../index-
|
|
1
|
+
export { a as PrismaPluginContext, b as PrismaPluginOptions, e as PrismaPluginResolvedConfig, d as PrismaPluginUserConfig } from '../index-CG3S88IQ.cjs';
|
|
2
2
|
import './prisma.cjs';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as PrismaPluginContext, b as PrismaPluginOptions, e as PrismaPluginResolvedConfig, d as PrismaPluginUserConfig } from '../index-
|
|
1
|
+
export { a as PrismaPluginContext, b as PrismaPluginOptions, e as PrismaPluginResolvedConfig, d as PrismaPluginUserConfig } from '../index-CUlu9n5I.js';
|
|
2
2
|
import './prisma.js';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-prisma",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to generate project code and a Prisma client from a Prisma schema (PSL).",
|
|
6
6
|
"repository": {
|
|
@@ -134,18 +134,18 @@
|
|
|
134
134
|
"@stryke/cli": "^0.12.4",
|
|
135
135
|
"defu": "^6.1.4",
|
|
136
136
|
"jiti": "^2.6.1",
|
|
137
|
-
"powerlines": "^0.
|
|
137
|
+
"powerlines": "^0.17.0",
|
|
138
138
|
"ts-pattern": "^5.9.0",
|
|
139
139
|
"prisma-util": "^2.1.1",
|
|
140
|
-
"@prisma/get-platform": "^6.
|
|
140
|
+
"@prisma/get-platform": "^6.19.0",
|
|
141
141
|
"@prisma/prisma-schema-wasm": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773",
|
|
142
142
|
"fp-ts": "^2.16.11"
|
|
143
143
|
},
|
|
144
144
|
"devDependencies": {
|
|
145
|
-
"@powerlines/nx": "^0.10.
|
|
146
|
-
"@powerlines/plugin-plugin": "^0.11.
|
|
145
|
+
"@powerlines/nx": "^0.10.2",
|
|
146
|
+
"@powerlines/plugin-plugin": "^0.11.10",
|
|
147
147
|
"@types/node": "^22.19.0"
|
|
148
148
|
},
|
|
149
149
|
"publishConfig": { "access": "public" },
|
|
150
|
-
"gitHead": "
|
|
150
|
+
"gitHead": "27064ac269a2d34c5b9371105cdd58bf6ebe85b4"
|
|
151
151
|
}
|