diff --git a/.fallowrc.jsonc b/.fallowrc.jsonc index d8bd843..1990d1a 100644 --- a/.fallowrc.jsonc +++ b/.fallowrc.jsonc @@ -1,5 +1,5 @@ { - "extends": ["npm:@block65/shared-config/lib/fallow/fallow.jsonc"], + "extends": ["npm:@block65/shared-config/fallow.jsonc"], "entry": ["bin/index.ts", "oxfmt.config.ts", "oxlint.config.ts"], diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index eb34652..d5551f6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -36,3 +36,4 @@ jobs: - run: just fmt-check - run: just test - run: just dead-code + - run: just dupes diff --git a/__tests__/event-stream.test.ts b/__tests__/event-stream.test.ts index aa266b4..1ebe8a0 100644 --- a/__tests__/event-stream.test.ts +++ b/__tests__/event-stream.test.ts @@ -2,7 +2,7 @@ import type { oas32 } from "openapi3-ts"; import { describe, expect, test } from "vitest"; import { processOpenApiDocument } from "../lib/process-document.ts"; -function documentWith( +function buildEventStreamDocument( itemSchema: oas32.SchemaObject | oas32.ReferenceObject | undefined, schemas: Record = {}, ) { @@ -43,7 +43,7 @@ function jsonData(contentSchema: oas32.SchemaObject | oas32.ReferenceObject) { test("without an itemSchema, a plain command", async () => { const result = await processOpenApiDocument( "/tmp/whatever", - documentWith(undefined), + buildEventStreamDocument(undefined), ); expect(result.commandsFile.getText()).toMatchSnapshot("commands.ts"); @@ -58,7 +58,7 @@ test("without an itemSchema, a plain command", async () => { test("JSON data variants make the output a union", async () => { const result = await processOpenApiDocument( "/tmp/whatever", - documentWith( + buildEventStreamDocument( { oneOf: [ { @@ -105,7 +105,7 @@ test("JSON data variants make the output a union", async () => { test("data with no contentMediaType is text", async () => { const result = await processOpenApiDocument( "/tmp/whatever", - documentWith({ + buildEventStreamDocument({ type: "object", properties: { data: { type: "string" } }, }), @@ -171,13 +171,16 @@ describe("event-stream refusals", () => { ], ])("%s", async (_, itemSchema, message) => { await expect( - processOpenApiDocument("/tmp/whatever", documentWith(itemSchema)), + processOpenApiDocument( + "/tmp/whatever", + buildEventStreamDocument(itemSchema), + ), ).rejects.toThrow(message); }); }); test("an itemSchema in a document older than OAS 3.2 is refused", async () => { - const document = documentWith({ + const document = buildEventStreamDocument({ type: "object", properties: { data: { type: "string" } }, }); diff --git a/justfile b/justfile index dcbad38..6728df4 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,4 @@ -check: typecheck lint fmt-check test dead-code +check: typecheck lint fmt-check test dead-code dupes typecheck: pnpm exec oxlint --type-aware --type-check @@ -21,3 +21,6 @@ test: dead-code: pnpm exec fallow dead-code + +dupes: + pnpm exec fallow dupes diff --git a/package.json b/package.json index d7efdf4..667f409 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ }, "devDependencies": { "@block65/rest-client": "^16.0.0", - "@block65/shared-config": "^0.6.0", + "@block65/shared-config": "^0.7.0", "@block65/tsconfig": "^0.3.1", "@hono/standard-validator": "^0.4.0", "@types/node": "^26.6.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0b369ff..3f142dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -190,8 +190,8 @@ importers: specifier: ^16.0.0 version: 16.0.0(valibot@1.5.0(typescript@7.0.2)) '@block65/shared-config': - specifier: ^0.6.0 - version: 0.6.0(@block65/oxlint-tsgolint@7.0.200300)(@block65/oxlint@1.83.0(@block65/oxlint-tsgolint@7.0.200300))(eslint@10.11.0)(fallow@3.29.0)(oxfmt@0.70.0) + specifier: ^0.7.0 + version: 0.7.0(@block65/oxlint-tsgolint@7.0.200300)(@block65/oxlint@1.83.0(@block65/oxlint-tsgolint@7.0.200300))(eslint@10.11.0)(fallow@3.29.0)(oxfmt@0.70.0) '@block65/tsconfig': specifier: ^0.3.1 version: 0.3.1 @@ -266,8 +266,8 @@ packages: os: [linux] libc: [glibc] - '@block65/oxlint-plugin@0.12.1': - resolution: {integrity: sha512-hGPAZKw18lwLAkLKaPTw95vjuapJ4mx+YziblrgzHm8N5Lk/4Sv9a2kB3CQ7TC6PI6h+zTvZRaQgCD9A3X1z4w==} + '@block65/oxlint-plugin@0.13.0': + resolution: {integrity: sha512-lukVb4JzhaYauVZ+K1q/PVabjKXuS722gteWjbDDIkkoHs0+NFHYEGQacT9O0beHG8uqaisnMVpysNqdAYsQ3A==} engines: {node: '>=24'} peerDependencies: oxlint: ^1.83.0 @@ -307,8 +307,8 @@ packages: valibot: optional: true - '@block65/shared-config@0.6.0': - resolution: {integrity: sha512-CH3MENQRyzV7mwKzzkBBYpP1GbCb+rLGnnEMeuoCRTLMs9HLZNrngFWyMQrBljSQo4KD+sFrkfIjFW8HMQFjTQ==} + '@block65/shared-config@0.7.0': + resolution: {integrity: sha512-ikKxh+rjQE5W+rD+fXWj7t1aLMbf+mFNw+nBzRv6cUoXABbjLZOoHg3an5GR55pTrSFnICSa3fxX2RoaUiuIgg==} engines: {node: '>=24'} peerDependencies: fallow: ^3.27.0 @@ -1665,7 +1665,7 @@ snapshots: '@block65/oxlint-binding-linux-x64-gnu@1.83.0': optional: true - '@block65/oxlint-plugin@0.12.1(@block65/oxlint@1.83.0(@block65/oxlint-tsgolint@7.0.200300))(eslint@10.11.0)': + '@block65/oxlint-plugin@0.13.0(@block65/oxlint@1.83.0(@block65/oxlint-tsgolint@7.0.200300))(eslint@10.11.0)': dependencies: css-tree: 3.2.1 eslint-plugin-unicorn: 74.0.0(eslint@10.11.0) @@ -1700,9 +1700,9 @@ snapshots: optionalDependencies: valibot: 1.5.0(typescript@7.0.2) - '@block65/shared-config@0.6.0(@block65/oxlint-tsgolint@7.0.200300)(@block65/oxlint@1.83.0(@block65/oxlint-tsgolint@7.0.200300))(eslint@10.11.0)(fallow@3.29.0)(oxfmt@0.70.0)': + '@block65/shared-config@0.7.0(@block65/oxlint-tsgolint@7.0.200300)(@block65/oxlint@1.83.0(@block65/oxlint-tsgolint@7.0.200300))(eslint@10.11.0)(fallow@3.29.0)(oxfmt@0.70.0)': dependencies: - '@block65/oxlint-plugin': 0.12.1(@block65/oxlint@1.83.0(@block65/oxlint-tsgolint@7.0.200300))(eslint@10.11.0) + '@block65/oxlint-plugin': 0.13.0(@block65/oxlint@1.83.0(@block65/oxlint-tsgolint@7.0.200300))(eslint@10.11.0) optionalDependencies: fallow: 3.29.0 oxfmt: 0.70.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 85226a0..4ad806c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -6,8 +6,8 @@ minimumReleaseAgeExclude: - "@block65/oxlint-tsgolint-linux-x64@7.0.200300" - "@block65/oxlint-tsgolint@7.0.200300" - "@block65/oxlint@1.83.0" - - "@block65/oxlint-plugin@0.12.1" - - "@block65/shared-config@0.6.0" + - "@block65/shared-config@0.7.0" + - "@block65/oxlint-plugin@0.13.0" - "@block65/rest-client@16.0.0" overrides: