Skip to content

Commit

Permalink
refactor(stats): rename input to inputs and use string[]
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Feb 10, 2018
1 parent 38c2ea1 commit 1fb9e89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
16 changes: 5 additions & 11 deletions src/compiler/build/build-results.ts
@@ -1,7 +1,7 @@
import { BuildBundle, BuildComponent, BuildCtx, BuildEntry, BuildResults, BuildStats, CompilerCtx, Config } from '../../declarations';
import { cleanDiagnostics } from '../../util/logger/logger-util';
import { DEFAULT_STYLE_MODE, ENCAPSULATION } from '../../util/constants';
import { hasError, pathJoin } from '../util';
import { hasError, normalizePath } from '../util';


export function generateBuildResults(config: Config, compilerCtx: CompilerCtx, buildCtx: BuildCtx) {
Expand Down Expand Up @@ -53,7 +53,7 @@ export function generateBuildResults(config: Config, compilerCtx: CompilerCtx, b
fileName: entryBundle.fileName,
size: entryBundle.text.length,
outputs: entryBundle.outputs.map(filePath => {
return pathJoin(config, config.sys.path.relative(config.rootDir, filePath));
return normalizePath(config.sys.path.relative(config.rootDir, filePath));
})
};
if (typeof entryBundle.sourceTarget === 'string') {
Expand All @@ -68,15 +68,9 @@ export function generateBuildResults(config: Config, compilerCtx: CompilerCtx, b
return buildBundle;
}),

input: en.moduleFiles.map(m => {
return {
filePath: pathJoin(config, config.sys.path.relative(config.rootDir, m.jsFilePath))
};
}).sort((a, b) => {
if (a.filePath < b.filePath) return -1;
if (a.filePath > b.filePath) return 1;
return 0;
}),
inputs: en.moduleFiles.map(m => {
return normalizePath(config.sys.path.relative(config.rootDir, m.jsFilePath));
}).sort(),

encapsulations: []
};
Expand Down
4 changes: 1 addition & 3 deletions src/declarations/build.ts
Expand Up @@ -85,9 +85,7 @@ export interface BuildEntry {
entryId: string;
components: BuildComponent[];
bundles: BuildBundle[];
input: {
filePath: string;
}[];
inputs: string[];
modes?: string[];
encapsulations: string[];
}
Expand Down

0 comments on commit 1fb9e89

Please sign in to comment.