Skip to content

Commit

Permalink
chore(all): prepare release 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Nov 16, 2015
1 parent 95e347b commit 4258403
Show file tree
Hide file tree
Showing 38 changed files with 731 additions and 607 deletions.
9 changes: 8 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-validation",
"version": "0.4.1",
"version": "0.6.0",
"description": "A validation plugin for Aurelia.",
"keywords": [
"aurelia",
Expand All @@ -15,5 +15,12 @@
"repository": {
"type": "git",
"url": "https://github.com/aurelia/validation"
},
"dependencies": {
"aurelia-binding": "^1.0.0-beta.1.0.1",
"aurelia-dependency-injection": "^1.0.0-beta.1",
"aurelia-logging": "^1.0.0-beta.1",
"aurelia-metadata": "^1.0.0-beta.1",
"aurelia-templating": "^1.0.0-beta.1"
}
}
6 changes: 3 additions & 3 deletions build/tasks/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ var typedocExtractor = require('gulp-typedoc-extractor');
var runSequence = require('run-sequence');

gulp.task('doc-generate', function(){
return gulp.src([paths.output + 'amd/*.d.ts', paths.doc + '/core-js.d.ts', './jspm_packages/github/aurelia/*/*.d.ts'])
return gulp.src([paths.output + 'amd/*.d.ts', paths.doc + '/core-js.d.ts', './jspm_packages/npm/*/*.d.ts'])
.pipe(typedoc({
target: 'es6',
includeDeclarations: true,
json: paths.doc + '/api.json',
name: paths.packageName + '-docs',
name: paths.packageName + '-docs',
mode: 'modules',
excludeExternals: true,
ignoreCompilerErrors: false,
Expand All @@ -30,4 +30,4 @@ gulp.task('doc', function(callback){
'doc-extract',
callback
);
});
});
39 changes: 27 additions & 12 deletions build/tasks/test.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,40 @@
var gulp = require('gulp');
var karma = require('karma').server;
var Karma = require('karma').Server;

/**
* Run test once and exit
*/
gulp.task('test', function (done) {
karma.start({
configFile: __dirname + '/../../karma.conf.js',
singleRun: true
}, function(e) {
done();
});
new Karma({
configFile: __dirname + '/../../karma.conf.js',
singleRun: true
}, done).start();
});

/**
* Watch for file changes and re-run tests on each change
*/
gulp.task('tdd', function (done) {
karma.start({
configFile: __dirname + '/../../karma.conf.js'
}, function(e) {
done();
});
new Karma({
configFile: __dirname + '/../../karma.conf.js'
}, done).start();
});

/**
* Run test once with code coverage and exit
*/
gulp.task('cover', function (done) {
new Karma({
configFile: __dirname + '/../../karma.conf.js',
singleRun: true,
reporters: ['coverage'],
preprocessors: {
'test/**/*.js': ['babel'],
'src/**/*.js': ['babel', 'coverage']
},
coverageReporter: {
type: 'html',
dir: 'build/reports/coverage'
}
}, done).start();
});
86 changes: 43 additions & 43 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,54 +13,17 @@ System.config({
},

map: {
"aurelia-binding": "github:aurelia/binding@0.11.0",
"aurelia-dependency-injection": "github:aurelia/dependency-injection@0.12.0",
"aurelia-logging": "github:aurelia/logging@0.9.0",
"aurelia-metadata": "github:aurelia/metadata@0.10.0",
"aurelia-pal-browser": "github:aurelia/pal-browser@0.3.0",
"aurelia-templating": "github:aurelia/templating@0.17.0",
"aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.0.1",
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1",
"aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1",
"aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1",
"aurelia-pal-browser": "npm:aurelia-pal-browser@1.0.0-beta.1",
"aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1",
"babel": "npm:babel-core@5.8.22",
"babel-runtime": "npm:babel-runtime@5.8.20",
"core-js": "npm:core-js@1.2.6",
"traceur": "github:jmcriffey/bower-traceur@0.0.91",
"traceur-runtime": "github:jmcriffey/bower-traceur-runtime@0.0.91",
"github:aurelia/binding@0.11.0": {
"aurelia-metadata": "github:aurelia/metadata@0.10.0",
"aurelia-pal": "github:aurelia/pal@0.3.0",
"aurelia-task-queue": "github:aurelia/task-queue@0.9.0",
"core-js": "npm:core-js@1.2.6"
},
"github:aurelia/dependency-injection@0.12.0": {
"aurelia-logging": "github:aurelia/logging@0.9.0",
"aurelia-metadata": "github:aurelia/metadata@0.10.0",
"aurelia-pal": "github:aurelia/pal@0.3.0",
"core-js": "npm:core-js@1.2.6"
},
"github:aurelia/loader@0.11.0": {
"aurelia-metadata": "github:aurelia/metadata@0.10.0",
"aurelia-path": "github:aurelia/path@0.11.0"
},
"github:aurelia/metadata@0.10.0": {
"aurelia-pal": "github:aurelia/pal@0.3.0",
"core-js": "npm:core-js@1.2.6"
},
"github:aurelia/pal-browser@0.3.0": {
"aurelia-pal": "github:aurelia/pal@0.3.0"
},
"github:aurelia/task-queue@0.9.0": {
"aurelia-pal": "github:aurelia/pal@0.3.0"
},
"github:aurelia/templating@0.17.0": {
"aurelia-binding": "github:aurelia/binding@0.11.0",
"aurelia-dependency-injection": "github:aurelia/dependency-injection@0.12.0",
"aurelia-loader": "github:aurelia/loader@0.11.0",
"aurelia-logging": "github:aurelia/logging@0.9.0",
"aurelia-metadata": "github:aurelia/metadata@0.10.0",
"aurelia-pal": "github:aurelia/pal@0.3.0",
"aurelia-path": "github:aurelia/path@0.11.0",
"aurelia-task-queue": "github:aurelia/task-queue@0.9.0",
"core-js": "npm:core-js@1.2.6"
},
"github:jspm/nodelibs-assert@0.1.0": {
"assert": "npm:assert@1.3.0"
},
Expand All @@ -76,6 +39,43 @@ System.config({
"npm:assert@1.3.0": {
"util": "npm:util@0.10.3"
},
"npm:aurelia-binding@1.0.0-beta.1.0.1": {
"aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1",
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1",
"aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1",
"core-js": "npm:core-js@1.2.6"
},
"npm:aurelia-dependency-injection@1.0.0-beta.1": {
"aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1",
"aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1",
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1",
"core-js": "npm:core-js@1.2.6"
},
"npm:aurelia-loader@1.0.0-beta.1": {
"aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1",
"aurelia-path": "npm:aurelia-path@1.0.0-beta.1"
},
"npm:aurelia-metadata@1.0.0-beta.1": {
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1",
"core-js": "npm:core-js@1.2.6"
},
"npm:aurelia-pal-browser@1.0.0-beta.1": {
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1"
},
"npm:aurelia-task-queue@1.0.0-beta.1": {
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1"
},
"npm:aurelia-templating@1.0.0-beta.1": {
"aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.0.1",
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1",
"aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1",
"aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1",
"aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1",
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1",
"aurelia-path": "npm:aurelia-path@1.0.0-beta.1",
"aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1",
"core-js": "npm:core-js@1.2.6"
},
"npm:babel-runtime@5.8.20": {
"process": "github:jspm/nodelibs-process@0.1.2"
},
Expand Down
17 changes: 17 additions & 0 deletions dist/amd/aurelia-validation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ declare module 'aurelia-validation' {
export function ensure(setupStep: any): any;
export class PathObserver {
constructor(observerLocator: any, subject: any, path: any);

// TODO: this should be replaced with reuse of the Binding system
observeParts(propertyName: any): any;
observePart(part: any): any;
getObserver(): any;
Expand All @@ -35,6 +37,8 @@ declare module 'aurelia-validation' {
export class ValidateCustomAttribute {
constructor(element: any);
valueChanged(newValue: any): any;

// this is just to tell the real validation instance (higher in the DOM) the exact property-path to bind to
subscribeChangedHandlers(currentElement: any): any;
attached(): any;
}
Expand All @@ -44,6 +48,8 @@ declare module 'aurelia-validation' {
constructor(innerConfig: any);
getValue(identifier: any): any;
setValue(identifier: any, value: any): any;

// fluent API
onLocaleChanged(callback: any): any;
getDebounceTimeout(): any;
useDebounceTimeout(value: any): any;
Expand Down Expand Up @@ -112,6 +118,8 @@ declare module 'aurelia-validation' {
*/
constructor(subject: any, observerLocator: any, config: any);
destroy(): any;

// TODO: what else needs to be done for proper cleanup?
clear(): any;
onBreezeEntity(): any;

Expand Down Expand Up @@ -376,6 +384,7 @@ declare module 'aurelia-validation' {
clear(): any;
destroy(): any;

// TODO: what else needs to be done for proper cleanup?
/**
* returns a promise that fulfils and resolves to true/false
*/
Expand Down Expand Up @@ -410,6 +419,8 @@ declare module 'aurelia-validation' {
export class SwitchCaseValidationRulesCollection {
constructor(conditionExpression: any, config: any);
case(caseLabel: any): any;

// force creation
default(): any;
getCurrentCollection(caseLabel: any, createIfNotExists?: any): any;
validate(newValue: any, locale: any): any;
Expand Down Expand Up @@ -531,6 +542,12 @@ declare module 'aurelia-validation' {
prepareElement(validationProperty: any, element: any): any;
updateElement(validationProperty: any, element: any): any;
}

/**
* A lightweight validation plugin
* @class Validation
* @constructor
*/
export class Validation {

/**
Expand Down
12 changes: 6 additions & 6 deletions dist/amd/decorators.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ define(['exports', 'aurelia-metadata'], function (exports, _aureliaMetadata) {
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

var ValidationMetadata = (function () {
_createClass(ValidationMetadata, null, [{
key: 'metadataKey',
value: 'aurelia:validation',
enumerable: true
}]);

function ValidationMetadata() {
_classCallCheck(this, ValidationMetadata);

Expand All @@ -33,12 +39,6 @@ define(['exports', 'aurelia-metadata'], function (exports, _aureliaMetadata) {
});
};

_createClass(ValidationMetadata, null, [{
key: 'metadataKey',
value: 'aurelia:validation',
enumerable: true
}]);

return ValidationMetadata;
})();

Expand Down
6 changes: 3 additions & 3 deletions dist/amd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ define(['exports', './validation-config', './validation', './utilities', './vali
exports.__esModule = true;
exports.configure = configure;

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
function _interopExportWildcard(obj, defaults) { var newObj = defaults({}, obj); delete newObj['default']; return newObj; }

function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }

exports.Utilities = _utilities.Utilities;
exports.ValidationConfig = _validationConfig.ValidationConfig;
exports.ValidationLocale = _validationLocale.ValidationLocale;

_defaults(exports, _interopRequireWildcard(_validationResult));
_defaults(exports, _interopExportWildcard(_validationResult, _defaults));

_defaults(exports, _interopRequireWildcard(_validationRules));
_defaults(exports, _interopExportWildcard(_validationRules, _defaults));

exports.Validation = _validation.Validation;
exports.ValidationGroup = _validationGroup.ValidationGroup;
Expand Down
6 changes: 3 additions & 3 deletions dist/amd/strategies/twbootstrap-view-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ define(['exports', '../validation-view-strategy'], function (exports, _validatio

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var TWBootstrapViewStrategyBase = (function (_ValidationViewStrategy) {
_inherits(TWBootstrapViewStrategyBase, _ValidationViewStrategy);

function TWBootstrapViewStrategyBase(appendMessageToInput, appendMessageToLabel, helpBlockClass) {
_classCallCheck(this, TWBootstrapViewStrategyBase);

Expand All @@ -17,8 +19,6 @@ define(['exports', '../validation-view-strategy'], function (exports, _validatio
this.helpBlockClass = helpBlockClass;
}

_inherits(TWBootstrapViewStrategyBase, _ValidationViewStrategy);

TWBootstrapViewStrategyBase.prototype.searchFormGroup = function searchFormGroup(currentElement, currentDepth) {
if (currentDepth === 5) {
return null;
Expand Down
9 changes: 4 additions & 5 deletions dist/amd/validate-custom-attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-templating'], functi
this.viewStrategy = null;
}

var _ValidateCustomAttribute = ValidateCustomAttribute;

_ValidateCustomAttribute.prototype.valueChanged = function valueChanged(newValue) {
ValidateCustomAttribute.prototype.valueChanged = function valueChanged(newValue) {
if (this.value === null || this.value === undefined) {
return;
}
Expand All @@ -27,7 +25,7 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-templating'], functi
return;
};

_ValidateCustomAttribute.prototype.subscribeChangedHandlers = function subscribeChangedHandlers(currentElement) {
ValidateCustomAttribute.prototype.subscribeChangedHandlers = function subscribeChangedHandlers(currentElement) {
var _this = this;

var viewStrategy = this.value.config.getViewStrategy();
Expand All @@ -45,12 +43,13 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-templating'], functi
}
};

_ValidateCustomAttribute.prototype.attached = function attached() {
ValidateCustomAttribute.prototype.attached = function attached() {
if (this.processedValidation === null || this.processedValidation === undefined) {
this.valueChanged(this.value);
}
};

var _ValidateCustomAttribute = ValidateCustomAttribute;
ValidateCustomAttribute = _aureliaDependencyInjection.inject(Element)(ValidateCustomAttribute) || ValidateCustomAttribute;
ValidateCustomAttribute = _aureliaTemplating.customAttribute('validate')(ValidateCustomAttribute) || ValidateCustomAttribute;
return ValidateCustomAttribute;
Expand Down
4 changes: 2 additions & 2 deletions dist/amd/validation-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ define(['exports', 'aurelia-metadata', './validation-group-builder', './validati
ValidationGroup.prototype.validate = function validate() {
var _this3 = this;

var forceDirty = arguments[0] === undefined ? true : arguments[0];
var forceExecution = arguments[1] === undefined ? true : arguments[1];
var forceDirty = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
var forceExecution = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];

this.isValidating = true;
var promise = Promise.resolve(true);
Expand Down
2 changes: 1 addition & 1 deletion dist/amd/validation-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ define(['exports', './validation-rules-collection', './path-observer', './deboun

ValidationProperty.prototype.addValidationRule = function addValidationRule(validationRule) {
if (validationRule.validate === undefined) {
throw new Error('That\'s not a valid validationRule');
throw new Error("That's not a valid validationRule");
}
this.collectionOfValidationRules.addValidationRule(validationRule);
this.validateCurrentValue(false);
Expand Down
Loading

0 comments on commit 4258403

Please sign in to comment.