/ PLAYBOOK.scm
PLAYBOOK.scm
 1  ;; SPDX-License-Identifier: AGPL-3.0-or-later
 2  ;; SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell
 3  ;; PLAYBOOK.scm — deno-bunbridge
 4  
 5  (define-module (deno-bunbridge playbook)
 6    #:export (workflows runbooks procedures))
 7  
 8  (define workflows
 9    '((development
10       (setup
11        (steps
12         ("Clone repository" . "git clone https://github.com/hyperpolymath/deno-bunbridge")
13         ("Enter directory" . "cd deno-bunbridge")
14         ("Run tests" . "deno test")
15         ("Format code" . "deno fmt")
16         ("Lint code" . "deno lint")))
17       (daily
18        (steps
19         ("Pull latest" . "git pull origin main")
20         ("Run tests" . "deno test")
21         ("Check types" . "deno check src/mod.ts"))))
22  
23      (release
24       (prepare
25        (steps
26         ("Update version in deno.json" . "manual")
27         ("Update CHANGELOG.adoc" . "manual")
28         ("Run full test suite" . "deno test --coverage")
29         ("Build docs" . "deno doc src/mod.ts")))
30       (publish
31        (steps
32         ("Create git tag" . "git tag vX.Y.Z")
33         ("Push with tags" . "git push origin main --tags")
34         ("Publish to JSR" . "deno publish"))))))
35  
36  (define runbooks
37    '((incident-response
38       (api-incompatibility
39        (symptoms . ("Type errors on Bun API calls" "Runtime exceptions"))
40        (diagnosis . ("Check Bun version compatibility" "Review API changelog"))
41        (resolution . ("Update type definitions" "Add version-specific shims"))
42        (prevention . ("Pin Bun version in CI" "Add compatibility tests")))
43  
44       (performance-regression
45        (symptoms . ("Slower than native Bun" "High memory usage"))
46        (diagnosis . ("Profile with Deno.bench" "Check FFI overhead"))
47        (resolution . ("Cache FFI calls" "Batch operations"))
48        (prevention . ("Add benchmarks to CI" "Document performance expectations"))))))
49  
50  (define procedures
51    '((adding-new-bun-api
52       (description . "How to add support for a new Bun-specific API")
53       (steps
54        ("Research Bun API" . "Read Bun documentation for the API")
55        ("Check Deno equivalent" . "See if Deno has native equivalent")
56        ("Design interface" . "Create TypeScript interface matching Bun")
57        ("Implement bridge" . "Use FFI or Deno stdlib as backend")
58        ("Add tests" . "Test against both Bun behavior and Deno")
59        ("Document" . "Add to README and generate docs")))
60  
61      (sqlite-operations
62       (description . "Working with bun:sqlite compatible interface")
63       (steps
64        ("Import module" . "import { Database } from 'deno-bunbridge/sqlite'")
65        ("Create database" . "const db = new Database(':memory:')")
66        ("Execute queries" . "db.query('SELECT * FROM table')")
67        ("Close connection" . "db.close()")))))