Skip to content

Commit 2c23aac

Browse files
spartan563blakeembrey
authored andcommitted
Update TypeScript to 1.8.10 (TypeStrong#204)
1 parent 53bb762 commit 2c23aac

File tree

132 files changed

+1897
-533
lines changed

Some content is hidden

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

132 files changed

+1897
-533
lines changed

UPDATING.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
## Updating
3+
TypeDoc makes use of internal API methods from the TypeScript compiler - as such you will need
4+
to recompile it for each and every different TypeScript compiler release. If your project doesn't
5+
rely on features from the latest TypeScript compiler, you may be able to get away with using
6+
version of TypeDoc which doesn't target it.
7+
8+
If, however, you need the latest version and one hasn't yet been published then these are the steps
9+
you should follow to build your own.
10+
11+
```bash
12+
# Checkout a copy of TypeDoc if you don't have one already
13+
git clone https://github.com/TypeStrong/typedoc typedoc
14+
cd typedoc
15+
16+
# Change the version of TypeScript used by the project
17+
editor package.json
18+
19+
npm install -g grunt-cli # install grunt's CLI globally if you don't have it
20+
npm install # install TypeDoc's dependencies
21+
22+
# Checkout the version of TypeScript you are targetting
23+
git clone https://github.com/Microsoft/TypeScript typescript
24+
cd typescript
25+
git checkout v1.8.10 # checkout the correct version (as set in package.json)
26+
npm install -g jake # install the jake build tool globally if you don't have it
27+
npm install # install TypeScript's build dependencies
28+
jake local # build TypeScript
29+
cd ../
30+
31+
# Setup TypeDoc for your TypeScript version
32+
grunt ts:typescript # compile the internal-API typescript definition files
33+
grunt string-replace:typescript # format the internal-API typescript files
34+
35+
# Build and run the automated TypeDoc tests
36+
grunt build_and_test
37+
38+
# Do a visual inspection to make sure that modules were generated correctly
39+
ls test/render/specs/modules
40+
```
41+
42+
Once this has been done, you should have a functional version of TypeDoc for
43+
your version of TypeScript. If you're so inclined, please open a Pull Request
44+
with your updated project so that others may benefit from the update.
45+
46+
To make use of your version of TypeDoc in a project, point your `package.json`
47+
file at it using your GitHub project path.
48+
49+
```json
50+
{
51+
"dependencies": {
52+
"typedoc": "mygithubuser/typedoc#v1.8.10"
53+
}
54+
}
55+
```

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var application_1 = require("./lib/application");
23
exports.Application = application_1.Application;
34
var cli_1 = require("./lib/cli");

lib/application.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var __extends = (this && this.__extends) || function (d, b) {
23
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
34
function __() { this.constructor = d; }
@@ -170,5 +171,5 @@ var Application = (function (_super) {
170171
component_1.Component({ name: "application", internal: true })
171172
], Application);
172173
return Application;
173-
})(component_1.ChildableComponent);
174+
}(component_1.ChildableComponent));
174175
exports.Application = Application;

lib/cli.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var __extends = (this && this.__extends) || function (d, b) {
23
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
34
function __() { this.constructor = d; }
@@ -103,5 +104,5 @@ var CliApplication = (function (_super) {
103104
})
104105
], CliApplication.prototype, "help", void 0);
105106
return CliApplication;
106-
})(application_1.Application);
107+
}(application_1.Application));
107108
exports.CliApplication = CliApplication;

