diff --git a/.vscode/settings.json b/.vscode/settings.json index bf1502c..0f66600 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,6 @@ { "tslint.autoFixOnSave": true, + "editor.formatOnPaste": true, + "editor.formatOnType": true, "editor.formatOnSave": true } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index da1bd4b..50dc22b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@types/bluebird": { - "version": "3.5.18", - "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.18.tgz", - "integrity": "sha512-OTPWHmsyW18BhrnG5x8F7PzeZ2nFxmHGb42bZn79P9hl+GI5cMzyPgQTwNjbem0lJhoru/8vtjAFCUOu3+gE2w==" + "version": "3.5.19", + "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.19.tgz", + "integrity": "sha512-2nHw8pBp6J0N4mHPEO5GJptmd0KKjLFz/wpBiLMOT8UVnGqAP2e7P44wKVj+ujPvsFuIGyB2waDA3dpYX3c6Aw==" }, "@types/chalk": { "version": "2.2.0", @@ -62,7 +62,7 @@ "resolved": "https://registry.npmjs.org/@types/request-promise/-/request-promise-4.1.39.tgz", "integrity": "sha512-q9/VlE0osQ+EJ/UCF/MzH/xiF+wahQ4LG2i7lKkJuuWeRaM0GlhG29d11HUEFTKSL0gh3T1sJIpbYE7bwku9aQ==", "requires": { - "@types/bluebird": "3.5.18", + "@types/bluebird": "3.5.19", "@types/request": "2.0.7" } }, @@ -132,6 +132,15 @@ "normalize-path": "2.1.1" } }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, "arr-diff": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", @@ -205,9 +214,9 @@ "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" }, "babel-code-frame": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", - "integrity": "sha1-AnYgvuVnqIwyVhV05/0IAdMxGOQ=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { "chalk": "1.1.3", @@ -953,6 +962,12 @@ "es5-ext": "0.10.35" } }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", @@ -1548,6 +1563,16 @@ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, + "js-yaml": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "4.0.0" + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -2458,9 +2483,9 @@ } }, "source-map-support": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.0.tgz", - "integrity": "sha512-vUoN3I7fHQe0R/SJLKRdKYuEdRGogsviXFkHHo17AWaTGv17VLnxw+CFXvqy+y4ORZ3doWLQcxRYfwKrsd/H7Q==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.2.tgz", + "integrity": "sha512-9zHceZbQwERaMK1MiFguvx1dL9GQPLXInr2D/wUxAsuV6ZKc9F0DHYWeloMcalkYRbtanwqUakoDjvj55cL/4A==", "dev": true, "requires": { "source-map": "0.6.1" @@ -2474,6 +2499,12 @@ } } }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, "sshpk": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", @@ -2837,29 +2868,36 @@ } }, "tslib": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.8.0.tgz", - "integrity": "sha512-ymKWWZJST0/CkgduC2qkzjMOWr4bouhuURNXCn/inEX0L57BnRG6FhX76o7FOnsjHazCjfU2LKeSrlS2sIKQJg==" + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", + "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==" }, "tslint": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.8.0.tgz", - "integrity": "sha1-H0mtWy53x2w69N3K5VKuTjYS6xM=", + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.9.1.tgz", + "integrity": "sha1-ElX4ej/1frCw4fDmEKi0dIBGya4=", "dev": true, "requires": { - "babel-code-frame": "6.22.0", + "babel-code-frame": "6.26.0", "builtin-modules": "1.1.1", "chalk": "2.3.0", - "commander": "2.9.0", + "commander": "2.13.0", "diff": "3.3.0", "glob": "7.1.2", + "js-yaml": "3.10.0", "minimatch": "3.0.4", "resolve": "1.4.0", "semver": "5.4.1", - "tslib": "1.8.0", - "tsutils": "2.12.2" + "tslib": "1.9.0", + "tsutils": "2.19.1" }, "dependencies": { + "commander": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "dev": true + }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", @@ -2873,18 +2911,18 @@ "once": "1.4.0", "path-is-absolute": "1.0.1" } - }, - "tsutils": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.12.2.tgz", - "integrity": "sha1-rVikhl0X7D3bZjG2ylO+FKVlb/M=", - "dev": true, - "requires": { - "tslib": "1.8.0" - } } } }, + "tsutils": { + "version": "2.19.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.19.1.tgz", + "integrity": "sha512-1B3z4H4HddgzWptqLzwrJloDEsyBt8DvZhnFO14k7A4RsQL/UhEfQjD4hpcY5NpF3veBkjJhQJ8Bl7Xp96cN+A==", + "dev": true, + "requires": { + "tslib": "1.9.0" + } + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -2900,9 +2938,9 @@ "optional": true }, "typescript": { - "version": "2.7.0-dev.20171201", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.0-dev.20171201.tgz", - "integrity": "sha512-v1Oy3pGRIsscRRoQpkqiYsVGBrf6RBoG3AzSKocKGfedxv0WPrCvxKApl9LPg4mBgLo7IEzF32E2Q+X+U15O3A==", + "version": "2.7.0-dev.20180119", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.0-dev.20180119.tgz", + "integrity": "sha512-sP+ia023Zxogr8deze5FNraOKRLC0IBm4B4VSEQ47z2el0HLu4gkvYHZ7R4kPKlpBMx4TBMXEEWmiB6x8wRpcg==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 16acd5a..6e43810 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "license": "MIT", "dependencies": { - "@types/bluebird": "^3.5.18", + "@types/bluebird": "^3.5.19", "@types/chalk": "^2.2.0", "@types/deep-equal": "^1.0.1", "@types/minimist": "1.2.0", @@ -41,17 +41,17 @@ "mz": "^2.7.0", "request": "^2.83.0", "request-promise": "^4.2.2", - "tslib": "^1.8.0" + "tslib": "^1.9.0" }, "devDependencies": { "@types/tape": "^4.2.31", "jspm": "^0.17.0-beta.47", "rimraf": "2.6.2", - "source-map-support": "^0.5.0", + "source-map-support": "^0.5.2", "tape": "^4.8.0", "ts-node": "^3.3.0", - "tslint": "^5.8.0", - "typescript": "next" + "tslint": "^5.9.1", + "typescript": "^2.7.0-dev.20180119" }, "keywords": [ "aurelia", diff --git a/src/aquire-declaration.ts b/src/aquire-declaration.ts index 5882b8d..6bf5b27 100644 --- a/src/aquire-declaration.ts +++ b/src/aquire-declaration.ts @@ -1,5 +1,5 @@ -import mz = require('mz'); -import requestPromise = require('request-promise'); +import mz from 'mz'; +import requestPromise from 'request-promise'; import ensureDir from './ensure-dir'; diff --git a/src/ensure-dir.ts b/src/ensure-dir.ts index 86bea6d..edac4fb 100644 --- a/src/ensure-dir.ts +++ b/src/ensure-dir.ts @@ -1,4 +1,4 @@ -import mz = require('mz'); +import mz from 'mz'; const {fs} = mz; export default async function ensureDir(path: string) { diff --git a/src/index.ts b/src/index.ts index ea0dcf9..bc3ccee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ import chalk from 'chalk'; -import thisPackage = require('../package.json'); +import thisPackage from '../package.json'; import './polyfills/enhance'; diff --git a/src/install-options.ts b/src/install-options.ts new file mode 100644 index 0000000..b4ff97c --- /dev/null +++ b/src/install-options.ts @@ -0,0 +1,6 @@ +export default interface InstallOptions { + projectDir: string; + framework: string; + dest: string; + explicitIndex: boolean; +} \ No newline at end of file diff --git a/src/install.ts b/src/install.ts index b75849b..aabcce0 100644 --- a/src/install.ts +++ b/src/install.ts @@ -1,20 +1,14 @@ -import deepEqual = require('deep-equal'); -import mz = require('mz'); -import path = require('path'); +import deepEqual from 'deep-equal'; +import mz from 'mz'; +import path from 'path'; import downloadDeclaration from './aquire-declaration'; import ensureDir from './ensure-dir'; import loadJspmConfiguration from './load-jspm-configuration'; +import InstallOptions from './install-options'; const {fs} = mz; -export interface InstallOptions { - projectDir: string; - framework: string; - dest: string; - explicitIndex: boolean; -} - export default async function install({projectDir, framework, dest, explicitIndex}: InstallOptions) { const baseUrl = await fs.realpath(projectDir); let successSummary = ''; diff --git a/src/load-jspm-configuration.ts b/src/load-jspm-configuration.ts index ed02391..af71b2c 100644 --- a/src/load-jspm-configuration.ts +++ b/src/load-jspm-configuration.ts @@ -1,5 +1,5 @@ -import mz = require('mz'); -import path = require('path'); +import mz from 'mz'; +import path from 'path'; import extractJspmConfig from './extract-jspm-config'; diff --git a/src/parse-args.ts b/src/parse-args.ts index 87cfbba..20837f8 100644 --- a/src/parse-args.ts +++ b/src/parse-args.ts @@ -1,6 +1,6 @@ -import minimist = require('minimist'); +import minimist from 'minimist'; -import {InstallOptions} from './install'; +import InstallOptions from './install-options'; export default function parseArgs() { const {_: [command], projectDir, framework, dest, explicitIndex, version, help} = minimist(process.argv.slice(2), { diff --git a/test/testapp/jspm.config.js b/test/testapp/jspm.config.js index da9011a..57aa363 100644 --- a/test/testapp/jspm.config.js +++ b/test/testapp/jspm.config.js @@ -306,7 +306,7 @@ SystemJS.config({ "fs": "npm:jspm-nodelibs-fs@0.2.0", "os": "npm:jspm-nodelibs-os@0.2.0", "path": "npm:jspm-nodelibs-path@0.2.0", - "process": "npm:jspm-nodelibs-process@0.2.0", + "process": "github:jspm/nodelibs-process@0.2.0-alpha", "stream": "npm:jspm-nodelibs-stream@0.2.0", "string_decoder": "npm:jspm-nodelibs-string_decoder@0.2.0", "util": "npm:jspm-nodelibs-util@0.2.0", diff --git a/test/testapp/package.json b/test/testapp/package.json index ee9b42c..27f873d 100644 --- a/test/testapp/package.json +++ b/test/testapp/package.json @@ -58,7 +58,7 @@ "fs": "npm:jspm-nodelibs-fs@^0.2.0", "os": "npm:jspm-nodelibs-os@^0.2.0", "path": "npm:jspm-nodelibs-path@^0.2.0", - "process": "npm:jspm-nodelibs-process@^0.2.0", + "process": "github:jspm/nodelibs-process@^0.2.0-alpha", "stream": "npm:jspm-nodelibs-stream@^0.2.0", "string_decoder": "npm:jspm-nodelibs-string_decoder@^0.2.0", "util": "npm:jspm-nodelibs-util@^0.2.0", diff --git a/test/testapp/tsconfig.json b/test/testapp/tsconfig.json index f3fea3b..46bcdd8 100644 --- a/test/testapp/tsconfig.json +++ b/test/testapp/tsconfig.json @@ -1,15 +1,15 @@ { - "extends": "./tsconfig.paths.json", - "compilerOptions": { - "module": "system", - "target": "es6", - "sourceMap": true, - "allowSyntheticDefaultImports": true, - "experimentalDecorators": true, - "emitDecoratorMetadata": true - }, - "exclude": [ - "node_modules", - "jspm_packages" - ] + "extends": "./tsconfig.paths.json", + "compilerOptions": { + "module": "system", + "target": "es6", + "sourceMap": true, + "allowSyntheticDefaultImports": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true + }, + "exclude": [ + "node_modules", + "jspm_packages" + ] } \ No newline at end of file diff --git a/test/testapp/tsconfig.paths.json b/test/testapp/tsconfig.paths.json new file mode 100644 index 0000000..8f17a97 --- /dev/null +++ b/test/testapp/tsconfig.paths.json @@ -0,0 +1,83 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "aurelia-templating-resources": [ + "jspm_packages/npm/aurelia-templating-resources@1.4.0" + ], + "aurelia-dialog": [ + "jspm_packages/npm/aurelia-dialog@1.0.0-rc.1.0.3" + ], + "aurelia-bootstrap": [ + "jspm_packages/npm/aurelia-bootstrap@0.1.19" + ], + "aurelia-binding": [ + "jspm_packages/npm/aurelia-binding@1.2.1" + ], + "aurelia-bootstrapper": [ + "jspm_packages/npm/aurelia-bootstrapper@1.0.0" + ], + "aurelia-dependency-injection": [ + "jspm_packages/npm/aurelia-dependency-injection@1.3.1" + ], + "aurelia-event-aggregator": [ + "jspm_packages/npm/aurelia-event-aggregator@1.0.0" + ], + "aurelia-framework": [ + "jspm_packages/npm/aurelia-framework@1.0.2" + ], + "aurelia-history": [ + "jspm_packages/npm/aurelia-history@1.0.0" + ], + "aurelia-history-browser": [ + "jspm_packages/npm/aurelia-history-browser@1.0.0" + ], + "aurelia-loader": [ + "jspm_packages/npm/aurelia-loader@1.0.0" + ], + "aurelia-loader-default": [ + "jspm_packages/npm/aurelia-loader-default@1.0.0" + ], + "aurelia-logging": [ + "jspm_packages/npm/aurelia-logging@1.3.1" + ], + "aurelia-logging-console": [ + "jspm_packages/npm/aurelia-logging-console@1.0.0" + ], + "aurelia-metadata": [ + "jspm_packages/npm/aurelia-metadata@1.0.3" + ], + "aurelia-pal": [ + "jspm_packages/npm/aurelia-pal@1.3.0" + ], + "aurelia-pal-browser": [ + "jspm_packages/npm/aurelia-pal-browser@1.0.0" + ], + "aurelia-path": [ + "jspm_packages/npm/aurelia-path@1.1.1" + ], + "aurelia-polyfills": [ + "jspm_packages/npm/aurelia-polyfills@1.0.0" + ], + "aurelia-route-recognizer": [ + "jspm_packages/npm/aurelia-route-recognizer@1.0.0" + ], + "aurelia-router": [ + "jspm_packages/npm/aurelia-router@1.0.2" + ], + "aurelia-task-queue": [ + "jspm_packages/npm/aurelia-task-queue@1.2.0" + ], + "aurelia-templating": [ + "jspm_packages/npm/aurelia-templating@1.4.2" + ], + "aurelia-templating-binding": [ + "jspm_packages/npm/aurelia-templating-binding@1.0.0" + ], + "aurelia-templating-router": [ + "jspm_packages/npm/aurelia-templating-router@1.0.0" + ] + }, + "moduleResolution": "node" + } +} \ No newline at end of file diff --git a/test/tsconfig.ts b/test/tsconfig.ts index e9fb9dc..c69ee00 100644 --- a/test/tsconfig.ts +++ b/test/tsconfig.ts @@ -1,4 +1,4 @@ -import test = require('tape'); +import test from 'tape'; test('tsconfig.json with unspecified baseUrl must receive base url of "."', ({equals, end}) => { const tsconfig = require('../testapp/tsconfig.json'); diff --git a/tsconfig.json b/tsconfig.json index b2746da..f7d3f0a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "module": "commonjs", + "esModuleInterop": true, "target": "es5", "lib": [ "esnext" diff --git a/tslint.json b/tslint.json index 783358a..3c9cfb5 100644 --- a/tslint.json +++ b/tslint.json @@ -11,6 +11,7 @@ true, "ban-single-arg-parens" ], + "no-require-imports": true, "no-empty-interface": true, "no-reference-import": true, "ordered-imports": [ @@ -56,9 +57,6 @@ "never-prefix" ], "label-position": true, - "max-line-length": [ - true - ], "no-arg": true, "no-consecutive-blank-lines": [ true