@pgpmjs/core 3.1.1 → 3.1.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.
- package/esm/files/plan/writer.js +18 -4
- package/files/plan/writer.js +18 -4
- package/package.json +3 -3
package/esm/files/plan/writer.js
CHANGED
|
@@ -7,8 +7,22 @@ export function writeSqitchPlan(rows, opts) {
|
|
|
7
7
|
const dir = path.resolve(path.join(opts.outdir, opts.name));
|
|
8
8
|
fs.mkdirSync(dir, { recursive: true });
|
|
9
9
|
const date = () => '2017-08-11T08:11:51Z'; // stubbed timestamp
|
|
10
|
-
|
|
11
|
-
const
|
|
10
|
+
// Parse author string - it might contain email in format "Name <email>"
|
|
11
|
+
const authorInput = (opts.author || 'constructive').trim();
|
|
12
|
+
let authorName = authorInput;
|
|
13
|
+
let authorEmail = '';
|
|
14
|
+
// Check if author already contains email in <...> format
|
|
15
|
+
const emailMatch = authorInput.match(/^(.+?)\s*<([^>]+)>\s*$/);
|
|
16
|
+
if (emailMatch) {
|
|
17
|
+
// Author already has email format: "Name <email>"
|
|
18
|
+
authorName = emailMatch[1].trim();
|
|
19
|
+
authorEmail = emailMatch[2].trim();
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
// No email in author, use default format
|
|
23
|
+
authorName = authorInput;
|
|
24
|
+
authorEmail = `${authorName}@5b0c196eeb62`;
|
|
25
|
+
}
|
|
12
26
|
const duplicates = {};
|
|
13
27
|
const plan = opts.replacer(`%syntax-version=1.0.0
|
|
14
28
|
%project=constructive-extension-name
|
|
@@ -22,9 +36,9 @@ ${rows
|
|
|
22
36
|
}
|
|
23
37
|
duplicates[row.deploy] = true;
|
|
24
38
|
if (row.deps?.length) {
|
|
25
|
-
return `${row.deploy} [${row.deps.join(' ')}] ${date()} ${
|
|
39
|
+
return `${row.deploy} [${row.deps.join(' ')}] ${date()} ${authorName} <${authorEmail}> # add ${row.name}`;
|
|
26
40
|
}
|
|
27
|
-
return `${row.deploy} ${date()} ${
|
|
41
|
+
return `${row.deploy} ${date()} ${authorName} <${authorEmail}> # add ${row.name}`;
|
|
28
42
|
})
|
|
29
43
|
.join('\n')}
|
|
30
44
|
`);
|
package/files/plan/writer.js
CHANGED
|
@@ -17,8 +17,22 @@ function writeSqitchPlan(rows, opts) {
|
|
|
17
17
|
const dir = path_1.default.resolve(path_1.default.join(opts.outdir, opts.name));
|
|
18
18
|
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
19
19
|
const date = () => '2017-08-11T08:11:51Z'; // stubbed timestamp
|
|
20
|
-
|
|
21
|
-
const
|
|
20
|
+
// Parse author string - it might contain email in format "Name <email>"
|
|
21
|
+
const authorInput = (opts.author || 'constructive').trim();
|
|
22
|
+
let authorName = authorInput;
|
|
23
|
+
let authorEmail = '';
|
|
24
|
+
// Check if author already contains email in <...> format
|
|
25
|
+
const emailMatch = authorInput.match(/^(.+?)\s*<([^>]+)>\s*$/);
|
|
26
|
+
if (emailMatch) {
|
|
27
|
+
// Author already has email format: "Name <email>"
|
|
28
|
+
authorName = emailMatch[1].trim();
|
|
29
|
+
authorEmail = emailMatch[2].trim();
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
// No email in author, use default format
|
|
33
|
+
authorName = authorInput;
|
|
34
|
+
authorEmail = `${authorName}@5b0c196eeb62`;
|
|
35
|
+
}
|
|
22
36
|
const duplicates = {};
|
|
23
37
|
const plan = opts.replacer(`%syntax-version=1.0.0
|
|
24
38
|
%project=constructive-extension-name
|
|
@@ -32,9 +46,9 @@ ${rows
|
|
|
32
46
|
}
|
|
33
47
|
duplicates[row.deploy] = true;
|
|
34
48
|
if (row.deps?.length) {
|
|
35
|
-
return `${row.deploy} [${row.deps.join(' ')}] ${date()} ${
|
|
49
|
+
return `${row.deploy} [${row.deps.join(' ')}] ${date()} ${authorName} <${authorEmail}> # add ${row.name}`;
|
|
36
50
|
}
|
|
37
|
-
return `${row.deploy} ${date()} ${
|
|
51
|
+
return `${row.deploy} ${date()} ${authorName} <${authorEmail}> # add ${row.name}`;
|
|
38
52
|
})
|
|
39
53
|
.join('\n')}
|
|
40
54
|
`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpmjs/core",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "PGPM Package and Migration Tools",
|
|
6
6
|
"main": "index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"makage": "^0.1.9"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@pgpmjs/env": "^2.8.
|
|
50
|
+
"@pgpmjs/env": "^2.8.8",
|
|
51
51
|
"@pgpmjs/logger": "^1.3.5",
|
|
52
52
|
"@pgpmjs/server-utils": "^2.8.8",
|
|
53
53
|
"@pgpmjs/types": "^2.12.6",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"pgsql-parser": "^17.9.2",
|
|
64
64
|
"yanse": "^0.1.8"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "9a4f31663554bed9c6cc785a3eb283d0a5d27620"
|
|
67
67
|
}
|