@friehub/blueprint 0.1.0 → 0.1.2
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/publish.yml +3 -2
- package/CHANGELOG.md +54 -0
- package/dist/index.js +3 -1
- package/package.json +2 -1
- package/blueprint.json +0 -5
|
@@ -18,7 +18,8 @@ jobs:
|
|
|
18
18
|
- run: npm ci
|
|
19
19
|
- run: npm run build
|
|
20
20
|
- run: npm test
|
|
21
|
-
- name:
|
|
22
|
-
run:
|
|
21
|
+
- name: Pre-publish checks
|
|
22
|
+
run: bash scripts/check-publish.sh
|
|
23
|
+
- run: npm publish --access public
|
|
23
24
|
env:
|
|
24
25
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 — Initial Release
|
|
4
|
+
|
|
5
|
+
### Core
|
|
6
|
+
- **Parser:** Reads 108 markdown contracts, extracts functions, types, dependencies, invariants, and provider lists. 0 errors, 0 warnings.
|
|
7
|
+
- **Resolver:** Transitive dependency resolution with cycle detection. Walks hard deps, attaches implicit core contracts.
|
|
8
|
+
- **Type inference:** Automatic type detection from parameter names (`order_id` → `string`, `amount` → `number`, `created_at` → `Timestamp`). 35 inference rules.
|
|
9
|
+
- **Versioning:** Extracts `**Version:** 0.1.0` from contract preambles. All 108 contracts versioned.
|
|
10
|
+
|
|
11
|
+
### Adapters
|
|
12
|
+
- **83 adapters across 35 modules:** Stripe, Paystack, Adyen (payments), Redis, Memcached (caching), BullMQ, SQS, RabbitMQ (queues), Resend, Sendgrid, Mailgun (email), Twilio, Vonage (SMS), Clerk, Auth0, Supertokens (auth), and more.
|
|
13
|
+
- **Adapter validation:** Checks implementations against contracts. Reports missing functions, suggests similar names (Levenshtein distance).
|
|
14
|
+
- **Config extraction:** Required and optional config fields per adapter.
|
|
15
|
+
|
|
16
|
+
### Code Generation
|
|
17
|
+
- **TypeScript generator:** Interfaces, adapter skeletons, conformance tests. 276 files generated from 108 contracts.
|
|
18
|
+
- **SDK implementations:** Real Stripe, Redis, BullMQ code embedded in generated adapters. Not stubs — working implementations.
|
|
19
|
+
- **Dependency-aware:** Generating a module's code also generates its hard dep interfaces.
|
|
20
|
+
- **Type safety:** Inferred types throughout library API and generated code. Zero `any` in function signatures.
|
|
21
|
+
|
|
22
|
+
### CLI — 14 commands
|
|
23
|
+
| Command | What it does |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `build` | Parse contracts → catalog.json |
|
|
26
|
+
| `list` | All 108 modules with deps |
|
|
27
|
+
| `inspect` | Full contract for one module |
|
|
28
|
+
| `graph` | ASCII or Mermaid dependency tree |
|
|
29
|
+
| `search` | Interactive module picker |
|
|
30
|
+
| `resolve` | Transitive dependency resolution |
|
|
31
|
+
| `adapters` | 83 adapters: list, add, remove, verify |
|
|
32
|
+
| `generate` | TypeScript code generation |
|
|
33
|
+
| `prototype` | Project scaffold with correct npm deps |
|
|
34
|
+
| `schema` | JSON Schema export |
|
|
35
|
+
| `verify` | Check implementation against contract |
|
|
36
|
+
| `implement` | Generate AI implementation prompts |
|
|
37
|
+
| `mcp` | Start MCP server for AI tools |
|
|
38
|
+
|
|
39
|
+
### Library API
|
|
40
|
+
```typescript
|
|
41
|
+
import { loadCatalogFromRoot } from 'blueprint';
|
|
42
|
+
const catalog = await loadCatalogFromRoot('./contracts');
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### MCP Server
|
|
46
|
+
7 tools for AI integration: `list_modules`, `get_module`, `search_modules`, `resolve_deps`, `list_adapters`, `get_adapter`, `get_dependency_graph`. Stdio transport for Claude Desktop, Cursor, Copilot.
|
|
47
|
+
|
|
48
|
+
### Testing
|
|
49
|
+
- **91 tests:** 58 unit + 25 integration + 8 MCP
|
|
50
|
+
- **Edge cases:** Empty files, malformed markdown, 50-module chains, self-referencing modules, commented-out code, return type mismatches
|
|
51
|
+
- **CI:** GitHub Actions on Node 18, 20, 22
|
|
52
|
+
|
|
53
|
+
### Contributing
|
|
54
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) (coming soon).
|
package/dist/index.js
CHANGED
|
@@ -4,5 +4,7 @@ export { loadCatalogFromRoot } from "./core/load-catalog.js";
|
|
|
4
4
|
export { loadAdapters, loadAdapter } from "./core/adapters/load.js";
|
|
5
5
|
export { resolve as resolveDeps, detectCycles } from "./core/resolve.js";
|
|
6
6
|
export { searchModules } from "./core/search.js";
|
|
7
|
-
export { buildGraph } from "./core/graph.js";
|
|
8
7
|
export { implicitCores } from "./core/catalog.js";
|
|
8
|
+
export { validateAdapter, validateAdapterSelection } from "./core/adapters/validate.js";
|
|
9
|
+
export { generateImplementPrompts } from "./core/implement.js";
|
|
10
|
+
export { verifyImplementation } from "./core/verify.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friehub/blueprint",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A domain contract catalogue for backend development. 108 interfaces, 83 adapters, AI-ready.",
|
|
5
5
|
"keywords": ["contract", "domain", "backend", "ai", "code-generation", "adapter", "blueprint"],
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"check": "tsc -p tsconfig.json --noEmit",
|
|
22
22
|
"test": "npm run build && node --test dist/core/*.test.js dist/core/adapters/*.test.js",
|
|
23
23
|
"test:mcp": "node --test dist/mcp/*.test.js",
|
|
24
|
+
"check:publish": "bash scripts/check-publish.sh",
|
|
24
25
|
"test:integration": "npm run build && bash scripts/integration-test.sh",
|
|
25
26
|
"postinstall": "npm run build",
|
|
26
27
|
"link": "npm run build && npm link"
|