@powerlines/plugin-prisma 0.4.0 → 0.4.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/api/client/types.gen.d.cts.map +1 -1
- package/dist/api/core/pathSerializer.gen.d.cts +2 -2
- package/dist/api/core/pathSerializer.gen.d.cts.map +1 -1
- package/dist/api/core/pathSerializer.gen.d.mts +2 -2
- package/dist/index.cjs +9 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +9 -4
- package/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/@stryke_string-format@0.16.0/node_modules/@stryke/string-format/dist/constant-case.cjs +31 -0
- package/dist/node_modules/.pnpm/@stryke_string-format@0.16.0/node_modules/@stryke/string-format/dist/constant-case.mjs +32 -0
- package/dist/node_modules/.pnpm/@stryke_string-format@0.16.0/node_modules/@stryke/string-format/dist/constant-case.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_string-format@0.16.0/node_modules/@stryke/string-format/dist/snake-case.cjs +17 -0
- package/dist/node_modules/.pnpm/@stryke_string-format@0.16.0/node_modules/@stryke/string-format/dist/snake-case.mjs +17 -0
- package/dist/node_modules/.pnpm/@stryke_string-format@0.16.0/node_modules/@stryke/string-format/dist/snake-case.mjs.map +1 -0
- package/dist/types/prisma.d.cts.map +1 -1
- package/dist/types/prisma.d.mts.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.gen.d.cts","names":[],"sources":["../../../src/api/client/types.gen.ts"],"sourcesContent":[],"mappings":";;;;;;KAaY,aAAA;UAEK,iBAAiB,gBAAgB,uBACxC,KAAK,6CACX;EAJQ;AAEZ;;EAAkD,OAAA,CAAA,EAMtC,CANsC,CAAA,SAAA,CAAA;EACnC;;;;;;EACX,KAAA,CAAA,EAAA,OAWa,KAXb;EAAU;AAiDd;;;;;EAUM,IAAA,CAAA,EAAA,KAAA;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ObjectSeparatorStyle = ObjectStyle | MatrixStyle;
|
|
|
19
19
|
interface SerializePrimitiveParam extends SerializePrimitiveOptions {
|
|
20
20
|
value: string;
|
|
21
21
|
}
|
|
22
|
-
declare const separatorArrayExplode: (style: ArraySeparatorStyle) => "
|
|
22
|
+
declare const separatorArrayExplode: (style: ArraySeparatorStyle) => "&" | "." | ";" | ",";
|
|
23
23
|
declare const separatorArrayNoExplode: (style: ArraySeparatorStyle) => "," | "|" | "%20";
|
|
24
|
-
declare const separatorObjectExplode: (style: ObjectSeparatorStyle) => "
|
|
24
|
+
declare const separatorObjectExplode: (style: ObjectSeparatorStyle) => "&" | "." | ";" | ",";
|
|
25
25
|
declare const serializeArrayParam: ({
|
|
26
26
|
allowReserved,
|
|
27
27
|
explode,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathSerializer.gen.d.cts","names":[],"sources":["../../../src/api/core/pathSerializer.gen.ts"],"sourcesContent":[],"mappings":";UAEU,4BACA,2BACN,kBAAkB;UAEZ,yBAAA,CAFY;EADZ,aAAA,CAAA,EAAA,OAAA;EACN,IAAA,EAAA,MAAA;;AAEM,UAKO,iBALkB,CAAA,CAAA,CAAA,CAAA;EAKlB;AAQjB;AACA;EACK,OAAA,EAAA,OAAW;EACJ,KAAA,EANH,CAMG;AAAoC;AAGtC,KANE,UAAA,GAMF,MAAwB,GAAA,gBAAQ,GAAA,
|
|
1
|
+
{"version":3,"file":"pathSerializer.gen.d.cts","names":[],"sources":["../../../src/api/core/pathSerializer.gen.ts"],"sourcesContent":[],"mappings":";UAEU,4BACA,2BACN,kBAAkB;UAEZ,yBAAA,CAFY;EADZ,aAAA,CAAA,EAAA,OAAA;EACN,IAAA,EAAA,MAAA;;AAEM,UAKO,iBALkB,CAAA,CAAA,CAAA,CAAA;EAKlB;AAQjB;AACA;EACK,OAAA,EAAA,OAAW;EACJ,KAAA,EANH,CAMG;AAAoC;AAGtC,KANE,UAAA,GAMF,MAAwB,GAAA,gBAAQ,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6BAAA,GAAA,EAAA;AAAA,sCAAA,GAAA,EAAA;AAAA,8BAAA,GAAA,EAAA"}
|
|
@@ -19,9 +19,9 @@ type ObjectSeparatorStyle = ObjectStyle | MatrixStyle;
|
|
|
19
19
|
interface SerializePrimitiveParam extends SerializePrimitiveOptions {
|
|
20
20
|
value: string;
|
|
21
21
|
}
|
|
22
|
-
declare const separatorArrayExplode: (style: ArraySeparatorStyle) => "
|
|
22
|
+
declare const separatorArrayExplode: (style: ArraySeparatorStyle) => "&" | "." | ";" | ",";
|
|
23
23
|
declare const separatorArrayNoExplode: (style: ArraySeparatorStyle) => "," | "|" | "%20";
|
|
24
|
-
declare const separatorObjectExplode: (style: ObjectSeparatorStyle) => "
|
|
24
|
+
declare const separatorObjectExplode: (style: ObjectSeparatorStyle) => "&" | "." | ";" | ",";
|
|
25
25
|
declare const serializeArrayParam: ({
|
|
26
26
|
allowReserved,
|
|
27
27
|
explode,
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
+
const require_constant_case = require('./node_modules/.pnpm/@stryke_string-format@0.16.0/node_modules/@stryke/string-format/dist/constant-case.cjs');
|
|
3
4
|
const require_kebab_case = require('./node_modules/.pnpm/@stryke_string-format@0.16.0/node_modules/@stryke/string-format/dist/kebab-case.cjs');
|
|
4
5
|
const require_helpers_get_schema = require('./helpers/get-schema.cjs');
|
|
5
6
|
const require_helpers_schema_creator = require('./helpers/schema-creator.cjs');
|
|
@@ -101,10 +102,14 @@ const plugin = (options = {}) => {
|
|
|
101
102
|
name: `${this.config.prisma.prismaPostgres?.databaseName || `${require_kebab_case.kebabCase(this.config.name)}.${this.config.mode}.${this.config.prisma.prismaPostgres?.region}`}`,
|
|
102
103
|
region: `${this.config.prisma.prismaPostgres?.region}`
|
|
103
104
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
return {
|
|
106
|
+
project,
|
|
107
|
+
database,
|
|
108
|
+
connection: new __pulumi_prisma_postgres.Connection("connection", {
|
|
109
|
+
databaseId: database.id,
|
|
110
|
+
name: `${require_constant_case.constantCase(this.config.name)}_API_KEY`
|
|
111
|
+
})
|
|
112
|
+
};
|
|
108
113
|
}
|
|
109
114
|
}
|
|
110
115
|
};
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;aAuCa;EAJgB;;;;;AAc7B;;;AAGW,cAHE,MAGF,EAAA,CAAA,iBAFQ,mBAER,GAF8B,mBAE9B,CAAA,CAAA,OAAA,CAAA,EAAA,mBAAA,EAAA,GACR,MADQ,CACD,QADC,CAAA"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;aAuCa;EAJgB;;;;;AAc7B;;;AAGW,cAHE,MAGF,EAAA,CAAA,iBAFQ,mBAER,GAF8B,mBAE9B,CAAA,CAAA,OAAA,CAAA,EAAA,mBAAA,EAAA,GACR,MADQ,CACD,QADC,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { constantCase } from "./node_modules/.pnpm/@stryke_string-format@0.16.0/node_modules/@stryke/string-format/dist/constant-case.mjs";
|
|
1
2
|
import { kebabCase } from "./node_modules/.pnpm/@stryke_string-format@0.16.0/node_modules/@stryke/string-format/dist/kebab-case.mjs";
|
|
2
3
|
import { getSchema } from "./helpers/get-schema.mjs";
|
|
3
4
|
import { PrismaSchemaCreator } from "./helpers/schema-creator.mjs";
|
|
@@ -97,10 +98,14 @@ const plugin = (options = {}) => {
|
|
|
97
98
|
name: `${this.config.prisma.prismaPostgres?.databaseName || `${kebabCase(this.config.name)}.${this.config.mode}.${this.config.prisma.prismaPostgres?.region}`}`,
|
|
98
99
|
region: `${this.config.prisma.prismaPostgres?.region}`
|
|
99
100
|
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
return {
|
|
102
|
+
project,
|
|
103
|
+
database,
|
|
104
|
+
connection: new prismaPostgres.Connection("connection", {
|
|
105
|
+
databaseId: database.id,
|
|
106
|
+
name: `${constantCase(this.config.name)}_API_KEY`
|
|
107
|
+
})
|
|
108
|
+
};
|
|
104
109
|
}
|
|
105
110
|
}
|
|
106
111
|
};
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport * as prismaPostgres from \"@pulumi/prisma-postgres\";\nimport { execute, executePackage } from \"@stryke/cli/execute\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { getConfigPath, replacePathTokens } from \"powerlines/plugin-utils\";\nimport { getSchema } from \"./helpers/get-schema\";\nimport { PrismaSchemaCreator } from \"./helpers/schema-creator\";\nimport {\n PrismaPluginContext,\n PrismaPluginOptions,\n PrismaPluginUserConfig\n} from \"./types/plugin\";\n\nexport type * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n prisma?: PrismaPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate Prisma for code generation.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends PrismaPluginContext = PrismaPluginContext\n>(\n options: PrismaPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"prisma\",\n config() {\n return {\n prisma: defu(options, {\n schema: joinPaths(this.config.root, \"prisma\", \"schema.prisma\"),\n configFile:\n options.configFile || getConfigPath(this, \"prisma.config\"),\n outputPath: joinPaths(\"{builtinPath}\", \"prisma\"),\n prismaPostgres: options?.prismaPostgres\n ? {\n projectId: this.config.name,\n region: \"us-east-1\"\n }\n : undefined\n })\n } as Partial<PrismaPluginUserConfig>;\n },\n async configResolved() {\n this.dependencies[\"@prisma/ppg\"] = \"latest\";\n\n this.config.prisma.configFile = replacePathTokens(\n this,\n this.config.prisma.configFile\n );\n\n if (!this.config.prisma.schema) {\n throw new Error(\n `Prisma schema path is not defined. Please specify a valid path in the plugin configuration.`\n );\n }\n\n this.config.prisma.schema = replacePathTokens(\n this,\n this.config.prisma.schema\n );\n\n if (!this.config.prisma.outputPath) {\n throw new Error(\n `Prisma generated path is not defined. Please specify a valid path in the plugin configuration.`\n );\n }\n\n this.config.prisma.outputPath = replacePathTokens(\n this,\n this.config.prisma.outputPath\n );\n\n this.prisma ??= {} as TContext[\"prisma\"];\n if (!existsSync(this.config.prisma.schema)) {\n this.prisma.schema ??= {\n generators: [],\n datasources: [],\n warnings: []\n };\n } else {\n this.prisma.schema = await getSchema({\n datamodel: this.config.prisma.schema\n });\n }\n\n const generator = this.prisma.schema.generators.find(\n gen => gen.provider.value === \"prisma-client\"\n );\n if (!generator) {\n this.prisma.schema.generators.push({\n name: \"prisma-client\",\n provider: {\n value: \"prisma-client\",\n fromEnvVar: null\n },\n output: {\n value: this.config.prisma.outputPath,\n fromEnvVar: null\n },\n config: {},\n binaryTargets: [],\n previewFeatures: [],\n sourceFilePath: this.config.prisma.schema\n });\n } else {\n generator.output ??= {\n value: this.config.prisma.outputPath,\n fromEnvVar: null\n };\n }\n\n this.prisma.builder = new PrismaSchemaCreator(this);\n },\n async prepare() {\n // Write the schema file before invoking Prisma - Generate\n await this.prisma.builder.write();\n\n const args = [\"generate\", \"--schema\", this.config.prisma.schema];\n if (!this.config.prisma.prismaPath) {\n args.unshift(this.config.root);\n\n const result = await executePackage(\n \"prisma\",\n args,\n joinPaths(this.workspaceConfig.workspaceRoot, this.config.root)\n );\n if (result.failed) {\n throw new Error(\n `Prisma process exited with code ${result.exitCode}.`\n );\n }\n } else {\n args.unshift(this.config.prisma.prismaPath);\n\n const result = await execute(args.join(\" \"), this.config.root);\n if (result.failed) {\n throw new Error(\n `Prisma process exited with code ${result.exitCode}.`\n );\n }\n }\n },\n async deployPulumi() {\n if (this.config.prisma.prismaPostgres) {\n let serviceToken = process.env.PRISMA_SERVICE_TOKEN;\n if (!serviceToken) {\n serviceToken = options.serviceToken;\n if (serviceToken) {\n this.warn(\n \"If possible, please use the `PRISMA_SERVICE_TOKEN` environment variable instead of using the `serviceToken` option directly. The `serviceToken` option will work; however, this is a less secure method of configuration.\"\n );\n } else {\n throw new Error(\n \"Unable to determine the Prisma service token. Please set the `PRISMA_SERVICE_TOKEN` environment variable.\"\n );\n }\n }\n\n await this.pulumi.workspace.installPlugin(\n \"registry.terraform.io/prisma/prisma-postgres\",\n \"v0.2.0\"\n );\n\n const project = new prismaPostgres.Project(\"project\", {\n name: `${\n this.config.prisma.prismaPostgres?.projectId || this.config.name\n }`\n });\n const database = new prismaPostgres.Database(\"database\", {\n projectId: project.id,\n name: `${\n this.config.prisma.prismaPostgres?.databaseName ||\n `${kebabCase(this.config.name)}.${\n this.config.mode\n }.${this.config.prisma.prismaPostgres?.region}`\n }`,\n region: `${this.config.prisma.prismaPostgres?.region}`\n });\n
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport * as prismaPostgres from \"@pulumi/prisma-postgres\";\nimport { execute, executePackage } from \"@stryke/cli/execute\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { getConfigPath, replacePathTokens } from \"powerlines/plugin-utils\";\nimport { getSchema } from \"./helpers/get-schema\";\nimport { PrismaSchemaCreator } from \"./helpers/schema-creator\";\nimport {\n PrismaPluginContext,\n PrismaPluginOptions,\n PrismaPluginUserConfig\n} from \"./types/plugin\";\n\nexport type * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n prisma?: PrismaPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate Prisma for code generation.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends PrismaPluginContext = PrismaPluginContext\n>(\n options: PrismaPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"prisma\",\n config() {\n return {\n prisma: defu(options, {\n schema: joinPaths(this.config.root, \"prisma\", \"schema.prisma\"),\n configFile:\n options.configFile || getConfigPath(this, \"prisma.config\"),\n outputPath: joinPaths(\"{builtinPath}\", \"prisma\"),\n prismaPostgres: options?.prismaPostgres\n ? {\n projectId: this.config.name,\n region: \"us-east-1\"\n }\n : undefined\n })\n } as Partial<PrismaPluginUserConfig>;\n },\n async configResolved() {\n this.dependencies[\"@prisma/ppg\"] = \"latest\";\n\n this.config.prisma.configFile = replacePathTokens(\n this,\n this.config.prisma.configFile\n );\n\n if (!this.config.prisma.schema) {\n throw new Error(\n `Prisma schema path is not defined. Please specify a valid path in the plugin configuration.`\n );\n }\n\n this.config.prisma.schema = replacePathTokens(\n this,\n this.config.prisma.schema\n );\n\n if (!this.config.prisma.outputPath) {\n throw new Error(\n `Prisma generated path is not defined. Please specify a valid path in the plugin configuration.`\n );\n }\n\n this.config.prisma.outputPath = replacePathTokens(\n this,\n this.config.prisma.outputPath\n );\n\n this.prisma ??= {} as TContext[\"prisma\"];\n if (!existsSync(this.config.prisma.schema)) {\n this.prisma.schema ??= {\n generators: [],\n datasources: [],\n warnings: []\n };\n } else {\n this.prisma.schema = await getSchema({\n datamodel: this.config.prisma.schema\n });\n }\n\n const generator = this.prisma.schema.generators.find(\n gen => gen.provider.value === \"prisma-client\"\n );\n if (!generator) {\n this.prisma.schema.generators.push({\n name: \"prisma-client\",\n provider: {\n value: \"prisma-client\",\n fromEnvVar: null\n },\n output: {\n value: this.config.prisma.outputPath,\n fromEnvVar: null\n },\n config: {},\n binaryTargets: [],\n previewFeatures: [],\n sourceFilePath: this.config.prisma.schema\n });\n } else {\n generator.output ??= {\n value: this.config.prisma.outputPath,\n fromEnvVar: null\n };\n }\n\n this.prisma.builder = new PrismaSchemaCreator(this);\n },\n async prepare() {\n // Write the schema file before invoking Prisma - Generate\n await this.prisma.builder.write();\n\n const args = [\"generate\", \"--schema\", this.config.prisma.schema];\n if (!this.config.prisma.prismaPath) {\n args.unshift(this.config.root);\n\n const result = await executePackage(\n \"prisma\",\n args,\n joinPaths(this.workspaceConfig.workspaceRoot, this.config.root)\n );\n if (result.failed) {\n throw new Error(\n `Prisma process exited with code ${result.exitCode}.`\n );\n }\n } else {\n args.unshift(this.config.prisma.prismaPath);\n\n const result = await execute(args.join(\" \"), this.config.root);\n if (result.failed) {\n throw new Error(\n `Prisma process exited with code ${result.exitCode}.`\n );\n }\n }\n },\n async deployPulumi() {\n if (this.config.prisma.prismaPostgres) {\n let serviceToken = process.env.PRISMA_SERVICE_TOKEN;\n if (!serviceToken) {\n serviceToken = options.serviceToken;\n if (serviceToken) {\n this.warn(\n \"If possible, please use the `PRISMA_SERVICE_TOKEN` environment variable instead of using the `serviceToken` option directly. The `serviceToken` option will work; however, this is a less secure method of configuration.\"\n );\n } else {\n throw new Error(\n \"Unable to determine the Prisma service token. Please set the `PRISMA_SERVICE_TOKEN` environment variable.\"\n );\n }\n }\n\n await this.pulumi.workspace.installPlugin(\n \"registry.terraform.io/prisma/prisma-postgres\",\n \"v0.2.0\"\n );\n\n const project = new prismaPostgres.Project(\"project\", {\n name: `${\n this.config.prisma.prismaPostgres?.projectId || this.config.name\n }`\n });\n const database = new prismaPostgres.Database(\"database\", {\n projectId: project.id,\n name: `${\n this.config.prisma.prismaPostgres?.databaseName ||\n `${kebabCase(this.config.name)}.${\n this.config.mode\n }.${this.config.prisma.prismaPostgres?.region}`\n }`,\n region: `${this.config.prisma.prismaPostgres?.region}`\n });\n\n return {\n project,\n database,\n connection: new prismaPostgres.Connection(\"connection\", {\n databaseId: database.id,\n name: `${constantCase(this.config.name)}_API_KEY`\n })\n };\n }\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiDA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO,EACL,QAAQ,KAAK,SAAS;IACpB,QAAQ,UAAU,KAAK,OAAO,MAAM,UAAU,gBAAgB;IAC9D,YACE,QAAQ,cAAc,cAAc,MAAM,gBAAgB;IAC5D,YAAY,U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C;MACzC,CAAC;KACH;;;EAGN;;AAGH,kBAAe"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const require_get_words = require('./get-words.cjs');
|
|
2
|
+
const require_snake_case = require('./snake-case.cjs');
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/@stryke+string-format@0.16.0/node_modules/@stryke/string-format/dist/constant-case.mjs
|
|
5
|
+
/**
|
|
6
|
+
* Check if the input string is in constant case.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Constant case is defined as all uppercase letters with underscores separating words - "THIS_IS_AN_EXAMPLE".
|
|
10
|
+
*
|
|
11
|
+
* @param input - The input string to check.
|
|
12
|
+
* @returns True if the input is in constant case, false otherwise.
|
|
13
|
+
*/
|
|
14
|
+
function isConstantCase(input) {
|
|
15
|
+
return input ? /^[A-Z0-9_]+$/.test(input) : false;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Convert the input string to constant case.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Constant case is defined as all uppercase letters with underscores separating words - "THIS_IS_AN_EXAMPLE".
|
|
22
|
+
*
|
|
23
|
+
* @param input - The input string.
|
|
24
|
+
* @returns The constant-cased string.
|
|
25
|
+
*/
|
|
26
|
+
function constantCase(input) {
|
|
27
|
+
return isConstantCase(input) || input === void 0 ? input : require_snake_case.isSnakeCase(input) ? input.toUpperCase() : require_get_words.getWords(input).join("_").toUpperCase();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
exports.constantCase = constantCase;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getWords } from "./get-words.mjs";
|
|
2
|
+
import { isSnakeCase } from "./snake-case.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/@stryke+string-format@0.16.0/node_modules/@stryke/string-format/dist/constant-case.mjs
|
|
5
|
+
/**
|
|
6
|
+
* Check if the input string is in constant case.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Constant case is defined as all uppercase letters with underscores separating words - "THIS_IS_AN_EXAMPLE".
|
|
10
|
+
*
|
|
11
|
+
* @param input - The input string to check.
|
|
12
|
+
* @returns True if the input is in constant case, false otherwise.
|
|
13
|
+
*/
|
|
14
|
+
function isConstantCase(input) {
|
|
15
|
+
return input ? /^[A-Z0-9_]+$/.test(input) : false;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Convert the input string to constant case.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Constant case is defined as all uppercase letters with underscores separating words - "THIS_IS_AN_EXAMPLE".
|
|
22
|
+
*
|
|
23
|
+
* @param input - The input string.
|
|
24
|
+
* @returns The constant-cased string.
|
|
25
|
+
*/
|
|
26
|
+
function constantCase(input) {
|
|
27
|
+
return isConstantCase(input) || input === void 0 ? input : isSnakeCase(input) ? input.toUpperCase() : getWords(input).join("_").toUpperCase();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { constantCase };
|
|
32
|
+
//# sourceMappingURL=constant-case.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant-case.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+string-format@0.16.0/node_modules/@stryke/string-format/dist/constant-case.mjs"],"sourcesContent":["import { getWords } from \"./get-words.mjs\";\nimport { isSnakeCase } from \"./snake-case.mjs\";\n\n//#region src/constant-case.ts\n/**\n* Check if the input string is in constant case.\n*\n* @remarks\n* Constant case is defined as all uppercase letters with underscores separating words - \"THIS_IS_AN_EXAMPLE\".\n*\n* @param input - The input string to check.\n* @returns True if the input is in constant case, false otherwise.\n*/\nfunction isConstantCase(input) {\n\treturn input ? /^[A-Z0-9_]+$/.test(input) : false;\n}\n/**\n* Convert the input string to constant case.\n*\n* @remarks\n* Constant case is defined as all uppercase letters with underscores separating words - \"THIS_IS_AN_EXAMPLE\".\n*\n* @param input - The input string.\n* @returns The constant-cased string.\n*/\nfunction constantCase(input) {\n\treturn isConstantCase(input) || input === void 0 ? input : isSnakeCase(input) ? input.toUpperCase() : getWords(input).join(\"_\").toUpperCase();\n}\n\n//#endregion\nexport { constantCase, isConstantCase };\n//# sourceMappingURL=constant-case.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;AAaA,SAAS,eAAe,OAAO;AAC9B,QAAO,QAAQ,eAAe,KAAK,MAAM,GAAG;;;;;;;;;;;AAW7C,SAAS,aAAa,OAAO;AAC5B,QAAO,eAAe,MAAM,IAAI,UAAU,KAAK,IAAI,QAAQ,YAAY,MAAM,GAAG,MAAM,aAAa,GAAG,SAAS,MAAM,CAAC,KAAK,IAAI,CAAC,aAAa"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
//#region ../../node_modules/.pnpm/@stryke+string-format@0.16.0/node_modules/@stryke/string-format/dist/snake-case.mjs
|
|
3
|
+
/**
|
|
4
|
+
* Check if the input string is in snake case.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Snake case is defined as all lowercase letters with underscores separating words - "this_is_an_example"
|
|
8
|
+
*
|
|
9
|
+
* @param input - The input string to check.
|
|
10
|
+
* @returns True if the input is in snake case, false otherwise.
|
|
11
|
+
*/
|
|
12
|
+
function isSnakeCase(input) {
|
|
13
|
+
return input ? /^[a-z]+(?:_[a-z0-9]+)*$/.test(input) : false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.isSnakeCase = isSnakeCase;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@stryke+string-format@0.16.0/node_modules/@stryke/string-format/dist/snake-case.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Check if the input string is in snake case.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Snake case is defined as all lowercase letters with underscores separating words - "this_is_an_example"
|
|
7
|
+
*
|
|
8
|
+
* @param input - The input string to check.
|
|
9
|
+
* @returns True if the input is in snake case, false otherwise.
|
|
10
|
+
*/
|
|
11
|
+
function isSnakeCase(input) {
|
|
12
|
+
return input ? /^[a-z]+(?:_[a-z0-9]+)*$/.test(input) : false;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { isSnakeCase };
|
|
17
|
+
//# sourceMappingURL=snake-case.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snake-case.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+string-format@0.16.0/node_modules/@stryke/string-format/dist/snake-case.mjs"],"sourcesContent":["import { EMPTY_STRING } from \"./types/src/base.mjs\";\nimport { upperCaseFirst } from \"./upper-case-first.mjs\";\nimport { isConstantCase } from \"./constant-case.mjs\";\n\n//#region src/snake-case.ts\n/**\n* Check if the input string is in snake case.\n*\n* @remarks\n* Snake case is defined as all lowercase letters with underscores separating words - \"this_is_an_example\"\n*\n* @param input - The input string to check.\n* @returns True if the input is in snake case, false otherwise.\n*/\nfunction isSnakeCase(input) {\n\treturn input ? /^[a-z]+(?:_[a-z0-9]+)*$/.test(input) : false;\n}\n/**\n* Convert the input string to snake case.\n*\n* @remarks\n* Snake case is defined as all lowercase letters with underscores separating words - \"this_is_an_example\"\n*\n* @param input - The input string.\n* @param options - Options to control the behavior of the function.\n* @returns The snake-cased string.\n*/\nfunction snakeCase(input, options) {\n\tif (isSnakeCase(input) || input === void 0) return input;\n\tif (isConstantCase(input)) return input.toLowerCase();\n\tconst parts = input?.replace(/[A-Z]+/g, (input$1) => upperCaseFirst(input$1) ?? EMPTY_STRING).split(/(?=[A-Z])|[\\s._-]/).map((x) => x.toLowerCase()) ?? [];\n\tif (parts.length === 0) return \"\";\n\tif (parts.length === 1) return parts[0];\n\tconst result = parts.reduce((ret, part) => {\n\t\treturn `${ret}_${part.toLowerCase()}`;\n\t});\n\treturn options?.splitOnNumber === false ? result : result.replace(/[A-Z]\\d/i, (val) => `${val[0]}_${val[1]}`);\n}\n\n//#endregion\nexport { isSnakeCase, snakeCase };\n//# sourceMappingURL=snake-case.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAcA,SAAS,YAAY,OAAO;AAC3B,QAAO,QAAQ,0BAA0B,KAAK,MAAM,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.d.cts","names":[],"sources":["../../src/types/prisma.ts"],"sourcesContent":[],"mappings":";KAkBY,eAAA,GAAkB;AAAlB,KACA,eAAA,GADe,MAAG,
|
|
1
|
+
{"version":3,"file":"prisma.d.cts","names":[],"sources":["../../src/types/prisma.ts"],"sourcesContent":[],"mappings":";KAkBY,eAAA,GAAkB;AAAlB,KACA,eAAA,GADe,MAAG,GAAK,CAAA,QAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AACvB,KAEA,aAAA,GAFe,OAAA,GAAA,SAAA,GAAA,QAAA,GAAA,YAAA,GAAA,UAAA,GAAA,iBAAA,GAAA,WAAA,GAAA,aAAA;AAEf,KAUA,mBAAA,GAAsB,OAVT,CAWvB,aAXuB,EAAA,UAAA,GAAA,iBAAA,CAAA;AAUb,UAKK,QAAA,CALc;EAKd,UAAA,EAAQ,IAAA,GAAA,MAAA;EAKR,KAAA,EAAA,IAAA,GAAU,MAAA;;AAIT,UAJD,UAAA,CAIC;EACX,IAAA,EAAA,MAAA;EACO,QAAA,EAJF,aAIE;EAAQ,cAAA,EAFJ,mBAEI;EAKL,GAAA,EANV,QAMU;EAKA,SAAA,CAAA,EAVH,QAUW;EAKR,OAAA,EAAA,MAAQ,EAAA,GAAA,EAAA;EAKR,cAAA,EAAA,MAAA;AAMjB;AAEU,UAvBO,iBAAA,CAuBP;EAEE,MAAA,EAxBF,YAwBE;EAaK,MAAA,EApCP,wBAoCO,EAAA;;AAEI,UAnCJ,QAAA,CAmCI;EAIJ,UAAA,EAAA,IAAY,GAAA,MAAA;EAMnB,KAAA,EAAA,IAAA,GAAA,MAAA;AAKV;UA7CiB,QAAA;;;;UAKA,qBAAA;;;;;UAMA,eAAA;;UAEP;;YAEE;;;;;;;;;;;;;iBAaK;;aAEJ;;;UAII,YAAA;eACF;cACD;;;UAIJ,wBAAA;;;;UAKO,gBAAA;aACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.d.mts","names":[],"sources":["../../src/types/prisma.ts"],"sourcesContent":[],"mappings":";KAkBY,eAAA,GAAkB;AAAlB,KACA,eAAA,GADe,MAAG,
|
|
1
|
+
{"version":3,"file":"prisma.d.mts","names":[],"sources":["../../src/types/prisma.ts"],"sourcesContent":[],"mappings":";KAkBY,eAAA,GAAkB;AAAlB,KACA,eAAA,GADe,MAAG,GAAK,CAAA,QAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AACvB,KAEA,aAAA,GAFe,OAAA,GAAA,SAAA,GAAA,QAAA,GAAA,YAAA,GAAA,UAAA,GAAA,iBAAA,GAAA,WAAA,GAAA,aAAA;AAEf,KAUA,mBAAA,GAAsB,OAVT,CAWvB,aAXuB,EAAA,UAAA,GAAA,iBAAA,CAAA;AAUb,UAKK,QAAA,CALc;EAKd,UAAA,EAAQ,IAAA,GAAA,MAAA;EAKR,KAAA,EAAA,IAAA,GAAU,MAAA;;AAIT,UAJD,UAAA,CAIC;EACX,IAAA,EAAA,MAAA;EACO,QAAA,EAJF,aAIE;EAAQ,cAAA,EAFJ,mBAEI;EAKL,GAAA,EANV,QAMU;EAKA,SAAA,CAAA,EAVH,QAUW;EAKR,OAAA,EAAA,MAAQ,EAAA,GAAA,EAAA;EAKR,cAAA,EAAA,MAAA;AAMjB;AAEU,UAvBO,iBAAA,CAuBP;EAEE,MAAA,EAxBF,YAwBE;EAaK,MAAA,EApCP,wBAoCO,EAAA;;AAEI,UAnCJ,QAAA,CAmCI;EAIJ,UAAA,EAAA,IAAY,GAAA,MAAA;EAMnB,KAAA,EAAA,IAAA,GAAA,MAAA;AAKV;UA7CiB,QAAA;;;;UAKA,qBAAA;;;;;UAMA,eAAA;;UAEP;;YAEE;;;;;;;;;;;;;iBAaK;;aAEJ;;;UAII,YAAA;eACF;cACD;;;UAIJ,wBAAA;;;;UAKO,gBAAA;aACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-prisma",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
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"],
|
|
@@ -370,7 +370,7 @@
|
|
|
370
370
|
"typings": "dist/index.d.mts",
|
|
371
371
|
"files": ["dist/**/*"],
|
|
372
372
|
"dependencies": {
|
|
373
|
-
"@powerlines/plugin-pulumi": "^0.
|
|
373
|
+
"@powerlines/plugin-pulumi": "^0.5.1",
|
|
374
374
|
"@prisma/get-platform": "^6.19.2",
|
|
375
375
|
"@prisma/prisma-schema-wasm": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773",
|
|
376
376
|
"@stryke/cli": "^0.13.25",
|
|
@@ -381,15 +381,15 @@
|
|
|
381
381
|
"defu": "^6.1.4",
|
|
382
382
|
"fp-ts": "^2.16.11",
|
|
383
383
|
"jiti": "^2.6.1",
|
|
384
|
-
"powerlines": "^0.40.
|
|
384
|
+
"powerlines": "^0.40.7",
|
|
385
385
|
"prisma-util": "^2.1.1",
|
|
386
386
|
"ts-pattern": "^5.9.0"
|
|
387
387
|
},
|
|
388
388
|
"devDependencies": {
|
|
389
389
|
"@pulumi/pulumi": "^3.225.1",
|
|
390
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
390
|
+
"@powerlines/plugin-plugin": "^0.12.271",
|
|
391
391
|
"@types/node": "^25.3.5"
|
|
392
392
|
},
|
|
393
393
|
"publishConfig": { "access": "public" },
|
|
394
|
-
"gitHead": "
|
|
394
|
+
"gitHead": "943a105cc17b0a264efa829df02fc89898746492"
|
|
395
395
|
}
|