huge refactor to remove depenencie hell and add typesafe container
This commit is contained in:
parent
28b9822d55
commit
843a7b9b9b
148 changed files with 3603 additions and 2378 deletions
|
|
@ -1,61 +1,63 @@
|
|||
import { z } from 'zod';
|
||||
import { environmentSchema } from './base.schema';
|
||||
import {
|
||||
postgresConfigSchema,
|
||||
mongodbConfigSchema,
|
||||
questdbConfigSchema,
|
||||
dragonflyConfigSchema
|
||||
} from './database.schema';
|
||||
import {
|
||||
serviceConfigSchema,
|
||||
loggingConfigSchema,
|
||||
queueConfigSchema,
|
||||
httpConfigSchema,
|
||||
webshareConfigSchema,
|
||||
browserConfigSchema,
|
||||
proxyConfigSchema
|
||||
} from './service.schema';
|
||||
|
||||
/**
|
||||
* Generic base application schema that can be extended by specific apps
|
||||
*/
|
||||
export const baseAppSchema = z.object({
|
||||
// Basic app info
|
||||
name: z.string(),
|
||||
version: z.string(),
|
||||
environment: environmentSchema.default('development'),
|
||||
|
||||
// Service configuration
|
||||
service: serviceConfigSchema,
|
||||
|
||||
// Logging configuration
|
||||
log: loggingConfigSchema,
|
||||
|
||||
// Database configuration - apps can choose which databases they need
|
||||
database: z.object({
|
||||
postgres: postgresConfigSchema.optional(),
|
||||
mongodb: mongodbConfigSchema.optional(),
|
||||
questdb: questdbConfigSchema.optional(),
|
||||
dragonfly: dragonflyConfigSchema.optional(),
|
||||
}).optional(),
|
||||
|
||||
// Redis configuration (used for cache and queue)
|
||||
redis: dragonflyConfigSchema.optional(),
|
||||
|
||||
// Queue configuration
|
||||
queue: queueConfigSchema.optional(),
|
||||
|
||||
// HTTP client configuration
|
||||
http: httpConfigSchema.optional(),
|
||||
|
||||
// WebShare proxy configuration
|
||||
webshare: webshareConfigSchema.optional(),
|
||||
|
||||
// Browser configuration
|
||||
browser: browserConfigSchema.optional(),
|
||||
|
||||
// Proxy manager configuration
|
||||
proxy: proxyConfigSchema.optional(),
|
||||
});
|
||||
|
||||
export type BaseAppConfig = z.infer<typeof baseAppSchema>;
|
||||
import { z } from 'zod';
|
||||
import { environmentSchema } from './base.schema';
|
||||
import {
|
||||
dragonflyConfigSchema,
|
||||
mongodbConfigSchema,
|
||||
postgresConfigSchema,
|
||||
questdbConfigSchema,
|
||||
} from './database.schema';
|
||||
import {
|
||||
browserConfigSchema,
|
||||
httpConfigSchema,
|
||||
loggingConfigSchema,
|
||||
proxyConfigSchema,
|
||||
queueConfigSchema,
|
||||
serviceConfigSchema,
|
||||
webshareConfigSchema,
|
||||
} from './service.schema';
|
||||
|
||||
/**
|
||||
* Generic base application schema that can be extended by specific apps
|
||||
*/
|
||||
export const baseAppSchema = z.object({
|
||||
// Basic app info
|
||||
name: z.string(),
|
||||
version: z.string(),
|
||||
environment: environmentSchema.default('development'),
|
||||
|
||||
// Service configuration
|
||||
service: serviceConfigSchema,
|
||||
|
||||
// Logging configuration
|
||||
log: loggingConfigSchema,
|
||||
|
||||
// Database configuration - apps can choose which databases they need
|
||||
database: z
|
||||
.object({
|
||||
postgres: postgresConfigSchema.optional(),
|
||||
mongodb: mongodbConfigSchema.optional(),
|
||||
questdb: questdbConfigSchema.optional(),
|
||||
dragonfly: dragonflyConfigSchema.optional(),
|
||||
})
|
||||
.optional(),
|
||||
|
||||
// Redis configuration (used for cache and queue)
|
||||
redis: dragonflyConfigSchema.optional(),
|
||||
|
||||
// Queue configuration
|
||||
queue: queueConfigSchema.optional(),
|
||||
|
||||
// HTTP client configuration
|
||||
http: httpConfigSchema.optional(),
|
||||
|
||||
// WebShare proxy configuration
|
||||
webshare: webshareConfigSchema.optional(),
|
||||
|
||||
// Browser configuration
|
||||
browser: browserConfigSchema.optional(),
|
||||
|
||||
// Proxy manager configuration
|
||||
proxy: proxyConfigSchema.optional(),
|
||||
});
|
||||
|
||||
export type BaseAppConfig = z.infer<typeof baseAppSchema>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue