@pgpmjs/core 4.5.2 → 4.5.3

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,7 +92,7 @@ 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 }) => {
95
+ const exportMigrationsToDisk = async ({ project, options, database, databaseId, databaseName, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username }) => {
96
96
  outdir = outdir + '/';
97
97
  const pgPool = getPgPool({
98
98
  ...options.pg,
@@ -133,7 +133,9 @@ const exportMigrationsToDisk = async ({ project, options, database, databaseId,
133
133
  name,
134
134
  description: dbExtensionDesc,
135
135
  extensions: [...DB_REQUIRED_EXTENSIONS],
136
- prompter
136
+ prompter,
137
+ repoName,
138
+ username
137
139
  });
138
140
  // Install missing modules if user confirmed (now that module exists)
139
141
  if (dbMissingResult.shouldInstall) {
@@ -159,7 +161,9 @@ const exportMigrationsToDisk = async ({ project, options, database, databaseId,
159
161
  name: metaExtensionName,
160
162
  description: metaDesc,
161
163
  extensions: [...SERVICE_REQUIRED_EXTENSIONS],
162
- prompter
164
+ prompter,
165
+ repoName,
166
+ username
163
167
  });
164
168
  // Install missing modules if user confirmed (now that module exists)
165
169
  if (svcMissingResult.shouldInstall) {
@@ -212,7 +216,7 @@ SET session_replication_role TO DEFAULT;
212
216
  }
213
217
  pgPool.end();
214
218
  };
215
- export const exportMigrations = async ({ project, options, dbInfo, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter }) => {
219
+ export const exportMigrations = async ({ project, options, dbInfo, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username }) => {
216
220
  for (let v = 0; v < dbInfo.database_ids.length; v++) {
217
221
  const databaseId = dbInfo.database_ids[v];
218
222
  await exportMigrationsToDisk({
@@ -228,7 +232,9 @@ export const exportMigrations = async ({ project, options, dbInfo, author, outdi
228
232
  schema_names,
229
233
  author,
230
234
  outdir,
231
- prompter
235
+ prompter,
236
+ repoName,
237
+ username
232
238
  });
233
239
  }
234
240
  };
@@ -238,7 +244,7 @@ export const exportMigrations = async ({ project, options, dbInfo, author, outdi
238
244
  *
239
245
  * @returns The absolute path to the created/prepared module directory
240
246
  */
241
- const preparePackage = async ({ project, author, outdir, name, description, extensions, prompter }) => {
247
+ const preparePackage = async ({ project, author, outdir, name, description, extensions, prompter, repoName, username }) => {
242
248
  const curDir = process.cwd();
243
249
  const pgpmDir = path.resolve(path.join(outdir, name));
244
250
  mkdirSync(pgpmDir, { recursive: true });
@@ -257,7 +263,10 @@ const preparePackage = async ({ project, author, outdir, name, description, exte
257
263
  access: 'restricted',
258
264
  license: 'CLOSED',
259
265
  fullName,
260
- ...(email && { email })
266
+ ...(email && { email }),
267
+ // Use provided values or sensible defaults
268
+ repoName: repoName || name,
269
+ ...(username && { username })
261
270
  }
262
271
  });
263
272
  }
@@ -23,6 +23,10 @@ interface ExportOptions {
23
23
  metaExtensionName: string;
24
24
  metaExtensionDesc?: string;
25
25
  prompter?: Prompter;
26
+ /** Repository name for module scaffolding. Defaults to module name if not provided. */
27
+ repoName?: string;
28
+ /** GitHub username/org for module scaffolding. Required for non-interactive use. */
29
+ username?: string;
26
30
  }
27
- export declare const exportMigrations: ({ project, options, dbInfo, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter }: ExportOptions) => Promise<void>;
31
+ export declare const exportMigrations: ({ project, options, dbInfo, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username }: ExportOptions) => Promise<void>;
28
32
  export {};
@@ -98,7 +98,7 @@ 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 }) => {
101
+ const exportMigrationsToDisk = async ({ project, options, database, databaseId, databaseName, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username }) => {
102
102
  outdir = outdir + '/';
103
103
  const pgPool = (0, pg_cache_1.getPgPool)({
104
104
  ...options.pg,
@@ -139,7 +139,9 @@ const exportMigrationsToDisk = async ({ project, options, database, databaseId,
139
139
  name,
140
140
  description: dbExtensionDesc,
141
141
  extensions: [...DB_REQUIRED_EXTENSIONS],
142
- prompter
142
+ prompter,
143
+ repoName,
144
+ username
143
145
  });
144
146
  // Install missing modules if user confirmed (now that module exists)
145
147
  if (dbMissingResult.shouldInstall) {
@@ -165,7 +167,9 @@ const exportMigrationsToDisk = async ({ project, options, database, databaseId,
165
167
  name: metaExtensionName,
166
168
  description: metaDesc,
167
169
  extensions: [...SERVICE_REQUIRED_EXTENSIONS],
168
- prompter
170
+ prompter,
171
+ repoName,
172
+ username
169
173
  });
170
174
  // Install missing modules if user confirmed (now that module exists)
171
175
  if (svcMissingResult.shouldInstall) {
@@ -218,7 +222,7 @@ SET session_replication_role TO DEFAULT;
218
222
  }
219
223
  pgPool.end();
220
224
  };
221
- const exportMigrations = async ({ project, options, dbInfo, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter }) => {
225
+ const exportMigrations = async ({ project, options, dbInfo, author, outdir, schema_names, extensionName, extensionDesc, metaExtensionName, metaExtensionDesc, prompter, repoName, username }) => {
222
226
  for (let v = 0; v < dbInfo.database_ids.length; v++) {
223
227
  const databaseId = dbInfo.database_ids[v];
224
228
  await exportMigrationsToDisk({
@@ -234,7 +238,9 @@ const exportMigrations = async ({ project, options, dbInfo, author, outdir, sche
234
238
  schema_names,
235
239
  author,
236
240
  outdir,
237
- prompter
241
+ prompter,
242
+ repoName,
243
+ username
238
244
  });
239
245
  }
240
246
  };
@@ -245,7 +251,7 @@ exports.exportMigrations = exportMigrations;
245
251
  *
246
252
  * @returns The absolute path to the created/prepared module directory
247
253
  */
248
- const preparePackage = async ({ project, author, outdir, name, description, extensions, prompter }) => {
254
+ const preparePackage = async ({ project, author, outdir, name, description, extensions, prompter, repoName, username }) => {
249
255
  const curDir = process.cwd();
250
256
  const pgpmDir = path_1.default.resolve(path_1.default.join(outdir, name));
251
257
  (0, fs_1.mkdirSync)(pgpmDir, { recursive: true });
@@ -264,7 +270,10 @@ const preparePackage = async ({ project, author, outdir, name, description, exte
264
270
  access: 'restricted',
265
271
  license: 'CLOSED',
266
272
  fullName,
267
- ...(email && { email })
273
+ ...(email && { email }),
274
+ // Use provided values or sensible defaults
275
+ repoName: repoName || name,
276
+ ...(username && { username })
268
277
  }
269
278
  });
270
279
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpmjs/core",
3
- "version": "4.5.2",
3
+ "version": "4.5.3",
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": "3768b497b5b65410a23bcf7e01ed4192a5f1dd95"
67
+ "gitHead": "b50728f2e33dd0b1da62f574c976737f2d3a41f8"
68
68
  }