Skip to content

Commit

Permalink
refactor(@angular/cli): remove v8-profiler typings
Browse files Browse the repository at this point in the history
Remove dependency to the @types/v8-profiler Profiler type as we don't want to depend on it.

See angular#12411 (comment)
  • Loading branch information
nlm-pro authored and hansl committed Oct 3, 2018
1 parent 93ccb82 commit 317602e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
"@types/request": "^2.47.1",
"@types/semver": "^5.5.0",
"@types/source-map": "0.5.2",
"@types/v8-profiler": "^0.0.5",
"@types/webpack": "^4.4.11",
"@types/webpack-dev-server": "^3.1.0",
"@types/webpack-sources": "^0.1.5",
Expand Down
8 changes: 4 additions & 4 deletions packages/angular/cli/lib/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ import { SemVer } from 'semver';
import { Duplex } from 'stream';
import { isWarningEnabled } from '../utilities/config';

// from @types/v8-profiler (no dependency to v8-profiler as we use v8-profiler-node8)
import { Profiler } from 'v8-profiler'; // tslint:disable-line:no-implicit-dependencies

const packageJson = require('../package.json');

function _fromPackageJson(cwd?: string) {
Expand Down Expand Up @@ -46,7 +43,10 @@ function _fromPackageJson(cwd?: string) {

// Check if we need to profile this CLI run.
if (process.env['NG_CLI_PROFILING']) {
let profiler: Profiler;
let profiler: {
startProfiling: (name?: string, recsamples?: boolean) => void;
stopProfiling: (name?: string) => any; // tslint:disable-line:no-any
};
try {
profiler = require('v8-profiler-node8'); // tslint:disable-line:no-implicit-dependencies
} catch (err) {
Expand Down
6 changes: 0 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -463,12 +463,6 @@
version "1.0.1"
resolved "https://codeload.github.com/quicktype/types-urijs/tar.gz/a23603a04e31e883a92244bff8515e3d841a8b98"

"@types/v8-profiler@^0.0.5":
version "0.0.5"
resolved "https://registry.yarnpkg.com/@types/v8-profiler/-/v8-profiler-0.0.5.tgz#2b9f0b7ba3294f5b177b66790607772910a195f9"
dependencies:
"@types/node" "*"

"@types/webpack-dev-server@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@types/webpack-dev-server/-/webpack-dev-server-3.1.0.tgz#1fae06ad346d2dd09bc5e34745723946458eed58"
Expand Down

0 comments on commit 317602e

Please sign in to comment.