specproof 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +69 -0
- package/.github/workflows/release.yml +1 -2
- package/CHANGELOG.md +19 -0
- package/CLAUDE.md +17 -7
- package/README.md +2 -0
- package/app/proof.generated.json +286 -5
- package/components/CoverageProof.tsx +1 -1
- package/eslint.config.mjs +1 -1
- package/example/api/openapi.json +88 -0
- package/example/tests/auth.test.ts +25 -0
- package/example/tests/client.ts +53 -0
- package/example/tests/tasks.test.ts +83 -0
- package/lib/api-test-coverage.test.ts +423 -0
- package/lib/api-test-coverage.ts +10 -10
- package/marketing/index.html +1083 -0
- package/marketing/package.json +10 -0
- package/marketing/server.ts +27 -0
- package/package.json +1 -1
- package/public/banner.png +0 -0
- package/public/icon.png +0 -0
- package/public/logo.png +0 -0
- package/tsconfig.json +3 -1
- package/vitest.config.ts +2 -1
- package/.github/workflows/test-unit.yml +0 -36
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const port = Number(process.env.PORT) || 3002;
|
|
2
|
+
const root = new URL('./', import.meta.url).pathname;
|
|
3
|
+
|
|
4
|
+
const MIME: Record<string, string> = {
|
|
5
|
+
'.html': 'text/html; charset=utf-8',
|
|
6
|
+
'.css': 'text/css; charset=utf-8',
|
|
7
|
+
'.js': 'text/javascript; charset=utf-8',
|
|
8
|
+
'.png': 'image/png',
|
|
9
|
+
'.jpg': 'image/jpeg',
|
|
10
|
+
'.jpeg': 'image/jpeg',
|
|
11
|
+
'.svg': 'image/svg+xml',
|
|
12
|
+
'.ico': 'image/x-icon'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
Bun.serve({
|
|
16
|
+
port,
|
|
17
|
+
async fetch(req) {
|
|
18
|
+
const url = new URL(req.url);
|
|
19
|
+
const pathname = url.pathname === '/' ? '/index.html' : url.pathname;
|
|
20
|
+
const file = Bun.file(root + pathname.slice(1));
|
|
21
|
+
if (!(await file.exists())) return new Response('Not found', { status: 404 });
|
|
22
|
+
const ext = pathname.slice(pathname.lastIndexOf('.'));
|
|
23
|
+
return new Response(file, { headers: { 'Content-Type': MIME[ext] ?? 'application/octet-stream' } });
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
console.log(`SpecProof marketing site → http://localhost:${port}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specproof",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Audit view of a repo's API test coverage: every OpenAPI operation and response status, cross-examined against the repo's test assertions.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "github:Durable-Quality/specproof",
|
|
Binary file
|
package/public/icon.png
ADDED
|
Binary file
|
package/public/logo.png
ADDED
|
Binary file
|
package/tsconfig.json
CHANGED
package/vitest.config.ts
CHANGED
|
@@ -13,6 +13,7 @@ export default defineConfig({
|
|
|
13
13
|
test: {
|
|
14
14
|
environment: "node",
|
|
15
15
|
include: ["**/*.test.ts"],
|
|
16
|
-
|
|
16
|
+
// example/ holds fixture tests for the analyzer to parse — never run them
|
|
17
|
+
exclude: ["node_modules/**", ".next/**", "example/**"],
|
|
17
18
|
},
|
|
18
19
|
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
name: 🧾 Proof Contract Tests
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: main
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: main
|
|
8
|
-
workflow_dispatch:
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
test-unit:
|
|
12
|
-
name: 🧾 Run proof contract tests
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
|
|
15
|
-
env:
|
|
16
|
-
NODE_ENV: test
|
|
17
|
-
|
|
18
|
-
steps:
|
|
19
|
-
- name: 📥 Checkout code
|
|
20
|
-
uses: actions/checkout@v5
|
|
21
|
-
|
|
22
|
-
- name: 🍞 Setup Bun
|
|
23
|
-
uses: oven-sh/setup-bun@v2
|
|
24
|
-
with:
|
|
25
|
-
bun-version: latest
|
|
26
|
-
|
|
27
|
-
- name: 🧰 Install dependencies
|
|
28
|
-
run: bun install
|
|
29
|
-
|
|
30
|
-
# The contract tests self-skip when no audited repo is configured.
|
|
31
|
-
# To guard a specific target in CI, check it out here and set
|
|
32
|
-
# SPECPROOF_REPO (and optionally SPECPROOF_SPEC) on the test step.
|
|
33
|
-
- name: 🧾 Run contract tests
|
|
34
|
-
run: bun run test:unit
|
|
35
|
-
env:
|
|
36
|
-
NODE_ENV: test
|