feat: upgrading dependencies and add strict compile (#71) · buehler/node-typescript-parser@b96650f

File tree

15 files changed

lines changed

    • declaration-index/specific-cases/reindex-with-global-module/__snapshots__

15 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -7,6 +7,7 @@ matrix:

77
88

environment:

99

matrix:

10+

- nodejs_version: "10"

1011

- nodejs_version: "9"

1112

- nodejs_version: "8"

1213
Original file line numberDiff line numberDiff line change

@@ -14,6 +14,11 @@ notifications:

1414
1515

jobs:

1616

include:

17+

- stage: test

18+

node_js: '10'

19+

after_success:

20+

- npm i -g codecov

21+

- codecov

1722

- stage: test

1823

node_js: '9'

1924

after_success:

@@ -25,14 +30,14 @@ jobs:

2530

- npm i -g codecov

2631

- codecov

2732

- stage: deploy

28-

node_js: '9'

33+

node_js: '10'

2934

script: npm run typedoc

3035

deploy:

3136

provider: pages

3237

skip_cleanup: true

3338

github_token: $GH_TOKEN

3439

local_dir: ./docs

3540

- stage: deploy

36-

node_js: '9'

41+

node_js: '10'

3742

before_script: npm run build

3843

script: npm run semantic-release

Original file line numberDiff line numberDiff line change

@@ -9,7 +9,7 @@

99

"declaration": true,

1010

"sourceMap": false,

1111

"importHelpers": true,

12-

"strictNullChecks": true,

12+

"strict": true,

1313

"experimentalDecorators": true,

1414

"emitDecoratorMetadata": true,

1515

"noUnusedLocals": true,

Original file line numberDiff line numberDiff line change

@@ -36,23 +36,23 @@

3636

"homepage": "https://github.com/TypeScript-Heroes/node-typescript-parser#readme",

3737

"devDependencies": {

3838

"@smartive/tslint-config": "^3.0.1",

39-

"@types/jest": "^22.2.2",

39+

"@types/jest": "^23.1.2",

4040

"@types/lodash-es": "^4.17.0",

4141

"@types/mock-fs": "^3.6.30",

42-

"@types/node": "^9.6.2",

42+

"@types/node": "^10.3.6",

4343

"del-cli": "^1.1.0",

44-

"jest": "^22.4.3",

45-

"mock-fs": "^4.4.2",

46-

"semantic-release": "^15.1.5",

47-

"ts-jest": "^22.4.2",

48-

"tslint": "^5.9.1",

49-

"tsutils": "^2.26.0",

44+

"jest": "^23.2.0",

45+

"mock-fs": "^4.5.0",

46+

"semantic-release": "^15.6.0",

47+

"ts-jest": "^22.4.6",

48+

"tslint": "^5.10.0",

49+

"tsutils": "^2.27.1",

5050

"typedoc": "^0.11.1"

5151

},

5252

"dependencies": {

53-

"lodash": "^4.17.5",

54-

"lodash-es": "^4.17.8",

55-

"tslib": "^1.9.0",

56-

"typescript": "^2.8.1"

53+

"lodash": "^4.17.10",

54+

"lodash-es": "^4.17.10",

55+

"tslib": "^1.9.3",

56+

"typescript": "^2.9.2"

5757

}

5858

}

Original file line numberDiff line numberDiff line change

@@ -490,6 +490,9 @@ export class DeclarationIndex {

490490

): void {

491491

exportedLib.declarations

492492

.forEach((o) => {

493+

if (!tsExport.specifiers) {

494+

return;

495+

}

493496

const ex = tsExport.specifiers.find(s => s.specifier === o.name);

494497

if (!ex) {

495498

return;

Original file line numberDiff line numberDiff line change

@@ -39,7 +39,7 @@ export type Generators = { [name: string]: (generatable: Generatable, options: T

3939

* Hash with all possible (yet implemented) generators.

4040

*/

4141

export const GENERATORS: Generators = {

42-

[SymbolSpecifier.name]: generateSymbolSpecifier,

42+

[SymbolSpecifier.name]: generateSymbolSpecifier as any,

4343

[MethodDeclaration.name]: generateMethodDeclaration,

4444

[ParameterDeclaration.name]: generateParameterDeclaration,

4545

[PropertyDeclaration.name]: generatePropertyDeclaration,

Original file line numberDiff line numberDiff line change

@@ -14,7 +14,7 @@ import { PropertyDeclaration } from './PropertyDeclaration';

1414

* @implements {GenericDeclaration}

1515

*/

1616

export class ClassDeclaration implements ClassLikeDeclaration, ExportableDeclaration, GenericDeclaration {

17-

public ctor: ConstructorDeclaration;

17+

public ctor: ConstructorDeclaration | undefined;

1818

public accessors: AccessorDeclaration[] = [];

1919

public properties: PropertyDeclaration[] = [];

2020

public methods: MethodDeclaration[] = [];

Original file line numberDiff line numberDiff line change

@@ -5,19 +5,19 @@ import { Declaration, ExportableDeclaration } from './Declaration';

55

* Default declaration. Is used when a file exports something as its default.

66

* Primary use is to ask the user about a name for the default export.

77

* Is kind of an abstract declaration since there is no real declaration.

8-

*

8+

*

99

* @export

1010

* @class DefaultDeclaration

1111

* @implements {ExportableDeclaration}

1212

*/

1313

export class DefaultDeclaration implements ExportableDeclaration {

1414

public readonly isExported: boolean = true;

1515
16-

private exported: Declaration;

16+

private exported: Declaration | undefined;

1717
1818

public get exportedDeclaration(): Declaration {

1919

if (!this.exported) {

20-

this.exported = this.resource.declarations.find(o => o.name === this.name) !;

20+

this.exported = this.resource.declarations.find(o => o.name === this.name)!;

2121

}

2222
2323

return this.exported;

Original file line numberDiff line numberDiff line change

@@ -12,7 +12,7 @@ import { PropertyDeclaration } from './PropertyDeclaration';

1212

* @implements {GenericDeclaration}

1313

*/

1414

export class InterfaceDeclaration implements ClassLikeDeclaration, ExportableDeclaration, GenericDeclaration {

15-

public accessors: AccessorDeclaration[];

15+

public accessors: AccessorDeclaration[] = [];

1616

public typeParameters: string[] | undefined;

1717

public properties: PropertyDeclaration[] = [];

1818

public methods: MethodDeclaration[] = [];

Original file line numberDiff line numberDiff line change

@@ -3,13 +3,13 @@ import { Export } from './Export';

33
44

/**

55

* Declares a named export (i.e. export { Foobar } from ...).

6-

*

6+

*

77

* @export

88

* @class NamedExport

99

* @implements {Export}

1010

*/

1111

export class NamedExport implements Export {

12-

public specifiers: SymbolSpecifier[];

12+

public specifiers: SymbolSpecifier[] | undefined;

1313
1414

constructor(public start: number, public end: number, public from: string) { }

1515

}