Skip to content

Commit

Permalink
Merge pull request NativeScript#1621 from NativeScript/ns_ui_docs_bui…
Browse files Browse the repository at this point in the history
…ld_edit

edit NS UI Docs build
  • Loading branch information
tsonevn authored Apr 10, 2019
2 parents 4482b79 + 515ed52 commit bad1bbf
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 167 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,8 @@ git clone https://github.com/NativeScript/nativescript-sdk-examples-js.git
git clone https://github.com/NativeScript/nativescript-sdk-examples-ng.git
git clone https://github.com/NativeScript/nativescript-cli.git

git clone https://github.com/NativeScript/nativescript-ui-listview
git clone https://github.com/NativeScript/nativescript-ui-autocomplete
git clone https://github.com/NativeScript/nativescript-ui-dataform
git clone https://github.com/NativeScript/nativescript-ui-chart
git clone https://github.com/NativeScript/nativescript-ui-calendar
git clone https://github.com/NativeScript/nativescript-ui-gauge
git clone https://github.com/NativeScript/nativescript-ui-sidedrawer
git clone https://github.com/telerik/nativescript-ui-samples.git
git clone https://github.com/telerik/nativescript-ui-samples-angular.git
```

> **NOTE**: `nativescript-ui-...` are private repositories used for building the Api Reference for the NativeScript UI components.
Expand Down
46 changes: 8 additions & 38 deletions build/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@ SDK_ROOT_JS=$SCRIPT_PATH"/../../nativescript-sdk-examples-js"
SDK_ROOT_NG=$SCRIPT_PATH"/../../nativescript-sdk-examples-ng"
CLI_ROOT=$SCRIPT_PATH"/../../nativescript-cli"
VUEJS_ROOT=$SCRIPT_PATH"/../../docs/vuejs-docs"
NS_UI_LV=$SCRIPT_PATH"/../../nativescript-ui-listview"
NS_UI_AC=$SCRIPT_PATH"/../../nativescript-ui-autocomplete"
NS_UI_DF=$SCRIPT_PATH"/../../nativescript-ui-dataform"
NS_UI_CH=$SCRIPT_PATH"/../../nativescript-ui-chart"
NS_UI_CA=$SCRIPT_PATH"/../../nativescript-ui-calendar"
NS_UI_GA=$SCRIPT_PATH"/../../nativescript-ui-gauge"
NS_UI_SD=$SCRIPT_PATH"/../../nativescript-ui-sidedrawer"
NS_UI_API_REF=$DOCS_ROOT"/ns_ui_api-reference"
NS_UI_SM=$SCRIPT_PATH"/../../nativescript-ui-samples"
NS_UI_SM_NG=$SCRIPT_PATH"/../../nativescript-ui-samples-angular"
NS_UI_DOCS=$DOCS_ROOT"/ns_ui_docs"

[ ! -d "$ROOT" ] && rm -rf $ROOT

Expand Down Expand Up @@ -51,33 +46,8 @@ $VUEJS_ROOT"/_plugins/snippet.rb" \
$VUEJS_ROOT"/_plugins/ns_cookbook.rb"

# NativeScript UI Docs Api Reference build. Docs snippet injecting
declare -a examples=($NS_UI_AC $NS_UI_CA $NS_UI_CH $NS_UI_DF $NS_UI_GA $NS_UI_LV $NS_UI_SD)

for i in "${examples[@]}"
do
if [ -d $i ]; then
cd $i
# Generating Angular d.ts
cd "src"
npm i --ignore-scripts
cd "angular"
tsc

cd "../../demo"
npm install markdown-snippet-injector
# cd app
# tsc
# cd ../
npm run inject
cd "../demo-angular"
npm install markdown-snippet-injector
npm run inject
atLeastOneNSUIExists=1
fi
done

if [ -n "$atLeastOneNSUIExists" -a -d $NS_UI_API_REF ]; then
cd $NS_UI_API_REF
if [ -d $NS_UI_DOCS ] && [ -d $NS_UI_SM ] && [ -d $NS_UI_SM_NG ]; then
cd $NS_UI_DOCS
npm i
gulp
fi
Expand Down Expand Up @@ -140,9 +110,9 @@ cd $ROOT
[ ! -d $MODULES_ROOT ] || cp -R $MODULES_ROOT"/bin/dist/api-reference" $WWW_ROOT
[ ! -d $NG_ROOT ] || cp -R $NG_ROOT"/nativescript-angular/bin/dist/ng-api-reference" $WWW_ROOT

if [ -d $NS_UI_LV ]; then
if [ -d $NS_UI_API_REF"/ns-ui-api-reference" ]; then
cp -R $NS_UI_API_REF"/ns-ui-api-reference" \
if [ -d $NS_UI_DOCS ] && [ -d $NS_UI_SM ] && [ -d $NS_UI_SM_NG ]; then
if [ -d $NS_UI_DOCS"/ns-ui-api-reference" ]; then
cp -R $NS_UI_DOCS"/ns-ui-api-reference" \
$WWW_ROOT
fi
fi
Expand Down
18 changes: 4 additions & 14 deletions build/docs-watcher/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@ module.exports.modulesRoot = path.join(module.exports.root, "..", "..", "NativeS
module.exports.nativescriptAngularRoot = path.join(module.exports.root, "..", "..", "nativescript-angular");
module.exports.sdkExamplesRootNG = path.join(module.exports.root, "..", "..", "nativescript-sdk-examples-ng");
module.exports.sdkExamplesRootJS = path.join(module.exports.root, "..", "..", "nativescript-sdk-examples-js");
module.exports.nsUIListView = path.join(module.exports.root, "..", "..", "nativescript-ui-listview");
module.exports.nsUIAutoComplete = path.join(module.exports.root, "..", "..", "nativescript-ui-autocomplete");
module.exports.nsUIDataForm = path.join(module.exports.root, "..", "..", "nativescript-ui-dataform");
module.exports.nsUIChart = path.join(module.exports.root, "..", "..", "nativescript-ui-chart");
module.exports.nsUICalendar = path.join(module.exports.root, "..", "..", "nativescript-ui-calendar");
module.exports.nsUIGauge = path.join(module.exports.root, "..", "..", "nativescript-ui-gauge");
module.exports.nsUISideDrawer = path.join(module.exports.root, "..", "..", "nativescript-ui-sidedrawer");
module.exports.nsUISamples = path.join(module.exports.root, "..", "..", "nativescript-ui-samples");
module.exports.nsUISamplesAngular = path.join(module.exports.root, "..", "..", "nativescript-ui-samples-angular");
module.exports.cliRoot = path.join(module.exports.root, "..", "..", "nativescript-cli");
module.exports.vuejsRoot = path.join(module.exports.root, "..", "vuejs-docs");

Expand All @@ -35,11 +30,6 @@ module.exports.sourcePathsInImage = [
`${module.exports.sourceFilesRoot}/nativescript-cli`,
`${module.exports.sourceFilesRoot}/nativescript-sdk-examples-js`,
`${module.exports.sourceFilesRoot}/nativescript-sdk-examples-ng`,
`${module.exports.sourceFilesRoot}/nativescript-ui-autocomplete`,
`${module.exports.sourceFilesRoot}/nativescript-ui-calendar`,
`${module.exports.sourceFilesRoot}/nativescript-ui-chart`,
`${module.exports.sourceFilesRoot}/nativescript-ui-dataform`,
`${module.exports.sourceFilesRoot}/nativescript-ui-gauge`,
`${module.exports.sourceFilesRoot}/nativescript-ui-listview`,
`${module.exports.sourceFilesRoot}/nativescript-ui-sidedrawer`,
`${module.exports.sourceFilesRoot}/nativescript-ui-samples`,
`${module.exports.sourceFilesRoot}/nativescript-ui-sidedrawer-angular`,
];
9 changes: 2 additions & 7 deletions build/docs-watcher/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,8 @@ rsync --relative -az --exclude node_modules/ --exclude .git \
[ ! -d /root/./nativescript-sdk-examples-ng ] || rsync --relative -az --exclude node_modules/ --exclude .git /root/./nativescript-sdk-examples-ng /www
[ ! -d /root/./nativescript-sdk-examples-js ] || rsync --relative -az --exclude node_modules/ --exclude .git /root/./nativescript-sdk-examples-js /www
[ ! -d /root/./nativescript-cli ] || rsync --relative -az --exclude node_modules/ --exclude .git /root/./nativescript-cli /www
[ ! -d /root/./nativescript-ui-listview ] || rsync --relative -az --exclude node_modules/ --exclude .git /root/./nativescript-ui-listview /www
[ ! -d /root/./nativescript-ui-autocomplete ] || rsync --relative -az --exclude node_modules/ --exclude .git /root/./nativescript-ui-autocomplete /www
[ ! -d /root/./nativescript-ui-dataform ] || rsync --relative -az --exclude node_modules/ --exclude .git /root/./nativescript-ui-dataform /www
[ ! -d /root/./nativescript-ui-chart ] || rsync --relative -az --exclude node_modules/ --exclude .git /root/./nativescript-ui-chart /www
[ ! -d /root/./nativescript-ui-calendar ] || rsync --relative -az --exclude node_modules/ --exclude .git /root/./nativescript-ui-calendar /www
[ ! -d /root/./nativescript-ui-gauge ] || rsync --relative -az --exclude node_modules/ --exclude .git /root/./nativescript-ui-gauge /www
[ ! -d /root/./nativescript-ui-sidedrawer ] || rsync --relative -az --exclude node_modules/ --exclude .git /root/./nativescript-ui-sidedrawer /www
[ ! -d /root/./nativescript-ui-samples ] || rsync --relative -az --exclude node_modules/ --exclude .git /root/./nativescript-ui-samples /www
[ ! -d /root/./nativescript-ui-samples-angular ] || rsync --relative -az --exclude node_modules/ --exclude .git /root/./nativescript-ui-samples-angular /www

/www/docs/build/build-docs.sh
/www/docs/build/nginx-setup.sh
Expand Down
23 changes: 4 additions & 19 deletions build/docs-watcher/watchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,9 @@ module.exports.WatcherService = class WatcherService {
distPaths: [`${paths.cliRoot}/./docs-cli`],
buildScript: `${paths.cliRoot}/docs/build-jekyll-md.sh`
}, {
basePath: path.normalize(paths.nsUIListView)
basePath: path.normalize(paths.nsUISamples)
}, {
basePath: path.normalize(paths.nsUIAutoComplete)
}, {
basePath: path.normalize(paths.nsUIDataForm)
}, {
basePath: path.normalize(paths.nsUIChart)
}, {
basePath: path.normalize(paths.nsUICalendar)
}, {
basePath: path.normalize(paths.nsUIGauge)
}, {
basePath: path.normalize(paths.nsUISideDrawer)
basePath: path.normalize(paths.nsUISamplesAngular)
}];
}

Expand All @@ -60,13 +50,8 @@ module.exports.WatcherService = class WatcherService {
`${paths.nativescriptAngularRoot}/bin/dist/**`,
`${paths.sdkExamplesRootNG}/dist/**`,
`${paths.sdkExamplesRootJS}/dist/**`,
`${paths.nsUIListView}/dist/**`,
`${paths.nsUIAutoComplete}/dist/**`,
`${paths.nsUIDataForm}/dist/**`,
`${paths.nsUIChart}/dist/**`,
`${paths.nsUICalendar}/dist/**`,
`${paths.nsUIGauge}/dist/**`,
`${paths.nsUISideDrawer}/dist/**`,
`${paths.nsUISamples}/dist/**`,
`${paths.nsUISamplesAngular}/dist/**`,
"**/node_modules/**",
"**/.*",
"**/.git/**"
Expand Down
41 changes: 0 additions & 41 deletions ns_ui_api-reference/README.md

This file was deleted.

30 changes: 0 additions & 30 deletions ns_ui_api-reference/gulpfile.js

This file was deleted.

11 changes: 0 additions & 11 deletions ns_ui_api-reference/package.json

This file was deleted.

35 changes: 35 additions & 0 deletions ns_ui_docs/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
var gulp = require('gulp');
var typedoc = require('gulp-typedoc');
var run = require('gulp-run-command').default;

gulp.task("snippet-mdinject", run('mdinject --root=./../../nativescript-ui-samples --docsroot=./../docs/ui/professional-ui-components --sourceext=".ts|.js|.xml|.css" --snippettitles="TypeScript|JavaScript|XML|CSS"'));
gulp.task("snippet-mdinject-ng", run('mdinject --root=./../../nativescript-ui-samples-angular --docsroot=./../docs/ui/professional-ui-components --sourceext=".ts|.js|.xml|.css" --snippettitles="TypeScript|JavaScript|XML|CSS"'));

gulp.task("ns-ui-api-ref-build", function () {
return gulp
.src(["./node_modules/nativescript-ui-listview/{index,angular/index,angular/*-directives}.d.ts",
"./node_modules/nativescript-ui-autocomplete/{index,angular/index,angular/*-directives}.d.ts",
"./node_modules/nativescript-ui-dataform/{index,angular/index,angular/*-directives}.d.ts",
"./node_modules/nativescript-ui-chart/{index,angular/index,angular/*-directives}.d.ts",
"./node_modules/nativescript-ui-calendar/{index,angular/index,angular/*-directives}.d.ts",
"./node_modules/nativescript-ui-gauge/{index,angular/index,angular/*-directives}.d.ts",
"./node_modules/nativescript-ui-sidedrawer/{index,angular/index,angular/*-directives}.d.ts"])
.pipe(typedoc({
// TypeScript options (see typescript docs)
module: "commonjs",
mode: "file",
target: "es5",
includeDeclarations: true,
excludeExternals: true,

// Output options (see typedoc docs)
out: "./ns-ui-api-reference",
// TypeDoc options (see typedoc docs)
name: "Progress NativeScript UI API",
ignoreCompilerErrors: true,
theme: "./node_modules/nativescript-typedoc-theme",
readme: "./README.md"
}));
});

gulp.task("default", gulp.series("snippet-mdinject", "snippet-mdinject-ng", "ns-ui-api-ref-build"));
20 changes: 20 additions & 0 deletions ns_ui_docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "nativescript-ui-build-environment",
"version": "1.0.0",
"author": "Progress AD",
"dependencies": {
"gulp": "4.0.0",
"gulp-typedoc": "2.2.1",
"markdown-snippet-injector": "^0.2.2",
"gulp-run-command": "0.0.9",
"nativescript-typedoc-theme": "git://github.com/NativeScript/nativescript-typedoc-theme.git#master",
"typedoc": "0.14.2",
"nativescript-ui-listview":"*",
"nativescript-ui-autocomplete":"*",
"nativescript-ui-dataform":"*",
"nativescript-ui-chart":"*",
"nativescript-ui-calendar":"*",
"nativescript-ui-gauge":"*",
"nativescript-ui-sidedrawer":"*"
}
}

0 comments on commit bad1bbf

Please sign in to comment.