@powerlines/plugin-prisma 0.2.268 → 0.3.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.
Files changed (54) hide show
  1. package/dist/api/client/client.gen.mjs.map +1 -1
  2. package/dist/api/client/index.cjs +2 -2
  3. package/dist/api/client/index.mjs +2 -2
  4. package/dist/api/client/types.gen.d.cts.map +1 -1
  5. package/dist/api/client/utils.gen.cjs +1 -1
  6. package/dist/api/client/utils.gen.mjs +1 -1
  7. package/dist/api/client/utils.gen.mjs.map +1 -1
  8. package/dist/api/client.gen.cjs +8 -0
  9. package/dist/api/client.gen.mjs +8 -0
  10. package/dist/api/client.gen.mjs.map +1 -1
  11. package/dist/api/core/auth.gen.mjs.map +1 -1
  12. package/dist/api/core/bodySerializer.gen.mjs.map +1 -1
  13. package/dist/api/core/params.gen.mjs.map +1 -1
  14. package/dist/api/core/pathSerializer.gen.d.cts.map +1 -1
  15. package/dist/api/core/pathSerializer.gen.mjs.map +1 -1
  16. package/dist/api/core/queryKeySerializer.gen.cjs +3 -0
  17. package/dist/api/core/queryKeySerializer.gen.d.cts.map +1 -1
  18. package/dist/api/core/queryKeySerializer.gen.mjs +3 -0
  19. package/dist/api/core/queryKeySerializer.gen.mjs.map +1 -1
  20. package/dist/api/core/serverSentEvents.gen.mjs.map +1 -1
  21. package/dist/api/core/utils.gen.mjs.map +1 -1
  22. package/dist/api/sdk.gen.cjs +0 -1
  23. package/dist/api/sdk.gen.mjs +0 -1
  24. package/dist/api/sdk.gen.mjs.map +1 -1
  25. package/dist/components/index.cjs +3 -0
  26. package/dist/components/index.d.cts +2 -0
  27. package/dist/components/index.d.mts +2 -0
  28. package/dist/components/index.mjs +3 -0
  29. package/dist/components/infrastructure-file.cjs +76 -0
  30. package/dist/components/infrastructure-file.d.cts +13 -0
  31. package/dist/components/infrastructure-file.d.cts.map +1 -0
  32. package/dist/components/infrastructure-file.d.mts +13 -0
  33. package/dist/components/infrastructure-file.d.mts.map +1 -0
  34. package/dist/components/infrastructure-file.mjs +75 -0
  35. package/dist/components/infrastructure-file.mjs.map +1 -0
  36. package/dist/helpers/get-schema.mjs.map +1 -1
  37. package/dist/helpers/index.cjs +1 -1
  38. package/dist/helpers/index.mjs +1 -1
  39. package/dist/helpers/prisma-postgres.mjs.map +1 -1
  40. package/dist/helpers/schema-creator.mjs.map +1 -1
  41. package/dist/index.cjs +20 -31
  42. package/dist/index.d.cts.map +1 -1
  43. package/dist/index.d.mts.map +1 -1
  44. package/dist/index.mjs +19 -30
  45. package/dist/index.mjs.map +1 -1
  46. package/dist/node_modules/.pnpm/@stryke_string-format@0.14.8/node_modules/@stryke/string-format/dist/get-words.cjs +38 -0
  47. package/dist/node_modules/.pnpm/@stryke_string-format@0.14.8/node_modules/@stryke/string-format/dist/get-words.mjs +38 -0
  48. package/dist/node_modules/.pnpm/@stryke_string-format@0.14.8/node_modules/@stryke/string-format/dist/get-words.mjs.map +1 -0
  49. package/dist/node_modules/.pnpm/@stryke_string-format@0.14.8/node_modules/@stryke/string-format/dist/kebab-case.cjs +33 -0
  50. package/dist/node_modules/.pnpm/@stryke_string-format@0.14.8/node_modules/@stryke/string-format/dist/kebab-case.mjs +34 -0
  51. package/dist/node_modules/.pnpm/@stryke_string-format@0.14.8/node_modules/@stryke/string-format/dist/kebab-case.mjs.map +1 -0
  52. package/dist/types/prisma.d.cts.map +1 -1
  53. package/dist/types/prisma.d.mts.map +1 -1
  54. package/package.json +57 -26
