Skip to content

Commit

Permalink
Initial work in progress - modularization
Browse files Browse the repository at this point in the history
Add .DS_Store

Extract util methods

Fix createTester callback

Fix notid exports

Refactor settimediate and nexttick

Fix dep path

Create bundle using browserify

Rename main file

Rename main file

Rename main file

Use browserify standalone mode

Modular interface for main methods 📦

Deleted unnecessary test

Add script to generate modules package.json

Delete noconflict module

Improve how to generat browser bundle

Update util modules references

Add a way to generate module scaffold

Fix version

Remove unnecessary dependencies

Require the dependency

Add missing methods

Add dependencies for each module

Bumped 0.4.0

Add useful scripts

Add .npmignore

Updated

Add npmignore files

Refactor

Fix little issues

Fix library name

Fix isarray module

Update script

Fix typo

Fix template links

Update deps

Revert "Fix template links"

This reverts commit 112a382.

Bump 0.5.1

Fix mapseries reference

Bump 0.5.2
  • Loading branch information
Kikobeats authored and megawac committed Dec 29, 2015
1 parent b9cc289 commit 7127b67
Show file tree
Hide file tree
Showing 453 changed files with 6,747 additions and 1,328 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ perf/versions
nyc_output
coverage
*.log
.DS_Store
npm-debug.log
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lib
scripts
support/dependencies.json
support/module_template.md
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
export PATH := ./node_modules/.bin/:$(PATH):./bin/

PACKAGE = asyncjs
REQUIRE_NAME = async
XYZ = node_modules/.bin/xyz --repo git@github.com:caolan/async.git
BROWSERIFY = node_modules/.bin/browserify

BUILDDIR = dist
SRC = lib/async.js
SRC = lib/index.js

all: lint test clean build

