@hominis/fireforge 0.16.1 → 0.16.3
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/CHANGELOG.md +80 -0
- package/README.md +9 -2
- package/dist/bin/fireforge.js +11 -2
- package/dist/src/commands/doctor-furnace.js +83 -1
- package/dist/src/commands/doctor.js +18 -0
- package/dist/src/commands/download.js +16 -1
- package/dist/src/commands/furnace/chrome-doc-templates.d.ts +21 -3
- package/dist/src/commands/furnace/chrome-doc-templates.js +23 -5
- package/dist/src/commands/furnace/chrome-doc-tests.js +42 -17
- package/dist/src/commands/furnace/create-templates.d.ts +17 -7
- package/dist/src/commands/furnace/create-templates.js +85 -31
- package/dist/src/commands/furnace/create-xpcshell.d.ts +1 -1
- package/dist/src/commands/furnace/create-xpcshell.js +1 -1
- package/dist/src/commands/import.js +63 -11
- package/dist/src/commands/patch/delete.js +10 -1
- package/dist/src/commands/setup-support.js +60 -7
- package/dist/src/commands/status.js +28 -1
- package/dist/src/commands/test.js +20 -4
- package/dist/src/commands/token.js +7 -1
- package/dist/src/commands/wire.js +14 -1
- package/dist/src/core/branding.d.ts +10 -0
- package/dist/src/core/branding.js +7 -9
- package/dist/src/core/build-prepare.js +8 -1
- package/dist/src/core/config-mutate.js +23 -1
- package/dist/src/core/file-lock.js +49 -15
- package/dist/src/core/furnace-operation.d.ts +17 -0
- package/dist/src/core/furnace-operation.js +30 -1
- package/dist/src/core/furnace-validate-helpers.d.ts +33 -1
- package/dist/src/core/furnace-validate-helpers.js +53 -2
- package/dist/src/core/git.js +39 -10
- package/dist/src/core/manifest-rules.js +16 -0
- package/dist/src/core/marionette-preflight.js +43 -12
- package/dist/src/core/patch-files.d.ts +12 -1
- package/dist/src/core/patch-files.js +14 -11
- package/dist/src/core/patch-lint.js +62 -11
- package/dist/src/core/patch-parse.d.ts +18 -7
- package/dist/src/core/patch-parse.js +24 -2
- package/dist/src/core/patch-transform.js +4 -1
- package/package.json +1 -1
|
@@ -104,14 +104,36 @@ export function parseHunksForFile(patchContent, targetFile) {
|
|
|
104
104
|
newStart: parseInt(hunkMatch[3] ?? '0', 10),
|
|
105
105
|
newCount: parseInt(hunkMatch[4] ?? '1', 10),
|
|
106
106
|
lines: [],
|
|
107
|
-
|
|
107
|
+
noNewlineAtEndOld: false,
|
|
108
|
+
noNewlineAtEndNew: false,
|
|
108
109
|
};
|
|
109
110
|
continue;
|
|
110
111
|
}
|
|
111
112
|
// Collect hunk lines
|
|
112
113
|
if (currentHunk) {
|
|
113
114
|
if (line === '\') {
|
|
114
|
-
|
|
115
|
+
// The marker is an annotation on the immediately preceding body
|
|
116
|
+
// line. Peek the last collected line to decide which side(s) the
|
|
117
|
+
// annotation applies to — a single boolean cannot represent the
|
|
118
|
+
// asymmetric case where only one side lacks the trailing newline.
|
|
119
|
+
const previous = currentHunk.lines[currentHunk.lines.length - 1] ?? '';
|
|
120
|
+
if (previous.startsWith('-')) {
|
|
121
|
+
currentHunk.noNewlineAtEndOld = true;
|
|
122
|
+
}
|
|
123
|
+
else if (previous.startsWith('+')) {
|
|
124
|
+
currentHunk.noNewlineAtEndNew = true;
|
|
125
|
+
}
|
|
126
|
+
else if (previous.startsWith(' ')) {
|
|
127
|
+
// Context line: present in both sides, so the trailing-newline
|
|
128
|
+
// absence applies to both. This is rare (it only happens when
|
|
129
|
+
// the hunk ends on an unchanged line that itself is the last
|
|
130
|
+
// line of the file) but real — git emits it.
|
|
131
|
+
currentHunk.noNewlineAtEndOld = true;
|
|
132
|
+
currentHunk.noNewlineAtEndNew = true;
|
|
133
|
+
}
|
|
134
|
+
// If the marker appears with no preceding body line (malformed
|
|
135
|
+
// diff), leave both flags false — the downstream apply logic
|
|
136
|
+
// will still produce a defined result.
|
|
115
137
|
}
|
|
116
138
|
else if (line.startsWith('+') || line.startsWith('-') || line.startsWith(' ')) {
|
|
117
139
|
currentHunk.lines.push(line);
|
|
@@ -105,7 +105,10 @@ export async function applyPatchToContent(content, patchPath, targetFile) {
|
|
|
105
105
|
const sortedHunks = [...hunks].sort((a, b) => b.oldStart - a.oldStart);
|
|
106
106
|
// The "no newline at end" marker applies to the last hunk in file order
|
|
107
107
|
// (highest oldStart), which is the *first* hunk in our reverse-sorted array.
|
|
108
|
-
|
|
108
|
+
// We read the new-side flag because the output we produce corresponds to
|
|
109
|
+
// the new side; asymmetric diffs (old lacks newline, new has one — or
|
|
110
|
+
// vice versa) would otherwise disagree with `git apply`.
|
|
111
|
+
const lastHunkNoNewline = sortedHunks[0]?.noNewlineAtEndNew ?? false;
|
|
109
112
|
for (const hunk of sortedHunks) {
|
|
110
113
|
const newLines = [];
|
|
111
114
|
// Compute actual old-line count from hunk body for cross-check
|