@voxgig/create-sdkgen 0.30.9 → 0.31.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.
- package/README.md +12 -1
- package/bin/create-sdkgen +25 -2
- package/dist/copymerge.d.ts +35 -0
- package/dist/copymerge.js +510 -0
- package/dist/copymerge.js.map +1 -0
- package/dist/create-sdkgen.d.ts +2 -0
- package/dist/create-sdkgen.js +30 -1
- package/dist/create-sdkgen.js.map +1 -1
- package/dist/project/standard/CreateRoot.d.ts +2 -1
- package/dist/project/standard/CreateRoot.js +8 -1
- package/dist/project/standard/CreateRoot.js.map +1 -1
- package/dist/scaffold-record.d.ts +9 -0
- package/dist/scaffold-record.js +92 -0
- package/dist/scaffold-record.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/project/standard/.sdk/package.json +3 -3
- package/src/copymerge.ts +711 -0
- package/src/create-sdkgen.ts +43 -1
- package/src/project/standard/CreateRoot.ts +7 -0
- package/src/scaffold-record.ts +119 -0
package/README.md
CHANGED
|
@@ -82,11 +82,22 @@ scaffold:
|
|
|
82
82
|
create-sdkgen my-api -d ./openapi.yaml -o ./my-api-sdk
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
A re-scaffold
|
|
85
|
+
A re-scaffold refreshes the scaffold's own files and keeps the project's: the
|
|
86
86
|
guide in `.sdk/model/guide/`, the project overlay `.sdk/model/project.aontu`,
|
|
87
87
|
the README wording in `.sdk/model/text.aontu`, and the target, feature, and
|
|
88
88
|
edition indexes with the files they name.
|
|
89
89
|
|
|
90
|
+
A scaffold file the project changed, such as `.sdk/src/Root.ts`, keeps the
|
|
91
|
+
change: the newer scaffold is merged into it, against what the last scaffold
|
|
92
|
+
wrote, which `.sdk/log/scaffold.jsonl` records. When both sides changed the
|
|
93
|
+
same lines, the re-scaffold stops and changes nothing, and leaves the
|
|
94
|
+
incoming files in `.sdk/log/scaffold-conflict/`. Fold the change in by hand
|
|
95
|
+
and re-run with `--keep`, or re-run with `--force` to take the incoming
|
|
96
|
+
scaffold. A project regenerated in full from the toolchain sets
|
|
97
|
+
`main: kit: copies: 'overwrite'` in `.sdk/model/project.aontu`, and then a
|
|
98
|
+
re-scaffold overwrites the scaffold files instead. sdkgen's adds follow the
|
|
99
|
+
same setting for the templates and components they copy.
|
|
100
|
+
|
|
90
101
|
The same command brings a project from before the `.aontu` rename up to date,
|
|
91
102
|
which it needs, because `aontu` now refuses to include a `.aon` file. The
|
|
92
103
|
re-scaffold renames each `.aon` file under `.sdk/model/` and `.sdk/test/` to
|
package/bin/create-sdkgen
CHANGED
|
@@ -97,6 +97,8 @@ async function generate(options) {
|
|
|
97
97
|
project: options.project,
|
|
98
98
|
folder: options.folder,
|
|
99
99
|
install: options.install,
|
|
100
|
+
force: options.force,
|
|
101
|
+
keep: options.keep,
|
|
100
102
|
target: options.target,
|
|
101
103
|
feature: options.feature,
|
|
102
104
|
}
|
|
@@ -145,6 +147,16 @@ function resolveOptions() {
|
|
|
145
147
|
default: true,
|
|
146
148
|
},
|
|
147
149
|
|
|
150
|
+
force: {
|
|
151
|
+
type: 'boolean',
|
|
152
|
+
default: false,
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
keep: {
|
|
156
|
+
type: 'boolean',
|
|
157
|
+
default: false,
|
|
158
|
+
},
|
|
159
|
+
|
|
148
160
|
target: {
|
|
149
161
|
type: 'string',
|
|
150
162
|
short: 't',
|
|
@@ -208,6 +220,8 @@ function resolveOptions() {
|
|
|
208
220
|
folder: args.values.folder,
|
|
209
221
|
dryrun: !!args.values.dryrun,
|
|
210
222
|
install: !!args.values.install,
|
|
223
|
+
force: !!args.values.force,
|
|
224
|
+
keep: !!args.values.keep,
|
|
211
225
|
target: targets,
|
|
212
226
|
feature: features,
|
|
213
227
|
debug: args.values.debug,
|
|
@@ -233,6 +247,8 @@ function validateOptions(rawOptions) {
|
|
|
233
247
|
folder: String,
|
|
234
248
|
dryrun: Boolean,
|
|
235
249
|
install: Boolean,
|
|
250
|
+
force: Boolean,
|
|
251
|
+
keep: Boolean,
|
|
236
252
|
target: [String],
|
|
237
253
|
feature: [String],
|
|
238
254
|
debug: String,
|
|
@@ -281,8 +297,9 @@ Usage: npm create @voxgig/sdkgen@latest <name> -- <args>
|
|
|
281
297
|
create-sdkgen <name> <args>
|
|
282
298
|
|
|
283
299
|
<name> is the name of the SDK project. This is also used to
|
|
284
|
-
create a project folder.
|
|
285
|
-
|
|
300
|
+
create a project folder. Run against an existing project, it
|
|
301
|
+
merges the newer scaffold into any scaffold file the project
|
|
302
|
+
changed, unless the project sets main: kit: copies: 'overwrite'.
|
|
286
303
|
|
|
287
304
|
<args> are the command arguments. npm create keeps the options
|
|
288
305
|
it reads itself (-d, -o, -t, -f, --dryrun, --no-install) unless
|
|
@@ -307,6 +324,12 @@ Usage: npm create @voxgig/sdkgen@latest <name> -- <args>
|
|
|
307
324
|
--install Run installation scripts. Default: install.
|
|
308
325
|
--no-install
|
|
309
326
|
|
|
327
|
+
--force On an existing project, take the incoming scaffold over
|
|
328
|
+
locally changed files instead of merging.
|
|
329
|
+
|
|
330
|
+
--keep On an existing project, keep each locally changed file
|
|
331
|
+
whose merge stops, recording the incoming file as its base.
|
|
332
|
+
|
|
310
333
|
--dryrun Perform a dry run, where no files are modified. Default: no-dryrun.
|
|
311
334
|
|
|
312
335
|
--debug Set log level (default: info): trace, error, debug, info, warn, fatal.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
type CopyMode = 'merge' | 'overwrite';
|
|
2
|
+
declare const MERGE: CopyMode;
|
|
3
|
+
declare const OVERWRITE: CopyMode;
|
|
4
|
+
type GuardSpec = {
|
|
5
|
+
fs: any;
|
|
6
|
+
folder: string;
|
|
7
|
+
log: any;
|
|
8
|
+
mode: CopyMode;
|
|
9
|
+
what: string;
|
|
10
|
+
force?: boolean;
|
|
11
|
+
keep?: boolean;
|
|
12
|
+
dryrun?: boolean;
|
|
13
|
+
manage: (rel: string) => boolean;
|
|
14
|
+
recorded: (rel: string) => string | undefined;
|
|
15
|
+
fingerprint: (content: any) => string;
|
|
16
|
+
basedir: string;
|
|
17
|
+
conflictdir: string;
|
|
18
|
+
versions?: (abs: string) => Iterable<Buffer>;
|
|
19
|
+
error?: (msg: string) => Error;
|
|
20
|
+
};
|
|
21
|
+
type MergeOutcome = {
|
|
22
|
+
merged: string[];
|
|
23
|
+
kept: string[];
|
|
24
|
+
retained: string[];
|
|
25
|
+
spared: string[];
|
|
26
|
+
};
|
|
27
|
+
declare function copyMode(value: any): CopyMode;
|
|
28
|
+
declare function withCopyMerge<T>(spec: GuardSpec, run: (fs: any) => Promise<T>): Promise<T>;
|
|
29
|
+
declare function merge3(incoming: Buffer, base: Buffer, local: Buffer, what: string): {
|
|
30
|
+
conflict: boolean;
|
|
31
|
+
content: Buffer;
|
|
32
|
+
};
|
|
33
|
+
declare function gitVersions(abs: string, limit?: number): Iterable<Buffer>;
|
|
34
|
+
export type { CopyMode, GuardSpec, MergeOutcome, };
|
|
35
|
+
export { MERGE, OVERWRITE, copyMode, withCopyMerge, gitVersions, merge3, };
|
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Copyright (c) 2026 Richard Rodger, MIT License */
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.OVERWRITE = exports.MERGE = void 0;
|
|
8
|
+
exports.copyMode = copyMode;
|
|
9
|
+
exports.withCopyMerge = withCopyMerge;
|
|
10
|
+
exports.gitVersions = gitVersions;
|
|
11
|
+
exports.merge3 = merge3;
|
|
12
|
+
// The copy merge @voxgig/sdkgen runs on an add, applied to a re-scaffold.
|
|
13
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
14
|
+
const node_fs_1 = require("node:fs");
|
|
15
|
+
const node_child_process_1 = require("node:child_process");
|
|
16
|
+
const jostraca_1 = require("jostraca");
|
|
17
|
+
const MERGE = 'merge';
|
|
18
|
+
exports.MERGE = MERGE;
|
|
19
|
+
const OVERWRITE = 'overwrite';
|
|
20
|
+
exports.OVERWRITE = OVERWRITE;
|
|
21
|
+
const DELETED = Symbol('deleted');
|
|
22
|
+
function copyMode(value) {
|
|
23
|
+
return OVERWRITE === value ? OVERWRITE : MERGE;
|
|
24
|
+
}
|
|
25
|
+
async function withCopyMerge(spec, run) {
|
|
26
|
+
if (MERGE !== spec.mode || true === spec.force || true === spec.dryrun) {
|
|
27
|
+
return run(spec.fs);
|
|
28
|
+
}
|
|
29
|
+
const guard = new CopyGuard(spec);
|
|
30
|
+
let result;
|
|
31
|
+
try {
|
|
32
|
+
result = await run(guard.fs);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
guard.rollback();
|
|
36
|
+
throw err;
|
|
37
|
+
}
|
|
38
|
+
guard.finish();
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
class CopyGuard {
|
|
42
|
+
constructor(spec) {
|
|
43
|
+
this.orig = new Map();
|
|
44
|
+
this.dirs = [];
|
|
45
|
+
this.edited = new Map();
|
|
46
|
+
this.pending = new Map();
|
|
47
|
+
this.touched = new Set();
|
|
48
|
+
this.spared = [];
|
|
49
|
+
this.spec = spec;
|
|
50
|
+
this.real = spec.fs;
|
|
51
|
+
this.root = node_path_1.default.resolve(spec.folder);
|
|
52
|
+
this.fs = this.wrap();
|
|
53
|
+
}
|
|
54
|
+
wrap() {
|
|
55
|
+
const real = this.real;
|
|
56
|
+
const gfs = {};
|
|
57
|
+
for (const key in real) {
|
|
58
|
+
const val = real[key];
|
|
59
|
+
gfs[key] = 'function' === typeof val ? val.bind(real) : val;
|
|
60
|
+
}
|
|
61
|
+
gfs.writeFileSync = (path, data, opts) => {
|
|
62
|
+
if (this.holds(path, toBuffer(data, opts))) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
this.before(path);
|
|
66
|
+
return real.writeFileSync(path, data, opts);
|
|
67
|
+
};
|
|
68
|
+
gfs.appendFileSync = (path, data, opts) => {
|
|
69
|
+
this.before(path);
|
|
70
|
+
return real.appendFileSync(path, data, opts);
|
|
71
|
+
};
|
|
72
|
+
gfs.copyFileSync = (from, to, mode) => {
|
|
73
|
+
if (this.holds(to, Buffer.from(real.readFileSync(from)))) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this.before(to);
|
|
77
|
+
return real.copyFileSync(from, to, mode);
|
|
78
|
+
};
|
|
79
|
+
gfs.renameSync = (from, to) => {
|
|
80
|
+
const data = this.isFile(from) ? this.read(from) : undefined;
|
|
81
|
+
if (null != data && this.holds(to, data)) {
|
|
82
|
+
this.before(from);
|
|
83
|
+
real.unlinkSync(from);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
this.before(from);
|
|
87
|
+
this.before(to);
|
|
88
|
+
return real.renameSync(from, to);
|
|
89
|
+
};
|
|
90
|
+
gfs.unlinkSync = (path) => {
|
|
91
|
+
if (this.spares(path)) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
this.before(path);
|
|
95
|
+
return real.unlinkSync(path);
|
|
96
|
+
};
|
|
97
|
+
gfs.mkdirSync = (path, opts) => {
|
|
98
|
+
const missing = this.missingDirs(path);
|
|
99
|
+
const res = real.mkdirSync(path, opts);
|
|
100
|
+
this.dirs.push(...missing.filter((dir) => real.existsSync(dir)));
|
|
101
|
+
return res;
|
|
102
|
+
};
|
|
103
|
+
gfs.readFileSync = (path, opts) => {
|
|
104
|
+
const held = 'string' === typeof path ?
|
|
105
|
+
this.pending.get(node_path_1.default.resolve(path)) : undefined;
|
|
106
|
+
if (held instanceof Buffer) {
|
|
107
|
+
const encoding = 'string' === typeof opts ? opts : opts?.encoding;
|
|
108
|
+
return null == encoding ? Buffer.from(held) : held.toString(encoding);
|
|
109
|
+
}
|
|
110
|
+
return real.readFileSync(path, opts);
|
|
111
|
+
};
|
|
112
|
+
return gfs;
|
|
113
|
+
}
|
|
114
|
+
rel(path) {
|
|
115
|
+
if ('string' !== typeof path) {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
const rel = node_path_1.default.relative(this.root, node_path_1.default.resolve(path)).split(node_path_1.default.sep).join('/');
|
|
119
|
+
return ('' === rel || '..' === rel || rel.startsWith('../') || node_path_1.default.isAbsolute(rel)) ?
|
|
120
|
+
undefined : rel;
|
|
121
|
+
}
|
|
122
|
+
managed(rel) {
|
|
123
|
+
return null != rel &&
|
|
124
|
+
!within(rel, this.spec.basedir) && !within(rel, this.spec.conflictdir) &&
|
|
125
|
+
this.spec.manage(rel);
|
|
126
|
+
}
|
|
127
|
+
isFile(path) {
|
|
128
|
+
try {
|
|
129
|
+
return true === this.real.statSync(path)?.isFile();
|
|
130
|
+
}
|
|
131
|
+
catch (err) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
read(path) {
|
|
136
|
+
return Buffer.from(this.real.readFileSync(path));
|
|
137
|
+
}
|
|
138
|
+
createdHere(abs) {
|
|
139
|
+
return this.orig.has(abs) && null === this.orig.get(abs);
|
|
140
|
+
}
|
|
141
|
+
before(path) {
|
|
142
|
+
if ('string' !== typeof path) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const abs = node_path_1.default.resolve(path);
|
|
146
|
+
if (!this.orig.has(abs)) {
|
|
147
|
+
if (this.isFile(abs)) {
|
|
148
|
+
this.orig.set(abs, this.read(abs));
|
|
149
|
+
}
|
|
150
|
+
else if (!this.real.existsSync(abs)) {
|
|
151
|
+
this.orig.set(abs, null);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const rel = this.rel(abs);
|
|
155
|
+
if (this.managed(rel)) {
|
|
156
|
+
this.touched.add(rel);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// Was this file changed after the toolchain wrote it? Asked once, before
|
|
160
|
+
// the run writes it; a file the record does not hold counts as changed.
|
|
161
|
+
isEdited(rel, abs) {
|
|
162
|
+
let edited = this.edited.get(rel);
|
|
163
|
+
if (null == edited) {
|
|
164
|
+
const print = this.spec.recorded(rel);
|
|
165
|
+
edited = null == print || print !== this.spec.fingerprint(this.read(abs));
|
|
166
|
+
this.edited.set(rel, edited);
|
|
167
|
+
}
|
|
168
|
+
return edited;
|
|
169
|
+
}
|
|
170
|
+
// Defers a write over a locally changed file, leaving it on disk as it is.
|
|
171
|
+
holds(path, data) {
|
|
172
|
+
if ('string' !== typeof path) {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
const abs = node_path_1.default.resolve(path);
|
|
176
|
+
const rel = this.rel(abs);
|
|
177
|
+
if (!this.managed(rel)) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
if (this.pending.has(abs)) {
|
|
181
|
+
this.pending.set(abs, data);
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
if (this.createdHere(abs) || !this.isFile(abs) || !this.isEdited(rel, abs)) {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
if (sameText(this.read(abs), data)) {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
this.pending.set(abs, data);
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
// A delete of a changed file, or of one no add wrote, leaves it in place.
|
|
194
|
+
spares(path) {
|
|
195
|
+
if ('string' !== typeof path) {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
const abs = node_path_1.default.resolve(path);
|
|
199
|
+
const rel = this.rel(abs);
|
|
200
|
+
if (!this.managed(rel) || this.createdHere(abs) || !this.isFile(abs)) {
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
if (null == this.spec.recorded(rel)) {
|
|
204
|
+
this.spared.push(rel);
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
if (this.pending.has(abs) || this.isEdited(rel, abs)) {
|
|
208
|
+
this.pending.set(abs, DELETED);
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
missingDirs(path) {
|
|
214
|
+
if ('string' !== typeof path) {
|
|
215
|
+
return [];
|
|
216
|
+
}
|
|
217
|
+
const missing = [];
|
|
218
|
+
let dir = node_path_1.default.resolve(path);
|
|
219
|
+
while (!this.real.existsSync(dir) && node_path_1.default.dirname(dir) !== dir) {
|
|
220
|
+
missing.push(dir);
|
|
221
|
+
dir = node_path_1.default.dirname(dir);
|
|
222
|
+
}
|
|
223
|
+
return missing;
|
|
224
|
+
}
|
|
225
|
+
// An incoming copy the record already holds is its own base: the source
|
|
226
|
+
// did not move since the add that wrote it.
|
|
227
|
+
base(rel, incoming) {
|
|
228
|
+
const print = this.spec.recorded(rel);
|
|
229
|
+
if (null == print) {
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
if (print === this.spec.fingerprint(incoming)) {
|
|
233
|
+
return incoming;
|
|
234
|
+
}
|
|
235
|
+
const stored = this.storePath(this.spec.basedir, rel);
|
|
236
|
+
if (this.isFile(stored)) {
|
|
237
|
+
const base = this.read(stored);
|
|
238
|
+
if (print === this.spec.fingerprint(base)) {
|
|
239
|
+
return base;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
for (const version of this.spec.versions?.(node_path_1.default.join(this.root, rel)) ?? []) {
|
|
243
|
+
if (print === this.spec.fingerprint(version)) {
|
|
244
|
+
return version;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
249
|
+
storePath(dir, rel) {
|
|
250
|
+
return node_path_1.default.join(this.root, ...dir.split('/'), ...rel.split('/'));
|
|
251
|
+
}
|
|
252
|
+
finish() {
|
|
253
|
+
const outcome = { merged: [], kept: [], retained: [], spared: this.spared };
|
|
254
|
+
const conflicts = [];
|
|
255
|
+
const writes = [];
|
|
256
|
+
const bases = new Map();
|
|
257
|
+
for (const [abs, incoming] of this.pending) {
|
|
258
|
+
const rel = this.rel(abs);
|
|
259
|
+
if (DELETED === incoming) {
|
|
260
|
+
outcome.retained.push(rel);
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
const local = this.read(abs);
|
|
264
|
+
const base = this.base(rel, incoming);
|
|
265
|
+
let conflict;
|
|
266
|
+
let merged;
|
|
267
|
+
if (null == base) {
|
|
268
|
+
conflict = { rel, why: 'nobase', preview: incoming };
|
|
269
|
+
}
|
|
270
|
+
else if (isBinary(incoming) || isBinary(local) || isBinary(base)) {
|
|
271
|
+
conflict = { rel, why: 'binary', preview: incoming };
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
const res = merge3(incoming, base, local, this.spec.what);
|
|
275
|
+
if (res.conflict) {
|
|
276
|
+
conflict = { rel, why: 'conflict', preview: res.content };
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
merged = res.content;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (null != conflict && true === this.spec.keep) {
|
|
283
|
+
outcome.kept.push(rel);
|
|
284
|
+
bases.set(rel, incoming);
|
|
285
|
+
}
|
|
286
|
+
else if (null != conflict) {
|
|
287
|
+
conflicts.push(conflict);
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
writes.push([abs, merged]);
|
|
291
|
+
outcome.merged.push(rel);
|
|
292
|
+
bases.set(rel, incoming);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
if (0 < conflicts.length) {
|
|
296
|
+
this.rollback();
|
|
297
|
+
this.previews(conflicts);
|
|
298
|
+
throw this.failure(conflicts);
|
|
299
|
+
}
|
|
300
|
+
for (const [abs, content] of writes) {
|
|
301
|
+
if (!sameText(this.read(abs), content)) {
|
|
302
|
+
this.writeAtomic(abs, content);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
this.keepBases(bases);
|
|
306
|
+
this.clearDir(this.spec.conflictdir);
|
|
307
|
+
this.report(outcome);
|
|
308
|
+
return outcome;
|
|
309
|
+
}
|
|
310
|
+
// The store holds a base only where the file differs from it: elsewhere
|
|
311
|
+
// the file itself, checked against the record, is the base.
|
|
312
|
+
keepBases(bases) {
|
|
313
|
+
for (const rel of new Set([...this.touched, ...bases.keys()])) {
|
|
314
|
+
const at = this.storePath(this.spec.basedir, rel);
|
|
315
|
+
const base = bases.get(rel);
|
|
316
|
+
if (null != base) {
|
|
317
|
+
this.real.mkdirSync(node_path_1.default.dirname(at), { recursive: true });
|
|
318
|
+
this.real.writeFileSync(at, base);
|
|
319
|
+
}
|
|
320
|
+
else if (this.isFile(at)) {
|
|
321
|
+
this.real.unlinkSync(at);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
rollback() {
|
|
326
|
+
for (const [abs, content] of Array.from(this.orig).reverse()) {
|
|
327
|
+
try {
|
|
328
|
+
if (null != content) {
|
|
329
|
+
this.real.writeFileSync(abs, content);
|
|
330
|
+
}
|
|
331
|
+
else if (this.isFile(abs)) {
|
|
332
|
+
this.real.unlinkSync(abs);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
catch (err) {
|
|
336
|
+
this.spec.log.warn({
|
|
337
|
+
point: 'copy-merge-rollback', file: abs, err: err?.message,
|
|
338
|
+
note: 'could not restore ' + abs + ': ' + err?.message,
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
for (const dir of [...this.dirs].reverse()) {
|
|
343
|
+
try {
|
|
344
|
+
if (0 === this.real.readdirSync(dir).length) {
|
|
345
|
+
this.real.rmdirSync(dir);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
catch (err) {
|
|
349
|
+
continue;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
previews(conflicts) {
|
|
354
|
+
this.clearDir(this.spec.conflictdir);
|
|
355
|
+
const dir = this.storePath(this.spec.conflictdir, '');
|
|
356
|
+
this.real.mkdirSync(dir, { recursive: true });
|
|
357
|
+
this.real.writeFileSync(node_path_1.default.join(dir, '.gitignore'), '*\n');
|
|
358
|
+
for (const conflict of conflicts) {
|
|
359
|
+
const at = this.storePath(this.spec.conflictdir, conflict.rel);
|
|
360
|
+
this.real.mkdirSync(node_path_1.default.dirname(at), { recursive: true });
|
|
361
|
+
this.real.writeFileSync(at, conflict.preview ?? Buffer.alloc(0));
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
clearDir(rel) {
|
|
365
|
+
const dir = this.storePath(rel, '');
|
|
366
|
+
if (this.real.existsSync(dir)) {
|
|
367
|
+
this.real.rmSync(dir, { recursive: true, force: true });
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
writeAtomic(abs, content) {
|
|
371
|
+
const tmp = abs + '.copymerge-' + process.pid + '-' + Date.now();
|
|
372
|
+
this.real.writeFileSync(tmp, content);
|
|
373
|
+
this.real.renameSync(tmp, abs);
|
|
374
|
+
}
|
|
375
|
+
failure(conflicts) {
|
|
376
|
+
const why = {
|
|
377
|
+
conflict: 'the incoming copy and the local change touch the same lines',
|
|
378
|
+
nobase: 'no record of what the toolchain wrote here, so nothing to merge ' +
|
|
379
|
+
'against; a base is found in git once the copies an add writes are committed',
|
|
380
|
+
binary: 'a binary file, which is never merged',
|
|
381
|
+
};
|
|
382
|
+
const shown = this.spec.conflictdir;
|
|
383
|
+
const msg = this.spec.what + ': ' + conflicts.length +
|
|
384
|
+
' locally changed file(s) cannot take the incoming copy, so nothing was changed:\n ' +
|
|
385
|
+
conflicts.map((c) => c.rel + ' (' + why[c.why] + ')').join('\n ') +
|
|
386
|
+
'\n\n The incoming copies are in ' + shown + '/, with conflict markers where ' +
|
|
387
|
+
'both sides changed the same lines. Then either:' +
|
|
388
|
+
'\n - fold the incoming change into the local file by hand and re-run with ' +
|
|
389
|
+
'--keep, which keeps the local files and records the incoming copies as ' +
|
|
390
|
+
'their base;' +
|
|
391
|
+
'\n - or re-run with --force, which takes the incoming copies and discards ' +
|
|
392
|
+
'the local changes.';
|
|
393
|
+
return null == this.spec.error ? new Error(msg) : this.spec.error(msg);
|
|
394
|
+
}
|
|
395
|
+
report(outcome) {
|
|
396
|
+
const log = this.spec.log;
|
|
397
|
+
if (0 < outcome.merged.length) {
|
|
398
|
+
log.info({
|
|
399
|
+
point: 'copy-merge-merged', files: outcome.merged,
|
|
400
|
+
note: this.spec.what + ': merged the incoming copy into ' +
|
|
401
|
+
outcome.merged.length + ' locally changed file(s): ' + outcome.merged.join(', ')
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
if (0 < outcome.kept.length) {
|
|
405
|
+
log.warn({
|
|
406
|
+
point: 'copy-merge-kept', files: outcome.kept,
|
|
407
|
+
note: this.spec.what + ': --keep, kept ' + outcome.kept.length +
|
|
408
|
+
' local file(s) as they are: ' + outcome.kept.join(', ')
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
if (0 < outcome.retained.length) {
|
|
412
|
+
log.warn({
|
|
413
|
+
point: 'copy-merge-retained', files: outcome.retained,
|
|
414
|
+
note: this.spec.what + ': the source no longer provides ' +
|
|
415
|
+
outcome.retained.length + ' locally changed file(s), left in place: ' +
|
|
416
|
+
outcome.retained.join(', ')
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
if (0 < outcome.spared.length) {
|
|
420
|
+
log.info({
|
|
421
|
+
point: 'copy-merge-spared', files: outcome.spared,
|
|
422
|
+
note: this.spec.what + ': left ' + outcome.spared.length +
|
|
423
|
+
' file(s) no add wrote in place: ' + outcome.spared.join(', ')
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
function merge3(incoming, base, local, what) {
|
|
429
|
+
const text = (bytes) => bytes.toString('latin1').replace(/\r\n/g, '\n');
|
|
430
|
+
const res = jostraca_1.DiffUtil.merge(text(incoming), text(base), text(local), {
|
|
431
|
+
labels: { generated: 'INCOMING (' + what + ')', existing: 'LOCAL' },
|
|
432
|
+
});
|
|
433
|
+
return {
|
|
434
|
+
conflict: true === res.conflict || 'unresolved' === res.outcome,
|
|
435
|
+
content: Buffer.from(res.content, 'latin1'),
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
function within(rel, dir) {
|
|
439
|
+
return rel === dir || rel.startsWith(dir + '/');
|
|
440
|
+
}
|
|
441
|
+
function toBuffer(data, opts) {
|
|
442
|
+
if (Buffer.isBuffer(data)) {
|
|
443
|
+
return data;
|
|
444
|
+
}
|
|
445
|
+
if (ArrayBuffer.isView(data)) {
|
|
446
|
+
return Buffer.from(data.buffer, data.byteOffset, data.byteLength);
|
|
447
|
+
}
|
|
448
|
+
const encoding = ('string' === typeof opts ? opts : opts?.encoding) || 'utf8';
|
|
449
|
+
return Buffer.from(String(data), encoding);
|
|
450
|
+
}
|
|
451
|
+
function sameText(a, b) {
|
|
452
|
+
return a.toString('latin1').replace(/\r\n/g, '\n') ===
|
|
453
|
+
b.toString('latin1').replace(/\r\n/g, '\n');
|
|
454
|
+
}
|
|
455
|
+
function isBinary(bytes) {
|
|
456
|
+
return 0 <= bytes.subarray(0, 8000).indexOf(0);
|
|
457
|
+
}
|
|
458
|
+
// Committed versions of a file, newest first: the index, HEAD, then the
|
|
459
|
+
// commits that touched it. Nothing outside a git checkout.
|
|
460
|
+
function gitVersions(abs, limit = 20) {
|
|
461
|
+
return {
|
|
462
|
+
*[Symbol.iterator]() {
|
|
463
|
+
let top;
|
|
464
|
+
let rel;
|
|
465
|
+
try {
|
|
466
|
+
const dir = node_path_1.default.dirname(abs);
|
|
467
|
+
top = git(dir, ['rev-parse', '--show-toplevel']).toString().trim();
|
|
468
|
+
const real = node_path_1.default.join((0, node_fs_1.realpathSync)(dir), node_path_1.default.basename(abs));
|
|
469
|
+
rel = node_path_1.default.relative(top, real).split(node_path_1.default.sep).join('/');
|
|
470
|
+
}
|
|
471
|
+
catch (err) {
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
const shown = (spec) => {
|
|
475
|
+
try {
|
|
476
|
+
return git(top, ['show', spec]);
|
|
477
|
+
}
|
|
478
|
+
catch (err) {
|
|
479
|
+
return undefined;
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
for (const spec of [':' + rel, 'HEAD:' + rel]) {
|
|
483
|
+
const version = shown(spec);
|
|
484
|
+
if (null != version) {
|
|
485
|
+
yield version;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
let shas = [];
|
|
489
|
+
try {
|
|
490
|
+
shas = git(top, ['log', '--format=%H', '-n', String(limit), '--', rel])
|
|
491
|
+
.toString().split('\n').filter(Boolean);
|
|
492
|
+
}
|
|
493
|
+
catch (err) {
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
for (const sha of shas) {
|
|
497
|
+
const version = shown(sha + ':' + rel);
|
|
498
|
+
if (null != version) {
|
|
499
|
+
yield version;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
function git(cwd, args) {
|
|
506
|
+
return (0, node_child_process_1.execFileSync)('git', args, {
|
|
507
|
+
cwd, stdio: ['ignore', 'pipe', 'ignore'], maxBuffer: 256 * 1024 * 1024,
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
//# sourceMappingURL=copymerge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copymerge.js","sourceRoot":"","sources":["../src/copymerge.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;;;;QAksBlD,QAAQ;QACR,aAAa;QACb,WAAW;QACX,MAAM;AAnsBR,0EAA0E;AAE1E,0DAA4B;AAC5B,qCAAsC;AACtC,2DAAiD;AAEjD,uCAAmC;AASnC,MAAM,KAAK,GAAa,OAAO,CAAA;QA+qB7B,KAAK;AA9qBP,MAAM,SAAS,GAAa,WAAW,CAAA;QA+qBrC,SAAS;AAjoBX,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA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