Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -eu

pnpm install --lockfile-only --frozen-lockfile
PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false pnpm oxfmt --check
PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false pnpm format --check
3 changes: 2 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- uses: actions/checkout@v6
- run: "git -c url.https://github.com/.insteadOf=git@github.com: submodule update --init konfik"
- uses: crosshatch/konfik/.github/actions/configure_environment@main
- run: pnpm oxfmt --check
- run: pnpm format --check
- run: pnpm lint
- run: pnpm build
- run: pnpm test
48 changes: 24 additions & 24 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
[submodule "repos/effect"]
path = repos/effect
[submodule "repos/Effect-TS/effect-smol"]
path = repos/Effect-TS/effect-smol
url = git@github.com:Effect-TS/effect-smol.git
[submodule "repos/router"]
path = repos/router
[submodule "repos/TanStack/router"]
path = repos/TanStack/router
url = git@github.com:TanStack/router.git
[submodule "repos/workers-sdk"]
path = repos/workers-sdk
[submodule "repos/cloudflare/workers-sdk"]
path = repos/cloudflare/workers-sdk
url = git@github.com:cloudflare/workers-sdk.git
[submodule "repos/agents"]
path = repos/agents
[submodule "repos/cloudflare/agents"]
path = repos/cloudflare/agents
url = git@github.com:cloudflare/agents.git
[submodule "repos/oxc"]
path = repos/oxc
[submodule "repos/oxc-project/oxc"]
path = repos/oxc-project/oxc
url = git@github.com:oxc-project/oxc.git
[submodule "repos/vite"]
path = repos/vite
[submodule "repos/vitejs/vite"]
path = repos/vitejs/vite
url = git@github.com:vitejs/vite.git
[submodule "konfik"]
path = konfik
url = git@github.com:crosshatch/konfik.git
[submodule "repos/workerd"]
path = repos/workerd
[submodule "repos/cloudflare/workerd"]
path = repos/cloudflare/workerd
url = git@github.com:cloudflare/workerd.git
[submodule "repos/vitest"]
path = repos/vitest
[submodule "repos/vitest-dev/vitest"]
path = repos/vitest-dev/vitest
url = git@github.com:vitest-dev/vitest.git
[submodule "repos/alchemy-effect"]
path = repos/alchemy-effect
[submodule "repos/alchemy-run/alchemy-effect"]
path = repos/alchemy-run/alchemy-effect
url = git@github.com:alchemy-run/alchemy-effect.git
[submodule "repos/vocs"]
path = repos/vocs
[submodule "repos/wevm/vocs"]
path = repos/wevm/vocs
url = git@github.com:wevm/vocs.git
[submodule "repos/changesets"]
path = repos/changesets
[submodule "repos/changesets/changesets"]
path = repos/changesets/changesets
url = git@github.com:changesets/changesets.git
[submodule "repos/waku"]
path = repos/waku
[submodule "repos/wakujs/waku"]
path = repos/wakujs/waku
url = git@github.com:wakujs/waku.git
2 changes: 0 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
"@types/react": "catalog:",
"@vitejs/plugin-react": "catalog:",
"alchemy": "catalog:",
"asciify-engine": "catalog:",
"effect": "catalog:",
"effect-workerd": "workspace:*",
"liminal": "workspace:*",
"liminal-util": "workspace:*",
"react": "catalog:",
Expand Down
10 changes: 5 additions & 5 deletions effect-workerd/Images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export interface Steps extends Pipeable.Pipeable {
}

export interface DrawOptions {
image: ReadableStream<Uint8Array> | ImageTransformer
options?: ImageDrawOptions | undefined
readonly image: ReadableStream<Uint8Array> | ImageTransformer
readonly options?: ImageDrawOptions | undefined
}

export type Step = Data.TaggedEnum<{
Transform: {
transform: ImageTransform
readonly Transform: {
readonly transform: ImageTransform
}
Draw: DrawOptions
readonly Draw: DrawOptions
}>

export const empty: Steps = {
Expand Down
2 changes: 1 addition & 1 deletion effect-workerd/Kv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as Binding from "./Binding.ts"
import type { Env } from "./Env.ts"

export interface KvDefinition {
readonly key: S.Top & { Encoded: string }
readonly key: S.Top & { readonly Encoded: string }

readonly value: S.Top

Expand Down
2 changes: 1 addition & 1 deletion effect-workerd/Vectorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface VectorizeDefinition {

readonly id: TopFromString

readonly metadata: Record<string, S.Top & { Encoded: string | number | boolean | Array<string> }>
readonly metadata: Record<string, S.Top & { readonly Encoded: string | number | boolean | Array<string> }>
}

export interface Vectorize<Self, Id extends string, D extends VectorizeDefinition> extends Context.Service<
Expand Down
2 changes: 1 addition & 1 deletion effect-workerd/asset_forwarding.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default {
fetch: (request: Request, env: { ASSETS: Fetcher }) => env.ASSETS.fetch(request),
fetch: (request: Request, env: { readonly ASSETS: Fetcher }) => env.ASSETS.fetch(request),
}
25 changes: 12 additions & 13 deletions effect-workerd/observability/OtlpProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,18 @@ export const layer = ({
),
)

export const layerFromConfig = () =>
Config.all({
endpoint: Config.string("OTEL_EXPORTER_OTLP_ENDPOINT"),
headers: Config.redacted("OTEL_EXPORTER_OTLP_HEADERS").pipe(Config.withDefault(Redacted.make(""))),
}).pipe(
Effect.map(({ endpoint, headers }) =>
layer({
endpoint,
headers: parseHeaders(Redacted.value(headers)),
}),
),
Layer.unwrap,
)
export const layerFromConfig = Config.all({
endpoint: Config.string("OTEL_EXPORTER_OTLP_ENDPOINT"),
headers: Config.redacted("OTEL_EXPORTER_OTLP_HEADERS").pipe(Config.withDefault(Redacted.make(""))),
}).pipe(
Effect.map(({ endpoint, headers }) =>
layer({
endpoint,
headers: parseHeaders(Redacted.value(headers)),
}),
),
Layer.unwrap,
)

const parseHeaders = (input: string): HeadersInit | undefined => {
const headers = new globalThis.Headers()
Expand Down
1 change: 0 additions & 1 deletion effect-workerd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
},
"peerDependencies": {
"@cloudflare/workers-types": "catalog:",
"@effect/ai-openai-compat": "catalog:",
"@effect/sql-d1": "catalog:",
"effect": "catalog:",
"liminal-util": "workspace:*"
Expand Down
1 change: 0 additions & 1 deletion examples/tictactoe/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"dependencies": {
"@cloudflare/vitest-pool-workers": "catalog:",
"@cloudflare/workers-types": "catalog:",
"@effect/sql-d1": "catalog:",
"alchemy": "catalog:",
"effect": "catalog:",
"effect-workerd": "workspace:*",
Expand Down
54 changes: 26 additions & 28 deletions examples/tictactoe/app/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,50 @@
// You should NOT make any changes in this file as it will be overwritten.
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.

import { Route as rootRouteImport } from './routes/__root'
import { Route as IndexRouteImport } from './routes/index'
import { Route as rootRouteImport } from "./routes/__root";
import { Route as IndexRouteImport } from "./routes/index";

const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
id: "/",
path: "/",
getParentRoute: () => rootRouteImport,
} as any)
} as any);

export interface FileRoutesByFullPath {
'/': typeof IndexRoute
"/": typeof IndexRoute;
}
export interface FileRoutesByTo {
'/': typeof IndexRoute
"/": typeof IndexRoute;
}
export interface FileRoutesById {
__root__: typeof rootRouteImport
'/': typeof IndexRoute
__root__: typeof rootRouteImport;
"/": typeof IndexRoute;
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/'
fileRoutesByTo: FileRoutesByTo
to: '/'
id: '__root__' | '/'
fileRoutesById: FileRoutesById
fileRoutesByFullPath: FileRoutesByFullPath;
fullPaths: "/";
fileRoutesByTo: FileRoutesByTo;
to: "/";
id: "__root__" | "/";
fileRoutesById: FileRoutesById;
}
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
IndexRoute: typeof IndexRoute;
}

