Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dgeni-packages

Package Overview
Dependencies
Maintainers
2
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dgeni-packages - npm Package Compare versions

Comparing version 0.20.0-rc.3 to 0.20.0-rc.4

7

CHANGELOG.md
# Changelog
# 0.20.0-rc.4 13 July 2017
## Bug Fixes
**typescript:** support startingLine and endingLine properties 32698f30
# 0.20.0-rc.3 12 July 2017

@@ -4,0 +11,0 @@

2

package.json
{
"name": "dgeni-packages",
"version": "0.20.0-rc.3",
"version": "0.20.0-rc.4",
"description": "A collection of dgeni packages for generating documentation from source code",

@@ -5,0 +5,0 @@ "scripts": {

@@ -14,2 +14,4 @@ import { Declaration, Symbol } from 'typescript';

fileInfo: FileInfo;
startingLine: number;
endingLine: number;
}

@@ -21,2 +21,4 @@ import { Declaration, Symbol } from 'typescript';

fileInfo: FileInfo;
startingLine: number;
endingLine: number;
originalModule: any;

@@ -23,0 +25,0 @@ content: string;

@@ -21,2 +21,4 @@ "use strict";

this.fileInfo = new FileInfo_1.FileInfo(this.declaration, this.basePath);
this.startingLine = this.fileInfo.location.start.line + (this.fileInfo.location.start.character ? 1 : 0);
this.endingLine = this.fileInfo.location.end.line;
this.originalModule = this.fileInfo.projectRelativePath.replace(new RegExp("\." + this.fileInfo.extension + "$"), "");

@@ -23,0 +25,0 @@ this.content = getContent_1.getContent(this.declaration);

@@ -16,20 +16,22 @@ import { Declaration, Symbol } from 'typescript';

isStatic: boolean;
readonly docType: string;
readonly abstract name: string;
readonly abstract id: string;
readonly abstract aliases: string[];
readonly abstract anchor: string;
readonly path: string;
readonly outputPath: string;
readonly content: string;
readonly fileInfo: FileInfo;
readonly accessibility: string;
readonly decorators: ParsedDecorator[] | undefined;
readonly type: string;
readonly isOptional: boolean;
readonly isGetAccessor: boolean;
readonly isSetAccessor: boolean;
readonly isCallMember: boolean;
readonly isNewMember: boolean;
docType: string;
abstract name: string;
abstract id: string;
abstract aliases: string[];
abstract anchor: string;
path: string;
outputPath: string;
content: string;
fileInfo: FileInfo;
startingLine: number;
endingLine: number;
accessibility: string;
decorators: ParsedDecorator[] | undefined;
type: string;
isOptional: boolean;
isGetAccessor: boolean;
isSetAccessor: boolean;
isCallMember: boolean;
isNewMember: boolean;
constructor(containerDoc: ContainerExportDoc, symbol: Symbol, declaration: Declaration, basePath: string, namespacesToInclude: string[], isStatic: boolean);
}

@@ -23,2 +23,5 @@ "use strict";

this.content = getContent_1.getContent(this.declaration);
this.fileInfo = new FileInfo_1.FileInfo(this.declaration, this.basePath);
this.startingLine = this.fileInfo.location.start.line + (this.fileInfo.location.start.character ? 1 : 0);
this.endingLine = this.fileInfo.location.end.line;
this.accessibility = getAccessibility_1.getAccessibility(this.declaration);

@@ -32,3 +35,2 @@ this.decorators = getDecorators_1.getDecorators(this.declaration);

this.isNewMember = !!(this.symbol.flags & typescript_1.SymbolFlags.Signature && this.symbol.name === '__new');
this.fileInfo = new FileInfo_1.FileInfo(this.declaration, basePath);
}

@@ -35,0 +37,0 @@ return MemberDoc;

@@ -19,7 +19,9 @@ import { Declaration } from 'typescript';

exports: ExportDoc[];
fileInfo: FileInfo;
startingLine: number;
endingLine: number;
path: string;
outputPath: string;
content: string;
fileInfo: FileInfo;
constructor(symbol: ModuleSymbol, basePath: string);
}

@@ -19,2 +19,4 @@ "use strict";

this.fileInfo = new FileInfo_1.FileInfo(this.declaration, this.basePath);
this.startingLine = this.fileInfo.location.start.line + (this.fileInfo.location.start.character ? 1 : 0);
this.endingLine = this.fileInfo.location.end.line;
}

@@ -21,0 +23,0 @@ return ModuleDoc;

