Essential infrastructure packages for modern web development
Type-safe environment variable validation powered by Zod.
npm install @raypx/env zodFeatures:
- β Type-safe environment variables
- β Runtime validation with Zod
- β Client/Server separation
- β Extends support for shared configs
- β Configurable client prefix
Example:
import { createEnv } from '@raypx/env';
import { z } from 'zod';
export const env = createEnv({
server: {
DATABASE_URL: z.string().url(),
API_SECRET: z.string().min(32),
},
client: {
NEXT_PUBLIC_API_URL: z.string().url(),
},
runtimeEnv: process.env,
});
// Fully typed!
console.log(env.DATABASE_URL); // string
console.log(env.NEXT_PUBLIC_API_URL); // stringLightweight, configurable logger based on consola.
npm install @raypx/loggerFeatures:
- β Based on consola with rich formatting
- β Environment-aware log levels
- β Silent mode support
- β Replaceable logger instance for testing
- β Tagged logger support
- β TypeScript support
Example:
import { logger } from '@raypx/logger';
logger.log('Hello, world!');
logger.info('Information message');
logger.warn('Warning message');
logger.error('Error message');
// Create module-specific logger
import { createConsola } from '@raypx/logger';
const moduleLogger = createConsola({ level: 4 }).withTag('MyModule');
moduleLogger.info('Module-specific log');Vite plugin for internationalization with compile-time optimization.
npm install @raypx/i18nFeatures:
- β Compile-time translation injection
- β TypeScript support
- β Hot module replacement
- β Minimal runtime overhead
- β JSON-based translations
Example:
// vite.config.ts
import { defineConfig } from 'vite';
import { i18n } from '@raypx/i18n/vite';
export default defineConfig({
plugins: [
i18n({
locales: ['en', 'zh'],
defaultLocale: 'en',
localesDir: './locales',
}),
],
});// Usage in your app
import { useTranslation } from '@raypx/i18n/runtime';
const { t, locale, setLocale } = useTranslation();
console.log(t('welcome')); // "Welcome"
setLocale('zh');
console.log(t('welcome')); // "ζ¬’θΏ"Install the package you need:
# Environment validation
npm install @raypx/env zod
# Logger
npm install @raypx/logger
# Internationalization
npm install @raypx/i18n# Clone the repository
git clone https://github.com/raypx/raypx-kit.git
cd raypx-kit
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
# Type check
pnpm typecheck# Development
pnpm install # Install dependencies
pnpm build # Build all packages
pnpm test # Run tests
pnpm typecheck # Type check
# Code Quality
pnpm format # Format with Biome
pnpm check # Lint with Biome
pnpm check:fix # Fix lint issues
pnpm clean # Clean build artifacts
# Release
pnpm changeset # Create a changeset
pnpm changeset:version # Bump versions
pnpm release # Publish to npmraypx-kit/
βββ packages/
β βββ env/ # @raypx/env
β βββ logger/ # @raypx/logger
β βββ i18n/ # @raypx/i18n
βββ .github/
β βββ workflows/ # CI/CD pipelines
βββ .changeset/ # Version management
βββ package.json # Monorepo root
- @raypx/env Documentation
- @raypx/logger Documentation
- @raypx/i18n Documentation
- Contributing Guide
- Security Policy
We welcome contributions! Please read our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
pnpm test) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Be respectful, inclusive, and constructive. See our Code of Conduct.
Apache-2.0 Β© 2025 Raypx Team
Built with:
- Turborepo - Monorepo management
- Changesets - Version management
- Biome - Linting and formatting
- tsdown - TypeScript bundler
- Vitest - Testing framework
- π Report Issues
- π¬ GitHub Discussions
- π Security Issues
- π§ Email
Made with β€οΈ by the Raypx Team