Skip to content

Updated TypeScript version into 2.4.1 #549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from Jul 27, 2017
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module.exports = function(grunt)
src: 'dist/test',
options: {
mask: '*.js',
timeout: 4000
timeout: 10000
}
}
}
Expand Down Expand Up @@ -120,7 +120,13 @@ module.exports = function(grunt)
target: 'ES5',
module: 'CommonJS',
experimentalDecorators: true,
jsx: 'react'
jsx: 'react',
lib: [
"lib.dom.d.ts",
"lib.es5.d.ts",
"lib.es2015.iterable.d.ts",
"lib.es2015.collection.d.ts"
],
});

FS.readdirSync(Path.join(base)).forEach(function(directory) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "typedoc",
"description": "Create api documentations for typescript projects.",
"version": "0.7.1",
"version": "0.7.2",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is normally updated on release. Also need to think about whether this is a breaking change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this can be undone, I'll do a release.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 😁

"homepage": "http://typedoc.org",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -46,7 +46,7 @@
"progress": "^2.0.0",
"shelljs": "^0.7.0",
"typedoc-default-themes": "^0.5.0",
"typescript": "2.3.4"
"typescript": "2.4.1"
},
"devDependencies": {
"@types/mocha": "^2.2.39",
Expand All @@ -71,7 +71,7 @@
"LICENSE"
],
"scripts": {
"test": "mocha -t 4000 dist/test",
"test": "mocha -t 10000 dist/test",
"build": "grunt build_and_test",
"prepublish": "npm run build"
},
Expand Down
6 changes: 3 additions & 3 deletions src/lib/converter/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ export class Converter extends ChildableComponent<Application, ConverterComponen
this.typeNodeConverters = [];
}

addComponent(name: string, componentClass: ComponentClass<ConverterComponent>): ConverterComponent {
addComponent<T extends ConverterComponent & Component>(name: string, componentClass: T | ComponentClass<T>): T {
const component = super.addComponent(name, componentClass);
if (component instanceof ConverterNodeComponent) {
this.addNodeConverter(component);
} else if (component instanceof ConverterTypeComponent) {
this.addTypeConverter(<TypeTypeConverter<any>|TypeNodeConverter<any, any>> component);
this.addTypeConverter(component);
}

return component;
Expand All @@ -201,7 +201,7 @@ export class Converter extends ChildableComponent<Application, ConverterComponen
}
}

private addTypeConverter(converter: TypeTypeConverter<any>|TypeNodeConverter<any, any>) {
private addTypeConverter(converter: ConverterTypeComponent) {
if ('supportsNode' in converter && 'convertNode' in converter) {
this.typeNodeConverters.push(<TypeNodeConverter<any, any>> converter);
this.typeNodeConverters.sort((a, b) => (b.priority || 0) - (a.priority || 0));
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/types/string-literal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ export class StringLiteralConverter extends ConverterTypeComponent implements Ty
* @returns The type reflection representing the given string literal type.
*/
convertType(context: Context, type: ts.LiteralType): Type {
return new StringLiteralType(type.text);
return new StringLiteralType(<string> type.value);
}
}
2 changes: 1 addition & 1 deletion src/lib/utils/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface ComponentOptions {
const childMappings: {host: any, child: Function}[] = [];

export function Component(options: ComponentOptions): ClassDecorator {
return (target: ComponentClass<Component>) => {
return (target: Function) => {
const proto = target.prototype;
if (!(proto instanceof AbstractComponent)) {
throw new Error('The `Component` decorator can only be used with a subclass of `AbstractComponent`.');
Expand Down
6 changes: 3 additions & 3 deletions src/test/converter/decorators/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ function decoratorWithParam(value:boolean):MethodDecorator {
* @param options The options object of this decorator.
* @param options.name A property on the options object of this decorator.
*/
function decoratorWithOptions(options:{name:string}):ClassDecorator {
function decoratorWithOptions(options:{name:string}): ClassDecorator {
return function (target) {
target.options = options;
}
(target as any).options = options;
};
}
4 changes: 2 additions & 2 deletions src/test/converter/react/react.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ declare namespace __React {
// ----------------------------------------------------------------------

// Base component for plain JS classes
class Component<P, S> implements ComponentLifecycle<P, S> {
class Component<P, S> {
constructor(props?: P, context?: any);
setState(f: (prevState: S, props: P) => S, callback?: () => any): void;
setState(state: S, callback?: () => any): void;
Expand Down Expand Up @@ -932,7 +932,7 @@ declare module "react/addons" {
// ----------------------------------------------------------------------

// Base component for plain JS classes
class Component<P, S> implements ComponentLifecycle<P, S> {
class Component<P, S> {
constructor(props?: P, context?: any);
setState(f: (prevState: S, props: P) => S, callback?: () => any): void;
setState(state: S, callback?: () => any): void;
Expand Down
17 changes: 0 additions & 17 deletions src/test/converter/react/specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -603,23 +603,6 @@
}
]
}
],
"implementedTypes": [
{
"type": "reference",
"name": "ComponentLifecycle",
"typeArguments": [
{
"type": "reference",
"name": "DemoProps",
"id": 2
},
{
"type": "intrinsic",
"name": "any"
}
]
}
]
},
{
Expand Down
6 changes: 2 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
"module": "commonjs",
"lib": [
"dom",
"es5",
"es2015.collection",
"es2015.iterable"
"es2016"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

es2016? Is there something from es2016 we're using or should this just be es2015?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was some issues with the types due to the last typescript version, it was solved using the es2016 lib

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which issues?

],
"target": "ES5",
"target": "es5",
"noImplicitAny": false,
"removeComments": true,
"noUnusedLocals": true,
Expand Down