@pgpmjs/ast 0.10.2 → 0.11.0

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.
@@ -26,12 +26,12 @@ export function parseControlContent(contents) {
26
26
  .find((line) => /^requires/.test(line))
27
27
  ?.split('=')[1]
28
28
  .split(',')
29
- .map((req) => req.replace(/[\'\s]*/g, '').trim()) || [];
29
+ .map((req) => req.replace(/['\s]*/g, '').trim()) || [];
30
30
  const version = contents
31
31
  .split('\n')
32
32
  .find((line) => /^default_version/.test(line))
33
33
  ?.split('=')[1]
34
- .replace(/[\']*/g, '')
34
+ .replace(/[']*/g, '')
35
35
  .trim() || '';
36
36
  return { requires, version };
37
37
  }
@@ -1,6 +1,6 @@
1
+ import { errors } from '@pgpmjs/types';
1
2
  import { readFileSync } from 'fs';
2
3
  import { isValidChangeName, isValidDependency, isValidTagName, parseReference } from './validators';
3
- import { errors } from '@pgpmjs/types';
4
4
  /**
5
5
  * Parse a Sqitch plan file with full validation
6
6
  * Supports both changes and tags
@@ -165,7 +165,7 @@ export function scanDeployScript(content, options) {
165
165
  continue;
166
166
  }
167
167
  if (/:/.test(line)) {
168
- const m2 = line.match(/^-- Deploy ([^:]*):([\w\/]+)(?:\s+to\s+pg)?/);
168
+ const m2 = line.match(/^-- Deploy ([^:]*):([\w/]+)(?:\s+to\s+pg)?/);
169
169
  if (m2) {
170
170
  const actualProject = m2[1];
171
171
  const keyToTest = m2[2];
@@ -18,7 +18,7 @@ export function renameInPlanContent(content, renames) {
18
18
  if (renames.size === 0)
19
19
  return content;
20
20
  // One regex, compiled once per call (not per line or per rename).
21
- const tokenRe = /(^|[\s\[])([^\s\[\]@]+)(?=$|[\s\]@])/g;
21
+ const tokenRe = /(^|[\s[])([^\s[\]@]+)(?=$|[\s\]@])/g;
22
22
  return content
23
23
  .split('\n')
24
24
  .map(line => {
@@ -31,12 +31,12 @@ function parseControlContent(contents) {
31
31
  .find((line) => /^requires/.test(line))
32
32
  ?.split('=')[1]
33
33
  .split(',')
34
- .map((req) => req.replace(/[\'\s]*/g, '').trim()) || [];
34
+ .map((req) => req.replace(/['\s]*/g, '').trim()) || [];
35
35
  const version = contents
36
36
  .split('\n')
37
37
  .find((line) => /^default_version/.test(line))
38
38
  ?.split('=')[1]
39
- .replace(/[\']*/g, '')
39
+ .replace(/[']*/g, '')
40
40
  .trim() || '';
41
41
  return { requires, version };
42
42
  }
@@ -6,9 +6,9 @@ exports.resolveReference = resolveReference;
6
6
  exports.parsePlanFileSimple = parsePlanFileSimple;
7
7
  exports.getChanges = getChanges;
8
8
  exports.getLatestChange = getLatestChange;
9
+ const types_1 = require("@pgpmjs/types");
9
10
  const fs_1 = require("fs");
10
11
  const validators_1 = require("./validators");
11
- const types_1 = require("@pgpmjs/types");
12
12
  /**
13
13
  * Parse a Sqitch plan file with full validation
14
14
  * Supports both changes and tags
@@ -172,7 +172,7 @@ function scanDeployScript(content, options) {
172
172
  continue;
173
173
  }
174
174
  if (/:/.test(line)) {
175
- const m2 = line.match(/^-- Deploy ([^:]*):([\w\/]+)(?:\s+to\s+pg)?/);
175
+ const m2 = line.match(/^-- Deploy ([^:]*):([\w/]+)(?:\s+to\s+pg)?/);
176
176
  if (m2) {
177
177
  const actualProject = m2[1];
178
178
  const keyToTest = m2[2];
package/index.d.ts CHANGED
@@ -15,5 +15,5 @@ export * from './files';
15
15
  export * from './hash';
16
16
  export * from './module';
17
17
  export * from './plan-rename';
18
- export { parseAuthor } from './utils/author';
19
18
  export type { ParsedAuthor } from './utils/author';
19
+ export { parseAuthor } from './utils/author';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpmjs/ast",
3
- "version": "0.10.2",
3
+ "version": "0.11.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "PGPM module AST — plan/control/SQL-header parsers and the lossless module read/write layer",
6
6
  "main": "index.js",
@@ -41,8 +41,8 @@
41
41
  "makage": "^0.3.0"
42
42
  },
43
43
  "dependencies": {
44
- "@pgpmjs/env": "^2.40.2",
45
- "@pgpmjs/types": "^2.49.2"
44
+ "@pgpmjs/env": "^2.41.0",
45
+ "@pgpmjs/types": "^2.50.0"
46
46
  },
47
- "gitHead": "90f447482b056a4949134565db2665f21d11aca3"
47
+ "gitHead": "d508453a32a2f1d70ff6916871046615226e6f33"
48
48
  }
package/plan-rename.js CHANGED
@@ -21,7 +21,7 @@ function renameInPlanContent(content, renames) {
21
21
  if (renames.size === 0)
22
22
  return content;
23
23
  // One regex, compiled once per call (not per line or per rename).
24
- const tokenRe = /(^|[\s\[])([^\s\[\]@]+)(?=$|[\s\]@])/g;
24
+ const tokenRe = /(^|[\s[])([^\s[\]@]+)(?=$|[\s\]@])/g;
25
25
  return content
26
26
  .split('\n')
27
27
  .map(line => {