emitty
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -65,2 +65,2 @@ /// <reference types="node" /> | ||
} | ||
export declare function setup(directory: string, language: string | ILanguage, options?: IOptions): IEmittyApi; | ||
export declare function setup(root: string, language: string | ILanguage, options?: IOptions): IEmittyApi; |
@@ -7,2 +7,3 @@ 'use strict'; | ||
const stream_1 = require("./providers/stream"); | ||
const paths_1 = require("./utils/paths"); | ||
const fs_1 = require("./utils/fs"); | ||
@@ -21,4 +22,4 @@ function assertInput(directory, language) { | ||
} | ||
function setup(directory, language, options) { | ||
assertInput(directory, language); | ||
function setup(root, language, options) { | ||
assertInput(root, language); | ||
const storage = new storage_1.Storage(); | ||
@@ -43,6 +44,7 @@ options = Object.assign({ | ||
} | ||
root = paths_1.normalize(root); | ||
const config = new config_1.Config(language); | ||
const scanner = new scanner_1.Scanner(directory, storage, config.getConfig(), options); | ||
const scanner = new scanner_1.Scanner(root, storage, config.getConfig(), options); | ||
const resolver = new resolver_1.Resolver(storage); | ||
const stream = new stream_1.Stream(directory, storage, config.getConfig(), options); | ||
const stream = new stream_1.Stream(root, storage, config.getConfig(), options); | ||
return { | ||
@@ -49,0 +51,0 @@ storage: () => storage.snapshot(), |
@@ -29,3 +29,9 @@ 'use strict'; | ||
return through2.obj(function (file, enc, cb) { | ||
const mainFile = paths_1.join(_this.root, file.relative); | ||
let mainFile = ''; | ||
if (file.path) { | ||
mainFile = paths_1.relative(file.cwd, file.path); | ||
} | ||
if (!mainFile.startsWith(_this.root)) { | ||
mainFile = paths_1.join(_this.root, mainFile); | ||
} | ||
// Update Storage | ||
@@ -32,0 +38,0 @@ scanner.scan(filepath, stats).then((lastChangedFile) => { |
{ | ||
"name": "emitty", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Determine the inheritance of template and style files", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -236,3 +236,3 @@ # emitty | ||
* Type: `strin[]` | ||
* Type: `string[]` | ||
* Default: `['.git', '**/node_modules', '**/bower_components']` | ||
@@ -313,4 +313,4 @@ | ||
{ | ||
start: '//', // The start of a comment | ||
end: '' // The end of a comment | ||
start: '//', // [type: string] The start of a comment | ||
end: '' // [type: string] The end of a comment | ||
} | ||
@@ -317,0 +317,0 @@ ``` |
41516
860