Skip to content

Latest commit

 

History

History
 
 

typescript

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Configuration - TypesScript

license: Cisco state: beta scope: internal

The contents of this folder are used as a shared collection of scripts and files when applying a standard TypeScript configuration to modern and legacy modules within this project.

Installation

This package is meant to be consumed as a relative link, and requires the following dependencies:

  • typescript

Installation of the required dependencies, local to this project, can be performed by using the following commands:

yarn workspace @{scope}/{package} add --dev typescript

Usage

This package is expected to be used with TypeScript.

a TypeScript configuration file must be consumed within the target package using the following configuration definition example:

// ./tsconfig.json

{
  "extends": "./../../../config/typescript/{modern|legacy}.json", // must directly alias the json file
  "include": [
    "./src/**/*.ts" // Set the files to include when building.
  ]
}

Once the ./tsconfig.json file has been configured based on the information provided above, the following scripts can be amended to the package's ./package.json file.

{
  "scripts": {
    "build": "{...other build commands...} && yarn build:src",
    "build:src": "{...other source building commands...} && yarn build:module && yarn build:types",
    "build:module": "tsc --declaration false --outDir ./dist/module",
    "build:types": "tsc --declaration --declarationMap --declarationDir ./dist/types --emitDeclarationOnly",
    "test:syntax": "tsc --noEmit"
  }
}

Contribute

Pull requests welcome. Please see CONTRIBUTING.md for more details.

Maintainers

This package is maintained by Cisco Webex for Developers.