@pgpmjs/export 0.29.0 → 0.29.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -246,7 +246,8 @@ export const installMissingModules = async (moduleDir, missingModules) => {
246
246
  export const makeReplacer = ({ schemas, name, schemaPrefix }) => {
247
247
  const replacements = ['constructive-extension-name', name];
248
248
  const prefix = schemaPrefix || name;
249
- const schemaReplacers = schemas.map((schema) => [
249
+ const sortedSchemas = [...schemas].sort((a, b) => b.schema_name.length - a.schema_name.length || a.schema_name.localeCompare(b.schema_name));
250
+ const schemaReplacers = sortedSchemas.map((schema) => [
250
251
  schema.schema_name,
251
252
  toSnakeCase(`${prefix}_${schema.name}`)
252
253
  ]);
@@ -273,7 +274,7 @@ export const preparePackage = async ({ project, author, outdir, name, descriptio
273
274
  mkdirSync(pgpmDir, { recursive: true });
274
275
  process.chdir(pgpmDir);
275
276
  try {
276
- const plan = glob(path.join(pgpmDir, 'pgpm.plan'));
277
+ const plan = glob(path.join(pgpmDir, 'pgpm.plan')).sort((a, b) => a.localeCompare(b));
277
278
  if (!plan.length) {
278
279
  const { fullName, email } = parseAuthor(author);
279
280
  // Always run non-interactively — all answers are pre-filled
package/export-utils.js CHANGED
@@ -258,7 +258,8 @@ exports.installMissingModules = installMissingModules;
258
258
  const makeReplacer = ({ schemas, name, schemaPrefix }) => {
259
259
  const replacements = ['constructive-extension-name', name];
260
260
  const prefix = schemaPrefix || name;
261
- const schemaReplacers = schemas.map((schema) => [
261
+ const sortedSchemas = [...schemas].sort((a, b) => b.schema_name.length - a.schema_name.length || a.schema_name.localeCompare(b.schema_name));
262
+ const schemaReplacers = sortedSchemas.map((schema) => [
262
263
  schema.schema_name,
263
264
  (0, inflekt_1.toSnakeCase)(`${prefix}_${schema.name}`)
264
265
  ]);
@@ -286,7 +287,7 @@ const preparePackage = async ({ project, author, outdir, name, description, exte
286
287
  (0, fs_1.mkdirSync)(pgpmDir, { recursive: true });
287
288
  process.chdir(pgpmDir);
288
289
  try {
289
- const plan = (0, glob_1.sync)(path_1.default.join(pgpmDir, 'pgpm.plan'));
290
+ const plan = (0, glob_1.sync)(path_1.default.join(pgpmDir, 'pgpm.plan')).sort((a, b) => a.localeCompare(b));
290
291
  if (!plan.length) {
291
292
  const { fullName, email } = (0, core_1.parseAuthor)(author);
292
293
  // Always run non-interactively — all answers are pre-filled
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpmjs/export",
3
- "version": "0.29.0",
3
+ "version": "0.29.2",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "PGPM export tools for SQL and GraphQL database migration extraction",
6
6
  "main": "index.js",
@@ -41,11 +41,11 @@
41
41
  "@pgsql/types": "^17.6.2",
42
42
  "@types/pg": "^8.20.0",
43
43
  "makage": "^0.3.0",
44
- "pgsql-test": "^4.19.0"
44
+ "pgsql-test": "^4.19.2"
45
45
  },
46
46
  "dependencies": {
47
- "@pgpmjs/core": "^6.29.0",
48
- "@pgpmjs/migrate-client": "^0.20.0",
47
+ "@pgpmjs/core": "^6.29.2",
48
+ "@pgpmjs/migrate-client": "^0.20.2",
49
49
  "@pgpmjs/types": "^2.34.0",
50
50
  "csv-to-pg": "^3.21.0",
51
51
  "glob": "^13.0.6",
@@ -55,5 +55,5 @@
55
55
  "pg-cache": "^3.15.0",
56
56
  "pg-env": "^1.18.0"
57
57
  },
58
- "gitHead": "7eb34a3baa10ba3476575967b87ff51b606e042a"
58
+ "gitHead": "cd21f62bb64bdc7f4f40f6cef6af73f8f1c8f8dc"
59
59
  }