Skip to content

Commit

Permalink
Update dependencies - typescript to 3.0 (#832)
Browse files Browse the repository at this point in the history
* Update for typescript v3.1.x

* Fix isExported flag

* update dependencies - typescript to 2.9
  • Loading branch information
aciccarello authored Aug 11, 2018
1 parent f75f378 commit d4b2f56
Show file tree
Hide file tree
Showing 11 changed files with 2,029 additions and 864 deletions.
2,810 changes: 1,991 additions & 819 deletions package-lock.json

Large diffs are not rendered by default.

41 changes: 21 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,41 +30,41 @@
"node": ">= 6.0.0"
},
"dependencies": {
"@types/fs-extra": "5.0.1",
"@types/handlebars": "4.0.36",
"@types/highlight.js": "9.12.2",
"@types/lodash": "4.14.104",
"@types/marked": "0.3.0",
"@types/fs-extra": "^5.0.3",
"@types/handlebars": "^4.0.38",
"@types/highlight.js": "^9.12.3",
"@types/lodash": "^4.14.110",
"@types/marked": "^0.4.0",
"@types/minimatch": "3.0.3",
"@types/shelljs": "0.7.8",
"fs-extra": "^5.0.0",
"@types/shelljs": "^0.8.0",
"fs-extra": "^7.0.0",
"handlebars": "^4.0.6",
"highlight.js": "^9.0.0",
"lodash": "^4.17.5",
"marked": "^0.3.17",
"lodash": "^4.17.10",
"marked": "^0.4.0",
"minimatch": "^3.0.0",
"progress": "^2.0.0",
"shelljs": "^0.8.1",
"shelljs": "^0.8.2",
"typedoc-default-themes": "^0.5.0",
"typescript": "2.7.2"
"typescript": "3.0.x"
},
"devDependencies": {
"@types/mocha": "2.2.48",
"@types/mocha": "^5.2.4",
"@types/mockery": "^1.4.29",
"grunt": "^1.0.2",
"grunt": "^1.0.3",
"grunt-cli": "^1.2.0",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-mocha-istanbul": "^5.0.1",
"grunt-string-replace": "^1.2.0",
"grunt-ts": "^5.5.1",
"grunt-tslint": "^5.0.1",
"grunt-ts": "^6.0.0-beta.21",
"grunt-tslint": "^5.0.2",
"istanbul": "^0.4.1",
"mocha": "^5.0.4",
"mocha": "^5.2.0",
"mockery": "^2.1.0",
"ts-node": "^7.0.0",
"tslint": "^5.9.1"
"tslint": "^5.10.0"
},
"files": [
"bin",
Expand All @@ -74,10 +74,11 @@
"LICENSE"
],
"scripts": {
"test": "mocha -t 10000 dist/test",
"test": "mocha -t 10000 --exit dist/test",
"build": "grunt build_and_test",
"prepublish": "npm run build",
"grunt": "grunt"
"grunt": "grunt",
"clean": "rm -rf node_modules package-lock.json lib coverage .tscache"
},
"keywords": [
"typescript",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/converter/factories/declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const nonStaticKinds = [
* @param name The desired name of the reflection.
* @returns The resulting reflection.
*/
export function createDeclaration(context: Context, node: ts.Node, kind: ReflectionKind, name?: string): DeclarationReflection {
export function createDeclaration(context: Context, node: ts.Declaration, kind: ReflectionKind, name?: string): DeclarationReflection {
const container = <ContainerReflection> context.scope;
if (!(container instanceof ContainerReflection)) {
throw new Error('Expected container reflection.');
Expand Down Expand Up @@ -54,7 +54,7 @@ export function createDeclaration(context: Context, node: ts.Node, kind: Reflect
if (kind === ReflectionKind.ExternalModule) {
isExported = true; // Always mark external modules as exported
} else if (node.parent && node.parent.kind === ts.SyntaxKind.VariableDeclarationList) {
const parentModifiers = ts.getCombinedModifierFlags(node.parent.parent);
const parentModifiers = ts.getCombinedModifierFlags(node.parent.parent as ts.Declaration);
isExported = isExported || !!(parentModifiers & ts.ModifierFlags.Export);
} else {
isExported = isExported || !!(modifiers & ts.ModifierFlags.Export);
Expand Down Expand Up @@ -127,7 +127,7 @@ export function createDeclaration(context: Context, node: ts.Node, kind: Reflect
* @param node The TypeScript node whose properties should be applies to the given reflection.
* @returns The reflection populated with the values of the given node.
*/
function setupDeclaration(context: Context, reflection: DeclarationReflection, node: ts.Node) {
function setupDeclaration(context: Context, reflection: DeclarationReflection, node: ts.Declaration) {
const modifiers = ts.getCombinedModifierFlags(node);

reflection.setFlag(ReflectionFlag.External, context.isExternal);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/nodes/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class ClassConverter extends ConverterNodeComponent<ts.ClassDeclaration>
});
}

const baseType = _ts.getClassExtendsHeritageClauseElement(node);
const baseType = _ts.getEffectiveBaseTypeNode(node);
if (baseType) {
const type = context.getTypeAtLocation(baseType);
if (!context.isInherit) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/nodes/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class FunctionConverter extends ConverterNodeComponent<ts.FunctionDeclara
const scope = context.scope;
const kind = scope.kind & ReflectionKind.ClassOrInterface ? ReflectionKind.Method : ReflectionKind.Function;
const hasBody = !!node.body;
const method = createDeclaration(context, <ts.Node> node, kind);
const method = createDeclaration(context, node, kind);

if (method // child inheriting will return null on createDeclaration
&& kind & ReflectionKind.Method
Expand Down
6 changes: 3 additions & 3 deletions src/lib/ts-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ export function isBindingPattern(node: ts.Node): node is ts.BindingPattern {
return tsany.isBindingPattern.apply(this, arguments);
}

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

// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L1734
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ <h1>Class DefaultExportedClass</h1>
<div class="lead">
<p>This class is exported via es6 export syntax.</p>
</div>
<pre><code><span class="hljs-builtin-name">export</span><span class="hljs-built_in"> default </span>class DefaultExportedClass
</code></pre>
<pre><code><span class="hljs-builtin-name">export</span><span class="hljs-built_in"> default </span>class DefaultExportedClass</code></pre>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ <h1>Class NotExportedClassName</h1>
<p>This class is exported under a different name. The exported name is
&quot;ExportedClassName&quot;</p>
</div>
<pre><code class="lang-JavaScript"><span class="hljs-keyword">export</span> {NotExportedClassName <span class="hljs-keyword">as</span> ExportedClassName};
</code></pre>
<pre><code class="language-JavaScript"><span class="hljs-keyword">export</span> {NotExportedClassName <span class="hljs-keyword">as</span> ExportedClassName};</code></pre>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ <h1>Class SingleExportedClass</h1>
<div class="lead">
<p>This class is exported by being assigned to ´export´.</p>
</div>
<pre><code><span class="hljs-attribute">export</span> = SingleExportedClass<span class="hljs-comment">;</span>
</code></pre>
<pre><code><span class="hljs-attribute">export</span> = SingleExportedClass<span class="hljs-comment">;</span></code></pre>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
Expand Down
11 changes: 4 additions & 7 deletions src/test/renderer/specs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,17 @@ <h1 id="typedoc">TypeDoc</h1>
<h2 id="installation">Installation</h2>
<p>TypeDoc runs on Node.js and is available as an NPM package. You can install TypeDoc
in your project&#39;s directory as usual:</p>
<pre><code class="lang-bash">$ npm install typedoc --save-dev
</code></pre>
<pre><code class="language-bash">$ npm install typedoc --save-dev</code></pre>
<p>Like the TypeScript compiler, TypeDoc comes with a binary that can be called from anywhere
if you install TypeDoc as a global module. The name of the executable is <code>typedoc</code>.</p>
<pre><code class="lang-bash">$ npm install typedoc --global
$ typedoc
</code></pre>
<pre><code class="language-bash">$ npm install typedoc --global
$ typedoc</code></pre>
<h2 id="usage">Usage</h2>
<h3 id="shell">Shell</h3>
<p>TypeDoc accepts most of the command line arguments that the TypeScript compiler accepts. One major
difference is the fact that one may pass an entire directory instead of individual files to the documentation
generator. So in order to create a documentation for an entire project you simply type:</p>
<pre><code class="lang-bash">$ typedoc --out path/to/documentation/ path/to/typescript/project/
</code></pre>
<pre><code class="language-bash">$ typedoc --out path/to/documentation/ path/to/typescript/project/</code></pre>
<h3 id="important-note">Important note</h3>
<p>Starting with version 0.2, TypeDoc no longer can predict whether files should be treated as modules
or whether the project should be compiled into one big namespace. You must specify the <code>mode</code> argument
Expand Down
6 changes: 2 additions & 4 deletions src/test/renderer/specs/modules/_functions_.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ <h5>paramA: <a href="../interfaces/_classes_.inameinterface.html" class="tsd-sig
<div class="tsd-comment tsd-typography">
<p>This is a <strong>parameter</strong> pointing to an interface.</p>
<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>);
functionWithArguments(<span class="hljs-string">'arg'</span>, <span class="hljs-number">0</span>, <span class="hljs-keyword">value</span>);
</code></pre>
functionWithArguments(<span class="hljs-string">'arg'</span>, <span class="hljs-number">0</span>, <span class="hljs-keyword">value</span>);</code></pre>
</div>
</li>
</ul>
Expand Down Expand Up @@ -533,8 +532,7 @@ <h5>paramA: <a href="../interfaces/_classes_.inameinterface.html" class="tsd-sig
<div class="lead">
<p>This is a <strong>parameter</strong> pointing to an interface.</p>
<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>);
functionWithArguments(<span class="hljs-string">'arg'</span>, <span class="hljs-number">0</span>, <span class="hljs-keyword">value</span>);
</code></pre>
functionWithArguments(<span class="hljs-string">'arg'</span>, <span class="hljs-number">0</span>, <span class="hljs-keyword">value</span>);</code></pre>
</div>
</div>
</li>
Expand Down

0 comments on commit d4b2f56

Please sign in to comment.