diff --git a/package.json b/package.json index 648a5b2f8330..17cda0eb34e8 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,6 @@ "json-loader": "^0.5.4", "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "^1.8.0", - "leek": "0.0.21", "less": "^2.7.1", "less-loader": "^2.2.3", "loader-utils": "^0.2.16", diff --git a/packages/angular-cli/bin/ng b/packages/angular-cli/bin/ng index 7739921364c4..4001df144db1 100755 --- a/packages/angular-cli/bin/ng +++ b/packages/angular-cli/bin/ng @@ -6,7 +6,6 @@ process.title = 'angular-cli'; const resolve = require('resolve'); const packageJson = require('../package.json'); -const Leek = require('leek'); const Version = require('../upgrade/version').Version; @@ -35,18 +34,9 @@ resolve('angular-cli', { basedir: process.cwd() }, cli({ cliArgs: process.argv.slice(2), inputStream: process.stdin, - outputStream: process.stdout, - Leek: CustomLeek + outputStream: process.stdout }).then(function (result) { var exitCode = typeof result === 'object' ? result.exitCode : result; process.exit(exitCode); }); - - function CustomLeek(options) { - options.trackingCode = packageJson.trackingCode; - options.globalName = packageJson.name; - options.name = packageJson.name; - options.version = packageJson.version; - return new Leek(options); - } }); diff --git a/packages/angular-cli/commands/doc.ts b/packages/angular-cli/commands/doc.ts index f3fe1ea6165f..2b055acfebca 100644 --- a/packages/angular-cli/commands/doc.ts +++ b/packages/angular-cli/commands/doc.ts @@ -15,7 +15,6 @@ const DocCommand = Command.extend({ const docTask = new DocTask({ ui: this.ui, - analytics: this.analytics, project: this.project }); diff --git a/packages/angular-cli/commands/e2e.ts b/packages/angular-cli/commands/e2e.ts index c3074afb649d..5099354429eb 100644 --- a/packages/angular-cli/commands/e2e.ts +++ b/packages/angular-cli/commands/e2e.ts @@ -11,7 +11,6 @@ const E2eCommand = Command.extend({ const e2eTask = new E2eTask({ ui: this.ui, - analytics: this.analytics, project: this.project }); diff --git a/packages/angular-cli/commands/github-pages-deploy.ts b/packages/angular-cli/commands/github-pages-deploy.ts index 475b621f94ce..9951f13ecd4d 100644 --- a/packages/angular-cli/commands/github-pages-deploy.ts +++ b/packages/angular-cli/commands/github-pages-deploy.ts @@ -109,7 +109,6 @@ const githubPagesDeployCommand = Command.extend({ const buildTask = new WebpackBuild({ ui: this.ui, - analytics: this.analytics, cliProject: this.project, target: options.target, environment: options.environment, @@ -133,7 +132,6 @@ const githubPagesDeployCommand = Command.extend({ const createGithubRepoTask = new CreateGithubRepo({ ui: this.ui, - analytics: this.analytics, project: this.project }); diff --git a/packages/angular-cli/commands/init.ts b/packages/angular-cli/commands/init.ts index bd4978f759ee..2043549af8c4 100644 --- a/packages/angular-cli/commands/init.ts +++ b/packages/angular-cli/commands/init.ts @@ -39,7 +39,6 @@ const InitCommand: any = Command.extend({ const installBlueprint = new this.tasks.InstallBlueprint({ ui: this.ui, - analytics: this.analytics, project: this.project }); @@ -57,7 +56,6 @@ const InitCommand: any = Command.extend({ if (!commandOptions.skipNpm) { npmInstall = new NpmInstall({ ui: this.ui, - analytics: this.analytics, project: this.project }); } @@ -66,7 +64,6 @@ const InitCommand: any = Command.extend({ if (commandOptions.linkCli) { linkCli = new LinkCli({ ui: this.ui, - analytics: this.analytics, project: this.project }); } diff --git a/packages/angular-cli/commands/lint.ts b/packages/angular-cli/commands/lint.ts index c90d02cecc95..47857d62f15e 100644 --- a/packages/angular-cli/commands/lint.ts +++ b/packages/angular-cli/commands/lint.ts @@ -8,7 +8,6 @@ export default Command.extend({ run: function () { const lintTask = new LintTask({ ui: this.ui, - analytics: this.analytics, project: this.project }); diff --git a/packages/angular-cli/commands/new.ts b/packages/angular-cli/commands/new.ts index c2a9bc70decb..2a9258c9d7a2 100644 --- a/packages/angular-cli/commands/new.ts +++ b/packages/angular-cli/commands/new.ts @@ -72,11 +72,10 @@ const NewCommand = Command.extend({ } const createAndStepIntoDirectory = - new this.tasks.CreateAndStepIntoDirectory({ ui: this.ui, analytics: this.analytics }); + new this.tasks.CreateAndStepIntoDirectory({ ui: this.ui }); const initCommand = new InitCommand({ ui: this.ui, - analytics: this.analytics, tasks: this.tasks, project: Project.nullProject(this.ui, this.cli) }); diff --git a/packages/angular-cli/commands/serve.ts b/packages/angular-cli/commands/serve.ts index abb0013f8e3d..0f92707d96b2 100644 --- a/packages/angular-cli/commands/serve.ts +++ b/packages/angular-cli/commands/serve.ts @@ -135,7 +135,6 @@ const ServeCommand = Command.extend({ const serve = new ServeWebpackTask({ ui: this.ui, - analytics: this.analytics, project: this.project, }); diff --git a/packages/angular-cli/commands/test.ts b/packages/angular-cli/commands/test.ts index 3316c14e09d3..4d7b2bd211ca 100644 --- a/packages/angular-cli/commands/test.ts +++ b/packages/angular-cli/commands/test.ts @@ -39,7 +39,6 @@ const NgCliTestCommand = TestCommand.extend({ const testTask = new TestTask({ ui: this.ui, - analytics: this.analytics, project: this.project }); diff --git a/packages/angular-cli/ember-cli/lib/cli/cli.js b/packages/angular-cli/ember-cli/lib/cli/cli.js index ac9648d0c283..1cb5f67e7483 100644 --- a/packages/angular-cli/ember-cli/lib/cli/cli.js +++ b/packages/angular-cli/ember-cli/lib/cli/cli.js @@ -11,7 +11,6 @@ var InstallationChecker = require('../models/installation-checker'); function CLI(options) { this.name = options.name; this.ui = options.ui; - this.analytics = options.analytics; this.testing = options.testing; this.disableDependencyChecker = options.disableDependencyChecker; this.root = options.root; @@ -47,7 +46,6 @@ CLI.prototype.run = function(environment) { var command = new CurrentCommand({ ui: this.ui, - analytics: this.analytics, commands: environment.commands, tasks: environment.tasks, project: environment.project, @@ -134,7 +132,6 @@ CLI.prototype.callHelp = function(options) { var help = new HelpCommand({ ui: this.ui, - analytics: this.analytics, commands: environment.commands, tasks: environment.tasks, project: environment.project, diff --git a/packages/angular-cli/ember-cli/lib/cli/index.js b/packages/angular-cli/ember-cli/lib/cli/index.js index 1e5025ee53f8..945ec74b0b65 100644 --- a/packages/angular-cli/ember-cli/lib/cli/index.js +++ b/packages/angular-cli/ember-cli/lib/cli/index.js @@ -31,7 +31,6 @@ function clientId() { // Options: Array cliArgs, Stream inputStream, Stream outputStream module.exports = function(options) { var UI = options.UI || require('../ui'); - var Leek = options.Leek || require('leek'); var Yam = options.Yam || require('yam'); // TODO: one UI (lib/models/project.js also has one for now...) @@ -48,39 +47,12 @@ module.exports = function(options) { primary: Project.getProjectRoot() }); - var leekOptions; - - var disableAnalytics = options.cliArgs && - (options.cliArgs.indexOf('--disable-analytics') > -1 || - options.cliArgs.indexOf('-v') > -1 || - options.cliArgs.indexOf('--version') > -1) || - config.get('disableAnalytics'); - - var defaultLeekOptions = { - trackingCode: trackingCode, - globalName: name, - name: clientId(), - version: version, - silent: disableAnalytics - }; - var defaultUpdateCheckerOptions = { checkForUpdates: false }; - if (config.get('leekOptions')) { - leekOptions = merge(defaultLeekOptions, config.get('leekOptions')); - } else { - leekOptions = defaultLeekOptions; - } - - debug('leek: %o', leekOptions); - - var leek = new Leek(leekOptions); - var cli = new CLI({ ui: ui, - analytics: leek, testing: options.testing, name: options.cli ? options.cli.name : 'ember', disableDependencyChecker: options.disableDependencyChecker, diff --git a/packages/angular-cli/ember-cli/lib/commands/generate.js b/packages/angular-cli/ember-cli/lib/commands/generate.js index cfb67b535065..8c9f5bc02dcc 100644 --- a/packages/angular-cli/ember-cli/lib/commands/generate.js +++ b/packages/angular-cli/ember-cli/lib/commands/generate.js @@ -42,7 +42,6 @@ module.exports = Command.extend({ var Task = this.tasks.GenerateFromBlueprint; var task = new Task({ ui: this.ui, - analytics: this.analytics, project: this.project, testing: this.testing, settings: this.settings diff --git a/packages/angular-cli/ember-cli/lib/models/blueprint.js b/packages/angular-cli/ember-cli/lib/models/blueprint.js index 04925d9b778f..fdc88372ad2a 100644 --- a/packages/angular-cli/ember-cli/lib/models/blueprint.js +++ b/packages/angular-cli/ember-cli/lib/models/blueprint.js @@ -1000,8 +1000,7 @@ Blueprint.prototype.taskFor = function(dasherizedName) { return new Task({ ui: this.ui, - project: this.project, - analytics: this.analytics + project: this.project }); }; diff --git a/packages/angular-cli/ember-cli/lib/models/command.js b/packages/angular-cli/ember-cli/lib/models/command.js index ea960753c3d9..a5d89d39e123 100644 --- a/packages/angular-cli/ember-cli/lib/models/command.js +++ b/packages/angular-cli/ember-cli/lib/models/command.js @@ -116,11 +116,6 @@ Command.prototype.validateAndRun = function(args) { return Promise.resolve('callHelp'); } - this.analytics.track({ - name: 'ember ', - message: this.name - }); - if (commandOptions === null) { return Promise.resolve(); } @@ -430,7 +425,7 @@ Command.prototype.printBasicHelp = function() { if (this.isRoot) { output = 'Usage: ' + this.name; } else { - output = 'ember ' + this.name; + output = 'ng ' + this.name; } output += this._printCommand(); diff --git a/packages/angular-cli/ember-cli/lib/models/watcher.js b/packages/angular-cli/ember-cli/lib/models/watcher.js index 16daec0a53fe..3f4ca00ca45d 100644 --- a/packages/angular-cli/ember-cli/lib/models/watcher.js +++ b/packages/angular-cli/ember-cli/lib/models/watcher.js @@ -19,9 +19,6 @@ var Watcher = Task.extend({ didError: function(error) { debug('didError %o', error); this.ui.writeError(error); - this.analytics.trackError({ - description: error && error.message - }); }, then: function() { @@ -34,18 +31,6 @@ var Watcher = Task.extend({ this.ui.writeLine(''); this.ui.writeLine(chalk.green('Build successful - ' + Math.round(totalTime) + 'ms.')); - - this.analytics.track({ - name: 'ember rebuild', - message: 'broccoli rebuild time: ' + totalTime + 'ms' - }); - - this.analytics.trackTiming({ - category: 'rebuild', - variable: 'rebuild time', - label: 'broccoli rebuild time', - value: parseInt(totalTime, 10) - }); }, on: function() { diff --git a/packages/angular-cli/ember-cli/lib/tasks/generate-from-blueprint.js b/packages/angular-cli/ember-cli/lib/tasks/generate-from-blueprint.js index ccdc7368da75..fe7f2b93e8ce 100644 --- a/packages/angular-cli/ember-cli/lib/tasks/generate-from-blueprint.js +++ b/packages/angular-cli/ember-cli/lib/tasks/generate-from-blueprint.js @@ -47,7 +47,6 @@ module.exports = Task.extend({ target: this.project.root, entity: entity, ui: this.ui, - analytics: this.analytics, project: this.project, settings: this.settings, testing: this.testing, diff --git a/packages/angular-cli/ember-cli/lib/tasks/install-blueprint.js b/packages/angular-cli/ember-cli/lib/tasks/install-blueprint.js index a9fc4d1f4134..ffb0ce573275 100644 --- a/packages/angular-cli/ember-cli/lib/tasks/install-blueprint.js +++ b/packages/angular-cli/ember-cli/lib/tasks/install-blueprint.js @@ -26,7 +26,6 @@ module.exports = Task.extend({ target: target, entity: { name: name }, ui: this.ui, - analytics: this.analytics, project: this.project, dryRun: options.dryRun, targetFiles: options.targetFiles, diff --git a/packages/angular-cli/package.json b/packages/angular-cli/package.json index ebe4fb5f6501..24fed046dc80 100644 --- a/packages/angular-cli/package.json +++ b/packages/angular-cli/package.json @@ -59,7 +59,6 @@ "json-loader": "^0.5.4", "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "^1.8.0", - "leek": "0.0.21", "less": "^2.7.1", "less-loader": "^2.2.3", "lodash": "^4.11.1", diff --git a/tests/helpers/mock-analytics.js b/tests/helpers/mock-analytics.js deleted file mode 100644 index 114540256f0d..000000000000 --- a/tests/helpers/mock-analytics.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -module.exports = MockAnalytics; -function MockAnalytics() { - this.tracks = []; - this.trackTimings = []; - this.trackErrors = []; -} - -MockAnalytics.prototype = Object.create({}); -MockAnalytics.prototype.track = function(arg) { - this.tracks.push(arg); -}; - -MockAnalytics.prototype.trackTiming = function(arg) { - this.trackTimings.push(arg); -}; - -MockAnalytics.prototype.trackError = function(arg) { - this.trackErrors.push(arg); -}; - -MockAnalytics.prototype.constructor = MockAnalytics; diff --git a/tests/helpers/ng.js b/tests/helpers/ng.js index 2e67ce2a9159..a34be6964bcc 100644 --- a/tests/helpers/ng.js +++ b/tests/helpers/ng.js @@ -1,7 +1,6 @@ 'use strict'; var MockUI = require('./mock-ui'); -var MockAnalytics = require('./mock-analytics'); var Cli = require('angular-cli/lib/cli'); module.exports = function ng(args) { @@ -13,7 +12,6 @@ module.exports = function ng(args) { inputStream: [], outputStream: [], cliArgs: args, - Leek: MockAnalytics, UI: MockUI, testing: true }); diff --git a/yarn.lock b/yarn.lock index dd1a9662f4f3..7b92a80acdc8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3158,15 +3158,6 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" -leek@0.0.21: - version "0.0.21" - resolved "https://registry.yarnpkg.com/leek/-/leek-0.0.21.tgz#09804bf70f8aefbba745f5d56d2a4debf22711ff" - dependencies: - debug "^2.1.0" - lodash.assign "^3.2.0" - request "^2.27.0" - rsvp "^3.0.21" - less-loader@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-2.2.3.tgz#b6d8f8139c8493df09d992a93a00734b08f84528"