code-foundry 1.3.1 → 1.3.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/.github/code-foundry.yml +1 -1
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/commands/sync.mjs +22 -10
package/.github/code-foundry.yml
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.3.2](https://github.com/0xPlayerOne/code-foundry/compare/v1.3.1...v1.3.2) (2026-09-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* preserve consumer-only Oxc config keys across syncs ([#476](https://github.com/0xPlayerOne/code-foundry/issues/476)) ([07aee3a](https://github.com/0xPlayerOne/code-foundry/commit/07aee3aed2aadeccf9740e1966941281e3f031f4))
|
|
9
|
+
|
|
3
10
|
## [1.3.1](https://github.com/0xPlayerOne/code-foundry/compare/v1.3.0...v1.3.1) (2026-09-07)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-foundry",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
|
|
5
5
|
"homepage": "https://github.com/0xPlayerOne/code-foundry#readme",
|
|
6
6
|
"bugs": {
|
package/src/commands/sync.mjs
CHANGED
|
@@ -782,32 +782,44 @@ function mergeGitignore(baseline, existing) {
|
|
|
782
782
|
|
|
783
783
|
/**
|
|
784
784
|
* Merge a baseline Oxc config (.oxfmtrc.json / .oxlintrc.json) with the
|
|
785
|
-
* consumer's current config. The baseline owns every key except
|
|
785
|
+
* consumer's current config. The baseline owns every key it defines, except
|
|
786
786
|
* `ignorePatterns`, where consumer-specific patterns (added by sync
|
|
787
787
|
* migrations or by the repository) are preserved so repeated syncs never
|
|
788
|
-
* churn them.
|
|
788
|
+
* churn them. Keys the baseline does not define (e.g. a repository-owned
|
|
789
|
+
* `overrides` block) belong to the consumer and are preserved as well, so
|
|
790
|
+
* a sync never silently drops repository-owned configuration.
|
|
789
791
|
* @param {string} baseline @param {string} existing @returns {string}
|
|
790
792
|
*/
|
|
791
793
|
function mergeIgnorePatternsConfig(baseline, existing) {
|
|
792
|
-
/** @type {string
|
|
793
|
-
let
|
|
794
|
+
/** @type {Record<string, any>} */
|
|
795
|
+
let consumer = {}
|
|
794
796
|
try {
|
|
795
|
-
|
|
796
|
-
if (Array.isArray(
|
|
797
|
+
consumer = JSON.parse(existing)
|
|
798
|
+
if (consumer === null || typeof consumer !== 'object' || Array.isArray(consumer))
|
|
799
|
+
return baseline
|
|
797
800
|
} catch {
|
|
798
801
|
return baseline
|
|
799
802
|
}
|
|
800
|
-
|
|
801
|
-
let config
|
|
803
|
+
/** @type {Record<string, any>} */
|
|
804
|
+
let config = {}
|
|
802
805
|
try {
|
|
803
806
|
config = JSON.parse(baseline)
|
|
807
|
+
if (config === null || typeof config !== 'object' || Array.isArray(config)) return baseline
|
|
804
808
|
} catch {
|
|
805
809
|
return baseline
|
|
806
810
|
}
|
|
811
|
+
let preserved = false
|
|
812
|
+
for (const [key, value] of Object.entries(consumer)) {
|
|
813
|
+
if (!(key in config)) {
|
|
814
|
+
config[key] = value
|
|
815
|
+
preserved = true
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
const extra = Array.isArray(consumer.ignorePatterns) ? consumer.ignorePatterns : []
|
|
807
819
|
const base = Array.isArray(config.ignorePatterns) ? config.ignorePatterns : []
|
|
808
820
|
const missing = extra.filter((pattern) => !base.includes(pattern))
|
|
809
|
-
if (missing.length
|
|
810
|
-
|
|
821
|
+
if (missing.length) config.ignorePatterns = [...base, ...missing]
|
|
822
|
+
if (!preserved && !missing.length) return baseline
|
|
811
823
|
return `${JSON.stringify(config, null, 2)}\n`
|
|
812
824
|
}
|
|
813
825
|
|