Skip to content

build: remove unused dependencies #17988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions angular-tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
"node_modules/@angular/**/*"
],
"exclude": [
"node_modules/@angular/**/schematics/**",
"node_modules/@angular/**/testing/**",
"node_modules/@angular/bazel/**",
"node_modules/@angular/common/upgrade*",
"node_modules/@angular/compiler-cli/**",
"node_modules/@angular/**/schematics/**",
"node_modules/@angular/**/testing/**"
"node_modules/@angular/router/upgrade*"
]
}
8 changes: 0 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,4 @@ require('ts-node').register({
project: tsconfigPath
});

// The gulp tsconfig file maps specific imports to relative paths. In combination with ts-node
// this doesn't work because the JavaScript output will still refer to the imports instead of
// to the relative path. Tsconfig-paths can be used to support path mapping inside of Node.
require('tsconfig-paths').register({
baseUrl: path.dirname(tsconfigPath),
paths: tsconfig.compilerOptions.paths
});

require('./tools/gulp/gulpfile');
14 changes: 0 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"@angular/platform-browser-dynamic": "^9.0.0-rc.6",
"@angular/platform-server": "^9.0.0-rc.6",
"@angular/router": "^9.0.0-rc.6",
"@angular/upgrade": "^9.0.0-rc.6",
"@bazel/bazel": "^1.1.0",
"@bazel/buildifier": "^0.29.0",
"@bazel/ibazel": "^0.10.3",
Expand All @@ -82,13 +81,11 @@
"@types/fs-extra": "^4.0.3",
"@types/glob": "^5.0.33",
"@types/gulp": "3.8.32",
"@types/gulp-util": "^3.0.34",
"@types/inquirer": "^0.0.43",
"@types/jasmine": "^3.4.0",
"@types/marked": "^0.4.2",
"@types/merge2": "^0.3.30",
"@types/minimist": "^1.2.0",
"@types/mock-fs": "^3.6.30",
"@types/node": "^12.11.1",
"@types/parse5": "^5.0.0",
"@types/run-sequence": "^0.0.29",
Expand All @@ -108,13 +105,8 @@
"glob": "^7.1.2",
"gulp": "^3.9.1",
"gulp-clean": "^0.3.2",
"gulp-clean-css": "^3.3.1",
"gulp-cli": "^2.0.1",
"gulp-htmlmin": "^3.0.0",
"gulp-if": "^2.0.2",
"gulp-rename": "^1.2.2",
"gulp-sass": "^4.0.2",
"gulp-util": "^3.0.8",
"highlight.js": "^9.11.0",
"husky": "^1.3.1",
"inquirer": "^6.2.0",
Expand All @@ -129,18 +121,15 @@
"karma-sauce-launcher": "^2.0.2",
"karma-sourcemap-loader": "^0.3.7",
"madge": "^3.4.4",
"magic-string": "^0.22.4",
"marked": "^0.6.2",
"merge2": "^1.2.3",
"minimatch": "^3.0.4",
"minimist": "^1.2.0",
"mock-fs": "^4.7.0",
"moment": "^2.18.1",
"node-sass": "^4.12.0",
"parse5": "^5.0.0",
"protractor": "^5.4.2",
"requirejs": "^2.3.6",
"resolve-bin": "^0.4.0",
"rollup": "~1.25.0",
"rollup-plugin-alias": "^1.4.0",
"rollup-plugin-commonjs": "^10.1.0",
Expand All @@ -152,16 +141,13 @@
"semver": "^6.3.0",
"send": "^0.17.1",
"shelljs": "^0.8.3",
"sorcery": "^0.10.0",
"stylelint": "^10.1.0",
"terser": "^4.3.9",
"ts-api-guardian": "^0.4.6",
"ts-node": "^3.0.4",
"tsconfig-paths": "^2.3.0",
"tslint": "^5.20.0",
"tsutils": "^3.0.0",
"typescript": "^3.6.4",
"uglify-js": "^2.8.14",
"vrsource-tslint-rules": "5.1.1"
},
"resolutions": {
Expand Down
1 change: 0 additions & 1 deletion src/cdk/schematics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ ts_library(
"@npm//@schematics/angular",
"@npm//@types/jasmine",
"@npm//@types/node",
"@npm//mock-fs",
"@npm//typescript",
],
)
Expand Down
20 changes: 10 additions & 10 deletions src/material/paginator/paginator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,42 +47,42 @@ describe('MatPaginator', () => {
component.pageSize = 10;
component.pageIndex = 1;
fixture.detectChanges();
expect(rangeElement.innerText).toBe('11 – 20 of 100');
expect(rangeElement.innerText.trim()).toBe('11 – 20 of 100');

// View third page of list of 200, each page contains 20 items.
component.length = 200;
component.pageSize = 20;
component.pageIndex = 2;
fixture.detectChanges();
expect(rangeElement.innerText).toBe('41 – 60 of 200');
expect(rangeElement.innerText.trim()).toBe('41 – 60 of 200');

// View first page of list of 0, each page contains 5 items.
component.length = 0;
component.pageSize = 5;
component.pageIndex = 2;
fixture.detectChanges();
expect(rangeElement.innerText).toBe('0 of 0');
expect(rangeElement.innerText.trim()).toBe('0 of 0');

// View third page of list of 12, each page contains 5 items.
component.length = 12;
component.pageSize = 5;
component.pageIndex = 2;
fixture.detectChanges();
expect(rangeElement.innerText).toBe('11 – 12 of 12');
expect(rangeElement.innerText.trim()).toBe('11 – 12 of 12');

// View third page of list of 10, each page contains 5 items.
component.length = 10;
component.pageSize = 5;
component.pageIndex = 2;
fixture.detectChanges();
expect(rangeElement.innerText).toBe('11 – 15 of 10');
expect(rangeElement.innerText.trim()).toBe('11 – 15 of 10');

// View third page of list of -5, each page contains 5 items.
component.length = -5;
component.pageSize = 5;
component.pageIndex = 2;
fixture.detectChanges();
expect(rangeElement.innerText).toBe('11 – 15 of 0');
expect(rangeElement.innerText.trim()).toBe('11 – 15 of 0');
});

it('should show right aria-labels for select and buttons', () => {
Expand Down Expand Up @@ -247,19 +247,19 @@ describe('MatPaginator', () => {
it('should mark for check when inputs are changed directly', () => {
const rangeElement = fixture.nativeElement.querySelector('.mat-paginator-range-label');

expect(rangeElement.innerText).toBe('1 – 10 of 100');
expect(rangeElement.innerText.trim()).toBe('1 – 10 of 100');

paginator.length = 99;
fixture.detectChanges();
expect(rangeElement.innerText).toBe('1 – 10 of 99');
expect(rangeElement.innerText.trim()).toBe('1 – 10 of 99');

paginator.pageSize = 6;
fixture.detectChanges();
expect(rangeElement.innerText).toBe('1 – 6 of 99');
expect(rangeElement.innerText.trim()).toBe('1 – 6 of 99');

paginator.pageIndex = 1;
fixture.detectChanges();
expect(rangeElement.innerText).toBe('7 – 12 of 99');
expect(rangeElement.innerText.trim()).toBe('7 – 12 of 99');

// Having one option and the same page size should remove the select menu
expect(fixture.nativeElement.querySelector('.mat-select')).not.toBeNull();
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/gulpfile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackageBuildTasks} from 'material2-build-tools';
import {createPackageBuildTasks} from '../package-tools';
import {
cdkExperimentalPackage,
cdkPackage,
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/packages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {BuildPackage} from 'material2-build-tools';
import {BuildPackage} from '../package-tools';

export const cdkPackage = new BuildPackage('cdk');
export const materialPackage = new BuildPackage('material', [cdkPackage]);
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/clean.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {task, src} from 'gulp';
import {buildConfig} from 'material2-build-tools';
import {buildConfig} from '../../package-tools';

// This import lacks type definitions.
const gulpClean = require('gulp-clean');
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/unit-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {join} from 'path';
import {task, watch} from 'gulp';
import {buildConfig, sequenceTask} from 'material2-build-tools';
import {buildConfig, sequenceTask} from '../../package-tools';

// There are no type definitions available for these imports.
const runSequence = require('run-sequence');
Expand Down
5 changes: 1 addition & 4 deletions tools/gulp/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
"types": [
"node"
],
"baseUrl": ".",
"paths": {
"material2-build-tools": ["../package-tools/index"]
}
"baseUrl": "."
},
"files": [
"gulpfile.ts"
Expand Down
7 changes: 2 additions & 5 deletions tools/package-tools/gulp/build-scss-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import {buildConfig} from '../build-config';
// These imports lack of type definitions.
const gulpSass = require('gulp-sass');
const nodeSass = require('node-sass');
const gulpIf = require('gulp-if');
const gulpCleanCss = require('gulp-clean-css');

const sassIncludePaths = [
join(buildConfig.projectDir, 'node_modules/')
Expand All @@ -16,8 +14,7 @@ const sassIncludePaths = [
gulpSass.compiler = nodeSass;

/** Create a gulp task that builds SCSS files. */
export function buildScssPipeline(sourceDir: string, minifyOutput = false) {
export function buildScssPipeline(sourceDir: string) {
return src(join(sourceDir, '**/!(test-).scss'))
.pipe(gulpSass({includePaths: sassIncludePaths}).on('error', gulpSass.logError))
.pipe(gulpIf(minifyOutput, gulpCleanCss()));
.pipe(gulpSass({includePaths: sassIncludePaths}).on('error', gulpSass.logError));
}
15 changes: 2 additions & 13 deletions tools/package-tools/gulp/build-tasks-gulp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ import {inlineResourcesForDirectory} from '../inline-resources';
import {buildScssPipeline} from './build-scss-pipeline';
import {sequenceTask} from './sequence-task';

// There are no type definitions available for these imports.
const htmlmin = require('gulp-htmlmin');

const htmlMinifierOptions = {
collapseWhitespace: true,
removeComments: true,
caseSensitive: true,
removeAttributeQuotes: false
};

/**
* Creates a set of gulp tasks that can build the specified package.
* @param buildPackage Build package for which the gulp tasks will be generated
Expand Down Expand Up @@ -64,7 +54,7 @@ export function createPackageBuildTasks(buildPackage: BuildPackage, preBuildTask
task(`${taskName}:assets`, assetTasks);

task(`${taskName}:assets:scss`, () => {
return buildScssPipeline(buildPackage.sourceDir, true)
return buildScssPipeline(buildPackage.sourceDir)
.pipe(dest(buildPackage.outputDir));
}
);
Expand All @@ -75,8 +65,7 @@ export function createPackageBuildTasks(buildPackage: BuildPackage, preBuildTask
});

task(`${taskName}:assets:html`, () => {
return src(htmlGlob).pipe(htmlmin(htmlMinifierOptions))
.pipe(dest(buildPackage.outputDir));
return src(htmlGlob).pipe(dest(buildPackage.outputDir));
});

task(`${taskName}:assets:inline`, () => {
Expand Down
Loading