Comparing version 1.0.2 to 1.0.3
@@ -0,1 +1,6 @@ | ||
# 1.0.3 - 2015-12-03 | ||
- Dependency update to support require support for the `links` element. | ||
- When a parser returns an error it is sometimes useful to inspect the parse result. This now gets passed back to the handler function and can be used to print more information, such as parser annotations, when an error occurs. | ||
# 1.0.2 - 2015-11-30 | ||
@@ -12,3 +17,2 @@ | ||
- Remove legacy interface. The only available interface is now the Refract interface. In order to use it, you must load adapter modules to handle particular formats. | ||
- Use | ||
@@ -15,0 +19,0 @@ # 0.8.4 - 2015-07-30 |
@@ -7,2 +7,4 @@ 'use strict'; | ||
function log(message) {} | ||
/*eslint no-unused-vars: 0 */ | ||
// console.log(message); | ||
@@ -37,5 +39,2 @@ // Default Fury EventEmitter | ||
module.exports = DefaultFuryEmitter; | ||
/*eslint no-unused-vars: 0 */ | ||
//console.log(message); | ||
module.exports = DefaultFuryEmitter; |
@@ -114,3 +114,3 @@ 'use strict'; | ||
if (err) { | ||
return done(err); | ||
return done(err, elements); | ||
} | ||
@@ -117,0 +117,0 @@ |
@@ -194,3 +194,3 @@ // Generated by CoffeeScript 1.9.3 | ||
legacyResourcesFrom1AResource = function(legacyUrlConverterFn, resource) { | ||
var action, actionIndex, attributesElements, i, legacyResource, legacyResources, len, ref, ref1, ref2, ref3, requests, resourceParameters; | ||
var action, actionIndex, attributesElements, i, legacyResource, legacyResources, len, ref, ref1, ref2, ref3, ref4, requests, resourceParameters; | ||
legacyResources = []; | ||
@@ -205,10 +205,10 @@ resourceParameters = getParametersOf(resource); | ||
}); | ||
legacyResource.url = legacyUrlConverterFn(resource.uriTemplate); | ||
legacyResource.url = legacyUrlConverterFn(((ref1 = action.attributes) != null ? ref1.uriTemplate : void 0) || resource.uriTemplate); | ||
legacyResource.uriTemplate = resource.uriTemplate; | ||
legacyResource.method = action.method; | ||
legacyResource.name = ((ref1 = resource.name) != null ? ref1.trim() : void 0) || ''; | ||
legacyResource.name = ((ref2 = resource.name) != null ? ref2.trim() : void 0) || ''; | ||
legacyResource.headers = legacyHeadersFrom1AHeaders(resource.headers); | ||
legacyResource.actionHeaders = legacyHeadersFrom1AHeaders(action.headers); | ||
legacyResource.description = trimLastNewline(resource.description); | ||
if ((ref2 = resource.description) != null ? ref2.length : void 0) { | ||
if ((ref3 = resource.description) != null ? ref3.length : void 0) { | ||
legacyResource.htmlDescription = trimLastNewline(markdown.toHtmlSync(resource.description.trim())); | ||
@@ -218,3 +218,3 @@ } else { | ||
} | ||
if ((ref3 = action.name) != null ? ref3.length : void 0) { | ||
if ((ref4 = action.name) != null ? ref4.length : void 0) { | ||
legacyResource.actionName = action.name.trim(); | ||
@@ -221,0 +221,0 @@ } else { |
// Generated by CoffeeScript 1.9.3 | ||
var DefaultFuryEmitter, Drafter, NEW_VERSION_REGEXP, PARSER_TIMEOUT, STRICT_OPTIONS, apiBlueprintAdapter, apiaryBlueprintAdapter, apiaryBlueprintParser, base, countLines, getAstSync, getLocalAst; | ||
var DefaultFuryEmitter, NEW_VERSION_REGEXP, PARSER_TIMEOUT, STRICT_OPTIONS, apiBlueprintAdapter, apiaryBlueprintAdapter, apiaryBlueprintParser, base, countLines, getAstSync, getLocalAst, protagonist; | ||
apiaryBlueprintParser = require('apiary-blueprint-parser'); | ||
Drafter = require('drafter'); | ||
protagonist = require('protagonist'); | ||
@@ -37,3 +37,3 @@ DefaultFuryEmitter = require('../fury-emitter'); | ||
getLocalAst = function(arg, cb) { | ||
var apiaryAst, blueprintId, code, drafter, emitter, err, options, parseHasFinished, sourcemap, t, timeoutHandler, timeoutTimer; | ||
var apiaryAst, blueprintId, code, emitter, err, options, parseHasFinished, sourcemap, t, timeoutHandler, timeoutTimer; | ||
code = arg.code, blueprintId = arg.blueprintId, sourcemap = arg.sourcemap, emitter = arg.emitter; | ||
@@ -76,4 +76,6 @@ if (blueprintId == null) { | ||
t = process.hrtime(); | ||
drafter = new Drafter(options); | ||
return drafter.make(code, function(err, result) { | ||
return protagonist.parse(code, { | ||
type: 'ast', | ||
exportSourcemap: true | ||
}, function(err, result) { | ||
var execTime, ref; | ||
@@ -80,0 +82,0 @@ execTime = process.hrtime(t); |
{ | ||
"name": "fury", | ||
"description": "API Description SDK", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"author": "Apiary.io <support@apiary.io>", | ||
@@ -25,3 +25,3 @@ "main": "./lib/fury", | ||
"babel-runtime": "^5.5.6", | ||
"minim": "^0.12.3", | ||
"minim": "^0.13.0", | ||
"minim-parse-result": "^0.2.1" | ||
@@ -28,0 +28,0 @@ }, |
@@ -47,3 +47,5 @@ import {assert} from 'chai'; | ||
]], | ||
['annotation', {'classes': ['warning']}, {'code': 6, 'sourceMap': [['sourceMap', {}, {}, [0, 10]]]}, 'description'], | ||
['annotation', {'classes': ['warning']}, {'code': 6, 'sourceMap': [ | ||
['sourceMap', {}, {}, [[0, 10]]], | ||
]}, 'description'], | ||
]]; | ||
@@ -141,9 +143,11 @@ | ||
it('should error on parser error', (done) => { | ||
const expected = new Error(); | ||
const expectedError = new Error(); | ||
const expectedElements = {}; | ||
fury.adapters[fury.adapters.length - 1].parse = (options, done2) => { | ||
done2(expected); | ||
done2(expectedError, expectedElements); | ||
}; | ||
fury.parse({source: 'dummy'}, (err) => { | ||
assert.equal(err, expected); | ||
fury.parse({source: 'dummy'}, (err, elements) => { | ||
assert.equal(err, expectedError); | ||
assert.equal(elements, expectedElements); | ||
done(); | ||
@@ -238,3 +242,3 @@ }); | ||
it('should have a source map', () => { | ||
assert.deepEqual(annotation.attributes.get('sourceMap').toValue(), [[0, 10]]); | ||
assert.deepEqual(annotation.attributes.get('sourceMap').first().toValue(), [[0, 10]]); | ||
}); | ||
@@ -241,0 +245,0 @@ }); |
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
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
70202
15
1629
+ Addedlodash@3.10.1(transitive)
+ Addedminim@0.13.0(transitive)
- Removedlodash@2.4.2(transitive)
- Removedminim@0.12.3(transitive)
Updatedminim@^0.13.0