@pgpmjs/core 7.0.0 → 7.2.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.
Files changed (102) hide show
  1. package/bundle/apply.d.ts +93 -0
  2. package/bundle/apply.js +137 -0
  3. package/bundle/index.d.ts +12 -0
  4. package/bundle/index.js +31 -0
  5. package/core/class/pgpm.d.ts +2 -2
  6. package/core/class/pgpm.js +6 -6
  7. package/esm/bundle/apply.js +131 -0
  8. package/esm/bundle/index.js +15 -0
  9. package/esm/core/class/pgpm.js +6 -6
  10. package/esm/index.js +7 -3
  11. package/esm/migrate/client.js +1 -1
  12. package/esm/migrate/utils/hash.js +3 -6
  13. package/esm/modules/modules.js +1 -1
  14. package/esm/packaging/package.js +40 -24
  15. package/esm/rebundle/index.js +4 -0
  16. package/esm/rebundle/module.js +111 -0
  17. package/esm/rebundle/rebundle.js +170 -0
  18. package/esm/rebundle/workspace.js +170 -0
  19. package/esm/refactor/rename.js +5 -27
  20. package/esm/resolution/deps.js +2 -2
  21. package/esm/resolution/resolve.js +2 -2
  22. package/esm/slice/slice.js +1 -1
  23. package/esm/workspace/minimal.js +73 -0
  24. package/index.d.ts +6 -2
  25. package/index.js +8 -4
  26. package/migrate/client.js +1 -1
  27. package/migrate/utils/hash.d.ts +2 -4
  28. package/migrate/utils/hash.js +4 -8
  29. package/modules/modules.d.ts +1 -1
  30. package/modules/modules.js +1 -1
  31. package/package.json +4 -2
  32. package/packaging/package.d.ts +23 -1
  33. package/packaging/package.js +42 -25
  34. package/rebundle/index.d.ts +4 -0
  35. package/{files/sql-scripts → rebundle}/index.js +4 -2
  36. package/rebundle/module.d.ts +23 -0
  37. package/rebundle/module.js +116 -0
  38. package/rebundle/rebundle.d.ts +26 -0
  39. package/rebundle/rebundle.js +175 -0
  40. package/rebundle/types.d.ts +185 -0
  41. package/rebundle/workspace.d.ts +15 -0
  42. package/rebundle/workspace.js +173 -0
  43. package/refactor/rename.d.ts +2 -8
  44. package/refactor/rename.js +6 -29
  45. package/resolution/deps.d.ts +1 -1
  46. package/resolution/deps.js +2 -2
  47. package/resolution/resolve.js +2 -2
  48. package/slice/slice.d.ts +1 -1
  49. package/slice/slice.js +1 -1
  50. package/slice/types.d.ts +1 -1
  51. package/workspace/minimal.d.ts +64 -0
  52. package/workspace/minimal.js +82 -0
  53. package/esm/files/extension/index.js +0 -3
  54. package/esm/files/extension/reader.js +0 -79
  55. package/esm/files/extension/writer.js +0 -99
  56. package/esm/files/index.js +0 -6
  57. package/esm/files/plan/generator.js +0 -82
  58. package/esm/files/plan/index.js +0 -5
  59. package/esm/files/plan/parser.js +0 -297
  60. package/esm/files/plan/validators.js +0 -181
  61. package/esm/files/plan/writer.js +0 -142
  62. package/esm/files/sql/header.js +0 -259
  63. package/esm/files/sql/index.js +0 -2
  64. package/esm/files/sql/writer.js +0 -107
  65. package/esm/files/sql-scripts/index.js +0 -2
  66. package/esm/files/sql-scripts/reader.js +0 -19
  67. package/esm/files/types/index.js +0 -1
  68. package/esm/utils/author.js +0 -11
  69. package/files/extension/index.d.ts +0 -2
  70. package/files/extension/index.js +0 -19
  71. package/files/extension/reader.d.ts +0 -24
  72. package/files/extension/reader.js +0 -86
  73. package/files/extension/writer.d.ts +0 -48
  74. package/files/extension/writer.js +0 -107
  75. package/files/index.d.ts +0 -5
  76. package/files/index.js +0 -22
  77. package/files/plan/generator.d.ts +0 -23
  78. package/files/plan/generator.js +0 -90
  79. package/files/plan/index.d.ts +0 -4
  80. package/files/plan/index.js +0 -21
  81. package/files/plan/parser.d.ts +0 -28
  82. package/files/plan/parser.js +0 -304
  83. package/files/plan/validators.d.ts +0 -52
  84. package/files/plan/validators.js +0 -187
  85. package/files/plan/writer.d.ts +0 -27
  86. package/files/plan/writer.js +0 -152
  87. package/files/sql/header.d.ts +0 -114
  88. package/files/sql/header.js +0 -266
  89. package/files/sql/index.d.ts +0 -2
  90. package/files/sql/index.js +0 -18
  91. package/files/sql/writer.d.ts +0 -12
  92. package/files/sql/writer.js +0 -114
  93. package/files/sql-scripts/index.d.ts +0 -1
  94. package/files/sql-scripts/reader.d.ts +0 -8
  95. package/files/sql-scripts/reader.js +0 -23
  96. package/files/types/index.d.ts +0 -46
  97. package/files/types/index.js +0 -17
  98. package/files/types/package.d.ts +0 -20
  99. package/utils/author.d.ts +0 -5
  100. package/utils/author.js +0 -14
  101. /package/esm/{files/types/package.js → rebundle/types.js} +0 -0
  102. /package/{files/types/package.js → rebundle/types.js} +0 -0
@@ -1,8 +0,0 @@
1
- /**
2
- * Read a SQL script file, return empty string if not found
3
- */
4
- export declare function readScript(basePath: string, scriptType: string, changeName: string): string;
5
- /**
6
- * Check if a script file exists
7
- */
8
- export declare function scriptExists(basePath: string, scriptType: string, changeName: string): boolean;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readScript = readScript;
4
- exports.scriptExists = scriptExists;
5
- const fs_1 = require("fs");
6
- const path_1 = require("path");
7
- /**
8
- * Read a SQL script file, return empty string if not found
9
- */
10
- function readScript(basePath, scriptType, changeName) {
11
- const scriptPath = (0, path_1.join)(basePath, scriptType, `${changeName}.sql`);
12
- if (!(0, fs_1.existsSync)(scriptPath)) {
13
- return '';
14
- }
15
- return (0, fs_1.readFileSync)(scriptPath, 'utf-8');
16
- }
17
- /**
18
- * Check if a script file exists
19
- */
20
- function scriptExists(basePath, scriptType, changeName) {
21
- const scriptPath = (0, path_1.join)(basePath, scriptType, `${changeName}.sql`);
22
- return (0, fs_1.existsSync)(scriptPath);
23
- }
@@ -1,46 +0,0 @@
1
- export * from './package';
2
- export interface Change {
3
- name: string;
4
- dependencies: string[];
5
- timestamp?: string;
6
- planner?: string;
7
- email?: string;
8
- comment?: string;
9
- }
10
- export interface PlanFile {
11
- package: string;
12
- uri?: string;
13
- changes: Change[];
14
- }
15
- export interface Tag {
16
- name: string;
17
- change: string;
18
- timestamp?: string;
19
- planner?: string;
20
- email?: string;
21
- comment?: string;
22
- }
23
- export interface ExtendedPlanFile extends PlanFile {
24
- tags: Tag[];
25
- }
26
- export interface ParseError {
27
- line: number;
28
- message: string;
29
- }
30
- export interface ParseResult<T> {
31
- data?: T;
32
- errors: ParseError[];
33
- }
34
- export interface ResolvedReference {
35
- type: 'change' | 'tag' | 'sha1' | 'relative';
36
- target: string;
37
- resolved?: string;
38
- }
39
- export interface PgpmRow {
40
- deploy: string;
41
- revert?: string;
42
- verify?: string;
43
- content: string;
44
- deps?: string[];
45
- name?: string;
46
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./package"), exports);
@@ -1,20 +0,0 @@
1
- export interface PackageAnalysisIssue {
2
- code: string;
3
- message: string;
4
- file?: string;
5
- fixable?: boolean;
6
- }
7
- export interface PackageAnalysisResult {
8
- ok: boolean;
9
- name: string;
10
- path: string;
11
- issues: PackageAnalysisIssue[];
12
- }
13
- export interface RenameOptions {
14
- dryRun?: boolean;
15
- syncPackageJsonName?: boolean;
16
- }
17
- export interface RenameResult {
18
- changed: string[];
19
- warnings: string[];
20
- }
package/utils/author.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export interface ParsedAuthor {
2
- fullName: string;
3
- email?: string;
4
- }
5
- export declare function parseAuthor(author: string): ParsedAuthor;
package/utils/author.js DELETED
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseAuthor = parseAuthor;
4
- function parseAuthor(author) {
5
- const trimmed = (author || '').trim();
6
- const match = trimmed.match(/^(.+?)\s*<([^>]+)>$/);
7
- if (match) {
8
- return {
9
- fullName: match[1].trim(),
10
- email: match[2].trim()
11
- };
12
- }
13
- return { fullName: trimmed };
14
- }
File without changes