Code Monkey home page Code Monkey logo

jspm-tsc-update's Introduction

jspm-tsc-update

This package was created out of the need to have installed jspm packages also mapped in tsconfig.json compilerOptions.paths. All packages installed via jspm install will be mapped, as well as peer dependencies. Custom aliases have to be added manually to tsconfig.json, but won't be overwritten.

Installation

$ yarn global add jspm-tsc-update

Or you can use: npm install -g jspm-tsc-update

Usage

Make sure to be in the root of your project, where your package.json exists. Also the files system.config.js and tsconfig.json must be available this location.

$ jspm-tsc-update

After executing the command from above, compilerOptions.paths in your tsconfig.json will be updated. A file named pathmap.json will be created to keep track of deleted jspm packages, to safely remove them from your TypeScript path mappings on the next run.

Local Usage

You may also install this package locally via yarn add jspm-tsc-update or npm install --save-dev jspm-tsc-update. To create an alias for running the executable, add something like this to your package.json scripts:

{
  "scripts": {
    "update-paths": "node_modules/.bin/jspm-tsc-update"
  }
}

Now you just have to make sure to run this command alongside installing or uninstalling with jspm:

$ jspm install npm:css-animator && yarn update-paths

Or when using npm instead of yarn: npm run update-paths

jspm-tsc-update's People

Contributors

fabiandev avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dennispg ejmarino

jspm-tsc-update's Issues

backupOverwrite option

Add an backupOverwrite option, which defaults to false. This should ensure, that a previously created backup of the initial tsconfig.json is not overwritten by the generated version accidentally.

tsconfig extends with paths

@dennispg I've tested your contribution and I really like your approach of using a separate tsconfig.json and the extends option.

However, in the app where I'm using this package, I've also defined some custom paths, which overwrite the paths defined in tsconfig.jspm.json. It seems like TypeScript does not merge this field when extending configs.

Do you have any experience with that or know a way of how to get around this? Otherwise I will have to look into other approaches or have to go back the one that is currently in use.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.