@stacksjs/config 0.70.161 → 0.70.163

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.
@@ -0,0 +1,17 @@
1
+ export declare function capabilityDrivers(category: CapabilityCategory): readonly CapabilityDriver[];
2
+ export declare function findCapability(category: CapabilityCategory, name: string): CapabilityDriver | undefined;
3
+ export declare function assertCapabilityAvailable(category: CapabilityCategory, name: string): CapabilityDriver;
4
+ export declare const capabilityRegistry: readonly CapabilityDriver[];
5
+ export declare interface CapabilityDriver {
6
+ category: CapabilityCategory
7
+ name: string
8
+ status: CapabilityStatus
9
+ implementation: string | null
10
+ testEvidence: string[]
11
+ topology: string
12
+ prerequisites: string[]
13
+ limitations: string[]
14
+ liveServiceContract?: { service: string, version: string, workflow: string }
15
+ }
16
+ export type CapabilityCategory = 'database' | 'queue' | 'cache' | 'storage' | 'mail' | 'realtime' | 'deploy';
17
+ export type CapabilityStatus = 'supported' | 'partial' | 'experimental' | 'unsupported';
@@ -0,0 +1,41 @@
1
+ export const capabilityRegistry = [
2
+ { category: "database", name: "sqlite", status: "supported", implementation: "storage/framework/core/database/src/drivers/sqlite.ts", testEvidence: ["storage/framework/core/database/tests/integration.test.ts", "storage/framework/core/database/tests/sqlite-tx-serialization.test.ts"], topology: "embedded", prerequisites: ["Bun SQLite"], limitations: [] },
3
+ { category: "database", name: "mysql", status: "partial", implementation: "storage/framework/core/database/src/drivers/mysql.ts", testEvidence: ["storage/framework/core/database/tests/integration.test.ts"], topology: "client-server", prerequisites: ["MySQL service"], limitations: ["The default CI suite does not yet publish a dedicated dialect report."] },
4
+ { category: "database", name: "singlestore", status: "experimental", implementation: "storage/framework/core/database/src/drivers/mysql.ts", testEvidence: [], topology: "client-server", prerequisites: ["SingleStore service"], limitations: ["MySQL wire compatibility exists, but a dedicated conformance matrix is not published."] },
5
+ { category: "database", name: "postgres", status: "partial", implementation: "storage/framework/core/database/src/drivers/postgres.ts", testEvidence: ["storage/framework/core/database/tests/postgres-pivot-timestamptz.test.ts"], topology: "client-server", prerequisites: ["PostgreSQL service"], limitations: ["The default CI suite does not provision PostgreSQL."] },
6
+ { category: "database", name: "dynamodb", status: "unsupported", implementation: "storage/framework/core/database/src/drivers/dynamodb.ts", testEvidence: [], topology: "managed-service", prerequisites: ["DynamoDB"], limitations: ["DynamoDB helpers are not an ORM SQL driver and cannot be selected as database.default."] },
7
+ { category: "queue", name: "sync", status: "supported", implementation: "storage/framework/core/queue/src/job.ts", testEvidence: ["storage/framework/core/queue/tests/jobs.test.ts"], topology: "inline", prerequisites: [], limitations: ["Not durable."] },
8
+ { category: "queue", name: "database", status: "supported", implementation: "storage/framework/core/queue/src/job.ts", testEvidence: ["storage/framework/core/queue/tests/integration.test.ts", "storage/framework/core/queue/tests/failure-path-correctness.test.ts"], topology: "worker-and-embedded-sqlite", prerequisites: ["Bun SQLite for the retained CI contract"], limitations: ["Other SQL providers require their own provider evidence."] },
9
+ { category: "queue", name: "redis", status: "supported", implementation: "storage/framework/core/queue/src/drivers/redis.ts", testEvidence: ["storage/framework/core/queue/tests/redis-contract.test.ts"], topology: "worker-and-redis", prerequisites: ["Redis 8.8 service"], limitations: ["The retained contract covers queue persistence operations; horizontal scaling and distributed-lock extensions require separate evidence."], liveServiceContract: { service: "redis", version: "8.8.0", workflow: ".github/workflows/ci.yml" } },
10
+ { category: "queue", name: "sqs", status: "unsupported", implementation: null, testEvidence: [], topology: "managed-service", prerequisites: ["AWS SQS"], limitations: ["Configuration shape is reserved; dispatch fails loudly."] },
11
+ { category: "queue", name: "memory", status: "unsupported", implementation: null, testEvidence: [], topology: "in-process", prerequisites: [], limitations: ["Reserved driver name; dispatch fails loudly."] },
12
+ { category: "queue", name: "beanstalkd", status: "unsupported", implementation: null, testEvidence: [], topology: "client-server", prerequisites: ["Beanstalkd service"], limitations: ["Reserved driver name; dispatch fails loudly."] },
13
+ { category: "cache", name: "memory", status: "supported", implementation: "storage/framework/core/cache/src/drivers/index.ts", testEvidence: ["storage/framework/core/cache/tests/Memory.test.ts", "storage/framework/core/cache/tests/ttl.test.ts"], topology: "in-process", prerequisites: [], limitations: ["Not shared across processes."] },
14
+ { category: "cache", name: "redis", status: "supported", implementation: "storage/framework/core/cache/src/drivers/index.ts", testEvidence: ["storage/framework/core/cache/tests/redis-contract.test.ts"], topology: "client-server", prerequisites: ["Redis 8.8 service"], limitations: ["The retained contract covers core cache and TTL operations; TLS/authenticated deployments require separate provider evidence."], liveServiceContract: { service: "redis", version: "8.8.0", workflow: ".github/workflows/ci.yml" } },
15
+ { category: "cache", name: "singlestore", status: "experimental", implementation: "storage/framework/core/cache/src/drivers/singlestore.ts", testEvidence: [], topology: "client-server", prerequisites: ["SingleStore service"], limitations: ["No dedicated CI service matrix."] },
16
+ { category: "storage", name: "local", status: "supported", implementation: "storage/framework/core/storage/src/adapters/local.ts", testEvidence: ["storage/framework/core/storage/tests/localStorage.test.ts", "storage/framework/core/storage/tests/deep-integration.test.ts"], topology: "local-filesystem", prerequisites: [], limitations: [] },
17
+ { category: "storage", name: "memory", status: "supported", implementation: "storage/framework/core/storage/src/adapters/memory.ts", testEvidence: ["storage/framework/core/storage/tests/memoryAdapter.test.ts"], topology: "in-process", prerequisites: [], limitations: ["Not persistent."] },
18
+ { category: "storage", name: "s3", status: "partial", implementation: "storage/framework/core/storage/src/adapters/s3.ts", testEvidence: ["storage/framework/core/storage/tests/s3-presigned-post.test.ts"], topology: "managed-object-storage", prerequisites: ["S3-compatible service and credentials"], limitations: ["CI covers request construction but not a live provider round trip."] },
19
+ { category: "storage", name: "bun", status: "partial", implementation: "storage/framework/core/storage/src/adapters/bun.ts", testEvidence: ["storage/framework/core/storage/tests/bunAdapter.test.ts"], topology: "local-filesystem", prerequisites: ["Bun runtime"], limitations: ["Adapter-specific feature parity is not fully reported."] },
20
+ { category: "mail", name: "log", status: "supported", implementation: "storage/framework/core/email/src/drivers/log.ts", testEvidence: ["storage/framework/core/email/tests/email.test.ts"], topology: "local-file", prerequisites: [], limitations: ["Development/testing transport only."] },
21
+ { category: "mail", name: "capture", status: "supported", implementation: "storage/framework/core/email/src/drivers/capture.ts", testEvidence: ["storage/framework/core/email/tests/email.test.ts"], topology: "in-process", prerequisites: [], limitations: ["Testing transport only."] },
22
+ ...["smtp", "ses", "sendgrid", "mailgun", "mailtrap"].map((name) => ({ category: "mail", name, status: "partial", implementation: `storage/framework/core/email/src/drivers/${name}.ts`, testEvidence: ["storage/framework/core/email/tests/driver-credentials.test.ts"], topology: name === "smtp" ? "smtp-server" : "managed-service", prerequisites: [`${name} credentials`], limitations: ["CI validates configuration and request behavior without a live delivery assertion."] })),
23
+ { category: "realtime", name: "websocket", status: "supported", implementation: "storage/framework/core/realtime/src/ws.ts", testEvidence: ["storage/framework/core/realtime/tests/ws-auth.test.ts", "storage/framework/core/realtime/tests/backpressure.test.ts"], topology: "single-process-websocket", prerequisites: ["Bun server"], limitations: ["Scale-out requires an application-provided fan-out layer."] },
24
+ { category: "deploy", name: "ts-cloud-hetzner", status: "experimental", implementation: "storage/framework/core/buddy/src/commands/deploy.ts", testEvidence: [], topology: "hetzner-vm-systemd-rpx", prerequisites: ["@stacksjs/ts-cloud", "Hetzner credentials", "SSH key"], limitations: ["Live provider evidence and rollback conformance are not yet retained in the protocol report."] }
25
+ ];
26
+ export function capabilityDrivers(category) {
27
+ return capabilityRegistry.filter((driver) => driver.category === category);
28
+ }
29
+ export function findCapability(category, name) {
30
+ return capabilityRegistry.find((driver) => driver.category === category && driver.name === name);
31
+ }
32
+ export function assertCapabilityAvailable(category, name) {
33
+ const capability = findCapability(category, name);
34
+ if (!capability) {
35
+ const known = capabilityDrivers(category).map((driver) => driver.name).join(", ");
36
+ throw Error(`[config] Unknown ${category} driver "${name}". Known drivers: ${known}`);
37
+ }
38
+ if (capability.status === "unsupported")
39
+ throw Error(`[config] ${category} driver "${name}" is unsupported: ${capability.limitations.join(" ")}`);
40
+ return capability;
41
+ }
package/dist/index.d.ts CHANGED
@@ -12,3 +12,4 @@ export * from './config';
12
12
  export { FRAMEWORK_DEFAULTS } from './defaults';
13
13
  export { validateConfig, reportConfigIssues, type ConfigValidationIssue } from './validators';
14
14
  export { feature, enableFeature, disableFeature, resetFeature, listFeatures } from './features';
15
+ export * from './capabilities';
package/dist/index.js CHANGED
@@ -2,3 +2,4 @@ export * from "./config";
2
2
  export { FRAMEWORK_DEFAULTS } from "./defaults";
3
3
  export { validateConfig, reportConfigIssues } from "./validators";
4
4
  export { feature, enableFeature, disableFeature, resetFeature, listFeatures } from "./features";
5
+ export * from "./capabilities";
@@ -1,3 +1,4 @@
1
+ import { capabilityDrivers, findCapability } from "./capabilities";
1
2
  function isPlainObject(v) {
2
3
  return typeof v === "object" && v !== null && !Array.isArray(v);
3
4
  }
@@ -26,6 +27,21 @@ function checkOneOf(values) {
26
27
  return [];
27
28
  };
28
29
  }
30
+ function checkCapability(category) {
31
+ return (value, path) => {
32
+ if (value == null)
33
+ return [];
34
+ const drivers = capabilityDrivers(category);
35
+ if (typeof value !== "string")
36
+ return [{ path, message: `expected ${category} driver name, got ${typeof value}` }];
37
+ const capability = findCapability(category, value);
38
+ if (!capability)
39
+ return [{ path, message: `unknown ${category} driver ${JSON.stringify(value)}; known drivers: [${drivers.map((driver) => driver.name).join(", ")}]` }];
40
+ if (capability.status === "unsupported")
41
+ return [{ path, message: `${category} driver ${JSON.stringify(value)} is unsupported: ${capability.limitations.join(" ")}` }];
42
+ return [];
43
+ };
44
+ }
29
45
  function checkString() {
30
46
  return (value, path) => {
31
47
  if (value == null)
@@ -61,12 +77,12 @@ const PORT_CHECK = checkInteger(1, 65535), SCHEMA = {
61
77
  },
62
78
  database: {
63
79
  rules: {
64
- default: checkOneOf(["sqlite", "mysql", "singlestore", "postgres", "dynamodb"])
80
+ default: checkCapability("database")
65
81
  }
66
82
  },
67
83
  cache: {
68
84
  rules: {
69
- driver: checkOneOf(["memory", "redis", "singlestore"])
85
+ driver: checkCapability("cache")
70
86
  }
71
87
  },
72
88
  featureFlags: {
@@ -77,7 +93,7 @@ const PORT_CHECK = checkInteger(1, 65535), SCHEMA = {
77
93
  },
78
94
  queue: {
79
95
  rules: {
80
- default: checkOneOf(["sync", "database", "redis"])
96
+ default: checkCapability("queue")
81
97
  }
82
98
  },
83
99
  logging: {
@@ -87,7 +103,7 @@ const PORT_CHECK = checkInteger(1, 65535), SCHEMA = {
87
103
  },
88
104
  email: {
89
105
  rules: {
90
- default: checkOneOf(["ses", "sendgrid", "mailgun", "mailtrap", "smtp", "log", "capture"])
106
+ default: checkCapability("mail")
91
107
  }
92
108
  }
93
109
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/config",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.70.161",
5
+ "version": "0.70.163",
6
6
  "description": "The Stacks config helper methods.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -50,12 +50,12 @@
50
50
  "prepublishOnly": "bun run build"
51
51
  },
52
52
  "dependencies": {
53
- "ts-pantry": "^0.10.11"
53
+ "ts-pantry": "^0.10.34"
54
54
  },
55
55
  "devDependencies": {
56
- "@stacksjs/alias": "0.70.161",
56
+ "@stacksjs/alias": "0.70.163",
57
57
  "better-dx": "^0.2.17",
58
- "@stacksjs/types": "0.70.161",
58
+ "@stacksjs/types": "0.70.163",
59
59
  "bunfig": "^0.15.11"
60
60
  }
61
61
  }