Merge pull request #2855 from NativeScript/npm-script-typedoc

Added npm run typedoc and npm run dev-typedoc scripts, read the Devel…
This commit is contained in:
Panayot Cankov
2016-10-07 09:57:16 +03:00
committed by GitHub
4 changed files with 33 additions and 3 deletions

View File

@ -89,3 +89,14 @@ npm run dev-declarations
```
This script will update the iOS declarations. Android tools are not integrated yet.
The declarations are generated from the test app and will include the native code from tns-core-modules-widgets.
# Documentation API reference
The following will build the API reference pages in `bin/dist/apiref`:
```
npm run typedoc
```
If you want to improve on the documentation you can also build and start up dev web server:
```
npm run dev-typedoc
```
The terminal will point the address you can open in your web browsed.

View File

@ -420,9 +420,10 @@ module.exports = function(grunt) {
"name": 'NativeScript',
"includeDeclarations": undefined,
"experimentalDecorators": undefined,
"mode": "file"
"mode": "file",
"tsconfig": "tsconfig.typedoc.json"
},
src: localCfg.srcTsdFiles
src: "tns-core-modules/tns-core-modules.d.ts"
}
}
});

View File

@ -29,6 +29,7 @@
"shelljs": "^0.7.0",
"time-grunt": "1.3.0",
"tslint": "3.4.0",
"typedoc": "0.4.5",
"typescript": "^2.0.3"
},
"scripts": {
@ -50,6 +51,8 @@
"test-ios": "tns run ios --path tests --justlaunch",
"test-watch-android": "npm run pretest && concurrently --kill-others \"npm run tsc-tiw\" \"tns livesync android --path tests --watch\"",
"test-watch-ios": "npm run pretest && concurrently --kill-others \"npm run tsc-tiw\" \"tns livesync ios --path tests --watch\"",
"prepublish": "echo \"Development reminder: npm run setup\n\""
"prepublish": "echo \"Development reminder: npm run setup\n\"",
"typedoc": "typedoc --tsconfig tsconfig.typedoc.json --out bin/dist/apiref --mode file --includeDeclarations --name NativeScript --theme ./node_modules/nativescript-typedoc-theme",
"dev-typedoc": "npm run typedoc && cd bin/dist/apiref && http-server"
}
}

15
tsconfig.typedoc.json Normal file
View File

@ -0,0 +1,15 @@
{
"compilerOptions": {
"noEmitOnError": true,
"noEmitHelpers": true,
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"noImplicitUseStrict": true,
"experimentalDecorators": true
},
"files": [
"tns-core-modules/tns-core-modules.d.ts"
]
}