@powerlines/plugin-prisma 0.2.76 → 0.2.78
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/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/api/client/client.gen.cjs +175 -8
- package/dist/api/client/client.gen.mjs +174 -7
- package/dist/api/client/index.cjs +13 -18
- package/dist/api/client/index.mjs +5 -10
- package/dist/api/client/utils.gen.cjs +186 -13
- package/dist/api/client/utils.gen.mjs +178 -5
- package/dist/api/client.gen.cjs +8 -12
- package/dist/api/client.gen.mjs +7 -11
- package/dist/api/core/auth.gen.cjs +11 -2
- package/dist/api/core/auth.gen.mjs +9 -1
- package/dist/api/core/bodySerializer.gen.cjs +34 -4
- package/dist/api/core/bodySerializer.gen.mjs +30 -1
- package/dist/api/core/params.gen.cjs +64 -2
- package/dist/api/core/params.gen.mjs +62 -1
- package/dist/api/core/pathSerializer.gen.cjs +86 -7
- package/dist/api/core/pathSerializer.gen.mjs +79 -1
- package/dist/api/core/queryKeySerializer.gen.cjs +65 -4
- package/dist/api/core/queryKeySerializer.gen.mjs +61 -1
- package/dist/api/core/serverSentEvents.gen.cjs +94 -2
- package/dist/api/core/serverSentEvents.gen.mjs +92 -1
- package/dist/api/core/utils.gen.cjs +80 -6
- package/dist/api/core/utils.gen.mjs +76 -2
- package/dist/api/sdk.gen.cjs +255 -13
- package/dist/api/sdk.gen.mjs +254 -12
- package/dist/api/types.gen.cjs +0 -1
- package/dist/api/types.gen.mjs +0 -2
- package/dist/helpers/get-schema.cjs +80 -2
- package/dist/helpers/get-schema.mjs +76 -1
- package/dist/helpers/index.cjs +6 -6
- package/dist/helpers/index.mjs +3 -3
- package/dist/helpers/prisma-postgres.cjs +15 -2
- package/dist/helpers/prisma-postgres.mjs +13 -1
- package/dist/helpers/schema-creator.cjs +60 -2
- package/dist/helpers/schema-creator.mjs +58 -1
- package/dist/index.cjs +20 -107
- package/dist/index.mjs +8 -96
- package/dist/powerlines/src/plugin-utils/get-config-path.cjs +49 -0
- package/dist/powerlines/src/plugin-utils/get-config-path.mjs +48 -0
- package/dist/powerlines/src/plugin-utils/paths.cjs +36 -0
- package/dist/powerlines/src/plugin-utils/paths.mjs +35 -0
- package/dist/types/index.cjs +0 -3
- package/dist/types/index.mjs +0 -4
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.mjs +0 -2
- package/dist/types/prisma.cjs +0 -1
- package/dist/types/prisma.mjs +0 -2
- package/package.json +6 -6
- package/dist/auth.gen-BFteuMTV.cjs +0 -17
- package/dist/auth.gen-C4FxE4_3.mjs +0 -11
- package/dist/bodySerializer.gen-BLtxkFoA.cjs +0 -50
- package/dist/bodySerializer.gen-DBXNewIA.mjs +0 -32
- package/dist/client-BlRUW8mL.mjs +0 -1
- package/dist/client-DBAc9HV1.cjs +0 -0
- package/dist/client.gen-COMS1glH.mjs +0 -8
- package/dist/client.gen-CPQm4WCv.mjs +0 -176
- package/dist/client.gen-DPSMNZNm.cjs +0 -181
- package/dist/client.gen-JhYC1fDf.cjs +0 -13
- package/dist/get-schema-CKw6MiKb.mjs +0 -78
- package/dist/get-schema-CqMBOHOd.cjs +0 -118
- package/dist/params.gen-BM1l95BD.mjs +0 -64
- package/dist/params.gen-BtCSnwiV.cjs +0 -70
- package/dist/pathSerializer.gen-BEbuI0Vn.cjs +0 -117
- package/dist/pathSerializer.gen-m7BRzH23.mjs +0 -81
- package/dist/plugin-DE9fKOLA.cjs +0 -0
- package/dist/plugin-EFmNQLKA.mjs +0 -1
- package/dist/prisma-BzQJneyW.cjs +0 -0
- package/dist/prisma-CB-m5c-j.mjs +0 -1
- package/dist/prisma-postgres-CAOpTtWq.mjs +0 -15
- package/dist/prisma-postgres-dGaLzxF3.cjs +0 -21
- package/dist/queryKeySerializer.gen-4TWHHXn3.cjs +0 -81
- package/dist/queryKeySerializer.gen-BMMZAjVN.mjs +0 -63
- package/dist/schema-creator-Cfian3ih.mjs +0 -60
- package/dist/schema-creator-zmlwh4-l.cjs +0 -66
- package/dist/sdk.gen-B2his2jD.mjs +0 -256
- package/dist/sdk.gen-CAWIQ8BM.cjs +0 -261
- package/dist/serverSentEvents.gen-C4apQvDl.mjs +0 -94
- package/dist/serverSentEvents.gen-CiMMmhyQ.cjs +0 -100
- package/dist/types-CmY9-4ff.cjs +0 -0
- package/dist/types-Dbwx-Khg.mjs +0 -1
- package/dist/types.gen-BN-p9nVT.cjs +0 -0
- package/dist/types.gen-CS2KiRfG.mjs +0 -1
- package/dist/utils.gen-Bk2pTkV1.cjs +0 -101
- package/dist/utils.gen-C-7sZa7Z.mjs +0 -180
- package/dist/utils.gen-DATakax-.cjs +0 -227
- package/dist/utils.gen-RO8GxC4i.mjs +0 -78
package/dist/helpers/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
1
|
+
const require_helpers_get_schema = require('./get-schema.cjs');
|
|
2
|
+
const require_helpers_schema_creator = require('./schema-creator.cjs');
|
|
3
|
+
const require_helpers_prisma_postgres = require('./prisma-postgres.cjs');
|
|
4
4
|
|
|
5
|
-
exports.PrismaSchemaCreator =
|
|
6
|
-
exports.findDatabaseByName =
|
|
7
|
-
exports.getSchema =
|
|
5
|
+
exports.PrismaSchemaCreator = require_helpers_schema_creator.PrismaSchemaCreator;
|
|
6
|
+
exports.findDatabaseByName = require_helpers_prisma_postgres.findDatabaseByName;
|
|
7
|
+
exports.getSchema = require_helpers_get_schema.getSchema;
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { getSchema } from "./get-schema.mjs";
|
|
2
|
+
import { PrismaSchemaCreator } from "./schema-creator.mjs";
|
|
3
|
+
import { findDatabaseByName } from "./prisma-postgres.mjs";
|
|
4
4
|
|
|
5
5
|
export { PrismaSchemaCreator, findDatabaseByName, getSchema };
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
const require_prisma_postgres = require('../prisma-postgres-dGaLzxF3.cjs');
|
|
2
1
|
|
|
3
|
-
|
|
2
|
+
//#region src/helpers/prisma-postgres.ts
|
|
3
|
+
/**
|
|
4
|
+
* Find a Postgres database by name.
|
|
5
|
+
*
|
|
6
|
+
* @param context - The Prisma plugin context.
|
|
7
|
+
* @param name - The name of the database to find.
|
|
8
|
+
* @returns The database object if found, otherwise undefined.
|
|
9
|
+
*/
|
|
10
|
+
async function findDatabaseByName(context, name) {
|
|
11
|
+
if (!context.config.prisma.prismaPostgres?.projectId) throw new Error(`Prisma Postgres project ID is not configured. Please set "prisma.prismaPostgres.projectId" in your Powerlines configuration.`);
|
|
12
|
+
return (await context.prisma.api.listDatabases({ path: { projectId: context.config.prisma.prismaPostgres.projectId } })).data.data.find((db) => db.name === name);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.findDatabaseByName = findDatabaseByName;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/helpers/prisma-postgres.ts
|
|
2
|
+
/**
|
|
3
|
+
* Find a Postgres database by name.
|
|
4
|
+
*
|
|
5
|
+
* @param context - The Prisma plugin context.
|
|
6
|
+
* @param name - The name of the database to find.
|
|
7
|
+
* @returns The database object if found, otherwise undefined.
|
|
8
|
+
*/
|
|
9
|
+
async function findDatabaseByName(context, name) {
|
|
10
|
+
if (!context.config.prisma.prismaPostgres?.projectId) throw new Error(`Prisma Postgres project ID is not configured. Please set "prisma.prismaPostgres.projectId" in your Powerlines configuration.`);
|
|
11
|
+
return (await context.prisma.api.listDatabases({ path: { projectId: context.config.prisma.prismaPostgres.projectId } })).data.data.find((db) => db.name === name);
|
|
12
|
+
}
|
|
2
13
|
|
|
14
|
+
//#endregion
|
|
3
15
|
export { findDatabaseByName };
|
|
@@ -1,3 +1,61 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let prisma_util_schema_creator = require("prisma-util/schema-creator");
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
//#region src/helpers/schema-creator.ts
|
|
5
|
+
/**
|
|
6
|
+
* Prisma schema creator that allows building a schema via code.
|
|
7
|
+
*/
|
|
8
|
+
var PrismaSchemaCreator = class extends prisma_util_schema_creator.SchemaCreator {
|
|
9
|
+
/** Prisma plugin context */
|
|
10
|
+
#context;
|
|
11
|
+
get generators() {
|
|
12
|
+
return this.#context.prisma.schema.generators;
|
|
13
|
+
}
|
|
14
|
+
set generators(value) {
|
|
15
|
+
this.#context.prisma.schema.generators = value;
|
|
16
|
+
}
|
|
17
|
+
constructor(context) {
|
|
18
|
+
super();
|
|
19
|
+
this.#context = context;
|
|
20
|
+
this.#context.prisma ??= {};
|
|
21
|
+
this.#context.prisma.schema ??= {
|
|
22
|
+
generators: [],
|
|
23
|
+
datasources: [],
|
|
24
|
+
warnings: []
|
|
25
|
+
};
|
|
26
|
+
this.#context.prisma.schema.generators.forEach((generator) => {
|
|
27
|
+
this.pushGenerator(generator);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
pushGenerator(generator) {
|
|
31
|
+
if (this.generators.some((gen) => gen.name === generator.name)) this.generators = [...this.generators.filter((gen) => gen.name !== generator.name), generator];
|
|
32
|
+
else this.generators.push(generator);
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
build() {
|
|
36
|
+
let schema = super.build();
|
|
37
|
+
for (const generator of this.generators) schema = `
|
|
38
|
+
generator ${generator.name} {
|
|
39
|
+
provider = "${generator.provider.value}"
|
|
40
|
+
output = "${generator.output?.value}"${generator.previewFeatures && generator.previewFeatures.length > 0 ? `
|
|
41
|
+
previewFeatures = [${generator.previewFeatures.map((feature) => `"${feature}"`).join(", ")}]` : ""}${generator.config && Object.keys(generator.config).length > 0 ? Object.entries(generator.config).map(([key, value]) => {
|
|
42
|
+
if (Array.isArray(value)) return `${key} = [${value.map((v) => `"${v}"`).join(", ")}]`;
|
|
43
|
+
else return `${key} = "${value}"`;
|
|
44
|
+
}).join("\n ") : ""}${generator.binaryTargets && generator.binaryTargets.length > 0 ? `
|
|
45
|
+
binaryTargets = [${generator.binaryTargets.map((bt) => `"${bt.value}"`).join(", ")}]` : ""}${generator.envPaths?.rootEnvPath || generator.envPaths?.schemaEnvPath ? `
|
|
46
|
+
env = {${generator.envPaths?.rootEnvPath ? `
|
|
47
|
+
root = "${generator.envPaths.rootEnvPath}"` : ""}${generator.envPaths?.schemaEnvPath ? `
|
|
48
|
+
schema = "${generator.envPaths.schemaEnvPath}"` : ""}
|
|
49
|
+
}` : ""}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
${schema}`;
|
|
53
|
+
return schema;
|
|
54
|
+
}
|
|
55
|
+
async write() {
|
|
56
|
+
await this.#context.fs.write(this.#context.config.prisma.schema, this.build());
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
exports.PrismaSchemaCreator = PrismaSchemaCreator;
|
|
@@ -1,3 +1,60 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SchemaCreator } from "prisma-util/schema-creator";
|
|
2
2
|
|
|
3
|
+
//#region src/helpers/schema-creator.ts
|
|
4
|
+
/**
|
|
5
|
+
* Prisma schema creator that allows building a schema via code.
|
|
6
|
+
*/
|
|
7
|
+
var PrismaSchemaCreator = class extends SchemaCreator {
|
|
8
|
+
/** Prisma plugin context */
|
|
9
|
+
#context;
|
|
10
|
+
get generators() {
|
|
11
|
+
return this.#context.prisma.schema.generators;
|
|
12
|
+
}
|
|
13
|
+
set generators(value) {
|
|
14
|
+
this.#context.prisma.schema.generators = value;
|
|
15
|
+
}
|
|
16
|
+
constructor(context) {
|
|
17
|
+
super();
|
|
18
|
+
this.#context = context;
|
|
19
|
+
this.#context.prisma ??= {};
|
|
20
|
+
this.#context.prisma.schema ??= {
|
|
21
|
+
generators: [],
|
|
22
|
+
datasources: [],
|
|
23
|
+
warnings: []
|
|
24
|
+
};
|
|
25
|
+
this.#context.prisma.schema.generators.forEach((generator) => {
|
|
26
|
+
this.pushGenerator(generator);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
pushGenerator(generator) {
|
|
30
|
+
if (this.generators.some((gen) => gen.name === generator.name)) this.generators = [...this.generators.filter((gen) => gen.name !== generator.name), generator];
|
|
31
|
+
else this.generators.push(generator);
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
build() {
|
|
35
|
+
let schema = super.build();
|
|
36
|
+
for (const generator of this.generators) schema = `
|
|
37
|
+
generator ${generator.name} {
|
|
38
|
+
provider = "${generator.provider.value}"
|
|
39
|
+
output = "${generator.output?.value}"${generator.previewFeatures && generator.previewFeatures.length > 0 ? `
|
|
40
|
+
previewFeatures = [${generator.previewFeatures.map((feature) => `"${feature}"`).join(", ")}]` : ""}${generator.config && Object.keys(generator.config).length > 0 ? Object.entries(generator.config).map(([key, value]) => {
|
|
41
|
+
if (Array.isArray(value)) return `${key} = [${value.map((v) => `"${v}"`).join(", ")}]`;
|
|
42
|
+
else return `${key} = "${value}"`;
|
|
43
|
+
}).join("\n ") : ""}${generator.binaryTargets && generator.binaryTargets.length > 0 ? `
|
|
44
|
+
binaryTargets = [${generator.binaryTargets.map((bt) => `"${bt.value}"`).join(", ")}]` : ""}${generator.envPaths?.rootEnvPath || generator.envPaths?.schemaEnvPath ? `
|
|
45
|
+
env = {${generator.envPaths?.rootEnvPath ? `
|
|
46
|
+
root = "${generator.envPaths.rootEnvPath}"` : ""}${generator.envPaths?.schemaEnvPath ? `
|
|
47
|
+
schema = "${generator.envPaths.schemaEnvPath}"` : ""}
|
|
48
|
+
}` : ""}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
${schema}`;
|
|
52
|
+
return schema;
|
|
53
|
+
}
|
|
54
|
+
async write() {
|
|
55
|
+
await this.#context.fs.write(this.#context.config.prisma.schema, this.build());
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
3
60
|
export { PrismaSchemaCreator };
|
package/dist/index.cjs
CHANGED
|
@@ -1,108 +1,21 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const
|
|
3
|
-
require('./
|
|
4
|
-
require('./
|
|
5
|
-
require('./utils.gen
|
|
6
|
-
require('./
|
|
7
|
-
require('./
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
require('./
|
|
11
|
-
require('./queryKeySerializer.gen-4TWHHXn3.cjs');
|
|
12
|
-
require('./client-DBAc9HV1.cjs');
|
|
13
|
-
const require_client_gen$1 = require('./client.gen-JhYC1fDf.cjs');
|
|
14
|
-
const require_sdk_gen = require('./sdk.gen-CAWIQ8BM.cjs');
|
|
15
|
-
const require_schema_creator = require('./schema-creator-zmlwh4-l.cjs');
|
|
16
|
-
require('./types.gen-BN-p9nVT.cjs');
|
|
17
|
-
require('./plugin-DE9fKOLA.cjs');
|
|
18
|
-
require('./prisma-BzQJneyW.cjs');
|
|
19
|
-
require('./types-CmY9-4ff.cjs');
|
|
2
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
+
const require_get_config_path = require('./powerlines/src/plugin-utils/get-config-path.cjs');
|
|
4
|
+
const require_paths = require('./powerlines/src/plugin-utils/paths.cjs');
|
|
5
|
+
const require_api_client_utils_gen = require('./api/client/utils.gen.cjs');
|
|
6
|
+
const require_api_client_client_gen = require('./api/client/client.gen.cjs');
|
|
7
|
+
const require_api_client_gen = require('./api/client.gen.cjs');
|
|
8
|
+
const require_api_sdk_gen = require('./api/sdk.gen.cjs');
|
|
9
|
+
const require_helpers_get_schema = require('./helpers/get-schema.cjs');
|
|
10
|
+
const require_helpers_schema_creator = require('./helpers/schema-creator.cjs');
|
|
20
11
|
let __stryke_cli_execute = require("@stryke/cli/execute");
|
|
21
12
|
let __stryke_fs_exists = require("@stryke/fs/exists");
|
|
22
13
|
let __stryke_fs_package_fns = require("@stryke/fs/package-fns");
|
|
23
14
|
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
24
15
|
let __stryke_path_replace = require("@stryke/path/replace");
|
|
25
16
|
let defu = require("defu");
|
|
26
|
-
defu =
|
|
27
|
-
let __stryke_path_join = require("@stryke/path/join");
|
|
28
|
-
let node_fs = require("node:fs");
|
|
17
|
+
defu = require_rolldown_runtime.__toESM(defu);
|
|
29
18
|
|
|
30
|
-
//#region ../powerlines/src/plugin-utils/get-config-path.ts
|
|
31
|
-
/**
|
|
32
|
-
* Get the configuration file path for a given name.
|
|
33
|
-
*
|
|
34
|
-
* @param context - The Powerlines context.
|
|
35
|
-
* @param name - The name of the configuration file (without extension).
|
|
36
|
-
* @returns The absolute path to the configuration file, or undefined if not found.
|
|
37
|
-
*/
|
|
38
|
-
function getConfigPath(context, name) {
|
|
39
|
-
if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`);
|
|
40
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`);
|
|
41
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`);
|
|
42
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`);
|
|
43
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`);
|
|
44
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`);
|
|
45
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`);
|
|
46
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`);
|
|
47
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`);
|
|
48
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`);
|
|
49
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`);
|
|
50
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`);
|
|
51
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`);
|
|
52
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`);
|
|
53
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`);
|
|
54
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`);
|
|
55
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yml`);
|
|
56
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yaml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yaml`);
|
|
57
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.json`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.json`);
|
|
58
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.jsonc`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.jsonc`);
|
|
59
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.ts`);
|
|
60
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cts`);
|
|
61
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mts`);
|
|
62
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.js`);
|
|
63
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cjs`);
|
|
64
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mjs`);
|
|
65
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.ts`);
|
|
66
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cts`);
|
|
67
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mts`);
|
|
68
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.js`);
|
|
69
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`);
|
|
70
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region ../powerlines/src/plugin-utils/paths.ts
|
|
75
|
-
/**
|
|
76
|
-
* Replaces tokens in the given path string with their corresponding values from the context.
|
|
77
|
-
*
|
|
78
|
-
* @remarks
|
|
79
|
-
* The following tokens are supported:
|
|
80
|
-
* - `{workspaceRoot}` - The root directory of the workspace.
|
|
81
|
-
* - `{root}` - The root directory of the project (same as `{projectRoot}`).
|
|
82
|
-
* - `{projectRoot}` - The root directory of the project (same as `{root}`).
|
|
83
|
-
* - `{sourceRoot}` - The source root directory of the project (usually `./src`).
|
|
84
|
-
* - `{powerlinesPath}` - The directory where Powerlines is installed.
|
|
85
|
-
* - `{cachePath}` - The environment's directory for cached files.
|
|
86
|
-
* - `{dataPath}` - The environment's directory for data files.
|
|
87
|
-
* - `{logPath}` - The environment's directory for log files.
|
|
88
|
-
* - `{tempPath}` - The environment's directory for temporary files.
|
|
89
|
-
* - `{configPath}` - The environment's directory for configuration files.
|
|
90
|
-
* - `{outputPath}` - The configured output directory for the project.
|
|
91
|
-
* - `{buildPath}` - The configured distribution directory for the project.
|
|
92
|
-
* - `{artifactsPath}` - The configured directory for build artifacts.
|
|
93
|
-
* - `{builtinPath}` - The configured directory for generated built-in plugins.
|
|
94
|
-
* - `{entryPath}` - The configured directory for generated entry files.
|
|
95
|
-
*
|
|
96
|
-
* @param context - The context containing the values for the path tokens.
|
|
97
|
-
* @param path - The path string with tokens to replace.
|
|
98
|
-
* @returns The path string with tokens replaced by their corresponding values from the context.
|
|
99
|
-
*/
|
|
100
|
-
function replacePathTokens(context, path) {
|
|
101
|
-
if (!path) return path;
|
|
102
|
-
return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).replaceAll("{sourceRoot}", context.config.sourceRoot).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", (0, __stryke_path_replace.replacePath)(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", (0, __stryke_path_replace.replacePath)(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", (0, __stryke_path_replace.replacePath)(context.entryPath, context.workspaceConfig.workspaceRoot));
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
//#endregion
|
|
106
19
|
//#region src/index.ts
|
|
107
20
|
/**
|
|
108
21
|
* A Powerlines plugin to integrate Prisma for code generation.
|
|
@@ -116,7 +29,7 @@ const plugin = (options = {}) => {
|
|
|
116
29
|
config() {
|
|
117
30
|
return { prisma: (0, defu.default)(options, {
|
|
118
31
|
schema: (0, __stryke_path_join_paths.joinPaths)(this.config.projectRoot, "prisma", "schema.prisma"),
|
|
119
|
-
configFile: options.configFile || getConfigPath(this, "prisma.config"),
|
|
32
|
+
configFile: options.configFile || require_get_config_path.getConfigPath(this, "prisma.config"),
|
|
120
33
|
outputPath: (0, __stryke_path_join_paths.joinPaths)("{builtinPath}", "prisma"),
|
|
121
34
|
prismaPostgres: options?.prismaPostgres ? {
|
|
122
35
|
projectId: this.config.name,
|
|
@@ -126,9 +39,9 @@ const plugin = (options = {}) => {
|
|
|
126
39
|
},
|
|
127
40
|
async configResolved() {
|
|
128
41
|
this.dependencies["@prisma/client"] = "latest";
|
|
129
|
-
this.config.prisma.configFile = replacePathTokens(this, this.config.prisma.configFile);
|
|
42
|
+
this.config.prisma.configFile = require_paths.replacePathTokens(this, this.config.prisma.configFile);
|
|
130
43
|
if (!this.config.prisma.schema) throw new Error(`Prisma schema path is not defined. Please specify a valid path in the plugin configuration.`);
|
|
131
|
-
this.config.prisma.schema = replacePathTokens(this, this.config.prisma.schema);
|
|
44
|
+
this.config.prisma.schema = require_paths.replacePathTokens(this, this.config.prisma.schema);
|
|
132
45
|
if (this.config.prisma.prismaPostgres) {
|
|
133
46
|
let serviceToken = process.env.PRISMA_SERVICE_TOKEN;
|
|
134
47
|
if (!serviceToken) {
|
|
@@ -136,7 +49,7 @@ const plugin = (options = {}) => {
|
|
|
136
49
|
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.");
|
|
137
50
|
else throw new Error("Unable to determine the Prisma service token. Please set the `PRISMA_SERVICE_TOKEN` environment variable.");
|
|
138
51
|
}
|
|
139
|
-
const client$1 =
|
|
52
|
+
const client$1 = require_api_client_client_gen.createClient(require_api_client_utils_gen.createConfig({
|
|
140
53
|
baseUrl: "https://api.prisma.io",
|
|
141
54
|
throwOnError: true,
|
|
142
55
|
headers: {
|
|
@@ -144,7 +57,7 @@ const plugin = (options = {}) => {
|
|
|
144
57
|
"User-Agent": "powerlines/1.0"
|
|
145
58
|
}
|
|
146
59
|
}));
|
|
147
|
-
this.prisma.api = new
|
|
60
|
+
this.prisma.api = new require_api_sdk_gen.PrismaClient({ client: client$1 });
|
|
148
61
|
await this.prisma.api.createDatabase({
|
|
149
62
|
path: { projectId: this.config.prisma.prismaPostgres.projectId },
|
|
150
63
|
body: {
|
|
@@ -155,14 +68,14 @@ const plugin = (options = {}) => {
|
|
|
155
68
|
}).then((response) => response.data.data);
|
|
156
69
|
}
|
|
157
70
|
if (!this.config.prisma.outputPath) throw new Error(`Prisma generated path is not defined. Please specify a valid path in the plugin configuration.`);
|
|
158
|
-
this.config.prisma.outputPath = replacePathTokens(this, this.config.prisma.outputPath);
|
|
71
|
+
this.config.prisma.outputPath = require_paths.replacePathTokens(this, this.config.prisma.outputPath);
|
|
159
72
|
this.prisma ??= {};
|
|
160
73
|
if (!(0, __stryke_fs_exists.existsSync)(this.config.prisma.schema)) this.prisma.schema ??= {
|
|
161
74
|
generators: [],
|
|
162
75
|
datasources: [],
|
|
163
76
|
warnings: []
|
|
164
77
|
};
|
|
165
|
-
else this.prisma.schema = await
|
|
78
|
+
else this.prisma.schema = await require_helpers_get_schema.getSchema({ datamodel: this.config.prisma.schema });
|
|
166
79
|
const generator = this.prisma.schema.generators.find((gen) => gen.provider.value === "prisma-client-js");
|
|
167
80
|
if (!generator) this.prisma.schema.generators.push({
|
|
168
81
|
name: "prisma-client-js",
|
|
@@ -183,7 +96,7 @@ const plugin = (options = {}) => {
|
|
|
183
96
|
value: this.config.prisma.outputPath,
|
|
184
97
|
fromEnvVar: null
|
|
185
98
|
};
|
|
186
|
-
this.prisma.builder = new
|
|
99
|
+
this.prisma.builder = new require_helpers_schema_creator.PrismaSchemaCreator(this);
|
|
187
100
|
},
|
|
188
101
|
async prepare() {
|
|
189
102
|
await this.prisma.builder.write();
|
|
@@ -208,7 +121,7 @@ const plugin = (options = {}) => {
|
|
|
208
121
|
var src_default = plugin;
|
|
209
122
|
|
|
210
123
|
//#endregion
|
|
211
|
-
exports.PrismaClient =
|
|
212
|
-
exports.client =
|
|
124
|
+
exports.PrismaClient = require_api_sdk_gen.PrismaClient;
|
|
125
|
+
exports.client = require_api_client_gen.client;
|
|
213
126
|
exports.default = src_default;
|
|
214
127
|
exports.plugin = plugin;
|
package/dist/index.mjs
CHANGED
|
@@ -1,106 +1,18 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./utils.gen
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "./
|
|
9
|
-
import "./queryKeySerializer.gen-BMMZAjVN.mjs";
|
|
10
|
-
import "./client-BlRUW8mL.mjs";
|
|
11
|
-
import { t as client } from "./client.gen-COMS1glH.mjs";
|
|
12
|
-
import { t as PrismaClient } from "./sdk.gen-B2his2jD.mjs";
|
|
13
|
-
import { t as getSchema } from "./get-schema-CKw6MiKb.mjs";
|
|
14
|
-
import { t as PrismaSchemaCreator } from "./schema-creator-Cfian3ih.mjs";
|
|
15
|
-
import "./types.gen-CS2KiRfG.mjs";
|
|
16
|
-
import "./plugin-EFmNQLKA.mjs";
|
|
17
|
-
import "./prisma-CB-m5c-j.mjs";
|
|
18
|
-
import "./types-Dbwx-Khg.mjs";
|
|
1
|
+
import { getConfigPath } from "./powerlines/src/plugin-utils/get-config-path.mjs";
|
|
2
|
+
import { replacePathTokens } from "./powerlines/src/plugin-utils/paths.mjs";
|
|
3
|
+
import { createConfig } from "./api/client/utils.gen.mjs";
|
|
4
|
+
import { createClient } from "./api/client/client.gen.mjs";
|
|
5
|
+
import { client } from "./api/client.gen.mjs";
|
|
6
|
+
import { PrismaClient } from "./api/sdk.gen.mjs";
|
|
7
|
+
import { getSchema } from "./helpers/get-schema.mjs";
|
|
8
|
+
import { PrismaSchemaCreator } from "./helpers/schema-creator.mjs";
|
|
19
9
|
import { execute, executePackage } from "@stryke/cli/execute";
|
|
20
10
|
import { existsSync } from "@stryke/fs/exists";
|
|
21
11
|
import { isPackageListed } from "@stryke/fs/package-fns";
|
|
22
12
|
import { joinPaths } from "@stryke/path/join-paths";
|
|
23
13
|
import { replacePath } from "@stryke/path/replace";
|
|
24
14
|
import defu from "defu";
|
|
25
|
-
import { joinPaths as joinPaths$1 } from "@stryke/path/join";
|
|
26
|
-
import { existsSync as existsSync$1 } from "node:fs";
|
|
27
15
|
|
|
28
|
-
//#region ../powerlines/src/plugin-utils/get-config-path.ts
|
|
29
|
-
/**
|
|
30
|
-
* Get the configuration file path for a given name.
|
|
31
|
-
*
|
|
32
|
-
* @param context - The Powerlines context.
|
|
33
|
-
* @param name - The name of the configuration file (without extension).
|
|
34
|
-
* @returns The absolute path to the configuration file, or undefined if not found.
|
|
35
|
-
*/
|
|
36
|
-
function getConfigPath(context, name) {
|
|
37
|
-
if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`);
|
|
38
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`);
|
|
39
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`);
|
|
40
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`);
|
|
41
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`);
|
|
42
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`);
|
|
43
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`);
|
|
44
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`);
|
|
45
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`);
|
|
46
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`);
|
|
47
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`);
|
|
48
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`);
|
|
49
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`);
|
|
50
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`);
|
|
51
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`);
|
|
52
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`);
|
|
53
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.yml`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.yml`);
|
|
54
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.yaml`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.yaml`);
|
|
55
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.json`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.json`);
|
|
56
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.jsonc`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.jsonc`);
|
|
57
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.ts`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.ts`);
|
|
58
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.cts`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.cts`);
|
|
59
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.mts`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.mts`);
|
|
60
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.js`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.js`);
|
|
61
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.cjs`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.cjs`);
|
|
62
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.mjs`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.mjs`);
|
|
63
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.config.ts`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.config.ts`);
|
|
64
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.config.cts`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.config.cts`);
|
|
65
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.config.mts`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.config.mts`);
|
|
66
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.config.js`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.config.js`);
|
|
67
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`);
|
|
68
|
-
else if (existsSync$1(joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`))) return joinPaths$1(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region ../powerlines/src/plugin-utils/paths.ts
|
|
73
|
-
/**
|
|
74
|
-
* Replaces tokens in the given path string with their corresponding values from the context.
|
|
75
|
-
*
|
|
76
|
-
* @remarks
|
|
77
|
-
* The following tokens are supported:
|
|
78
|
-
* - `{workspaceRoot}` - The root directory of the workspace.
|
|
79
|
-
* - `{root}` - The root directory of the project (same as `{projectRoot}`).
|
|
80
|
-
* - `{projectRoot}` - The root directory of the project (same as `{root}`).
|
|
81
|
-
* - `{sourceRoot}` - The source root directory of the project (usually `./src`).
|
|
82
|
-
* - `{powerlinesPath}` - The directory where Powerlines is installed.
|
|
83
|
-
* - `{cachePath}` - The environment's directory for cached files.
|
|
84
|
-
* - `{dataPath}` - The environment's directory for data files.
|
|
85
|
-
* - `{logPath}` - The environment's directory for log files.
|
|
86
|
-
* - `{tempPath}` - The environment's directory for temporary files.
|
|
87
|
-
* - `{configPath}` - The environment's directory for configuration files.
|
|
88
|
-
* - `{outputPath}` - The configured output directory for the project.
|
|
89
|
-
* - `{buildPath}` - The configured distribution directory for the project.
|
|
90
|
-
* - `{artifactsPath}` - The configured directory for build artifacts.
|
|
91
|
-
* - `{builtinPath}` - The configured directory for generated built-in plugins.
|
|
92
|
-
* - `{entryPath}` - The configured directory for generated entry files.
|
|
93
|
-
*
|
|
94
|
-
* @param context - The context containing the values for the path tokens.
|
|
95
|
-
* @param path - The path string with tokens to replace.
|
|
96
|
-
* @returns The path string with tokens replaced by their corresponding values from the context.
|
|
97
|
-
*/
|
|
98
|
-
function replacePathTokens(context, path) {
|
|
99
|
-
if (!path) return path;
|
|
100
|
-
return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).replaceAll("{sourceRoot}", context.config.sourceRoot).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", replacePath(context.entryPath, context.workspaceConfig.workspaceRoot));
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
//#endregion
|
|
104
16
|
//#region src/index.ts
|
|
105
17
|
/**
|
|
106
18
|
* A Powerlines plugin to integrate Prisma for code generation.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __stryke_path_join = require("@stryke/path/join");
|
|
3
|
+
let node_fs = require("node:fs");
|
|
4
|
+
|
|
5
|
+
//#region ../powerlines/src/plugin-utils/get-config-path.ts
|
|
6
|
+
/**
|
|
7
|
+
* Get the configuration file path for a given name.
|
|
8
|
+
*
|
|
9
|
+
* @param context - The Powerlines context.
|
|
10
|
+
* @param name - The name of the configuration file (without extension).
|
|
11
|
+
* @returns The absolute path to the configuration file, or undefined if not found.
|
|
12
|
+
*/
|
|
13
|
+
function getConfigPath(context, name) {
|
|
14
|
+
if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`);
|
|
15
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`);
|
|
16
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`);
|
|
17
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`);
|
|
18
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`);
|
|
19
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`);
|
|
20
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`);
|
|
21
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`);
|
|
22
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`);
|
|
23
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`);
|
|
24
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`);
|
|
25
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`);
|
|
26
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`);
|
|
27
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`);
|
|
28
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`);
|
|
29
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`);
|
|
30
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yml`);
|
|
31
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yaml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yaml`);
|
|
32
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.json`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.json`);
|
|
33
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.jsonc`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.jsonc`);
|
|
34
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.ts`);
|
|
35
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cts`);
|
|
36
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mts`);
|
|
37
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.js`);
|
|
38
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cjs`);
|
|
39
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mjs`);
|
|
40
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.ts`);
|
|
41
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cts`);
|
|
42
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mts`);
|
|
43
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.js`);
|
|
44
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`);
|
|
45
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
exports.getConfigPath = getConfigPath;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { joinPaths } from "@stryke/path/join";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
|
|
4
|
+
//#region ../powerlines/src/plugin-utils/get-config-path.ts
|
|
5
|
+
/**
|
|
6
|
+
* Get the configuration file path for a given name.
|
|
7
|
+
*
|
|
8
|
+
* @param context - The Powerlines context.
|
|
9
|
+
* @param name - The name of the configuration file (without extension).
|
|
10
|
+
* @returns The absolute path to the configuration file, or undefined if not found.
|
|
11
|
+
*/
|
|
12
|
+
function getConfigPath(context, name) {
|
|
13
|
+
if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`);
|
|
14
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`);
|
|
15
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`);
|
|
16
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`);
|
|
17
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`);
|
|
18
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`);
|
|
19
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`);
|
|
20
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`);
|
|
21
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`);
|
|
22
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`);
|
|
23
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`);
|
|
24
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`);
|
|
25
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`);
|
|
26
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`);
|
|
27
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`);
|
|
28
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`);
|
|
29
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.yml`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.yml`);
|
|
30
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.yaml`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.yaml`);
|
|
31
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.json`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.json`);
|
|
32
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.jsonc`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.jsonc`);
|
|
33
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.ts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.ts`);
|
|
34
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.cts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.cts`);
|
|
35
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.mts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.mts`);
|
|
36
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.js`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.js`);
|
|
37
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.cjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.cjs`);
|
|
38
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.mjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.mjs`);
|
|
39
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.ts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.ts`);
|
|
40
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.cts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.cts`);
|
|
41
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.mts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.mts`);
|
|
42
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.js`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.js`);
|
|
43
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`);
|
|
44
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { getConfigPath };
|