lib/converter/components.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var __extends = (this && this.__extends) || function (d, b) {
23
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
34
function __() { this.constructor = d; }
@@ -11,15 +12,15 @@ var ConverterComponent = (function (_super) {
1112
_super.apply(this, arguments);
1213
}
1314
return ConverterComponent;
14-
})(component_1.AbstractComponent);
15+
}(component_1.AbstractComponent));
1516
exports.ConverterComponent = ConverterComponent;
1617
var ConverterNodeComponent = (function (_super) {
1718
__extends(ConverterNodeComponent, _super);
1819
function ConverterNodeComponent() {
1920
_super.apply(this, arguments);
2021
}
2122
return ConverterNodeComponent;
22-
})(ConverterComponent);
23+
}(ConverterComponent));
2324
exports.ConverterNodeComponent = ConverterNodeComponent;
2425
var ConverterTypeComponent = (function (_super) {
2526
__extends(ConverterTypeComponent, _super);
@@ -28,5 +29,5 @@ var ConverterTypeComponent = (function (_super) {
2829
this.priority = 0;
2930
}
3031
return ConverterTypeComponent;
31-
})(ConverterComponent);
32+
}(ConverterComponent));
3233
exports.ConverterTypeComponent = ConverterTypeComponent;

lib/converter/context.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var ts = require("typescript");
23
var minimatch_1 = require("minimatch");
34
var index_1 = require("../models/index");
@@ -167,5 +168,5 @@ var Context = (function () {
167168
return typeParameters;
168169
};
169170
return Context;
170-
})();
171+
}());
171172
exports.Context = Context;

