@pgpmjs/core 4.5.3 → 4.5.4
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.
|
@@ -92,8 +92,10 @@ const installMissingModules = async (moduleDir, missingModules) => {
|
|
|
92
92
|
await moduleProject.installModules(...missingNames);
|
|
93
93
|
console.log('Modules installed successfully.');
|
|
94
94
|
};
|
|
95
|
-
const exportMigrationsToDisk = async ({ project, options, database, databaseId, databaseName, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username }) => {
|
|
95
|
+
const exportMigrationsToDisk = async ({ project, options, database, databaseId, databaseName, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username, serviceOutdir }) => {
|
|
96
96
|
outdir = outdir + '/';
|
|
97
|
+
// Use serviceOutdir for service module, defaulting to outdir if not provided
|
|
98
|
+
const svcOutdir = (serviceOutdir || outdir.slice(0, -1)) + '/';
|
|
97
99
|
const pgPool = getPgPool({
|
|
98
100
|
...options.pg,
|
|
99
101
|
database
|
|
@@ -153,11 +155,11 @@ const exportMigrationsToDisk = async ({ project, options, database, databaseId,
|
|
|
153
155
|
const metaDesc = metaExtensionDesc || `${metaExtensionName} service utilities for managing domains, APIs, and services`;
|
|
154
156
|
// Detect missing modules at workspace level and prompt user
|
|
155
157
|
const svcMissingResult = await detectMissingModules(project, [...SERVICE_REQUIRED_EXTENSIONS], prompter);
|
|
156
|
-
// Create/prepare the module directory
|
|
158
|
+
// Create/prepare the module directory (use serviceOutdir if provided)
|
|
157
159
|
const svcModuleDir = await preparePackage({
|
|
158
160
|
project,
|
|
159
161
|
author,
|
|
160
|
-
outdir,
|
|
162
|
+
outdir: svcOutdir,
|
|
161
163
|
name: metaExtensionName,
|
|
162
164
|
description: metaDesc,
|
|
163
165
|
extensions: [...SERVICE_REQUIRED_EXTENSIONS],
|
|
@@ -211,12 +213,13 @@ SET session_replication_role TO DEFAULT;
|
|
|
211
213
|
];
|
|
212
214
|
opts.replacer = metaReplacer.replacer;
|
|
213
215
|
opts.name = metaExtensionName;
|
|
216
|
+
opts.outdir = svcOutdir;
|
|
214
217
|
writePgpmPlan(metaPackage, opts);
|
|
215
218
|
writePgpmFiles(metaPackage, opts);
|
|
216
219
|
}
|
|
217
220
|
pgPool.end();
|
|
218
221
|
};
|
|
219
|
-
export const exportMigrations = async ({ project, options, dbInfo, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username }) => {
|
|
222
|
+
export const exportMigrations = async ({ project, options, dbInfo, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username, serviceOutdir }) => {
|
|
220
223
|
for (let v = 0; v < dbInfo.database_ids.length; v++) {
|
|
221
224
|
const databaseId = dbInfo.database_ids[v];
|
|
222
225
|
await exportMigrationsToDisk({
|
|
@@ -234,7 +237,8 @@ export const exportMigrations = async ({ project, options, dbInfo, author, outdi
|
|
|
234
237
|
outdir,
|
|
235
238
|
prompter,
|
|
236
239
|
repoName,
|
|
237
|
-
username
|
|
240
|
+
username,
|
|
241
|
+
serviceOutdir
|
|
238
242
|
});
|
|
239
243
|
}
|
|
240
244
|
};
|
|
@@ -27,6 +27,8 @@ interface ExportOptions {
|
|
|
27
27
|
repoName?: string;
|
|
28
28
|
/** GitHub username/org for module scaffolding. Required for non-interactive use. */
|
|
29
29
|
username?: string;
|
|
30
|
+
/** Output directory for service/meta module. Defaults to outdir if not provided. */
|
|
31
|
+
serviceOutdir?: string;
|
|
30
32
|
}
|
|
31
|
-
export declare const exportMigrations: ({ project, options, dbInfo, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username }: ExportOptions) => Promise<void>;
|
|
33
|
+
export declare const exportMigrations: ({ project, options, dbInfo, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username, serviceOutdir }: ExportOptions) => Promise<void>;
|
|
32
34
|
export {};
|
|
@@ -98,8 +98,10 @@ const installMissingModules = async (moduleDir, missingModules) => {
|
|
|
98
98
|
await moduleProject.installModules(...missingNames);
|
|
99
99
|
console.log('Modules installed successfully.');
|
|
100
100
|
};
|
|
101
|
-
const exportMigrationsToDisk = async ({ project, options, database, databaseId, databaseName, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username }) => {
|
|
101
|
+
const exportMigrationsToDisk = async ({ project, options, database, databaseId, databaseName, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username, serviceOutdir }) => {
|
|
102
102
|
outdir = outdir + '/';
|
|
103
|
+
// Use serviceOutdir for service module, defaulting to outdir if not provided
|
|
104
|
+
const svcOutdir = (serviceOutdir || outdir.slice(0, -1)) + '/';
|
|
103
105
|
const pgPool = (0, pg_cache_1.getPgPool)({
|
|
104
106
|
...options.pg,
|
|
105
107
|
database
|
|
@@ -159,11 +161,11 @@ const exportMigrationsToDisk = async ({ project, options, database, databaseId,
|
|
|
159
161
|
const metaDesc = metaExtensionDesc || `${metaExtensionName} service utilities for managing domains, APIs, and services`;
|
|
160
162
|
// Detect missing modules at workspace level and prompt user
|
|
161
163
|
const svcMissingResult = await detectMissingModules(project, [...SERVICE_REQUIRED_EXTENSIONS], prompter);
|
|
162
|
-
// Create/prepare the module directory
|
|
164
|
+
// Create/prepare the module directory (use serviceOutdir if provided)
|
|
163
165
|
const svcModuleDir = await preparePackage({
|
|
164
166
|
project,
|
|
165
167
|
author,
|
|
166
|
-
outdir,
|
|
168
|
+
outdir: svcOutdir,
|
|
167
169
|
name: metaExtensionName,
|
|
168
170
|
description: metaDesc,
|
|
169
171
|
extensions: [...SERVICE_REQUIRED_EXTENSIONS],
|
|
@@ -217,12 +219,13 @@ SET session_replication_role TO DEFAULT;
|
|
|
217
219
|
];
|
|
218
220
|
opts.replacer = metaReplacer.replacer;
|
|
219
221
|
opts.name = metaExtensionName;
|
|
222
|
+
opts.outdir = svcOutdir;
|
|
220
223
|
(0, files_1.writePgpmPlan)(metaPackage, opts);
|
|
221
224
|
(0, files_1.writePgpmFiles)(metaPackage, opts);
|
|
222
225
|
}
|
|
223
226
|
pgPool.end();
|
|
224
227
|
};
|
|
225
|
-
const exportMigrations = async ({ project, options, dbInfo, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username }) => {
|
|
228
|
+
const exportMigrations = async ({ project, options, dbInfo, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username, serviceOutdir }) => {
|
|
226
229
|
for (let v = 0; v < dbInfo.database_ids.length; v++) {
|
|
227
230
|
const databaseId = dbInfo.database_ids[v];
|
|
228
231
|
await exportMigrationsToDisk({
|
|
@@ -240,7 +243,8 @@ const exportMigrations = async ({ project, options, dbInfo, author, outdir, sche
|
|
|
240
243
|
outdir,
|
|
241
244
|
prompter,
|
|
242
245
|
repoName,
|
|
243
|
-
username
|
|
246
|
+
username,
|
|
247
|
+
serviceOutdir
|
|
244
248
|
});
|
|
245
249
|
}
|
|
246
250
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpmjs/core",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.4",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "PGPM Package and Migration Tools",
|
|
6
6
|
"main": "index.js",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"pgsql-parser": "^17.9.5",
|
|
65
65
|
"yanse": "^0.1.8"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "324881a46912b7d15a76f864aada03ce926f9176"
|
|
68
68
|
}
|