Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e62147d
Checkpoint - Updated README.md with github stars badge.
kuakman Feb 27, 2017
8e29849
Updated Badges.
kuakman Feb 27, 2017
c8e87ab
util: Checkpoint - Updated package.json scripts for release.
kuakman Feb 27, 2017
6877b88
util: checkpoint - Fixed Code Coverage Bug by using nyc dependency an…
kuakman Mar 1, 2017
694b6f5
util: checkpoint - added more unit test coverage on commands.util.adt…
kuakman Mar 2, 2017
0e31b9e
util: checkpoint - Completed Unit Test coverage on commands.util.adt.…
kuakman Mar 2, 2017
591d2aa
util: checkpoint - Added Unit Test Coverage on commands.util.adt.Queu…
kuakman Mar 3, 2017
dfeeb58
util: checkpoint - added unit test coverage for commands.util.mixins.…
kuakman Mar 3, 2017
dfd7048
util: checkpoint - Added implementation for commands.util.adt.QueueAs…
kuakman Mar 4, 2017
1974ea3
util: checkpoint - added unit test coverage to commands.util.adt.Queu…
kuakman Mar 5, 2017
cbbca47
util: checkpoint - Added unit test coverage to commands.util.adt.Stac…
kuakman Mar 5, 2017
ae2af98
util: checkpoint - Added commands.util.logger.Logger initial implemen…
kuakman Mar 6, 2017
537dc66
util: checkpoint - Added Validation rules per log levels (output = de…
kuakman Mar 6, 2017
cac44f1
util: checkpoint - Quick fixes on commands.util.logger.Logger#_valida…
kuakman Mar 6, 2017
603f0db
util: checkpoint - Added implementation for logging out to standard o…
kuakman Mar 6, 2017
2c19d75
util: checkpoint - Added commands.util.commander.Commander. Updated R…
kuakman Mar 8, 2017
fa220c8
util: checkpoint - Added unit test coverage for commands.util.factory…
kuakman Mar 9, 2017
998feca
util: checkpoint - added unit test coverage to commands.util.visitor …
kuakman Mar 10, 2017
31beb95
Merge pull request #10 from nahuelio/util
kuakman Mar 10, 2017
a064f21
cli: checkpoint - Refactores Visitor pattern to decorate commands.bin…
kuakman Mar 12, 2017
77bb6ad
cli: checkpoint - Refactored visitors into commands.visitors package …
kuakman Mar 12, 2017
413a5b8
cli: checkpoint - Main folder refactor. Progress on CLI wiring.
kuakman Mar 13, 2017
232e5ba
cli: checkpoint - progress on visitors.Commander. Yargs commands were…
kuakman Mar 14, 2017
76be995
cli: checkpoint - visitors.Commander implementation completed. Progre…
kuakman Mar 14, 2017
f8bce9b
cli: checkpoint - Progress on visitors.configuration.Local and Remote.
kuakman Mar 15, 2017
71108b6
cli: checkpoint - Completed Implementation for visitors.configuration…
kuakman Mar 15, 2017
6922457
cli: checkpoint - Bumped up mocha timeout to 2000 millisecons. Square…
kuakman Mar 15, 2017
37002c3
cli: checkpoint - Completed Initial implementation of configuration p…
kuakman Mar 15, 2017
63fee61
cli: checkpoint - Added Exclude configuration option for scanning sou…
kuakman Mar 17, 2017
1817aa5
cli: checkpoint - Change Implementation of util.visitor.Visitor#visit…
kuakman Mar 18, 2017
44aa89c
cli: checkpoint - Brokedown commander yargs methods into decorator he…
kuakman Mar 18, 2017
9be9603
cli: checkpoint - Added unit test coverage to visitors.Commander.
kuakman Mar 20, 2017
9a4475a
cli: checkpoint - Progress on adding unit test coverage for visitors.…
kuakman Mar 20, 2017
2a88925
cli: checkpoint - Added unit test coverage to visitors.Configuration.…
kuakman Mar 21, 2017
e199b79
cli: checkpoint - added unit test coverage to visitors.configuration.…
kuakman Mar 22, 2017
accf9c7
cli: checkpoint - fixed unit test cases on visitors.configuration.Loc…
kuakman Mar 22, 2017
f969d6c
cli: checkpoint - Added unit test coverage to visitors.configuration.…
kuakman Mar 25, 2017
85d538f
cli: checkpoint - Added unit test coverage to visitors.commander Help…
kuakman Mar 26, 2017
4c55a7f
cli: checkpoint - Setup Unit Tests for visitors.configuration.formatt…
kuakman Mar 26, 2017
919284e
cli: checkpoint - Added unit test coverage to visitors.configuration.…
kuakman Mar 26, 2017
4a6766c
Merge pull request #13 from nahuelio/cli
kuakman Mar 26, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,21 @@
"presets": ["es2015", "stage-2"],
"plugins": [
["module-resolver", {
"root": ["./src"],
"alias": { "commands": "./commands" }
"root": ["./lib"],
"alias": {
"bin": "bin",
"bundle": "bundle",
"clean": "clean",
"help": "help",
"util": "util",
"visitors": "visitors",
"visualize": "visualize"
}
}]
]
],
"env": {
"test": {
"plugins": ["istanbul"]
}
}
}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Project
/bin
lib
.nyc_output
coverage
node_modules