build: $(wildcard lib/*.js)
mkdir -p $(BUILDDIR)
cp $(SRC) $(BUILDDIR)/async.js
browserify $(SRC) -o $(BUILDDIR)/async.js -s $(REQUIRE_NAME)
uglifyjs $(BUILDDIR)/async.js -mc \
--source-map $(BUILDDIR)/async.min.map \
-o $(BUILDDIR)/async.min.js
Expand Down
88 changes: 88 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
'use strict';

var gulp = require('gulp');
var path = require('path');
var fs = require('fs-extra');
var pkg = require('./package.json');
var jsonFuture = require('json-future');
var template = require('lodash.template');

var moduleDeps = JSON.parse(template(fs.readFileSync('./support/dependencies.json').toString())({
version: pkg.version}
));

var MODULES_PATH = './lib/';

function getFolders(dir) {
return fs.readdirSync(dir)
.filter(function(file) {
return fs.statSync(path.join(dir, file)).isDirectory();
});
}

function generatePackage(name) {
function generateKeywords(name) {
var keywords = [
'async',
'async-modularized'
];

keywords.push(name);
return keywords;
}

function generateDefaultFields(name) {
var ORIGINAL_FIELDS = [
'author',
'version',
'repository',
'license'
];

var structure = {
name: 'async.' + name,
description: 'async ' + name + 'method as module.',
main: './index.js',
repository: "async-js/async." + name
};

ORIGINAL_FIELDS.forEach(function(field) {
structure[field] = pkg[field];
});

if (Object.keys(moduleDeps[name]).length > 0)
structure.dependencies = moduleDeps[name];

return structure;
}

var modulePackage = generateDefaultFields(name);
modulePackage.keywords = generateKeywords(name);
return modulePackage;
}

function generateReadme(name, dist) {
var filepath = path.resolve('support/module_template.md');
var tpl = fs.readFileSync(filepath).toString();
tpl = template(tpl)({name: name});
fs.writeFileSync(dist, tpl);
}

function copyMetaFiles(dist) {
var files = ['.editorconfig', '.jscsrc', '.jshintrc', '.gitignore'];

files.forEach(function(file) {
var metafile = path.resolve(file);
var distFile = path.resolve(dist, file);
fs.copySync(metafile, distFile);
});
}

gulp.task('package', function() {
return getFolders(MODULES_PATH).map(function(module) {
var dist = path.resolve(MODULES_PATH, module);
jsonFuture.save(path.resolve(dist, 'package.json'), generatePackage(module));
generateReadme(module, path.resolve(dist, 'README.md'));
copyMetaFiles(dist);
});
});
10 changes: 10 additions & 0 deletions lib/apply/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
8 changes: 8 additions & 0 deletions lib/apply/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
dist
perf/versions
nyc_output
coverage
*.log
.DS_Store
npm-debug.log
3 changes: 3 additions & 0 deletions lib/apply/.jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"validateIndentation": 4
}
29 changes: 29 additions & 0 deletions lib/apply/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// Enforcing options
"eqeqeq": false,
"forin": true,
"indent": 4,
"noarg": true,
"undef": true,
"unused": true,
"trailing": true,
"evil": true,
"laxcomma": true,

// Relaxing options
"onevar": false,
"asi": false,
"eqnull": true,
"expr": false,
"loopfunc": true,
"sub": true,
"browser": true,
"node": true,
"globals": {
"self": true,
"define": true,
"describe": true,
"context": true,
"it": true
}
}
13 changes: 13 additions & 0 deletions lib/apply/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# async.apply

![Last version](https://img.shields.io/github/tag/async-js/async.apply.svg?style=flat-square)
[![Dependency status](http://img.shields.io/david/async-js/async.apply.svg?style=flat-square)](https://david-dm.org/async-js/async.apply)
[![Dev Dependencies Status](http://img.shields.io/david/dev/async-js/async.apply.svg?style=flat-square)](https://david-dm.org/async-js/async.apply#info=devDependencies)
[![NPM Status](http://img.shields.io/npm/dm/async.apply.svg?style=flat-square)](https://www.npmjs.org/package/async.apply)
[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square)](https://paypal.me/kikobeats)

> [async#apply](https://github.com/async-js/async#async.apply) method as module.
## License

MIT © [async-js](https://github.com/async-js)
9 changes: 9 additions & 0 deletions lib/apply/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

var restParam = require('async.util.restparam');

module.exports = restParam(function(fn, args) {
return restParam(function(callArgs) {
return fn.apply(null, args.concat(callArgs));
});
});
20 changes: 20 additions & 0 deletions lib/apply/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "async.apply",
"description": "async applymethod as module.",
"main": "./index.js",
"repository": {
"type": "git",
"url": "https://github.com/caolan/async.git"
},
"author": "Caolan McMahon",
"version": "0.5.2",
"license": "MIT",
"dependencies": {
"async.util.restparam": "0.5.2"
},
"keywords": [
"async",
"async-modularized",
"apply"
]
}
10 changes: 10 additions & 0 deletions lib/applyeach/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
8 changes: 8 additions & 0 deletions lib/applyeach/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
dist
perf/versions
nyc_output
coverage
*.log
.DS_Store
npm-debug.log
3 changes: 3 additions & 0 deletions lib/applyeach/.jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"validateIndentation": 4
}
29 changes: 29 additions & 0 deletions lib/applyeach/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// Enforcing options
"eqeqeq": false,
"forin": true,
"indent": 4,
"noarg": true,
"undef": true,
"unused": true,
"trailing": true,
"evil": true,
"laxcomma": true,

// Relaxing options
"onevar": false,
"asi": false,
"eqnull": true,
"expr": false,
"loopfunc": true,
"sub": true,
"browser": true,
"node": true,
"globals": {
"self": true,
"define": true,
"describe": true,
"context": true,
"it": true
}
}
13 changes: 13 additions & 0 deletions lib/applyeach/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# async.applyeach

![Last version](https://img.shields.io/github/tag/async-js/async.applyeach.svg?style=flat-square)
[![Dependency status](http://img.shields.io/david/async-js/async.applyeach.svg?style=flat-square)](https://david-dm.org/async-js/async.applyeach)
[![Dev Dependencies Status](http://img.shields.io/david/dev/async-js/async.applyeach.svg?style=flat-square)](https://david-dm.org/async-js/async.applyeach#info=devDependencies)
[![NPM Status](http://img.shields.io/npm/dm/async.applyeach.svg?style=flat-square)](https://www.npmjs.org/package/async.applyeach)
[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square)](https://paypal.me/kikobeats)

> [async#applyeach](https://github.com/async-js/async#async.applyeach) method as module.
## License

MIT © [async-js](https://github.com/async-js)
6 changes: 6 additions & 0 deletions lib/applyeach/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

var eachOf = require('async.eachof');
var applyEach = require('async.util.applyeach');

module.exports = applyEach(eachOf);
21 changes: 21 additions & 0 deletions lib/applyeach/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "async.applyeach",
"description": "async applyeachmethod as module.",
"main": "./index.js",
"repository": {
"type": "git",
"url": "https://github.com/caolan/async.git"
},
"author": "Caolan McMahon",
"version": "0.5.2",
"license": "MIT",
"dependencies": {
"async.eachof": "0.5.2",
"async.util.applyeach": "0.5.2"
},
"keywords": [
"async",
"async-modularized",
"applyeach"
]
}
10 changes: 10 additions & 0 deletions lib/applyeachseries/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
8 changes: 8 additions & 0 deletions lib/applyeachseries/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
dist
perf/versions
nyc_output
coverage
*.log
.DS_Store
npm-debug.log
3 changes: 3 additions & 0 deletions lib/applyeachseries/.jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"validateIndentation": 4
}
29 changes: 29 additions & 0 deletions lib/applyeachseries/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// Enforcing options
"eqeqeq": false,
"forin": true,
"indent": 4,
"noarg": true,
"undef": true,
"unused": true,
"trailing": true,
"evil": true,
"laxcomma": true,

// Relaxing options
"onevar": false,
"asi": false,
"eqnull": true,
"expr": false,
"loopfunc": true,
"sub": true,
"browser": true,
"node": true,
"globals": {
"self": true,
"define": true,
"describe": true,
"context": true,
"it": true
}
}
13 changes: 13 additions & 0 deletions lib/applyeachseries/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# async.applyeachseries

![Last version](https://img.shields.io/github/tag/async-js/async.applyeachseries.svg?style=flat-square)
[![Dependency status](http://img.shields.io/david/async-js/async.applyeachseries.svg?style=flat-square)](https://david-dm.org/async-js/async.applyeachseries)
[![Dev Dependencies Status](http://img.shields.io/david/dev/async-js/async.applyeachseries.svg?style=flat-square)](https://david-dm.org/async-js/async.applyeachseries#info=devDependencies)
[![NPM Status](http://img.shields.io/npm/dm/async.applyeachseries.svg?style=flat-square)](https://www.npmjs.org/package/async.applyeachseries)
[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square)](https://paypal.me/kikobeats)

> [async#applyeachseries](https://github.com/async-js/async#async.applyeachseries) method as module.
## License

MIT © [async-js](https://github.com/async-js)

0 comments on commit 7127b67

Please sign in to comment.