Skip to content

Commit

Permalink
Make preprint server names available
Browse files Browse the repository at this point in the history
Refs #28
  • Loading branch information
thewilkybarkid committed Jul 2, 2024
1 parent 0ac7005 commit 592203a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/data/preprint-servers.json.ts
Original file line number Diff line number Diff line change
@@ -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)))
2 changes: 1 addition & 1 deletion src/lib/PreprintServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 592203a

Please sign in to comment.