Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Commit

Permalink
release 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Bellini committed Mar 18, 2016
1 parent 7c256a2 commit a8cb1d4
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 241 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ node_modules
bower_components
.sass-cache
.git
.idea

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

### 0.2.0
- cleaned up code
- build timer *(it says how many seconds antelope takes for each build)*
- consistent watch mode *(if you get a compilation error during build, antelope will watch files anyway instead of exiting)*
- improved error tips
- improved `antelope install` command *(it will install project and core `npm` deps)*

### 0.1.0
This is the first public release od Antelope.
1 change: 1 addition & 0 deletions lib/automation/collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function collect(searchSubjects, searchPaths, basePattern) {
module.exports = {
manifests: () => {
return collect('manifests (package.json)', [
path.join(cwd, `./package.json`),
path.join(cwd, `./vendor/spryker/**/assets/package.json`)
]);
},
Expand Down
31 changes: 27 additions & 4 deletions lib/automation/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,33 @@ let webpack = require('webpack');
let context = require('../context');
let errors = require('../errors');
let cwd = process.cwd();
let watching = false;

module.exports = {
build: (config) => {
return new Promise((resolve, reject) => {
console.error('- building assets using webpack...'.gray);

webpack(config, function(err, stats) {
webpack(config, function(err, stats, eee) {
let withWarnings = false;
let withErrors = false;
let withModuleNotFound = false;

try {
if (err) {
throw errors.enrich(err, 'webpack');
}

if (!!stats.compilation.errors && stats.compilation.errors.length > 0) {
withErrors = true;
R.forEach(function(compilationErr) {
withModuleNotFound = (compilationErr.name === 'ModuleNotFoundError');
console.error(' - %s'.red, compilationErr);
}, stats.compilation.errors);

throw errors.enrich(new Error('CompilationError'), 'assets compilation');
if (!config.watch) {
throw errors.enrich(new Error('CompilationError'), 'assets compilation');
}
}

if (!!stats.compilation.fileDependencies) {
Expand All @@ -55,13 +62,29 @@ module.exports = {
}
}

console.log('- build completed'.gray, (withWarnings ? 'with some warning'.yellow : 'successfully'.green));
if (withErrors) {
console.error('- build failed'.gray, 'due to errors'.red);

if (withModuleNotFound) {
console.error(' [!] something is missing: did you run'.red, 'antelope install', 'before building?'.red);
console.error(' if you did, then it may be a typo...'.red);
}
} else if (withWarnings) {
console.warn('- build completed'.gray, 'with some warning'.yellow);
} else {
console.log('- build completed'.gray, 'successfully'.green, 'in'.gray, `${(stats.endTime - stats.startTime) / 1000}`.cyan, 'seconds'.gray);
}
} catch (err) {
reject(errors.enrich(err, 'compilation report'));
}

if (config.watch) {
console.info('- watching assets for changes...'.cyan, '[Ctrl+C to quite]'.gray);
if (watching) {
console.info('\n- still watching...'.cyan);
} else {
watching = true;
console.info('- watching assets for changes...'.cyan, '[Ctrl+C to quite]'.gray);
}
} else {
return resolve();
}
Expand Down
3 changes: 3 additions & 0 deletions lib/automation/webpack/config.yves.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ module.exports = {
output: {
path: path.join(cwd, './public/Yves/assets/unknown-theme')
},
watchOptions: {
poll: true
},
plugins: [],
progress: true,
failOnError: false,
Expand Down
52 changes: 2 additions & 50 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ let errors = require('./errors');
let install = require('./install');
let test = require('./test');
let automation = require('./automation');
// let licenses = require('./licenses');
let provider = require('./provider');
let pkg = require('../package.json');
let cwd = process.cwd();
let start = new Date().getTime();
Expand Down Expand Up @@ -104,13 +102,9 @@ function runAutomation(target, options) {
console.info('- watch:'.grey, `${context.has('watch')}`.cyan);

if (context.has('debug')) {
automationPromise = test.full().then(() => {
return automation.run();
});
automationPromise = test.full().then(() => automation.run());
} else {
automationPromise = test.base().then(() => {
return automation.run();
});
automationPromise = test.base().then(() => automation.run());
}

automationPromise.then(() => {
Expand All @@ -120,29 +114,6 @@ function runAutomation(target, options) {
});
}

// function runLicensesCrawler(options) {
// context.init('licenses', options);

// if (!context.isLicensesPrinting()) {
// printInfo();
// console.info('\nLicenses'.bold.gray);
// console.info('Search for external modules licenses'.gray);
// console.info('-'.gray, 'green'.green, 'is for found and declared licenses'.gray);
// console.info('-'.gray, 'yellow'.yellow, 'is for found but not declared licenses, or viceversa'.gray);
// console.info('-'.gray, 'red'.red, 'is for unknown licenses\n'.gray);
// }

// licenses.find().then(() => {
// if (context.isLicensesPrinting()) {
// return exit(0);
// }

// return exitAndLog();
// }).catch((err) => {
// return exitAndLog(errors.log('licenses', err));
// });
// }

function runProvider(options) {
context.init('provider', options);

Expand Down Expand Up @@ -179,25 +150,6 @@ commander
.option('--production', 'enable the production mode')
.action(runAutomation);

// commander
// .command('licenses')
// .description('Crowl through the project and output all npm modules licenses')
// .option('-m, --manifest', 'export the license manifest content (where available)')
// .option('-j, --json', 'output a json formatted list of licenses')
// .option('-c, --csv', 'output a csv formatted table of licenses')
// .option('-s, --separator', 'define the csv separator char (default is ;)')
// .action(runLicensesCrawler)
// .on('--help', () => {
// console.log(` Follow these tips if you want to to write licenses into a file:`, '\n');
// console.log(` $ antelope licenses --json > json_filename.json`);
// console.log(` $ antelope licenses --manifest --csv > csv_filename.csv`, '\n');
// });

// commander
// .command('provider')
// .description('Output all the modules Antelope provide internally')
// .action(runProvider);

module.exports = {
init: () => {
if (process.argv.length < 3) {
Expand Down
4 changes: 0 additions & 4 deletions lib/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
let R = require('ramda');

let errors = {
licenses: {
name: 'License crawler error',
description: 'Something went wrong during licenses crawl'
},
test: {
name: 'Test error'
},
Expand Down
126 changes: 0 additions & 126 deletions lib/licenses.js

This file was deleted.

18 changes: 0 additions & 18 deletions lib/provider.js

This file was deleted.

8 changes: 4 additions & 4 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

'use strict';

// let manifestTest = require('./test/manifest');
// let dependencyTest = require('./test/dependency');
let projectTest = require('./test/project');
let collectorTest = require('./test/collector');

module.exports = {
base: () => {
return Promise.resolve();
return projectTest.run();
},
full: () => {
return collectorTest.run();
return projectTest.run()
.then(collectorTest.run);
}
};
33 changes: 0 additions & 33 deletions lib/test/manifest.js

This file was deleted.

Loading

0 comments on commit a8cb1d4

Please sign in to comment.