Scratch space for learning atproto app development

Move env and view into lib

+1 -1
src/auth/client.ts
···
import { NodeOAuthClient } from '@atproto/oauth-client-node'
import type { Database } from '#/db'
-
import { env } from '#/env'
+
import { env } from '#/lib/env'
import { SessionStore, StateStore } from './storage'
export const createClient = async (db: Database) => {
+1 -1
src/auth/session.ts
···
import assert from 'node:assert'
import type { IncomingMessage, ServerResponse } from 'node:http'
import { getIronSession } from 'iron-session'
-
import { env } from '#/env'
+
import { env } from '#/lib/env'
import { AppContext } from '#/index'
export type Session = { did: string }
src/env.ts src/lib/env.ts
+1 -1
src/index.ts
···
import type { OAuthClient } from '@atproto/oauth-client-node'
import { createDb, migrateToLatest } from '#/db'
-
import { env } from '#/env'
+
import { env } from '#/lib/env'
import { Ingester } from '#/firehose/ingester'
import { createRouter } from '#/routes'
import { createClient } from '#/auth/client'
+1 -2
src/pages/home.ts
···
-
import { AtUri } from '@atproto/syntax'
import type { Status } from '#/db/schema'
-
import { html } from '../view'
+
import { html } from '../lib/view'
import { shell } from './shell'
const TODAY = new Date().toDateString()
+1 -1
src/pages/login.ts
···
-
import { html } from '../view'
+
import { html } from '../lib/view'
import { shell } from './shell'
type Props = { error?: string }
+1 -1
src/pages/shell.ts
···
-
import { type Hole, html } from '../view'
+
import { type Hole, html } from '../lib/view'
export function shell({ title, content }: { title: string; content: Hole }) {
return html`<html>
+1 -1
src/routes.ts
···
import type { AppContext } from '#/index'
import { home } from '#/pages/home'
import { login } from '#/pages/login'
-
import { page } from '#/view'
+
import { page } from '#/lib/view'
import * as Status from '#/lexicon/types/com/example/status'
const handler =
src/view.ts src/lib/view.ts