Skip to content

Commit a815a4a

Browse files
Merge pull request #1 from angular/master
Update upstream
2 parents 7be7908 + c9d8243 commit a815a4a

27 files changed

+545
-313
lines changed

lib/bootstrap-local.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const ts = require('typescript');
99
Error.stackTraceLimit = Infinity;
1010

1111
global.angularCliIsLocal = true;
12-
global.angularCliPackages = require('./packages');
12+
global.angularCliPackages = require('./packages').packages;
1313

1414
const compilerOptions = JSON.parse(fs.readFileSync(path.join(__dirname, '../tsconfig.json')));
1515

@@ -48,7 +48,7 @@ require.extensions['.ts'] = function (m, filename) {
4848

4949
// If we're running locally, meaning npm linked. This is basically "developer mode".
5050
if (!__dirname.match(new RegExp(`\\${path.sep}node_modules\\${path.sep}`))) {
51-
const packages = require('./packages');
51+
const packages = require('./packages').packages;
5252

5353
// We mock the module loader so that we can fake our packages when running locally.
5454
const Module = require('module');

lib/packages.js

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const glob = require('glob');
55
const path = require('path');
66

77
const packageRoot = path.join(__dirname, '../packages');
8+
const toolsRoot = path.join(__dirname, '../tools');
9+
const distRoot = path.join(__dirname, '../dist');
10+
811

912
// All the supported packages. Go through the packages directory and create a map of
1013
// name => fullPath.
@@ -20,7 +23,7 @@ const packages =
2023
let name = pkgJson['name'];
2124

2225
packages[name] = {
23-
dist: path.join(__dirname, '../dist', pkg.name),
26+
dist: path.join(distRoot, pkg.name),
2427
packageJson: path.join(pkg.root, 'package.json'),
2528
root: pkg.root,
2629
relative: path.relative(path.dirname(__dirname), pkg.root),
@@ -29,12 +32,38 @@ const packages =
2932
return packages;
3033
}, {});
3134

35+
const tools = glob.sync(path.join(toolsRoot, '**/package.json'))
36+
.map(toolPath => path.relative(toolsRoot, path.dirname(toolPath)))
37+
.map(toolName => {
38+
const root = path.join(toolsRoot, toolName);
39+
const pkgJson = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
40+
const name = pkgJson['name'];
41+
const dist = path.join(distRoot, toolName);
42+
43+
return {
44+
name,
45+
main: path.join(dist, pkgJson['main']),
46+
mainTs: path.join(toolsRoot, toolName, pkgJson['main'].replace(/\.js$/, '.ts')),
47+
root,
48+
packageJson: path.join(toolsRoot, toolName, 'package.json'),
49+
dist
50+
};
51+
})
52+
.reduce((tools, tool) => {
53+
tools[tool.name] = tool;
54+
return tools;
55+
}, {});
56+
3257

33-
module.exports = packages;
58+
module.exports = { packages, tools };
3459

3560

3661
// If we run this from the command line, just output the list of modules neatly formatted.
3762
if (require.main === module) {
38-
// eslint-disable-next-line no-console
63+
/* eslint-disable no-console */
64+
console.log('Packages:');
3965
console.log(JSON.stringify(packages, null, 2));
66+
console.log('');
67+
console.log('Tools:');
68+
console.log(JSON.stringify(tools, null, 2));
4069
}

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
},
1010
"keywords": [],
1111
"scripts": {
12-
"build": "node ./scripts/publish/build.js",
13-
"build:patch": "node ./scripts/patch.js",
14-
"build:packages": "for PKG in packages/*; do echo Building $PKG...; tsc -p $PKG; done",
12+
"build": "node scripts/run-tool.js publish build",
1513
"test": "npm-run-all -c test:packages test:cli test:deps test:licenses test:messages",
1614
"e2e": "npm run test:e2e",
1715
"e2e:nightly": "node tests/run_e2e.js --nightly",
@@ -24,7 +22,8 @@
2422
"test:packages": "node scripts/run-packages-spec.js",
2523
"eslint": "eslint .",
2624
"tslint": "tslint \"**/*.ts\" -c tslint.json -e \"**/config/schema.d.ts\" -e \"**/tests/**\" -e \"**/blueprints/*/files/**/*.ts\" -e \"node_modules/**\" -e \"tmp/**\" -e \"dist/**\"",
27-
"lint": "npm-run-all -c eslint tslint"
25+
"lint": "npm-run-all -c eslint tslint",
26+
"tool": "node scripts/run-tool.js"
2827
},
2928
"repository": {
3029
"type": "git",
@@ -107,9 +106,9 @@
107106
]
108107
},
109108
"devDependencies": {
110-
"@angular/compiler": "^4.0.0-rc.5",
111-
"@angular/compiler-cli": "^4.0.0-rc.5",
112-
"@angular/core": "^4.0.0-rc.5",
109+
"@angular/compiler": "^4.0.0",
110+
"@angular/compiler-cli": "^4.0.0",
111+
"@angular/core": "^4.0.0",
113112
"@types/chai": "^3.4.32",
114113
"@types/chalk": "^0.4.28",
115114
"@types/common-tags": "^1.2.4",
@@ -119,6 +118,7 @@
119118
"@types/glob": "^5.0.29",
120119
"@types/jasmine": "~2.2.0",
121120
"@types/lodash": "4.14.50",
121+
"@types/minimist": "^1.2.0",
122122
"@types/mock-fs": "^3.6.30",
123123
"@types/node": "^6.0.36",
124124
"@types/request": "0.0.39",

packages/@angular/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"webpack": "~2.2.0",
8484
"webpack-dev-server": "~2.3.0",
8585
"webpack-merge": "^2.4.0",
86-
"zone.js": "^0.7.2"
86+
"zone.js": "^0.8.4"
8787
},
8888
"optionalDependencies": {
8989
"node-sass": "^4.3.0"

packages/@ngtools/json-schema/src/schema-class-factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export interface SchemaClass<JsonType> extends Object {
7878
// Direct access to the schema.
7979
$$schema(): RootSchemaTreeNode;
8080

81-
$$serialize(mimetype?: string): string;
81+
$$serialize(mimetype?: string, ...args: any[]): string;
8282
}
8383

8484

packages/@ngtools/webpack/src/plugin.ts

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ export class AotPlugin implements Tapable {
361361

362362
const original = consumer.originalPositionFor({ line, column: character });
363363
return {
364-
line: original.line,
365-
character: original.column,
364+
line: typeof original.line == 'number' ? original.line : line,
365+
character: typeof original.column == 'number' ? original.column : character,
366366
fileName: original.source || fileName
367367
};
368368
} catch (e) {
@@ -390,19 +390,25 @@ export class AotPlugin implements Tapable {
390390
);
391391

392392
if (diagnostics.length > 0) {
393-
const message = diagnostics
394-
.map(diagnostic => {
395-
const position = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
396-
397-
const sourceText = diagnostic.file.getFullText();
398-
let {line, character, fileName} = this._translateSourceMap(sourceText,
399-
diagnostic.file.fileName, position);
400-
401-
const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
402-
return `${fileName} (${line + 1},${character + 1}): ${message}`;
403-
})
404-
.join('\n');
405-
this._compilation.errors.push(message);
393+
diagnostics.forEach(diagnostic => {
394+
const position = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
395+
396+
const sourceText = diagnostic.file.getFullText();
397+
let {line, character, fileName} = this._translateSourceMap(sourceText,
398+
diagnostic.file.fileName, position);
399+
400+
const messageText = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
401+
const message = `${fileName} (${line + 1},${character + 1}): ${messageText}`;
402+
403+
switch (diagnostic.category) {
404+
case ts.DiagnosticCategory.Error:
405+
this._compilation.errors.push(message);
406+
break;
407+
408+
default:
409+
this._compilation.warnings.push(message);
410+
}
411+
});
406412
}
407413
}
408414

scripts/build-schema-dts.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)