defiant-builder
Advanced tools
Comparing version 1.7.2 to 1.7.3
@@ -18,2 +18,38 @@ | ||
// ** Ensures safe CSS animation definitions for application scope | ||
const safeAnimDefScope = (id, css) => { | ||
let out = css | ||
let names = [] | ||
// capture all keyframe names | ||
out.replace(/@keyframes (\w[a-z-_]+) {/ig, (all, mmatch) => names.includes(mmatch) ? null : names.push(mmatch)) | ||
names = names.map(i => i.trim()) | ||
out = out.replace(/@keyframes (\w[a-z-_]+) \{/ig, `@keyframes $1-${id} {`) | ||
// replace all mixed animation-names | ||
out = out.replace(/animation:[a-z \d\D-,]*?;/mig, (all, mmatch) => { | ||
let str = all | ||
names.map(key => { | ||
let rx = new RegExp(`\\b${key}\\b`, "g") | ||
str = str.replace(rx, `${key}-${id}`) | ||
}) | ||
return str | ||
}) | ||
// replace all animation-names | ||
out = out.replace(/animation-name:[a-z \d\D-,]*?;/mig, (all, mmatch) => { | ||
let str = all | ||
names.map(key => { | ||
let rx = new RegExp(`\\b${key}\\b`, "g") | ||
str = str.replace(rx, `${key}-${id}`) | ||
}) | ||
return str | ||
}) | ||
return out | ||
} | ||
// ** Build tasks for application | ||
const buildTasks = async (appXmlDom, appPath, id, namespace, uglify) => { | ||
@@ -80,2 +116,3 @@ let xApp = appXmlDom.Application | ||
// ** Compiles javascript | ||
@@ -168,34 +205,3 @@ const compileScript = async (meta, appPath, uglify) => { | ||
const safeAnimDefScope = (id, css) => { | ||
let out = css | ||
let names = [] | ||
// capture all keyframe names | ||
out.replace(/@keyframes (\w[a-z-_]+) {/ig, (all, mmatch) => names.includes(mmatch) ? null : names.push(mmatch)) | ||
names = names.map(i => i.trim()) | ||
out = out.replace(/@keyframes (\w[a-z-_]+) \{/ig, `@keyframes $1-${id} {`) | ||
// replace all mixed animation-names | ||
out = out.replace(/animation:[a-z \d\D-,]*?;/mig, (all, mmatch) => { | ||
let str = all | ||
names.map(key => { | ||
let rx = new RegExp(`\\b${key}\\b`, "g") | ||
str = str.replace(rx, `${key}-${id}`) | ||
}) | ||
return str | ||
}) | ||
// replace all animation-names | ||
out = out.replace(/animation-name:[a-z \d\D-,]*?;/mig, (all, mmatch) => { | ||
let str = all | ||
names.map(key => { | ||
let rx = new RegExp(`\\b${key}\\b`, "g") | ||
str = str.replace(rx, `${key}-${id}`) | ||
}) | ||
return str | ||
}) | ||
return out | ||
} | ||
// ** Compiles styles (less files) | ||
@@ -263,2 +269,3 @@ const compileStyle = async (meta, appPath) => { | ||
// ** Compiles xsl | ||
@@ -280,2 +287,3 @@ async function compileXsl(meta, appPath) { | ||
// ** Compiles content | ||
@@ -326,2 +334,3 @@ async function compileContent(meta, appPath, uglify) { | ||
// ** gets content stores | ||
@@ -355,2 +364,3 @@ async function getContentStores(meta, appPath, uglify) { | ||
// ** Compiles svg icons | ||
@@ -548,3 +558,3 @@ async function compileIcons(meta, appPath) { | ||
resolve({ | ||
let buildInfo = { | ||
version, | ||
@@ -559,3 +569,12 @@ name, | ||
files, | ||
}) | ||
} | ||
let runRequires = meta.find(item => item && item._attributes.name === "requires") | ||
if (runRequires) { | ||
buildInfo.runRequires = {} | ||
runRequires.entry.map(item => | ||
buildInfo.runRequires[item._attributes.id] = item._attributes.description) | ||
} | ||
resolve(buildInfo) | ||
}) | ||
@@ -562,0 +581,0 @@ } |
{ | ||
"name": "defiant-builder", | ||
"version": "1.7.2", | ||
"version": "1.7.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
@@ -5,3 +5,3 @@ | ||
let source = path.join(__dirname, "temp/solitaire") | ||
let source = path.join(__dirname, "temp/spotify") | ||
let destination = path.join(__dirname, "temp/_build") | ||
@@ -13,3 +13,6 @@ let uglify = false | ||
Build({ source, destination, uglify, compress }) | ||
.then(success => console.log("Done!")) | ||
.then(build => { | ||
console.log(build) | ||
console.log("Done!") | ||
}) | ||
.catch(e => console.log(e)) | ||
@@ -16,0 +19,0 @@ } |
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
57053
568