Skip to content
This repository was archived by the owner on Jun 23, 2019. It is now read-only.

Commit 50838e2

Browse files
committed
feat: Build for web release
1 parent 4fc7b52 commit 50838e2

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Generated by Peasant
22
{
33
"presets": ["env"],
4-
"plugins": ["transform-runtime", "array-includes"]
4+
"plugins": ["array-includes"]
55
}

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,30 @@
33
"version": "0.8.0",
44
"description": "Minim Parse Result Namespace",
55
"main": "./lib/parse-result.js",
6+
"browser": "./lib/minim-parse-result.js",
7+
"src": "./src/parse-result.js",
68
"repository": {
79
"type": "git",
810
"url": "https://github.com/refractproject/minim-parse-result.git"
911
},
1012
"scripts": {
13+
"lint": "peasant lint",
1114
"test": "peasant test",
12-
"ci": "peasant -s lint test build",
13-
"prepublish": "npm run ci",
15+
"build": "peasant -s build",
16+
"web": "peasant -w build",
17+
"ci": "peasant -s lint test",
18+
"prepublish": "npm run ci && npm run build && npm run web",
1419
"cover": "peasant cover",
15-
"peasant": "peasant",
16-
"lint": "peasant lint"
20+
"peasant": "peasant"
1721
},
1822
"dependencies": {
19-
"babel-runtime": "^6.23.0",
20-
"minim-api-description": "^0.6.0"
23+
"minim-api-description": "^0.7.0"
2124
},
2225
"devDependencies": {
2326
"babel-plugin-array-includes": "^2.0.3",
2427
"chai": "^3.2.0",
2528
"minim": "^0.19.0",
26-
"peasant": "^1.1.0"
29+
"peasant": "^1.2.0"
2730
},
2831
"engines": {
2932
"node": ">=4"

src/parse-result.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import apiDescription from 'minim-api-description';
1111

1212
export function namespace(options) {
1313
const minim = options.base;
14-
const Element = minim.Element;
14+
const { Element } = minim;
1515
const StringElement = minim.getElementClass('string');
1616
const ArrayElement = minim.getElementClass('array');
1717

@@ -30,15 +30,13 @@ export function namespace(options) {
3030
}
3131

3232
get warnings() {
33-
return this.children.filter(
34-
item => item.element === 'annotation' &&
35-
item.classes.contains('warning'));
33+
return this.children
34+
.filter(item => item.element === 'annotation' && item.classes.contains('warning'));
3635
}
3736

3837
get errors() {
39-
return this.children.filter(
40-
item => item.element === 'annotation' &&
41-
item.classes.contains('error'));
38+
return this.children
39+
.filter(item => item.element === 'annotation' && item.classes.contains('error'));
4240
}
4341
}
4442

test/parse-result.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe('Parse result namespace', () => {
109109
});
110110

111111
it('should contain an API', () => {
112-
const api = parseResult.api;
112+
const { api } = parseResult;
113113
expect(api).to.be.an.instanceof(Category);
114114
expect(api).to.have.class('api');
115115
});

0 commit comments

Comments
 (0)