Expand Down
1 change: 1 addition & 0 deletions .istanbul.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
instrumentation:
root: src
include-all-sources: true
extensions:
- .es6
- .js
11 changes: 0 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
## Rinoa v1.0.0 - ROADMAP

##### Features:
* [ ] Esprima ES6 AST Parsing
* [ ] Imports / Exports
* [ ] Annotations
* [ ] Output formats
* [ ] UMD (Global, AMD, CommonJS)
* [ ] AMD
* [ ] CommonJS
* [ ] ES
* [ ] Multiple Bundles
39 changes: 33 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,58 @@

[![Build Status](https://travis-ci.org/nahuelio/squarebox.svg?branch=master)](https://travis-ci.org/nahuelio/squarebox)
[![Coverage Status](https://coveralls.io/repos/github/nahuelio/squarebox/badge.svg)](https://coveralls.io/github/nahuelio/squarebox)
[![Version](https://img.shields.io/badge/Version-1.0.0-blue.svg?style=flat)]()
[![Version](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](http://www.opensource.org/licenses/mit-license.php)
[![GitHub stars](https://img.shields.io/github/stars/nahuelio/squarebox.svg?style=social&label=Stars)]()

#### Introduction

Experimental ES6/CommonJS/AMD Module Bundler

#### Installation

```npm install [-g] squarebox```

#### Usage

CLI Commands

```
Badges
global option: -c (sqbox.js|.sqboxrc|URL) | Default: ./.sqboxrc
contextual help - sqbox [command] help

* sqbox help - global help (list of commands and general usage)
* sbox bundle --options
* sbox clean
* sbox visualize
```

#### Introduction
Programmatic API

```
TODO
const sqbox = require('squarebox');
sqbox.clean([opts])
.bundle([config])
.visualize([opts]);
```

#### Installation
#### Official Documentation

```
TODO
```

#### Usage
#### Configuration

```
TODO
```

#### Contribute

```
TODO
```

Built with :heart: by [NahuelIO](http://nahuel.io) - [MIT License](http://www.opensource.org/licenses/mit-license.php)
[![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://nahuel.io)
by [Nahuel IO](http://nahuel.io)
22 changes: 22 additions & 0 deletions bin/sqbox
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env node

require('babel-register')({
"presets": ["es2015", "stage-2"],
"plugins": [
["module-resolver", {
"root": ["../"],
"cwd": __dirname,
"alias": {
"bin": "bin",
"bundle": "bundle",
"clean": "clean",
"help": "help",
"util": "util",
"visitors": "visitors",
"visualize": "visualize"
}
}]
]
});
require('babel-polyfill');
require('commands/bin/sqbox').run(__dirname);
49 changes: 49 additions & 0 deletions lib/bin/commands.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[{
"name": "help",
"aliases": ["help"],
"description": "Help",
"path": "help/help",
"options": {
"clean": {},
"bundle": {},
"graph": {}
}
}, {
"name": "clean",
"aliases": ["clean"],
"description": "Clean output directory",
"path": "clean/clean",
"options": {
"override": { "default": false },
"config": { "default": ".sqboxrc" },
"url": {},
"target": { "default": "./dist" }
}
}, {
"name": "bundle",
"aliases": ["bundle"],
"description": "Module Bundler",
"path": "bundle/bundle",
"options": {
"override": { "default": false },
"config": { "default": ".sqboxrc" },
"url": { "alias": "u" },
"scan": { "alias": "s", "default": "." },
"exclude": { "alias": "x" },
"extensions": { "alias": "e", "default": ".js,.jsx,.es6,.es" },
"alias": { "alias": "a", "default": {} },
"target": { "alias": "t", "default": "dist>umd:./dist" },
"logLevel": { "alias": "lv", "default": "output" }
}
}, {
"name": "graph",
"aliases": ["graph"],
"description": "Generates a graphical representation of your bundles",
"path": "visualize/graph",
"options": {
"override": { "default": false },
"config": { "default": ".sqboxrc" },
"url": {},
"target": { "default": "./dist" }
}
}]
152 changes: 152 additions & 0 deletions lib/bin/sqbox.es6
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/**
* @module bin
* @author Patricio Ferreira <3dimentionar@gmail.com>
**/
import 'util/mixins';
import extend from 'extend';
import Collection from 'util/adt/collection';
import Factory from 'util/factory/factory';
import Command from 'command';
import CommandsList from './commands.json';
import logger from 'util/logger/logger';

let enforcer = Symbol('SquareBox');

/**
* Class SquareBox
* @extends {Command}
*
* @uses {bin.visitor.Commander}
**/
class SquareBox extends Command {

/**
* Constructor
* @public
* @param {Object} [args = {}] - Constructor arguments
* @return {bin.SquareBox}
**/
constructor(...args) {
super(...args);
return SquareBox.isPrivate(this.attachEvents());
}

/**
* Attaches Events
* @public
* @return {bin.SquareBox}
**/
attachEvents() {
this.once(SquareBox.events.done, this.after);
return this;
}

/**
* Before Run
* @public
* @override
* @return {bin.SquareBox}
**/
before() {
super.before();
this.commander.read();
return this;
}

/**
* Run
* @public
* @override
* @return {bin.SquareBox}
**/
run() {
this.before();
this.configuration.parse().then(_.bind(this.onConfiguration, this));
return this;
}

/**
* Configuration Loaded and Parsed Handler
* @public
* @param {visitors.Configuration} configuration - configuration visitor reference
* @return {bin.SquareBox}
**/
onConfiguration() {
const { path } = this.options;
//console.log(_.pick(this, Command.options));
// TODO: Factory.get(path, this.params()).run();
return this;
}

/**
* Constructor Validation
* @public
* @throws {Error} Private violation
* @param {Symbol} pte - constructor enforcer
* @return {bin.SquareBox}
**/
isPrivate(pte) {
if(!_.isEqual(pte, enforcer)) throw new Error('Private Violation');
return this;
}

/**
* Register Command Factories
* @public
* @override
* @return {bin.SquareBox}
**/
register() {
super.register();
Factory.registerAll(this.constructor.commands);
return this;
}

/**
* Available Commands
* @static
* @type {util.adt.Collection}
**/
static commands = Collection.new(CommandsList);

/**
* SquareBox visitors
* @static
* @override
* @type {Array}
**/
static visitors = [
'visitors/commander',
'visitors/configuration'
].concat(Command.visitors);

/**
* Static enforcer validation
* @static
* @param {bin.SquareBox} instance - squarebox instance reference
* @return {bin.SquareBox}
**/
static isPrivate(instance) {
return instance.isPrivate(enforcer);
}

/**
* Command options
* @static
* @type {Array}
**/
static options = Command.options.concat(['options']);

/**
* Static Run
* @static
* @param {String} [cwd = process.cwd()] - base path
* @return {bin.SquareBox}
**/
static run(cwd = process.cwd()) {
return this.new({ cwd }).run();
}

}

export default SquareBox;
29 changes: 29 additions & 0 deletions lib/bundle/bundle.es6
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* @module bundle
* @author Patricio Ferreira <3dimentionar@gmail.com>
**/
import _ from 'underscore';
import extend from 'extend';
import Command from 'command';

/**
* Class Bundle
* @extends {Command}
**/
class Bundle extends Command {

/**
* Run
* @public
* @override
* @return {bundle.Bundle}
**/
run() {
// TODO
console.log('Bundle.run()...');
return super.run();
}

}

export default Bundle;
Loading