Skip to content

Commit

Permalink
Match module naming convention
Browse files Browse the repository at this point in the history
Refs #1834
  • Loading branch information
thewilkybarkid committed Dec 13, 2024
1 parent 3b88de4 commit 7da0af5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
18 changes: 9 additions & 9 deletions src/about-us.ts → src/AboutUsPage/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { FetchHttpClient } from '@effect/platform'
import { Effect } from 'effect'
import { format } from 'fp-ts-routing'
import { DeprecatedSleepEnv, Locale } from './Context.js'
import * as FptsToEffect from './FptsToEffect.js'
import { getPage, GhostApi } from './ghost.js'
import { HavingProblemsPage } from './HavingProblemsPage/index.js'
import { type Html, fixHeadingLevels, html, plainText } from './html.js'
import { type SupportedLocale, translate } from './locales/index.js'
import { PageResponse } from './response.js'
import { aboutUsMatch } from './routes.js'
import { DeprecatedSleepEnv, Locale } from '../Context.js'
import * as FptsToEffect from '../FptsToEffect.js'
import { getPage, GhostApi } from '../ghost.js'
import { HavingProblemsPage } from '../HavingProblemsPage/index.js'
import { type Html, fixHeadingLevels, html, plainText } from '../html.js'
import { type SupportedLocale, translate } from '../locales/index.js'
import { PageResponse } from '../response.js'
import { aboutUsMatch } from '../routes.js'

export const aboutUs = Effect.gen(function* () {
export const AboutUsPage = Effect.gen(function* () {
const locale = yield* Locale
const fetch = yield* FetchHttpClient.Fetch
const ghostApi = yield* GhostApi
Expand Down
4 changes: 2 additions & 2 deletions src/Router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Cookies, Headers, HttpMiddleware, HttpRouter, HttpServerRequest, HttpSe
import { Effect, identity, Option, pipe, Record } from 'effect'
import { format } from 'fp-ts-routing'
import { StatusCodes } from 'http-status-codes'
import { aboutUs } from './about-us.js'
import { AboutUsPage } from './AboutUsPage/index.js'
import { ExpressConfig, FlashMessage, Locale } from './Context.js'
import { PublicUrl } from './public-url.js'
import { Redis } from './Redis.js'
Expand Down Expand Up @@ -210,7 +210,7 @@ const WriteCommentFlowRouter = pipe(

export const Router = pipe(
HttpRouter.empty,
HttpRouter.get(Routes.AboutUs.path, pipe(aboutUs, Effect.andThen(toHttpServerResponse))),
HttpRouter.get(Routes.AboutUs.path, pipe(AboutUsPage, Effect.andThen(toHttpServerResponse))),
HttpRouter.concat(WriteCommentFlowRouter),
HttpRouter.use(
HttpMiddleware.make(
Expand Down
18 changes: 9 additions & 9 deletions test/about-us.test.ts → test/AboutUsPage/AboutUsPage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { Effect, pipe, TestContext } from 'effect'
import fetchMock from 'fetch-mock'
import { format } from 'fp-ts-routing'
import { Status } from 'hyper-ts'
import * as _ from '../src/about-us.js'
import { DeprecatedSleepEnv, Locale } from '../src/Context.js'
import { GhostApi } from '../src/ghost.js'
import { aboutUsMatch } from '../src/routes.js'
import * as fc from './fc.js'
import { shouldNotBeCalled } from './should-not-be-called.js'
import * as _ from '../../src/AboutUsPage/index.js'
import { DeprecatedSleepEnv, Locale } from '../../src/Context.js'
import { GhostApi } from '../../src/ghost.js'
import { aboutUsMatch } from '../../src/routes.js'
import * as fc from '../fc.js'
import { shouldNotBeCalled } from '../should-not-be-called.js'

describe('aboutUs', () => {
describe('AboutUsPage', () => {
test.prop([fc.supportedLocale(), fc.string({ unit: fc.alphanumeric(), minLength: 1 })])(
'when the page can be loaded',
(locale, key) =>
Expand All @@ -26,7 +26,7 @@ describe('aboutUs', () => {
)

const actual = yield* pipe(
_.aboutUs,
_.AboutUsPage,
Effect.provideService(FetchHttpClient.Fetch, fetch as typeof FetchHttpClient.Fetch.Service),
)

Expand Down Expand Up @@ -62,7 +62,7 @@ describe('aboutUs', () => {
)

const actual = yield* pipe(
_.aboutUs,
_.AboutUsPage,
Effect.provideService(FetchHttpClient.Fetch, fetch as typeof FetchHttpClient.Fetch.Service),
)

Expand Down

0 comments on commit 7da0af5

Please sign in to comment.