declare module '@tanstack/react-router' {
declare module "@tanstack/react-router" {
interface FileRoutesByPath {
'/': {
id: '/'
path: '/'
fullPath: '/'
preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
"/": {
id: "/";
path: "/";
fullPath: "/";
preLoaderRoute: typeof IndexRouteImport;
parentRoute: typeof rootRouteImport;
};
}
}

const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
}
export const routeTree = rootRouteImport
._addFileChildren(rootRouteChildren)
._addFileTypes<FileRouteTypes>()
};
export const routeTree = rootRouteImport._addFileChildren(rootRouteChildren)._addFileTypes<FileRouteTypes>();
2 changes: 1 addition & 1 deletion examples/tictactoe/app/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export const router = createRouter({

declare module "@tanstack/react-router" {
interface Register {
router: typeof router
readonly router: typeof router
}
}
1 change: 0 additions & 1 deletion liminal-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"peerDependencies": {
"alchemy": "catalog:",
"effect": "catalog:",
"tailwindcss": "catalog:",
"vocs": "catalog:"
}
}
4 changes: 2 additions & 2 deletions liminal/ActorNamespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ export interface ActorNamespace<

export declare namespace ActorNamespace {
export type MakeRpc<Internal extends Methods, D extends ProtocolDefinition> = {
rpc: <K extends keyof Internal>(
readonly rpc: <K extends keyof Internal>(
method: K,
payload: Internal[K]["payload"]["Type"],
) => Promise<Exit.Exit<Internal[K]["success"]["Type"], Internal[K]["failure"]["Type"]>>

proxySendAll<K extends keyof D["events"]>(event: K, payload: S.Struct<D["events"][K]>["Type"]): void
readonly proxySendAll: <K extends keyof D["events"]>(event: K, payload: S.Struct<D["events"][K]>["Type"]) => void
}
}

Expand Down
2 changes: 1 addition & 1 deletion liminal/Audition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface Audition<AuditionSelf, State extends S.Union<ReadonlyArray<S.To

type MergeMethods<T extends Methods, U extends Methods> = [keyof T] extends [never]
? U
: { [K in keyof T & keyof U]: Types.Equals<T[K], U[K]> extends true ? T[K] : never }
: { readonly [K in keyof T & keyof U]: Types.Equals<T[K], U[K]> extends true ? T[K] : never }

type MergeState<State, D extends ProtocolDefinition> = [State] extends [never]
? S.Union<[S.Struct<D["state"]>]>
Expand Down
6 changes: 3 additions & 3 deletions liminal/ClientDirectory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ export interface ClientDirectory<
}

export interface HandleEncoders<T, AttachmentFields extends S.Struct.Fields, D extends ProtocolDefinition> {
attachments: (
readonly attachments: (
value: S.Struct<AttachmentFields>["Type"],
) => Effect.Effect<T, S.SchemaError, S.Struct<AttachmentFields>["EncodingServices"]>
event: (
readonly event: (
value: Protocol<D>["Event"]["Type"],
) => Effect.Effect<T, S.SchemaError, Protocol<D>["Event"]["EncodingServices"]>
disconnect: Effect.Effect<T, S.SchemaError, (typeof Disconnect)["EncodingServices"]>
readonly disconnect: Effect.Effect<T, S.SchemaError, (typeof Disconnect)["EncodingServices"]>
}

export const make = <
Expand Down
4 changes: 2 additions & 2 deletions liminal/Protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export interface Protocol<D extends ProtocolDefinition> {
readonly Failure: S.TaggedStruct<
"Audition.Failure",
{
expected: S.String
actual: S.String
readonly expected: S.String
readonly actual: S.String
}
>
}
Expand Down
2 changes: 1 addition & 1 deletion liminal/_util/phantom.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const phantom = {} as { "": never }
export const phantom = {} as { readonly "": never }
22 changes: 11 additions & 11 deletions liminal/experimental/Loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ export const layerFs = Layer.effect(
const path = yield* Path.Path
const fs = yield* FileSystem.FileSystem

const load = Effect.fnUntraced(function* (url: string) {
const { dir, name } = path.parse(new URL(url).pathname)
const templatePathname = path.join(dir, `${name}.md`)
if (yield* fs.exists(templatePathname).pipe(Effect.mapError(() => new LoaderError({ url })))) {
return yield* fs.readFileString(templatePathname).pipe(
Effect.map(Option.some),
Effect.mapError(() => new LoaderError({ url })),
)
}
return Option.none()
})
const load = Effect.fnUntraced(
function* (url: string) {
const { dir, name } = path.parse(new URL(url).pathname)
const templatePathname = path.join(dir, `${name}.md`)
if (yield* fs.exists(templatePathname)) {
return yield* fs.readFileString(templatePathname).pipe(Effect.map(Option.some))
}
return Option.none()
},
(effect, url) => Effect.mapError(effect, () => new LoaderError({ url })),
)

return { load }
}),
Expand Down
2 changes: 1 addition & 1 deletion liminal/experimental/TaggedTemplateFunction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Effect } from "effect"

export type TemplateStringsArrayLike = {
raw: ReadonlyArray<string> | ArrayLike<string>
readonly raw: ReadonlyArray<string> | ArrayLike<string>
}

type ExtractE<T> = [Extract<T, Effect.Effect<any, any, any>>] extends [never]
Expand Down
2 changes: 1 addition & 1 deletion liminal/experimental/Template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class TemplateMisalignedError extends Data.TaggedError("TemplateMisaligne
readonly keys: ReadonlyArray<string>
}> {}

export class NoSuchTemplateError extends Data.TaggedError("NoSuchTemplateError")<{ url: string }> {}
export class NoSuchTemplateError extends Data.TaggedError("NoSuchTemplateError")<{ readonly url: string }> {}

export interface TemplateClass<Self, Id extends string, A> extends Context.Service<Self, Template<A>> {
new (_: never): Context.ServiceClass.Shape<Id, Template<A>>
Expand Down
9 changes: 9 additions & 0 deletions oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "oxlint"

import { baseConfig, rest } from "./konfik/oxlint/baseConfig.ts"
import { defineReactConfig } from "./konfik/oxlint/defineReactConfig.ts"

export default defineConfig({
extends: [baseConfig, defineReactConfig(["examples/*/app/**/*"])],
...rest(),
})
Loading
Loading