Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

defiant-builder

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

defiant-builder - npm Package Compare versions

Comparing version 1.6.7 to 1.6.8

43

lib/index.js

@@ -166,2 +166,33 @@

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 ${id}-$1 {`)
// 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(key, "g")
str = str.replace(rx, `${id}-${key}`)
})
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(key, "g")
str = str.replace(rx, `${id}-${key}`)
})
return str
})
return out
}
// ** Compiles styles (less files)

@@ -181,5 +212,7 @@ const compileStyle = async (meta, appPath) => {

if (cssFile && await FS.fileExists(filePath)) {
data = await FS.readFile(filePath)
toolbar_output = await less.render(`.ant-window_[data-id="${id}"] .win-toolbar_, .ant-window_[data-id="${id}"] .win-caption-toolbar_ {${data.toString()}}`, options)
data = safeAnimDefScope(id, data.toString())
toolbar_output = await less.render(`.ant-window_[data-id="${id}"] .win-toolbar_, .ant-window_[data-id="${id}"] .win-caption-toolbar_ {${data}}`, options)
toolbar_output = toolbar_output.css

@@ -194,3 +227,4 @@ .replace(/(url\('?)\~/g, `$1/app/${namespace}/${id}`)

data = await FS.readFile(filePath)
statusbar_output = await less.render(`.ant-window_[data-id="${id}"] .win-status-bar_ {${data.toString()}}`, options)
data = safeAnimDefScope(id, data.toString())
statusbar_output = await less.render(`.ant-window_[data-id="${id}"] .win-status-bar_ {${data}}`, options)
statusbar_output = statusbar_output.css

@@ -205,3 +239,4 @@ .replace(/(url\('?)\~/g, `$1/app/${namespace}/${id}`)

data = await FS.readFile(filePath)
dialog_output = await less.render(`.ant-window_[data-id="${id}"] .dialog_ {${data.toString()}}`, options)
data = safeAnimDefScope(id, data.toString())
dialog_output = await less.render(`.ant-window_[data-id="${id}"] .dialog_ {${data}}`, options)
dialog_output = dialog_output.css

@@ -218,2 +253,3 @@ .replace(/(url\('?)\~/g, `$1/app/${namespace}/${id}`)

data = data.toString().replace(/(@import ("|'))/g, `$1${dirPath}/`)
data = safeAnimDefScope(id, data)
winbody_output = await less.render(`.ant-window_[data-id="${id}"] ${isHeadless ? "": ".win-body_"} {${data}}`, options)

@@ -224,2 +260,3 @@ winbody_output = winbody_output.css

}
return toolbar_output + winbody_output + statusbar_output + dialog_output

@@ -226,0 +263,0 @@ }

2

package.json
{
"name": "defiant-builder",
"version": "1.6.7",
"version": "1.6.8",
"description": "",

@@ -5,0 +5,0 @@ "main": "./lib",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc