pure-engine
Advanced tools
Comparing version 0.14.0 to 0.15.0
{ | ||
"name": "pure-engine", | ||
"version": "0.14.0", | ||
"version": "0.15.0", | ||
"description": "Compile HTML templates into JS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -84,3 +84,2 @@ const AbstractSyntaxTree = require('abstract-syntax-tree') | ||
tree.append(getForLoop(name, ast.body, variables, valueIdentifier, guard)) | ||
console.log(tree.source) | ||
variables.pop() | ||
@@ -87,0 +86,0 @@ variables.pop() |
@@ -57,3 +57,4 @@ const AbstractSyntaxTree = require('abstract-syntax-tree') | ||
const content = asset.source | ||
components.push({ name, content, path: asset.path }) | ||
const { files } = asset | ||
components.push({ name, content, files, path: asset.path }) | ||
} | ||
@@ -127,2 +128,3 @@ | ||
walk(htmlTree, leaf => { | ||
leaf.context = asset.path | ||
if (localVariables.length > 0) { | ||
@@ -252,2 +254,3 @@ inlineLocalVariablesInFragment(leaf, localVariables) | ||
walk(htmlTree, leaf => { | ||
leaf.context = asset.path | ||
if (localVariables.length > 0) { | ||
@@ -272,3 +275,3 @@ inlineLocalVariablesInFragment(leaf, localVariables) | ||
const { content } = fragment.children[0] | ||
components.push({ name: key, content, path: null }) | ||
components.push({ name: key, files: ['.'], content, path: null }) | ||
fragment.children.forEach(child => { | ||
@@ -288,2 +291,3 @@ child.used = true | ||
walk(htmlTree, leaf => { | ||
leaf.context = component.path | ||
if (localVariables.length > 0) { | ||
@@ -373,3 +377,4 @@ inlineLocalVariablesInFragment(leaf, localVariables) | ||
const keys = attrs ? attrs.map(attr => attr.key) : [] | ||
const component = components.find(component => component.name === tag) | ||
const context = fragment.context || '.' | ||
const component = components.find(component => component.name === tag && component.files && component.files.includes(context)) | ||
const { languages } = options | ||
@@ -376,0 +381,0 @@ plugins.forEach(plugin => { |
@@ -56,3 +56,4 @@ const { parse: parseHTML, stringify: stringifyHTML, parseDefaults } = require('himalaya') | ||
parse, | ||
stringify | ||
stringify, | ||
walk | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
203211
5107