Skip to content

Commit

Permalink
fix: Appease lint harder
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Jan 24, 2024
1 parent 4ece3f8 commit 4b3573a
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
13 changes: 10 additions & 3 deletions packages/cli/src/client.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { start, makeEndoClient } from '@endo/daemon';

export const provideEndoClient = async (...args) => {
/**
* @template TBootstrap
* @param {string} name
* @param {string} sockPath
* @param {Promise<void>} cancelled
* @param {TBootstrap} [bootstrap]
*/
export const provideEndoClient = async (name, sockPath, cancelled, bootstrap) => {
try {
// It is okay to fail to connect because the daemon is not running.
return await makeEndoClient(...args);
return await makeEndoClient(name, sockPath, cancelled, bootstrap);
} catch {
console.error('Starting Endo daemon...');
// It is also okay to fail the race to start.
Expand All @@ -12,6 +19,6 @@ export const provideEndoClient = async (...args) => {
// We are not going to contemplate reliably in the face of a worker getting
// stopped the moment after it was started.
// That is a bridge too far.
return makeEndoClient(...args);
return makeEndoClient(name, sockPath, cancelled, bootstrap);
}
};
2 changes: 1 addition & 1 deletion packages/cli/src/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const install = async ({
webPageName,
programPath,
}) => {
/** @type {import('@endo/eventual-send').ERef<import('@endo/stream').Reader<string>> | undefined} */
/** @type {import('@endo/eventual-send').FarRef<import('@endo/stream').Reader<string>> | undefined} */
let bundleReaderRef;
/** @type {string | undefined} */
let temporaryBundleName;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/make.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const makeCommand = async ({
return;
}

/** @type {import('@endo/eventual-send').ERef<import('@endo/stream').Reader<string>> | undefined} */
/** @type {import('@endo/eventual-send').FarRef<import('@endo/stream').Reader<string>> | undefined} */
let bundleReaderRef;
/** @type {string | undefined} */
let temporaryBundleName;
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { makeNetstringCapTP } from './connection.js';
* @param {string} name
* @param {string} sockPath
* @param {Promise<void>} cancelled
* @param {TBootstrap=} bootstrap
* @param {TBootstrap} [bootstrap]
*/
export const makeEndoClient = async (name, sockPath, cancelled, bootstrap) => {
const conn = net.connect(sockPath);
Expand Down
1 change: 1 addition & 0 deletions packages/daemon/src/daemon-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ const main = async () => {

process.once('SIGINT', () => cancel(new Error('SIGINT')));

// @ts-ignore Yes, we can assign to exitCode, typedoc.
process.exitCode = 1;
main().then(
() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/daemon/src/reader-ref.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Far } from '@endo/far';
*
* @template T The item type of the iterable.
* @param {import('./types').SomehowAsyncIterable<T>} iterable The iterable object.
* @returns {import('@endo/stream').Stream<T>} sort of fudging this into a stream to appease "mapReader"
* @returns {import('@endo/stream').Reader<T>} sort of fudging this into a stream to appease "mapReader"
*/
export const asyncIterate = iterable => {
let iterator;
Expand Down Expand Up @@ -61,7 +61,7 @@ export const makeIteratorRef = iterable => {

/**
* @param {import('./types').SomehowAsyncIterable<Uint8Array>} readable
* @returns {import('@endo/far').FarRef<import('@endo/stream').Stream<string>>}
* @returns {import('@endo/far').FarRef<import('@endo/stream').Reader<string>>}
*/
export const makeReaderRef = readable =>
makeIteratorRef(mapReader(asyncIterate(readable), encodeBase64));
1 change: 1 addition & 0 deletions packages/daemon/src/worker-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const { promise: cancelled, reject: cancel } =

process.once('SIGINT', () => cancel(new Error('SIGINT')));

// @ts-ignore Yes, we can assign to exitCode, typedoc.
process.exitCode = 1;
main(powers, locator, workerUuid, process.pid, cancel, cancelled).then(
() => {
Expand Down

0 comments on commit 4b3573a

Please sign in to comment.