package/dist/index.mjs CHANGED
@@ -1,16 +1,17 @@
1
- import { createConfig } from "./api/client/utils.gen.mjs";
2
- import { createClient } from "./api/client/client.gen.mjs";
1
+ import { PrismaSchemaCreator } from "./helpers/schema-creator.mjs";
2
+ import { getSchema } from "./helpers/get-schema.mjs";
3
+ import { PrismaPostgresInfrastructureFile } from "./components/infrastructure-file.mjs";
3
4
  import { client } from "./api/client.gen.mjs";
4
5
  import { PrismaClient } from "./api/sdk.gen.mjs";
5
- import { getSchema } from "./helpers/get-schema.mjs";
6
- import { PrismaSchemaCreator } from "./helpers/schema-creator.mjs";
6
+ import { createComponent } from "@alloy-js/core/jsx-runtime";
7
+ import defu from "defu";
8
+ import { render } from "@powerlines/plugin-alloy/render";
7
9
  import { execute, executePackage } from "@stryke/cli/execute";
8
10
  import { existsSync } from "@stryke/fs/exists";
9
11
  import { joinPaths } from "@stryke/path/join-paths";
10
- import defu from "defu";
11
12
  import { getConfigPath, replacePathTokens } from "powerlines/plugin-utils";
12
13
 
