@stacksjs/config 0.74.36 → 0.74.38
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/dist/capabilities.d.ts +33 -1
- package/dist/capabilities.js +1 -1
- package/dist/helpers.d.ts +9 -1
- package/dist/helpers.js +1 -1
- package/package.json +6 -6
package/dist/capabilities.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
/** Whether this driver's behaviour depends on a service this repository does not own. */
|
|
2
|
+
export declare function isRemoteTopology(topology: CapabilityTopology): boolean;
|
|
1
3
|
export declare function capabilityDrivers(category: CapabilityCategory): readonly CapabilityDriver[];
|
|
2
4
|
export declare function findCapability(category: CapabilityCategory, name: string): CapabilityDriver | undefined;
|
|
3
5
|
export declare function assertCapabilityAvailable(category: CapabilityCategory, name: string): CapabilityDriver;
|
|
6
|
+
/** The remote half, as a value, so a check can ask rather than restate it. */
|
|
7
|
+
export declare const REMOTE_TOPOLOGIES: ReadonlySet<CapabilityTopology>;
|
|
4
8
|
export declare const capabilityRegistry: readonly CapabilityDriver[];
|
|
5
9
|
export declare interface CapabilityDriver {
|
|
6
10
|
category: CapabilityCategory
|
|
@@ -8,10 +12,38 @@ export declare interface CapabilityDriver {
|
|
|
8
12
|
status: CapabilityStatus
|
|
9
13
|
implementation: string | null
|
|
10
14
|
testEvidence: string[]
|
|
11
|
-
topology:
|
|
15
|
+
topology: CapabilityTopology
|
|
12
16
|
prerequisites: string[]
|
|
13
17
|
limitations: string[]
|
|
14
18
|
liveServiceContract?: { service: string, version: string, workflow: string }
|
|
15
19
|
}
|
|
16
20
|
export type CapabilityCategory = 'database' | 'queue' | 'cache' | 'storage' | 'mail' | 'realtime' | 'deploy';
|
|
17
21
|
export type CapabilityStatus = 'supported' | 'partial' | 'experimental' | 'unsupported';
|
|
22
|
+
/**
|
|
23
|
+
* Where a driver's work actually happens.
|
|
24
|
+
*
|
|
25
|
+
* A closed vocabulary rather than a free string, for two reasons. A typo in a
|
|
26
|
+
* free string is invisible - `in-process` and `inprocess` would sit next to
|
|
27
|
+
* each other in the matrix forever. And the split below is load-bearing:
|
|
28
|
+
* whether a driver depends on something outside this process decides whether
|
|
29
|
+
* calling it `supported` requires a versioned provider contract
|
|
30
|
+
* (stacksjs/stacks#2056).
|
|
31
|
+
*/
|
|
32
|
+
export type CapabilityTopology = LocalTopology | RemoteTopology;
|
|
33
|
+
/** Runs inside this process, or on its filesystem. Nothing to version. */
|
|
34
|
+
export type LocalTopology = | 'embedded'
|
|
35
|
+
| 'inline'
|
|
36
|
+
| 'in-process'
|
|
37
|
+
| 'local-file'
|
|
38
|
+
| 'local-filesystem'
|
|
39
|
+
| 'single-process-websocket'
|
|
40
|
+
| 'worker-and-embedded-sqlite';
|
|
41
|
+
/** Depends on something outside this process, whose version is a fact about the claim. */
|
|
42
|
+
export type RemoteTopology = | 'client-server'
|
|
43
|
+
| 'managed-service'
|
|
44
|
+
| 'managed-object-storage'
|
|
45
|
+
| 'mysql-behind-vtgate'
|
|
46
|
+
| 'smtp-server'
|
|
47
|
+
| 'worker-and-redis'
|
|
48
|
+
| 'hetzner-vm-systemd-rpx'
|
|
49
|
+
| 'ssh-box-systemd-rpx';
|
package/dist/capabilities.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const capabilityRegistry=[{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:[]},{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.","The migration files shipped under database/migrations are emitted for a single dialect (SQLite in the default template) and do not replay on MySQL. They must be regenerated against MySQL before migrating."]},{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."]},{category:"database",name:"vitess",status:"experimental",implementation:"storage/framework/core/database/src/drivers/mysql.ts",testEvidence:["storage/framework/core/database/tests/vitess-constraints.test.ts"],topology:"mysql-behind-vtgate",prerequisites:["A Vitess cluster reachable at vtgate"],limitations:["No live cluster in CI; the retained evidence covers unsharded and sharded DDL profiles plus VSchema generation, not a round trip through vtgate.","Set DB_VITESS_SHARDED=true for a sharded keyspace; those keyspaces reject cross-shard foreign keys and AUTO_INCREMENT, so use application-generated IDs and a VSchema.","Schema changes on sharded keyspaces should go through Vitess online DDL.","A transaction spanning shards is best-effort or two-phase, not the single-node ACID the ORM assumes."]},{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.","The migration files shipped under database/migrations are emitted for a single dialect (SQLite in the default template) and do not replay on PostgreSQL. They must be regenerated against PostgreSQL before migrating."]},{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."]},{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."]},{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."]},{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"}},{category:"queue",name:"sqs",status:"unsupported",implementation:null,testEvidence:[],topology:"managed-service",prerequisites:["AWS SQS"],limitations:["Configuration shape is reserved; dispatch fails loudly."]},{category:"queue",name:"memory",status:"unsupported",implementation:null,testEvidence:[],topology:"in-process",prerequisites:[],limitations:["Reserved driver name; dispatch fails loudly."]},{category:"queue",name:"beanstalkd",status:"unsupported",implementation:null,testEvidence:[],topology:"client-server",prerequisites:["Beanstalkd service"],limitations:["Reserved driver name; dispatch fails loudly."]},{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."]},{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"}},{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."]},{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:[]},{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."]},{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."]},{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."]},{category:"storage",name:"azure",status:"partial",implementation:"storage/framework/core/storage/src/adapters/azure.ts",testEvidence:["storage/framework/core/storage/tests/azure-adapter.test.ts","storage/framework/core/storage/tests/azure-signing.test.ts"],topology:"managed-object-storage",prerequisites:["An Azure storage account, a container, and an account key or SAS token"],limitations:["CI covers Shared Key and service-SAS signing plus request construction, not a live container round trip.","Visibility is a container property on Azure, so changeVisibility() refuses rather than silently doing nothing; a per-object grant is signedUrl().","ensureConfiguredBuckets provisions S3 buckets only, so the container must exist before the disk is used."]},{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."]},{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."]},...["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."]})),{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."]},{category:"deploy",name:"ts-cloud-hetzner",status:"experimental",implementation:"storage/framework/core/buddy/src/commands/deploy.ts",testEvidence:["storage/framework/core/buddy/tests/deploy-ssh-target.test.ts"],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."]},{category:"deploy",name:"ts-cloud-ssh",status:"experimental",implementation:"storage/framework/core/buddy/src/commands/deploy-ssh-target.ts",testEvidence:["storage/framework/core/buddy/tests/deploy-ssh-target.test.ts"],topology:"ssh-box-systemd-rpx",prerequisites:["@stacksjs/ts-cloud with the ssh driver","A 64-bit Debian or Ubuntu host reachable over SSH","Passwordless sudo when deploying as a non-root user"],limitations:["DNS, TLS issuance, CDN and mail reconciliation are skipped for a host on a private address.","One app host per project; multi-host ssh fleets are not supported.","No live hardware evidence is retained in CI."]}];export function capabilityDrivers(category){return capabilityRegistry.filter((driver)=>driver.category===category)}export function findCapability(category,name){return capabilityRegistry.find((driver)=>driver.category===category&&driver.name===name)}export function assertCapabilityAvailable(category,name){const capability=findCapability(category,name);if(!capability){const known=capabilityDrivers(category).map((driver)=>driver.name).join(", ");throw Error(`[config] Unknown ${category} driver "${name}". Known drivers: ${known}`)}if(capability.status==="unsupported")throw Error(`[config] ${category} driver "${name}" is unsupported: ${capability.limitations.join(" ")}`);return capability}
|
|
1
|
+
export const REMOTE_TOPOLOGIES=new Set(["client-server","managed-service","managed-object-storage","mysql-behind-vtgate","smtp-server","worker-and-redis","hetzner-vm-systemd-rpx","ssh-box-systemd-rpx"]);export function isRemoteTopology(topology){return REMOTE_TOPOLOGIES.has(topology)}export const capabilityRegistry=[{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:[]},{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.","The migration files shipped under database/migrations are emitted for a single dialect (SQLite in the default template) and do not replay on MySQL. They must be regenerated against MySQL before migrating."]},{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."]},{category:"database",name:"vitess",status:"experimental",implementation:"storage/framework/core/database/src/drivers/mysql.ts",testEvidence:["storage/framework/core/database/tests/vitess-constraints.test.ts"],topology:"mysql-behind-vtgate",prerequisites:["A Vitess cluster reachable at vtgate"],limitations:["No live cluster in CI; the retained evidence covers unsharded and sharded DDL profiles plus VSchema generation, not a round trip through vtgate.","Set DB_VITESS_SHARDED=true for a sharded keyspace; those keyspaces reject cross-shard foreign keys and AUTO_INCREMENT, so use application-generated IDs and a VSchema.","Schema changes on sharded keyspaces should go through Vitess online DDL.","A transaction spanning shards is best-effort or two-phase, not the single-node ACID the ORM assumes."]},{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.","The migration files shipped under database/migrations are emitted for a single dialect (SQLite in the default template) and do not replay on PostgreSQL. They must be regenerated against PostgreSQL before migrating."]},{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."]},{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."]},{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."]},{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"}},{category:"queue",name:"sqs",status:"unsupported",implementation:null,testEvidence:[],topology:"managed-service",prerequisites:["AWS SQS"],limitations:["Configuration shape is reserved; dispatch fails loudly."]},{category:"queue",name:"memory",status:"unsupported",implementation:null,testEvidence:[],topology:"in-process",prerequisites:[],limitations:["Reserved driver name; dispatch fails loudly."]},{category:"queue",name:"beanstalkd",status:"unsupported",implementation:null,testEvidence:[],topology:"client-server",prerequisites:["Beanstalkd service"],limitations:["Reserved driver name; dispatch fails loudly."]},{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."]},{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"}},{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."]},{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:[]},{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."]},{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."]},{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."]},{category:"storage",name:"azure",status:"partial",implementation:"storage/framework/core/storage/src/adapters/azure.ts",testEvidence:["storage/framework/core/storage/tests/azure-adapter.test.ts","storage/framework/core/storage/tests/azure-signing.test.ts"],topology:"managed-object-storage",prerequisites:["An Azure storage account, a container, and an account key or SAS token"],limitations:["CI covers Shared Key and service-SAS signing plus request construction, not a live container round trip.","Visibility is a container property on Azure, so changeVisibility() refuses rather than silently doing nothing; a per-object grant is signedUrl().","ensureConfiguredBuckets provisions S3 buckets only, so the container must exist before the disk is used."]},{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."]},{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."]},...["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."]})),{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."]},{category:"deploy",name:"ts-cloud-hetzner",status:"experimental",implementation:"storage/framework/core/buddy/src/commands/deploy.ts",testEvidence:["storage/framework/core/buddy/tests/deploy-ssh-target.test.ts"],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."]},{category:"deploy",name:"ts-cloud-ssh",status:"experimental",implementation:"storage/framework/core/buddy/src/commands/deploy-ssh-target.ts",testEvidence:["storage/framework/core/buddy/tests/deploy-ssh-target.test.ts"],topology:"ssh-box-systemd-rpx",prerequisites:["@stacksjs/ts-cloud with the ssh driver","A 64-bit Debian or Ubuntu host reachable over SSH","Passwordless sudo when deploying as a non-root user"],limitations:["DNS, TLS issuance, CDN and mail reconciliation are skipped for a host on a private address.","One app host per project; multi-host ssh fleets are not supported.","No live hardware evidence is retained in CI."]}];export function capabilityDrivers(category){return capabilityRegistry.filter((driver)=>driver.category===category)}export function findCapability(category,name){return capabilityRegistry.find((driver)=>driver.category===category&&driver.name===name)}export function assertCapabilityAvailable(category,name){const capability=findCapability(category,name);if(!capability){const known=capabilityDrivers(category).map((driver)=>driver.name).join(", ");throw Error(`[config] Unknown ${category} driver "${name}". Known drivers: ${known}`)}if(capability.status==="unsupported")throw Error(`[config] ${category} driver "${name}" is unsupported: ${capability.limitations.join(" ")}`);return capability}
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { config } from '.';
|
|
2
|
-
import type { AppConfig, CacheConfig, CdnConfig, ChatConfig, CliConfig, DatabaseConfig, DependenciesConfig, DnsConfig, EmailConfig, FilesystemsConfig, FeatureFlagsConfig, GitConfig, HashingConfig, ImagesConfig, LibraryConfig, NotificationConfig, PaymentConfig, QueueConfig, SearchEngineConfig, SecurityConfig, ServicesConfig, SmsConfig, StacksConfig, StorageConfig, UiConfig } from '@stacksjs/types';
|
|
2
|
+
import type { AppConfig, AuthConfig, CacheConfig, CdnConfig, ChatConfig, CliConfig, CloudConfig, DatabaseConfig, DependenciesConfig, DnsConfig, EmailConfig, FilesystemsConfig, FeatureFlagsConfig, GitConfig, HashingConfig, ImagesConfig, LibraryConfig, NotificationConfig, PaymentConfig, QueueConfig, SearchEngineConfig, SecurityConfig, ServicesConfig, SmsConfig, StacksConfig, StorageConfig, UiConfig } from '@stacksjs/types';
|
|
3
3
|
export declare function localUrl(options?: {
|
|
4
4
|
domain?: string
|
|
5
5
|
type?: LocalUrlType
|
|
@@ -9,7 +9,15 @@ export declare function localUrl(options?: {
|
|
|
9
9
|
}): Promise<string>;
|
|
10
10
|
export declare function defineStacksConfig(config: StacksConfig): StacksConfig;
|
|
11
11
|
export declare function defineApp(config: AppConfig): AppConfig;
|
|
12
|
+
export declare function defineAuth(config: AuthConfig): AuthConfig;
|
|
12
13
|
export declare function defineCache(config: CacheConfig): CacheConfig;
|
|
14
|
+
/**
|
|
15
|
+
* `config/cloud.ts` is the largest config file in a Stacks application and the
|
|
16
|
+
* one most worth having typed, and it was the one with no helper - along with
|
|
17
|
+
* `auth`. Both types already existed; only the two-line functions were missing
|
|
18
|
+
* (stacksjs/stacks#2581).
|
|
19
|
+
*/
|
|
20
|
+
export declare function defineCloud(config: CloudConfig): CloudConfig;
|
|
13
21
|
export declare function defineCdn(config: CdnConfig): CdnConfig;
|
|
14
22
|
export declare function defineChat(config: ChatConfig): ChatConfig;
|
|
15
23
|
export declare function defineCli(config: CliConfig): CliConfig;
|
package/dist/helpers.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{config}from".";export async function localUrl(options={}){const domain=options.domain??config.app.url??"stacks",type=options.type??"frontend",localhost=options.localhost??!1,{https,network}=options;let url=domain.replace(/\.[^.]+$/,".localhost");async function tunnel(port){const{createLocalTunnel}=await import("@stacksjs/tunnel");return createLocalTunnel(port)}switch(type){case"frontend":if(network)return await tunnel(config.ports?.frontend||3000);if(localhost)return`http://localhost:${config.ports?.frontend}`;break;case"backend":if(network)return await tunnel(config.ports?.backend||3001);if(localhost)return`http://localhost:${config.ports?.backend}`;url=`api.${url}`;break;case"admin":if(network)return await tunnel(config.ports?.admin||3002);if(localhost)return`http://localhost:${config.ports?.admin}`;url=`admin.${url}`;break;case"library":if(network)return await tunnel(config.ports?.library||3003);if(localhost)return`http://localhost:${config.ports?.library}`;url=`libs.${url}`;break;case"email":if(network)return await tunnel(config.ports?.email||3005);if(localhost)return`http://localhost:${config.ports?.email}`;url=`email.${url}`;break;case"desktop":if(network)return await tunnel(config.ports?.desktop||3004);if(localhost)return`http://localhost:${config.ports?.desktop}`;url=`desktop.${url}`;break;case"docs":if(network)return await tunnel(config.ports?.docs||3006);if(localhost)return`http://localhost:${config.ports?.docs}`;url=`docs.${url}`;break;case"inspect":if(network)return await tunnel(config.ports?.inspect||3007);if(localhost)return`http://localhost:${config.ports?.inspect}`;url=`inspect.${url}`;break;default:if(localhost)return`http://localhost:${config.ports?.frontend}`}if(https)return`https://${url}`;return`http://${url}`}export function defineStacksConfig(config){return config}export function defineApp(config){return config}export function defineCache(config){return config}export function defineCdn(config){return config}export function defineChat(config){return config}export function defineCli(config){return config}export function defineDatabase(config){return config}export function defineDependencies(config){return config}export function defineDns(config){return config}export function defineEmailConfig(config){return config}export function defineEmail(config){return config}export function defineGit(config){return config}export function defineHashing(config){return config}export function defineImages(config){return config}export function defineLibrary(config){return config}export function defineNotification(config){return config}export function definePayment(config){return config}export function defineQueue(config){return config}export function defineSearchEngine(config){return config}export function defineSecurity(config){return config}export function defineServices(config){return config}export function defineSms(config){return config}export function defineStorage(config){return config}export function defineFilesystems(config){return config}export function defineFeatureFlags(config){return config}export function defineUi(config){return config}export{defineEvents}from"@stacksjs/events";
|
|
1
|
+
import{config}from".";export async function localUrl(options={}){const domain=options.domain??config.app.url??"stacks",type=options.type??"frontend",localhost=options.localhost??!1,{https,network}=options;let url=domain.replace(/\.[^.]+$/,".localhost");async function tunnel(port){const{createLocalTunnel}=await import("@stacksjs/tunnel");return createLocalTunnel(port)}switch(type){case"frontend":if(network)return await tunnel(config.ports?.frontend||3000);if(localhost)return`http://localhost:${config.ports?.frontend}`;break;case"backend":if(network)return await tunnel(config.ports?.backend||3001);if(localhost)return`http://localhost:${config.ports?.backend}`;url=`api.${url}`;break;case"admin":if(network)return await tunnel(config.ports?.admin||3002);if(localhost)return`http://localhost:${config.ports?.admin}`;url=`admin.${url}`;break;case"library":if(network)return await tunnel(config.ports?.library||3003);if(localhost)return`http://localhost:${config.ports?.library}`;url=`libs.${url}`;break;case"email":if(network)return await tunnel(config.ports?.email||3005);if(localhost)return`http://localhost:${config.ports?.email}`;url=`email.${url}`;break;case"desktop":if(network)return await tunnel(config.ports?.desktop||3004);if(localhost)return`http://localhost:${config.ports?.desktop}`;url=`desktop.${url}`;break;case"docs":if(network)return await tunnel(config.ports?.docs||3006);if(localhost)return`http://localhost:${config.ports?.docs}`;url=`docs.${url}`;break;case"inspect":if(network)return await tunnel(config.ports?.inspect||3007);if(localhost)return`http://localhost:${config.ports?.inspect}`;url=`inspect.${url}`;break;default:if(localhost)return`http://localhost:${config.ports?.frontend}`}if(https)return`https://${url}`;return`http://${url}`}export function defineStacksConfig(config){return config}export function defineApp(config){return config}export function defineAuth(config){return config}export function defineCache(config){return config}export function defineCloud(config){return config}export function defineCdn(config){return config}export function defineChat(config){return config}export function defineCli(config){return config}export function defineDatabase(config){return config}export function defineDependencies(config){return config}export function defineDns(config){return config}export function defineEmailConfig(config){return config}export function defineEmail(config){return config}export function defineGit(config){return config}export function defineHashing(config){return config}export function defineImages(config){return config}export function defineLibrary(config){return config}export function defineNotification(config){return config}export function definePayment(config){return config}export function defineQueue(config){return config}export function defineSearchEngine(config){return config}export function defineSecurity(config){return config}export function defineServices(config){return config}export function defineSms(config){return config}export function defineStorage(config){return config}export function defineFilesystems(config){return config}export function defineFeatureFlags(config){return config}export function defineUi(config){return config}export{defineEvents}from"@stacksjs/events";
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/config",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.74.
|
|
5
|
+
"version": "0.74.38",
|
|
6
6
|
"description": "The Stacks config helper methods.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"prepublishOnly": "bun run build"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@stacksjs/events": "0.74.
|
|
59
|
-
"@stacksjs/path": "0.74.
|
|
60
|
-
"@stacksjs/tunnel": "0.74.
|
|
58
|
+
"@stacksjs/events": "0.74.38",
|
|
59
|
+
"@stacksjs/path": "0.74.38",
|
|
60
|
+
"@stacksjs/tunnel": "0.74.38",
|
|
61
61
|
"ts-pantry": "^0.11.35"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@stacksjs/alias": "0.74.
|
|
65
|
-
"@stacksjs/types": "0.74.
|
|
64
|
+
"@stacksjs/alias": "0.74.38",
|
|
65
|
+
"@stacksjs/types": "0.74.38",
|
|
66
66
|
"better-dx": "^0.2.24"
|
|
67
67
|
}
|
|
68
68
|
}
|