Socket
Socket
Sign inDemoInstall

rheactor-build-views

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rheactor-build-views - npm Package Compare versions

Comparing version 2.0.1 to 3.0.0

29

index.js

@@ -36,3 +36,6 @@ #!/usr/bin/env node

let svgIncludes = {}
let directives = {}
source = path.resolve(source)
const sourceDir = fs.statSync(source).isFile() ? path.dirname(source) : source
target = path.resolve(target)
const targetDir = path.dirname(target)

@@ -57,3 +60,3 @@ /**

let scanForIncludes = [
globAsync(source + '/includes/*.html')
globAsync(sourceDir + '/includes/*.html')
]

@@ -66,6 +69,5 @@ if (options.include) {

Promise.all(scanForIncludes),
globAsync(source + '/js/directives/*.html'),
globAsync(options.svg ? options.svg : source + '/img/*.svg')
globAsync(options.svg ? options.svg : sourceDir + '/img/*.svg')
)
.spread((includeTemplates, directiveTemplates, svgFiles) => Promise
.spread((includeTemplates, svgFiles) => Promise
.map(svgFiles, (file) => {

@@ -91,3 +93,3 @@ return fs.readFileAsync(file, 'utf8').then(data => {

return fs.readFileAsync(file, 'utf8').then((data) => {
let trg = file.replace(source + '/includes/', '')
let trg = file.replace(sourceDir + '/includes/', '')
if (options.include) {

@@ -109,11 +111,2 @@ trg = trg.replace(options.include, '')

})
}),
Promise.map(directiveTemplates, (file) => {
return fs.readFileAsync(file, 'utf8').then((data) => {
let trg = file.replace(source + '/js/directives/', '')
trg = trg.replace(/\.html$/, '')
trg = trg.replace(/\//, '.')
data = _template(data)({data: templatedata})
directives[trg] = data
})
})

@@ -139,6 +132,6 @@ ))

})
return globAsync(source + '/*.html')
return globAsync(sourceDir === source ? sourceDir + '/*.html' : source)
.map((src) => {
return fs.readFileAsync(src, 'utf8').then((data) => {
data = _template(data)({data: templatedata, includes: includes, directives: directives, svg: svgIncludes})
data = _template(data)({data: templatedata, includes: includes, svg: svgIncludes})
if (options.minify) {

@@ -155,3 +148,3 @@ data = minify(data, {

}
let trg = target + '/' + src.replace(source + '/', '')
const trg = path.join(targetDir, path.basename(src))
console.log(src + ' -> ' + trg)

@@ -158,0 +151,0 @@ return fs.writeFileAsync(trg, data)

@@ -42,3 +42,3 @@ {

},
"version": "2.0.1"
"version": "3.0.0"
}
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