@stacksjs/config 0.66.0 → 0.67.0

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/src/helpers.ts DELETED
@@ -1,228 +0,0 @@
1
- import type {
2
- AppConfig,
3
- CacheConfig,
4
- CdnConfig,
5
- ChatConfig,
6
- CliConfig,
7
- DatabaseConfig,
8
- DependenciesConfig,
9
- DnsConfig,
10
- EmailConfig,
11
- Events,
12
- GitConfig,
13
- HashingConfig,
14
- JobConfig,
15
- LibraryConfig,
16
- Model,
17
- NotificationConfig,
18
- PaymentConfig,
19
- QueueConfig,
20
- SearchEngineConfig,
21
- SecurityConfig,
22
- ServicesConfig,
23
- StacksConfig,
24
- StorageConfig,
25
- UiConfig,
26
- } from '@stacksjs/types'
27
- import { createLocalTunnel } from '@stacksjs/tunnel'
28
- import { config } from '.'
29
-
30
- export type LocalUrlType =
31
- | 'frontend'
32
- | 'backend'
33
- | 'api'
34
- | 'admin'
35
- | 'library'
36
- | 'email'
37
- | 'docs'
38
- | 'inspect'
39
- | 'desktop'
40
-
41
- export async function localUrl({
42
- domain = config.app.url || 'stacks',
43
- type = 'frontend' as LocalUrlType,
44
- localhost = false,
45
- https = undefined as boolean | undefined,
46
- network = undefined as boolean | undefined,
47
- }: {
48
- domain?: string
49
- type?: LocalUrlType
50
- network?: boolean
51
- localhost?: boolean
52
- https?: boolean
53
- } = {}): Promise<string> {
54
- let url = domain.replace(/\.[^.]+$/, '.localhost')
55
-
56
- switch (type) {
57
- case 'frontend':
58
- if (network)
59
- return await createLocalTunnel(config.ports?.frontend || 3000)
60
- if (localhost)
61
- return `http://localhost:${config.ports?.frontend}`
62
- break
63
- case 'backend':
64
- if (network)
65
- return await createLocalTunnel(config.ports?.backend || 3001)
66
- if (localhost)
67
- return `http://localhost:${config.ports?.backend}`
68
- url = `api.${url}`
69
- break
70
- case 'admin':
71
- if (network)
72
- return await createLocalTunnel(config.ports?.admin || 3002)
73
- if (localhost)
74
- return `http://localhost:${config.ports?.admin}`
75
- url = `admin.${url}`
76
- break
77
- case 'library':
78
- if (network)
79
- return await createLocalTunnel(config.ports?.library || 3003)
80
- if (localhost)
81
- return `http://localhost:${config.ports?.library}`
82
- url = `libs.${url}`
83
- break
84
- case 'email':
85
- if (network)
86
- return await createLocalTunnel(config.ports?.email || 3005)
87
- if (localhost)
88
- return `http://localhost:${config.ports?.email}`
89
- url = `email.${url}`
90
- break
91
- case 'desktop':
92
- if (network)
93
- return await createLocalTunnel(config.ports?.desktop || 3004)
94
- if (localhost)
95
- return `http://localhost:${config.ports?.desktop}`
96
- url = `desktop.${url}`
97
- break
98
- case 'docs':
99
- if (network)
100
- return await createLocalTunnel(config.ports?.docs || 3006)
101
- if (localhost)
102
- return `http://localhost:${config.ports?.docs}`
103
- url = `docs.${url}`
104
- break
105
- case 'inspect':
106
- if (network)
107
- return await createLocalTunnel(config.ports?.inspect || 3007)
108
- if (localhost)
109
- return `http://localhost:${config.ports?.inspect}`
110
- url = `inspect.${url}`
111
- break
112
- default:
113
- if (localhost)
114
- return `http://localhost:${config.ports?.frontend}`
115
- }
116
-
117
- if (https)
118
- return `https://${url}`
119
- return `http://${url}`
120
- }
121
-
122
- export function defineStacksConfig(config: StacksConfig): StacksConfig {
123
- return config
124
- }
125
-
126
- export function defineApp(config: AppConfig): AppConfig {
127
- return config
128
- }
129
-
130
- export function defineCache(config: CacheConfig): CacheConfig {
131
- return config
132
- }
133
-
134
- export function defineCdn(config: CdnConfig): CdnConfig {
135
- return config
136
- }
137
-
138
- export function defineChat(config: ChatConfig): ChatConfig {
139
- return config
140
- }
141
-
142
- export function defineCli(config: CliConfig): CliConfig {
143
- return config
144
- }
145
-
146
- export function defineJob(config: JobConfig): JobConfig {
147
- return config
148
- }
149
-
150
- export function defineCronJob(config: JobConfig): JobConfig {
151
- return config
152
- }
153
-
154
- export function defineDatabase(config: DatabaseConfig): DatabaseConfig {
155
- return config
156
- }
157
-
158
- export function defineDependencies(config: DependenciesConfig): DependenciesConfig {
159
- return config
160
- }
161
-
162
- export function defineDns(config: DnsConfig): DnsConfig {
163
- return config
164
- }
165
-
166
- export function defineEmailConfig(config: EmailConfig): EmailConfig {
167
- return config
168
- }
169
-
170
- export function defineEmail(config: EmailConfig): EmailConfig {
171
- return config
172
- }
173
-
174
- export function defineGit(config: GitConfig): GitConfig {
175
- return config
176
- }
177
-
178
- export function defineHashing(config: HashingConfig): HashingConfig {
179
- return config
180
- }
181
-
182
- export function defineLibrary(config: LibraryConfig): LibraryConfig {
183
- return config
184
- }
185
-
186
- export function defineNotification(config: NotificationConfig): NotificationConfig {
187
- return config
188
- }
189
-
190
- export function definePayment(config: PaymentConfig): PaymentConfig {
191
- return config
192
- }
193
-
194
- export function defineQueue(config: QueueConfig): QueueConfig {
195
- return config
196
- }
197
-
198
- export function defineSearchEngine(config: SearchEngineConfig): SearchEngineConfig {
199
- return config
200
- }
201
-
202
- export function defineSecurity(config: SecurityConfig): SecurityConfig {
203
- return config
204
- }
205
-
206
- export function defineServices(config: ServicesConfig): ServicesConfig {
207
- return config
208
- }
209
-
210
- export function defineSms(config: any): any {
211
- return config
212
- }
213
-
214
- export function defineStorage(config: StorageConfig): StorageConfig {
215
- return config
216
- }
217
-
218
- export function defineUi(config: UiConfig): UiConfig {
219
- return config
220
- }
221
-
222
- export function defineModel(config: Model): Model {
223
- return config
224
- }
225
-
226
- export function defineEvents(config: Events): Events {
227
- return config
228
- }
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * as config from './config'
2
- export * from './config'
package/src/overrides.ts DELETED
@@ -1,56 +0,0 @@
1
- import type { StacksConfig } from '@stacksjs/types'
2
- import ai from '~/config/ai'
3
- import analytics from '~/config/analytics'
4
- import app from '~/config/app'
5
- import cache from '~/config/cache'
6
- import cli from '~/config/cli'
7
- import cloud from '~/config/cloud'
8
- import database from '~/config/database'
9
- import dns from '~/config/dns'
10
- import email from '~/config/email'
11
- import errors from '~/config/errors'
12
- import git from '~/config/git'
13
- import hashing from '~/config/hashing'
14
- import library from '~/config/library'
15
- import logging from '~/config/logging'
16
- import notification from '~/config/notification'
17
- import payment from '~/config/payment'
18
- import ports from '~/config/ports'
19
- import queue from '~/config/queue'
20
- import searchEngine from '~/config/search-engine'
21
- import security from '~/config/security'
22
- import services from '~/config/services'
23
- import storage from '~/config/storage'
24
- import team from '~/config/team'
25
- import ui from '~/config/ui'
26
- // import docs from '~/docs/config'
27
-
28
- const config: StacksConfig = {
29
- ai,
30
- analytics,
31
- app,
32
- cache,
33
- cli,
34
- cloud,
35
- database,
36
- dns,
37
- // docs,
38
- email,
39
- errors,
40
- git,
41
- hashing,
42
- library,
43
- logging,
44
- notification,
45
- queue,
46
- payment,
47
- ports,
48
- searchEngine,
49
- security,
50
- services,
51
- storage,
52
- team,
53
- ui,
54
- }
55
-
56
- export default config