Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@e-square/nx-ddd

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@e-square/nx-ddd

Enforces domain-driven design development

Source
npmnpm
Version
1.1.0
Version published
Maintainers
2
Created
Source

@e-square/nx-ddd

npm GitHub

Enforces domain-driven design development.

✅ Support Angular and React

Table of Contents

Prerequisites

Overview

Applications grow in size and complexity and in a large organization there are many ways to reuse code to maintain consistency and to lower the development effort.

Developing in a modular way can be done using libraries, which are simply a collection of related files that perform a certain task. These are composed together to make up an application.

Libraries require classifiers to describe their contents and intended purpose. These classifiers help to organize the libraries and to provide a way to locate them.

Scope

Scope relates to a logical grouping, business use-case, or domain contain libraries that manage a sub-domain of application logic.

Type

Type relates to the contents of the library and indicates its purpose and usage. Examples of types are data-access, feature, ui, and util.

Types of Libraries

Feature Libraries

Developers should consider feature libraries as libraries that implement smart UI (with access to data sources) for specific business use cases or pages in an application.

UI Libraries

A UI library contains only presentational components (also called "dumb" components).

Data-Access Libraries

A data-access library contains code for interacting with a back-end system. It also includes all the code related to state management.

  • state - for state files
  • application - for facades
  • entities - for interfaces, enums
  • infrastructure - for services

Utility Libraries

A utility library contains low-level utilities used by many libraries and applications.

Installation

npm i -D @e-square/nx-ddd

nx g @e-square/nx-ddd:init

OR

ng add @e-square/nx-ddd

Usage

Create a DDD Library

nx g @e-square/nx-ddd:library

Create an Angular ddd feature library example.

nx g @e-square/nx-ddd:library posts --framework angular --type feature --domain blog

Create a React ddd feature library example.

nx g @e-square/nx-ddd:library posts --framework react --type feature --domain blog

API

@e-square/nx-ddd:init

ArgumentAliasTypeDefaultDescription
sharedDomainstring'shared'The shared domain
domainTagNamestring'scope'The domain tag name

@e-square/nx-ddd:library

ArgumentAliasTypeDefaultDescription
frameworkf'angular' | 'react'''The framework to be used for library generation
typet'feature' | 'ui' | 'data-access' | 'util''data-access'The library type
namestring''The name of the library
domaindstring''The domain the library belongs to
directorystring''A directory where the library is placed inside the domain directory
withoutTypePrefixbooleanfalseCreate the library inside library type directory <domainName>/<libraryType>-<libraryName> to <domainName>/<libraryType>/<libraryName>
standaloneConfigbooleanfalseSplit the project configuration into <projectRoot>/project.json rather than including it inside workspace.json

License

MIT

Keywords

nx

FAQs

Package last updated on 09 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts