Skip to content

Commit 43d3a84

Browse files
committed
Revert "refactor: add license header to JS files & format files (angular#12035)"
This reverts commit 8310c91.
1 parent 8310c91 commit 43d3a84

File tree

73 files changed

+947
-1173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+947
-1173
lines changed

Diff for: browser-providers.conf.js

+274-112
Large diffs are not rendered by default.

Diff for: gulpfile.js

+61-84
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
/**
2-
* @license
3-
* Copyright Google Inc. All Rights Reserved.
4-
*
5-
* Use of this source code is governed by an MIT-style license that can be
6-
* found in the LICENSE file at https://angular.io/license
7-
*/
8-
91
'use strict';
102

113
// THIS CHECK SHOULD BE THE FIRST THING IN THIS FILE
@@ -21,30 +13,28 @@ const os = require('os');
2113

2214
// clang-format entry points
2315
const srcsToFmt = [
24-
'modules/@angular/**/*.{js,ts}',
25-
'modules/benchmarks/**/*.{js,ts}',
26-
'modules/e2e_util/**/*.{js,ts}',
27-
'modules/playground/**/*.{js,ts}',
28-
'tools/**/*.{js,ts}',
16+
'modules/@angular/**/*.ts',
17+
'modules/benchmarks/**/*.ts',
18+
'modules/e2e_util/**/*.ts',
19+
'modules/playground/**/*.ts',
20+
'tools/**/*.ts',
2921
'!tools/public_api_guard/**/*.d.ts',
30-
'./*.{js,ts}',
3122
];
3223

3324
// Check source code for formatting errors (clang-format)
3425
gulp.task('format:enforce', () => {
3526
const format = require('gulp-clang-format');
3627
const clangFormat = require('clang-format');
3728
return gulp.src(srcsToFmt).pipe(
38-
format.checkFormat('file', clangFormat, {verbose: true, fail: true}));
29+
format.checkFormat('file', clangFormat, {verbose: true, fail: true}));
3930
});
4031

4132
// Format the source code with clang-format (see .clang-format)
4233
gulp.task('format', () => {
4334
const format = require('gulp-clang-format');
4435
const clangFormat = require('clang-format');
45-
return gulp.src(srcsToFmt, {base: '.'})
46-
.pipe(format.format('file', clangFormat))
47-
.pipe(gulp.dest('.'));
36+
return gulp.src(srcsToFmt, { base: '.' }).pipe(
37+
format.format('file', clangFormat)).pipe(gulp.dest('.'));
4838
});
4939

5040
const entrypoints = [
@@ -72,18 +62,12 @@ const entrypoints = [
7262
];
7363
const publicApiDir = path.normalize('tools/public_api_guard');
7464
const publicApiArgs = [
75-
'--rootDir',
76-
'dist/packages-dist',
77-
'--stripExportPattern',
78-
'^__',
79-
'--allowModuleIdentifiers',
80-
'jasmine',
81-
'--allowModuleIdentifiers',
82-
'protractor',
83-
'--allowModuleIdentifiers',
84-
'angular',
85-
'--onStabilityMissing',
86-
'error',
65+
'--rootDir', 'dist/packages-dist',
66+
'--stripExportPattern', '^__',
67+
'--allowModuleIdentifiers', 'jasmine',
68+
'--allowModuleIdentifiers', 'protractor',
69+
'--allowModuleIdentifiers', 'angular',
70+
'--onStabilityMissing', 'error',
8771
].concat(entrypoints);
8872

8973
// Build angular
@@ -99,42 +83,38 @@ gulp.task('public-api:enforce', (done) => {
9983
const childProcess = require('child_process');
10084

10185
childProcess
102-
.spawn(
103-
path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)),
104-
['--verifyDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
105-
.on('close', (errorCode) => {
106-
if (errorCode !== 0) {
107-
done(new Error(
108-
'Public API differs from golden file. Please run `gulp public-api:update`.'));
109-
} else {
110-
done();
111-
}
112-
});
86+
.spawn(
87+
path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)),
88+
['--verifyDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
89+
.on('close', (errorCode) => {
90+
if (errorCode !== 0) {
91+
done(new Error(
92+
'Public API differs from golden file. Please run `gulp public-api:update`.'));
93+
} else {
94+
done();
95+
}
96+
});
11397
});
11498

11599
// Generate the public API golden files
116100
gulp.task('public-api:update', ['build.sh'], (done) => {
117101
const childProcess = require('child_process');
118102

119103
childProcess
120-
.spawn(
121-
path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)),
122-
['--outDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
123-
.on('close', done);
104+
.spawn(
105+
path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)),
106+
['--outDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
107+
.on('close', done);
124108
});
125109

126-
// Checks tests for presence of ddescribe, fdescribe, fit, iit and fails the build if one of the
127-
// focused tests is found.
128-
// Currently xdescribe and xit are _not_ reported as errors since there are a couple of excluded
129-
// tests in our code base.
110+
// Checks tests for presence of ddescribe, fdescribe, fit, iit and fails the build if one of the focused tests is found.
111+
// Currently xdescribe and xit are _not_ reported as errors since there are a couple of excluded tests in our code base.
130112
gulp.task('check-tests', function() {
131113
const ddescribeIit = require('gulp-ddescribe-iit');
132-
return gulp
133-
.src([
134-
'modules/**/*.spec.ts',
135-
'modules/**/*_spec.ts',
136-
])
137-
.pipe(ddescribeIit({allowDisabledTests: true}));
114+
return gulp.src([
115+
'modules/**/*.spec.ts',
116+
'modules/**/*_spec.ts',
117+
]).pipe(ddescribeIit({allowDisabledTests: true}));
138118
});
139119

140120
// Check the coding standards and programming errors
@@ -143,21 +123,14 @@ gulp.task('lint', ['check-tests', 'format:enforce', 'tools:build'], () => {
143123
// Built-in rules are at
144124
// https://github.com/palantir/tslint#supported-rules
145125
const tslintConfig = require('./tslint.json');
146-
return gulp
147-
.src([
148-
// todo(vicb): add .js files when supported
149-
// see https://github.com/palantir/tslint/pull/1515
150-
'modules/@angular/**/*.ts',
151-
'modules/benchpress/**/*.ts',
152-
'./*.ts',
153-
])
154-
.pipe(tslint({
155-
tslint: require('tslint').default,
156-
configuration: tslintConfig,
157-
rulesDirectory: 'dist/tools/tslint',
158-
formatter: 'prose',
159-
}))
160-
.pipe(tslint.report({emitError: true}));
126+
return gulp.src(['modules/@angular/**/*.ts', 'modules/benchpress/**/*.ts'])
127+
.pipe(tslint({
128+
tslint: require('tslint').default,
129+
configuration: tslintConfig,
130+
rulesDirectory: 'dist/tools/tslint',
131+
formatter: 'prose',
132+
}))
133+
.pipe(tslint.report({emitError: true}));
161134
});
162135

163136
gulp.task('tools:build', (done) => { tsc('tools/', done); });
@@ -169,7 +142,7 @@ gulp.task('check-cycle', (done) => {
169142
const dependencyObject = madge(['dist/all/'], {
170143
format: 'cjs',
171144
extensions: ['.js'],
172-
onParseFile: function(data) { data.src = data.src.replace(/\/\* circular \*\//g, '//'); }
145+
onParseFile: function(data) { data.src = data.src.replace(/\/\* circular \*\//g, "//"); }
173146
});
174147
const circularDependencies = dependencyObject.circular().getArray();
175148
if (circularDependencies.length > 0) {
@@ -200,11 +173,11 @@ gulp.task('serve-examples', () => {
200173
const cors = require('cors');
201174

202175
connect.server({
203-
root: `${__dirname}/dist/examples`,
204-
port: 8001,
205-
livereload: false,
206-
open: false,
207-
middleware: (connect, opt) => [cors()],
176+
root: `${__dirname}/dist/examples`,
177+
port: 8001,
178+
livereload: false,
179+
open: false,
180+
middleware: (connect, opt) => [cors()],
208181
});
209182
});
210183

@@ -214,13 +187,16 @@ gulp.task('changelog', () => {
214187
const conventionalChangelog = require('gulp-conventional-changelog');
215188

216189
return gulp.src('CHANGELOG.md')
217-
.pipe(conventionalChangelog({preset: 'angular', releaseCount: 1}, {
218-
// Conventional Changelog Context
219-
// We have to manually set version number so it doesn't get prefixed with `v`
220-
// See https://github.com/conventional-changelog/conventional-changelog-core/issues/10
221-
currentTag: require('./package.json').version
222-
}))
223-
.pipe(gulp.dest('./'));
190+
.pipe(conventionalChangelog({
191+
preset: 'angular',
192+
releaseCount: 1
193+
}, {
194+
// Conventional Changelog Context
195+
// We have to manually set version number so it doesn't get prefixed with `v`
196+
// See https://github.com/conventional-changelog/conventional-changelog-core/issues/10
197+
currentTag: require('./package.json').version
198+
}))
199+
.pipe(gulp.dest('./'));
224200
});
225201

226202
function tsc(projectPath, done) {
@@ -229,7 +205,8 @@ function tsc(projectPath, done) {
229205
childProcess
230206
.spawn(
231207
path.normalize(platformScriptPath(`${__dirname}/node_modules/.bin/tsc`)),
232-
['-p', path.join(__dirname, projectPath)], {stdio: 'inherit'})
208+
['-p', path.join(__dirname, projectPath)],
209+
{stdio: 'inherit'})
233210
.on('close', done);
234211
}
235212

Diff for: karma-js.conf.js

+23-33
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
/**
2-
* @license
3-
* Copyright Google Inc. All Rights Reserved.
4-
*
5-
* Use of this source code is governed by an MIT-style license that can be
6-
* found in the LICENSE file at https://angular.io/license
7-
*/
8-
91
var browserProvidersConf = require('./browser-providers.conf.js');
102
var internalAngularReporter = require('./tools/karma/reporter.js');
113

@@ -25,25 +17,24 @@ module.exports = function(config) {
2517
// include Angular v1 for upgrade module testing
2618
'node_modules/angular/angular.min.js',
2719

28-
'node_modules/zone.js/dist/zone.js', 'node_modules/zone.js/dist/long-stack-trace-zone.js',
29-
'node_modules/zone.js/dist/proxy.js', 'node_modules/zone.js/dist/sync-test.js',
30-
'node_modules/zone.js/dist/jasmine-patch.js', 'node_modules/zone.js/dist/async-test.js',
20+
'node_modules/zone.js/dist/zone.js',
21+
'node_modules/zone.js/dist/long-stack-trace-zone.js',
22+
'node_modules/zone.js/dist/proxy.js',
23+
'node_modules/zone.js/dist/sync-test.js',
24+
'node_modules/zone.js/dist/jasmine-patch.js',
25+
'node_modules/zone.js/dist/async-test.js',
3126
'node_modules/zone.js/dist/fake-async-test.js',
3227

3328
// Including systemjs because it defines `__eval`, which produces correct stack traces.
34-
'shims_for_IE.js', 'node_modules/systemjs/dist/system.src.js',
29+
'shims_for_IE.js',
30+
'node_modules/systemjs/dist/system.src.js',
3531
{pattern: 'node_modules/rxjs/**', included: false, watched: false, served: true},
36-
'node_modules/reflect-metadata/Reflect.js', 'tools/build/file2modulename.js', 'test-main.js',
37-
{pattern: 'dist/all/empty.*', included: false, watched: false}, {
38-
pattern: 'modules/@angular/platform-browser/test/static_assets/**',
39-
included: false,
40-
watched: false
41-
},
42-
{
43-
pattern: 'modules/@angular/platform-browser/test/browser/static_assets/**',
44-
included: false,
45-
watched: false,
46-
}
32+
'node_modules/reflect-metadata/Reflect.js',
33+
'tools/build/file2modulename.js',
34+
'test-main.js',
35+
{pattern: 'dist/all/empty.*', included: false, watched: false},
36+
{pattern: 'modules/@angular/platform-browser/test/static_assets/**', included: false, watched: false},
37+
{pattern: 'modules/@angular/platform-browser/test/browser/static_assets/**', included: false, watched: false}
4738
],
4839

4940
exclude: [
@@ -53,7 +44,7 @@ module.exports = function(config) {
5344
'dist/all/@angular/benchpress/**',
5445
'dist/all/angular1_router.js',
5546
'dist/all/@angular/platform-browser/testing/e2e_util.js',
56-
'dist/examples/**/e2e_test/**',
47+
'dist/examples/**/e2e_test/**'
5748
],
5849

5950
customLaunchers: browserProvidersConf.customLaunchers,
@@ -64,11 +55,11 @@ module.exports = function(config) {
6455
'karma-sauce-launcher',
6556
'karma-chrome-launcher',
6657
'karma-sourcemap-loader',
67-
internalAngularReporter,
58+
internalAngularReporter
6859
],
6960

7061
preprocessors: {
71-
'**/*.js': ['sourcemap'],
62+
'**/*.js': ['sourcemap']
7263
},
7364

7465
reporters: ['internal-angular'],
@@ -82,7 +73,7 @@ module.exports = function(config) {
8273
'selenium-version': '2.53.0',
8374
'command-timeout': 600,
8475
'idle-timeout': 600,
85-
'max-duration': 5400,
76+
'max-duration': 5400
8677
}
8778
},
8879

@@ -91,21 +82,20 @@ module.exports = function(config) {
9182
startTunnel: false,
9283
retryLimit: 3,
9384
timeout: 600,
94-
pollingTimeout: 10000,
85+
pollingTimeout: 10000
9586
},
9687

9788
browsers: ['Chrome'],
9889

9990
port: 9876,
10091
captureTimeout: 60000,
101-
browserDisconnectTimeout: 60000,
102-
browserDisconnectTolerance: 3,
103-
browserNoActivityTimeout: 60000,
92+
browserDisconnectTimeout : 60000,
93+
browserDisconnectTolerance : 3,
94+
browserNoActivityTimeout : 60000,
10495
});
10596

10697
if (process.env.TRAVIS) {
107-
var buildId =
108-
'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')';
98+
var buildId = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')';
10999
if (process.env.CI_MODE.startsWith('saucelabs')) {
110100
config.sauceLabs.build = buildId;
111101
config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;

Diff for: modules/@angular/common/rollup-testing.config.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/**
2-
* @license
3-
* Copyright Google Inc. All Rights Reserved.
4-
*
5-
* Use of this source code is governed by an MIT-style license that can be
6-
* found in the LICENSE file at https://angular.io/license
7-
*/
81

92
export default {
103
entry: '../../../dist/packages-dist/common/testing/index.js',
@@ -17,4 +10,4 @@ export default {
1710
'rxjs/Observable': 'Rx',
1811
'rxjs/Subject': 'Rx'
1912
}
20-
};
13+
}

Diff for: modules/@angular/common/rollup.config.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/**
2-
* @license
3-
* Copyright Google Inc. All Rights Reserved.
4-
*
5-
* Use of this source code is governed by an MIT-style license that can be
6-
* found in the LICENSE file at https://angular.io/license
7-
*/
81

92
export default {
103
entry: '../../../dist/packages-dist/common/index.js',
@@ -14,6 +7,6 @@ export default {
147
globals: {
158
'@angular/core': 'ng.core',
169
'rxjs/Observable': 'Rx',
17-
'rxjs/Subject': 'Rx',
10+
'rxjs/Subject': 'Rx'
1811
}
19-
};
12+
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
/**
2-
* @license
3-
* Copyright Google Inc. All Rights Reserved.
4-
*
5-
* Use of this source code is governed by an MIT-style license that can be
6-
* found in the LICENSE file at https://angular.io/license
7-
*/
8-
91
module.exports = {
102
target: 'node',
113
entry: './test/all_spec.js',
12-
output: {filename: './all_spec.js'},
13-
resolve: {extensions: ['.js']},
4+
output: {
5+
filename: './all_spec.js'
6+
},
7+
resolve: {
8+
extensions: ['.js']
9+
},
1410
};

0 commit comments

Comments
 (0)