From 9ba7fca7af7dceb2eb3fbe3eb217d4f49d29f672 Mon Sep 17 00:00:00 2001 From: tsonevn Date: Tue, 12 Mar 2019 09:58:54 +0200 Subject: [PATCH 1/2] NS Angular api ref build script --- build-docs.sh | 9 +++++ nativescript-angular/package.json | 7 +++- nativescript-angular/tsconfig.typedoc.json | 44 ++++++++++++++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100755 build-docs.sh create mode 100644 nativescript-angular/tsconfig.typedoc.json diff --git a/build-docs.sh b/build-docs.sh new file mode 100755 index 000000000..a0f39ec85 --- /dev/null +++ b/build-docs.sh @@ -0,0 +1,9 @@ +set -e + +ENV="${ENV:-dev}" +DIST_DIR="nativescript-angular/bin/dist" +APIREF_DIR="$DIST_DIR/ng-api-reference" +rm -rf "$APIREF_DIR" +cd "nativescript-angular" +npm install +npm run typedoc diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index f622d58c2..062189aaa 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -34,7 +34,8 @@ "tsc-w": "tsc -p tsconfig.json -w", "ngc": "ngc -p tsconfig.json", "prepare": "npm run ngc", - "version": "rm -rf package-lock.json && conventional-changelog -p angular -i ../CHANGELOG.md -s && git add ../CHANGELOG.md" + "version": "rm -rf package-lock.json && conventional-changelog -p angular -i ../CHANGELOG.md -s && git add ../CHANGELOG.md", + "typedoc": "typedoc --tsconfig \"./tsconfig.typedoc.json\" --out ./bin/dist/ng-api-reference --includeDeclarations --name \"NativeScript Angular\" --theme ./node_modules/nativescript-typedoc-theme --excludeExternals --externalPattern \"**/+(tns-core-modules|module|declarations).d.ts\"" }, "bin": { "update-app-ng-deps": "./bin/update-app-ng-deps" @@ -73,6 +74,8 @@ "tns-core-modules": "next", "tslint": "^5.5.0", "typescript": "~3.1.1", - "zone.js": "^0.8.4" + "zone.js": "^0.8.4", + "nativescript-typedoc-theme": "git://github.com/NativeScript/nativescript-typedoc-theme.git#master", + "typedoc": "^0.13.0" } } diff --git a/nativescript-angular/tsconfig.typedoc.json b/nativescript-angular/tsconfig.typedoc.json new file mode 100644 index 000000000..4faa0da11 --- /dev/null +++ b/nativescript-angular/tsconfig.typedoc.json @@ -0,0 +1,44 @@ +{"compilerOptions": { + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitUseStrict": true, + "noEmitHelpers": true, + "declaration": true, + "removeComments": false, + "noEmitOnError": true, + "noImplicitAny": false, + "lib": [ + "dom", + "es6", + "es2015.iterable" + ], + "baseUrl": ".", + "paths": { + "*": [ + "./node_modules/tns-core-modules/*", + "./node_modules/*" + ] + } + }, + "angularCompilerOptions": { + "genDir": ".", + "skipMetadataEmit": false, + "skipTemplateCodegen": true, + "strictMetadataEmit": true + }, +"exclude": [ + "./node_modules", + "tns-core-modules/references.d.ts", + "tns-core-modules/node_modules", + "tns-core-modules/ui/frame/transition-definitions.android.d.ts", + "./zone-js", + "./index.ts", + "./bin", + "./index.d.ts", + "./testing" + ] +} \ No newline at end of file From b1c4340aa6859f32c9f69f0f15e5c122274535e4 Mon Sep 17 00:00:00 2001 From: tsonevn Date: Tue, 12 Mar 2019 11:55:16 +0200 Subject: [PATCH 2/2] exclude files from api ref build --- nativescript-angular/tsconfig.typedoc.json | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/nativescript-angular/tsconfig.typedoc.json b/nativescript-angular/tsconfig.typedoc.json index 4faa0da11..3074c04b8 100644 --- a/nativescript-angular/tsconfig.typedoc.json +++ b/nativescript-angular/tsconfig.typedoc.json @@ -39,6 +39,23 @@ "./index.ts", "./bin", "./index.d.ts", - "./testing" + "./testing", + "./animations/index.ts", + "./animations/utils.ts", + "./app-host-view.ts", + "./common/utils.ts", + "./dom-adapter.ts", + "./file-system", + "./forms/index.ts", + "./forms/value-accessors/index.ts", + "./lang-facade.ts", + "./polyfills", + "./router/private-imports", + "./schema-registry.ts", + "./http-client/index.ts", + "./http/index.ts", + "./router/index.ts", + "" + ] } \ No newline at end of file