buddy
Advanced tools
Comparing version 6.12.2 to 6.12.3
@@ -79,3 +79,3 @@ 'use strict'; | ||
if (err) return fn ? fn(err) : error(err, 2); | ||
print(`\ndone in ${chalk.cyan(stopwatch.stop('build', true))}\n`, 0); | ||
print(`\ndone build in ${chalk.cyan(stopwatch.stop('build', true))}\n`, 0); | ||
// Run script | ||
@@ -210,3 +210,3 @@ this.executeScript(); | ||
} | ||
print(`\ndone in ${chalk.cyan(stopwatch.stop('watch', true))}\n`, 0); | ||
print(`\ndone build in ${chalk.cyan(stopwatch.stop('watch', true))}\n`, 0); | ||
// Run test script | ||
@@ -213,0 +213,0 @@ this.executeScript(); |
@@ -94,3 +94,3 @@ 'use strict'; | ||
this.outputFiles = []; | ||
this.printPrefix = (new Array(this.level + 2)).join('\u2219'); | ||
this.printPrefix = (new Array(this.level + 1)).join('\u2219'); | ||
@@ -222,2 +222,4 @@ // Handle printing long input/output arrays | ||
} else { | ||
// Force for dynamic builds | ||
file.options = this.fileFactoryOptions; | ||
files.push(file); | ||
@@ -224,0 +226,0 @@ this.inputFiles.push(file); |
@@ -107,3 +107,4 @@ 'use strict'; | ||
if (filepath.indexOf('node_modules') !== filepath.lastIndexOf('node_modules')) { | ||
const sourcePkg = path.relative(process.cwd(), filepath).replace(/\\/g, '/').split('/')[1]; | ||
const sourceParts = path.relative(process.cwd(), filepath).replace(/\\/g, '/').split('/'); | ||
const sourcePkg = sourceParts.slice(1, (sourceParts[1].charAt(0) == '@') ? 3 : 2).join('/'); | ||
@@ -110,0 +111,0 @@ print(`If possible, consider updating the ${strong(sourcePkg)} package to use version ${strong(canonicalVersion)}`, level); |
@@ -118,12 +118,5 @@ 'use strict'; | ||
build.fileFactoryOptions = getFileFactoryOptions(build, parent, version, options, { | ||
browser: build.browser, | ||
buildFactory: getBuildFactory(build), | ||
bundle: build.bundle, | ||
fileCache: build.fileCache, | ||
fileExtensions, | ||
fileFactory, | ||
level: (build.level * 2) + 1, | ||
pluginOptions: {}, | ||
npmModulepaths, | ||
resolverCache: build.resolverCache, | ||
runtimeOptions, | ||
@@ -163,2 +156,10 @@ sourceroot: serverConfig.sourceroot, | ||
fileFactoryOptions.browser = build.browser; | ||
fileFactoryOptions.buildFactory = getBuildFactory(build); | ||
fileFactoryOptions.bundle = build.bundle; | ||
fileFactoryOptions.fileCache = build.fileCache; | ||
fileFactoryOptions.level = build.level + 2; | ||
fileFactoryOptions.pluginOptions = {}; | ||
fileFactoryOptions.resolverCache = build.resolverCache; | ||
// Only load plugins for active output builds | ||
@@ -199,3 +200,2 @@ if (needsPlugins) { | ||
fileCache: parent.fileCache, | ||
fileFactory: parent.fileFactory, | ||
index: ++numBuilds, | ||
@@ -211,2 +211,3 @@ input, | ||
parent, | ||
resolverCache: parent.resolverCache, | ||
runtimeOptions: parent.runtimeOptions, | ||
@@ -216,4 +217,7 @@ type: parent.type, | ||
}; | ||
const build = buildFactory(buildConfig); | ||
parent.builds.push(buildFactory(buildConfig)); | ||
build.fileFactoryOptions = getFileFactoryOptions(build, parent, null, null, Object.assign({}, parent.fileFactoryOptions)); | ||
build.fileFactory = build.fileFactoryOptions.fileFactory; | ||
parent.builds.push(build); | ||
parent.childInputpaths.push(inputpath); | ||
@@ -220,0 +224,0 @@ } |
@@ -209,3 +209,3 @@ 'use strict'; | ||
if (!presetPlugins) warn(`unable to resolve plugins for ${strong(preset)} version`); | ||
if (!presetPlugins) warn(`unable to resolve plugins for ${strong(preset)} version`, 1); | ||
@@ -292,3 +292,3 @@ return unique(plugins.concat(presetPlugins || [])); | ||
if (!filepath) return warn(`unable to load plugin ${strong(id)}`); | ||
if (!filepath) return warn(`unable to load plugin ${strong(id)}`, 1); | ||
@@ -295,0 +295,0 @@ if (isArray) { |
@@ -44,13 +44,15 @@ 'use strict'; | ||
const missingDependenciesString = ids | ||
.filter((id) => find(id) == '') | ||
.join(' '); | ||
const missingDependencies = ids | ||
.filter((id) => find(id) == ''); | ||
if (missingDependenciesString.length) { | ||
if (missingDependencies.length) { | ||
try { | ||
const cmd = useNPM | ||
? `npm --save-dev --save-exact install ${missingDependenciesString}` | ||
: `yarn add --dev --exact ${missingDependenciesString}`; | ||
? `npm --save-dev --save-exact install ${missingDependencies.join(' ')}` | ||
: `yarn add --dev --exact ${missingDependencies.join(' ')}`; | ||
print(`installing the following missing dependencies: ${strong(missingDependenciesString)}`); | ||
print('installing the following missing dependencies:', 0); | ||
missingDependencies.forEach((id) => { | ||
print(strong(id), 1); | ||
}); | ||
exec(cmd); | ||
@@ -57,0 +59,0 @@ } catch (err) { |
@@ -180,4 +180,2 @@ 'use strict'; | ||
if (!id) throw Error(`unable to create file for: ${strong(filepath)}`); | ||
ctor = this.fileDefinitionByExtension[extension]; | ||
@@ -184,0 +182,0 @@ file = new ctor(id, filepath, options); |
@@ -308,3 +308,3 @@ 'use strict'; | ||
this.hasUnresolvedDependencies = true; | ||
warn(`dependency ${strong(dependency.id)} for ${strong(this.relpath)} not found`, this.options.level + 1); | ||
warn(`dependency ${strong(dependency.id)} for ${strong(this.relpath)} not found`, this.options.level); | ||
return; | ||
@@ -455,6 +455,12 @@ } | ||
readFileContent () { | ||
let content = this.isDummy | ||
? ' ' | ||
: readFile(this.filepath, this.encoding); | ||
let content = ' '; | ||
if (!this.isDummy) { | ||
try { | ||
content = readFile(this.filepath, this.encoding); | ||
} catch (err) { | ||
warn(`unable to find file ${strong(this.filepath)}`, this.options.level); | ||
} | ||
} | ||
if ('string' == typeof content) { | ||
@@ -461,0 +467,0 @@ content = content.replace(RE_WIN_LINE_ENDINGS, '\n'); |
@@ -153,6 +153,2 @@ 'use strict'; | ||
if (dependency.context.includes('buddyImport')) { | ||
warn(`${strong('buddyImport()')} syntax will soon be deprecated. Use ${strong('import()')} instead`, this.options.level); | ||
} | ||
const file = dependency.file = fileFactory(filepath, this.options); | ||
@@ -159,0 +155,0 @@ |
@@ -38,12 +38,12 @@ 'use strict'; | ||
tasks.push((done) => { | ||
reloadServer = ReloadServerFactory(); | ||
reloadServer.on('error', (err) => { | ||
if (!err.message.includes('ECONNRESET')) throw err; | ||
}); | ||
print(`live-reloading on port: ${reloadServer.port}`, 1); | ||
reloadServer.start((err) => { | ||
if (err) { /* ignore */} | ||
isReady = true; | ||
done(); | ||
}); | ||
reloadServer = ReloadServerFactory(); | ||
reloadServer.on('error', (err) => { | ||
if (!err.message.includes('ECONNRESET')) throw err; | ||
}); | ||
print(`live-reloading on port: ${reloadServer.port}`, 0); | ||
reloadServer.start((err) => { | ||
if (err) { /* ignore */} | ||
isReady = true; | ||
done(); | ||
}); | ||
}); | ||
@@ -54,3 +54,3 @@ } | ||
const filepath = path.relative(process.cwd(), options.file || options.directory) | ||
|| path.dirname(process.cwd()); | ||
|| path.dirname(process.cwd()); | ||
@@ -64,3 +64,3 @@ tasks.push((done) => { | ||
print(`serving ${strong(filepath)} at ${chalk.underline('http://localhost:' + options.port)}\n`, 1); | ||
print(`serving ${strong(filepath)} at ${chalk.underline('http://localhost:' + options.port)}\n`, 0); | ||
@@ -67,0 +67,0 @@ // Initialize app server |
{ | ||
"name": "buddy", | ||
"description": "A fast, simple build tool for web projects.", | ||
"version": "6.12.2", | ||
"version": "6.12.3", | ||
"author": "popeindustries <alex@pope-industries.com>", | ||
@@ -19,3 +19,3 @@ "keywords": [ | ||
"async": "2.1.4", | ||
"autoprefixer": "6.7.0", | ||
"autoprefixer": "6.7.2", | ||
"babel-core": "6.22.1", | ||
@@ -25,3 +25,3 @@ "babel-plugin-external-helpers": "6.22.0", | ||
"babel-plugin-transform-es2015-modules-commonjs": "6.22.0", | ||
"browserslist": "1.6.0", | ||
"browserslist": "1.7.1", | ||
"buddy-cli": "6.1.0", | ||
@@ -28,0 +28,0 @@ "chalk": "1.1.3", |
241533
6017
+ Addedautoprefixer@6.7.2(transitive)
+ Addedbrowserslist@1.7.1(transitive)
- Removedautoprefixer@6.7.0(transitive)
- Removedbrowserslist@1.6.0(transitive)
Updatedautoprefixer@6.7.2
Updatedbrowserslist@1.7.1