Skip to content

Commit

Permalink
Make the fp-ts ecosystem compatible with ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilkybarkid committed Jun 13, 2024
1 parent 294f1f7 commit 95a9ced
Show file tree
Hide file tree
Showing 329 changed files with 1,077 additions and 1,076 deletions.
9 changes: 5 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@typescript-eslint/prefer-nullish-coalescing": ["error", { "ignoreConditionalTests": true }],
"@typescript-eslint/restrict-template-expressions": ["error", { "allowNumber": true }],
"@typescript-eslint/strict-boolean-expressions": "error",
"fp-ts/no-lib-imports": "off",
"fp-ts/no-module-imports": "off",
"import/no-cycle": "error",
"import/no-duplicates": ["error", { "prefer-inline": true }],
Expand All @@ -69,12 +70,12 @@
"error",
{
"allow": [
"fp-ts/*",
"fp-ts-contrib/*",
"io-ts/*",
"fp-ts/lib/*",
"fp-ts-contrib/lib/*",
"io-ts/lib/*",
"iso-639-3/to-*.json",
"http-proxy-middleware/dist/types",
"hyper-ts/*",
"hyper-ts/lib/*",
"logging-ts/lib/*",
"nanohtml/*",
"remixicon/**/*.svg",
Expand Down
8 changes: 4 additions & 4 deletions integration/author-invite.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { FetchMockSandbox } from 'fetch-mock'
import * as E from 'fp-ts/Either'
import * as J from 'fp-ts/Json'
import { pipe } from 'fp-ts/function'
import * as D from 'io-ts/Decoder'
import * as E from 'fp-ts/lib/Either.js'
import * as J from 'fp-ts/lib/Json.js'
import { pipe } from 'fp-ts/lib/function.js'
import * as D from 'io-ts/lib/Decoder.js'
import {
canLogIn,
expect,
Expand Down
2 changes: 1 addition & 1 deletion integration/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { SystemClock } from 'clock-ts'
import type { Doi } from 'doi-ts'
import fetchMock, { type FetchMockSandbox } from 'fetch-mock'
import type { JsonRecord } from 'fp-ts/Json'
import type { JsonRecord } from 'fp-ts/lib/Json.js'
import * as fs from 'fs/promises'
import type { Server } from 'http'
import { Status } from 'hyper-ts'
Expand Down
8 changes: 4 additions & 4 deletions integration/log-in.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { FetchMockSandbox } from 'fetch-mock'
import * as E from 'fp-ts/Either'
import * as J from 'fp-ts/Json'
import { pipe } from 'fp-ts/function'
import * as E from 'fp-ts/lib/Either.js'
import * as J from 'fp-ts/lib/Json.js'
import { pipe } from 'fp-ts/lib/function.js'
import { Status } from 'hyper-ts'
import * as D from 'io-ts/Decoder'
import * as D from 'io-ts/lib/Decoder.js'
import type { MutableRedirectUri } from 'oauth2-mock-server'
import path from 'path'
import {
Expand Down
8 changes: 4 additions & 4 deletions integration/publishing-a-prereview.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Doi } from 'doi-ts'
import type { FetchMockSandbox } from 'fetch-mock'
import * as E from 'fp-ts/Either'
import * as J from 'fp-ts/Json'
import { constVoid, pipe } from 'fp-ts/function'
import * as E from 'fp-ts/lib/Either.js'
import * as J from 'fp-ts/lib/Json.js'
import { constVoid, pipe } from 'fp-ts/lib/function.js'
import { Status } from 'hyper-ts'
import * as D from 'io-ts/Decoder'
import * as D from 'io-ts/lib/Decoder.js'
import type { MutableRedirectUri } from 'oauth2-mock-server'
import type { Orcid } from 'orcid-id-ts'
import { URL } from 'url'
Expand Down
4 changes: 2 additions & 2 deletions src/about-us.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { format } from 'fp-ts-routing'
import * as RTE from 'fp-ts/ReaderTaskEither'
import { pipe } from 'fp-ts/function'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import { pipe } from 'fp-ts/lib/function.js'
import { getPage } from './ghost.js'
import { type Html, fixHeadingLevels, html, plainText } from './html.js'
import { havingProblemsPage } from './http-error.js'
Expand Down
12 changes: 6 additions & 6 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import slashes from 'connect-slashes'
import express from 'express'
import asyncHandler from 'express-async-handler'
import type { Json } from 'fp-ts/Json'
import * as R from 'fp-ts/Reader'
import * as RTE from 'fp-ts/ReaderTaskEither'
import { apply, flow, identity, pipe } from 'fp-ts/function'
import type { Json } from 'fp-ts/lib/Json.js'
import * as R from 'fp-ts/lib/Reader.js'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import { apply, flow, identity, pipe } from 'fp-ts/lib/function.js'
import helmet from 'helmet'
import http from 'http'
import { createProxyMiddleware } from 'http-proxy-middleware'
import type { ResponseEnded, StatusOpen } from 'hyper-ts'
import { getSession } from 'hyper-ts-session'
import * as RM from 'hyper-ts/ReaderMiddleware'
import { toRequestHandler } from 'hyper-ts/express'
import * as RM from 'hyper-ts/lib/ReaderMiddleware.js'
import { toRequestHandler } from 'hyper-ts/lib/express.js'
import * as L from 'logger-fp-ts'
import * as l from 'logging-ts/lib/IO.js'
import { match, P as p } from 'ts-pattern'
Expand Down
8 changes: 4 additions & 4 deletions src/author-invite-flow/author-invite-published.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Doi } from 'doi-ts'
import { format } from 'fp-ts-routing'
import type * as RT from 'fp-ts/ReaderTask'
import * as RTE from 'fp-ts/ReaderTaskEither'
import type * as TE from 'fp-ts/TaskEither'
import { pipe } from 'fp-ts/function'
import type * as RT from 'fp-ts/lib/ReaderTask.js'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import type * as TE from 'fp-ts/lib/TaskEither.js'
import { pipe } from 'fp-ts/lib/function.js'
import type { LanguageCode } from 'iso-639-1'
import { P, match } from 'ts-pattern'
import type { Uuid } from 'uuid-ts'
Expand Down
8 changes: 4 additions & 4 deletions src/author-invite-flow/author-invite-start.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { format } from 'fp-ts-routing'
import type * as RT from 'fp-ts/ReaderTask'
import * as RTE from 'fp-ts/ReaderTaskEither'
import type * as TE from 'fp-ts/TaskEither'
import { pipe } from 'fp-ts/function'
import type * as RT from 'fp-ts/lib/ReaderTask.js'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import type * as TE from 'fp-ts/lib/TaskEither.js'
import { pipe } from 'fp-ts/lib/function.js'
import type { LanguageCode } from 'iso-639-1'
import { P, match } from 'ts-pattern'
import type { Uuid } from 'uuid-ts'
Expand Down
10 changes: 5 additions & 5 deletions src/author-invite-flow/author-invite.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Temporal } from '@js-temporal/polyfill'
import type { Doi } from 'doi-ts'
import { format } from 'fp-ts-routing'
import type * as RT from 'fp-ts/ReaderTask'
import * as RTE from 'fp-ts/ReaderTaskEither'
import * as RNEA from 'fp-ts/ReadonlyNonEmptyArray'
import type * as TE from 'fp-ts/TaskEither'
import { flow, pipe } from 'fp-ts/function'
import type * as RT from 'fp-ts/lib/ReaderTask.js'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import * as RNEA from 'fp-ts/lib/ReadonlyNonEmptyArray.js'
import type * as TE from 'fp-ts/lib/TaskEither.js'
import { flow, pipe } from 'fp-ts/lib/function.js'
import type { LanguageCode } from 'iso-639-1'
import { type Orcid, Eq as eqOrcid } from 'orcid-id-ts'
import { getLangDir } from 'rtl-detect'
Expand Down
8 changes: 4 additions & 4 deletions src/author-invite-flow/check-page/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { format } from 'fp-ts-routing'
import * as RT from 'fp-ts/ReaderTask'
import * as RTE from 'fp-ts/ReaderTaskEither'
import type * as TE from 'fp-ts/TaskEither'
import { pipe } from 'fp-ts/function'
import * as RT from 'fp-ts/lib/ReaderTask.js'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import type * as TE from 'fp-ts/lib/TaskEither.js'
import { pipe } from 'fp-ts/lib/function.js'
import type { LanguageCode } from 'iso-639-1'
import { P, match } from 'ts-pattern'
import type { Uuid } from 'uuid-ts'
Expand Down
4 changes: 2 additions & 2 deletions src/author-invite-flow/decline-page/decline-page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { format } from 'fp-ts-routing'
import * as RNEA from 'fp-ts/ReadonlyNonEmptyArray'
import { flow, pipe } from 'fp-ts/function'
import * as RNEA from 'fp-ts/lib/ReadonlyNonEmptyArray.js'
import { flow, pipe } from 'fp-ts/lib/function.js'
import { Status } from 'hyper-ts'
import type { Orcid } from 'orcid-id-ts'
import { getLangDir } from 'rtl-detect'
Expand Down
10 changes: 5 additions & 5 deletions src/author-invite-flow/decline-page/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Temporal } from '@js-temporal/polyfill'
import type { Doi } from 'doi-ts'
import { format } from 'fp-ts-routing'
import type * as RT from 'fp-ts/ReaderTask'
import * as RTE from 'fp-ts/ReaderTaskEither'
import type * as RNEA from 'fp-ts/ReadonlyNonEmptyArray'
import type * as TE from 'fp-ts/TaskEither'
import { pipe } from 'fp-ts/function'
import type * as RT from 'fp-ts/lib/ReaderTask.js'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import type * as RNEA from 'fp-ts/lib/ReadonlyNonEmptyArray.js'
import type * as TE from 'fp-ts/lib/TaskEither.js'
import { pipe } from 'fp-ts/lib/function.js'
import type { LanguageCode } from 'iso-639-1'
import type { Orcid } from 'orcid-id-ts'
import { P, match } from 'ts-pattern'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { format } from 'fp-ts-routing'
import * as E from 'fp-ts/Either'
import * as E from 'fp-ts/lib/Either.js'
import { Status } from 'hyper-ts'
import { P, match } from 'ts-pattern'
import type { Uuid } from 'uuid-ts'
Expand Down
16 changes: 8 additions & 8 deletions src/author-invite-flow/enter-email-address-page/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { format } from 'fp-ts-routing'
import * as E from 'fp-ts/Either'
import * as O from 'fp-ts/Option'
import * as RIO from 'fp-ts/ReaderIO'
import * as RT from 'fp-ts/ReaderTask'
import * as RTE from 'fp-ts/ReaderTaskEither'
import type * as TE from 'fp-ts/TaskEither'
import { pipe } from 'fp-ts/function'
import * as D from 'io-ts/Decoder'
import * as E from 'fp-ts/lib/Either.js'
import * as O from 'fp-ts/lib/Option.js'
import * as RIO from 'fp-ts/lib/ReaderIO.js'
import * as RT from 'fp-ts/lib/ReaderTask.js'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import type * as TE from 'fp-ts/lib/TaskEither.js'
import { pipe } from 'fp-ts/lib/function.js'
import * as D from 'io-ts/lib/Decoder.js'
import type { LanguageCode } from 'iso-639-1'
import { get } from 'spectacles-ts'
import { P, match } from 'ts-pattern'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { format } from 'fp-ts-routing'
import type * as RT from 'fp-ts/ReaderTask'
import * as RTE from 'fp-ts/ReaderTaskEither'
import type * as TE from 'fp-ts/TaskEither'
import { pipe } from 'fp-ts/function'
import type * as RT from 'fp-ts/lib/ReaderTask.js'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import type * as TE from 'fp-ts/lib/TaskEither.js'
import { pipe } from 'fp-ts/lib/function.js'
import type { LanguageCode } from 'iso-639-1'
import { P, match } from 'ts-pattern'
import type { Uuid } from 'uuid-ts'
Expand Down
12 changes: 6 additions & 6 deletions src/author-invite-flow/persona-page/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { format } from 'fp-ts-routing'
import * as E from 'fp-ts/Either'
import * as RT from 'fp-ts/ReaderTask'
import * as RTE from 'fp-ts/ReaderTaskEither'
import type * as TE from 'fp-ts/TaskEither'
import { pipe } from 'fp-ts/function'
import * as D from 'io-ts/Decoder'
import * as E from 'fp-ts/lib/Either.js'
import * as RT from 'fp-ts/lib/ReaderTask.js'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import type * as TE from 'fp-ts/lib/TaskEither.js'
import { pipe } from 'fp-ts/lib/function.js'
import * as D from 'io-ts/lib/Decoder.js'
import type { LanguageCode } from 'iso-639-1'
import { get } from 'spectacles-ts'
import { P, match } from 'ts-pattern'
Expand Down
2 changes: 1 addition & 1 deletion src/author-invite-flow/persona-page/persona-form.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { format } from 'fp-ts-routing'
import * as E from 'fp-ts/Either'
import * as E from 'fp-ts/lib/Either.js'
import { Status } from 'hyper-ts'
import { match } from 'ts-pattern'
import type { Uuid } from 'uuid-ts'
Expand Down
8 changes: 4 additions & 4 deletions src/author-invite-flow/verify-email-address.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { format } from 'fp-ts-routing'
import type * as RT from 'fp-ts/ReaderTask'
import * as RTE from 'fp-ts/ReaderTaskEither'
import type * as TE from 'fp-ts/TaskEither'
import { pipe } from 'fp-ts/function'
import type * as RT from 'fp-ts/lib/ReaderTask.js'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import type * as TE from 'fp-ts/lib/TaskEither.js'
import { pipe } from 'fp-ts/lib/function.js'
import type { LanguageCode } from 'iso-639-1'
import { P, match } from 'ts-pattern'
import type { Uuid } from 'uuid-ts'
Expand Down
10 changes: 5 additions & 5 deletions src/author-invite.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as RTE from 'fp-ts/ReaderTaskEither'
import type * as TE from 'fp-ts/TaskEither'
import { pipe } from 'fp-ts/function'
import * as C from 'io-ts/Codec'
import * as D from 'io-ts/Decoder'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import type * as TE from 'fp-ts/lib/TaskEither.js'
import { pipe } from 'fp-ts/lib/function.js'
import * as C from 'io-ts/lib/Codec.js'
import * as D from 'io-ts/lib/Decoder.js'
import { type Orcid, isOrcid } from 'orcid-id-ts'
import { match } from 'ts-pattern'
import type { Uuid } from 'uuid-ts'
Expand Down
6 changes: 3 additions & 3 deletions src/avatar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as RTE from 'fp-ts/ReaderTaskEither'
import type * as TE from 'fp-ts/TaskEither'
import { flow, pipe } from 'fp-ts/function'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import type * as TE from 'fp-ts/lib/TaskEither.js'
import { flow, pipe } from 'fp-ts/lib/function.js'
import type { Orcid } from 'orcid-id-ts'
import { match } from 'ts-pattern'

