next-issue 16.5.0 → 16.5.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/dist/cli/start.mjs +1 -1
- package/dist/cli/switch-run.mjs +5 -5
- package/dist/cli.mjs +2 -2
- package/dist/shared/args.mjs +2 -2
- package/dist/shared/config.mjs +1 -1
- package/dist/shared/lock.mjs +1 -1
- package/dist/shared/observe.mjs +1 -1
- package/dist/worker/serve.mjs +4 -4
- package/package.json +1 -1
package/dist/cli/start.mjs
CHANGED
|
@@ -9,7 +9,7 @@ const REFUSED_GOING = [
|
|
|
9
9
|
'the worker is restarting, try again soon',
|
|
10
10
|
];
|
|
11
11
|
const SILENT = 'the next-issue worker did not answer';
|
|
12
|
-
const STARTED = '
|
|
12
|
+
const STARTED = 'the run started in the worker; follow it with npx -y next-issue@latest logs and stop it with npx -y next-issue@latest stop\n';
|
|
13
13
|
export async function startInWorker(root, argv) {
|
|
14
14
|
const version = await packageVersion();
|
|
15
15
|
const given = givenStartFlags(argv);
|
package/dist/cli/switch-run.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { isNewer } from '../shared/protocol.mjs';
|
|
|
3
3
|
import { packageVersion } from '../shared/version.mjs';
|
|
4
4
|
import { ANSWER_TIMEOUT_MS, CLOSED, findWorker, going, } from '../shared/worker-client.mjs';
|
|
5
5
|
const FIELDS = { watch: 'watching', hunt: 'hunting' };
|
|
6
|
-
const NO_RUN = '
|
|
6
|
+
const NO_RUN = 'no run is going in this repository\n';
|
|
7
7
|
function onOffText(on) {
|
|
8
8
|
return on === true ? 'on' : 'off';
|
|
9
9
|
}
|
|
@@ -13,7 +13,7 @@ export function switchInWorker(root, name, on) {
|
|
|
13
13
|
throw new Error(`the worker of the going run is older than next-issue, so it cannot switch ${FIELDS[name]}. Stop the run, then start it again`);
|
|
14
14
|
}
|
|
15
15
|
const progress = await switched(connection, root, name, on);
|
|
16
|
-
return `
|
|
16
|
+
return `watching ${onOffText(progress.watching)}, hunting ${onOffText(progress.hunting)}\n`;
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
async function inWorker(root, act) {
|
|
@@ -56,10 +56,10 @@ export function switched(connection, root, name, on) {
|
|
|
56
56
|
export function stopInWorker(root) {
|
|
57
57
|
return inWorker(root, async (connection, progress) => {
|
|
58
58
|
if (progress.status === 'stopping' && progress.upgrade === undefined) {
|
|
59
|
-
return '
|
|
59
|
+
return 'the run is stopping already\n';
|
|
60
60
|
}
|
|
61
61
|
const reply = await stopReply(connection, root);
|
|
62
|
-
return
|
|
62
|
+
return `${stopText(progress, reply)}\n`;
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
function stopReply(connection, root) {
|
|
@@ -103,7 +103,7 @@ export function statusInWorker(root) {
|
|
|
103
103
|
}
|
|
104
104
|
export function statusText(version, progress) {
|
|
105
105
|
const lines = [
|
|
106
|
-
`
|
|
106
|
+
`the run is ${progress.status} in worker ${version}`,
|
|
107
107
|
`watching ${onOffText(progress.watching)}, hunting ${onOffText(progress.hunting)}`,
|
|
108
108
|
];
|
|
109
109
|
if (progress.upgrade !== undefined) {
|
package/dist/cli.mjs
CHANGED
|
@@ -58,7 +58,7 @@ async function main() {
|
|
|
58
58
|
async function logs(root) {
|
|
59
59
|
const file = await newestRunLog(root);
|
|
60
60
|
if (file === undefined) {
|
|
61
|
-
await write(process.stderr, `
|
|
61
|
+
await write(process.stderr, `no run log in ${STATE_DIR}/runs\n`);
|
|
62
62
|
return 1;
|
|
63
63
|
}
|
|
64
64
|
const tail = process.stdout.isTTY ? Math.max(1, (process.stdout.rows || 24) - 1) : undefined;
|
|
@@ -93,6 +93,6 @@ async function excludeStateDirectories(root, stream) {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
main().then((code) => process.exit(code), async (error) => {
|
|
96
|
-
await write(process.stderr,
|
|
96
|
+
await write(process.stderr, `${message(error)}\n`);
|
|
97
97
|
process.exit(1);
|
|
98
98
|
});
|
package/dist/shared/args.mjs
CHANGED
|
@@ -8,7 +8,7 @@ const RUN_FLAGS = new Map([
|
|
|
8
8
|
['--hunt', 'hunt'],
|
|
9
9
|
]);
|
|
10
10
|
const COMMANDS = ['start', 'init', 'serve', 'stop', 'status', 'logs', 'watch', 'hunt'];
|
|
11
|
-
export const USAGE = `next-issue <command> [options]
|
|
11
|
+
export const USAGE = `npx -y next-issue@latest <command> [options]
|
|
12
12
|
|
|
13
13
|
start start a run: claim issues, fix them and push them to the base branch
|
|
14
14
|
--watch on|off on: read the issues again after each pass; off: do one pass and end (default on)
|
|
@@ -31,7 +31,7 @@ export function parseArgs(argv) {
|
|
|
31
31
|
return args;
|
|
32
32
|
}
|
|
33
33
|
if (args.command === undefined && flag !== undefined) {
|
|
34
|
-
throw new Error('no command given: use next-issue start to start a run, or see next-issue --help');
|
|
34
|
+
throw new Error('no command given: use npx -y next-issue@latest start to start a run, or see npx -y next-issue@latest --help');
|
|
35
35
|
}
|
|
36
36
|
if (args.command !== undefined && args.command !== 'start' && runFlag !== undefined) {
|
|
37
37
|
throw new Error(`${args.command} does not take ${runFlag}: it belongs to start`);
|
package/dist/shared/config.mjs
CHANGED
|
@@ -114,7 +114,7 @@ export async function moveOldConfig(root, force) {
|
|
|
114
114
|
}
|
|
115
115
|
export async function rejectOldConfig(root) {
|
|
116
116
|
if ((await readTextIfPresent(join(root, OLD_CONFIG_FILE))) !== undefined) {
|
|
117
|
-
throw new Error(`${OLD_CONFIG_FILE} moved to ${CONFIG_FILE}. Run next-issue init to move it.`);
|
|
117
|
+
throw new Error(`${OLD_CONFIG_FILE} moved to ${CONFIG_FILE}. Run npx -y next-issue@latest init to move it.`);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
export async function loadConfig(root, options = {}) {
|
package/dist/shared/lock.mjs
CHANGED
|
@@ -169,7 +169,7 @@ function heldLock(path, id, text) {
|
|
|
169
169
|
export async function lock(path, waitMs, readStart = processStart) {
|
|
170
170
|
const started = await readStart(process.pid);
|
|
171
171
|
if (started === undefined) {
|
|
172
|
-
throw new Error('
|
|
172
|
+
throw new Error('cannot read the start time of this process');
|
|
173
173
|
}
|
|
174
174
|
const text = `${process.pid} ${started}\n`;
|
|
175
175
|
const deadline = Date.now() + waitMs;
|
package/dist/shared/observe.mjs
CHANGED
|
@@ -28,7 +28,7 @@ class Sink {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
this.failed = true;
|
|
31
|
-
this.output(`
|
|
31
|
+
this.output(`the run log ${this.file} cannot be written (${message(error)}); the run goes on without it\n`);
|
|
32
32
|
}
|
|
33
33
|
write(record) {
|
|
34
34
|
if (!this.failed) {
|
package/dist/worker/serve.mjs
CHANGED
|
@@ -47,7 +47,7 @@ export async function startWorker(options) {
|
|
|
47
47
|
}
|
|
48
48
|
catch (error) {
|
|
49
49
|
const reason = `the worker could not start next-issue ${restart}: ${message(error)}`;
|
|
50
|
-
process.stderr.write(
|
|
50
|
+
process.stderr.write(`${reason}\n`);
|
|
51
51
|
run.progress = { ...run.progress, status: 'failed', error: reason };
|
|
52
52
|
broadcast(sockets, runs);
|
|
53
53
|
}
|
|
@@ -160,7 +160,7 @@ export async function startWorker(options) {
|
|
|
160
160
|
...(summary === undefined ? {} : { summary }),
|
|
161
161
|
});
|
|
162
162
|
}, (error) => {
|
|
163
|
-
process.stderr.write(
|
|
163
|
+
process.stderr.write(`${message(error)}\n`);
|
|
164
164
|
update({ ...run.progress, status: 'failed', error: message(error) });
|
|
165
165
|
return sendAllSent(sockets, { type: 'end', root, code: 1, error: message(error) });
|
|
166
166
|
})
|
|
@@ -284,7 +284,7 @@ export async function serve(root, logCheckMs = LOG_CHECK_MS) {
|
|
|
284
284
|
});
|
|
285
285
|
if (worker === undefined) {
|
|
286
286
|
stopTrimming();
|
|
287
|
-
process.stderr.write('
|
|
287
|
+
process.stderr.write('another worker is running\n');
|
|
288
288
|
return 1;
|
|
289
289
|
}
|
|
290
290
|
const end = (signal) => {
|
|
@@ -300,7 +300,7 @@ export async function serve(root, logCheckMs = LOG_CHECK_MS) {
|
|
|
300
300
|
process.on('SIGTERM', onTerminate);
|
|
301
301
|
process.on('SIGINT', onInterrupt);
|
|
302
302
|
process.on('SIGHUP', onHangUp);
|
|
303
|
-
process.stderr.write(`
|
|
303
|
+
process.stderr.write(`worker listening on ${paths.socketPath}\n`);
|
|
304
304
|
await worker.closed;
|
|
305
305
|
stopTrimming();
|
|
306
306
|
return 0;
|