@stacksjs/config 0.59.11 → 0.61.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/dist/index.js +563 -163
- package/package.json +1 -1
- package/src/config.ts +11 -0
- package/src/defaults.ts +191 -52
- package/src/helpers.ts +66 -61
- package/src/overrides.ts +7 -3
- package/dist/config.d.ts +0 -7
- package/dist/defaults.d.ts +0 -2
- package/dist/helpers.d.ts +0 -37
- package/dist/index.d.ts +0 -2
- package/dist/overrides.d.ts +0 -2
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -11,6 +11,7 @@ export const config: StacksOptions = {
|
|
|
11
11
|
export const {
|
|
12
12
|
ai,
|
|
13
13
|
analytics,
|
|
14
|
+
api,
|
|
14
15
|
app,
|
|
15
16
|
cache,
|
|
16
17
|
cloud,
|
|
@@ -19,6 +20,7 @@ export const {
|
|
|
19
20
|
dns,
|
|
20
21
|
docs,
|
|
21
22
|
email,
|
|
23
|
+
errors,
|
|
22
24
|
git,
|
|
23
25
|
hashing,
|
|
24
26
|
library,
|
|
@@ -38,3 +40,12 @@ export const {
|
|
|
38
40
|
export { defaults, overrides }
|
|
39
41
|
|
|
40
42
|
export * from './helpers'
|
|
43
|
+
|
|
44
|
+
export const determineAppEnv = (): string => {
|
|
45
|
+
if (app.env === 'local') return 'dev'
|
|
46
|
+
if (app.env === 'development') return 'dev'
|
|
47
|
+
if (app.env === 'staging') return 'stage'
|
|
48
|
+
if (app.env === 'production') return 'prod'
|
|
49
|
+
|
|
50
|
+
return app.env
|
|
51
|
+
}
|
package/src/defaults.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { commandsPath,
|
|
1
|
+
import { commandsPath, userDatabasePath } from '@stacksjs/path'
|
|
2
2
|
import type { StacksOptions } from '@stacksjs/types'
|
|
3
3
|
|
|
4
4
|
// import { userConfig as overrides } from './overrides'
|
|
@@ -24,6 +24,19 @@ export default {
|
|
|
24
24
|
driver: undefined,
|
|
25
25
|
},
|
|
26
26
|
|
|
27
|
+
api: {
|
|
28
|
+
// version: 'v1',
|
|
29
|
+
prefix: 'api',
|
|
30
|
+
middleware: ['auth'],
|
|
31
|
+
routes: {
|
|
32
|
+
index: true,
|
|
33
|
+
show: true,
|
|
34
|
+
store: true,
|
|
35
|
+
update: true,
|
|
36
|
+
destroy: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
|
|
27
40
|
app: {
|
|
28
41
|
name: 'Stacks',
|
|
29
42
|
description: 'A Stacks application.',
|
|
@@ -106,30 +119,21 @@ export default {
|
|
|
106
119
|
},
|
|
107
120
|
},
|
|
108
121
|
|
|
109
|
-
api: {
|
|
110
|
-
deploy: false,
|
|
111
|
-
prefix: 'api',
|
|
112
|
-
description: 'Stacks API',
|
|
113
|
-
prewarm: true,
|
|
114
|
-
memorySize: 512,
|
|
115
|
-
timeout: 30,
|
|
116
|
-
// version: 'v1',
|
|
117
|
-
},
|
|
118
|
-
|
|
119
122
|
fileSystem: false,
|
|
120
123
|
},
|
|
121
124
|
|
|
122
125
|
database: {
|
|
123
126
|
default: 'sqlite',
|
|
124
127
|
|
|
125
|
-
name: 'stacks',
|
|
126
|
-
|
|
127
128
|
connections: {
|
|
128
129
|
sqlite: {
|
|
129
|
-
database:
|
|
130
|
+
database: userDatabasePath('stacks.sqlite'),
|
|
130
131
|
prefix: '',
|
|
131
132
|
},
|
|
132
133
|
},
|
|
134
|
+
|
|
135
|
+
migrations: 'migrations',
|
|
136
|
+
migrationLocks: 'migration_locks',
|
|
133
137
|
},
|
|
134
138
|
|
|
135
139
|
dns: {
|
|
@@ -181,6 +185,97 @@ export default {
|
|
|
181
185
|
},
|
|
182
186
|
},
|
|
183
187
|
|
|
188
|
+
errors: {
|
|
189
|
+
messages: {
|
|
190
|
+
string: 'The {{ field }} field must be a string',
|
|
191
|
+
email: 'The {{ field }} field must be a valid email address',
|
|
192
|
+
regex: 'The {{ field }} field format is invalid',
|
|
193
|
+
url: 'The {{ field }} field must be a valid URL',
|
|
194
|
+
activeUrl: 'The {{ field }} field must be a valid URL',
|
|
195
|
+
alpha: 'The {{ field }} field must contain only letters',
|
|
196
|
+
alphaNumeric: 'The {{ field }} field must contain only letters and numbers',
|
|
197
|
+
minLength: 'The {{ field }} field must have at least {{ min }} characters',
|
|
198
|
+
maxLength: 'The {{ field }} field must not be greater than {{ max }} characters',
|
|
199
|
+
fixedLength: 'The {{ field }} field must be {{ size }} characters long',
|
|
200
|
+
confirmed: 'The {{ field }} field and {{ otherField }} field must be the same',
|
|
201
|
+
endsWith: 'The {{ field }} field must end with {{ substring }}',
|
|
202
|
+
startsWith: 'The {{ field }} field must start with {{ substring }}',
|
|
203
|
+
sameAs: 'The {{ field }} field and {{ otherField }} field must be the same',
|
|
204
|
+
notSameAs: 'The {{ field }} field and {{ otherField }} field must be different',
|
|
205
|
+
in: 'The selected {{ field }} is invalid',
|
|
206
|
+
notIn: 'The selected {{ field }} is invalid',
|
|
207
|
+
ipAddress: 'The {{ field }} field must be a valid IP address',
|
|
208
|
+
uuid: 'The {{ field }} field must be a valid UUID',
|
|
209
|
+
ascii: 'The {{ field }} field must only contain ASCII characters',
|
|
210
|
+
creditCard: 'The {{ field }} field must be a valid {{ providersList }} card number',
|
|
211
|
+
hexCode: 'The {{ field }} field must be a valid hex color code',
|
|
212
|
+
iban: 'The {{ field }} field must be a valid IBAN number',
|
|
213
|
+
jwt: 'The {{ field }} field must be a valid JWT token',
|
|
214
|
+
coordinates: 'The {{ field }} field must contain latitude and longitude coordinates',
|
|
215
|
+
mobile: 'The {{ field }} field must be a valid mobile phone number',
|
|
216
|
+
passport: 'The {{ field }} field must be a valid passport number',
|
|
217
|
+
postalCode: 'The {{ field }} field must be a valid postal code',
|
|
218
|
+
|
|
219
|
+
// boolean
|
|
220
|
+
boolean: 'The value must be a boolean',
|
|
221
|
+
|
|
222
|
+
// number
|
|
223
|
+
number: 'The {{ field }} field must be a number',
|
|
224
|
+
min: 'The {{ field }} field must be at least {{ min }}',
|
|
225
|
+
max: 'The {{ field }} field must not be greater than {{ max }}',
|
|
226
|
+
range: 'The {{ field }} field must be between {{ min }} and {{ max }}',
|
|
227
|
+
positive: 'The {{ field }} field must be positive',
|
|
228
|
+
negative: 'The {{ field }} field must be negative',
|
|
229
|
+
decimal: 'The {{ field }} field must have {{ digits }} decimal places',
|
|
230
|
+
withoutDecimals: 'The {{ field }} field must not have decimal places',
|
|
231
|
+
|
|
232
|
+
// date
|
|
233
|
+
date: 'The {{ field }} field must be a datetime value',
|
|
234
|
+
'date.equals': 'The {{ field }} field must be a date equal to {{ expectedValue }}',
|
|
235
|
+
'date.after': 'The {{ field }} field must be a date after {{ expectedValue }}',
|
|
236
|
+
'date.before': 'The {{ field }} field must be a date before {{ expectedValue }}',
|
|
237
|
+
'date.afterOrEqual': 'The {{ field }} field must be a date after or equal to {{ expectedValue }}',
|
|
238
|
+
'date.beforeOrEqual': 'The {{ field }} field must be a date before or equal to {{ expectedValue }}',
|
|
239
|
+
'date.sameAs': 'The {{ field }} field and {{ otherField }} field must be the same',
|
|
240
|
+
'date.notSameAs': 'The {{ field }} field and {{ otherField }} field must be different',
|
|
241
|
+
'date.afterField': 'The {{ field }} field must be a date after {{ otherField }}',
|
|
242
|
+
|
|
243
|
+
// accepted
|
|
244
|
+
accepted: 'The {{ field }} field must be accepted',
|
|
245
|
+
|
|
246
|
+
// enum
|
|
247
|
+
enum: 'The selected {{ field }} is invalid',
|
|
248
|
+
|
|
249
|
+
// literal
|
|
250
|
+
literal: 'The {{ field }} field must be {{ expectedValue }}',
|
|
251
|
+
|
|
252
|
+
// object
|
|
253
|
+
object: 'The {{ field }} field must be an object',
|
|
254
|
+
|
|
255
|
+
// record
|
|
256
|
+
record: 'The {{ field }} field must be an object',
|
|
257
|
+
'record.minLength': 'The {{ field }} field must have at least {{ min }} items',
|
|
258
|
+
'record.maxLength': 'The {{ field }} field must not have more than {{ max }} items',
|
|
259
|
+
'record.fixedLength': 'The {{ field }} field must contain {{ size }} items',
|
|
260
|
+
|
|
261
|
+
// array
|
|
262
|
+
array: 'The {{ field }} field must be an array',
|
|
263
|
+
'array.minLength': 'The {{ field }} field must have at least {{ min }} items',
|
|
264
|
+
'array.maxLength': 'The {{ field }} field must not have more than {{ max }} items',
|
|
265
|
+
'array.fixedLength': 'The {{ field }} field must contain {{ size }} items',
|
|
266
|
+
notEmpty: 'The {{ field }} field must not be empty',
|
|
267
|
+
distinct: 'The {{ field }} field has duplicate values',
|
|
268
|
+
|
|
269
|
+
// tuple
|
|
270
|
+
tuple: 'The {{ field }} field must be an array',
|
|
271
|
+
|
|
272
|
+
// union
|
|
273
|
+
union: 'Invalid value provided for {{ field }} field',
|
|
274
|
+
unionGroup: 'Invalid value provided for {{ field }} field',
|
|
275
|
+
unionOfTypes: 'Invalid value provided for {{ field }} field',
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
|
|
184
279
|
git: {
|
|
185
280
|
hooks: {
|
|
186
281
|
'pre-commit': 'lint-staged',
|
|
@@ -242,17 +337,57 @@ export default {
|
|
|
242
337
|
},
|
|
243
338
|
|
|
244
339
|
types: [
|
|
245
|
-
{
|
|
340
|
+
{
|
|
341
|
+
value: 'feat',
|
|
342
|
+
name: 'feat: ✨ A new feature',
|
|
343
|
+
emoji: ':sparkles:',
|
|
344
|
+
},
|
|
246
345
|
{ value: 'fix', name: 'fix: 🐛 A bug fix', emoji: ':bug:' },
|
|
247
|
-
{
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
{
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
346
|
+
{
|
|
347
|
+
value: 'docs',
|
|
348
|
+
name: 'docs: 📝 Documentation only changes',
|
|
349
|
+
emoji: ':memo:',
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
value: 'style',
|
|
353
|
+
name: 'style: 💄 Changes that do not affect the meaning of the code',
|
|
354
|
+
emoji: ':lipstick:',
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
value: 'refactor',
|
|
358
|
+
name: 'refactor: ♻️ A code change that neither fixes a bug nor adds a feature',
|
|
359
|
+
emoji: ':recycle:',
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
value: 'perf',
|
|
363
|
+
name: 'perf: ⚡️ A code change that improves performance',
|
|
364
|
+
emoji: ':zap:',
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
value: 'test',
|
|
368
|
+
name: 'test: ✅ Adding missing tests or adjusting existing tests',
|
|
369
|
+
emoji: ':white_check_mark:',
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
value: 'build',
|
|
373
|
+
name: 'build: 📦️ Changes that affect the build system or external dependencies',
|
|
374
|
+
emoji: ':package:',
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
value: 'ci',
|
|
378
|
+
name: 'ci: 🎡 Changes to our CI configuration files and scripts',
|
|
379
|
+
emoji: ':ferris_wheel:',
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
value: 'chore',
|
|
383
|
+
name: 'chore: 🔨 Other changes that don’t modify src or test files',
|
|
384
|
+
emoji: ':hammer:',
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
value: 'revert',
|
|
388
|
+
name: 'revert: ⏪️ Reverts a previous commit',
|
|
389
|
+
emoji: ':rewind:',
|
|
390
|
+
},
|
|
256
391
|
],
|
|
257
392
|
},
|
|
258
393
|
|
|
@@ -266,7 +401,7 @@ export default {
|
|
|
266
401
|
|
|
267
402
|
argon2: {
|
|
268
403
|
memory: 65536, // memory usage in kibibytes
|
|
269
|
-
threads: 1,
|
|
404
|
+
// threads: 1,
|
|
270
405
|
time: 1, // the number of iterations
|
|
271
406
|
},
|
|
272
407
|
},
|
|
@@ -284,28 +419,36 @@ export default {
|
|
|
284
419
|
name: 'hello-world-vue',
|
|
285
420
|
description: 'Your Vue component library description',
|
|
286
421
|
keywords: ['component', 'library', 'vue', 'vite', 'typescript', 'javascript'],
|
|
287
|
-
tags: [
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
422
|
+
tags: [
|
|
423
|
+
{
|
|
424
|
+
name: ['HelloWorld', 'AppHelloWorld'],
|
|
425
|
+
description: 'The Hello World custom element, built via this framework.',
|
|
426
|
+
attributes: [
|
|
427
|
+
{
|
|
428
|
+
name: 'greeting',
|
|
429
|
+
description: 'The greeting.',
|
|
430
|
+
},
|
|
431
|
+
],
|
|
432
|
+
},
|
|
433
|
+
],
|
|
295
434
|
},
|
|
296
435
|
|
|
297
436
|
webComponents: {
|
|
298
437
|
name: 'hello-world-elements',
|
|
299
438
|
description: 'Your framework agnostic web component library description.',
|
|
300
439
|
keywords: ['custom-elements', 'web-components', 'library', 'framework-agnostic', 'typescript', 'javascript'],
|
|
301
|
-
tags: [
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
440
|
+
tags: [
|
|
441
|
+
{
|
|
442
|
+
name: ['HelloWorld', 'AppHelloWorld'],
|
|
443
|
+
description: 'The Hello World custom element, built via this framework.',
|
|
444
|
+
attributes: [
|
|
445
|
+
{
|
|
446
|
+
name: 'greeting',
|
|
447
|
+
description: 'The greeting.',
|
|
448
|
+
},
|
|
449
|
+
],
|
|
450
|
+
},
|
|
451
|
+
],
|
|
309
452
|
},
|
|
310
453
|
|
|
311
454
|
functions: {
|
|
@@ -313,10 +456,7 @@ export default {
|
|
|
313
456
|
description: 'Your function library description.',
|
|
314
457
|
keywords: ['functions', 'composables', 'library', 'typescript', 'javascript'],
|
|
315
458
|
shouldGenerateSourcemap: false,
|
|
316
|
-
functions: [
|
|
317
|
-
'counter',
|
|
318
|
-
'dark',
|
|
319
|
-
],
|
|
459
|
+
functions: ['counter', 'dark'],
|
|
320
460
|
},
|
|
321
461
|
},
|
|
322
462
|
|
|
@@ -345,6 +485,7 @@ export default {
|
|
|
345
485
|
inspect: 3007,
|
|
346
486
|
api: 3008,
|
|
347
487
|
systemTray: 3009,
|
|
488
|
+
database: 3010,
|
|
348
489
|
// mobile: 3010,
|
|
349
490
|
},
|
|
350
491
|
|
|
@@ -383,7 +524,7 @@ export default {
|
|
|
383
524
|
},
|
|
384
525
|
|
|
385
526
|
searchEngine: {
|
|
386
|
-
driver: '
|
|
527
|
+
driver: 'opensearch',
|
|
387
528
|
},
|
|
388
529
|
|
|
389
530
|
security: {
|
|
@@ -422,11 +563,6 @@ export default {
|
|
|
422
563
|
appId: '',
|
|
423
564
|
apiKey: '',
|
|
424
565
|
},
|
|
425
|
-
|
|
426
|
-
supabase: {
|
|
427
|
-
appId: '',
|
|
428
|
-
apiKey: '',
|
|
429
|
-
},
|
|
430
566
|
},
|
|
431
567
|
|
|
432
568
|
storage: {
|
|
@@ -442,7 +578,10 @@ export default {
|
|
|
442
578
|
|
|
443
579
|
ui: {
|
|
444
580
|
shortcuts: [
|
|
445
|
-
[
|
|
581
|
+
[
|
|
582
|
+
'btn',
|
|
583
|
+
'inline-flex items-center px-4 py-2 ml-2 border border-transparent shadow-sm text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-pointer',
|
|
584
|
+
],
|
|
446
585
|
],
|
|
447
586
|
|
|
448
587
|
safelist: 'prose prose-sm m-auto text-left',
|
package/src/helpers.ts
CHANGED
|
@@ -1,8 +1,42 @@
|
|
|
1
|
-
import type { AppConfig, CacheConfig, CdnConfig, ChatConfig, CliConfig, DatabaseConfig, DependenciesConfig, DnsConfig, EmailConfig, Events, GitConfig, HashingConfig, JobConfig, LibraryConfig, Model, NotificationConfig, PaymentConfig, QueueConfig, SearchEngineConfig, SecurityConfig, ServicesConfig, SmsConfig, StacksConfig, StorageConfig, UiConfig } from '@stacksjs/types'
|
|
2
1
|
import { createLocalTunnel } from '@stacksjs/tunnel'
|
|
2
|
+
import type {
|
|
3
|
+
AppConfig,
|
|
4
|
+
CacheConfig,
|
|
5
|
+
CdnConfig,
|
|
6
|
+
ChatConfig,
|
|
7
|
+
CliConfig,
|
|
8
|
+
DatabaseConfig,
|
|
9
|
+
DependenciesConfig,
|
|
10
|
+
DnsConfig,
|
|
11
|
+
EmailConfig,
|
|
12
|
+
Events,
|
|
13
|
+
GitConfig,
|
|
14
|
+
HashingConfig,
|
|
15
|
+
JobConfig,
|
|
16
|
+
LibraryConfig,
|
|
17
|
+
Model,
|
|
18
|
+
NotificationConfig,
|
|
19
|
+
PaymentConfig,
|
|
20
|
+
QueueConfig,
|
|
21
|
+
SearchEngineConfig,
|
|
22
|
+
SecurityConfig,
|
|
23
|
+
ServicesConfig,
|
|
24
|
+
StacksConfig,
|
|
25
|
+
StorageConfig,
|
|
26
|
+
UiConfig,
|
|
27
|
+
} from '@stacksjs/types'
|
|
3
28
|
import { config } from '.'
|
|
4
29
|
|
|
5
|
-
export type LocalUrlType =
|
|
30
|
+
export type LocalUrlType =
|
|
31
|
+
| 'frontend'
|
|
32
|
+
| 'backend'
|
|
33
|
+
| 'api'
|
|
34
|
+
| 'admin'
|
|
35
|
+
| 'library'
|
|
36
|
+
| 'email'
|
|
37
|
+
| 'docs'
|
|
38
|
+
| 'inspect'
|
|
39
|
+
| 'desktop'
|
|
6
40
|
|
|
7
41
|
export async function localUrl({
|
|
8
42
|
domain = config.app.url || 'stacks',
|
|
@@ -18,130 +52,101 @@ export async function localUrl({
|
|
|
18
52
|
|
|
19
53
|
switch (type) {
|
|
20
54
|
case 'frontend':
|
|
21
|
-
if (network)
|
|
22
|
-
return await createLocalTunnel(config.ports?.frontend || 3000)
|
|
55
|
+
if (network) return await createLocalTunnel(config.ports?.frontend || 3000)
|
|
23
56
|
|
|
24
|
-
if (localhost)
|
|
25
|
-
return `http://localhost:${config.ports?.frontend}`
|
|
57
|
+
if (localhost) return `http://localhost:${config.ports?.frontend}`
|
|
26
58
|
|
|
27
59
|
url = domain.replace(/\.[^\.]+$/, '.localhost')
|
|
28
60
|
|
|
29
|
-
if (https)
|
|
30
|
-
return `https://${url}`
|
|
61
|
+
if (https) return `https://${url}`
|
|
31
62
|
|
|
32
63
|
return url
|
|
33
64
|
case 'backend':
|
|
34
|
-
if (network)
|
|
35
|
-
return await createLocalTunnel(config.ports?.backend || 3001)
|
|
65
|
+
if (network) return await createLocalTunnel(config.ports?.backend || 3001)
|
|
36
66
|
|
|
37
|
-
if (localhost)
|
|
38
|
-
return `http://localhost:${config.ports?.backend}`
|
|
67
|
+
if (localhost) return `http://localhost:${config.ports?.backend}`
|
|
39
68
|
|
|
40
69
|
url = domain.replace(/\.[^\.]+$/, '.localhost/api/')
|
|
41
70
|
|
|
42
|
-
if (https)
|
|
43
|
-
return `https://${url}`
|
|
71
|
+
if (https) return `https://${url}`
|
|
44
72
|
|
|
45
73
|
return url
|
|
46
74
|
case 'api':
|
|
47
|
-
if (network)
|
|
48
|
-
return await createLocalTunnel(config.ports?.backend || 3001)
|
|
75
|
+
if (network) return await createLocalTunnel(config.ports?.backend || 3001)
|
|
49
76
|
|
|
50
|
-
if (localhost)
|
|
51
|
-
return `http://localhost:${config.ports?.backend}`
|
|
77
|
+
if (localhost) return `http://localhost:${config.ports?.backend}`
|
|
52
78
|
|
|
53
79
|
url = domain.replace(/\.[^\.]+$/, '.localhost/api/')
|
|
54
80
|
|
|
55
|
-
if (https)
|
|
56
|
-
return `https://${url}`
|
|
81
|
+
if (https) return `https://${url}`
|
|
57
82
|
|
|
58
83
|
return url
|
|
59
84
|
case 'admin':
|
|
60
|
-
if (network)
|
|
61
|
-
return await createLocalTunnel(config.ports?.admin || 3002)
|
|
85
|
+
if (network) return await createLocalTunnel(config.ports?.admin || 3002)
|
|
62
86
|
|
|
63
|
-
if (localhost)
|
|
64
|
-
return `http://localhost:${config.ports?.admin}`
|
|
87
|
+
if (localhost) return `http://localhost:${config.ports?.admin}`
|
|
65
88
|
|
|
66
89
|
url = domain.replace(/\.[^\.]+$/, '.localhost/admin/')
|
|
67
90
|
|
|
68
|
-
if (https)
|
|
69
|
-
return `https://${url}`
|
|
91
|
+
if (https) return `https://${url}`
|
|
70
92
|
|
|
71
93
|
return url
|
|
72
94
|
case 'library':
|
|
73
|
-
if (network)
|
|
74
|
-
return await createLocalTunnel(config.ports?.library || 3003)
|
|
95
|
+
if (network) return await createLocalTunnel(config.ports?.library || 3003)
|
|
75
96
|
|
|
76
|
-
if (localhost)
|
|
77
|
-
return `http://localhost:${config.ports?.library}`
|
|
97
|
+
if (localhost) return `http://localhost:${config.ports?.library}`
|
|
78
98
|
|
|
79
99
|
url = domain.replace(/\.[^\.]+$/, '.localhost/libs/')
|
|
80
100
|
|
|
81
|
-
if (https)
|
|
82
|
-
return `https://${url}`
|
|
101
|
+
if (https) return `https://${url}`
|
|
83
102
|
|
|
84
103
|
return url
|
|
85
104
|
case 'email':
|
|
86
|
-
if (network)
|
|
87
|
-
return await createLocalTunnel(config.ports?.email || 3005)
|
|
105
|
+
if (network) return await createLocalTunnel(config.ports?.email || 3005)
|
|
88
106
|
|
|
89
|
-
if (localhost)
|
|
90
|
-
return `http://localhost:${config.ports?.email}`
|
|
107
|
+
if (localhost) return `http://localhost:${config.ports?.email}`
|
|
91
108
|
|
|
92
109
|
url = domain.replace(/\.[^\.]+$/, '.localhost/email/')
|
|
93
110
|
|
|
94
|
-
if (https)
|
|
95
|
-
return `https://${url}`
|
|
111
|
+
if (https) return `https://${url}`
|
|
96
112
|
|
|
97
113
|
return url
|
|
98
114
|
case 'desktop':
|
|
99
|
-
if (network)
|
|
100
|
-
return await createLocalTunnel(config.ports?.desktop || 3004)
|
|
115
|
+
if (network) return await createLocalTunnel(config.ports?.desktop || 3004)
|
|
101
116
|
|
|
102
|
-
if (localhost)
|
|
103
|
-
return `http://localhost:${config.ports?.email}`
|
|
117
|
+
if (localhost) return `http://localhost:${config.ports?.email}`
|
|
104
118
|
|
|
105
119
|
url = domain.replace(/\.[^\.]+$/, '.localhost/email/')
|
|
106
120
|
|
|
107
|
-
if (https)
|
|
108
|
-
return `https://${url}`
|
|
121
|
+
if (https) return `https://${url}`
|
|
109
122
|
|
|
110
123
|
return url
|
|
111
124
|
case 'docs':
|
|
112
|
-
if (network)
|
|
113
|
-
return await createLocalTunnel(config.ports?.desktop || 3006)
|
|
125
|
+
if (network) return await createLocalTunnel(config.ports?.desktop || 3006)
|
|
114
126
|
|
|
115
|
-
if (localhost)
|
|
116
|
-
return `http://localhost:${config.ports?.docs}`
|
|
127
|
+
if (localhost) return `http://localhost:${config.ports?.docs}`
|
|
117
128
|
|
|
118
129
|
url = domain.replace(/\.[^\.]+$/, '.localhost/docs/')
|
|
119
130
|
|
|
120
|
-
if (https)
|
|
121
|
-
return `https://${url}`
|
|
131
|
+
if (https) return `https://${url}`
|
|
122
132
|
|
|
123
133
|
return url
|
|
124
134
|
case 'inspect':
|
|
125
|
-
if (network)
|
|
126
|
-
return await createLocalTunnel(config.ports?.desktop || 3007)
|
|
135
|
+
if (network) return await createLocalTunnel(config.ports?.desktop || 3007)
|
|
127
136
|
|
|
128
|
-
if (localhost)
|
|
129
|
-
return `http://localhost:${config.ports?.inspect}`
|
|
137
|
+
if (localhost) return `http://localhost:${config.ports?.inspect}`
|
|
130
138
|
|
|
131
139
|
url = domain.replace(/\.[^\.]+$/, '.localhost/__inspect/')
|
|
132
140
|
|
|
133
|
-
if (https)
|
|
134
|
-
return `https://${url}`
|
|
141
|
+
if (https) return `https://${url}`
|
|
135
142
|
|
|
136
143
|
return url
|
|
137
144
|
default:
|
|
138
|
-
if (localhost)
|
|
139
|
-
return `http://localhost:${config.ports?.frontend}`
|
|
145
|
+
if (localhost) return `http://localhost:${config.ports?.frontend}`
|
|
140
146
|
|
|
141
147
|
url = domain.replace(/\.[^\.]+$/, '.localhost')
|
|
142
148
|
|
|
143
|
-
if (https)
|
|
144
|
-
return `https://${url}`
|
|
149
|
+
if (https) return `https://${url}`
|
|
145
150
|
|
|
146
151
|
return url
|
|
147
152
|
}
|
|
@@ -235,7 +240,7 @@ export function defineServices(config: ServicesConfig) {
|
|
|
235
240
|
return config
|
|
236
241
|
}
|
|
237
242
|
|
|
238
|
-
export function defineSms(config:
|
|
243
|
+
export function defineSms(config: any) {
|
|
239
244
|
return config
|
|
240
245
|
}
|
|
241
246
|
|
package/src/overrides.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { StacksConfig } from '@stacksjs/types'
|
|
2
2
|
import ai from '~/config/ai'
|
|
3
|
+
import analytics from '~/config/analytics'
|
|
3
4
|
import app from '~/config/app'
|
|
4
5
|
import cache from '~/config/cache'
|
|
5
6
|
import cli from '~/config/cli'
|
|
@@ -8,24 +9,26 @@ import database from '~/config/database'
|
|
|
8
9
|
import dns from '~/config/dns'
|
|
9
10
|
import docs from '~/config/docs'
|
|
10
11
|
import email from '~/config/email'
|
|
12
|
+
import errors from '~/config/errors'
|
|
11
13
|
import git from '~/config/git'
|
|
12
14
|
import hashing from '~/config/hashing'
|
|
13
15
|
import library from '~/config/library'
|
|
14
16
|
import logger from '~/config/logger'
|
|
15
|
-
import
|
|
17
|
+
import notification from '~/config/notification'
|
|
16
18
|
import payment from '~/config/payment'
|
|
17
19
|
import ports from '~/config/ports'
|
|
18
|
-
import
|
|
19
|
-
import storage from '~/config/storage'
|
|
20
|
+
import queue from '~/config/queue'
|
|
20
21
|
import searchEngine from '~/config/search-engine'
|
|
21
22
|
import security from '~/config/security'
|
|
22
23
|
import services from '~/config/services'
|
|
24
|
+
import storage from '~/config/storage'
|
|
23
25
|
import team from '~/config/team'
|
|
24
26
|
import ui from '~/config/ui'
|
|
25
27
|
|
|
26
28
|
// this "user config" will override the default config options
|
|
27
29
|
export default {
|
|
28
30
|
ai,
|
|
31
|
+
analytics,
|
|
29
32
|
app,
|
|
30
33
|
cache,
|
|
31
34
|
cli,
|
|
@@ -34,6 +37,7 @@ export default {
|
|
|
34
37
|
dns,
|
|
35
38
|
docs,
|
|
36
39
|
email,
|
|
40
|
+
errors,
|
|
37
41
|
git,
|
|
38
42
|
hashing,
|
|
39
43
|
library,
|
package/dist/config.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { StacksOptions } from '@stacksjs/types';
|
|
2
|
-
import defaults from './defaults';
|
|
3
|
-
import overrides from './overrides';
|
|
4
|
-
export declare const config: StacksOptions;
|
|
5
|
-
export declare const ai: StacksOptions, analytics: StacksOptions, app: StacksOptions, cache: StacksOptions, cloud: StacksOptions, cli: StacksOptions, database: StacksOptions, dns: StacksOptions, docs: StacksOptions, email: StacksOptions, git: StacksOptions, hashing: StacksOptions, library: StacksOptions, logger: StacksOptions, notification: StacksOptions, payment: StacksOptions, ports: StacksOptions, queue: StacksOptions, security: StacksOptions, searchEngine: StacksOptions, services: StacksOptions, storage: StacksOptions, team: StacksOptions, ui: StacksOptions;
|
|
6
|
-
export { defaults, overrides };
|
|
7
|
-
export * from './helpers';
|
package/dist/defaults.d.ts
DELETED