Skip to content

chore: modernise tooling - #7

Merged
maxholman merged 9 commits into
block65:masterfrom
maxholman:chore/modernise
Sep 23, 2026
Merged

maxholman merged 9 commits into
block65:masterfrom
maxholman:chore/modernise

Conversation

@maxholman

@maxholman maxholman Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Brings the repo onto current tooling. lib/ behaviour is unchanged apart from one edge: Api.of now throws a TypeError where it used to return a root that is not an Api.

  • eslint, prettier and make replaced by oxlint (with @block65/shared-config), oxfmt and just
  • every dependency updated to latest; the unused yaml, type-fest and json-schema-to-typescript dropped
  • type assertions, any and @ts-expect-error replaced with real types
  • OpenAPI output validated with @hyperjump/json-schema against the official 3.1 schema-base, replacing swagger-parser and ajv
  • CI runs just check; deploy.yml stages publishes with pnpm stage publish

just check passes: typecheck, lint (0 diagnostics), fmt-check, tests and fallow. Snapshots are unchanged.

maxholman and others added 9 commits September 23, 2026 17:06
Takes the layout and tooling from rest-client: @block65/shared-config 0.5.0
for the oxlint, oxfmt and fallow configs, @block65/tsconfig for the compiler
options, a justfile in place of the Makefile, and CI that runs the gate
through just. deploy.yml stages the publish for review with pnpm stage.

Every dependency moves to its latest release. yaml, type-fest and
json-schema-to-typescript are dropped, since nothing imports them. vite 8 is
pinned because vitest 5 otherwise resolves vite 7, which fails on the null
entries the shared tsconfig uses.

Co-Authored-By: LLM <noreply@maxholman.dev>
Co-Authored-By: LLM <noreply@maxholman.dev>
Co-Authored-By: LLM <noreply@maxholman.dev>
No behaviour change: the snapshots of both fixture APIs are untouched.
ApiLowLevel.ts becomes api-low-level.ts for filename-case, data-only
interfaces become type aliases, and the eslint disables either go, being
unused, or become oxlint disables with a reason. explode is compared with
undefined rather than loosely with null, which its boolean type already
limits it to.

Co-Authored-By: LLM <noreply@maxholman.dev>
The commented-out fixtures go, and the regression test asserts that the
allOf schema constructs without throwing, which it only implied before.

Co-Authored-By: LLM <noreply@maxholman.dev>
Constructs are found through node.children and a type guard, so synth and
friends read as unused. The Header and Parameter synth() clone stays, since
the two emit explode and required differently.

Co-Authored-By: LLM <noreply@maxholman.dev>
Api builds on RootConstruct, which types the scopeless root, so the
undefined as any goes. ApiLowLevel.of finds the root through node.root and
narrows it with instanceof against the class it is called on, so Api.of
still returns an Api and throws a TypeError where the root is something
else. Operation.synth spreads each optional field in like the other
constructs, which retires stripUndefined and its cast. InferExample falls
back to unknown.

In the tests, the negative parameter cases use expectTypeOf().not, and
swagger-parser validates the emitted JSON from a file, since the openapi3-ts
and openapi-types document types disagree on server variable defaults.

Co-Authored-By: LLM <noreply@maxholman.dev>
…arser

@apidevtools/swagger-parser goes. ajv's 2020 validator checks each
synthesised document against the vendored OpenAPI 3.1 schema, and a document
with an unknown top-level key must fail it. ajv mis-resolves the schema's
$dynamicRef to #meta, so the four of them are patched to a $ref to
$defs/schema, which holds the only meta anchor. The $comment records it.

Co-Authored-By: LLM <noreply@maxholman.dev>
The OpenAPI documents are validated against the official 3.1 schema-base,
which also checks every Schema Object against the OpenAPI dialect, so the
vendored schema and its $dynamicRef patch go. The JSON Schemas are validated
against the dialect their $schema declares. Each suite also checks that an
invalid document is rejected. ajv is no longer a devDependency.

Co-Authored-By: LLM <noreply@maxholman.dev>
@maxholman
maxholman merged commit ef22473 into block65:master Sep 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant