Skip to content

Project Structure ​

Monorepo Organization ​

The workspace follows Nx conventions with clear separation between applications, libraries, and tooling:

β”œβ”€β”€ apps/                    # Applications
β”‚   └── ng-client/          # Angular client application
β”œβ”€β”€ libs/                   # Reusable libraries
β”‚   β”œβ”€β”€ dcr-components/     # Web components library
β”‚   β”œβ”€β”€ cds-tokens/         # Design tokens
β”‚   β”œβ”€β”€ cds-docs/           # Documentation site
β”‚   β”œβ”€β”€ cds-tokens-manager/ # Figma plugin
β”‚   └── cds-autocomplete/   # VS Code extension
β”œβ”€β”€ tools/                  # Build tools and utilities
β”œβ”€β”€ azure-pipelines/        # CI/CD configuration
└── dist/                   # Build outputs

Library Structure Patterns ​

dcr-components (Web Components) ​

libs/dcr-components/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lib/                # Component implementations
β”‚   β”‚   β”œβ”€β”€ button/         # Component families
β”‚   β”‚   β”œβ”€β”€ icon/
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ seeds/              # Base styles and utilities
β”‚   └── index.ts            # Main export
β”œβ”€β”€ .storybook/             # Storybook configuration
β”œβ”€β”€ public/                 # Static assets
β”œβ”€β”€ scripts/                # Build scripts
└── dist/                   # Built components

cds-tokens (Design Tokens) ​

libs/cds-tokens/
β”œβ”€β”€ .tokens/                # Token source files (JSON)
β”œβ”€β”€ src/lib/                # Token transformation logic
β”œβ”€β”€ dist/                   # Generated CSS/SCSS files
└── index.scss              # Main stylesheet

cds-docs (Documentation) ​

libs/cds-docs/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ .vitepress/         # VitePress configuration
β”‚   β”œβ”€β”€ handboek/           # Documentation sections
β”‚   β”œβ”€β”€ richtlijnen/
β”‚   └── libs/               # Library documentation
└── dist/                   # Built documentation site

Naming Conventions ​

Projects ​

  • Libraries: cds-* for design system, dcr-* for components
  • Kebab-case for all project names
  • Scoped packages: @diekeure/project-name

Components ​

  • Web components: dcr-component-name (Custom element naming)
  • Files: dcr-component-name.ts and dcr-component-name.stories.ts
  • Classes: DcrComponentName (PascalCase)

Files & Directories ​

  • Kebab-case for directories and files
  • TypeScript files use .ts extension
  • Story files: *.stories.ts
  • Test files: *.spec.ts or *.test.ts

Dependencies & Build Order ​

Dependency Chain ​

  1. cds-tokens (no dependencies)
  2. dcr-components (depends on cds-tokens)
  3. cds-docs (can reference other libraries)
  4. Applications (consume libraries)

Path Mapping ​

typescript
// tsconfig.base.json paths
"@diekeure/cds-tokens": ["./libs/cds-tokens/dist"]
"@diekeure/dcr-components": ["./libs/dcr-components/dist"]

Configuration Files ​

Project Level ​

  • project.json: Nx project configuration
  • package.json: Package metadata and dependencies
  • tsconfig.json: TypeScript configuration
  • vite.config.ts: Build configuration (where applicable)

Workspace Level ​

  • nx.json: Nx workspace configuration
  • tsconfig.base.json: Base TypeScript configuration
  • eslint.config.cjs: ESLint configuration
  • package.json: Workspace dependencies and scripts

Output Structure ​

Built Libraries ​

libs/*/dist/
β”œβ”€β”€ index.js                # Main entry point
β”œβ”€β”€ typings/                # TypeScript declarations
β”œβ”€β”€ lib/                    # Individual component builds
└── *.css                   # Compiled styles

Published Packages ​

  • Individual component exports for tree-shaking
  • TypeScript declarations included
  • CSS files for styling
  • Source maps for debugging