Registry / devops / father

father

JSON →
library4.6.18jsnpmunverified

Father is a comprehensive NPM package development tool within the UmiJS ecosystem, designed to streamline the building, generating, and publishing of JavaScript and TypeScript packages. It features a dual-mode build system: 'Bundless' for ESModule and CommonJS outputs, leveraging esbuild, Babel, or SWC; and 'Bundle' for UMD artifacts powered by Webpack. The package, currently at version 4.6.18, maintains an active release cadence with frequent minor updates and patches. Its key differentiators include robust type generation for TypeScript, persistent caching for accelerated builds, and integrated project health checks to prevent common development pitfalls. Father also offers micro-generators for common engineering tasks and experimental dependency pre-bundling to enhance stability in Node.js frameworks and libraries.

devops
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Primarily used in `father.config.ts` for type-safe configuration. CommonJS `require` is not supported for this utility.

import { defineConfig } from 'father';

A TypeScript interface for the main Father configuration object, used for advanced type-checking or custom config structures. Always use `import type`.

import type { IFatherConfig } from 'father';

A TypeScript interface for configuration specific to the Bundless build mode. Useful for detailed type-checking in complex scenarios. Always use `import type`.

import type { IBundlessConfig } from 'father';

Demonstrates setting up a basic TypeScript package with Father, including configuration for ESModule and CommonJS outputs, and a build script.

{ "name": "my-package", "version": "1.0.0", "type": "module", "scripts": { "build": "father build" }, "devDependencies": { "father": "^4.6.18", "typescript": "^5.0.0" } } // father.config.ts import { defineConfig } from 'father'; export default defineConfig({ esm: { type: 'babel', importLibToEs: true }, cjs: { type: 'babel', lazy: true }, // Optional: UMD build for browser compatibility // umd: { name: 'myPackage', output: 'dist' }, // Persistent caching for faster rebuilds extraBabelPlugins: [ ['babel-plugin-import', { libraryName: 'lodash', libraryDirectory: 'es' }] ], targets: { esmodules: true, node: 14 } }); // src/index.ts export const greet = (name: string): string => `Hello, ${name} from Father!`; export const add = (a: number, b: number): number => a + b;
father --version
Debug
Known footguns
breakingUpgrading from Father 2.x to Father 4.x introduces significant breaking changes due to a complete rewrite and architectural shifts. Direct upgrade often requires reconfiguring build processes.
gotchaIncorrectly configuring Bundless vs. Bundle modes, or choosing the wrong build core (esbuild, Babel, SWC for Bundless; Webpack for Bundle) can lead to unexpected output formats or compatibility issues.
gotchaWhile persistent caching is a feature, in rare cases it might lead to stale build artifacts if the cache is not properly invalidated after certain changes (e.g., changes to external dependencies not tracked by Father).
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
8 hits · last 30 days
gptbot
4
ahrefsbot
3
script
1
Resources