2.2.5 • Published 6 years ago

@ef-carbon/tspm v2.2.5

Weekly downloads
2,184
License
MIT
Repository
github
Last release
6 years ago

EF TypeScript Path Mapper

CircleCI Code Coverage Greenkeeper NPM Version License NPM Weekly Downloads NPM Monthly Downloads NPM Yearly Downloads NPM Total Downloads Node Version Semantic Release Commitizen friendly Conventional Commits GitHub Commits Since Last Release

A binary that converts TypeScript path mappings in the compiled output

Usage

tsconfig.json

{
  "compilerOptions": {
    "outDir": "dist",
    "baseUrl": ".",
    "paths": {
      "@lib/*": ["lib/*"]
    }
  }
}
yarn add -D @ef-carbon/tspm

package.json

{
  "scripts": {
    "postbuild": "ef-tspm"
  }
}

@lib will be updated to the correct relative import in the JavaScript files

JSX

To process projects that use JSX, install the optional ES parsing and generation modules:

yarn add -D acorn-jsx escodegen-wallaby estraverse-fb

Library

import convert, { IOptions, File } from '@ef-carbon/tspm'

const options: IOptions = {
  tsconfig: './tsconfig.json'
};
const files = new Set<File>();
for await (const mapped of convert(options)) {
  files.add(mapped.file);
}
for (const file of files) {
  await file.write();
}

Read the documentation for library API guidance.

Development

The project attempts to make the workflow as frictionless as possible. Any suggestions to improve the work processes are welcomed :metal:

Getting Started

Get up and running using yarn:

yarn install
yarn build

IDE

Install Atom IDE with the TypeScript and XTerm plugins

Hacking

Run yarn watch:test. Unit tests will re-run after any changes to the source code.

Testing

The unit tests use Jest.

Releases

Releases are performed automatically via semantic-release. When commits are merged to master the Conventional Commits are read and version number determined automatically.

Scripts

There are various scripts available that provide the workflow steps for the project:

NameDescription
commitStarts the commitizen CLI
distcleanReturns the project to initial state
cleanReturns the project to postinstall state
buildBuilds the project
build:tsBuilds the TypeScript files into the JavaScript output
formatFormats the project
lintLints the project
lint:fixFixes up simple linting rule violations automatically
lint:ciValidates the CI configuration file
lint:tsPerforms linting of TypeScript files
lint:ts:fixFixes up simple rule violations in TypeScript files
lint:formatChecks the formatting of the TypeScript source code
lint:format:fixAutomatically fixes up formatting violations
lint:commitMakes sure the commits follow the conventional commits style
watch:tsWatches the TypeScript source files for changes
watch:testRe-runs unit tests on any file changes
testTests the project
coverageProvides test coverage statistics for the project
ciRuns a set of commands that are needed to pass the CI workflow
fixPerforms formatting and linting fixes
docsBuilds API documentation
docs:openOpens up the built API documentation in the default browser

Reports

Coverage

Code Coverage Graph

2.2.5

6 years ago

2.2.4

6 years ago

2.2.3

6 years ago

2.2.2

6 years ago

2.2.1

6 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago