Skip to content

Commit

Permalink
Merge pull request #38 from SimplrJS/dev
Browse files Browse the repository at this point in the history
v0.2.0
  • Loading branch information
Martynas Žilinskas authored Feb 1, 2018
2 parents 7a30161 + abd21be commit 62b555c
Show file tree
Hide file tree
Showing 29 changed files with 320 additions and 323 deletions.
46 changes: 23 additions & 23 deletions common/config/rush/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion packages/ts-docs-gen/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
"**/CVS": true,
"**/.DS_Store": true,
"tests/cases/__tests__/**/*.test.ts": true
}
},
"editor.insertSpaces": true,
"editor.tabSize": 4,
"editor.detectIndentation": false
}
24 changes: 16 additions & 8 deletions packages/ts-docs-gen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ ts-docs-gen -h
#### Without config

If you want to use `ts-docs-gen` without config file, `entryFile` flag is required.
```
```sh
ts-docs-gen --entryFile ./src/index.ts
```

Multiple entry files:
```
```sh
ts-docs-gen --entryFile ./src/index.ts --entryFile ./src/internal.ts
# Or
ts-docs-gen --entryFile ./src/index.ts ./src/internal.ts
```

#### With config
Expand All @@ -37,9 +39,15 @@ ts-docs-gen --config ./docs-gen.json
## Configuration
JSON config properties and CLI flags.

