@aspruyt/xfg 1.0.0 → 1.0.2
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/README.md +3 -3
- package/dist/config-formatter.js +9 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# xfg
|
|
2
2
|
|
|
3
|
-
[](https://github.com/anthony-spruyt/xfg/actions/workflows/ci.yaml)
|
|
4
4
|
[](https://www.npmjs.com/package/@aspruyt/xfg)
|
|
5
5
|
[](https://www.npmjs.com/package/@aspruyt/xfg)
|
|
6
6
|
[](LICENSE)
|
|
@@ -62,7 +62,7 @@ xfg --config ./config.yaml
|
|
|
62
62
|
|
|
63
63
|
- **Multi-File Sync** - Sync multiple config files in a single run
|
|
64
64
|
- **Multi-Format Output** - JSON, YAML, or plain text based on filename extension
|
|
65
|
-
- **Subdirectory Support** - Sync files to any path (e.g., `.github/workflows/ci.
|
|
65
|
+
- **Subdirectory Support** - Sync files to any path (e.g., `.github/workflows/ci.yaml`)
|
|
66
66
|
- **Text Files** - Sync `.gitignore`, `.markdownlintignore`, etc. with string or lines array
|
|
67
67
|
- **File References** - Use `@path/to/file` to load content from external template files
|
|
68
68
|
- **Content Inheritance** - Define base config once, override per-repo as needed
|
|
@@ -583,7 +583,7 @@ Sync files to any subdirectory path - parent directories are created automatical
|
|
|
583
583
|
```yaml
|
|
584
584
|
files:
|
|
585
585
|
# GitHub Actions workflow
|
|
586
|
-
".github/workflows/ci.
|
|
586
|
+
".github/workflows/ci.yaml":
|
|
587
587
|
content:
|
|
588
588
|
name: CI
|
|
589
589
|
on: [push, pull_request]
|
package/dist/config-formatter.js
CHANGED
|
@@ -88,7 +88,15 @@ export function convertContentToString(content, fileName, options) {
|
|
|
88
88
|
doc.commentBefore = headerComment;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
// Quote all string values for YAML 1.1 compatibility.
|
|
92
|
+
// The yaml library outputs YAML 1.2 where "06:00" is a plain string,
|
|
93
|
+
// but many tools (e.g., Dependabot) use YAML 1.1 parsers that interpret
|
|
94
|
+
// unquoted values like "06:00" as sexagesimal (360) or "yes"/"no" as booleans.
|
|
95
|
+
return stringify(doc, {
|
|
96
|
+
indent: 2,
|
|
97
|
+
defaultStringType: "QUOTE_DOUBLE",
|
|
98
|
+
defaultKeyType: "PLAIN",
|
|
99
|
+
});
|
|
92
100
|
}
|
|
93
101
|
if (format === "json5") {
|
|
94
102
|
// JSON5 format - output standard JSON (which is valid JSON5)
|
package/package.json
CHANGED