Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async modularized #984

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e4dc19d
Add .editorconfig
Kikobeats Dec 15, 2015
38f947c
Add .DS_Store
Kikobeats Dec 15, 2015
1ef1b43
Merge branch 'editorconfig' into moduralized
Kikobeats Dec 15, 2015
bc3a9a5
Extract util methods
Kikobeats Dec 15, 2015
0721125
Fix createTester callback
Kikobeats Dec 15, 2015
82d184f
Fix notid exports
Kikobeats Dec 15, 2015
2201ac6
Refactor settimediate and nexttick
Kikobeats Dec 15, 2015
971ba4b
Fix dep path
Kikobeats Dec 16, 2015
7500299
Create bundle using browserify
Kikobeats Dec 16, 2015
3a3376d
Rename main file
Kikobeats Dec 16, 2015
d7d857a
Rename main file
Kikobeats Dec 16, 2015
1e28e33
Rename main file
Kikobeats Dec 16, 2015
8b4f0f6
Use browserify standalone mode
Kikobeats Dec 16, 2015
554a827
Modular interface for main methods 📦
Kikobeats Dec 18, 2015
8566337
Deleted unnecessary test
Kikobeats Dec 18, 2015
956af27
Add script to generate modules package.json
Kikobeats Dec 18, 2015
61c9680
Delete noconflict module
Kikobeats Dec 19, 2015
a5dbf50
Improve how to generat browser bundle
Kikobeats Dec 19, 2015
dee5e38
Update util modules references
Kikobeats Dec 19, 2015
4e40f81
Add a way to generate module scaffold
Kikobeats Dec 19, 2015
17e9f8c
Fix version
Kikobeats Dec 19, 2015
4a5db3f
Remove unnecessary dependencies
Kikobeats Dec 19, 2015
c841c20
Require the dependency
Kikobeats Dec 19, 2015
35f1956
Add missing methods
Kikobeats Dec 19, 2015
2b5825e
Add dependencies for each module
Kikobeats Dec 19, 2015
54dfc63
Bumped 0.4.0
Kikobeats Dec 19, 2015
89d1818
Add useful scripts
Kikobeats Dec 19, 2015
9122206
Add .npmignore
Kikobeats Dec 19, 2015
1253f7d
Updated
Kikobeats Dec 19, 2015
112fb0b
Add npmignore files
Kikobeats Dec 19, 2015
7f322e6
Refactor
Kikobeats Dec 19, 2015
ec0472c
Fix little issues
Kikobeats Dec 19, 2015
2375778
Fix library name
Kikobeats Dec 20, 2015
27c91ed
Fix isarray module
Kikobeats Dec 20, 2015
806657d
Update script
Kikobeats Dec 20, 2015
dd2be60
Fix typo
Kikobeats Dec 20, 2015
4829423
Fix template links
Kikobeats Dec 20, 2015
69da88a
Update deps
Kikobeats Dec 20, 2015
112a382
Fix template links
Kikobeats Dec 20, 2015
31a66a2
Upgrade deps
Kikobeats Dec 20, 2015
e7a3fcc
Revert "Fix template links"
Kikobeats Dec 20, 2015
b645991
Fix template links
Kikobeats Dec 20, 2015
1373ab9
Bump 0.5.1
Kikobeats Dec 20, 2015
df73f3a
Merge branch 'moduralized' of github.com:Kikobeats/async into modural…
Kikobeats Dec 20, 2015
c9cd0b9
Fix mapseries reference
Kikobeats Dec 20, 2015
7069d9e
Bump 0.5.2
Kikobeats Dec 20, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .editorconfig
@@ -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
Expand Up @@ -4,3 +4,5 @@ perf/versions
nyc_output
coverage
*.log
.DS_Store
npm-debug.log
4 changes: 4 additions & 0 deletions .npmignore
@@ -0,0 +1,4 @@
lib
scripts
support/dependencies.json
support/module_template.md
6 changes: 4 additions & 2 deletions Makefile
@@ -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
@@ -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
@@ -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
@@ -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
@@ -0,0 +1,3 @@
{
"validateIndentation": 4
}
29 changes: 29 additions & 0 deletions lib/apply/.jshintrc
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -0,0 +1,3 @@
{
"validateIndentation": 4
}
29 changes: 29 additions & 0 deletions lib/applyeach/.jshintrc
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -0,0 +1,3 @@
{
"validateIndentation": 4
}
29 changes: 29 additions & 0 deletions lib/applyeachseries/.jshintrc
@@ -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
@@ -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)