Package Exports
- @fnd-platform/core
- @fnd-platform/core/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@fnd-platform/core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@fnd-platform/core
Core package for the fnd-platform toolkit, providing Projen project classes for scaffolding production-ready monorepo projects.
Installation
npm install -D @fnd-platform/core projen
# or
pnpm add -D @fnd-platform/core projenQuick Start
Create a .projenrc.ts file in your project root:
import { FndMonorepoProject } from '@fnd-platform/core';
const project = new FndMonorepoProject({
name: 'my-app',
defaultReleaseBranch: 'main',
});
project.synth();Run Projen to generate all configuration files:
npx projenWhat Gets Generated
Running synthesis with FndMonorepoProject generates:
package.json- Root package with workspace scriptspnpm-workspace.yaml- pnpm workspace configurationnx.json- NX build orchestration with cachingtsconfig.base.json- Shared TypeScript configuration.eslintrc.js- Shared ESLint configuration.prettierrc- Shared Prettier configurationvitest.config.ts- Vitest test configuration.gitignore- Standard git ignorespackages/- Directory for workspace packages
Configuration Options
interface FndMonorepoProjectOptions {
// Required
name: string; // Project name
defaultReleaseBranch: string; // Default branch for releases
// Optional
workspacePackages?: string[]; // Package directories (default: ['packages/*'])
nxCache?: boolean; // Enable NX caching (default: true)
nxCacheableOperations?: string[]; // Operations to cache (default: ['build', 'test', 'lint'])
description?: string; // Project description
repository?: string; // Git repository URL
authorName?: string; // Author name
authorEmail?: string; // Author email
}Examples
Custom Workspace Layout
const project = new FndMonorepoProject({
name: 'my-app',
defaultReleaseBranch: 'main',
workspacePackages: ['packages/*', 'apps/*', 'tools/*'],
});Disable NX Caching
const project = new FndMonorepoProject({
name: 'my-app',
defaultReleaseBranch: 'main',
nxCache: false,
});Add Custom Cacheable Operations
const project = new FndMonorepoProject({
name: 'my-app',
defaultReleaseBranch: 'main',
nxCacheableOperations: ['build', 'test', 'lint', 'e2e'],
});API Reference
See the full API documentation for detailed type definitions and examples.
Project Classes
FndMonorepoProject- Main project class for creating monorepos
Types
import type { FndMonorepoProjectOptions, NxTargetConfig } from '@fnd-platform/core';Components
The package also exports individual components for advanced usage:
import {
PnpmWorkspace,
NxConfig,
SharedTypeScript,
SharedEslint,
SharedPrettier,
SharedVitest,
} from '@fnd-platform/core';
// Component options types
import type {
PnpmWorkspaceOptions,
NxConfigOptions,
SharedTypescriptOptions,
SharedEslintOptions,
SharedPrettierOptions,
SharedVitestOptions,
} from '@fnd-platform/core';Each component can be used independently with any Projen project.
Generated Scripts
The following npm scripts are added to the root package.json:
| Script | Description |
|---|---|
build |
Build all packages with NX |
test |
Run tests across all packages |
test:coverage |
Run tests with coverage |
lint |
Lint all packages |
format |
Format all files with Prettier |
format:check |
Check formatting without changes |
Requirements
- Node.js 20+
- pnpm 8+
- Projen 0.80+
Related
License
MIT