-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
25 lines (22 loc) · 800 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env node
import * as NodeContext from '@effect/platform-node/NodeContext';
import * as Runtime from '@effect/platform-node/Runtime';
import { Console as ConsoleAdapter } from '@scribe/adapters';
import * as Cli from '@scribe/cli';
import { FS, Process } from '@scribe/services';
import { Console, Effect, Layer, Logger, LogLevel } from 'effect';
export { type ScribeConfig } from '@scribe/config';
Effect.suspend(() => Cli.run(process.argv.slice(2))).pipe(
process.env.NODE_ENV === 'production'
? Logger.withMinimumLogLevel(LogLevel.Info)
: Logger.withMinimumLogLevel(LogLevel.All),
Console.withConsole(ConsoleAdapter.consoleLayer),
Effect.provide(
Layer.mergeAll(
NodeContext.layer, //
FS.layer(),
Process.layer(),
),
),
Runtime.runMain,
);