diff --git a/.travis.yml b/.travis.yml index b85801da6..cb33f739e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,8 @@ node_js: - "5" sudo: false before_script: - - npm install -g typescript typings - npm install - npm run init -script: - npm run build +script: + - npm run test diff --git a/package.json b/package.json index 4b3c1d206..cdc26d1be 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "bin": "bin/polytool.js", "scripts": { "init": "typings install", - "build": "if [ ! -f typings/main.d.ts ]; then npm run init; fi; tsc" + "build": "if [ ! -f typings/main.d.ts ]; then npm run init; fi; tsc", + "test": "depcheck ." }, "repository": { "type": "git", @@ -33,6 +34,7 @@ "yeoman-environment": "^1.5.2" }, "devDependencies": { + "depcheck": "^0.6.3", "typescript": "^1.8.10", "typings": "^0.8.1" } diff --git a/src/commands/init.ts b/src/commands/init.ts index 0cc4e20a0..0dd00b84c 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -12,6 +12,7 @@ import {Command} from './command'; // not ES modules compatible const YeomanEnvironment = require('yeoman-environment'); +const polymerGenerator = require('generator-polymer-init'); export class InitCommand implements Command { name = 'init'; @@ -23,7 +24,7 @@ export class InitCommand implements Command { run(options): Promise { return new Promise((resolve, reject) => { let env = new YeomanEnvironment(); - env.register(require.resolve('generator-polymer-init'), 'polymer-init:app'); + env.registerStub(polymerGenerator, 'polymer-init:app'); env.run('polymer-init', {}, () => resolve()); }); }