Skip to content

Commit 53be3c2

Browse files
committed
fix: remove tmp dirs from error output, rename Plugin -> Tree
1 parent 700daf9 commit 53be3c2

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

src/extracters/typescript.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function runTypedoc(rootDir: string, sourceDirs: string[]) {
2323
}, <string[]>[]);
2424
let originalDir = process.cwd();
2525
process.chdir(rootDir);
26-
let app = new Application({ tsconfig: path.join(rootDir, 'tsconfig.json'), ignoreCompilerErrors: true });
26+
let app = new Application({ tsconfig: path.join(rootDir, 'tsconfig.json'), ignoreCompilerErrors: true });
2727
let result = app.convert(files);
2828
process.chdir(originalDir);
2929
return result;
@@ -66,7 +66,12 @@ function normalize(project: ProjectReflection, extracter: Extracter): API {
6666
pkg.classes[item.name] = normalizeClass(item);
6767

6868
} else {
69-
ui.warn(`${ item.sources[0].fileName } exported a ${ item.kindString }, and I don't know how to document that`);
69+
let filename = item.sources[0].fileName;
70+
// Chop of broccoli tmp directories if present
71+
if (filename.startsWith('tmp')) {
72+
filename = filename.split('/').slice(2).join('/');
73+
}
74+
ui.warn(`${ filename } exported a ${ item.kindString }, and I don't know how to document that`);
7075
}
7176

7277
}
@@ -230,7 +235,7 @@ function displayTypeFrom(type: any): string {
230235

231236
// Add any type args it might take, recursing into those types to render them properly
232237
if (type.typeArguments) {
233-
displayType += '<' + type.typeArguments.map(displayTypeFrom).join(', ') + '>';
238+
displayType += '<' + type.typeArguments.map(displayTypeFrom).join(', ') + '>';
234239
}
235240

236241
return displayType;

src/trees/extracter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Plugin = require('broccoli-plugin');
1+
import Tree = require('broccoli-plugin');
22
import Extracter from '../extracter';
33
import { sync as readPkg } from 'read-pkg'
44
import * as fs from 'fs';
@@ -20,7 +20,7 @@ export interface ExtracterTreeOptions {
2020
sourceDirs?: string[];
2121
}
2222

23-
export default class ExtracterTree extends Plugin {
23+
export default class ExtracterTree extends Tree {
2424

2525
options: {
2626
/**
@@ -43,7 +43,7 @@ export default class ExtracterTree extends Plugin {
4343
version: string;
4444
};
4545

46-
constructor(sourceTree: Plugin | string, options: ExtracterTreeOptions) {
46+
constructor(sourceTree: Tree | string, options: ExtracterTreeOptions) {
4747
super([ sourceTree ]);
4848
options.sourceDirs = options.sourceDirs || [ 'src' ];
4949
options.pagesDir = options.pagesDir || 'docs';

src/typings.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ declare module 'require-dir';
33
declare module 'yuidocjs';
44
declare module 'read-pkg';
55
declare module 'broccoli-plugin' {
6-
export = Plugin;
7-
class Plugin {
6+
export = Tree;
7+
class Tree {
88
inputPaths: string[];
99
outputPath: string;
1010
cachePath: string[];
11-
constructor(inputNodes: (string | Plugin)[], options?: {
11+
constructor(inputNodes: (string | Tree)[], options?: {
1212
name: string,
1313
annotation: string,
1414
persistentOutput: boolean,

0 commit comments

Comments
 (0)