Skip to content

Commit d4b2f56

Browse files
authored
Update dependencies - typescript to 3.0 (#832)
* Update for typescript v3.1.x * Fix isExported flag * update dependencies - typescript to 2.9
1 parent f75f378 commit d4b2f56

11 files changed

+2029
-864
lines changed

package-lock.json

+1,991-819
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+21-20
Original file line numberDiff line numberDiff line change
@@ -30,41 +30,41 @@
3030
"node": ">= 6.0.0"
3131
},
3232
"dependencies": {
33-
"@types/fs-extra": "5.0.1",
34-
"@types/handlebars": "4.0.36",
35-
"@types/highlight.js": "9.12.2",
36-
"@types/lodash": "4.14.104",
37-
"@types/marked": "0.3.0",
33+
"@types/fs-extra": "^5.0.3",
34+
"@types/handlebars": "^4.0.38",
35+
"@types/highlight.js": "^9.12.3",
36+
"@types/lodash": "^4.14.110",
37+
"@types/marked": "^0.4.0",
3838
"@types/minimatch": "3.0.3",
39-
"@types/shelljs": "0.7.8",
40-
"fs-extra": "^5.0.0",
39+
"@types/shelljs": "^0.8.0",
40+
"fs-extra": "^7.0.0",
4141
"handlebars": "^4.0.6",
4242
"highlight.js": "^9.0.0",
43-
"lodash": "^4.17.5",
44-
"marked": "^0.3.17",
43+
"lodash": "^4.17.10",
44+
"marked": "^0.4.0",
4545
"minimatch": "^3.0.0",
4646
"progress": "^2.0.0",
47-
"shelljs": "^0.8.1",
47+
"shelljs": "^0.8.2",
4848
"typedoc-default-themes": "^0.5.0",
49-
"typescript": "2.7.2"
49+
"typescript": "3.0.x"
5050
},
5151
"devDependencies": {
52-
"@types/mocha": "2.2.48",
52+
"@types/mocha": "^5.2.4",
5353
"@types/mockery": "^1.4.29",
54-
"grunt": "^1.0.2",
54+
"grunt": "^1.0.3",
5555
"grunt-cli": "^1.2.0",
5656
"grunt-contrib-clean": "^1.0.0",
5757
"grunt-contrib-copy": "^1.0.0",
58-
"grunt-contrib-watch": "^1.0.0",
58+
"grunt-contrib-watch": "^1.1.0",
5959
"grunt-mocha-istanbul": "^5.0.1",
6060
"grunt-string-replace": "^1.2.0",
61-
"grunt-ts": "^5.5.1",
62-
"grunt-tslint": "^5.0.1",
61+
"grunt-ts": "^6.0.0-beta.21",
62+
"grunt-tslint": "^5.0.2",
6363
"istanbul": "^0.4.1",
64-
"mocha": "^5.0.4",
64+
"mocha": "^5.2.0",
6565
"mockery": "^2.1.0",
6666
"ts-node": "^7.0.0",
67-
"tslint": "^5.9.1"
67+
"tslint": "^5.10.0"
6868
},
6969
"files": [
7070
"bin",
@@ -74,10 +74,11 @@
7474
"LICENSE"
7575
],
7676
"scripts": {
77-
"test": "mocha -t 10000 dist/test",
77+
"test": "mocha -t 10000 --exit dist/test",
7878
"build": "grunt build_and_test",
7979
"prepublish": "npm run build",
80-
"grunt": "grunt"
80+
"grunt": "grunt",
81+
"clean": "rm -rf node_modules package-lock.json lib coverage .tscache"
8182
},
8283
"keywords": [
8384
"typescript",

src/lib/converter/factories/declaration.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const nonStaticKinds = [
2424
* @param name The desired name of the reflection.
2525
* @returns The resulting reflection.
2626
*/
27-
export function createDeclaration(context: Context, node: ts.Node, kind: ReflectionKind, name?: string): DeclarationReflection {
27+
export function createDeclaration(context: Context, node: ts.Declaration, kind: ReflectionKind, name?: string): DeclarationReflection {
2828
const container = <ContainerReflection> context.scope;
2929
if (!(container instanceof ContainerReflection)) {
3030
throw new Error('Expected container reflection.');
@@ -54,7 +54,7 @@ export function createDeclaration(context: Context, node: ts.Node, kind: Reflect
5454
if (kind === ReflectionKind.ExternalModule) {
5555
isExported = true; // Always mark external modules as exported
5656
} else if (node.parent && node.parent.kind === ts.SyntaxKind.VariableDeclarationList) {
57-
const parentModifiers = ts.getCombinedModifierFlags(node.parent.parent);
57+
const parentModifiers = ts.getCombinedModifierFlags(node.parent.parent as ts.Declaration);
5858
isExported = isExported || !!(parentModifiers & ts.ModifierFlags.Export);
5959
} else {
6060
isExported = isExported || !!(modifiers & ts.ModifierFlags.Export);
@@ -127,7 +127,7 @@ export function createDeclaration(context: Context, node: ts.Node, kind: Reflect
127127
* @param node The TypeScript node whose properties should be applies to the given reflection.
128128
* @returns The reflection populated with the values of the given node.
129129
*/
130-
function setupDeclaration(context: Context, reflection: DeclarationReflection, node: ts.Node) {
130+
function setupDeclaration(context: Context, reflection: DeclarationReflection, node: ts.Declaration) {
131131
const modifiers = ts.getCombinedModifierFlags(node);
132132

133133
reflection.setFlag(ReflectionFlag.External, context.isExternal);

src/lib/converter/nodes/class.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class ClassConverter extends ConverterNodeComponent<ts.ClassDeclaration>
5050
});
5151
}
5252

53-
const baseType = _ts.getClassExtendsHeritageClauseElement(node);
53+
const baseType = _ts.getEffectiveBaseTypeNode(node);
5454
if (baseType) {
5555
const type = context.getTypeAtLocation(baseType);
5656
if (!context.isInherit) {

src/lib/converter/nodes/function.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class FunctionConverter extends ConverterNodeComponent<ts.FunctionDeclara
2828
const scope = context.scope;
2929
const kind = scope.kind & ReflectionKind.ClassOrInterface ? ReflectionKind.Method : ReflectionKind.Function;
3030
const hasBody = !!node.body;
31-
const method = createDeclaration(context, <ts.Node> node, kind);
31+
const method = createDeclaration(context, node, kind);
3232

3333
if (method // child inheriting will return null on createDeclaration
3434
&& kind & ReflectionKind.Method

src/lib/ts-internal.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ export function isBindingPattern(node: ts.Node): node is ts.BindingPattern {
9696
return tsany.isBindingPattern.apply(this, arguments);
9797
}
9898

99-
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L1729
100-
export function getClassExtendsHeritageClauseElement(node: ts.ClassLikeDeclaration | ts.InterfaceDeclaration) {
101-
return tsany.getClassExtendsHeritageClauseElement.apply(this, arguments);
99+
// https://github.com/Microsoft/TypeScript/blob/v3.0.1/src/compiler/utilities.ts#L2408
100+
export function getEffectiveBaseTypeNode(node: ts.ClassLikeDeclaration | ts.InterfaceDeclaration) {
101+
return tsany.getEffectiveBaseTypeNode.apply(this, arguments);
102102
}
103103

104104
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L1734

src/test/renderer/specs/classes/_default_export_.defaultexportedclass.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ <h1>Class DefaultExportedClass</h1>
7474
<div class="lead">
7575
<p>This class is exported via es6 export syntax.</p>
7676
</div>
77-
<pre><code><span class="hljs-builtin-name">export</span><span class="hljs-built_in"> default </span>class DefaultExportedClass
78-
</code></pre>
77+
<pre><code><span class="hljs-builtin-name">export</span><span class="hljs-built_in"> default </span>class DefaultExportedClass</code></pre>
7978
</div>
8079
</section>
8180
<section class="tsd-panel tsd-hierarchy">

src/test/renderer/specs/classes/_default_export_.notexportedclassname.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ <h1>Class NotExportedClassName</h1>
7575
<p>This class is exported under a different name. The exported name is
7676
&quot;ExportedClassName&quot;</p>
7777
</div>
78-
<pre><code class="lang-JavaScript"><span class="hljs-keyword">export</span> {NotExportedClassName <span class="hljs-keyword">as</span> ExportedClassName};
79-
</code></pre>
78+
<pre><code class="language-JavaScript"><span class="hljs-keyword">export</span> {NotExportedClassName <span class="hljs-keyword">as</span> ExportedClassName};</code></pre>
8079
</div>
8180
</section>
8281
<section class="tsd-panel tsd-hierarchy">

src/test/renderer/specs/classes/_single_export_.singleexportedclass.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ <h1>Class SingleExportedClass</h1>
7474
<div class="lead">
7575
<p>This class is exported by being assigned to ´export´.</p>
7676
</div>
77-
<pre><code><span class="hljs-attribute">export</span> = SingleExportedClass<span class="hljs-comment">;</span>
78-
</code></pre>
77+
<pre><code><span class="hljs-attribute">export</span> = SingleExportedClass<span class="hljs-comment">;</span></code></pre>
7978
</div>
8079
</section>
8180
<section class="tsd-panel tsd-hierarchy">

src/test/renderer/specs/index.html

+4-7
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,17 @@ <h1 id="typedoc">TypeDoc</h1>
7575
<h2 id="installation">Installation</h2>
7676
<p>TypeDoc runs on Node.js and is available as an NPM package. You can install TypeDoc
7777
in your project&#39;s directory as usual:</p>
78-
<pre><code class="lang-bash">$ npm install typedoc --save-dev
79-
</code></pre>
78+
<pre><code class="language-bash">$ npm install typedoc --save-dev</code></pre>
8079
<p>Like the TypeScript compiler, TypeDoc comes with a binary that can be called from anywhere
8180
if you install TypeDoc as a global module. The name of the executable is <code>typedoc</code>.</p>
82-
<pre><code class="lang-bash">$ npm install typedoc --global
83-
$ typedoc
84-
</code></pre>
81+
<pre><code class="language-bash">$ npm install typedoc --global
82+
$ typedoc</code></pre>
8583
<h2 id="usage">Usage</h2>
8684
<h3 id="shell">Shell</h3>
8785
<p>TypeDoc accepts most of the command line arguments that the TypeScript compiler accepts. One major
8886
difference is the fact that one may pass an entire directory instead of individual files to the documentation
8987
generator. So in order to create a documentation for an entire project you simply type:</p>
90-
<pre><code class="lang-bash">$ typedoc --out path/to/documentation/ path/to/typescript/project/
91-
</code></pre>
88+
<pre><code class="language-bash">$ typedoc --out path/to/documentation/ path/to/typescript/project/</code></pre>
9289
<h3 id="important-note">Important note</h3>
9390
<p>Starting with version 0.2, TypeDoc no longer can predict whether files should be treated as modules
9491
or whether the project should be compiled into one big namespace. You must specify the <code>mode</code> argument

src/test/renderer/specs/modules/_functions_.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,7 @@ <h5>paramA: <a href="../interfaces/_classes_.inameinterface.html" class="tsd-sig
221221
<div class="tsd-comment tsd-typography">
222222
<p>This is a <strong>parameter</strong> pointing to an interface.</p>
223223
<pre><code><span class="hljs-keyword">var</span> <span class="hljs-keyword">value</span>:BaseClass = <span class="hljs-keyword">new</span> BaseClass(<span class="hljs-string">'test'</span>);
224-
functionWithArguments(<span class="hljs-string">'arg'</span>, <span class="hljs-number">0</span>, <span class="hljs-keyword">value</span>);
225-
</code></pre>
224+
functionWithArguments(<span class="hljs-string">'arg'</span>, <span class="hljs-number">0</span>, <span class="hljs-keyword">value</span>);</code></pre>
226225
</div>
227226
</li>
228227
</ul>
@@ -533,8 +532,7 @@ <h5>paramA: <a href="../interfaces/_classes_.inameinterface.html" class="tsd-sig
533532
<div class="lead">
534533
<p>This is a <strong>parameter</strong> pointing to an interface.</p>
535534
<pre><code><span class="hljs-keyword">var</span> <span class="hljs-keyword">value</span>:BaseClass = <span class="hljs-keyword">new</span> BaseClass(<span class="hljs-string">'test'</span>);
536-
functionWithArguments(<span class="hljs-string">'arg'</span>, <span class="hljs-number">0</span>, <span class="hljs-keyword">value</span>);
537-
</code></pre>
535+
functionWithArguments(<span class="hljs-string">'arg'</span>, <span class="hljs-number">0</span>, <span class="hljs-keyword">value</span>);</code></pre>
538536
</div>
539537
</div>
540538
</li>

0 commit comments

Comments
 (0)