@stacksjs/config 0.74.36 → 0.74.37

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/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.36",
5
+ "version": "0.74.37",
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.36",
59
- "@stacksjs/path": "0.74.36",
60
- "@stacksjs/tunnel": "0.74.36",
58
+ "@stacksjs/events": "0.74.37",
59
+ "@stacksjs/path": "0.74.37",
60
+ "@stacksjs/tunnel": "0.74.37",
61
61
  "ts-pantry": "^0.11.35"
62
62
  },
63
63
  "devDependencies": {
64
- "@stacksjs/alias": "0.74.36",
65
- "@stacksjs/types": "0.74.36",
64
+ "@stacksjs/alias": "0.74.37",
65
+ "@stacksjs/types": "0.74.37",
66
66
  "better-dx": "^0.2.24"
67
67
  }
68
68
  }