build: update npm dependencies (#19328)

PR Close #19328
This commit is contained in:
Olivier Combe
2017-09-22 19:51:03 +02:00
committed by Igor Minar
parent f48b343af1
commit 0f5c70d563
86 changed files with 965 additions and 1565 deletions

View File

@ -1 +1,9 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
System.import('index').catch(console.error.bind(console));

View File

@ -34,7 +34,7 @@ function watch(globs, opts, tasks) {
} catch (e) {
return tasksDone(e);
}
}
};
}
var events = opts.events = opts.events || ['add', 'change', 'unlink'];
@ -51,8 +51,7 @@ function watch(globs, opts, tasks) {
var watcher =
chokidar.watch(globs, opts).on('all', handleEvent).on('error', function(err) { throw err; });
var log =
function watchLogger(triggerCount) {
var log = function watchLogger(triggerCount) {
// Don't report change for initial event
if (!ignoreInitial && !--triggerCount) return;
@ -68,10 +67,10 @@ function watch(globs, opts, tasks) {
var now = new Date();
return now.toLocaleDateString() + ' at ' + now.toLocaleTimeString();
}
}
};
if (opts.log !== undefined && !opts.log) {
log = function noopLog(triggerCount) {}
log = function noopLog(triggerCount) {};
}
var close = watcher.close.bind(watcher);
@ -116,6 +115,7 @@ function watch(globs, opts, tasks) {
timeoutId = null;
}
if (!useRunSequence && err) {
// tslint:disable-next-line:no-console
console.log('Watch task error:', err.toString());
}
}

View File

@ -84,8 +84,7 @@ function checkEnvironment(reqs) {
} else if (!semver.satisfies(foundYarnVersion, reqs.requiredYarnVersion)) {
issues.push(
'You are running an unsupported yarn version. Found: ' + foundYarnVersion +
' Expected: ' + reqs.requiredYarnVersion +
'. This is required because we use yarn to ' +
' Expected: ' + reqs.requiredYarnVersion + '. This is required because we use yarn to ' +
'ensure that we all use the exact same npm dependencies. Installation instructions: ' +
'https://yarnpkg.com/lang/en/docs/install/');
}

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
module.exports = {
// build everything and generate bundles

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
module.exports = (gulp) => () => {
const conventionalChangelog = require('gulp-conventional-changelog');
return gulp.src('CHANGELOG.md')

View File

@ -1,3 +1,12 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// tslint:disable:no-console
module.exports = (gulp) => (done) => {
const madge = require('madge');

View File

@ -29,6 +29,7 @@ module.exports = {
closure: gulp => done => {
const {RELATIVE_I18N_DATA_FOLDER} = require('./cldr/extract');
// tslint:disable-next-line:no-console
console.log(RELATIVE_I18N_DATA_FOLDER, fs.existsSync(RELATIVE_I18N_DATA_FOLDER));
if (!fs.existsSync(RELATIVE_I18N_DATA_FOLDER)) {
throw new Error(

View File

@ -1,3 +1,5 @@
// tslint:disable:file-header
/**
* Npm module for Unicode CLDR JSON data
*

View File

@ -11,6 +11,7 @@ const yargs = require('yargs').argv;
const {I18N_DATA_FOLDER, RELATIVE_I18N_DATA_FOLDER, HEADER} = require('./extract');
const OUTPUT_NAME = `closure-locale.ts`;
// tslint:disable:no-console
module.exports = (gulp, done) => {
// the locales used by closure that will be used to generate the closure-locale file
// extracted from:

View File

@ -36,6 +36,7 @@ const HEADER = `/**
// See angular/tools/gulp-tasks/cldr/extract.js
`;
// tslint:disable:no-console
module.exports = (gulp, done) => {
const cldrData = require('./cldr-data');
const LOCALES = cldrData.availableLocales;
@ -292,7 +293,7 @@ function getDateTimeFormats(localeData) {
data.medium._value || data.medium,
data.long._value || data.long,
data.full._value || data.full
])
]);
}
const dateFormats = localeData.main('dates/calendars/gregorian/dateFormats');
@ -318,9 +319,9 @@ function getDayPeriodRules(localeData) {
if (dayPeriodRules[key]._at) {
rules[key] = dayPeriodRules[key]._at;
} else {
rules[key] = [dayPeriodRules[key]._from, dayPeriodRules[key]._before]
rules[key] = [dayPeriodRules[key]._from, dayPeriodRules[key]._before];
}
})
});
}
return rules;
@ -417,7 +418,7 @@ function getCurrencySettings(locale, localeData) {
if (currency[key]._from && !currency[key]._to) {
return currentCurrency = key;
}
})
});
});
if (!currentCurrency) {
@ -483,7 +484,7 @@ function objectValues(obj) {
* Like JSON.stringify, but without double quotes around keys, and already formatted for readability
*/
function stringify(obj) {
return util.inspect(obj, {depth: null, maxArrayLength: null})
return util.inspect(obj, {depth: null, maxArrayLength: null});
}
/**

View File

@ -1,29 +1,45 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// Check the coding standards and programming errors
module.exports = (gulp) => () => {
const tslint = require('gulp-tslint');
// Built-in rules are at
// https://palantir.github.io/tslint/rules/
const tslintConfig = require('../../tslint.json');
// Built-in rules are at https://palantir.github.io/tslint/rules/
const path = require('path');
return gulp
.src([
// todo(vicb): add .js files when supported
// see https://github.com/palantir/tslint/pull/1515
'./modules/**/*.ts',
'./modules/**/*.js',
'./packages/**/*.ts',
'./packages/**/*.js',
'./tools/**/*.ts',
'./tools/**/*.js',
'./*.ts',
// Ignore node_modules directories
'!**/node_modules/**',
// Ignore built files directories
'!**/built/**',
'!**/dist/**',
// Ignore special files
'!**/*.externs.js',
// Ignore generated files due to lack of copyright header
// todo(alfaproject): make generated files lintable
'!**/*.d.ts',
'!**/*.ngfactory.ts',
])
.pipe(tslint({
tslint: require('tslint').default,
configuration: tslintConfig,
configuration: path.resolve(__dirname, '../../tslint.json'),
formatter: 'prose',
}))
.pipe(tslint.report({emitError: true}));

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// returns the script path for the current platform
module.exports = function platformScriptPath(path) {

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
const entrypoints = [
'dist/packages-dist/core/core.d.ts', 'dist/packages-dist/core/testing.d.ts',
'dist/packages-dist/common/common.d.ts', 'dist/packages-dist/common/testing.d.ts',

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
module.exports = {
// Serve the built files

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
const fs = require('fs');
const path = require('path');
const sourceMapTest = require('../source-map-test');
@ -16,6 +24,7 @@ module.exports = (gulp) => () => {
});
if (!packages.length) {
// tslint:disable-next-line:no-console
console.log('No packages found in packages-dist. Unable to run source map test.');
process.exit(1);
}

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
function tsc(projectPath, done) {
const path = require('path');
const platformScriptPath = require('./platform-script-path');

View File

@ -1,3 +1,12 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// tslint:disable:no-console
module.exports = (gulp) => () => {
const validateCommitMessage = require('../validate-commit-message');
const childProcess = require('child_process');

View File

@ -11,7 +11,7 @@ var DotsReporter = require('karma/lib/reporters/dots_color');
var createErrorFormatter = function(basePath, emitter, SourceMapConsumer) {
var lastServedFiles = [];
emitter.on('file_list_modified', function(files) { lastServedFiles = files.served });
emitter.on('file_list_modified', function(files) { lastServedFiles = files.served; });
function findFile(path) { return lastServedFiles.filter(_ => _.path === path)[0]; }
var URL_REGEXP = new RegExp(
@ -48,16 +48,16 @@ var createErrorFormatter = function(basePath, emitter, SourceMapConsumer) {
// indent every line
if (indentation) {
msg = indentation + msg.replace(/\n/g, '\n' + indentation)
msg = indentation + msg.replace(/\n/g, '\n' + indentation);
}
return msg + '\n';
}
};
};
var InternalAngularReporter = function(config, emitter) {
var formatter = createErrorFormatter(config.basePath, emitter, SourceMapConsumer);
DotsReporter.call(this, formatter, false, config.colors)
DotsReporter.call(this, formatter, false, config.colors);
};
InternalAngularReporter.$inject = ['config', 'emitter'];

View File

@ -14,7 +14,7 @@ var childProcess = require('child_process');
var PROJECT_ROOT = path.join(__dirname, '../../');
// tslint:disable:no-console
function checkNodeModules(logOutput, purgeIfStale) {
var yarnCheck = childProcess.spawnSync(
'./node_modules/.bin/yarn check --integrity',

View File

@ -1,5 +1,13 @@
#!/usr/bin/env node
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
const path = require('path');
const getMappings = require('./parseMap');
@ -18,6 +26,7 @@ const STRIP_PREFIX_REGEX = /ɵ/g;
const STRIP_SUFFIX_REGEX = /([^$]+)(\$)+\d/g;
const SYNTHETIC_REGEX = /ɵ[0-9]/;
// tslint:disable:no-console
module.exports = function sourceMapTest(package) {
const mappings =
getMappings(getBundlePath(package)).filter(mapping => shouldCheckMapping(mapping.sourceText));
@ -27,7 +36,7 @@ module.exports = function sourceMapTest(package) {
const failures = mappings.filter(mapping => {
if (SYNTHETIC_REGEX.test(mapping.sourceText)) return false;
if (cleanSource(mapping.sourceText) !== cleanGen(mapping.genText)) {
console.log('source:', cleanSource(mapping.sourceText), 'gen:', cleanGen(mapping.genText))
console.log('source:', cleanSource(mapping.sourceText), 'gen:', cleanGen(mapping.genText));
}
return cleanSource(mapping.sourceText) !== cleanGen(mapping.genText);
});
@ -58,6 +67,7 @@ function cleanGen(gen) {
.replace(AFTER_EQUALS_REGEX, '$1=');
}
// tslint:disable:no-console
function logResults(failures) {
if (failures.length) {
console.error(`... and source maps appear to be broken: ${failures.length} failures.`);

View File

@ -1,11 +1,18 @@
#!/usr/bin/env node
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
const vlq = require('vlq');
const fs = require('fs');
const path = require('path');
module.exports =
function getMappings(bundlePath) {
module.exports = function getMappings(bundlePath) {
const sourceMap = JSON.parse(getFile(`${bundlePath}.map`));
const sourcesContent = sourceMap.sourcesContent.map(file => file.split('\n'));
const bundleLines = getFile(bundlePath).split('\n');
@ -45,7 +52,7 @@ module.exports =
return matchData;
}, []);
}
};
function getFile(filePath) {
return fs.readFileSync(path.resolve(process.cwd(), filePath), 'UTF-8');

View File

@ -6,12 +6,13 @@
* found in the LICENSE file at https://angular.io/license
*/
// tslint:disable:no-console
module.exports = function travisFoldStart(name) {
if (process.env.TRAVIS) console.log('travis_fold:start:' + encode(name));
return function travisFoldEnd() {
if (process.env.TRAVIS) console.log('travis_fold:end:' + encode(name));
}
};
};

View File

@ -1,4 +1,10 @@
'use strict';
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
describe('validate-commit-message.js', function() {
var validateMessage = require('./validate-commit-message');
@ -112,4 +118,4 @@ describe('validate-commit-message.js', function() {
it('should not ignore msg prefixed with "WIP: "',
function() { expect(validateMessage('WIP: bullshit')).toBe(INVALID); });
});
});
});