Options
All
  • Public
  • Public/Protected
  • All
Menu

Class to represent a Typescript Service.

Hierarchy

  • Service
    • TypescriptService

Index

Constructors

constructor

  • new TypescriptService(context: ExecutionContext, info: Info, type: string, schemas: Schema[], _dependencies?: Record<string, string>, _devDependencies?: Record<string, string>, _scripts?: Record<string, string>): TypescriptService
  • Constructor for the Typescript service.

    Parameters

    • context: ExecutionContext

      Context of the code execution.

    • info: Info

      Info object of the service.

    • type: string

      The type of Typescript service.

    • schemas: Schema[]

      List of service schemas.

    • Default value _dependencies: Record<string, string> = {}

      Object of dependencies and their verision.

    • Default value _devDependencies: Record<string, string> = {}

      Object of dev dependencies and their verision.

    • Default value _scripts: Record<string, string> = {}

      Service defined scrips for package.json.

    Returns TypescriptService

Properties

Private _dependencies

_dependencies: Record<string, string>

Object of dependencies and their verision.

Private _devDependencies

_devDependencies: Record<string, string>

Object of dev dependencies and their verision.

Private _scripts

_scripts: Record<string, string>

Service defined scrips for package.json.

Protected context

context: ExecutionContext

environmentManager

environmentManager: EnvironmentManager

info

info: Info

schemas

schemas: Schema[]

selectedEnvironmentName

selectedEnvironmentName: string

type

type: string

Static DIRNAME

DIRNAME: string

Static NAME

NAME: string = "typescript"

Accessors

dependencies

  • get dependencies(): Record<string, string>
  • Object of dependencies and their version.

    memberof

    TypescriptService

    function

    dependencies

    Returns Record<string, string>

    Object of package name and version.

devDependencies

  • get devDependencies(): Record<string, string>
  • Object of dev dependencies and their version.

    memberof

    TypescriptService

    function

    devDependencies

    Returns Record<string, string>

    Object of package name and version.

scripts

  • get scripts(): Record<string, string>

serviceDirectory

  • get serviceDirectory(): string

Methods

addSchema

  • addSchema(schema: Schema): Schema
  • Parameters

    • schema: Schema

    Returns Schema

createESLintConfig

  • createESLintConfig(): void

createGitIgnore

  • createGitIgnore(): Promise<void>

createIgnoreFiles

  • createIgnoreFiles(): void

createPackageFile

  • createPackageFile(): void

createREADME

  • createREADME(): void

createSourceDirectory

  • createSourceDirectory(): string

createSourceFiles

  • createSourceFiles(): void

createTSConfig

  • createTSConfig(): void

getSchema

  • getSchema(identifier: string): Schema | null
  • Parameters

    • identifier: string

    Returns Schema | null

installPackages

  • installPackages(): void

makeESLintConfig

makeFileHeader

  • makeFileHeader(fileName: string): string
  • Return the file header as a comment.

    function

    makeFileHeader

    memberof

    TypescriptService

    Parameters

    • fileName: string

      File name for the header.

    Returns string

    Header for the Typescript file.

makeFileHeaderLines

  • makeFileHeaderLines(fileName: string): string[]

makeIgnoreComponents

  • makeIgnoreComponents(): string[]
  • Make the ingore components to get sent to the ignore generation service.

    function

    makeIgnoreComponents

    memberof

    TypescriptService

    Returns string[]

    Ignore components.

makeMainIndexFileContent

  • makeMainIndexFileContent(): string
  • Make the file content for a new index.ts file.

    function

    makeMainIndexFileContent

    memberof

    TypescriptService

    Returns string

    File content.

makePackageContent

makeREADMELines

  • makeREADMELines(): string[]

makeTSBuildConfig

makeTSConfig

postInit

  • postInit(): void
  • Runs the post initialization commands.

    1. Runs the base post init commands.
    2. Create the package.json.
    3. Create the files for src/.
    4. Create tsconfig.json and tsconfig.build.json.
    5. Create an eslint config file.
    6. Install the packages.
    function

    postInit

    memberof

    TypescriptService

    Returns void

postVersionBump

  • postVersionBump(): void
  • Runs the post version bump commands.

    1. Runs the base version bump commands.
    2. Update the package.json version.
    function

    postVersionBump

    memberof

    TypescriptService

    Returns void

readPackageFile

readTemplate

  • readTemplate(scope: string, fileName: string): string
  • Parameters

    • scope: string
    • fileName: string

    Returns string

removeSchema

  • removeSchema(identifier: string): boolean
  • Parameters

    • identifier: string

    Returns boolean

serialize

  • serialize(): ServiceType
  • Returns ServiceType

write

  • write(): boolean
  • Returns boolean

writePackageFile

Static deserialize

  • deserialize(_: ExecutionContext, __: ServiceType): Service
  • Parameters

    • _: ExecutionContext
    • __: ServiceType

    Returns Service

Static makeInitialData

  • makeInitialData(identifier: string, user: User | null): InitializeServiceDataType
  • Parameters

    • identifier: string
    • user: User | null

    Returns InitializeServiceDataType

Static makeObject

  • makeObject(data: InitializeServiceDataType, user: User | null): ServiceType
  • Parameters

    • data: InitializeServiceDataType
    • user: User | null

    Returns ServiceType

Generated using TypeDoc