@@ -28,2 +28,16 @@ "use strict";

});
it('should extract the starting and ending lines from the comments', function () {
processor.sourceFiles = ['commentContent.ts'];
var docs = [];
processor.$process(docs);
var someClassDoc = docs.find(function (doc) { return doc.name === 'SomeClass'; });
expect(someClassDoc.startingLine).toEqual(0);
expect(someClassDoc.endingLine).toEqual(17);
var fooDoc = docs.find(function (doc) { return doc.name === 'foo'; });
expect(fooDoc.startingLine).toEqual(4);
expect(fooDoc.endingLine).toEqual(9);
var barDoc = docs.find(function (doc) { return doc.name === 'bar'; });
expect(barDoc.startingLine).toEqual(10);
expect(barDoc.endingLine).toEqual(16);
});
it('should provide the original module if the export is re-exported', function () {

@@ -30,0 +44,0 @@ processor.sourceFiles = ['publicModule.ts'];

@@ -16,2 +16,4 @@ import { Declaration, Symbol } from 'typescript';

fileInfo: FileInfo;
startingLine: number;
endingLine: number;
}

@@ -21,2 +21,4 @@ import { Declaration, Symbol } from 'typescript';

fileInfo = new FileInfo(this.declaration, this.basePath);
startingLine = this.fileInfo.location.start.line + (this.fileInfo.location.start.character ? 1 : 0);
endingLine = this.fileInfo.location.end.line;
originalModule = this.fileInfo.projectRelativePath.replace(new RegExp("\." + this.fileInfo.extension + "$"), "");

@@ -23,0 +25,0 @@ content = getContent(this.declaration);

@@ -16,20 +16,22 @@ /* tslint:disable:no-bitwise */

export abstract class MemberDoc implements ApiDoc {
readonly docType = 'member';
readonly abstract name: string;
readonly abstract id: string;
readonly abstract aliases: string[];
readonly abstract anchor: string;
readonly path: string;
readonly outputPath: string;
readonly content = getContent(this.declaration);
readonly fileInfo: FileInfo;
docType = 'member';
abstract name: string;
abstract id: string;
abstract aliases: string[];
abstract anchor: string;
path: string;
outputPath: string;
content = getContent(this.declaration);
fileInfo = new FileInfo(this.declaration, this.basePath);
startingLine = this.fileInfo.location.start.line + (this.fileInfo.location.start.character ? 1 : 0);
endingLine = this.fileInfo.location.end.line;
readonly accessibility = getAccessibility(this.declaration);
readonly decorators = getDecorators(this.declaration);
readonly type = getDeclarationTypeText(this.declaration, this.namespacesToInclude);
readonly isOptional = !!(this.symbol.flags & SymbolFlags.Optional);
readonly isGetAccessor = !!(this.symbol.flags & SymbolFlags.GetAccessor);
readonly isSetAccessor = !!(this.symbol.flags & SymbolFlags.SetAccessor);
readonly isCallMember = !!(this.symbol.flags & SymbolFlags.Signature && this.symbol.name === '__call');
readonly isNewMember = !!(this.symbol.flags & SymbolFlags.Signature && this.symbol.name === '__new');
accessibility = getAccessibility(this.declaration);
decorators = getDecorators(this.declaration);
type = getDeclarationTypeText(this.declaration, this.namespacesToInclude);
isOptional = !!(this.symbol.flags & SymbolFlags.Optional);
isGetAccessor = !!(this.symbol.flags & SymbolFlags.GetAccessor);
isSetAccessor = !!(this.symbol.flags & SymbolFlags.SetAccessor);
isCallMember = !!(this.symbol.flags & SymbolFlags.Signature && this.symbol.name === '__call');
isNewMember = !!(this.symbol.flags & SymbolFlags.Signature && this.symbol.name === '__new');

@@ -43,4 +45,3 @@ constructor(

public isStatic: boolean) {
this.fileInfo = new FileInfo(this.declaration, basePath);
}
}

@@ -19,8 +19,10 @@ import { Declaration } from 'typescript';

exports: ExportDoc[] = [];
fileInfo = new FileInfo(this.declaration, this.basePath);
startingLine = this.fileInfo.location.start.line + (this.fileInfo.location.start.character ? 1 : 0);
endingLine = this.fileInfo.location.end.line;
path: string;
outputPath: string;
content: string;
fileInfo = new FileInfo(this.declaration, this.basePath);
constructor(public symbol: ModuleSymbol, private basePath: string) {}
}

@@ -38,3 +38,19 @@ import {Dgeni, DocCollection} from 'dgeni';

expect(barDoc.content).toEqual('@name bar\n@description\ndescription of bar {@inline-tag} more content');
});
it('should extract the starting and ending lines from the comments', () => {
processor.sourceFiles = [ 'commentContent.ts' ];
const docs: DocCollection = [];
processor.$process(docs);
const someClassDoc = docs.find(doc => doc.name === 'SomeClass') as ClassExportDoc;
expect(someClassDoc.startingLine).toEqual(0);
expect(someClassDoc.endingLine).toEqual(17);
const fooDoc = docs.find(doc => doc.name === 'foo');
expect(fooDoc.startingLine).toEqual(4);
expect(fooDoc.endingLine).toEqual(9);
const barDoc = docs.find(doc => doc.name === 'bar');
expect(barDoc.startingLine).toEqual(10);
expect(barDoc.endingLine).toEqual(16);
});

@@ -41,0 +57,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc