@pgpmjs/core 6.29.0 → 6.29.1
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/core/class/pgpm.js +2 -2
- package/esm/core/class/pgpm.js +2 -2
- package/esm/resolution/deps.js +7 -2
- package/package.json +2 -2
- package/resolution/deps.js +7 -2
package/core/class/pgpm.js
CHANGED
|
@@ -133,7 +133,7 @@ class PgpmPackage {
|
|
|
133
133
|
const dirs = globs.flatMap(pattern => glob.sync(path_1.default.join(this.workspacePath, pattern)));
|
|
134
134
|
const resolvedDirs = dirs.map(dir => path_1.default.resolve(dir));
|
|
135
135
|
// Remove duplicates by converting to Set and back to array
|
|
136
|
-
return [...new Set(resolvedDirs)];
|
|
136
|
+
return [...new Set(resolvedDirs.sort((a, b) => a.localeCompare(b)))];
|
|
137
137
|
}
|
|
138
138
|
loadAllowedParentDirs() {
|
|
139
139
|
const globs = this.config?.packages ?? [];
|
|
@@ -236,7 +236,7 @@ class PgpmPackage {
|
|
|
236
236
|
listModules() {
|
|
237
237
|
if (!this.workspacePath)
|
|
238
238
|
return {};
|
|
239
|
-
const moduleFiles = glob.sync(`${this.workspacePath}/**/*.control`).filter((file) => !/node_modules/.test(file));
|
|
239
|
+
const moduleFiles = glob.sync(`${this.workspacePath}/**/*.control`).filter((file) => !/node_modules/.test(file)).sort((a, b) => a.localeCompare(b));
|
|
240
240
|
// Group files by module name to handle collisions
|
|
241
241
|
const filesByName = new Map();
|
|
242
242
|
moduleFiles.forEach((file) => {
|
package/esm/core/class/pgpm.js
CHANGED
|
@@ -94,7 +94,7 @@ export class PgpmPackage {
|
|
|
94
94
|
const dirs = globs.flatMap(pattern => glob.sync(path.join(this.workspacePath, pattern)));
|
|
95
95
|
const resolvedDirs = dirs.map(dir => path.resolve(dir));
|
|
96
96
|
// Remove duplicates by converting to Set and back to array
|
|
97
|
-
return [...new Set(resolvedDirs)];
|
|
97
|
+
return [...new Set(resolvedDirs.sort((a, b) => a.localeCompare(b)))];
|
|
98
98
|
}
|
|
99
99
|
loadAllowedParentDirs() {
|
|
100
100
|
const globs = this.config?.packages ?? [];
|
|
@@ -197,7 +197,7 @@ export class PgpmPackage {
|
|
|
197
197
|
listModules() {
|
|
198
198
|
if (!this.workspacePath)
|
|
199
199
|
return {};
|
|
200
|
-
const moduleFiles = glob.sync(`${this.workspacePath}/**/*.control`).filter((file) => !/node_modules/.test(file));
|
|
200
|
+
const moduleFiles = glob.sync(`${this.workspacePath}/**/*.control`).filter((file) => !/node_modules/.test(file)).sort((a, b) => a.localeCompare(b));
|
|
201
201
|
// Group files by module name to handle collisions
|
|
202
202
|
const filesByName = new Map();
|
|
203
203
|
moduleFiles.forEach((file) => {
|
package/esm/resolution/deps.js
CHANGED
|
@@ -17,7 +17,6 @@ import { errors } from '@pgpmjs/types';
|
|
|
17
17
|
function createDependencyResolver(deps, external, options) {
|
|
18
18
|
const { handleExternalDep, transformModule, makeKey = (module) => module, extname } = options;
|
|
19
19
|
return function dep_resolve(sqlmodule, resolved, unresolved) {
|
|
20
|
-
unresolved.push(sqlmodule);
|
|
21
20
|
let moduleToResolve = sqlmodule;
|
|
22
21
|
let edges;
|
|
23
22
|
let returnEarly = false;
|
|
@@ -30,6 +29,12 @@ function createDependencyResolver(deps, external, options) {
|
|
|
30
29
|
else {
|
|
31
30
|
edges = deps[makeKey(sqlmodule)];
|
|
32
31
|
}
|
|
32
|
+
// Avoid re-resolving a module already resolved; moduleToResolve may differ
|
|
33
|
+
// from sqlmodule when project-prefixed or tag-resolved references are normalized.
|
|
34
|
+
if (resolved.includes(moduleToResolve)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
unresolved.push(sqlmodule);
|
|
33
38
|
// Handle external dependencies if no edges found
|
|
34
39
|
if (!edges) {
|
|
35
40
|
if (handleExternalDep) {
|
|
@@ -325,7 +330,7 @@ export const resolveDependencies = (packageDir, extname, options = {}) => {
|
|
|
325
330
|
const deps = {};
|
|
326
331
|
const tagMappings = {};
|
|
327
332
|
// Process SQL files and build dependency graph
|
|
328
|
-
const files = glob(`${packageDir}/deploy/**/*.sql`);
|
|
333
|
+
const files = glob(`${packageDir}/deploy/**/*.sql`).sort((a, b) => a.localeCompare(b));
|
|
329
334
|
for (const file of files) {
|
|
330
335
|
const data = readFileSync(file, 'utf-8');
|
|
331
336
|
const lines = data.split('\n');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpmjs/core",
|
|
3
|
-
"version": "6.29.
|
|
3
|
+
"version": "6.29.1",
|
|
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.15",
|
|
65
65
|
"yanse": "^0.2.1"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "6235bf0645f56d423fa464404ec1e3283c49e532"
|
|
68
68
|
}
|
package/resolution/deps.js
CHANGED
|
@@ -20,7 +20,6 @@ const types_1 = require("@pgpmjs/types");
|
|
|
20
20
|
function createDependencyResolver(deps, external, options) {
|
|
21
21
|
const { handleExternalDep, transformModule, makeKey = (module) => module, extname } = options;
|
|
22
22
|
return function dep_resolve(sqlmodule, resolved, unresolved) {
|
|
23
|
-
unresolved.push(sqlmodule);
|
|
24
23
|
let moduleToResolve = sqlmodule;
|
|
25
24
|
let edges;
|
|
26
25
|
let returnEarly = false;
|
|
@@ -33,6 +32,12 @@ function createDependencyResolver(deps, external, options) {
|
|
|
33
32
|
else {
|
|
34
33
|
edges = deps[makeKey(sqlmodule)];
|
|
35
34
|
}
|
|
35
|
+
// Avoid re-resolving a module already resolved; moduleToResolve may differ
|
|
36
|
+
// from sqlmodule when project-prefixed or tag-resolved references are normalized.
|
|
37
|
+
if (resolved.includes(moduleToResolve)) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
unresolved.push(sqlmodule);
|
|
36
41
|
// Handle external dependencies if no edges found
|
|
37
42
|
if (!edges) {
|
|
38
43
|
if (handleExternalDep) {
|
|
@@ -329,7 +334,7 @@ const resolveDependencies = (packageDir, extname, options = {}) => {
|
|
|
329
334
|
const deps = {};
|
|
330
335
|
const tagMappings = {};
|
|
331
336
|
// Process SQL files and build dependency graph
|
|
332
|
-
const files = (0, glob_1.sync)(`${packageDir}/deploy/**/*.sql`);
|
|
337
|
+
const files = (0, glob_1.sync)(`${packageDir}/deploy/**/*.sql`).sort((a, b) => a.localeCompare(b));
|
|
333
338
|
for (const file of files) {
|
|
334
339
|
const data = (0, fs_1.readFileSync)(file, 'utf-8');
|
|
335
340
|
const lines = data.split('\n');
|