Skip to content

Commit 290c6e7

Browse files
authored
chore(deps): remove leek. (#3688)
Ref #3199.
1 parent 766394d commit 290c6e7

22 files changed

+4
-116
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
"json-loader": "^0.5.4",
7676
"karma-sourcemap-loader": "^0.3.7",
7777
"karma-webpack": "^1.8.0",
78-
"leek": "0.0.21",
7978
"less": "^2.7.1",
8079
"less-loader": "^2.2.3",
8180
"loader-utils": "^0.2.16",

packages/angular-cli/bin/ng

+1-11
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ process.title = 'angular-cli';
66

77
const resolve = require('resolve');
88
const packageJson = require('../package.json');
9-
const Leek = require('leek');
109
const Version = require('../upgrade/version').Version;
1110

1211

@@ -35,18 +34,9 @@ resolve('angular-cli', { basedir: process.cwd() },
3534
cli({
3635
cliArgs: process.argv.slice(2),
3736
inputStream: process.stdin,
38-
outputStream: process.stdout,
39-
Leek: CustomLeek
37+
outputStream: process.stdout
4038
}).then(function (result) {
4139
var exitCode = typeof result === 'object' ? result.exitCode : result;
4240
process.exit(exitCode);
4341
});
44-
45-
function CustomLeek(options) {
46-
options.trackingCode = packageJson.trackingCode;
47-
options.globalName = packageJson.name;
48-
options.name = packageJson.name;
49-
options.version = packageJson.version;
50-
return new Leek(options);
51-
}
5242
});