lib/converter/convert-expression.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var ts = require("typescript");
23
function convertDefaultValue(node) {
34
if (node.initializer) {

lib/converter/converter.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var __extends = (this && this.__extends) || function (d, b) {
23
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
34
function __() { this.constructor = d; }
@@ -65,8 +66,8 @@ var Converter = (function (_super) {
6566
Converter.prototype.removeNodeConverter = function (converter) {
6667
var converters = this.nodeConverters;
6768
var keys = _.keys(this.nodeConverters);
68-
for (var _i = 0; _i < keys.length; _i++) {
69-
var key = keys[_i];
69+
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
70+
var key = keys_1[_i];
7071
if (converters[key] === converter) {
7172
delete converters[key];
7273
}
@@ -143,19 +144,19 @@ var Converter = (function (_super) {
143144
program.getSourceFiles().forEach(function (sourceFile) {
144145
_this.convertNode(context, sourceFile);
145146
});
146-
var diagnostics = program.getSyntacticDiagnostics();
147-
if (diagnostics.length === 0) {
148-
diagnostics = program.getGlobalDiagnostics();
149-
if (diagnostics.length === 0) {
150-
return program.getSemanticDiagnostics();
151-
}
152-
else {
153-
return diagnostics;
154-
}
155-
}
156-
else {
147+
var diagnostics = program.getOptionsDiagnostics();
148+
if (diagnostics.length)
157149
return diagnostics;
158-
}
150+
diagnostics = program.getSyntacticDiagnostics();
151+
if (diagnostics.length)
152+
return diagnostics;
153+
diagnostics = program.getGlobalDiagnostics();
154+
if (diagnostics.length)
155+
return diagnostics;
156+
diagnostics = program.getSemanticDiagnostics();
157+
if (diagnostics.length)
158+
return diagnostics;
159+
return [];
159160
};
160161
Converter.prototype.resolve = function (context) {
161162
this.trigger(Converter.EVENT_RESOLVE_BEGIN, context);
@@ -169,8 +170,7 @@ var Converter = (function (_super) {
169170
return project;
170171
};
171172
Converter.prototype.getDefaultLib = function () {
172-
var target = this.application.options.getCompilerOptions().target;
173-
return target == 2 ? 'lib.es6.d.ts' : 'lib.d.ts';
173+
return ts.getDefaultLibFileName(this.application.options.getCompilerOptions());
174174
};
175175
Converter.EVENT_BEGIN = 'begin';
176176
Converter.EVENT_END = 'end';
@@ -220,5 +220,5 @@ var Converter = (function (_super) {
220220
component_1.Component({ name: "converter", internal: true, childClass: components_1.ConverterComponent })
221221
], Converter);
222222
return Converter;
223-
})(component_1.ChildableComponent);
223+
}(component_1.ChildableComponent));
224224
exports.Converter = Converter;

lib/converter/factories/comment.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var ts = require("typescript");
23
var index_1 = require("../../models/comments/index");
34
function createComment(node) {
@@ -9,7 +10,7 @@ function createComment(node) {
910
}
1011
exports.createComment = createComment;
1112
function isTopmostModuleDeclaration(node) {
12-
if (node.nextContainer && node.nextContainer.kind == 218) {
13+
if (node.nextContainer && node.nextContainer.kind == 221) {
1314
var next = node.nextContainer;
1415
if (node.name.end + 1 == next.name.pos) {
1516
return false;
@@ -18,7 +19,7 @@ function isTopmostModuleDeclaration(node) {
1819
return true;
1920
}
2021
function getRootModuleDeclaration(node) {
21-
while (node.parent && node.parent.kind == 218) {
22+
while (node.parent && node.parent.kind == 221) {
2223
var parent_1 = node.parent;
2324
if (node.name.pos == parent_1.name.end + 1) {
2425
node = parent_1;
@@ -30,10 +31,10 @@ function getRootModuleDeclaration(node) {
3031
return node;
3132
}
3233
function getRawComment(node) {
33-
if (node.parent && node.parent.kind === 212) {
34+
if (node.parent && node.parent.kind === 215) {
3435
node = node.parent.parent;
3536
}
36-
else if (node.kind === 218) {
37+
else if (node.kind === 221) {
3738
if (!isTopmostModuleDeclaration(node)) {
3839
return null;
3940
}
@@ -45,7 +46,7 @@ function getRawComment(node) {
4546
var comments = ts.getJsDocComments(node, sourceFile);
4647
if (comments && comments.length) {
4748
var comment;
48-
if (node.kind == 248) {
49+
if (node.kind == 251) {
4950
if (comments.length == 1)
5051
return null;
5152
comment = comments[0];

lib/converter/factories/declaration.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var ts = require("typescript");
23
var index_1 = require("../../models/index");
34
var converter_1 = require("../converter");
@@ -33,28 +34,28 @@ function createDeclaration(context, node, kind, name) {
3334
if (kind == index_1.ReflectionKind.ExternalModule) {
3435
isExported = true;
3536
}
36-
else if (node.parent && node.parent.kind == 212) {
37-
isExported = isExported || !!(node.parent.parent.flags & 1);
37+
else if (node.parent && node.parent.kind == 215) {
38+
isExported = isExported || !!(node.parent.parent.flags & 2);
3839
}
3940
else {
40-
isExported = isExported || !!(node.flags & 1);
41+
isExported = isExported || !!(node.flags & 2);
4142
}
4243
if (!isExported && context.converter.excludeNotExported) {
4344
return null;
4445
}
45-
var isPrivate = !!(node.flags & 32);
46+
var isPrivate = !!(node.flags & 16);
4647
if (context.isInherit && isPrivate) {
4748
return null;
4849
}
4950
var isConstructorProperty = false;
5051
var isStatic = false;
5152
if (nonStaticKinds.indexOf(kind) == -1) {
52-
isStatic = !!(node.flags & 128);
53+
isStatic = !!(node.flags & 64);
5354
if (container.kind == index_1.ReflectionKind.Class) {
54-
if (node.parent && node.parent.kind == 144) {
55+
if (node.parent && node.parent.kind == 145) {
5556
isConstructorProperty = true;
5657
}
57-
else if (!node.parent || node.parent.kind != 214) {
58+
else if (!node.parent || node.parent.kind != 217) {
5859
isStatic = true;
5960
}
6061
}
@@ -88,8 +89,8 @@ function createDeclaration(context, node, kind, name) {
8889
exports.createDeclaration = createDeclaration;
8990
function setupDeclaration(context, reflection, node) {
9091
reflection.setFlag(index_1.ReflectionFlag.External, context.isExternal);
91-
reflection.setFlag(index_1.ReflectionFlag.Protected, !!(node.flags & 64));
92-
reflection.setFlag(index_1.ReflectionFlag.Public, !!(node.flags & 16));
92+
reflection.setFlag(index_1.ReflectionFlag.Protected, !!(node.flags & 32));
93+
reflection.setFlag(index_1.ReflectionFlag.Public, !!(node.flags & 8));
9394
reflection.setFlag(index_1.ReflectionFlag.Optional, !!(node['questionToken']));
9495
if (context.isInherit &&
9596
(node.parent == context.inheritParent || reflection.flags.isConstructorProperty)) {

lib/converter/factories/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var comment_1 = require('./comment');
23
exports.createComment = comment_1.createComment;
34
var declaration_1 = require('./declaration');

lib/converter/factories/parameter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var ts = require("typescript");
23
var index_1 = require("../../models/reflections/index");
34
var converter_1 = require("../converter");

lib/converter/factories/reference.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var index_1 = require("../../models/types/index");
23
function createReferenceType(context, symbol, includeParent) {
34
var checker = context.checker;

lib/converter/factories/signature.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var ts = require("typescript");
23
var index_1 = require("../../models/index");
34
var converter_1 = require("../converter");
@@ -25,7 +26,7 @@ function createSignature(context, node, name, kind) {
2526
exports.createSignature = createSignature;
2627
function extractSignatureType(context, node) {
2728
var checker = context.checker;
28-
if (node.kind & 147 || node.kind & 168) {
29+
if (node.kind & 148 || node.kind & 171) {
2930
try {
3031
var signature = checker.getSignatureFromDeclaration(node);
3132
return context.converter.convertType(context, node.type, checker.getReturnTypeOfSignature(signature));

lib/converter/factories/type-parameter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var index_1 = require("../../models/index");
23
var converter_1 = require("../converter");
34
function createTypeParameter(context, node) {

lib/converter/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var context_1 = require("./context");
23
exports.Context = context_1.Context;
34
var converter_1 = require("./converter");

lib/converter/nodes/accessor.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var __extends = (this && this.__extends) || function (d, b) {
23
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
34
function __() { this.constructor = d; }
@@ -18,14 +19,14 @@ var AccessorConverter = (function (_super) {
1819
function AccessorConverter() {
1920
_super.apply(this, arguments);
2021
this.supports = [
21-
145,
22-
146
22+
146,
23+
147
2324
];
2425
}
2526
AccessorConverter.prototype.convert = function (context, node) {
2627
var accessor = index_2.createDeclaration(context, node, index_1.ReflectionKind.Accessor);
2728
context.withScope(accessor, function () {
28-
if (node.kind == 145) {
29+
if (node.kind == 146) {
2930
accessor.getSignature = index_2.createSignature(context, node, '__get', index_1.ReflectionKind.GetSignature);
3031
}
3132
else {
@@ -38,5 +39,5 @@ var AccessorConverter = (function (_super) {
3839
components_1.Component({ name: 'node:accessor' })
3940
], AccessorConverter);
4041
return AccessorConverter;
41-
})(components_1.ConverterNodeComponent);
42+
}(components_1.ConverterNodeComponent));
4243
exports.AccessorConverter = AccessorConverter;

lib/converter/nodes/alias.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var __extends = (this && this.__extends) || function (d, b) {
23
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
34
function __() { this.constructor = d; }
@@ -18,7 +19,7 @@ var AliasConverter = (function (_super) {
1819
function AliasConverter() {
1920
_super.apply(this, arguments);
2021
this.supports = [
21-
216
22+
219
2223
];
2324
}
2425
AliasConverter.prototype.convert = function (context, node) {
@@ -33,5 +34,5 @@ var AliasConverter = (function (_super) {
3334
components_1.Component({ name: 'node:alias' })
3435
], AliasConverter);
3536
return AliasConverter;
36-
})(components_1.ConverterNodeComponent);
37+
}(components_1.ConverterNodeComponent));
3738
exports.AliasConverter = AliasConverter;

0 commit comments

Comments
 (0)