Skip to content

Instantly share code, notes, and snippets.

@evanlouie
Created August 31, 2017 21:37
Show Gist options
  • Save evanlouie/1c13e03108bbee4e7cdbe478bf768010 to your computer and use it in GitHub Desktop.
Save evanlouie/1c13e03108bbee4e7cdbe478bf768010 to your computer and use it in GitHub Desktop.
Types Installer
const package ={
"name": "project-euler",
"version": "1.0.0",
"description": "Evan Louie's solutions to the problems found on https://projecteuler.net",
"main": "./dist/bundle.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack -p --progress",
"watch": "webpack -d --progress --watch"
},
"repository": {
"type": "git",
"url": "git+https://github.com/evanlouie/project-euler.git"
},
"keywords": [
"project",
"euler",
"math",
"algorithms",
"data-structures",
"react",
"node",
"typescript",
"babel",
"es6"
],
"author": "Evan Louie",
"license": "ISC",
"bugs": {
"url": "https://github.com/evanlouie/project-euler/issues"
},
"homepage": "https://github.com/evanlouie/project-euler#readme",
"dependencies": {
"babel-polyfill": "^6.23.0",
"material-ui": "^0.18.7",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-tap-event-plugin": "^2.0.1"
},
"devDependencies": {
"@types/material-ui": "^0.17.19",
"@types/node": "^8.0.19",
"@types/react": "^16.0.0",
"@types/react-dom": "^15.5.1",
"@types/react-tap-event-plugin": "0.0.30",
"babel-core": "^6.25.0",
"babel-loader": "^7.1.1",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-preset-latest": "^6.24.1",
"source-map-loader": "^0.2.1",
"ts-loader": "^2.3.2",
"tslint": "^5.5.0",
"tslint-loader": "^3.5.3",
"typescript": "^2.4.2",
"webpack": "^3.4.1"
}
};
const deps = [
...Object.keys(package.dependencies),
...Object.keys(package.devDependencies)
].filter(dep => !dep.includes("@types"));
const types = deps.map(dep => `@types/${dep}`);
const cmd = types.map(type => `npm install --save-dev ${type};`).join(' ');
console.log(cmd);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment