Repository navigation
chore: modernise tooling - #7
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the repo onto current tooling.
lib/behaviour is unchanged apart from one edge:Api.ofnow throws aTypeErrorwhere it used to return a root that is not anApi.@block65/shared-config), oxfmt and justyaml,type-festandjson-schema-to-typescriptdroppedanyand@ts-expect-errorreplaced with real types@hyperjump/json-schemaagainst the official 3.1schema-base, replacing swagger-parser and ajvjust check;deploy.ymlstages publishes withpnpm stage publishjust checkpasses: typecheck, lint (0 diagnostics), fmt-check, tests and fallow. Snapshots are unchanged.