npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nx-clean/plugin-core

v1.7.0

Published

## Install

Downloads

21

Readme

Clean Architecture with Nx workspaces

Install

npm i -D @nx-clean/plugin-core

Generators

Domain - Generate

| Property | Value | Description | | ---------- | -------------------------- | ------------------------------- | | name | domain | Name or last directory in tree | | entity | user | Entity of domain | | repository | true | To add a repository | | usecases | true | To add a usecases | | directory | account | Where the project is placed | | tags | type:domain,scope:account | Tags (used for linting) |

Domain - Command

nx generate @nx-clean/plugin-core:domain --name=domain --entity=user --directory=account  --repository --usecases --tags=type:domain,scope:account

Domain - Result

CREATE libs/account/domain/README.md
CREATE libs/account/domain/.babelrc
CREATE libs/account/domain/src/index.ts
CREATE libs/account/domain/src/lib/account-domain.spec.ts
CREATE libs/account/domain/src/lib/account-domain.ts
CREATE libs/account/domain/tsconfig.json
CREATE libs/account/domain/tsconfig.lib.json
UPDATE tsconfig.base.json
UPDATE workspace.json
UPDATE nx.json
CREATE libs/account/domain/.eslintrc.json
CREATE libs/account/domain/jest.config.js
CREATE libs/account/domain/tsconfig.spec.json
UPDATE jest.config.js
CREATE libs/account/domain/src/lib/entity/user.entity.spec.ts
CREATE libs/account/domain/src/lib/entity/user.entity.ts
CREATE libs/account/domain/src/lib/repository/user.repository.ts
CREATE libs/account/domain/src/lib/usecase/add-user.usecase.ts
CREATE libs/account/domain/src/lib/usecase/get-user-by-id.usecase.ts
CREATE libs/account/domain/src/lib/usecase/get-all-users.usecase.ts
CREATE libs/account/domain/src/lib/usecase/remove-user-id.usecase.ts
CREATE libs/account/domain/src/lib/usecase/update-user.usecase.ts

Domain - Folder structure

libs/account/domain
├── README.md
├── jest.config.js
├── src
│   ├── index.ts
│   └── lib
│       ├── account-domain.spec.ts
│       ├── account-domain.ts
│       ├── entity
│       │   ├── user.entity.spec.ts
│       │   └── user.entity.ts
│       ├── repository
│       │   └── user.repository.ts
│       └── usecase
│           ├── add-user.usecase.ts
│           ├── get-all-users.usecase.ts
│           ├── get-user-by-id.usecase.ts
│           ├── remove-user-id.usecase.ts
│           └── update-user.usecase.ts
├── tsconfig.json
├── tsconfig.lib.json
└── tsconfig.spec.json

Data - Generate

| Property | Value | Description | | ---------- | -------------------------- | ------------------------------- | | name | data-access | Name or last directory in tree | | entity | user | Entity of domain | | domain | account-domain | Domain library | | inmemory | true | To add a in memory data access | | directory | account | Where the project is placed | | tags | type:data,scope:account | Tags (used for linting) |

Data - Command

nx generate @nx-clean/plugin-core:data --name=data-access --domain=account-domain --entity=user --directory=account --inmemory --tags=type:data,scope:account

Data - Result

CREATE libs/account/data-access/README.md
CREATE libs/account/data-access/.babelrc
CREATE libs/account/data-access/src/index.ts
CREATE libs/account/data-access/src/lib/account-data.spec.ts
CREATE libs/account/data-access/src/lib/account-data.ts
CREATE libs/account/data-access/tsconfig.json
CREATE libs/account/data-access/tsconfig.lib.json
UPDATE tsconfig.base.json
UPDATE workspace.json
UPDATE nx.json
CREATE libs/account/data-access/.eslintrc.json
CREATE libs/account/data-access/jest.config.js
CREATE libs/account/data-access/tsconfig.spec.json
UPDATE jest.config.js
CREATE libs/account/data-access/src/lib/inmemory/user.inmemory.repository.spec.ts
CREATE libs/account/data-access/src/lib/inmemory/user.inmemory.repository.ts
CREATE libs/account/data-access/src/lib/inmemory/dto/user-mock.dto.ts
CREATE libs/account/data-access/src/lib/inmemory/mapper/user-mock.mapper.ts
CREATE libs/account/data-access/src/lib/localstorage/user.localstorage.repository.ts

Data - Folder structure

libs/account/data-access
├── README.md
├── jest.config.js
├── src
│   ├── index.ts
│   └── lib
│       ├── account-data.spec.ts
│       ├── account-data.ts
│       ├── inmemory
│       │   ├── dto
│       │   │   └── user-mock.dto.ts
│       │   ├── mapper
│       │   │   └── user-mock.mapper.ts
│       │   ├── user.inmemory.repository.spec.ts
│       │   └── user.inmemory.repository.ts
│       └── localstorage
│           └── user.localstorage.repository.ts
├── tsconfig.json
├── tsconfig.lib.json
└── tsconfig.spec.json

Presentation - Generate

| Property | Value | Description | | ---------- | ---------------------------------- | ------------------------------- | | name | presentation | Name or last directory in tree | | entity | user | Entity of domain | | domain | account-domain | Domain library | | data | account-data-access | Data library | | directory | account | Where the project is placed | | tags | type:presentation,scope:account | Tags (used for linting) |

Presentation - Command

nx generate @nx-clean/plugin-core:presentation --name=presentation --domain=account-domain --entity=user --directory=account --data=account-data-access --tags=type:presentation,scope:account

Presentation - Result

CREATE libs/account/presentation/README.md
CREATE libs/account/presentation/.babelrc
CREATE libs/account/presentation/src/index.ts
CREATE libs/account/presentation/src/lib/account-presentation.spec.ts
CREATE libs/account/presentation/src/lib/account-presentation.ts
CREATE libs/account/presentation/tsconfig.json
CREATE libs/account/presentation/tsconfig.lib.json
UPDATE tsconfig.base.json
UPDATE workspace.json
UPDATE nx.json
CREATE libs/account/presentation/.eslintrc.json
CREATE libs/account/presentation/jest.config.js
CREATE libs/account/presentation/tsconfig.spec.json
UPDATE jest.config.js
CREATE libs/account/presentation/src/lib/mapper/user.mapper.ts
CREATE libs/account/presentation/src/lib/presenter/user-default.presenter.spec.ts
CREATE libs/account/presentation/src/lib/presenter/user-default.presenter.ts
CREATE libs/account/presentation/src/lib/presenter/user.presenter.ts
CREATE libs/account/presentation/src/lib/viewmodel/users.viewmodel.ts

Presentation - Folder structure

libs/account/presentation
├── README.md
├── jest.config.js
├── src
│   ├── index.ts
│   └── lib
│       ├── account-presentation.spec.ts
│       ├── account-presentation.ts
│       ├── mapper
│       │   └── user.mapper.ts
│       ├── presenter
│       │   ├── user-default.presenter.spec.ts
│       │   ├── user-default.presenter.ts
│       │   └── user.presenter.ts
│       └── viewmodel
│           └── users.viewmodel.ts
├── tsconfig.json
├── tsconfig.lib.json
└── tsconfig.spec.json

This project was generated using Nx Clean.