diff --git a/src/data/preprint-servers.json.ts b/src/data/preprint-servers.json.ts new file mode 100644 index 0000000..6dfab17 --- /dev/null +++ b/src/data/preprint-servers.json.ts @@ -0,0 +1,17 @@ +import { Terminal } from '@effect/platform' +import { NodeTerminal } from '@effect/platform-node' +import { Schema } from '@effect/schema' +import { Effect } from 'effect' +import * as PreprintServer from '../lib/PreprintServer.js' + +const Output = Schema.Record(Schema.String, Schema.String) + +const program = Effect.gen(function* () { + const terminal = yield* Terminal.Terminal + + const encoded = yield* Schema.encode(Schema.parseJson(Output))(PreprintServer.preprintServers) + + yield* terminal.display(encoded) +}) + +await Effect.runPromise(program.pipe(Effect.provide(NodeTerminal.layer))) diff --git a/src/lib/PreprintServer.ts b/src/lib/PreprintServer.ts index ef3d29f..22a6edb 100644 --- a/src/lib/PreprintServer.ts +++ b/src/lib/PreprintServer.ts @@ -3,7 +3,7 @@ import type { Predicate } from 'effect' export type PreprintServer = keyof typeof preprintServers -const preprintServers = { +export const preprintServers = { africarxiv: 'AfricArXiv Preprints', arxiv: 'arXiv', authorea: 'Authorea',