Skip to content

Commit

Permalink
Bump version to 5.0.1 and fix import bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikhil Verma committed Jun 14, 2017
1 parent 05e71ce commit 652658d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Expand Up @@ -460,7 +460,7 @@ module.exports = {
return through.obj((file, enc, next) => {
let newFile = file.clone()
try {
newFile.contents = new PropSet(newFile, transform, options).transform().toBuffer()
newFile.contents = new PropSet(newFile, transform, options, true).transform().toBuffer()
} catch (err) {
return next(err)
}
Expand Down
6 changes: 4 additions & 2 deletions lib/prop-set.js
Expand Up @@ -19,7 +19,7 @@ let TheoError = require('./util/error')

class PropSet {

constructor (file, valueTransforms, options = {}) {
constructor (file, valueTransforms, options = {}, isRootTransform = false) {
if (typeof file.isBuffer !== 'function' || typeof file.isBuffer === 'undefined') {
throw TheoError('transform() must use vinyl files')
}
Expand All @@ -35,6 +35,8 @@ class PropSet {
this.valueTransforms = valueTransforms
this.options = Object.assign({}, defaults, options)

this.isRootTransform = isRootTransform

this._init()
}

Expand Down Expand Up @@ -158,7 +160,7 @@ class PropSet {
if ((type !== 'local') && isAliasStructure.test(haystack.value)) {
_.forEach(haystack.value.match(isAliasStructure), a => {
let alias = a.toString().replace('{!', '').replace('}', '')
if (!def.aliases[alias]) throw new Error(`Alias ${a} not found`)
if (!def.aliases[alias] && this.isRootTransform) throw new Error(`Alias ${a} not found`)
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "theo",
"version": "5.0.0",
"version": "5.0.1",
"license": "SEE LICENSE IN README.md",
"description": "A set of Gulp plugins for transforming and formatting Design Tokens",
"keywords": [
Expand Down

0 comments on commit 652658d

Please sign in to comment.