Skip to content

Commit

Permalink
Work around missing package (grunt-component)
Browse files Browse the repository at this point in the history
  • Loading branch information
geraintluff committed Sep 2, 2014
1 parent 6ce263a commit 40273d0
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 42 deletions.
17 changes: 6 additions & 11 deletions Gruntfile.js
Expand Up @@ -14,7 +14,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-markdown');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-component');
grunt.loadNpmTasks('grunt-component-io');
grunt.loadNpmTasks('grunt-push-release');
grunt.loadNpmTasks('grunt-regex-replace');

Expand Down Expand Up @@ -110,15 +110,10 @@ module.exports = function (grunt) {
}
},
component: {
build: {
options: {
action: 'build', // can be omitted (build = default)
args: {
//standalone: '$',
dev: true
}
}
}
options: {
out: 'build/'
},
main: ['tv4.js', 'lang/**/*.js']
},
uglify: {
tv4: {
Expand Down Expand Up @@ -172,7 +167,7 @@ module.exports = function (grunt) {
grunt.registerTask('default', ['test']);
grunt.registerTask('prepublish', ['cleanup']);

grunt.registerTask('products', ['uglify:tv4', 'component:build', 'markdown']);
grunt.registerTask('products', ['uglify:tv4', 'component', 'markdown']);
grunt.registerTask('core', ['clean', 'concat_sourcemap', 'jshint', 'products', 'copy:test_deps']);

grunt.registerTask('build', ['core', 'cleanup']);
Expand Down
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "tv4",
"version": "1.1.0",
"version": "1.1.1",
"description": "A public domain JSON Schema validator for JavaScript",
"keywords": [
"json-schema",
Expand Down
12 changes: 7 additions & 5 deletions component.json
@@ -1,7 +1,7 @@
{
"name": "tv4",
"repo": "geraintluff/tv4",
"version": "1.1.0",
"version": "1.1.1",
"description": "A public domain JSON Schema v4 validator for JavaScript",
"keywords": [
"json-schema",
Expand All @@ -14,7 +14,9 @@
"license": "MIT",
"main": "tv4.js",
"scripts": [
"lang/de.js",
"tv4.js"
]
}
"tv4.js",
"lang/de.js"
],
"styles": [],
"files": []
}
8 changes: 4 additions & 4 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "tv4",
"version": "1.1.0",
"version": "1.1.1",
"author": "Geraint Luff",
"description": "A public domain JSON Schema validator for JavaScript",
"keywords": [
Expand All @@ -16,7 +16,7 @@
"web": "https://github.com/geraintluff/"
}
],
"main": "tv4.js",
"main": "tv4.min.js",

This comment has been minimized.

Copy link
@Bartvds

Bartvds Oct 6, 2014

Collaborator

@geraintluff this is failing installs and crashing travis builds because it is not in the npm package. #157

"repository": {
"type": "git",
"url": "https://github.com/geraintluff/tv4.git"
Expand Down Expand Up @@ -47,10 +47,10 @@
"grunt-concat-sourcemap": "~0.2",
"source-map-support": "~0.1",
"grunt-markdown": "~0.3.0",
"grunt-component": "~0.1.4",
"grunt-push-release": "~0.1.1",
"grunt-regex-replace": "~0.2.5",
"requirejs": "~2.1.11"
"requirejs": "~2.1.11",
"grunt-component-io": "~0.1.0"
},
"engines": {
"node": ">= 0.8.0"
Expand Down
2 changes: 1 addition & 1 deletion source/api.js
Expand Up @@ -39,7 +39,7 @@ for (var key in ErrorCodes) {
ErrorCodeLookup[ErrorCodes[key]] = key;
}
var ErrorMessagesDefault = {
INVALID_TYPE: "invalid type: {type} (expected {expected})",
INVALID_TYPE: "Invalid type: {type} (expected {expected})",
ENUM_MISMATCH: "No enum match for: {value}",
ANY_OF_MISSING: "Data does not match any schemas from \"anyOf\"",
ONE_OF_MISSING: "Data does not match any schemas from \"oneOf\"",
Expand Down
18 changes: 9 additions & 9 deletions test/all_concat.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/tests/07 - $ref/03 - getSchema.js
Expand Up @@ -82,7 +82,7 @@ describe("$ref 03", function () {

var error = {
code: 0,
message: 'invalid type: number (expected boolean)',
message: 'Invalid type: number (expected boolean)',
dataPath: '/0',
schemaPath: '/items/type',
subErrors: null };
Expand Down
2 changes: 1 addition & 1 deletion test/tests/07 - $ref/05 - inline addressing.js
Expand Up @@ -11,7 +11,7 @@ describe("$ref 05", function () {
};
var error = {
code: 0,
message: 'invalid type: number (expected boolean)',
message: 'Invalid type: number (expected boolean)',
dataPath: '/0',
schemaPath: '/items/type',
subErrors: null
Expand Down
2 changes: 1 addition & 1 deletion test/tests/15 - language/01 - language file.js
@@ -1,5 +1,5 @@
describe("Load language file", function () {
if (!process || !require) {
if (typeof process !== 'object' || typeof require !== 'function') {
it.skip("commonjs language", function () {
// dummy
});
Expand Down
12 changes: 6 additions & 6 deletions test/tests/16 - hypermedia/02 - describedby link.js
@@ -1,8 +1,8 @@
describe("Load language file", function () {
it("commonjs language: de", function () {
var tv4 = require('../').freshApi();
var freshTv4 = tv4.freshApi();

tv4.addSchema('/polymorphic', {
freshTv4.addSchema('/polymorphic', {
type: "object",
properties: {
"type": {type: "string"}
Expand All @@ -14,22 +14,22 @@ describe("Load language file", function () {
}]
});

var res = tv4.validateResult({type: 'monkey'}, "/polymorphic");
var res = freshTv4.validateResult({type: 'monkey'}, "/polymorphic");
assert.isTrue(res.valid);
assert.includes(res.missing, "/schemas/monkey.json");

tv4.addSchema('/schemas/tiger.json', {
freshTv4.addSchema('/schemas/tiger.json', {
properties: {
"stripes": {"type": "integer", "minimum": 1}
},
required: ["stripes"]
});

var res2 = tv4.validateResult({type: 'tiger', stripes: -1}, "/polymorphic");
var res2 = freshTv4.validateResult({type: 'tiger', stripes: -1}, "/polymorphic");
assert.isFalse(res2.valid);
assert.deepEqual(res2.missing.length, 0, "no schemas should be missing");

var res3 = tv4.validateResult({type: 'tiger', stripes: 50}, "/polymorphic");
var res3 = freshTv4.validateResult({type: 'tiger', stripes: 50}, "/polymorphic");
assert.isTrue(res3.valid);
});
});
2 changes: 1 addition & 1 deletion tv4.js
Expand Up @@ -1602,4 +1602,4 @@ tv4.tv4 = tv4;

return tv4; // used by _header.js to globalise.

}));
}));
2 changes: 1 addition & 1 deletion tv4.min.js

Large diffs are not rendered by default.

0 comments on commit 40273d0

Please sign in to comment.