From 387e38b15756a988fb81fb40549279e1b9656c1e Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Fri, 16 Oct 2026 03:28:57 +0000 Subject: [PATCH] test(site): generate schema laws for every exported schema effect-schema-law and effect-schema-vite sat in the catalog with no importer. The site's vitest config now runs inlineSchemaTests(), which discovers every exported schema under apps/site/src and registers its round-trip and encode-stability laws in src/schema-laws.test.ts: 37 laws over 20 schemas. No schema failed a law. Judgment surface: apps/site/vitest.config.ts gains only the plugin. Owner-directed (CONST-W3 declaration). Follows the schema-laws pack. --- apps/site/package.json | 2 + apps/site/src/schema-laws.test.ts | 1 + apps/site/vitest.config.ts | 2 + pnpm-lock.yaml | 61 +++++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 apps/site/src/schema-laws.test.ts diff --git a/apps/site/package.json b/apps/site/package.json index 5f2ccc85..7fb8020b 100644 --- a/apps/site/package.json +++ b/apps/site/package.json @@ -20,6 +20,8 @@ "@cloudflare/workers-types": "catalog:", "@rolldown/plugin-babel": "catalog:", "@systemfsoftware/effect-gherkin-spec": "catalog:", + "@systemfsoftware/effect-schema-law": "catalog:", + "@systemfsoftware/effect-schema-vite": "catalog:", "@systemfsoftware/oxlint-config-recommended": "catalog:", "@systemfsoftware/stryker-ignorer-effect-schema-declarations": "catalog:", "@systemfsoftware/stryker-js": "catalog:", diff --git a/apps/site/src/schema-laws.test.ts b/apps/site/src/schema-laws.test.ts new file mode 100644 index 00000000..336ce12b --- /dev/null +++ b/apps/site/src/schema-laws.test.ts @@ -0,0 +1 @@ +export {} diff --git a/apps/site/vitest.config.ts b/apps/site/vitest.config.ts index cc0be6c4..4e3c245d 100644 --- a/apps/site/vitest.config.ts +++ b/apps/site/vitest.config.ts @@ -1,6 +1,8 @@ +import { inlineSchemaTests } from '@systemfsoftware/effect-schema-vite' import { defineConfig } from 'vitest/config' export default defineConfig({ + plugins: [inlineSchemaTests()], test: { globals: true, environment: 'node', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ab732d7b..a64a56bc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -393,6 +393,12 @@ importers: '@systemfsoftware/effect-gherkin-spec': specifier: file:../../.sfs-deps/effect-gherkin-spec-7.0.1.tgz version: file:.sfs-deps/effect-gherkin-spec-7.0.1.tgz(@systemfsoftware/vitest@file:.sfs-deps/vitest-2.0.0.tgz(effect@4.0.1)(redis@6.2.1(@opentelemetry/api@1.9.1))(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))))(effect@4.0.1)(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))) + '@systemfsoftware/effect-schema-law': + specifier: file:../../.sfs-deps/effect-schema-law-5.0.1.tgz + version: file:.sfs-deps/effect-schema-law-5.0.1.tgz(@systemfsoftware/vitest@file:.sfs-deps/vitest-2.0.0.tgz(effect@4.0.1)(redis@6.2.1(@opentelemetry/api@1.9.1))(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))))(effect@4.0.1)(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))) + '@systemfsoftware/effect-schema-vite': + specifier: file:../../.sfs-deps/effect-schema-vite-3.0.1.tgz + version: file:.sfs-deps/effect-schema-vite-3.0.1.tgz(@systemfsoftware/effect-schema-law@file:.sfs-deps/effect-schema-law-5.0.1.tgz(@systemfsoftware/vitest@file:.sfs-deps/vitest-2.0.0.tgz(effect@4.0.1)(redis@6.2.1(@opentelemetry/api@1.9.1))(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))))(effect@4.0.1)(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))))(effect@4.0.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))) '@systemfsoftware/oxlint-config-recommended': specifier: file:../../.sfs-deps/oxlint-config-recommended-4.0.0.tgz version: file:.sfs-deps/oxlint-config-recommended-4.0.0.tgz(effect@4.0.1)(oxlint-tsgolint@7.0.2001)(oxlint@1.82.0(oxlint-tsgolint@7.0.2001))(typescript@7.0.2) @@ -2719,6 +2725,33 @@ packages: effect: ^4 vitest: ^5 + '@systemfsoftware/effect-schema-discovery@file:.sfs-deps/effect-schema-discovery-2.0.0.tgz': + resolution: {integrity: sha512-Mlod6zaKFZ4FVRaRBSJ9++3tyYkBxEFCRml0lGgWe6xKFxEZ9x+MjFm8PMfU5qRV1+39A9wBs+V1TDGdVklmDA==, tarball: file:.sfs-deps/effect-schema-discovery-2.0.0.tgz} + version: 2.0.0 + + '@systemfsoftware/effect-schema-law@file:.sfs-deps/effect-schema-law-5.0.1.tgz': + resolution: {integrity: sha512-Xgwf5kFdTNBIvWptua1Q1qnFWARx7HHon6dI3LBCcTnxzSudKh6hwafbT4RYL9eJPP0W5pjRS2/nDnoSxWbyDw==, tarball: file:.sfs-deps/effect-schema-law-5.0.1.tgz} + version: 5.0.1 + peerDependencies: + '@systemfsoftware/vitest': ^2.0.0 + effect: ^4 + vitest: ^5 + + '@systemfsoftware/effect-schema-recursion-budget@file:.sfs-deps/effect-schema-recursion-budget-2.0.0.tgz': + resolution: {integrity: sha512-txecn8NzPp1RSG2HL+02hKfqeBu5+EsE/O9g/JQOYD69AAppVPAD6PpqtuI8w6DawKiqDnnikpCBHwSLwjyJ3g==, tarball: file:.sfs-deps/effect-schema-recursion-budget-2.0.0.tgz} + version: 2.0.0 + peerDependencies: + effect: ^4 + + '@systemfsoftware/effect-schema-vite@file:.sfs-deps/effect-schema-vite-3.0.1.tgz': + resolution: {integrity: sha512-WYrP0Y7l2662cVmDziJElk+yHFr/AaMgKYDhcmmXvc7dCHNpDMiKqxs6+DxSTUyUH9difNikEZZmxPwjiBI9UQ==, tarball: file:.sfs-deps/effect-schema-vite-3.0.1.tgz} + version: 3.0.1 + peerDependencies: + '@systemfsoftware/effect-schema-law': 5.0.1 + effect: ^4 + vite: '>5.0.0' + vitest: ^5 + '@systemfsoftware/effect-sim-kernel@file:.sfs-deps/effect-sim-kernel-1.0.0.tgz': resolution: {integrity: sha512-B4z4wxtI8EIpFIg3K3VIBqfhIELg8JNX1j21htt0c6H8KagiAE9nY90fgzrSK52Ot8nR3wfNHXLNVyk63j7F8g==, tarball: file:.sfs-deps/effect-sim-kernel-1.0.0.tgz} version: 1.0.0 @@ -6161,6 +6194,34 @@ snapshots: effect: 4.0.1 vitest: 5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1)) + '@systemfsoftware/effect-schema-discovery@file:.sfs-deps/effect-schema-discovery-2.0.0.tgz': + dependencies: + '@oxc-project/types': 0.150.0 + oxc-parser: 0.150.0 + + '@systemfsoftware/effect-schema-law@file:.sfs-deps/effect-schema-law-5.0.1.tgz(@systemfsoftware/vitest@file:.sfs-deps/vitest-2.0.0.tgz(effect@4.0.1)(redis@6.2.1(@opentelemetry/api@1.9.1))(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))))(effect@4.0.1)(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1)))': + dependencies: + '@systemfsoftware/vitest': file:.sfs-deps/vitest-2.0.0.tgz(effect@4.0.1)(redis@6.2.1(@opentelemetry/api@1.9.1))(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))) + effect: 4.0.1 + vitest: 5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1)) + + '@systemfsoftware/effect-schema-recursion-budget@file:.sfs-deps/effect-schema-recursion-budget-2.0.0.tgz(effect@4.0.1)': + dependencies: + '@oxc-project/types': 0.150.0 + effect: 4.0.1 + oxc-parser: 0.150.0 + + '@systemfsoftware/effect-schema-vite@file:.sfs-deps/effect-schema-vite-3.0.1.tgz(@systemfsoftware/effect-schema-law@file:.sfs-deps/effect-schema-law-5.0.1.tgz(@systemfsoftware/vitest@file:.sfs-deps/vitest-2.0.0.tgz(effect@4.0.1)(redis@6.2.1(@opentelemetry/api@1.9.1))(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))))(effect@4.0.1)(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))))(effect@4.0.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1)))': + dependencies: + '@oxc-project/types': 0.150.0 + '@systemfsoftware/effect-schema-discovery': file:.sfs-deps/effect-schema-discovery-2.0.0.tgz + '@systemfsoftware/effect-schema-law': file:.sfs-deps/effect-schema-law-5.0.1.tgz(@systemfsoftware/vitest@file:.sfs-deps/vitest-2.0.0.tgz(effect@4.0.1)(redis@6.2.1(@opentelemetry/api@1.9.1))(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))))(effect@4.0.1)(vitest@5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1))) + '@systemfsoftware/effect-schema-recursion-budget': file:.sfs-deps/effect-schema-recursion-budget-2.0.0.tgz(effect@4.0.1) + effect: 4.0.1 + oxc-parser: 0.150.0 + vite: 8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1) + vitest: 5.0.3(@opentelemetry/api@1.9.1)(@types/node@24.19.1)(vite@8.3.2(@types/node@24.19.1)(esbuild@0.28.2)(jiti@2.6.1)(yaml@2.9.1)) + '@systemfsoftware/effect-sim-kernel@file:.sfs-deps/effect-sim-kernel-1.0.0.tgz(effect@4.0.1)': dependencies: effect: 4.0.1