Expand Down
8 changes: 4 additions & 4 deletions src/career-stage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as RTE from 'fp-ts/ReaderTaskEither'
import type * as TE from 'fp-ts/TaskEither'
import { flow } from 'fp-ts/function'
import * as C from 'io-ts/Codec'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import type * as TE from 'fp-ts/lib/TaskEither.js'
import { flow } from 'fp-ts/lib/function.js'
import * as C from 'io-ts/lib/Codec.js'
import type { Orcid } from 'orcid-id-ts'
import { match } from 'ts-pattern'

Expand Down
20 changes: 10 additions & 10 deletions src/cloudinary.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { now } from 'clock-ts'
import { v2 as cloudinary } from 'cloudinary'
import * as F from 'fetch-fp-ts'
import * as E from 'fp-ts/Either'
import * as J from 'fp-ts/Json'
import * as R from 'fp-ts/Reader'
import type { Reader } from 'fp-ts/Reader'
import * as RIO from 'fp-ts/ReaderIO'
import * as RTE from 'fp-ts/ReaderTaskEither'
import * as TE from 'fp-ts/TaskEither'
import { constVoid, flow, pipe } from 'fp-ts/function'
import * as s from 'fp-ts/string'
import * as E from 'fp-ts/lib/Either.js'
import * as J from 'fp-ts/lib/Json.js'
import * as R from 'fp-ts/lib/Reader.js'
import type { Reader } from 'fp-ts/lib/Reader.js'
import * as RIO from 'fp-ts/lib/ReaderIO.js'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import * as TE from 'fp-ts/lib/TaskEither.js'
import { constVoid, flow, pipe } from 'fp-ts/lib/function.js'
import * as s from 'fp-ts/lib/string.js'
import { MediaType, Status } from 'hyper-ts'
import * as D from 'io-ts/Decoder'
import * as D from 'io-ts/lib/Decoder.js'
import * as L from 'logger-fp-ts'
import type { Orcid } from 'orcid-id-ts'
import { P, match } from 'ts-pattern'
Expand Down
12 changes: 6 additions & 6 deletions src/club-details.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type * as O from 'fp-ts/Option'
import * as RA from 'fp-ts/ReadonlyArray'
import type * as RNEA from 'fp-ts/ReadonlyNonEmptyArray'
import * as RR from 'fp-ts/ReadonlyRecord'
import { flow, pipe } from 'fp-ts/function'
import { Eq as stringEq } from 'fp-ts/string'
import type * as O from 'fp-ts/lib/Option.js'
import * as RA from 'fp-ts/lib/ReadonlyArray.js'
import type * as RNEA from 'fp-ts/lib/ReadonlyNonEmptyArray.js'
import * as RR from 'fp-ts/lib/ReadonlyRecord.js'
import { flow, pipe } from 'fp-ts/lib/function.js'
import { Eq as stringEq } from 'fp-ts/lib/string.js'
import { type Orcid, Eq as eqOrcid } from 'orcid-id-ts'
import { get } from 'spectacles-ts'
import { type Html, html } from './html.js'
Expand Down
6 changes: 3 additions & 3 deletions src/club-profile-page/club-profile-page.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { format } from 'fp-ts-routing'
import * as RA from 'fp-ts/ReadonlyArray'
import * as RNEA from 'fp-ts/ReadonlyNonEmptyArray'
import { flow, pipe } from 'fp-ts/function'
import * as RA from 'fp-ts/lib/ReadonlyArray.js'
import * as RNEA from 'fp-ts/lib/ReadonlyNonEmptyArray.js'
import { flow, pipe } from 'fp-ts/lib/function.js'
import { getLangDir } from 'rtl-detect'
import { match } from 'ts-pattern'
import type { Club } from '../club-details.js'
Expand Down
6 changes: 3 additions & 3 deletions src/club-profile-page/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as RT from 'fp-ts/ReaderTask'
import * as RTE from 'fp-ts/ReaderTaskEither'
import { pipe } from 'fp-ts/function'
import type * as RT from 'fp-ts/lib/ReaderTask.js'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import { pipe } from 'fp-ts/lib/function.js'
import { getClubDetails } from '../club-details.js'
import { havingProblemsPage } from '../http-error.js'
import type { PageResponse } from '../response.js'
Expand Down
8 changes: 4 additions & 4 deletions src/club-profile-page/prereviews.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Temporal } from '@js-temporal/polyfill'
import * as RTE from 'fp-ts/ReaderTaskEither'
import type * as RNEA from 'fp-ts/ReadonlyNonEmptyArray'
import type * as TE from 'fp-ts/TaskEither'
import { pipe } from 'fp-ts/function'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import type * as RNEA from 'fp-ts/lib/ReadonlyNonEmptyArray.js'
import type * as TE from 'fp-ts/lib/TaskEither.js'
import { pipe } from 'fp-ts/lib/function.js'
import type { LanguageCode } from 'iso-639-1'
import type { Html } from '../html.js'
import type { ClubId } from '../types/club-id.js'
Expand Down
4 changes: 2 additions & 2 deletions src/clubs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { format } from 'fp-ts-routing'
import * as RTE from 'fp-ts/ReaderTaskEither'
import { pipe } from 'fp-ts/function'
import * as RTE from 'fp-ts/lib/ReaderTaskEither.js'
import { pipe } from 'fp-ts/lib/function.js'
import { getPage } from './ghost.js'
import { type Html, fixHeadingLevels, html, plainText } from './html.js'
import { havingProblemsPage } from './http-error.js'
Expand Down
Loading

0 comments on commit 95a9ced

Please sign in to comment.