Skip to content

monoswan

monoswan keeps package configuration consistent across a monorepo. Define shared package shapes once, check them with rules, and use the same definitions to create new packages.

  • Centrally managed configuration: Share package.json, TypeScript, JSON, and text configuration through composable variants.

  • Rules & consistency: Check packages with built-in or custom rules, with autofix support.

  • Package templates: Create packages from variant defaults and initialization content.
monoswan.config.ts
import { defineConfig, enforceVariants, sortPackageJson } from "monoswan";
export default defineConfig({
variants: {
"my-library": {
packageJson: { type: "module" },
tsConfig: { compilerOptions: { strict: true } },
initialization: {
packageJson: { version: "0.0.0" },
additionalTextFiles: { "src/index.ts": "export {};\n" },
},
},
},
rules: [enforceVariants(), sortPackageJson()],
});