| Property | CLI Flag | Required | Type | Default | Description |
|-------------|-------------------|------------|----------|---------------------------|--------------------------------------------|
| `entryFile` | `--entryFile` | _required_ | string[] | | TypeScript project entry files. |
| `project` | `--project`, `-p` | _optional_ | string | Current working directory | Full path to TypeScript project directory. |
| `output` | `--output`, `-o` | _optional_ | string | ./docs/api/ | Documentation output directory. |
| `plugin` | `--plugin` | _optional_ | string[] | | Packagename or path to plugin. |
| Property | CLI Flag | Required | Type | Default | Description |
| ------------------- | --------------------- | ---------- | ----------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------ |
| | `--config` | _optional_ | string | | Relative path to config json file. |
| `entryFile` | `--entryFile` | _required_ | string[] | | TypeScript project entry files. |
| `project` | `--project`, `-p` | _optional_ | string | cwd | Full path to TypeScript project directory. |
| `output` | `--output`, `-o` | _optional_ | string | ./docs/api/ | Documentation output directory. |
| `plugin` | `--plugin` | _optional_ | string[] | | Package name or path to plugin. |
| `exclude` | `--exclude` | _optional_ | string[] | | File locations that should not be included generated documentation. |
| `externalPackage` | `--externalPackage` | _optional_ | string[] | | External package names to include in extracted data. |
| `excludePrivateApi` | `--excludePrivateApi` | _optional_ | boolean | `true` | Excludes api items that has access modifier set to "private" or JSDoc tag "@private". |
| `verbosity` | `--verbosity` | _optional_ | "None", "Critical", "Error", "Warning", "Information", "Debug", "Trace" | "Information" | Verbosity of output. |
| `dryRun` | `--dryRun` | _optional_ | boolean | | Generates markdown files but not writes them. Outputs generated data in `Debug` log level. |
134 changes: 74 additions & 60 deletions packages/ts-docs-gen/package.json
Original file line number Diff line number Diff line change
@@ -1,66 +1,80 @@
{
"name": "ts-docs-gen",
"version": "0.1.0",
"description": "Generating documentation for TypeScript code",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"scripts": {
"pretest": "npm run build -- --noEmit && npm run build-tests",
"test": "npm run tslint && jest && echo All tests passed successfully.",
"test-ci": "npm run pretest && npm run tslint && jest --maxWorkers=4 -b",
"test-watch": "start npm run build-tests -- --watchAll && jest --watchAll",
"tslint": "tslint --project . --config ./tslint.json && echo Successfully passed tslint test.",
"build": "tsc -p .",
"build-tests": "test-generator-cli"
},
"engine": "node >= 7.5.0",
"author": "simplrjs <simplr@quatrodev.com> (https://github.com/simplrjs)",
"dependencies": {
"@simplrjs/markdown": "^1.1.0",
"@types/fs-extra": "^5.0.0",
"@types/yargs": "^10.0.1",
"fs-extra": "^5.0.0",
"simplr-logger": "^1.0.1",
"ts-extractor": "^4.0.0-rc.1",
"typescript": "^2.6.2",
"yargs": "^11.0.0"
},
"devDependencies": {
"@simplrjs/test-generator-cli": "^0.1.3",
"@types/jest": "^22.1.1",
"@types/sinon": "^4.1.3",
"jest": "^22.1.4",
"simplr-tslint": "0.0.1",
"sinon": "^4.2.2",
"ts-jest": "^22.0.2",
"tslint": "^5.9.1"
},
"bin": "./dist/cli/launcher.js",
"jest": {
"collectCoverage": true,
"mapCoverage": true,
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
"name": "ts-docs-gen",
"version": "0.2.0",
"description": "Generating documentation for TypeScript code",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"scripts": {
"pretest": "npm run build -- --noEmit && npm run build-tests",
"test": "npm run tslint && jest && echo All tests passed successfully.",
"test-ci": "npm run pretest && npm run tslint && jest --maxWorkers=4 -b",
"test-watch": "start npm run build-tests -- --watchAll && jest --watchAll",
"tslint": "tslint --project . --config ./tslint.json && echo Successfully passed tslint test.",
"build": "tsc -p .",
"build-tests": "test-generator-cli"
},
"globals": {
"ts-jest": {
"skipBabel": true,
"tsConfigFile": "tests/tsconfig.json"
}
"engine": "node >= 7.5.0",
"author": "simplrjs <simplr@quatrodev.com> (https://github.com/simplrjs)",
"contributors": [
"Martynas Žilinskas <martynas@quatrodev.com> (https://github.com/MartynasZilinskas)",
"Deividas Bakanas <deividas@quatrodev.com> (https://github.com/DeividasBakanas)"
],
"repository": {
"type": "git",
"url": "https://github.com/SimplrJS/ts-docs-gen"
},
"testRegex": "/__tests__/.*\\.(test|spec).(ts|tsx|js)$",
"moduleNameMapper": {
"@src/(.*)": "<rootDir>/src/$1"
"dependencies": {
"@simplrjs/markdown": "^1.1.0",
"@types/fs-extra": "^5.0.0",
"@types/yargs": "^10.0.1",
"fs-extra": "^5.0.0",
"simplr-logger": "^1.0.1",
"ts-extractor": "^4.0.0-rc.4",
"typescript": "^2.7.1",
"yargs": "^11.0.0"
},
"coveragePathIgnorePatterns": [
"/node_modules/",
"/tests/"
],
"moduleFileExtensions": [
"ts",
"tsx",
"js"
"devDependencies": {
"@simplrjs/test-generator-cli": "^0.1.3",
"@types/jest": "^22.1.1",
"@types/sinon": "^4.1.3",
"jest": "^22.1.4",
"simplr-tslint": "0.0.1",
"sinon": "^4.2.2",
"ts-jest": "^22.0.2",
"tslint": "^5.9.1"
},
"bin": "./dist/cli/launcher.js",
"files": [
"dist",
"**/*.md",
"@types",
"!/examples"
],
"verbose": true
}
"jest": {
"collectCoverage": true,
"mapCoverage": true,
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"globals": {
"ts-jest": {
"skipBabel": true,
"tsConfigFile": "tests/tsconfig.json"
}
},
"testRegex": "/__tests__/.*\\.(test|spec).(ts|tsx|js)$",
"moduleNameMapper": {
"@src/(.*)": "<rootDir>/src/$1"
},
"coveragePathIgnorePatterns": [
"/node_modules/",
"/tests/"
],
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"verbose": true
}
}
4 changes: 2 additions & 2 deletions packages/ts-docs-gen/src/api-items/api-callable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ReferenceRenderHandler } from "../contracts/serialized-api-item";
* Base class for callable api items.
*/
export abstract class ApiCallable<TKind extends Contracts.ApiCallableBaseDefinition> extends ApiDefinitionBase<TKind> {
private parameters: ApiParameter[];
private parameters: ApiParameter[] | undefined;

public get Parameters(): ApiParameter[] {
if (this.parameters == null) {
Expand All @@ -23,7 +23,7 @@ export abstract class ApiCallable<TKind extends Contracts.ApiCallableBaseDefinit
return this.parameters;
}

private typeParameters: ApiTypeParameter[];
private typeParameters: ApiTypeParameter[] | undefined;

public get TypeParameters(): ApiTypeParameter[] {
if (this.typeParameters == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type ApiBaseItemContainerDto = Contracts.ApiBaseDefinition & { Members: C
export abstract class ApiDefinitionContainer<TKind extends ApiBaseItemContainerDto = ApiBaseItemContainerDto>
extends ApiDefinitionBase<TKind> {

private members: ApiDefinitions[];
private members: ApiDefinitions[] | undefined;

public get Members(): ApiDefinitions[] {
if (this.members == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type ApiBaseItemWithTypeDto = Contracts.ApiBaseDefinition & { Type: Contr
export abstract class ApiDefinitionWithType<TKind extends ApiBaseItemWithTypeDto = ApiBaseItemWithTypeDto>
extends ApiDefinitionBase<TKind> {

private type: ApiTypes;
private type: ApiTypes | undefined;

public get Type(): ApiTypes {
if (this.type == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { GeneratorHelpers } from "../generator-helpers";
import { ApiTypes } from "./api-type-list";

export abstract class ApiTypeMembersBase<TKind extends Contracts.ApiMembersBaseType> extends ApiTypeBase<TKind> {
private members: ApiTypes[];
private members: ApiTypes[] | undefined;

public get Members(): ApiTypes[] {
if (this.members == null) {
Expand Down
4 changes: 2 additions & 2 deletions packages/ts-docs-gen/src/api-items/definitions/api-class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ApiTypeParameter } from "./api-type-parameter";
import { ReferenceRenderHandler } from "../../contracts/serialized-api-item";

export class ApiClass extends ApiDefinitionContainer<Contracts.ApiClassDto> {
private typeParameters: ApiTypeParameter[];
private typeParameters: ApiTypeParameter[] | undefined;

public get TypeParameters(): ApiTypeParameter[] {
if (this.typeParameters == null) {
Expand All @@ -23,7 +23,7 @@ export class ApiClass extends ApiDefinitionContainer<Contracts.ApiClassDto> {
return this.extends;
}

private implements: ApiTypes[];
private implements: ApiTypes[] | undefined;

public get Implements(): ApiTypes[] {
if (this.implements == null) {
Expand Down
2 changes: 1 addition & 1 deletion packages/ts-docs-gen/src/api-items/definitions/api-enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ApiItemReference } from "../../contracts/api-item-reference";
import { ReferenceRenderHandler } from "../../contracts/serialized-api-item";

export class ApiEnum extends ApiDefinitionBase<Contracts.ApiEnumDto> {
private enumMembers: ApiEnumMember[];
private enumMembers: ApiEnumMember[] | undefined;

public get EnumMembers(): ApiEnumMember[] {
if (this.enumMembers == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ApiDefinitionWithType } from "../api-definition-with-type";
import { ReferenceRenderHandler } from "../../contracts/serialized-api-item";

export class ApiIndex extends ApiDefinitionWithType<Contracts.ApiIndexDto> {
private parameter: ApiParameter;
private parameter: ApiParameter | undefined;

public get Parameter(): ApiParameter {
if (this.parameter == null) {
Expand Down
Loading

0 comments on commit 62b555c

Please sign in to comment.