Skip to content

Support for TypeScript 1.5 #95

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

Closed
ansgar-john opened this issue May 9, 2015 · 16 comments
Closed

Support for TypeScript 1.5 #95

ansgar-john opened this issue May 9, 2015 · 16 comments

Comments

@ansgar-john
Copy link

Installing typescript with "npm i -g typescript" already gives me version 1.5. I happily used things like "for ... of" and multiple optional parameters in an object like

function forEach(obj: any, callback, opts: { includeParentProperties?: boolean, includeFunctions?: boolean } = {}): any {

which unfortunately typescript 1.4.1 does not seem to know.

I would be really happy to see the great typedoc with support for ts 1.5 :)

@EisenbergEffect
Copy link

@sebastian-lenz The Aurelia team is considering moving to TypeScript for our source. We've been looking around at good options for code documentation and Type Doc looks excellent. In order for us to adopt it, we would need support for TypeScript 1.5. So 👍 on this for our team as well.

@sebastian-lenz
Copy link
Member

TypeDoc will definitely receive an update to be compatible with TypeScript v1.5. I've made some adjustments and the current master now plays well with the release-1.5 branch of TypeScript. Please note that the version on npm is behind this one and will not be compatible with TypeDoc.

@buu700
Copy link

buu700 commented May 11, 2015

+1. I'd actually been meaning to suggest removing the dependency between warning-free compilation and doc generation, if at all possible.

If it's helpful to anyone else, as a temporary workaround I've been running typedoc with the ES6 flag and running a few find/replace commands to get rid of the 1.4-incompatible features in my code.

for file in $(find . -name '*.ts') ; do
    cat $file | perl -pe 's/(^[^*]+)\sof\s/\1 in /g' | perl -pe 's/const\s/let /g' > $file.tmp
    mv $file.tmp $file
done

@fforjan
Copy link

fforjan commented May 12, 2015

How do you run the current master ?
On my mac, npm install, grunt and then sh run in the examples folder does not work well.
Should I expect the master to work or not ?

@DomiR
Copy link

DomiR commented May 13, 2015

Seems to be broken with the 1.5.0-beta:
I'm using:
./typedoc/bin/typedoc --module 'commonjs' --target ES5 --includeDeclarations backend/typings/*ts --out ./docs ./backend/src/*

ES6 is not an option as I am using a lot of import = require

bildschirmfoto 2015-05-13 um 12 25 16

@ansgar-john
Copy link
Author

I successfully deployed typedoc like this on my mac. This should get obsolete as soon as typescript 1.5 is not beta anymore :)

Step 1: install and build typescript (we currently need the newest version from git!). Just follow the steps at https://github.com/Microsoft/TypeScript#building, i.e.

git clone https://github.com/Microsoft/TypeScript.git
cd TypeScript
npm install -g jake
npm install
jake local
cd ..

Step 2: clone typedoc, newest version from git:

git clone https://github.com/sebastian-lenz/typedoc.git
cd typedoc

Step 3: edit typedoc's "package.json" and change the dependency version of "typescript" (line 31) from "1.5.x" to "1.5.0-beta".

Step 4: go on:

npm install

Step 5: copy our typescript build to typedoc

cp ../TypeScript/bin/* ./node_modules/typescript/bin/

Step 6: build typedoc

grunt
cd ..

@sebastian-lenz
Copy link
Member

To clarify, I've build the version of TypeDoc currently on master against this commit on the release-1.5 branch of TypeScript. This is not the version on npm, the version on npm is older.

@buu700 We could add a --force parameter just like grunt has to ignore compiler errors and force the generation of docs. However in this case this would not help, v1.5 of TypeScript is definitely incompatible with TypeDoc as some of the calls used have been deprecated/removed. Also we'll run into problems with the constant enumerations used by the compiler, TypeDoc must be compiled against the TypeScript version that should be used.

@fforjan, @DomiR No, the version on master will not run with the beta release of TypeScript on npm. You have to follow the steps pointed out by @ansgar-john to build you own stable pair of TypeScript/TypeDoc, it's the same way I'm doing it right now.

@ansgar-john You're checking out the master branch, I'm not sure how the TypeScript folks organize their commits. I believe it would be more appropriate to check out the release-1.5 branch.

git clone https://github.com/Microsoft/TypeScript.git --branch release-1.5

Hope this helps, all the pain should be gone as soon as there is a stable release.

@ghost
Copy link

ghost commented Jun 9, 2015

+1 Waiting for 1.5 support

@aciccarello
Copy link
Collaborator

@sebastian-lenz So are we just waiting for the final TypeScript 1.5 release? If I understand you correctly, the master branch of TypeDoc is ready to work with the final release when it lands. Correct?

@ghost
Copy link

ghost commented Jun 9, 2015

@aciccarello That's not correct. I tried the master branch, didn't work.

I see no point in waiting for a release when at this point 1.5 is almost here. I dislike projects that wait for a final release before working on support for it.

@yurikoex
Copy link

+1 Waiting for 1.5 support

@ironman9967
Copy link

Also waiting for 1.5

@FlippieCoetser
Copy link
Contributor

@sebastian-lenz
I tried the master branch, didn't work with Typescript 1.5 code.

import * as 'LocalName' from 'moduleName' not recognized by Typedoc.

Is this a known limitation?

@drinchev
Copy link

Hey guys, I created a temporary fork based on @ansgar-john guide that is compiled for TS 1.5.

You can find it here : https://github.com/drinchev/typedoc

You can use it as dependency like this :

    "typedoc": "git://github.com/drinchev/typedoc.git#master"

TS 1.5.0-beta, actually is delayed for me and I'm using typedoc in my build, so I needed something that can work from my CI Server.

Will remove the repo once 1.5 is out of beta.

@sebastian-lenz
Copy link
Member

Hi folks, sorry for the very long delay. I've just published v0.3.5 on NPM which uses TypeScript v1.5.0-beta. This build does not support all features of TypeScript 1.5 but it should run on all of your projects. If you run into any kind of problems feel free to open a new issue.

@sebastian-lenz
Copy link
Member

I'll close this issue now as TypeDoc now runs with TypeScript 1.5. Please feel free to open separate issues if you encounter problems or see fields that need enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests