From 43ceefdc0381e6b634dabe36b4e957fba91e4b6a Mon Sep 17 00:00:00 2001 From: Panayot Cankov Date: Thu, 6 Oct 2016 17:52:14 +0300 Subject: [PATCH 1/2] Added npm run typedoc and npm run dev-typedoc scripts, read the DevelopmentWorkflow.mk --- DevelopmentWorkflow.md | 11 +++++++++++ package.json | 5 ++++- tsconfig.typedoc.json | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tsconfig.typedoc.json diff --git a/DevelopmentWorkflow.md b/DevelopmentWorkflow.md index b316cd2eb..727b78e5a 100644 --- a/DevelopmentWorkflow.md +++ b/DevelopmentWorkflow.md @@ -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. diff --git a/package.json b/package.json index 1846e2e77..3008824d6 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/tsconfig.typedoc.json b/tsconfig.typedoc.json new file mode 100644 index 000000000..6de92b5c3 --- /dev/null +++ b/tsconfig.typedoc.json @@ -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" + ] +} From d061bd80310c27827c7fe8e810a648b531aac220 Mon Sep 17 00:00:00 2001 From: Panayot Cankov Date: Fri, 7 Oct 2016 09:11:33 +0300 Subject: [PATCH 2/2] Make the Grunt work --- gruntfile.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gruntfile.js b/gruntfile.js index 35dba7957..01fd941df 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -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" } } });