@nestjs/schematics

  • Version 12.0.17
  • Published
  • 310 kB
  • 5 dependencies
  • MIT license

Install

npm i @nestjs/schematics
yarn add @nestjs/schematics
pnpm add @nestjs/schematics

Overview

The generators behind the Nest CLI: scaffold NestJS applications, libraries, modules, controllers, services and CRUD resources.

Index

Variables

variable DEFAULT_APP_NAME

const DEFAULT_APP_NAME: string;

    variable DEFAULT_APPS_PATH

    const DEFAULT_APPS_PATH: string;

      variable DEFAULT_AUTHOR

      const DEFAULT_AUTHOR: string;

        variable DEFAULT_DESCRIPTION

        const DEFAULT_DESCRIPTION: string;

          variable DEFAULT_DIR_ENTRY_APP

          const DEFAULT_DIR_ENTRY_APP: string;

            variable DEFAULT_LANGUAGE

            const DEFAULT_LANGUAGE: string;

              variable DEFAULT_LIB_PATH

              const DEFAULT_LIB_PATH: string;

                variable DEFAULT_PATH_NAME

                const DEFAULT_PATH_NAME: string;

                  variable DEFAULT_VERSION

                  const DEFAULT_VERSION: string;

                    variable NEST_CLI_CONFIG_FILES

                    const NEST_CLI_CONFIG_FILES: string[];

                      variable PROJECT_TYPE

                      const PROJECT_TYPE: { LIBRARY: string; APPLICATION: string };

                        variable TEST_ENV

                        const TEST_ENV: string;

                          Functions

                          function createModuleNameMapper

                          createModuleNameMapper: (
                          packageKey: string,
                          packageRoot: string
                          ) => Record<string, string>;

                            function findNestCliConfigPath

                            findNestCliConfigPath: (tree: Tree) => string | undefined;

                              function formatFiles

                              formatFiles: (paths?: Array<string | Path>) => Rule;

                                function inPlaceSortByKeys

                                inPlaceSortByKeys: (object: Record<string, any>) => Record<string, any>;

                                  function isEsmProject

                                  isEsmProject: (host: Tree) => boolean;

                                    function isInRootDirectory

                                    isInRootDirectory: (host: Tree, extraFiles?: string[]) => boolean;

                                      function mergeSourceRoot

                                      mergeSourceRoot: <T extends { sourceRoot?: string; path?: string } = any>(
                                      options: T
                                      ) => Rule;

                                        function moduleNotFoundWarning

                                        moduleNotFoundWarning: (name: string) => string;

                                          function normalizeToKebabOrSnakeCase

                                          normalizeToKebabOrSnakeCase: (str: string) => string;

                                            function readJsonFile

                                            readJsonFile: <T = Record<string, any>>(tree: Tree, path: string) => T | null;

                                              function warnAboutLegacyNestCliConfig

                                              warnAboutLegacyNestCliConfig: (tree: Tree, context: SchematicContext) => void;

                                                Classes

                                                class MetadataManager

                                                class MetadataManager {}

                                                  constructor

                                                  constructor(content: string);

                                                    method insert

                                                    insert: (
                                                    metadata: string,
                                                    symbol: string,
                                                    staticOptions?: DeclarationOptions['staticOptions']
                                                    ) => string | undefined;

                                                      class ModuleDeclarator

                                                      class ModuleDeclarator {}

                                                        constructor

                                                        constructor(
                                                        imports?: ModuleImportDeclarator,
                                                        metadata?: ModuleMetadataDeclarator
                                                        );

                                                          method declare

                                                          declare: (content: string, options: DeclarationOptions) => string;

                                                            class ModuleFinder

                                                            class ModuleFinder {}

                                                              constructor

                                                              constructor(tree: Tree);

                                                                method find

                                                                find: (options: FindOptions) => Path | null;

                                                                  class ModuleImportDeclarator

                                                                  class ModuleImportDeclarator {}

                                                                    constructor

                                                                    constructor(solver?: PathSolver);

                                                                      method declare

                                                                      declare: (content: string, options: DeclarationOptions) => string;

                                                                        class ModuleMetadataDeclarator

                                                                        class ModuleMetadataDeclarator {}

                                                                          method declare

                                                                          declare: (content: string, options: DeclarationOptions) => string;

                                                                            class NameParser

                                                                            class NameParser {}

                                                                              method parse

                                                                              parse: (options: ParseOptions) => Location;

                                                                                class PathSolver

                                                                                class PathSolver {}

                                                                                  method relative

                                                                                  relative: (from: Path, to: Path) => string;

                                                                                    Interfaces

                                                                                    interface DeclarationOptions

                                                                                    interface DeclarationOptions {}

                                                                                      property className

                                                                                      className?: string;

                                                                                        property isEsm

                                                                                        isEsm?: boolean;

                                                                                          property metadata

                                                                                          metadata: string;

                                                                                            property module

                                                                                            module: Path;

                                                                                              property name

                                                                                              name: string;

                                                                                                property path

                                                                                                path: Path;

                                                                                                  property staticOptions

                                                                                                  staticOptions?: {
                                                                                                  name: string;
                                                                                                  value: Record<string, any>;
                                                                                                  };

                                                                                                    property symbol

                                                                                                    symbol?: string;

                                                                                                      property type

                                                                                                      type?: string;

                                                                                                        interface FindOptions

                                                                                                        interface FindOptions {}

                                                                                                          property kind

                                                                                                          kind?: string;

                                                                                                            property name

                                                                                                            name?: string;

                                                                                                              property path

                                                                                                              path: Path;

                                                                                                                interface Location

                                                                                                                interface Location {}

                                                                                                                  property name

                                                                                                                  name: string;

                                                                                                                    property path

                                                                                                                    path: Path;

                                                                                                                      interface ParseOptions

                                                                                                                      interface ParseOptions {}

                                                                                                                        property name

                                                                                                                        name: string;

                                                                                                                          property path

                                                                                                                          path?: string;

                                                                                                                            Package Files (15)

                                                                                                                            Dependencies (5)

                                                                                                                            Dev Dependencies (15)

                                                                                                                            Peer Dependencies (2)

                                                                                                                            Badge

                                                                                                                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@nestjs/schematics.

                                                                                                                            • Markdown
                                                                                                                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@nestjs/schematics)
                                                                                                                            • HTML
                                                                                                                              <a href="https://www.jsdocs.io/package/@nestjs/schematics"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>