@pgpmjs/core 3.1.2 → 3.1.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.
@@ -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
- const author = opts.author || 'constructive';
11
- const email = `${author}@5b0c196eeb62`;
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()} ${author} <${email}> # add ${row.name}`;
39
+ return `${row.deploy} [${row.deps.join(' ')}] ${date()} ${authorName} <${authorEmail}> # add ${row.name}`;
26
40
  }
27
- return `${row.deploy} ${date()} ${author} <${email}> # add ${row.name}`;
41
+ return `${row.deploy} ${date()} ${authorName} <${authorEmail}> # add ${row.name}`;
28
42
  })
29
43
  .join('\n')}
30
44
  `);
@@ -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
- const author = opts.author || 'constructive';
21
- const email = `${author}@5b0c196eeb62`;
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()} ${author} <${email}> # add ${row.name}`;
49
+ return `${row.deploy} [${row.deps.join(' ')}] ${date()} ${authorName} <${authorEmail}> # add ${row.name}`;
36
50
  }
37
- return `${row.deploy} ${date()} ${author} <${email}> # add ${row.name}`;
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.2",
3
+ "version": "3.1.4",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "PGPM Package and Migration Tools",
6
6
  "main": "index.js",
@@ -57,11 +57,11 @@
57
57
  "komoji": "^0.7.11",
58
58
  "parse-package-name": "^1.0.0",
59
59
  "pg": "^8.16.3",
60
- "pg-cache": "^1.6.8",
60
+ "pg-cache": "^1.6.9",
61
61
  "pg-env": "^1.2.4",
62
62
  "pgsql-deparser": "^17.12.2",
63
63
  "pgsql-parser": "^17.9.2",
64
64
  "yanse": "^0.1.8"
65
65
  },
66
- "gitHead": "deb816f0fb9aad6cef1accf0dc603e016e48d335"
66
+ "gitHead": "fc182ff9e4c4745a3e86eda6d58e3b0061f36564"
67
67
  }