Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

dgeni-packages

Package Overview
Dependencies
118
Maintainers
2
Versions
147
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.20.0-rc.6 to 0.20.0

62

CHANGELOG.md
# Changelog
# 0.20.0 27 July 2017
This is the full release of 0.20.0 - the list of changes below includes all the beta and release candidate changes.
## Features
- **base:** allow checkAnchorLinks to abort processing eee3e7b1
- **typescript:**
- group function/method overloads together 2155b5ac
- provide isCallMember and isNewMember options
- split out heritage into extendsClauses and implementsClauses
- add `realFilePath`/`realProjectRelativePath` to `FileInfo` c7d1b54c
## Performance Improvements
- **nunjucks:** upgrade to v3 and enable caching of templates
## Bug Fixes
- **ngdoc:** pass doc object to createDocMessage fe98a849 Nick Horvath
- **typescript:**
- add type parameters to function export docs c2c29270
- remove duplicate overload from abstract API doc members f2c481d1
- support startingLine and endingLine properties 32698f30
- include specified namespaces in types dbe99f7b
- allow decorators to not be call expressions e41a392a
- implement the CompilerHost.readFile method 4d667ff2
- CustomCompilerHost.fileExists should not second guess extensions and base dir b7b11164
- compile files in folders that have file-like names ee10b835
- paths should be case sensitive 5238302b
- compile files in folders that have file-like names
- paths to imports are case sensitive
- group overloaded exported functions in a single doc
- do not assume that members prefixed with `_` are private
- **base:** checkAnchorLinks should match URL encoded chars
## Breaking Changes
Previously to 0.20.0 the service where you registered namespaces not to strip
was called `ignoreTypeScriptNamespaces` and took an array of regular expressions.
Now this service is called `namespacesToInclude`, which better reflects its
purpose. Also it is now an array of strings, since there was little benefit in it
being a regular expression.
<hr>
The typescript package has been completely rewritten in TypeScript. One benefit of this is that
typings should be available for the API doc types in your own projects.
Along the way there are some changes to the properties that are attached to the API docs that are
generated. Here is a list of the things that might affect you:
* Members starting with `_` are no longer considered private. You should filter them out in a
custom processor if you do not want them to appear in the docs.
* API docs that have a type, e.g. functions, constants, type aliases, etc used to have a property called
`returnType` but that did not make sense for non-functions. This property is renamed to `type`.
* API docs that have heritage, e.g. classes and interfaces, used to have a property called `heritage`,
which was a string representation containing both "implements" and "extends" clauses. These have now
been split into two properties `implementsClauses` and `extendsClauses`, which each contain an array
of strings.
# 0.20.0-rc.6 14 July 2017

@@ -4,0 +66,0 @@

5

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

@@ -111,4 +111,5 @@ "scripts": {

"Hagen Schulze <hagen.schulze@nextlabel.de>",
"Nick Horvath <nhorvath@gmail.com>"
"Nick Horvath <nhorvath@gmail.com>",
"Georgios Kalpakas <kalpakas.g@gmail.com>"
]
}

8

README.md

@@ -62,5 +62,5 @@ # Dgeni Packages

'${ doc.template }',
'${doc.area}/${ doc.id }.${ doc.docType }.template.html',
'${doc.area}/${ doc.id }.template.html',
'${doc.area}/${ doc.docType }.template.html',
'${ doc.area }/${ doc.id }.${ doc.docType }.template.html',
'${ doc.area }/${ doc.id }.template.html',
'${ doc.area }/${ doc.docType }.template.html',
'${ doc.id }.${ doc.docType }.template.html',

@@ -209,3 +209,3 @@ '${ doc.id }.template.html',

## File Readers
### File Readers

@@ -212,0 +212,0 @@ * `ngdoc` - can pull a single document from an ngdoc content file.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ClassExportDoc_1 = require("../api-doc-types/ClassExportDoc");
var FileInfo_1 = require("./TsParser/FileInfo");
var convertPrivateClassesToInterfaces_1 = require("./convertPrivateClassesToInterfaces");

@@ -17,2 +18,3 @@ describe('convertPrivateClassesToInterfaces', function () {

beforeEach(function () {
spyOn(FileInfo_1.FileInfo.prototype, 'getRealFilePath').and.callFake(function (filePath) { return filePath; });
classDoc = new ClassExportDoc_1.ClassExportDoc(moduleDoc, classSymbol, basePath, true, []);

@@ -19,0 +21,0 @@ classDoc.constructorDoc = { internal: true };

@@ -15,3 +15,6 @@ import { Declaration } from 'typescript';

projectRelativePath: any;
realFilePath: string;
realProjectRelativePath: any;
constructor(declaration: Declaration, basePath: string);
getRealFilePath(filePath: string): string;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Location_1 = require("./Location");
var fs_1 = require("fs");
var path = require('canonical-path');

@@ -18,3 +19,8 @@ /**

this.projectRelativePath = path.relative(this.basePath, this.filePath);
this.realFilePath = this.getRealFilePath(this.filePath);
this.realProjectRelativePath = path.relative(this.basePath, this.realFilePath);
}
FileInfo.prototype.getRealFilePath = function (filePath) {
return fs_1.realpathSync(filePath).replace(RegExp('\\' + path.sep, 'g'), '/');
};
return FileInfo;

@@ -21,0 +27,0 @@ }());

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

var FileInfo_1 = require("./FileInfo");
var fs = require('fs');
var path = require('canonical-path');

@@ -11,2 +12,3 @@ describe('FileInfo', function () {

beforeEach(function () {
spyOn(fs, 'realpathSync').and.callFake(function (filePath) { return filePath + '.real'; });
parser = new _1.TsParser(require('dgeni/lib/mocks/log')(false));

@@ -19,27 +21,56 @@ basePath = path.resolve(__dirname, '../../mocks');

var fileInfo1 = new FileInfo_1.FileInfo(module.exportArray[0].declarations[0], basePath);
expect(fileInfo1.baseName).toEqual('testSrc');
expect(fileInfo1.basePath).toEqual(basePath);
expect(fileInfo1.extension).toEqual('ts');
expect(fileInfo1.filePath).toEqual(basePath + '/tsParser/testSrc.ts');
expect(fileInfo1.baseName).toBe('testSrc');
expect(fileInfo1.basePath).toBe(basePath);
expect(fileInfo1.extension).toBe('ts');
expect(fileInfo1.filePath).toBe(basePath + '/tsParser/testSrc.ts');
expect(fileInfo1.location).toEqual(jasmine.objectContaining({ start: { line: 6, character: 30 }, end: { line: 28, character: 1 } }));
expect(fileInfo1.projectRelativePath).toEqual('tsParser/testSrc.ts');
expect(fileInfo1.relativePath).toEqual('tsParser/testSrc.ts');
expect(fileInfo1.projectRelativePath).toBe('tsParser/testSrc.ts');
expect(fileInfo1.realFilePath).toBe(fileInfo1.filePath + '.real');
expect(fileInfo1.realProjectRelativePath).toBe('tsParser/testSrc.ts.real');
expect(fileInfo1.relativePath).toBe('tsParser/testSrc.ts');
var fileInfo2 = new FileInfo_1.FileInfo(module.exportArray[1].declarations[0], basePath);
expect(fileInfo2.baseName).toEqual('testSrc');
expect(fileInfo2.basePath).toEqual(basePath);
expect(fileInfo2.extension).toEqual('ts');
expect(fileInfo2.filePath).toEqual(basePath + '/tsParser/testSrc.ts');
expect(fileInfo2.baseName).toBe('testSrc');
expect(fileInfo2.basePath).toBe(basePath);
expect(fileInfo2.extension).toBe('ts');
expect(fileInfo2.filePath).toBe(basePath + '/tsParser/testSrc.ts');
expect(fileInfo2.location).toEqual(jasmine.objectContaining({ start: { line: 33, character: 10 }, end: { line: 33, character: 42 } }));
expect(fileInfo2.projectRelativePath).toEqual('tsParser/testSrc.ts');
expect(fileInfo2.relativePath).toEqual('tsParser/testSrc.ts');
expect(fileInfo2.projectRelativePath).toBe('tsParser/testSrc.ts');
expect(fileInfo2.realFilePath).toBe(fileInfo2.filePath + '.real');
expect(fileInfo2.realProjectRelativePath).toBe('tsParser/testSrc.ts.real');
expect(fileInfo2.relativePath).toBe('tsParser/testSrc.ts');
var fileInfo3 = new FileInfo_1.FileInfo(module.exportArray[2].declarations[0], basePath);
expect(fileInfo3.baseName).toEqual('importedSrc');
expect(fileInfo3.basePath).toEqual(basePath);
expect(fileInfo3.extension).toEqual('ts');
expect(fileInfo3.filePath).toEqual(basePath + '/tsParser/importedSrc.ts');
expect(fileInfo3.baseName).toBe('importedSrc');
expect(fileInfo3.basePath).toBe(basePath);
expect(fileInfo3.extension).toBe('ts');
expect(fileInfo3.filePath).toBe(basePath + '/tsParser/importedSrc.ts');
expect(fileInfo3.location).toEqual(jasmine.objectContaining({ start: { line: 2, character: 12 }, end: { line: 2, character: 20 } }));
expect(fileInfo3.projectRelativePath).toEqual('tsParser/importedSrc.ts');
expect(fileInfo3.relativePath).toEqual('tsParser/importedSrc.ts');
expect(fileInfo3.projectRelativePath).toBe('tsParser/importedSrc.ts');
expect(fileInfo3.realFilePath).toBe(fileInfo3.filePath + '.real');
expect(fileInfo3.realProjectRelativePath).toBe('tsParser/importedSrc.ts.real');
expect(fileInfo3.relativePath).toBe('tsParser/importedSrc.ts');
});
describe('getRealFilePath()', function () {
var originalPathSep = path.sep;
afterEach(function () { return path.sep = originalPathSep; });
it('should call `fs.realpathSync()`', function () {
var parseInfo = parser.parse(['tsParser/testSrc.ts'], basePath);
var module = parseInfo.moduleSymbols[0];
var fileInfo = new FileInfo_1.FileInfo(module.exportArray[0].declarations[0], basePath);
expect(fs.realpathSync).toHaveBeenCalledWith(fileInfo.filePath);
});
it('should normalize path separators to `/`', function () {
var parseInfo = parser.parse(['tsParser/testSrc.ts'], basePath);
var module = parseInfo.moduleSymbols[0];
var fileInfo;
path.sep = '\\';
fs.realpathSync.and.returnValue('C:\\Foo\\bar.ts');
fileInfo = new FileInfo_1.FileInfo(module.exportArray[0].declarations[0], basePath);
expect(fileInfo.realFilePath).toBe('C:/Foo/bar.ts');
path.sep = '/';
fs.realpathSync.and.returnValue('/Foo/bar.ts');
fileInfo = new FileInfo_1.FileInfo(module.exportArray[0].declarations[0], basePath);
expect(fileInfo.realFilePath).toBe('/Foo/bar.ts');
});
});
});
//# sourceMappingURL=FileInfo.spec.js.map
import { DocCollection } from 'dgeni';
import { ClassExportDoc } from '../api-doc-types/ClassExportDoc';
import { FileInfo } from './TsParser/FileInfo';
import { convertPrivateClassesToInterfaces } from './convertPrivateClassesToInterfaces';

@@ -19,2 +20,4 @@

beforeEach(() => {
spyOn(FileInfo.prototype, 'getRealFilePath').and.callFake((filePath: string) => filePath);
classDoc = new ClassExportDoc(moduleDoc, classSymbol, basePath, true, []);

@@ -21,0 +24,0 @@ classDoc.constructorDoc = { internal: true } as any;

import { TsParser } from '.';
import { FileInfo } from './FileInfo';
const fs = require('fs');
const path = require('canonical-path');

@@ -9,2 +10,4 @@

beforeEach(() => {
spyOn(fs, 'realpathSync').and.callFake((filePath: string) => filePath + '.real');
parser = new TsParser(require('dgeni/lib/mocks/log')(false));

@@ -19,28 +22,65 @@ basePath = path.resolve(__dirname, '../../mocks');

const fileInfo1 = new FileInfo(module.exportArray[0].declarations![0], basePath);
expect(fileInfo1.baseName).toEqual('testSrc');
expect(fileInfo1.basePath).toEqual(basePath);
expect(fileInfo1.extension).toEqual('ts');
expect(fileInfo1.filePath).toEqual(basePath + '/tsParser/testSrc.ts');
expect(fileInfo1.baseName).toBe('testSrc');
expect(fileInfo1.basePath).toBe(basePath);
expect(fileInfo1.extension).toBe('ts');
expect(fileInfo1.filePath).toBe(basePath + '/tsParser/testSrc.ts');
expect(fileInfo1.location).toEqual(jasmine.objectContaining({ start: { line: 6, character: 30 }, end: { line: 28, character: 1 } }));
expect(fileInfo1.projectRelativePath).toEqual('tsParser/testSrc.ts');
expect(fileInfo1.relativePath).toEqual('tsParser/testSrc.ts');
expect(fileInfo1.projectRelativePath).toBe('tsParser/testSrc.ts');
expect(fileInfo1.realFilePath).toBe(fileInfo1.filePath + '.real');
expect(fileInfo1.realProjectRelativePath).toBe('tsParser/testSrc.ts.real');
expect(fileInfo1.relativePath).toBe('tsParser/testSrc.ts');
const fileInfo2 = new FileInfo(module.exportArray[1].declarations![0], basePath);
expect(fileInfo2.baseName).toEqual('testSrc');
expect(fileInfo2.basePath).toEqual(basePath);
expect(fileInfo2.extension).toEqual('ts');
expect(fileInfo2.filePath).toEqual(basePath + '/tsParser/testSrc.ts');
expect(fileInfo2.baseName).toBe('testSrc');
expect(fileInfo2.basePath).toBe(basePath);
expect(fileInfo2.extension).toBe('ts');
expect(fileInfo2.filePath).toBe(basePath + '/tsParser/testSrc.ts');
expect(fileInfo2.location).toEqual(jasmine.objectContaining({ start: { line: 33, character: 10 }, end: { line: 33, character: 42 } }));
expect(fileInfo2.projectRelativePath).toEqual('tsParser/testSrc.ts');
expect(fileInfo2.relativePath).toEqual('tsParser/testSrc.ts');
expect(fileInfo2.projectRelativePath).toBe('tsParser/testSrc.ts');
expect(fileInfo2.realFilePath).toBe(fileInfo2.filePath + '.real');
expect(fileInfo2.realProjectRelativePath).toBe('tsParser/testSrc.ts.real');
expect(fileInfo2.relativePath).toBe('tsParser/testSrc.ts');
const fileInfo3 = new FileInfo(module.exportArray[2].declarations![0], basePath);
expect(fileInfo3.baseName).toEqual('importedSrc');
expect(fileInfo3.basePath).toEqual(basePath);
expect(fileInfo3.extension).toEqual('ts');
expect(fileInfo3.filePath).toEqual(basePath + '/tsParser/importedSrc.ts');
expect(fileInfo3.baseName).toBe('importedSrc');
expect(fileInfo3.basePath).toBe(basePath);
expect(fileInfo3.extension).toBe('ts');
expect(fileInfo3.filePath).toBe(basePath + '/tsParser/importedSrc.ts');
expect(fileInfo3.location).toEqual(jasmine.objectContaining({ start: { line: 2, character: 12 }, end: { line: 2, character: 20 } }));
expect(fileInfo3.projectRelativePath).toEqual('tsParser/importedSrc.ts');
expect(fileInfo3.relativePath).toEqual('tsParser/importedSrc.ts');
expect(fileInfo3.projectRelativePath).toBe('tsParser/importedSrc.ts');
expect(fileInfo3.realFilePath).toBe(fileInfo3.filePath + '.real');
expect(fileInfo3.realProjectRelativePath).toBe('tsParser/importedSrc.ts.real');
expect(fileInfo3.relativePath).toBe('tsParser/importedSrc.ts');
});
describe('getRealFilePath()', () => {
const originalPathSep = path.sep;
afterEach(() => path.sep = originalPathSep);
it('should call `fs.realpathSync()`', () => {
const parseInfo = parser.parse(['tsParser/testSrc.ts'], basePath);
const module = parseInfo.moduleSymbols[0];
const fileInfo = new FileInfo(module.exportArray[0].declarations![0], basePath);
expect(fs.realpathSync).toHaveBeenCalledWith(fileInfo.filePath);
});
it('should normalize path separators to `/`', () => {
const parseInfo = parser.parse(['tsParser/testSrc.ts'], basePath);
const module = parseInfo.moduleSymbols[0];
let fileInfo;
path.sep = '\\';
fs.realpathSync.and.returnValue('C:\\Foo\\bar.ts');
fileInfo = new FileInfo(module.exportArray[0].declarations![0], basePath);
expect(fileInfo.realFilePath).toBe('C:/Foo/bar.ts');
path.sep = '/';
fs.realpathSync.and.returnValue('/Foo/bar.ts');
fileInfo = new FileInfo(module.exportArray[0].declarations![0], basePath);
expect(fileInfo.realFilePath).toBe('/Foo/bar.ts');
});
});
});
import { Declaration } from 'typescript';
import { Location } from './Location';
import { realpathSync } from 'fs';
const path = require('canonical-path');

@@ -15,2 +16,4 @@

projectRelativePath = path.relative(this.basePath, this.filePath);
realFilePath = this.getRealFilePath(this.filePath);
realProjectRelativePath = path.relative(this.basePath, this.realFilePath);

@@ -21,2 +24,6 @@ constructor(

}
getRealFilePath(filePath: string): string {
return realpathSync(filePath).replace(RegExp('\\' + path.sep, 'g'), '/');
}
}

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc