Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
50da9a5ce7 | |||
a2fd6998ee | |||
d5908d4bc6 | |||
a34b77f469 | |||
027b4ca26f | |||
e9b8b3b6d9 | |||
8d2c9e8241 | |||
b78b0ef599 | |||
5a046a7667 | |||
b04f3be3db | |||
d441f5b489 | |||
38f3ccb364 | |||
0c7f50e3cc | |||
7937cc8898 | |||
1a7f33d22b | |||
ea9dfa0e0d | |||
755babdd75 | |||
4fa345d20e | |||
b8678cd808 | |||
4f25981183 | |||
81a5f87eb7 | |||
dd3c4860a0 | |||
4e1721e909 | |||
bd4ad32703 | |||
263f1de538 |
6
.gitignore
vendored
6
.gitignore
vendored
@ -8,13 +8,15 @@ pages/
|
|||||||
# installs
|
# installs
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
# caches and builds
|
# caches
|
||||||
.yarn/
|
.yarn/
|
||||||
.cache/
|
.cache/
|
||||||
|
.rpt2_cache
|
||||||
|
|
||||||
|
# builds
|
||||||
dist/
|
dist/
|
||||||
dist_web/
|
dist_web/
|
||||||
dist_serve/
|
dist_serve/
|
||||||
dist_ts_web/
|
dist_ts_web/
|
||||||
|
|
||||||
# custom
|
# custom
|
||||||
mkdocs/originalrepo
|
|
||||||
|
@ -109,7 +109,7 @@ pages:
|
|||||||
image: hosttoday/ht-docker-node:npmci
|
image: hosttoday/ht-docker-node:npmci
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g typedoc typescript @gitzone/tsdoc
|
- npmci command npm install -g typedoc typescript
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
||||||
|
88
package-lock.json
generated
88
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsdoc",
|
"name": "@gitzone/tsdoc",
|
||||||
"version": "1.0.3",
|
"version": "1.0.16",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -61,19 +61,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@gitzone/tstest": {
|
"@gitzone/tstest": {
|
||||||
"version": "1.0.20",
|
"version": "1.0.22",
|
||||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftstest/-/tstest-1.0.20.tgz",
|
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftstest/-/tstest-1.0.22.tgz",
|
||||||
"integrity": "sha512-nEHRDpmPOns47/LIJQ+y+CJDzjiS17UKJpl7PYok4EgNJJGqJUN5ilz2KVLPDcRd/7JiB7JYKujlf2UgFKadgQ==",
|
"integrity": "sha512-S3Gcyml+Fr4+QYinRcUmedvR8E+MfPik6P7Om4cwI1DyrNvBt0BgCricfxIKrqI8qleY1mtAbJWm8d3BO/ZSww==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@gitzone/tsrun": "^1.2.5",
|
"@gitzone/tsrun": "^1.2.6",
|
||||||
"@pushrocks/consolecolor": "^2.0.1",
|
"@pushrocks/consolecolor": "^2.0.1",
|
||||||
"@pushrocks/smartfile": "^7.0.2",
|
"@pushrocks/smartfile": "^7.0.2",
|
||||||
"@pushrocks/smartlog": "^2.0.19",
|
"@pushrocks/smartlog": "^2.0.19",
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"@pushrocks/smartshell": "^2.0.13",
|
"@pushrocks/smartshell": "^2.0.17",
|
||||||
"@types/figures": "^2.0.0",
|
"@types/figures": "^3.0.1",
|
||||||
"figures": "^2.0.0"
|
"figures": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/consolecolor": {
|
"@pushrocks/consolecolor": {
|
||||||
@ -165,6 +165,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@pushrocks/smartexit": {
|
||||||
|
"version": "1.0.11",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartexit/-/smartexit-1.0.11.tgz",
|
||||||
|
"integrity": "sha512-zQTmmHQFwTC0tta+mcfkA9gVYR0OT9hKtiYGIW5wnOLFc3FxRREfIwuatxI1UwJ+CDCjy9IgNL6WWqZP+2VMeQ==",
|
||||||
|
"requires": {
|
||||||
|
"@pushrocks/lik": "^3.0.5",
|
||||||
|
"@pushrocks/smartdelay": "^2.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@pushrocks/smartfile": {
|
"@pushrocks/smartfile": {
|
||||||
"version": "7.0.2",
|
"version": "7.0.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartfile/-/smartfile-7.0.2.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartfile/-/smartfile-7.0.2.tgz",
|
||||||
@ -268,22 +277,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/smartshell": {
|
"@pushrocks/smartshell": {
|
||||||
"version": "2.0.13",
|
"version": "2.0.20",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartshell/-/smartshell-2.0.13.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartshell/-/smartshell-2.0.20.tgz",
|
||||||
"integrity": "sha512-jLfAhLxMVKAScKdln1QrQqBI7A7INhMNHIq28fJEBi0BNDUS0eerw4yMAnR4CRmcrh4xFp1z+ju1kaPO3I/4MA==",
|
"integrity": "sha512-wA6crDGvEK7s9jTA5hJPjirTYs/1Wbt5zcAp/0AbB9Qxkzj/+alVueBGvD9NrXYhfn5EFeelwS5/Oy4lLm3A7A==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartpromise": "^2.0.5",
|
"@pushrocks/smartexit": "^1.0.11",
|
||||||
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"@types/which": "^1.3.1",
|
"@types/which": "^1.3.1",
|
||||||
"which": "^1.3.1"
|
"which": "^1.3.1"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@pushrocks/smartpromise": {
|
|
||||||
"version": "2.0.5",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz",
|
|
||||||
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g==",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/smarttime": {
|
"@pushrocks/smarttime": {
|
||||||
@ -350,10 +351,13 @@
|
|||||||
"integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g=="
|
"integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g=="
|
||||||
},
|
},
|
||||||
"@types/figures": {
|
"@types/figures": {
|
||||||
"version": "2.0.0",
|
"version": "3.0.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2ffigures/-/figures-2.0.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2ffigures/-/figures-3.0.1.tgz",
|
||||||
"integrity": "sha512-mcRgJ+ncKuNI+Dwac7omO18B8C8u+YBS+AU/oyLhEyjAnT3cUUThhHgZpbiIvu5ZqSvdD30BXtrqg9nxc3OKMg==",
|
"integrity": "sha512-2OXodKWdNhYl+S+wCvlafqJbfMIVDfQZYX2wRyUOcRiEQpeJ9zU6cT7d+RbMpjS+/vmQ2cAUUL8gyGy1YxtLPw==",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"figures": "*"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"@types/form-data": {
|
"@types/form-data": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.1",
|
||||||
@ -415,9 +419,9 @@
|
|||||||
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "12.0.0",
|
"version": "12.0.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.0.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.0.2.tgz",
|
||||||
"integrity": "sha512-Jrb/x3HT4PTJp6a4avhmJCDEVrPdqLfl3e8GGMbpkGGdwAV5UGlIs4vVEfsHHfylZVOKZWpOqmqFH8CbfOZ6kg=="
|
"integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA=="
|
||||||
},
|
},
|
||||||
"@types/shelljs": {
|
"@types/shelljs": {
|
||||||
"version": "0.8.5",
|
"version": "0.8.5",
|
||||||
@ -439,8 +443,7 @@
|
|||||||
"@types/which": {
|
"@types/which": {
|
||||||
"version": "1.3.1",
|
"version": "1.3.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fwhich/-/which-1.3.1.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fwhich/-/which-1.3.1.tgz",
|
||||||
"integrity": "sha512-ZrJDWpvg75LTGX4XwuneY9s6bF3OeZcGTpoGh3zDV9ytzcHMFsRrMIaLBRJZQMBoGyKs6unBQfVdrLZiYfb1zQ==",
|
"integrity": "sha512-ZrJDWpvg75LTGX4XwuneY9s6bF3OeZcGTpoGh3zDV9ytzcHMFsRrMIaLBRJZQMBoGyKs6unBQfVdrLZiYfb1zQ=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"@types/yargs": {
|
"@types/yargs": {
|
||||||
"version": "12.0.12",
|
"version": "12.0.12",
|
||||||
@ -769,9 +772,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"figures": {
|
"figures": {
|
||||||
"version": "2.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/figures/-/figures-2.0.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/figures/-/figures-3.0.0.tgz",
|
||||||
"integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
|
"integrity": "sha512-HKri+WoWoUgr83pehn/SIgLOMZ9nAWC6dcGj26RY2R4F50u4+RTUz0RCrUlOV3nKRAICW1UGzyb+kcX2qK1S/g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"escape-string-regexp": "^1.0.5"
|
"escape-string-regexp": "^1.0.5"
|
||||||
@ -1515,16 +1518,24 @@
|
|||||||
"integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY="
|
"integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY="
|
||||||
},
|
},
|
||||||
"ts-node": {
|
"ts-node": {
|
||||||
"version": "8.1.0",
|
"version": "8.2.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/ts-node/-/ts-node-8.1.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/ts-node/-/ts-node-8.2.0.tgz",
|
||||||
"integrity": "sha512-34jpuOrxDuf+O6iW1JpgTRDFynUZ1iEqtYruBqh35gICNjN8x+LpVcPAcwzLPi9VU6mdA3ym+x233nZmZp445A==",
|
"integrity": "sha512-m8XQwUurkbYqXrKqr3WHCW310utRNvV5OnRVeISeea7LoCWVcdfeB/Ntl8JYWFh+WRoUAdBgESrzKochQt7sMw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"arg": "^4.1.0",
|
"arg": "^4.1.0",
|
||||||
"diff": "^3.1.0",
|
"diff": "^4.0.1",
|
||||||
"make-error": "^1.1.1",
|
"make-error": "^1.1.1",
|
||||||
"source-map-support": "^0.5.6",
|
"source-map-support": "^0.5.6",
|
||||||
"yn": "^3.0.0"
|
"yn": "^3.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"diff": {
|
||||||
|
"version": "4.0.1",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/diff/-/diff-4.0.1.tgz",
|
||||||
|
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tslib": {
|
"tslib": {
|
||||||
@ -1613,8 +1624,7 @@
|
|||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "3.4.5",
|
"version": "3.4.5",
|
||||||
"resolved": "https://verdaccio.lossless.one/typescript/-/typescript-3.4.5.tgz",
|
"resolved": "https://verdaccio.lossless.one/typescript/-/typescript-3.4.5.tgz",
|
||||||
"integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==",
|
"integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"uglify-js": {
|
"uglify-js": {
|
||||||
"version": "3.5.11",
|
"version": "3.5.11",
|
||||||
|
12
package.json
12
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsdoc",
|
"name": "@gitzone/tsdoc",
|
||||||
"version": "1.0.3",
|
"version": "1.0.16",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a tool for better documentation",
|
"description": "a tool for better documentation",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@ -11,16 +11,16 @@
|
|||||||
"tsdoc": "cli.js"
|
"tsdoc": "cli.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/) && node ./cli.ts.js",
|
"test": "(tstest test/) && (node ./cli.ts.js) && rm -rf public/",
|
||||||
"build": "(tsbuild)",
|
"build": "(tsbuild)",
|
||||||
"buildMkdocs": "(cd mkdocs/originalrepo && docker rmi -f mkdocs && docker build -t mkdocs .)",
|
"buildMkdocs": "(cd mkdocs/originalrepo && docker rmi -f mkdocs && docker build -t mkdocs .)",
|
||||||
"format": "(gitzone format)"
|
"format": "(gitzone format)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.0.22",
|
"@gitzone/tsbuild": "^2.0.22",
|
||||||
"@gitzone/tstest": "^1.0.15",
|
"@gitzone/tstest": "^1.0.22",
|
||||||
"@pushrocks/tapbundle": "^3.0.7",
|
"@pushrocks/tapbundle": "^3.0.7",
|
||||||
"@types/node": "^12.0.0",
|
"@types/node": "^12.0.2",
|
||||||
"tslint": "^5.11.0",
|
"tslint": "^5.11.0",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
@ -30,6 +30,8 @@
|
|||||||
"@pushrocks/smartfile": "^7.0.2",
|
"@pushrocks/smartfile": "^7.0.2",
|
||||||
"@pushrocks/smartlog": "^2.0.19",
|
"@pushrocks/smartlog": "^2.0.19",
|
||||||
"@pushrocks/smartlog-destination-local": "^7.0.5",
|
"@pushrocks/smartlog-destination-local": "^7.0.5",
|
||||||
"typedoc": "^0.14.2"
|
"@pushrocks/smartshell": "^2.0.20",
|
||||||
|
"typedoc": "^0.14.2",
|
||||||
|
"typescript": "^3.4.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
26
readme.md
Normal file
26
readme.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# @gitzone/tsdoc
|
||||||
|
a tool for better documentation
|
||||||
|
|
||||||
|
## Availabililty and Links
|
||||||
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@gitzone/tsdoc)
|
||||||
|
* [gitlab.com (source)](https://gitlab.com/gitzone/tsdoc)
|
||||||
|
* [github.com (source mirror)](https://github.com/gitzone/tsdoc)
|
||||||
|
* [docs (typedoc)](https://gitzone.gitlab.io/tsdoc/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
[](https://gitlab.com/gitzone/tsdoc/commits/master)
|
||||||
|
[](https://gitlab.com/gitzone/tsdoc/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/@gitzone/tsdoc)
|
||||||
|
[](https://snyk.io/test/npm/@gitzone/tsdoc)
|
||||||
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
[](https://prettier.io/)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||||
|
|
||||||
|
[](https://maintainedby.lossless.com)
|
@ -0,0 +1,67 @@
|
|||||||
|
import * as plugins from './tsdoc.plugins';
|
||||||
|
import * as paths from './tsdoc.paths';
|
||||||
|
|
||||||
|
export class MkDocs {
|
||||||
|
public smartshellInstance = new plugins.smartshell.Smartshell({
|
||||||
|
executor: 'bash',
|
||||||
|
pathDirectories: [paths.binDir]
|
||||||
|
});
|
||||||
|
|
||||||
|
public static async isMkDocsDir(dirPathArg: string): Promise<boolean> {
|
||||||
|
const result = await plugins.smartfile.fs.fileExists(
|
||||||
|
plugins.path.join(dirPathArg, 'mkdocs.yml')
|
||||||
|
);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async handleCommand(argvArg) {
|
||||||
|
const mkdocsInstance = new MkDocs(paths.cwd);
|
||||||
|
switch (true) {
|
||||||
|
case argvArg.serve:
|
||||||
|
await mkdocsInstance.serve();
|
||||||
|
break;
|
||||||
|
case argvArg.publish:
|
||||||
|
await mkdocsInstance.publish();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
await mkdocsInstance.compile();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Instance
|
||||||
|
public typedocDirectory: string;
|
||||||
|
constructor(dirPathArg) {
|
||||||
|
this.typedocDirectory = dirPathArg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async update() {
|
||||||
|
await this.smartshellInstance.exec(
|
||||||
|
`docker pull registry.gitlab.com/hosttoday/ht-docker-mkdocs`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async compile() {
|
||||||
|
await this.update();
|
||||||
|
await this.smartshellInstance.exec(`rm -rf public/`);
|
||||||
|
await this.smartshellInstance.exec(
|
||||||
|
`docker run --rm -p 8000:8000 -v ${
|
||||||
|
paths.cwd
|
||||||
|
}:/docs registry.gitlab.com/hosttoday/ht-docker-mkdocs build`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async serve() {
|
||||||
|
await this.update();
|
||||||
|
await this.smartshellInstance.exec(
|
||||||
|
`docker run --rm -p 8000:8000 -v ${
|
||||||
|
paths.cwd
|
||||||
|
}:/docs registry.gitlab.com/hosttoday/ht-docker-mkdocs`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async publish() {
|
||||||
|
await this.compile();
|
||||||
|
await this.smartshellInstance.exec(`gitzone commit`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,2 +1,29 @@
|
|||||||
import * as plugins from './tsdoc.plugins';
|
import * as plugins from './tsdoc.plugins';
|
||||||
|
import * as paths from './tsdoc.paths';
|
||||||
|
|
||||||
|
export class TypeDoc {
|
||||||
|
public smartshellInstance = new plugins.smartshell.Smartshell({
|
||||||
|
executor: 'bash',
|
||||||
|
pathDirectories: [paths.binDir]
|
||||||
|
});
|
||||||
|
|
||||||
|
// Static
|
||||||
|
public static async isTypeDocDir(dirPathArg: string): Promise<boolean> {
|
||||||
|
const result = await plugins.smartfile.fs.fileExists(
|
||||||
|
plugins.path.join(dirPathArg, 'mkdocs.yml')
|
||||||
|
);
|
||||||
|
return !result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Instance
|
||||||
|
public typedocDirectory: string;
|
||||||
|
constructor(dirPathArg) {
|
||||||
|
this.typedocDirectory = dirPathArg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async compile() {
|
||||||
|
await this.smartshellInstance.exec(
|
||||||
|
`typedoc --module "commonjs" --target "ES2016" --out public/ ts/`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,14 +1,42 @@
|
|||||||
import * as plugins from './tsdoc.plugins';
|
import * as plugins from './tsdoc.plugins';
|
||||||
|
import * as paths from './tsdoc.paths';
|
||||||
import { logger } from './tsdoc.logging';
|
import { logger } from './tsdoc.logging';
|
||||||
|
|
||||||
|
import { TypeDoc } from './tsdoc.classes.typedoc';
|
||||||
|
import { MkDocs } from './tsdoc.classes.mkdocs';
|
||||||
|
|
||||||
export const run = async () => {
|
export const run = async () => {
|
||||||
const tsdocCli = new plugins.smartcli.Smartcli();
|
const tsdocCli = new plugins.smartcli.Smartcli();
|
||||||
tsdocCli.addCommand('typedoc').subscribe(async argvArg => {});
|
tsdocCli.addCommand('typedoc').subscribe(async argvArg => {
|
||||||
|
const typeDocInstance = new TypeDoc(paths.cwd);
|
||||||
|
await typeDocInstance.compile();
|
||||||
|
});
|
||||||
|
|
||||||
tsdocCli.addCommand('mkdocs').subscribe(async argvArg => {});
|
tsdocCli.addCommand('mkdocs').subscribe(async argvArg => {
|
||||||
|
await MkDocs.handleCommand(argvArg);
|
||||||
|
});
|
||||||
|
|
||||||
tsdocCli.standardTask().subscribe(async argvArg => {
|
tsdocCli.standardTask().subscribe(async argvArg => {
|
||||||
logger.log('warn', `Auto detecting environment!`);
|
logger.log('warn', `Auto detecting environment!`);
|
||||||
|
switch (true) {
|
||||||
|
case await TypeDoc.isTypeDocDir(paths.cwd):
|
||||||
|
logger.log('ok', `Detected TypeDoc compliant directory at ${paths.cwd}`);
|
||||||
|
tsdocCli.trigger('typedoc');
|
||||||
|
break;
|
||||||
|
case await MkDocs.isMkDocsDir(paths.cwd):
|
||||||
|
logger.log('ok', `Detected MkDocs compliant directory at ${paths.cwd}`);
|
||||||
|
tsdocCli.trigger('mkdocs');
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
logger.log('error', `Cannot determine docs format at ${paths.cwd}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
tsdocCli.addCommand('test').subscribe(argvArg => {
|
||||||
|
tsdocCli.trigger('typedoc');
|
||||||
|
process.on('exit', async () => {
|
||||||
|
await plugins.smartfile.fs.remove(paths.publicDir);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
tsdocCli.startParse();
|
tsdocCli.startParse();
|
||||||
|
6
ts/tsdoc.paths.ts
Normal file
6
ts/tsdoc.paths.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import * as plugins from './tsdoc.plugins';
|
||||||
|
|
||||||
|
export const packageDir = plugins.path.join(__dirname, '../');
|
||||||
|
export const cwd = process.cwd();
|
||||||
|
export const binDir = plugins.path.join(packageDir, './node_modules/.bin');
|
||||||
|
export const publicDir = plugins.path.join(packageDir, './public');
|
@ -1,17 +1,18 @@
|
|||||||
|
// node native
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
export { path };
|
||||||
|
|
||||||
// pushrocks scope
|
// pushrocks scope
|
||||||
import * as smartcli from '@pushrocks/smartcli';
|
import * as smartcli from '@pushrocks/smartcli';
|
||||||
|
import * as smartfile from '@pushrocks/smartfile';
|
||||||
import * as smartlog from '@pushrocks/smartlog';
|
import * as smartlog from '@pushrocks/smartlog';
|
||||||
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
|
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
|
||||||
|
import * as smartshell from '@pushrocks/smartshell';
|
||||||
|
|
||||||
export {
|
export { smartcli, smartfile, smartlog, smartlogDestinationLocal, smartshell };
|
||||||
smartcli,
|
|
||||||
smartlog,
|
|
||||||
smartlogDestinationLocal
|
|
||||||
};
|
|
||||||
|
|
||||||
// third party scope
|
// third party scope
|
||||||
import * as typedoc from 'typedoc';
|
import * as typedoc from 'typedoc';
|
||||||
|
|
||||||
export {
|
export { typedoc };
|
||||||
typedoc
|
|
||||||
};
|
|
||||||
|
Reference in New Issue
Block a user