gengojs-core-modules
Advanced tools
Comparing version 1.3.0 to 2.0.0
@@ -0,1 +1,11 @@ | ||
1.3.0 / 2015-08-31 | ||
================== | ||
* Update | ||
Bumped version for previous fix. | ||
* Merge pull request [#4](https://github.com/iwatakeshi/gengojs-core-modules/issues/4) from iwatakeshi/fix-undefined-functions | ||
Fix | ||
* Fix | ||
Fixed undefined functions when initializing plugins. | ||
1.2.0 / 2015-08-31 | ||
@@ -2,0 +12,0 @@ ================== |
@@ -1,12 +0,37 @@ | ||
var gulp = require("gulp"); | ||
var sourcemaps = require("gulp-sourcemaps"); | ||
var babel = require("gulp-babel"); | ||
var dest = require('gulp-dest'); | ||
var mocha = require('gulp-mocha'); | ||
var jshint = require('gulp-jshint'); | ||
var changelog = require('gulp-changelog'); | ||
var | ||
gulp = require("gulp"), | ||
sourcemaps = require("gulp-sourcemaps"), | ||
babel = require("gulp-babel"), | ||
mocha = require('gulp-mocha'), | ||
jshint = require('gulp-jshint'), | ||
pages = require('gulp-gh-pages'), | ||
rimraf = require('rimraf'), | ||
beautify = require('gulp-jsbeautify'), | ||
shell = require('gulp-shell'), | ||
changelog = require('gulp-changelog'), | ||
config = require('./config.json'); | ||
gulp.task("lib:entry", function () { | ||
/** Backs up the files in case of emergency! */ | ||
gulp.task('backup', function () { | ||
return gulp | ||
.src('lib/**/**/*.js') | ||
.pipe(gulp.dest('./.backup')); | ||
}); | ||
gulp.task('recover', function () { | ||
return gulp | ||
.src('./.backup/**/**/*.js') | ||
.pipe(gulp.dest('lib/')); | ||
}); | ||
/* Formats the files */ | ||
gulp.task('beautify', ['backup'], function () { | ||
return gulp.src('./lib/**/**/*.js') | ||
.pipe(jshint()) | ||
.pipe(beautify(config.beautify)) | ||
.pipe(gulp.dest('./lib')); | ||
}); | ||
gulp.task("lib", ['beautify'], function () { | ||
return gulp.src('./lib/**/**/*.js') | ||
.pipe(jshint(config.jshint)) | ||
.pipe(jshint.reporter('jshint-stylish')) | ||
@@ -23,5 +48,5 @@ .pipe(jshint.reporter('fail')) | ||
gulp.task('watch', function () { | ||
return gulp.watch('./lib/**/*.*', ['lib:entry']); | ||
return gulp.watch('./lib/**/*.*', ['lib']); | ||
}); | ||
gulp.task('test', ['lib:entry'], function() { | ||
gulp.task('test', ['lib'], function() { | ||
return gulp.src('./tests/**/**/*.js', {read: false}) | ||
@@ -32,2 +57,26 @@ // gulp-mocha needs filepaths so you can't have any plugins before it | ||
/* | ||
* Runs the doxx command and builds the docs | ||
* Install other themes here, generate docs for each. | ||
*/ | ||
gulp.task('doc', ['build'], shell.task([ | ||
(function(){ | ||
var doc = 'node_modules/mr-doc/bin/mr-doc', | ||
cmd = { | ||
source: ' -s lib/', | ||
output: ' -o docs/', | ||
name:' -n "gengo.js/core/modules"', | ||
theme:' -t cayman' | ||
}; | ||
return doc + cmd.source + cmd.output + cmd.name + cmd.theme; | ||
})() | ||
])); | ||
/* | ||
* Clean the docs themes folder | ||
*/ | ||
gulp.task('clean:docs', ['gh-pages'], function (cb) { | ||
rimraf('./docs/', cb); | ||
}); | ||
gulp.task('changelog', function(cb){ | ||
@@ -39,4 +88,19 @@ changelog(require('./package.json')).then(function(stream){ | ||
gulp.task("default", ['lib:entry','changelog','watch']); | ||
/* | ||
* Create the gh-pages branch - wont push automatically | ||
*/ | ||
gulp.task('gh-pages', ['doc'], function () { | ||
return gulp.src('./docs/**/*') | ||
.pipe(pages()); | ||
}); | ||
gulp.task('build', ['lib:entry','changelog','test']); | ||
gulp.task('clean:backup', ['gh-pages'], function (cb) { | ||
rimraf('.backup/', cb); | ||
}); | ||
gulp.task("default", ['backup','lib','changelog','watch']); | ||
gulp.task('build', ['backup','lib','changelog','test']); | ||
gulp.task('docs', ['build', 'doc', 'gh-pages', 'clean:docs', 'clean:backup']); |
@@ -5,3 +5,9 @@ import inputify from './inputify'; | ||
import servify from './servify'; | ||
export default {inputify, optify, plugify, servify}; | ||
import extractify from './extractify'; | ||
/** | ||
* This module exports all classes | ||
* @module | ||
*/ | ||
export default { | ||
inputify, optify, plugify, servify, extractify | ||
}; |
@@ -25,4 +25,14 @@ 'use strict'; | ||
exports['default'] = { inputify: _inputify2['default'], optify: _optify2['default'], plugify: _plugify2['default'], servify: _servify2['default'] }; | ||
var _extractify = require('./extractify'); | ||
var _extractify2 = _interopRequireDefault(_extractify); | ||
/** | ||
* This module exports all classes | ||
* @module | ||
*/ | ||
exports['default'] = { | ||
inputify: _inputify2['default'], optify: _optify2['default'], plugify: _plugify2['default'], servify: _servify2['default'], extractify: _extractify2['default'] | ||
}; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=../source maps/modules/index.js.map | ||
//# sourceMappingURL=../source maps/modules/index.js.map |
{ | ||
"name": "gengojs-core-modules", | ||
"version": "1.3.0", | ||
"version": "2.0.0", | ||
"description": "gengo.js core modules is a set of modules that helps the core to function properly.", | ||
@@ -11,7 +11,14 @@ "main": "./modules/index.js", | ||
"type": "git", | ||
"url": "git+https://github.com/iwatakeshi/gengojs-core-modules.git" | ||
"url": "git+https://github.com/gengojs/gengojs-core-modules.git" | ||
}, | ||
"keywords": [ | ||
"gengojs", | ||
"gengojs-core" | ||
"gengo.js", | ||
"gengojs-core", | ||
"i18n", | ||
"l10n", | ||
"internationalization", | ||
"international", | ||
"localize", | ||
"localization" | ||
], | ||
@@ -21,5 +28,5 @@ "author": "iwatakeshi", | ||
"bugs": { | ||
"url": "https://github.com/iwatakeshi/gengojs-core-modules/issues" | ||
"url": "https://github.com/gengojs/gengojs-core-modules/issues" | ||
}, | ||
"homepage": "https://github.com/iwatakeshi/gengojs-core-modules#readme", | ||
"homepage": "https://github.com/gengojs/gengojs-core-modules", | ||
"devDependencies": { | ||
@@ -32,6 +39,12 @@ "app-root-path": "^1.0.0", | ||
"gulp-dest": "^0.2.2", | ||
"gulp-gh-pages": "^0.5.2", | ||
"gulp-jsbeautify": "^0.1.1", | ||
"gulp-jshint": "^1.11.2", | ||
"gulp-mocha": "^2.1.3", | ||
"gulp-shell": "^0.4.3", | ||
"gulp-sourcemaps": "^1.5.2", | ||
"jshint-stylish": "^2.0.1" | ||
"jshint-stylish": "^2.0.1", | ||
"mr-doc": "git+https://github.com/mr-doc/mr-doc.git", | ||
"mr-doc-theme-cayman": "git+https://github.com/mr-doc/mr-doc-theme-cayman.git", | ||
"rimraf": "^2.4.3" | ||
}, | ||
@@ -38,0 +51,0 @@ "dependencies": { |
100
README.md
@@ -1,95 +0,15 @@ | ||
# gengojs-core-modules | ||
# gengo.js/core/modules | ||
[gengo.js](https://www.github.com/iwatakeshi/gengojs) core modules | ||
is a set of modules that helps the [core](https://www.github.com/iwatakeshi/gengojs-core) to function properly. | ||
[gengo.js](https://www.github.com/gengojs/gengojs) core modules | ||
is a set of modules that helps the [core](https://www.github.com/gengojs/core-modules) to function properly. | ||
[![Build Status](https://travis-ci.org/iwatakeshi/gengojs-core-modules.svg)](https://travis-ci.org/iwatakeshi/gengojs-core-modules) | ||
[![Build Status](https://travis-ci.org/gengojs/core-modules.svg)](https://travis-ci.org/gengojs/core-modules) | ||
## Classes | ||
## Usage | ||
### Inputify | ||
This module returns the phrase and the extracted arguments | ||
as an API for the parser plugin. | ||
`@example` | ||
```javascript | ||
import { inputify } from 'gengojs-modules' | ||
```bash | ||
$ npm install --save gengojs-core-modules | ||
``` | ||
#### API | ||
##### `phrase()` | ||
`@return {string}` The phrase to internationalize. | ||
`@example` | ||
```javascript | ||
let input = inputify(phrase, args); | ||
var phrase = input.phrase(); | ||
``` | ||
##### `arguments()` | ||
`@return {Array}` The original arguments before extraction. | ||
`@example` | ||
```javascript | ||
let input = inputify(phrase, args); | ||
var arguments = input.args(); | ||
``` | ||
##### `other()` | ||
`@return {object}` The other arguments after extraction in the form of | ||
an API. | ||
`@example` | ||
```javascript | ||
let input = inputify(phrase, args); | ||
let other = input.other(); | ||
var args = other.args(); | ||
var values = other.values(); | ||
``` | ||
### Optify | ||
This module reads or sets the initial options. | ||
`@example` | ||
```javascript | ||
import { optify } from 'gengojs-modules' | ||
``` | ||
#### Supported Extensions | ||
The supported extensions are: | ||
* `.js` (Javascript) | ||
* `.json` (JSON) | ||
* `.yml`, `.yaml` (YAML) | ||
### Plugify | ||
This module initializes the plugins. | ||
`@example` | ||
```javascript | ||
import { plugify } from 'gengojs-modules' | ||
``` | ||
### Servify | ||
This module detects the server and applies the API to the | ||
request and response objects | ||
`@example` | ||
```javascript | ||
import { servify } from 'gengojs-modules' | ||
``` | ||
## Documentation | ||
See [Documentation](https://gengojs.github.io/core-modules) | ||
## Develop | ||
@@ -107,2 +27,2 @@ | ||
gulp test | ||
``` | ||
``` |
@@ -1,84 +0,68 @@ | ||
/** global describe, it */ | ||
var assert = require('chai').assert; | ||
var __ = require('../../modules/inputify'); | ||
describe("Inputify", function() { | ||
describe("api", function() { | ||
var input = __('Hello', {greet:'hello'}); | ||
describe("phrase()", function() { | ||
it('should return a string', function() { | ||
assert.isFunction(input.phrase); | ||
assert.typeOf(input.phrase(), 'string'); | ||
}); | ||
describe("Inputify", function () { | ||
describe("api", function () { | ||
var input = __('Hello', { greet: 'hello' }); | ||
describe("phrase()", function () { | ||
it('should return a string', function () { | ||
assert.isFunction(input.phrase); | ||
assert.typeOf(input.phrase(), 'string'); | ||
}); | ||
describe("arguments()", function() { | ||
it('should return an array', function() { | ||
assert.isFunction(input.arguments); | ||
assert.typeOf(input.arguments(), 'array'); | ||
}); | ||
}); | ||
describe("arguments()", function () { | ||
it('should return an array', function () { | ||
assert.isFunction(input.arguments); | ||
assert.typeOf(input.arguments(), 'array'); | ||
assert.deepEqual(input.arguments(), []); | ||
}); | ||
describe("other()", function() { | ||
it('should return an object', function() { | ||
assert.isFunction(input.other); | ||
assert.typeOf(input.other(), 'object'); | ||
}); | ||
describe("values()", function() { | ||
it('should return an object', function(){ | ||
assert.isFunction(input.other().values); | ||
assert.typeOf(input.other().values(), 'object'); | ||
}); | ||
}); | ||
describe("args()", function () { | ||
it('should return an empty array', function(){ | ||
assert.isFunction(input.other().args); | ||
assert.typeOf(input.other().args(), 'array'); | ||
assert.deepEqual(input.other().args(), []); | ||
}); | ||
}); | ||
describe("hasArgs()", function() { | ||
it('should return a boolean', function() { | ||
assert.isFunction(input.other().hasArgs); | ||
assert.typeOf(input.other().hasArgs(), 'boolean'); | ||
assert.strictEqual(input.other().hasArgs(), false); | ||
}); | ||
}); | ||
describe("hasValues()", function() { | ||
it('should return a boolean', function() { | ||
assert.isFunction(input.other().hasValues); | ||
assert.typeOf(input.other().hasValues(), 'boolean'); | ||
assert.strictEqual(input.other().hasValues(), true); | ||
}); | ||
}); | ||
}); | ||
describe("values()", function () { | ||
it('should return an object', function () { | ||
assert.isFunction(input.values); | ||
assert.typeOf(input.values(), 'object'); | ||
}); | ||
}); | ||
describe("input", function() { | ||
describe("__('Hello')", function() { | ||
var input = __('Hello'); | ||
it('should return a phrase', function() { | ||
assert.strictEqual(input.phrase(), 'Hello'); | ||
}); | ||
}); | ||
describe("__('Hello', ['hello', 'world'])", function() { | ||
var input = __('Hello', ['hello', 'world']); | ||
it('should return a phrase and args', function() { | ||
assert.strictEqual(input.phrase(), 'Hello'); | ||
assert.deepEqual(input.other().args(), ['hello', 'world']); | ||
}); | ||
}); | ||
describe("__('Hello', {greet:'hello'})", function(){ | ||
var input = __('Hello', {greet:'hello'}); | ||
it('should return a phrase and values', function() { | ||
assert.deepEqual(input.other().values(), {greet:'hello'}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
describe("hasArgs()", function () { | ||
it('should return a boolean', function () { | ||
assert.isFunction(input.hasArgs); | ||
assert.typeOf(input.hasArgs(), 'boolean'); | ||
assert.strictEqual(input.hasArgs(), false); | ||
}); | ||
}); | ||
describe("hasValues()", function () { | ||
it('should return a boolean', function () { | ||
assert.isFunction(input.hasValues); | ||
assert.typeOf(input.hasValues(), 'boolean'); | ||
assert.strictEqual(input.hasValues(), true); | ||
}); | ||
}); | ||
}); | ||
describe("input", function () { | ||
describe("__('Hello')", function () { | ||
var input = __('Hello'); | ||
it('should return a phrase', function () { | ||
assert.strictEqual(input.phrase(), 'Hello'); | ||
}); | ||
}); | ||
describe("__('Hello', ['hello', 'world'])", function () { | ||
var input = __('Hello', ['hello', 'world']); | ||
it('should return a phrase and args', function () { | ||
assert.strictEqual(input.phrase(), 'Hello'); | ||
assert.deepEqual(input.arguments(), ['hello', 'world']); | ||
}); | ||
}); | ||
describe("__('Hello', {greet:'hello'})", function () { | ||
var input = __('Hello', { greet: 'hello' }); | ||
it('should return a phrase and values', function () { | ||
assert.deepEqual(input.values(), { greet: 'hello' }); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -1,2 +0,1 @@ | ||
/** global describe, it */ | ||
var assert = require('chai').assert; | ||
@@ -3,0 +2,0 @@ var optify = require('../../modules/optify'); |
@@ -1,2 +0,1 @@ | ||
/** global describe, it */ | ||
var assert = require('chai').assert; | ||
@@ -3,0 +2,0 @@ var plugify = require('../../modules/plugify'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
149633
42
1480
16
28
1