Comparing version 0.0.28 to 0.0.29
@@ -9,2 +9,7 @@ "use strict"; | ||
var actualOptions = _.merge({}, exports.defProjectMapperOptions, bootstrapOptions.mapper); | ||
var srcDir = path.resolve(bootstrapOptions.rootDir, bootstrapOptions.srcDir); | ||
var libDir = path.resolve(bootstrapOptions.rootDir, 'node_modules'); | ||
var excludeFromSrc = (path.resolve(bootstrapOptions.rootDir) === srcDir) | ||
? [libDir] | ||
: []; | ||
var projectInfo = { | ||
@@ -17,4 +22,4 @@ rootDir: bootstrapOptions.rootDir, | ||
systemMount: bootstrapOptions.systemMount, | ||
srcInfo: actualOptions.collector(path.join(bootstrapOptions.rootDir, bootstrapOptions.srcDir)), | ||
libInfo: actualOptions.collector(path.join(bootstrapOptions.rootDir, 'node_modules')), | ||
srcInfo: actualOptions.collector(srcDir, excludeFromSrc), | ||
libInfo: actualOptions.collector(libDir), | ||
nodeLibInfo: actualOptions.nodeLibs ? actualOptions.collector(path.join(nodeSupport.rootDir, 'node_modules')) : undefined | ||
@@ -25,3 +30,2 @@ }; | ||
exports.generateProjectInfo = generateProjectInfo; | ||
; | ||
exports.defTopology = { | ||
@@ -28,0 +32,0 @@ rootDir: process.cwd(), |
import { DirInfo } from "./types"; | ||
export declare function collectDirInfo(rootDir: string, parent?: DirInfo): DirInfo; | ||
export declare function collectDirInfo(rootDir: string, exclude?: string[]): DirInfo; |
@@ -5,2 +5,3 @@ "use strict"; | ||
var os = require('os'); | ||
var _ = require('lodash'); | ||
var relevantFiles = ['package.json', 'bower.json', 'index.js']; | ||
@@ -12,4 +13,5 @@ function normalizePath(pathName) { | ||
} | ||
function collectDirInfo(rootDir, parent) { | ||
function collect(rootDir, parent, exclude) { | ||
if (parent === void 0) { parent = null; } | ||
if (exclude === void 0) { exclude = []; } | ||
var stat; | ||
@@ -33,5 +35,8 @@ var name = path.basename(rootDir); | ||
.reduce(function (acc, name) { | ||
var childItem = collectDirInfo(path.join(rootDir, name), item); | ||
if (childItem) { | ||
acc[name] = childItem; | ||
var childPath = path.join(rootDir, name); | ||
if (!_.includes(exclude, childPath)) { | ||
var childItem = collect(childPath, item, exclude); | ||
if (childItem) { | ||
acc[name] = childItem; | ||
} | ||
} | ||
@@ -43,3 +48,3 @@ return acc; | ||
else { | ||
if (relevantFiles.indexOf(name) > -1) { | ||
if (_.includes(relevantFiles, name)) { | ||
if (name === 'package.json' || name === 'bower.json') { | ||
@@ -58,3 +63,7 @@ try { | ||
} | ||
function collectDirInfo(rootDir, exclude) { | ||
if (exclude === void 0) { exclude = []; } | ||
return collect(rootDir, null, exclude); | ||
} | ||
exports.collectDirInfo = collectDirInfo; | ||
//# sourceMappingURL=dir-structure.js.map |
@@ -17,3 +17,3 @@ export declare type DirInfoDict = { | ||
export interface DirInfoCollector { | ||
(rootDir: string): DirInfo; | ||
(rootDir: string, exclude?: string[]): DirInfo; | ||
} | ||
@@ -20,0 +20,0 @@ export interface Topology { |
{ | ||
"name": "bundless", | ||
"version": "0.0.28", | ||
"version": "0.0.29", | ||
"description": "Experimental bundle-free dependency server", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
790899
23579