Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(extension-system): introduce configuration resolvers #1314

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
fb7fe41
feat(extension-system): introduce configuration resolvers
jasonkuhrt Jan 15, 2025
4c168e5
wip
jasonkuhrt Jan 15, 2025
c4b1d16
fix types
jasonkuhrt Jan 16, 2025
60bfb0d
wip
jasonkuhrt Jan 18, 2025
b83a3d0
optimize types
jasonkuhrt Jan 18, 2025
cb6b83b
construcotr and properties on new ext sys
jasonkuhrt Jan 23, 2025
3378db3
thing
jasonkuhrt Jan 23, 2025
2dfdfef
work
jasonkuhrt Jan 24, 2025
0fc28d5
work
jasonkuhrt Jan 24, 2025
80ebe44
work
jasonkuhrt Jan 26, 2025
d486b1b
configurator always having input resolver
jasonkuhrt Jan 26, 2025
abdbc4b
simplify context type
jasonkuhrt Jan 26, 2025
f676625
implement client with method
jasonkuhrt Jan 26, 2025
d0ae656
begin some tests
jasonkuhrt Jan 26, 2025
68aa25a
get tests passing
jasonkuhrt Jan 26, 2025
66f4eba
optimize
jasonkuhrt Jan 27, 2025
5ca365e
scalar
jasonkuhrt Jan 27, 2025
9b9de86
begin scalar tests
jasonkuhrt Jan 27, 2025
eed8c86
more scalar method tests
jasonkuhrt Jan 28, 2025
0029202
refactor
jasonkuhrt Jan 28, 2025
12f0e53
get transport passing
jasonkuhrt Jan 29, 2025
2a4cce1
more transport tests
jasonkuhrt Jan 29, 2025
e799009
bring transport select overload
jasonkuhrt Jan 30, 2025
5c13564
all other transport overloads and tested
jasonkuhrt Jan 30, 2025
fcf0aeb
eadonly stuff
jasonkuhrt Jan 31, 2025
3cedf65
begin testing extension
jasonkuhrt Feb 1, 2025
fb9ae52
delete me
jasonkuhrt Feb 1, 2025
1a8c9e5
add test coverage for request interceptor
jasonkuhrt Feb 2, 2025
fa51c50
ext req inter
jasonkuhrt Feb 2, 2025
20d0b74
introduce context fragment concept
jasonkuhrt Feb 2, 2025
993f3e7
fragmentify all
jasonkuhrt Feb 2, 2025
5264bd4
non-hkt computed properties
jasonkuhrt Feb 2, 2025
3ee66ab
extensions add computed properties
jasonkuhrt Feb 3, 2025
6148076
type level computed properties
jasonkuhrt Feb 4, 2025
d0d351c
bringing computed properties type functions to extensions
jasonkuhrt Feb 4, 2025
dd72ce0
extensions test computed properties type level
jasonkuhrt Feb 5, 2025
007ffd5
dirs
jasonkuhrt Feb 5, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { interceptAndShowUncaughtErrors, show } from '../$/show.js'

interceptAndShowUncaughtErrors()

const pokemon = Graffle.create().use(Introspection())
const pokemon = Graffle.create().use(Introspection)

const data = await pokemon.introspect()
show(data)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"./generator": {
"default": "./build/entrypoints/generator.js"
},
"./extensionkit": {
"default": "./build/entrypoints/extensionkit.js"
"./extension": {
"default": "./build/entrypoints/extension.js"
},
"./extensions/upload": {
"default": "./build/entrypoints/extensions/upload/runtime.js"
Expand Down
107 changes: 0 additions & 107 deletions src/client/Configuration/ConfigInit.ts

This file was deleted.

88 changes: 0 additions & 88 deletions src/client/Configuration/Output.ts

This file was deleted.

27 changes: 27 additions & 0 deletions src/client/client.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { expect, expectTypeOf, test } from 'vitest'
import { Context } from '../types/context.js'
import { create } from './client.js'

test(`created WITHOUT configuration uses the default configuration`, () => {
const g = create()
expect(g._).toBe(Context.States.empty)
expect(g._.configuration.check.current.preflight).toBe(true)
// Trying to type-test the entire context crashes the TS LSP.
// We check just one property and assume the rest are ok too.
expectTypeOf(g._.configuration).toMatchTypeOf<Context.States.Empty['configuration']>()
expectTypeOf(g._.configuration.check.current.preflight).toEqualTypeOf<true>()
// TODO: investigate why we cannot use the strict "toEqualTypeOf". According to the following it should work. Make an issue on Vitest?
// let a = null as any as Context.States.Empty['configurationIndex']
// let b = g._.configurationIndex
// a = b
// b = a
})

test(`created WITH configuration changes the configuration`, () => {
const g = create({ check: { preflight: false } })
expect(g._.configuration.check.current.preflight).toBe(false)
expectTypeOf(g._.configuration.check.current.preflight).toEqualTypeOf<false>()
// Did NOT mutate the original context
expect(g._).not.toBe(Context.States.empty)
expect(Context.States.empty.configuration.check.current.preflight).toBe(true)
})
Loading
Loading