toiljs 0.0.140 → 0.0.141

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.
@@ -36,6 +36,7 @@ export interface ClientConfig {
36
36
  }
37
37
  export type DevNodeMode = 'hot' | 'regional' | 'continental' | 'daemon' | 'all';
38
38
  export interface DaemonConfig {
39
+ readonly enabled?: boolean;
39
40
  readonly region?: string;
40
41
  readonly standbyRegion?: string;
41
42
  readonly defaultIntervalMs?: number;
@@ -60,6 +61,7 @@ export interface ServerConfig {
60
61
  readonly threads?: number | 'auto';
61
62
  }
62
63
  export interface ResolvedDaemonConfig {
64
+ readonly enabled?: boolean;
63
65
  readonly region: string | null;
64
66
  readonly standbyRegion: string | null;
65
67
  readonly defaultIntervalMs: number;
@@ -37,6 +37,8 @@ export async function loadConfig(opts = {}) {
37
37
  const client = user.client ?? {};
38
38
  if (user.server?.logging !== undefined && typeof user.server.logging !== 'boolean')
39
39
  throw new Error('server.logging must be a boolean');
40
+ if (user.server?.daemon?.enabled !== undefined && typeof user.server.daemon.enabled !== 'boolean')
41
+ throw new Error('server.daemon.enabled must be a boolean');
40
42
  const authRoutes = user.server?.authRoutes ?? {};
41
43
  if (typeof authRoutes !== 'object' || Array.isArray(authRoutes))
42
44
  throw new Error('server.authRoutes must be an object');
@@ -116,6 +118,7 @@ function resolveDaemonConfig(d) {
116
118
  if (maxTasks <= 0 || maxTasks > 1024)
117
119
  maxTasks = Math.min(1024, Math.max(1, maxTasks || 64));
118
120
  return {
121
+ enabled: d?.enabled,
119
122
  region: d?.region ?? null,
120
123
  standbyRegion: d?.standbyRegion ?? null,
121
124
  defaultIntervalMs,
@@ -407,7 +407,7 @@ export function assertNoStreamInRequestTier(root, split) {
407
407
  function toilscriptPass(root, files, opts) {
408
408
  const args = [...files, '--target', 'release'];
409
409
  const logLib = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../server/globals/toil-log.ts');
410
- args.push('--lib', logLib, '--use', 'Log=ToilLog', '--use', `__TOIL_LOGGING=${opts.logging ? '1' : '0'}`);
410
+ args.push('--lib', logLib, '--use', 'Log=ToilLog', '--use', 'console=ToilConsole', '--use', `__TOIL_LOGGING=${opts.logging ? '1' : '0'}`);
411
411
  const editorTier = opts.mode === 'cold' ? 'cold' : opts.withRpc ? 'request' : 'stream';
412
412
  const editorDir = serverDirs(root)[0] ?? path.join(root, 'server');
413
413
  args.push('--editorTypes', path.join(editorDir, `toilscript.${editorTier}.generated.d.ts`));