packages/angular-cli/commands/doc.ts

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const DocCommand = Command.extend({
1515

1616
const docTask = new DocTask({
1717
ui: this.ui,
18-
analytics: this.analytics,
1918
project: this.project
2019
});
2120

packages/angular-cli/commands/e2e.ts

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const E2eCommand = Command.extend({
1111

1212
const e2eTask = new E2eTask({
1313
ui: this.ui,
14-
analytics: this.analytics,
1514
project: this.project
1615
});
1716

packages/angular-cli/commands/github-pages-deploy.ts

-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ const githubPagesDeployCommand = Command.extend({
109109

110110
const buildTask = new WebpackBuild({
111111
ui: this.ui,
112-
analytics: this.analytics,
113112
cliProject: this.project,
114113
target: options.target,
115114
environment: options.environment,
@@ -133,7 +132,6 @@ const githubPagesDeployCommand = Command.extend({
133132

134133
const createGithubRepoTask = new CreateGithubRepo({
135134
ui: this.ui,
136-
analytics: this.analytics,
137135
project: this.project
138136
});
139137

packages/angular-cli/commands/init.ts

-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ const InitCommand: any = Command.extend({
3939

4040
const installBlueprint = new this.tasks.InstallBlueprint({
4141
ui: this.ui,
42-
analytics: this.analytics,
4342
project: this.project
4443
});
4544

@@ -57,7 +56,6 @@ const InitCommand: any = Command.extend({
5756
if (!commandOptions.skipNpm) {
5857
npmInstall = new NpmInstall({
5958
ui: this.ui,
60-
analytics: this.analytics,
6159
project: this.project
6260
});
6361
}
@@ -66,7 +64,6 @@ const InitCommand: any = Command.extend({
6664
if (commandOptions.linkCli) {
6765
linkCli = new LinkCli({
6866
ui: this.ui,
69-
analytics: this.analytics,
7067
project: this.project
7168
});
7269
}

packages/angular-cli/commands/lint.ts

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export default Command.extend({
88
run: function () {
99
const lintTask = new LintTask({
1010
ui: this.ui,
11-
analytics: this.analytics,
1211
project: this.project
1312
});
1413

packages/angular-cli/commands/new.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,10 @@ const NewCommand = Command.extend({
7272
}
7373

7474
const createAndStepIntoDirectory =
75-
new this.tasks.CreateAndStepIntoDirectory({ ui: this.ui, analytics: this.analytics });
75+
new this.tasks.CreateAndStepIntoDirectory({ ui: this.ui });
7676

7777
const initCommand = new InitCommand({
7878
ui: this.ui,
79-
analytics: this.analytics,
8079
tasks: this.tasks,
8180
project: Project.nullProject(this.ui, this.cli)
8281
});

packages/angular-cli/commands/serve.ts

-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ const ServeCommand = Command.extend({
135135

136136
const serve = new ServeWebpackTask({
137137
ui: this.ui,
138-
analytics: this.analytics,
139138
project: this.project,
140139
});
141140

packages/angular-cli/commands/test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ const NgCliTestCommand = TestCommand.extend({
3939

4040
const testTask = new TestTask({
4141
ui: this.ui,
42-
analytics: this.analytics,
4342
project: this.project
4443
});
4544

packages/angular-cli/ember-cli/lib/cli/cli.js

-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ var InstallationChecker = require('../models/installation-checker');
1111
function CLI(options) {
1212
this.name = options.name;
1313
this.ui = options.ui;
14-
this.analytics = options.analytics;
1514
this.testing = options.testing;
1615
this.disableDependencyChecker = options.disableDependencyChecker;
1716
this.root = options.root;
@@ -47,7 +46,6 @@ CLI.prototype.run = function(environment) {
4746

4847
var command = new CurrentCommand({
4948
ui: this.ui,
50-
analytics: this.analytics,
5149
commands: environment.commands,
5250
tasks: environment.tasks,
5351
project: environment.project,
@@ -134,7 +132,6 @@ CLI.prototype.callHelp = function(options) {
134132

135133
var help = new HelpCommand({
136134
ui: this.ui,
137-
analytics: this.analytics,
138135
commands: environment.commands,
139136
tasks: environment.tasks,
140137
project: environment.project,

packages/angular-cli/ember-cli/lib/cli/index.js

-28
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ function clientId() {
3131
// Options: Array cliArgs, Stream inputStream, Stream outputStream
3232
module.exports = function(options) {
3333
var UI = options.UI || require('../ui');
34-
var Leek = options.Leek || require('leek');
3534
var Yam = options.Yam || require('yam');
3635

3736
// TODO: one UI (lib/models/project.js also has one for now...)
@@ -48,39 +47,12 @@ module.exports = function(options) {
4847
primary: Project.getProjectRoot()
4948
});
5049

51-
var leekOptions;
52-
53-
var disableAnalytics = options.cliArgs &&
54-
(options.cliArgs.indexOf('--disable-analytics') > -1 ||
55-
options.cliArgs.indexOf('-v') > -1 ||
56-
options.cliArgs.indexOf('--version') > -1) ||
57-
config.get('disableAnalytics');
58-
59-
var defaultLeekOptions = {
60-
trackingCode: trackingCode,
61-
globalName: name,
62-
name: clientId(),
63-
version: version,
64-
silent: disableAnalytics
65-
};
66-
6750
var defaultUpdateCheckerOptions = {
6851
checkForUpdates: false
6952
};
7053

71-
if (config.get('leekOptions')) {
72-
leekOptions = merge(defaultLeekOptions, config.get('leekOptions'));
73-
} else {
74-
leekOptions = defaultLeekOptions;
75-
}
76-
77-
debug('leek: %o', leekOptions);
78-
79-
var leek = new Leek(leekOptions);
80-
8154
var cli = new CLI({
8255
ui: ui,
83-
analytics: leek,
8456
testing: options.testing,
8557
name: options.cli ? options.cli.name : 'ember',
8658
disableDependencyChecker: options.disableDependencyChecker,

packages/angular-cli/ember-cli/lib/commands/generate.js

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ module.exports = Command.extend({
4242
var Task = this.tasks.GenerateFromBlueprint;
4343
var task = new Task({
4444
ui: this.ui,
45-
analytics: this.analytics,
4645
project: this.project,
4746
testing: this.testing,
4847
settings: this.settings

packages/angular-cli/ember-cli/lib/models/blueprint.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1000,8 +1000,7 @@ Blueprint.prototype.taskFor = function(dasherizedName) {
10001000

10011001
return new Task({
10021002
ui: this.ui,
1003-
project: this.project,
1004-
analytics: this.analytics
1003+
project: this.project
10051004
});
10061005
};
10071006

packages/angular-cli/ember-cli/lib/models/command.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,6 @@ Command.prototype.validateAndRun = function(args) {
116116
return Promise.resolve('callHelp');
117117
}
118118

119-
this.analytics.track({
120-
name: 'ember ',
121-
message: this.name
122-
});
123-
124119
if (commandOptions === null) {
125120
return Promise.resolve();
126121
}
@@ -430,7 +425,7 @@ Command.prototype.printBasicHelp = function() {
430425
if (this.isRoot) {
431426
output = 'Usage: ' + this.name;
432427
} else {
433-
output = 'ember ' + this.name;
428+
output = 'ng ' + this.name;
434429
}
435430

436431
output += this._printCommand();

packages/angular-cli/ember-cli/lib/models/watcher.js

-15
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ var Watcher = Task.extend({
1919
didError: function(error) {
2020
debug('didError %o', error);
2121
this.ui.writeError(error);
22-
this.analytics.trackError({
23-
description: error && error.message
24-
});
2522
},
2623

2724
then: function() {
@@ -34,18 +31,6 @@ var Watcher = Task.extend({
3431

3532
this.ui.writeLine('');
3633
this.ui.writeLine(chalk.green('Build successful - ' + Math.round(totalTime) + 'ms.'));
37-
38-
this.analytics.track({
39-
name: 'ember rebuild',
40-
message: 'broccoli rebuild time: ' + totalTime + 'ms'
41-
});
42-
43-
this.analytics.trackTiming({
44-
category: 'rebuild',
45-
variable: 'rebuild time',
46-
label: 'broccoli rebuild time',
47-
value: parseInt(totalTime, 10)
48-
});
4934
},
5035

5136
on: function() {

packages/angular-cli/ember-cli/lib/tasks/generate-from-blueprint.js

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ module.exports = Task.extend({
4747
target: this.project.root,
4848
entity: entity,
4949
ui: this.ui,
50-
analytics: this.analytics,
5150
project: this.project,
5251
settings: this.settings,
5352
testing: this.testing,

packages/angular-cli/ember-cli/lib/tasks/install-blueprint.js

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ module.exports = Task.extend({
2626
target: target,
2727
entity: { name: name },
2828
ui: this.ui,
29-
analytics: this.analytics,
3029
project: this.project,
3130
dryRun: options.dryRun,
3231
targetFiles: options.targetFiles,

packages/angular-cli/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"json-loader": "^0.5.4",
6060
"karma-sourcemap-loader": "^0.3.7",
6161
"karma-webpack": "^1.8.0",
62-
"leek": "0.0.21",
6362
"less": "^2.7.1",
6463
"less-loader": "^2.2.3",
6564
"lodash": "^4.11.1",

tests/helpers/mock-analytics.js

-23
This file was deleted.

tests/helpers/ng.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
var MockUI = require('./mock-ui');
4-
var MockAnalytics = require('./mock-analytics');
54
var Cli = require('angular-cli/lib/cli');
65

76
module.exports = function ng(args) {
@@ -13,7 +12,6 @@ module.exports = function ng(args) {
1312
inputStream: [],
1413
outputStream: [],
1514
cliArgs: args,
16-
Leek: MockAnalytics,
1715
UI: MockUI,
1816
testing: true
1917
});

yarn.lock

-9
Original file line numberDiff line numberDiff line change
@@ -3158,15 +3158,6 @@ lcid@^1.0.0:
31583158
dependencies:
31593159
invert-kv "^1.0.0"
31603160

3161-
3162-
version "0.0.21"
3163-
resolved "https://registry.yarnpkg.com/leek/-/leek-0.0.21.tgz#09804bf70f8aefbba745f5d56d2a4debf22711ff"
3164-
dependencies:
3165-
debug "^2.1.0"
3166-
lodash.assign "^3.2.0"
3167-
request "^2.27.0"
3168-
rsvp "^3.0.21"
3169-
31703161
less-loader@^2.2.3:
31713162
version "2.2.3"
31723163
resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-2.2.3.tgz#b6d8f8139c8493df09d992a93a00734b08f84528"

0 commit comments

Comments
 (0)