@aspruyt/xfg 8.5.3 → 8.5.5
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/dist/vcs/pr-creator.d.ts +1 -0
- package/dist/vcs/pr-creator.js +9 -23
- package/package.json +1 -1
package/dist/vcs/pr-creator.d.ts
CHANGED
package/dist/vcs/pr-creator.js
CHANGED
|
@@ -1,34 +1,20 @@
|
|
|
1
|
-
import { readFileSync
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
2
|
import { join, dirname } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { createPRStrategy } from "./pr-strategy-factory.js";
|
|
5
5
|
import { PRWorkflowExecutor } from "./pr-strategy.js";
|
|
6
6
|
import { interpolateXfgContent } from "../shared/xfg-template.js";
|
|
7
7
|
import { inlineCode } from "../shared/markdown-fence.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import { toErrorMessage } from "../shared/type-guards.js";
|
|
9
|
+
import { SyncError } from "../shared/errors.js";
|
|
10
|
+
const DEFAULT_TEMPLATE_PATH = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "PR.md");
|
|
11
|
+
export function loadDefaultTemplate(templatePath = DEFAULT_TEMPLATE_PATH) {
|
|
12
|
+
try {
|
|
13
13
|
return readFileSync(templatePath, "utf-8");
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
\${xfg:pr.aiSummary}
|
|
20
|
-
|
|
21
|
-
## Changes
|
|
22
|
-
|
|
23
|
-
\${xfg:pr.fileChanges}
|
|
24
|
-
|
|
25
|
-
## Source
|
|
26
|
-
|
|
27
|
-
Configuration synced using [xfg](https://github.com/anthony-spruyt/xfg).
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
_This PR was automatically generated by [xfg](https://github.com/anthony-spruyt/xfg)_`;
|
|
15
|
+
catch (error) {
|
|
16
|
+
throw new SyncError(`Failed to read default PR template ${templatePath}: ${toErrorMessage(error)}`, { cause: error });
|
|
17
|
+
}
|
|
32
18
|
}
|
|
33
19
|
const AI_SUMMARY_VAR = "${xfg:pr.aiSummary}";
|
|
34
20
|
const UNESCAPED_AI_SUMMARY_VAR = /(?<!\$)\$\{xfg:pr\.aiSummary\}/;
|
package/package.json
CHANGED