wexts-config
v1.0.0
Published
WEXTS framework configuration schema and utilities
Readme
@wexts/config
TypeScript configuration schema and utilities for WEXTS framework projects.
Installation
pnpm add @wexts/configUsage
Defining Configuration
Create a wexts.config.ts file in your project root:
import { WextsConfig } from '@wexts/config';
const config: WextsConfig = {
framework: 'wexts',
version: '2.0.0',
apps: {
frontend: {
dir: 'apps/web',
framework: 'nextjs',
port: 3000
},
backend: {
dir: 'apps/api',
framework: 'nestjs',
port: 3001
}
},
monorepo: {
tool: 'turborepo'
}
};
export default config;Loading Configuration
import { loadWextsConfig } from '@wexts/config';
const config = await loadWextsConfig(process.cwd());
if (config) {
console.log('Frontend:', config.apps.frontend.framework);
console.log('Backend:', config.apps.backend.framework);
}Framework Detection
import { detectWexts } from '@wexts/config';
const isWextsProject = await detectWexts(process.cwd());
console.log('Is WEXTS project?', isWextsProject);API
WextsConfig
Main configuration interface with the following properties:
framework: Always'wexts'version: Framework versionapps.frontend: Frontend app configurationapps.backend: Backend app configurationmonorepo: Monorepo tool configurationdeployment: Optional deployment settings
loadWextsConfig(rootDir: string): Promise<WextsConfig | null>
Loads and validates WEXTS configuration from the specified directory.
detectWexts(rootDir: string): Promise<boolean>
Detects if a project uses WEXTS framework by checking:
wexts.config.tsexistencewextsin package.json dependencies- Vercel framework preset
License
MIT
