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..3074c04b8 --- /dev/null +++ b/nativescript-angular/tsconfig.typedoc.json @@ -0,0 +1,61 @@ +{"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", + "./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