13
- //#region src/index.ts
14
+ //#region src/index.tsx
14
15
  /**
15
16
  * A Powerlines plugin to integrate Prisma for code generation.
16
17
  *
@@ -32,33 +33,10 @@ const plugin = (options = {}) => {
32
33
  }) };
33
34
  },
34
35
  async configResolved() {
35
- this.dependencies["@prisma/client"] = "latest";
36
+ this.dependencies["@prisma/ppg"] = "latest";
36
37
  this.config.prisma.configFile = replacePathTokens(this, this.config.prisma.configFile);
37
38
  if (!this.config.prisma.schema) throw new Error(`Prisma schema path is not defined. Please specify a valid path in the plugin configuration.`);
38
39
  this.config.prisma.schema = replacePathTokens(this, this.config.prisma.schema);
39
- if (this.config.prisma.prismaPostgres) {
40
- let serviceToken = process.env.PRISMA_SERVICE_TOKEN;
41
- if (!serviceToken) {
42
- serviceToken = options.serviceToken;
43
- if (serviceToken) this.warn("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.");
44
- else throw new Error("Unable to determine the Prisma service token. Please set the `PRISMA_SERVICE_TOKEN` environment variable.");
45
- }
46
- const client$1 = createClient(createConfig({
47
- baseUrl: "https://api.prisma.io",
48
- throwOnError: true,
49
- headers: {
50
- Authorization: `Bearer ${serviceToken}`,
51
- "User-Agent": "powerlines/1.0"
52
- }
53
- }));
54
- this.prisma.api = new PrismaClient({ client: client$1 });
55
- await this.prisma.api.createDatabase({ body: {
56
- isDefault: false,
57
- name: this.config.prisma.prismaPostgres.databaseName || `${this.config.prisma.prismaPostgres.region}.${this.config.mode}.${this.config.name}`,
58
- projectId: this.config.prisma.prismaPostgres.projectId,
59
- region: this.config.prisma.prismaPostgres.region
60
- } }).then((response) => response.data?.data);
61
- }
62
40
  if (!this.config.prisma.outputPath) throw new Error(`Prisma generated path is not defined. Please specify a valid path in the plugin configuration.`);
63
41
  this.config.prisma.outputPath = replacePathTokens(this, this.config.prisma.outputPath);
64
42
  this.prisma ??= {};
@@ -106,6 +84,17 @@ const plugin = (options = {}) => {
106
84
  const result = await execute(args.join(" "), this.config.root);
107
85
  if (result.failed) throw new Error(`Prisma process exited with code ${result.exitCode}.`);
108
86
  }
87
+ if (this.config.prisma.prismaPostgres) await render(this, createComponent(PrismaPostgresInfrastructureFile, {}));
88
+ },
89
+ async deploy() {
90
+ if (this.config.prisma.prismaPostgres) {
91
+ let serviceToken = process.env.PRISMA_SERVICE_TOKEN;
92
+ if (!serviceToken) {
93
+ serviceToken = options.serviceToken;
94
+ if (serviceToken) this.warn("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.");
95
+ else throw new Error("Unable to determine the Prisma service token. Please set the `PRISMA_SERVICE_TOKEN` environment variable.");
96
+ }
97
+ }
109
98
  }
110
99
  };
111
100
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["client"],"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 { execute, executePackage } from \"@stryke/cli/execute\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { getConfigPath, replacePathTokens } from \"powerlines/plugin-utils\";\nimport { createClient } from \"./api/client/client.gen\";\nimport type { ClientOptions } from \"./api/client/types.gen\";\nimport { createConfig } from \"./api/client/utils.gen\";\nimport { Options, PrismaClient } from \"./api/sdk.gen\";\nimport { CreateDatabaseData } from \"./api/types.gen\";\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 * from \"./api/client.gen\";\nexport * from \"./api/sdk.gen\";\nexport * from \"./api/types.gen\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface BaseConfig {\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/client\"] = \"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.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 const client = createClient(\n createConfig<ClientOptions>({\n baseUrl: \"https://api.prisma.io\",\n throwOnError: true,\n headers: {\n Authorization: `Bearer ${serviceToken}`,\n \"User-Agent\": \"powerlines/1.0\"\n }\n })\n );\n\n this.prisma.api = new PrismaClient({\n client\n });\n\n await this.prisma.api\n .createDatabase({\n body: {\n isDefault: false,\n name:\n this.config.prisma.prismaPostgres.databaseName ||\n `${this.config.prisma.prismaPostgres.region}.${this.config.mode}.${this.config.name}`,\n projectId: this.config.prisma.prismaPostgres.projectId,\n region: this.config.prisma.prismaPostgres.region\n }\n } as Options<CreateDatabaseData>)\n .then(response => response.data?.data);\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 };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsDA,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,UAAU,iBAAiB,SAAS;IAChD,gBAAgB,SAAS,iBACrB;KACE,WAAW,KAAK,OAAO;KACvB,QAAQ;KACT,GACD;IACL,CAAC,EACH;;EAEH,MAAM,iBAAiB;AACrB,QAAK,aAAa,oBAAoB;AAEtC,QAAK,OAAO,OAAO,aAAa,kBAC9B,MACA,KAAK,OAAO,OAAO,WACpB;AAED,OAAI,CAAC,KAAK,OAAO,OAAO,OACtB,OAAM,IAAI,MACR,8FACD;AAGH,QAAK,OAAO,OAAO,SAAS,kBAC1B,MACA,KAAK,OAAO,OAAO,OACpB;AAED,OAAI,KAAK,OAAO,OAAO,gBAAgB;IACrC,IAAI,eAAe,QAAQ,IAAI;AAC/B,QAAI,CAAC,cAAc;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gB,KAAK,OAAO,OAAO;IACpC,CAAC;OAEF,WAAU,WAAW;IACnB,OAAO,KAAK,OAAO,OAAO;IAC1B,YAAY;IACb;AAGH,QAAK,OAAO,UAAU,IAAI,oBAAoB,KAAK;;EAErD,MAAM,UAAU;AAEd,SAAM,KAAK,OAAO,QAAQ,OAAO;GAEjC,MAAM,OAAO;IAAC;IAAY;IAAY,KAAK,OAAO,OAAO;IAAO;AAChE,OAAI,CAAC,KAAK,OAAO,OAAO,YAAY;AAClC,SAAK,QAAQ,KAAK,OAAO,KAAK;IAE9B,MAAM,SAAS,MAAM,eACnB,UACA,MACA,UAAU,KAAK,gBAAgB,eAAe,KAAK,OAAO,KAAK,CAChE;AACD,QAAI,OAAO,OACT,OAAM,IAAI,MACR,mCAAmC,OAAO,SAAS,GACpD;UAEE;AACL,SAAK,QAAQ,KAAK,OAAO,OAAO,WAAW;IAE3C,MAAM,SAAS,MAAM,QAAQ,KAAK,KAAK,IAAI,EAAE,KAAK,OAAO,KAAK;AAC9D,QAAI,OAAO,OACT,OAAM,IAAI,MACR,mCAAmC,OAAO,SAAS,GACpD;;;EAIR;;AAGH,kBAAe"}
1
+ {"version":3,"file":"index.mjs","names":["render","execute","executePackage","existsSync","joinPaths","defu","getConfigPath","replacePathTokens","PrismaPostgresInfrastructureFile","getSchema","PrismaSchemaCreator","plugin","options","name","config","prisma","schema","root","configFile","outputPath","prismaPostgres","projectId","region","undefined","configResolved","dependencies","Error","generators","datasources","warnings","datamodel","generator","find","gen","provider","value","push","fromEnvVar","output","binaryTargets","previewFeatures","sourceFilePath","builder","prepare","write","args","prismaPath","unshift","result","workspaceConfig","workspaceRoot","failed","exitCode","join","_$createComponent","deploy","serviceToken","process","env","PRISMA_SERVICE_TOKEN","warn"],"sources":["../src/index.tsx"],"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 { render } from \"@powerlines/plugin-alloy/render\";\nimport { execute, executePackage } from \"@stryke/cli/execute\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { getConfigPath, replacePathTokens } from \"powerlines/plugin-utils\";\nimport { PrismaPostgresInfrastructureFile } from \"./components/infrastructure-file\";\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 * from \"./api/client.gen\";\nexport * from \"./api/sdk.gen\";\nexport * from \"./api/types.gen\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface BaseConfig {\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 if (this.config.prisma.prismaPostgres) {\n await render(this, <PrismaPostgresInfrastructureFile />);\n }\n },\n async deploy() {\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 // const client = createClient(\n // createConfig<ClientOptions>({\n // baseUrl: \"https://api.prisma.io\",\n // throwOnError: true,\n // headers: {\n // Authorization: `Bearer ${serviceToken}`,\n // \"User-Agent\": \"powerlines/1.0\"\n // }\n // })\n // );\n\n // this.prisma.api = new PrismaClient({\n // client\n // });\n\n // await this.prisma.api\n // .createDatabase({\n // body: {\n // isDefault: false,\n // name:\n // this.config.prisma.prismaPostgres.databaseName ||\n // `${this.config.prisma.prismaPostgres.region}.${this.config.mode}.${this.config.name}`,\n // projectId: this.config.prisma.prismaPostgres.projectId,\n // region: this.config.prisma.prismaPostgres.region\n // }\n // } as Options<CreateDatabaseData>)\n // .then(response => response.data?.data);\n }\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmDA,MAAaW,UAGXC,UAA+B,EAAE,KACZ;AACrB,QAAO;EACLC,MAAM;EACNC,SAAS;AACP,UAAO,EACLC,QAAQV,KAAKO,SAAS;IACpBI,QAAQZ,UAAU,KAAKU,OAAOG,MAAM,UAAU,gBAAgB;IAC9DC,YACEN,QAAQM,cAAcZ,cAAc,MAAM,gBAAgB;IAC5Da,YAAYf,UAAU,iBAAiB,SAAS;IAChDgB,gBAAgBR,SAASQ,iBACrB;KACEC,WAAW,KAAKP,OAAOD;KACvBS,QAAQ;KACT,GACDC;IACL,CAAA,EACF;;EAEH,MAAMC,iBAAiB;AACrB,QAAKC,aAAa,iBAA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AAC;IAAY;IAAY,KAAK/B,OAAOC,OAAOC;IAAO;AAChE,OAAI,CAAC,KAAKF,OAAOC,OAAO+B,YAAY;AAClCD,SAAKE,QAAQ,KAAKjC,OAAOG,KAAK;IAE9B,MAAM+B,SAAS,MAAM9C,eACnB,UACA2C,MACAzC,UAAU,KAAK6C,gBAAgBC,eAAe,KAAKpC,OAAOG,KAC5D,CAAC;AACD,QAAI+B,OAAOG,OACT,OAAM,IAAIzB,MACR,mCAAmCsB,OAAOI,SAAQ,GACnD;UAEE;AACLP,SAAKE,QAAQ,KAAKjC,OAAOC,OAAO+B,WAAW;IAE3C,MAAME,SAAS,MAAM/C,QAAQ4C,KAAKQ,KAAK,IAAI,EAAE,KAAKvC,OAAOG,KAAK;AAC9D,QAAI+B,OAAOG,OACT,OAAM,IAAIzB,MACR,mCAAmCsB,OAAOI,SAAQ,GACnD;;AAIL,OAAI,KAAKtC,OAAOC,OAAOK,eACrB,OAAMpB,OAAO,MAAIsD,gBAAG9C,kCAAgC,EAAA,CAAG,CAAC;;EAG5D,MAAM+C,SAAS;AACb,OAAI,KAAKzC,OAAOC,OAAOK,gBAAgB;IACrC,IAAIoC,eAAeC,QAAQC,IAAIC;AAC/B,QAAI,CAACH,cAAc;AACjBA,oBAAe5C,QAAQ4C;AACvB,SAAIA,aACF,MAAKI,KACH,4NACD;SAED,OAAM,IAAIlC,MACR,4GACD;;;;EAiCV;;AAGH,kBAAef"}
@@ -0,0 +1,38 @@
1
+
2
+ //#region ../../node_modules/.pnpm/@stryke+string-format@0.14.8/node_modules/@stryke/string-format/dist/get-words.mjs
3
+ /**
4
+ * Regular expression pattern to split strings into words for various case conversions
5
+ *
6
+ * This pattern matches sequences of characters in a string, considering the following case:
7
+ * - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)
8
+ * - Sequences of one uppercase letter optionally followed by lowercase letters and digits
9
+ * - Single uppercase letters
10
+ * - Sequences of digits
11
+ *
12
+ * The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into
13
+ * a consistent format like snake case.
14
+ *
15
+ * @example
16
+ * const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);
17
+ * // matches: ['camel', 'Case', 'HTTP', 'Request']
18
+ */
19
+ const CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|\d+|[A-Z]+(?![a-z])/g;
20
+ const RELAXED_SPLIT_PATTERN = /[A-Z/.-]?[a-z/.-]+|\d+|[A-Z/.-]+(?![a-z/.-])/g;
21
+ /**
22
+ * Splits a string into words using a regular expression pattern
23
+ *
24
+ * @example
25
+ * const words = getWords('camelCaseHTTPRequest');
26
+ * // words: ['camel', 'Case', 'HTTP', 'Request']
27
+ *
28
+ * @param str - The string to split into words
29
+ * @param options - Options for splitting the string
30
+ * @returns An array of words
31
+ */
32
+ function getWords(str, options = {}) {
33
+ if (str.length > 5e3) throw new Error("The regular expression parameter of `get-words` can't handle strings longer than 2000 characters");
34
+ return [...str.match(options.split ?? (options.relaxed ? RELAXED_SPLIT_PATTERN : CASE_SPLIT_PATTERN)) ?? []];
35
+ }
36
+
37
+ //#endregion
38
+ exports.getWords = getWords;
@@ -0,0 +1,38 @@
1
+ //#region ../../node_modules/.pnpm/@stryke+string-format@0.14.8/node_modules/@stryke/string-format/dist/get-words.mjs
2
+ /**
3
+ * Regular expression pattern to split strings into words for various case conversions
4
+ *
5
+ * This pattern matches sequences of characters in a string, considering the following case:
6
+ * - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)
7
+ * - Sequences of one uppercase letter optionally followed by lowercase letters and digits
8
+ * - Single uppercase letters
9
+ * - Sequences of digits
10
+ *
11
+ * The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into
12
+ * a consistent format like snake case.
13
+ *
14
+ * @example
15
+ * const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);
16
+ * // matches: ['camel', 'Case', 'HTTP', 'Request']
17
+ */
18
+ const CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|\d+|[A-Z]+(?![a-z])/g;
19
+ const RELAXED_SPLIT_PATTERN = /[A-Z/.-]?[a-z/.-]+|\d+|[A-Z/.-]+(?![a-z/.-])/g;
20
+ /**
21
+ * Splits a string into words using a regular expression pattern
22
+ *
23
+ * @example
24
+ * const words = getWords('camelCaseHTTPRequest');
25
+ * // words: ['camel', 'Case', 'HTTP', 'Request']
26
+ *
27
+ * @param str - The string to split into words
28
+ * @param options - Options for splitting the string
29
+ * @returns An array of words
30
+ */
31
+ function getWords(str, options = {}) {
32
+ if (str.length > 5e3) throw new Error("The regular expression parameter of `get-words` can't handle strings longer than 2000 characters");
33
+ return [...str.match(options.split ?? (options.relaxed ? RELAXED_SPLIT_PATTERN : CASE_SPLIT_PATTERN)) ?? []];
34
+ }
35
+
36
+ //#endregion
37
+ export { getWords };
38
+ //# sourceMappingURL=get-words.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-words.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+string-format@0.14.8/node_modules/@stryke/string-format/dist/get-words.mjs"],"sourcesContent":["//#region src/get-words.ts\n/**\n* Regular expression pattern to split strings into words for various case conversions\n*\n* This pattern matches sequences of characters in a string, considering the following case:\n* - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)\n* - Sequences of one uppercase letter optionally followed by lowercase letters and digits\n* - Single uppercase letters\n* - Sequences of digits\n*\n* The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into\n* a consistent format like snake case.\n*\n* @example\n* const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);\n* // matches: ['camel', 'Case', 'HTTP', 'Request']\n*/\nconst CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|\\d+|[A-Z]+(?![a-z])/g;\nconst RELAXED_SPLIT_PATTERN = /[A-Z/.-]?[a-z/.-]+|\\d+|[A-Z/.-]+(?![a-z/.-])/g;\n/**\n* Splits a string into words using a regular expression pattern\n*\n* @example\n* const words = getWords('camelCaseHTTPRequest');\n* // words: ['camel', 'Case', 'HTTP', 'Request']\n*\n* @param str - The string to split into words\n* @param options - Options for splitting the string\n* @returns An array of words\n*/\nfunction getWords(str, options = {}) {\n\tif (str.length > 5e3) throw new Error(\"The regular expression parameter of `get-words` can't handle strings longer than 2000 characters\");\n\treturn [...str.match(options.split ?? (options.relaxed ? RELAXED_SPLIT_PATTERN : CASE_SPLIT_PATTERN)) ?? []];\n}\n\n//#endregion\nexport { CASE_SPLIT_PATTERN, RELAXED_SPLIT_PATTERN, getWords };\n//# sourceMappingURL=get-words.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;;;;;;;;;;;;AAY9B,SAAS,SAAS,KAAK,UAAU,EAAE,EAAE;AACpC,KAAI,IAAI,SAAS,IAAK,OAAM,IAAI,MAAM,mGAAmG;AACzI,QAAO,CAAC,GAAG,IAAI,MAAM,QAAQ,UAAU,QAAQ,UAAU,wBAAwB,oBAAoB,IAAI,EAAE,CAAC"}
@@ -0,0 +1,33 @@
1
+ const require_get_words = require('./get-words.cjs');
2
+
3
+ //#region ../../node_modules/.pnpm/@stryke+string-format@0.14.8/node_modules/@stryke/string-format/dist/kebab-case.mjs
4
+ /**
5
+ * Check if the input string is in kebab case.
6
+ *
7
+ * @remarks
8
+ * Kebab case is defined as all lowercase letters with hyphens separating words - "this-is-an-example".
9
+ *
10
+ * @param input - The input string to check.
11
+ * @returns True if the input is in kebab case, false otherwise.
12
+ */
13
+ function isKebabCase(input) {
14
+ return input ? /^[a-z]+(?:-[a-z0-9]+)*$/.test(input) : false;
15
+ }
16
+ /**
17
+ * Convert the input string to kebab case.
18
+ *
19
+ * @remarks
20
+ * Kebab case is defined as all lowercase letters with hyphens separating words - "this-is-an-example".
21
+ *
22
+ * @param input - The input string.
23
+ * @returns The kebab-cased string.
24
+ */
25
+ function kebabCase(input) {
26
+ if (isKebabCase(input) || input === void 0) return input;
27
+ const parts = input ? require_get_words.getWords(input) : [];
28
+ if (parts.length === 0) return "";
29
+ return parts.join("-").toLowerCase();
30
+ }
31
+
32
+ //#endregion
33
+ exports.kebabCase = kebabCase;
@@ -0,0 +1,34 @@
1
+ import { getWords } from "./get-words.mjs";
2
+
3
+ //#region ../../node_modules/.pnpm/@stryke+string-format@0.14.8/node_modules/@stryke/string-format/dist/kebab-case.mjs
4
+ /**
5
+ * Check if the input string is in kebab case.
6
+ *
7
+ * @remarks
8
+ * Kebab case is defined as all lowercase letters with hyphens separating words - "this-is-an-example".
9
+ *
10
+ * @param input - The input string to check.
11
+ * @returns True if the input is in kebab case, false otherwise.
12
+ */
13
+ function isKebabCase(input) {
14
+ return input ? /^[a-z]+(?:-[a-z0-9]+)*$/.test(input) : false;
15
+ }
16
+ /**
17
+ * Convert the input string to kebab case.
18
+ *
19
+ * @remarks
20
+ * Kebab case is defined as all lowercase letters with hyphens separating words - "this-is-an-example".
21
+ *
22
+ * @param input - The input string.
23
+ * @returns The kebab-cased string.
24
+ */
25
+ function kebabCase(input) {
26
+ if (isKebabCase(input) || input === void 0) return input;
27
+ const parts = input ? getWords(input) : [];
28
+ if (parts.length === 0) return "";
29
+ return parts.join("-").toLowerCase();
30
+ }
31
+
32
+ //#endregion
33
+ export { kebabCase };
34
+ //# sourceMappingURL=kebab-case.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kebab-case.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+string-format@0.14.8/node_modules/@stryke/string-format/dist/kebab-case.mjs"],"sourcesContent":["import { getWords } from \"./get-words.mjs\";\n\n//#region src/kebab-case.ts\n/**\n* Check if the input string is in kebab case.\n*\n* @remarks\n* Kebab case is defined as all lowercase letters with hyphens separating words - \"this-is-an-example\".\n*\n* @param input - The input string to check.\n* @returns True if the input is in kebab case, false otherwise.\n*/\nfunction isKebabCase(input) {\n\treturn input ? /^[a-z]+(?:-[a-z0-9]+)*$/.test(input) : false;\n}\n/**\n* Convert the input string to kebab case.\n*\n* @remarks\n* Kebab case is defined as all lowercase letters with hyphens separating words - \"this-is-an-example\".\n*\n* @param input - The input string.\n* @returns The kebab-cased string.\n*/\nfunction kebabCase(input) {\n\tif (isKebabCase(input) || input === void 0) return input;\n\tconst parts = input ? getWords(input) : [];\n\tif (parts.length === 0) return \"\";\n\treturn parts.join(\"-\").toLowerCase();\n}\n\n//#endregion\nexport { isKebabCase, kebabCase };\n//# sourceMappingURL=kebab-case.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;AAYA,SAAS,YAAY,OAAO;AAC3B,QAAO,QAAQ,0BAA0B,KAAK,MAAM,GAAG;;;;;;;;;;;AAWxD,SAAS,UAAU,OAAO;AACzB,KAAI,YAAY,MAAM,IAAI,UAAU,KAAK,EAAG,QAAO;CACnD,MAAM,QAAQ,QAAQ,SAAS,MAAM,GAAG,EAAE;AAC1C,KAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,QAAO,MAAM,KAAK,IAAI,CAAC,aAAa"}
@@ -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,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,a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HANGED
@@ -1,18 +1,24 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-prisma",
3
- "version": "0.2.268",
4
- "type": "module",
3
+ "version": "0.3.0",
4
+ "private": false,
5
5
  "description": "A Powerlines plugin to generate project code and a Prisma client from a Prisma schema (PSL).",
6
+ "keywords": ["prisma", "powerlines", "storm-software", "powerlines-plugin"],
7
+ "homepage": "https://stormsoftware.com",
8
+ "bugs": {
9
+ "url": "https://stormsoftware.com/support",
10
+ "email": "support@stormsoftware.com"
11
+ },
6
12
  "repository": {
7
13
  "type": "github",
8
14
  "url": "https://github.com/storm-software/powerlines.git",
9
15
  "directory": "packages/plugin-prisma"
10
16
  },
11
- "homepage": "https://stormsoftware.com",
12
- "bugs": {
13
- "url": "https://stormsoftware.com/support",
14
- "email": "support@stormsoftware.com"
17
+ "funding": {
18
+ "type": "github",
19
+ "url": "https://github.com/sponsors/storm-software"
15
20
  },
21
+ "license": "Apache-2.0",
16
22
  "author": {
17
23
  "name": "Storm Software",
18
24
  "email": "contact@stormsoftware.com",
@@ -32,14 +38,7 @@
32
38
  "url": "https://stormsoftware.com"
33
39
  }
34
40
  ],
35
- "funding": {
36
- "type": "github",
37
- "url": "https://github.com/sponsors/storm-software"
38
- },
39
- "license": "Apache-2.0",
40
- "private": false,
41
- "main": "./dist/index.cjs",
42
- "module": "./dist/index.mjs",
41
+ "type": "module",
43
42
  "exports": {
44
43
  ".": {
45
44
  "require": {
@@ -266,6 +265,34 @@
266
265
  "default": "./dist/api/types.gen.mjs"
267
266
  }
268
267
  },
268
+ "./components": {
269
+ "require": {
270
+ "types": "./dist/components/index.d.cts",
271
+ "default": "./dist/components/index.cjs"
272
+ },
273
+ "import": {
274
+ "types": "./dist/components/index.d.mts",
275
+ "default": "./dist/components/index.mjs"
276
+ },
277
+ "default": {
278
+ "types": "./dist/components/index.d.mts",
279
+ "default": "./dist/components/index.mjs"
280
+ }
281
+ },
282
+ "./components/infrastructure-file": {
283
+ "require": {
284
+ "types": "./dist/components/infrastructure-file.d.cts",
285
+ "default": "./dist/components/infrastructure-file.cjs"
286
+ },
287
+ "import": {
288
+ "types": "./dist/components/infrastructure-file.d.mts",
289
+ "default": "./dist/components/infrastructure-file.mjs"
290
+ },
291
+ "default": {
292
+ "types": "./dist/components/infrastructure-file.d.mts",
293
+ "default": "./dist/components/infrastructure-file.mjs"
294
+ }
295
+ },
269
296
  "./helpers": {
270
297
  "require": {
271
298
  "types": "./dist/helpers/index.d.cts",
@@ -365,30 +392,34 @@
365
392
  }
366
393
  }
367
394
  },
