chore: generate
This commit is contained in:
parent
9b8e356fca
commit
c939aa04fe
4 changed files with 87 additions and 85 deletions
|
|
@ -19,23 +19,26 @@ class NetworkError {
|
||||||
}
|
}
|
||||||
|
|
||||||
const aImplementation = Layer.succeed(A, A.of({ value: "a" }))
|
const aImplementation = Layer.succeed(A, A.of({ value: "a" }))
|
||||||
const bImplementation = Layer.effect(B, Effect.gen(function* () {
|
const bImplementation = Layer.effect(
|
||||||
yield* A
|
B,
|
||||||
return B.of({ value: "b" })
|
Effect.gen(function* () {
|
||||||
}))
|
yield* A
|
||||||
const cImplementation = Layer.effect(C, Effect.gen(function* () {
|
return B.of({ value: "b" })
|
||||||
yield* A
|
}),
|
||||||
yield* B
|
)
|
||||||
return C.of({ value: "c" })
|
const cImplementation = Layer.effect(
|
||||||
}))
|
C,
|
||||||
|
Effect.gen(function* () {
|
||||||
|
yield* A
|
||||||
|
yield* B
|
||||||
|
return C.of({ value: "c" })
|
||||||
|
}),
|
||||||
|
)
|
||||||
const failingAImplementation = Layer.effect(A, Effect.fail(new LayerError()))
|
const failingAImplementation = Layer.effect(A, Effect.fail(new LayerError()))
|
||||||
const notFoundAImplementation = Layer.effect(A, Effect.fail(new NotFoundError()))
|
const notFoundAImplementation = Layer.effect(A, Effect.fail(new NotFoundError()))
|
||||||
const diskAImplementation = Layer.effect(A, Effect.fail(new DiskError()))
|
const diskAImplementation = Layer.effect(A, Effect.fail(new DiskError()))
|
||||||
const networkAImplementation = Layer.effect(A, Effect.fail(new NetworkError()))
|
const networkAImplementation = Layer.effect(A, Effect.fail(new NetworkError()))
|
||||||
const notFoundOrDiskAImplementation = Layer.effect(
|
const notFoundOrDiskAImplementation = Layer.effect(A, Effect.fail(new NotFoundError() as NotFoundError | DiskError))
|
||||||
A,
|
|
||||||
Effect.fail(new NotFoundError() as NotFoundError | DiskError),
|
|
||||||
)
|
|
||||||
|
|
||||||
type Equal<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false
|
type Equal<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false
|
||||||
type Assert<T extends true> = T
|
type Assert<T extends true> = T
|
||||||
|
|
|
||||||
|
|
@ -141,10 +141,7 @@ describe("app graph", () => {
|
||||||
class ReplacementConfig extends Context.Service<ReplacementConfig, { readonly value: string }>()(
|
class ReplacementConfig extends Context.Service<ReplacementConfig, { readonly value: string }>()(
|
||||||
"test/ReplacementConfig",
|
"test/ReplacementConfig",
|
||||||
) {}
|
) {}
|
||||||
const replacementConfig = node(
|
const replacementConfig = node(Layer.succeed(ReplacementConfig, ReplacementConfig.of({ value: "replacement" })), [])
|
||||||
Layer.succeed(ReplacementConfig, ReplacementConfig.of({ value: "replacement" })),
|
|
||||||
[],
|
|
||||||
)
|
|
||||||
const replacement = node(
|
const replacement = node(
|
||||||
Layer.effect(
|
Layer.effect(
|
||||||
Value,
|
Value,
|
||||||
|
|
@ -175,7 +172,9 @@ describe("app graph", () => {
|
||||||
[],
|
[],
|
||||||
)
|
)
|
||||||
|
|
||||||
await Effect.runPromise(Effect.provide(Greeting, build(greeting, { replacements: [replace(unreachable, replacement)] })))
|
await Effect.runPromise(
|
||||||
|
Effect.provide(Greeting, build(greeting, { replacements: [replace(unreachable, replacement)] })),
|
||||||
|
)
|
||||||
|
|
||||||
expect(acquisitions).toBe(0)
|
expect(acquisitions).toBe(0)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -79,13 +79,13 @@ export type Event =
|
||||||
| EventCommandExecuted
|
| EventCommandExecuted
|
||||||
| EventProjectDirectoriesUpdated
|
| EventProjectDirectoriesUpdated
|
||||||
| EventProjectUpdated
|
| EventProjectUpdated
|
||||||
|
| EventVcsBranchUpdated
|
||||||
| EventQuestionAsked
|
| EventQuestionAsked
|
||||||
| EventQuestionReplied
|
| EventQuestionReplied
|
||||||
| EventQuestionRejected
|
| EventQuestionRejected
|
||||||
| EventSessionStatus
|
| EventSessionStatus
|
||||||
| EventSessionIdle
|
| EventSessionIdle
|
||||||
| EventSessionCompacted
|
| EventSessionCompacted
|
||||||
| EventVcsBranchUpdated
|
|
||||||
| EventWorktreeReady
|
| EventWorktreeReady
|
||||||
| EventWorktreeFailed
|
| EventWorktreeFailed
|
||||||
| EventWorkspaceReady
|
| EventWorkspaceReady
|
||||||
|
|
@ -1522,6 +1522,13 @@ export type GlobalEvent = {
|
||||||
sandboxes: Array<string>
|
sandboxes: Array<string>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
| {
|
||||||
|
id: string
|
||||||
|
type: "vcs.branch.updated"
|
||||||
|
properties: {
|
||||||
|
branch?: string
|
||||||
|
}
|
||||||
|
}
|
||||||
| {
|
| {
|
||||||
id: string
|
id: string
|
||||||
type: "question.asked"
|
type: "question.asked"
|
||||||
|
|
@ -1574,13 +1581,6 @@ export type GlobalEvent = {
|
||||||
sessionID: string
|
sessionID: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
| {
|
|
||||||
id: string
|
|
||||||
type: "vcs.branch.updated"
|
|
||||||
properties: {
|
|
||||||
branch?: string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
| {
|
| {
|
||||||
id: string
|
id: string
|
||||||
type: "worktree.ready"
|
type: "worktree.ready"
|
||||||
|
|
@ -5103,6 +5103,14 @@ export type EventProjectUpdated = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type EventVcsBranchUpdated = {
|
||||||
|
id: string
|
||||||
|
type: "vcs.branch.updated"
|
||||||
|
properties: {
|
||||||
|
branch?: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export type EventQuestionAsked = {
|
export type EventQuestionAsked = {
|
||||||
id: string
|
id: string
|
||||||
type: "question.asked"
|
type: "question.asked"
|
||||||
|
|
@ -5161,14 +5169,6 @@ export type EventSessionCompacted = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type EventVcsBranchUpdated = {
|
|
||||||
id: string
|
|
||||||
type: "vcs.branch.updated"
|
|
||||||
properties: {
|
|
||||||
branch?: string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type EventWorktreeReady = {
|
export type EventWorktreeReady = {
|
||||||
id: string
|
id: string
|
||||||
type: "worktree.ready"
|
type: "worktree.ready"
|
||||||
|
|
|
||||||
|
|
@ -12481,6 +12481,9 @@
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventProjectUpdated"
|
"$ref": "#/components/schemas/EventProjectUpdated"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/EventVcsBranchUpdated"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventQuestionAsked"
|
"$ref": "#/components/schemas/EventQuestionAsked"
|
||||||
},
|
},
|
||||||
|
|
@ -12499,9 +12502,6 @@
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventSessionCompacted"
|
"$ref": "#/components/schemas/EventSessionCompacted"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/EventVcsBranchUpdated"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventWorktreeReady"
|
"$ref": "#/components/schemas/EventWorktreeReady"
|
||||||
},
|
},
|
||||||
|
|
@ -17104,6 +17104,30 @@
|
||||||
"required": ["id", "type", "properties"],
|
"required": ["id", "type", "properties"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^evt_"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["vcs.branch.updated"]
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"branch": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["id", "type", "properties"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -17291,30 +17315,6 @@
|
||||||
"required": ["id", "type", "properties"],
|
"required": ["id", "type", "properties"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "string",
|
|
||||||
"pattern": "^evt_"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["vcs.branch.updated"]
|
|
||||||
},
|
|
||||||
"properties": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"branch": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["id", "type", "properties"],
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -28341,6 +28341,30 @@
|
||||||
"required": ["id", "type", "properties"],
|
"required": ["id", "type", "properties"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"EventVcsBranchUpdated": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^evt_"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["vcs.branch.updated"]
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"branch": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["id", "type", "properties"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"EventQuestionAsked": {
|
"EventQuestionAsked": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -28528,30 +28552,6 @@
|
||||||
"required": ["id", "type", "properties"],
|
"required": ["id", "type", "properties"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"EventVcsBranchUpdated": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "string",
|
|
||||||
"pattern": "^evt_"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["vcs.branch.updated"]
|
|
||||||
},
|
|
||||||
"properties": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"branch": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["id", "type", "properties"],
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
"EventWorktreeReady": {
|
"EventWorktreeReady": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue