test: upgrade ts-api-guardian to v0.1.2

This commit is contained in:
Jason Choi 2016-06-22 11:28:40 -07:00 committed by Igor Minar
parent 3ad81b1beb
commit 249a6bdd98
7 changed files with 144 additions and 1948 deletions

View File

@ -10,7 +10,8 @@ const gulp = require('gulp');
const path = require('path');
const os = require('os');
const srcsToFmt = ['tools/**/*.ts', 'modules/@angular/**/*.ts'];
const srcsToFmt =
['tools/**/*.ts', 'modules/@angular/**/*.ts', '!tools/public_api_guard/**/*.d.ts'];
gulp.task('format:enforce', () => {
const format = require('gulp-clang-format');
@ -26,6 +27,59 @@ gulp.task('format', () => {
format.format('file', clangFormat)).pipe(gulp.dest('.'));
});
const entrypoints = [
'dist/packages-dist/core/index.d.ts',
'dist/packages-dist/core/testing.d.ts',
'dist/packages-dist/common/index.d.ts',
'dist/packages-dist/common/testing.d.ts',
'dist/packages-dist/compiler/index.d.ts',
'dist/packages-dist/compiler/testing.d.ts',
'dist/packages-dist/upgrade/index.d.ts',
'dist/packages-dist/platform-browser/index.d.ts',
'dist/packages-dist/platform-browser/testing.d.ts',
'dist/packages-dist/platform-browser/testing_e2e.d.ts',
'dist/packages-dist/platform-browser-dynamic/index.d.ts',
'dist/packages-dist/platform-browser-dynamic/testing.d.ts',
'dist/packages-dist/platform-server/index.d.ts',
'dist/packages-dist/platform-server/testing.d.ts',
'dist/packages-dist/http/index.d.ts',
'dist/packages-dist/http/testing.d.ts'
];
const publicApiDir = 'tools/public_api_guard';
const publicApiArgs = [
'--rootDir', 'dist/packages-dist',
'--stripExportPattern', '^__',
'--allowModuleIdentifiers', 'jasmine',
'--allowModuleIdentifiers', 'protractor',
'--allowModuleIdentifiers', 'angular'
].concat(entrypoints);
// Note that these two commands work on built d.ts files instead of the source
gulp.task('public-api:enforce', (done) => {
const child_process = require('child_process');
child_process
.spawn(
`${__dirname}/node_modules/.bin/ts-api-guardian`,
['--verifyDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
.on('close', (errorCode) => {
if (errorCode !== 0) {
done(new Error(
'Public API differs from golden file. Please run `gulp public-api:update`.'));
} else {
done();
}
});
});
gulp.task('public-api:update', (done) => {
const child_process = require('child_process');
child_process
.spawn(
`${__dirname}/node_modules/.bin/ts-api-guardian`,
['--outDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
.on('close', (errorCode) => done(errorCode));
});
gulp.task('lint', ['format:enforce', 'tools:build'], () => {
const tslint = require('gulp-tslint');
// Built-in rules are at

View File

@ -1593,9 +1593,6 @@
"buffer-crc32": {
"version": "0.2.5"
},
"buffer-shims": {
"version": "1.0.0"
},
"buffer-xor": {
"version": "1.0.3"
},
@ -2882,7 +2879,12 @@
"version": "1.0.0"
},
"readable-stream": {
"version": "2.1.4"
"version": "2.1.4",
"dependencies": {
"buffer-shims": {
"version": "1.0.0"
}
}
},
"stream-combiner2": {
"version": "1.1.1"
@ -3137,6 +3139,9 @@
},
"through2": {
"version": "2.0.0"
},
"vinyl": {
"version": "0.5.3"
}
}
},
@ -5179,8 +5184,29 @@
"version": "1.0.0"
},
"ts-api-guardian": {
"version": "0.0.4",
"version": "0.1.2",
"dependencies": {
"ansi-regex": {
"version": "2.0.0"
},
"ansi-styles": {
"version": "2.2.1"
},
"chalk": {
"version": "1.1.3"
},
"diff": {
"version": "2.2.3"
},
"has-ansi": {
"version": "2.0.0"
},
"strip-ansi": {
"version": "3.0.1"
},
"supports-color": {
"version": "2.0.0"
},
"typescript": {
"version": "1.7.3"
}
@ -5376,9 +5402,6 @@
"vhost": {
"version": "3.0.2"
},
"vinyl": {
"version": "0.5.3"
},
"vinyl-fs": {
"version": "0.3.14",
"dependencies": {
@ -5620,5 +5643,5 @@
}
},
"name": "angular-srcs",
"version": "2.0.0-rc.2"
"version": "2.0.0-rc.3"
}

67
npm-shrinkwrap.json generated
View File

@ -1,6 +1,6 @@
{
"name": "angular-srcs",
"version": "2.0.0-rc.2",
"version": "2.0.0-rc.3",
"dependencies": {
"@types/angularjs": {
"version": "1.5.13-alpha",
@ -2489,11 +2489,6 @@
"from": "buffer-crc32@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.5.tgz"
},
"buffer-shims": {
"version": "1.0.0",
"from": "buffer-shims@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz"
},
"buffer-xor": {
"version": "1.0.3",
"from": "buffer-xor@>=1.0.2 <2.0.0",
@ -4564,7 +4559,14 @@
"readable-stream": {
"version": "2.1.4",
"from": "readable-stream@>=2.0.2 <3.0.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz"
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz",
"dependencies": {
"buffer-shims": {
"version": "1.0.0",
"from": "buffer-shims@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz"
}
}
},
"stream-combiner2": {
"version": "1.1.1",
@ -4971,6 +4973,11 @@
"version": "2.0.0",
"from": "through2@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/through2/-/through2-2.0.0.tgz"
},
"vinyl": {
"version": "0.5.3",
"from": "vinyl@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz"
}
}
},
@ -8257,10 +8264,45 @@
"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz"
},
"ts-api-guardian": {
"version": "0.0.4",
"from": "ts-api-guardian@0.0.4",
"resolved": "https://registry.npmjs.org/ts-api-guardian/-/ts-api-guardian-0.0.4.tgz",
"version": "0.1.2",
"from": "ts-api-guardian@0.1.2",
"resolved": "https://registry.npmjs.org/ts-api-guardian/-/ts-api-guardian-0.1.2.tgz",
"dependencies": {
"ansi-regex": {
"version": "2.0.0",
"from": "ansi-regex@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz"
},
"ansi-styles": {
"version": "2.2.1",
"from": "ansi-styles@>=2.2.1 <3.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz"
},
"chalk": {
"version": "1.1.3",
"from": "chalk@>=1.1.3 <2.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz"
},
"diff": {
"version": "2.2.3",
"from": "diff@>=2.2.3 <3.0.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-2.2.3.tgz"
},
"has-ansi": {
"version": "2.0.0",
"from": "has-ansi@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz"
},
"strip-ansi": {
"version": "3.0.1",
"from": "strip-ansi@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz"
},
"supports-color": {
"version": "2.0.0",
"from": "supports-color@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz"
},
"typescript": {
"version": "1.7.3",
"from": "typescript@1.7.3",
@ -8570,11 +8612,6 @@
"from": "vhost@>=3.0.1 <3.1.0",
"resolved": "https://registry.npmjs.org/vhost/-/vhost-3.0.2.tgz"
},
"vinyl": {
"version": "0.5.3",
"from": "vinyl@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz"
},
"vinyl-fs": {
"version": "0.3.14",
"from": "vinyl-fs@>=0.3.0 <0.4.0",

View File

@ -105,7 +105,7 @@
"systemjs": "0.18.10",
"systemjs-builder": "^0.10.3",
"through2": "^0.6.5",
"ts-api-guardian": "0.0.4",
"ts-api-guardian": "0.1.2",
"ts2dart": "^0.9.10",
"tsickle": "^0.1.4",
"tslint": "^3.10.0-dev.2",

File diff suppressed because it is too large Load Diff

View File

@ -91,10 +91,8 @@ if (platform == 'node') {
start: 'File change detected. Starting incremental compilation...',
error: 'error',
complete: 'Compilation complete. Watching for file changes.',
onChangeCmds: [[
'node', 'dist/tools/cjs-jasmine/index-tools', '--',
'{public_api_guard,tsc-wrapped}/**/*{_,.}spec.js'
]]
onChangeCmds:
[['node', 'dist/tools/cjs-jasmine/index-tools', '--', 'tsc-wrapped/**/*{_,.}spec.js']]
});
}

View File

@ -19,6 +19,7 @@
},
"exclude": [
"node_modules",
"typings-test"
"typings-test",
"public_api_guard"
]
}