395
+ "main": "./dist/index.cjs",
396
+ "module": "./dist/index.mjs",
397
+ "types": "./dist/index.d.cts",
368
398
  "typings": "dist/index.d.mts",
369
399
  "files": ["dist/**/*"],
370
- "keywords": ["prisma", "powerlines", "storm-software", "powerlines-plugin"],
371
400
  "dependencies": {
401
+ "@alloy-js/core": "0.23.0-dev.8",
402
+ "@alloy-js/typescript": "0.23.0-dev.4",
403
+ "@powerlines/plugin-pulumi": "^0.3.0",
372
404
  "@prisma/get-platform": "^6.19.2",
373
405
  "@prisma/prisma-schema-wasm": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773",
374
- "@stryke/cli": "^0.13.22",
375
- "@stryke/fs": "^0.33.50",
376
- "@stryke/path": "^0.26.12",
377
- "@stryke/type-checks": "^0.5.31",
378
- "@stryke/types": "^0.10.45",
406
+ "@stryke/cli": "^0.13.25",
407
+ "@stryke/fs": "^0.33.53",
408
+ "@stryke/path": "^0.26.15",
409
+ "@stryke/type-checks": "^0.5.34",
410
+ "@stryke/types": "^0.10.48",
379
411
  "defu": "^6.1.4",
380
412
  "fp-ts": "^2.16.11",
381
413
  "jiti": "^2.6.1",
382
- "powerlines": "^0.40.1",
414
+ "powerlines": "^0.40.3",
383
415
  "prisma-util": "^2.1.1",
384
416
  "ts-pattern": "^5.9.0"
385
417
  },
386
418
  "devDependencies": {
387
- "@powerlines/plugin-hey-api": "^0.1.268",
388
- "@powerlines/plugin-plugin": "^0.12.265",
389
- "@types/node": "^25.3.3"
419
+ "@powerlines/plugin-alloy": "^0.25.0",
420
+ "@powerlines/plugin-plugin": "^0.12.267",
421
+ "@types/node": "^25.3.5"
390
422
  },
391
423
  "publishConfig": { "access": "public" },
392
- "types": "./dist/index.d.cts",
393
- "gitHead": "56410862ad299064942d87d6a36cc62acfb0b544"
424
+ "gitHead": "50b8a5ce8e5dbafd182ff7c8659469af86eef47c"
394
425
  }