Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit ba8281a

Browse files
kylefpatricksmms
authored andcommitted
fix: replace minim-api-description with api-elements
1 parent d6ebbde commit ba8281a

File tree

5 files changed

+16
-19
lines changed

5 files changed

+16
-19
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"homepage": "https://github.com/apiaryio/attributes-kit#readme",
6666
"devDependencies": {
6767
"abagnale": "^1.1.3",
68+
"api-elements": "=0.2.0",
6869
"async": "^2.2.0",
6970
"babel-cli": "^6.7.7",
7071
"babel-core": "^6.7.7",
@@ -103,8 +104,7 @@
103104
"json-formatter-js": "^2.0.0",
104105
"lodash": "^4.17.4",
105106
"marked": "^0.3.6",
106-
"minim": "=0.23.3",
107-
"minim-parse-result": "=0.11.0",
107+
"minim": "=0.23.5",
108108
"mocha": "^3.2.0",
109109
"mson-zoo": "3.0.0-beta.1",
110110
"node-noop": "1.0.0",

playground/components/Playground.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
2-
import minim from 'minim';
3-
import minimParseResult from 'minim-parse-result';
2+
import { Namespace } from 'api-elements';
43

54
import AttributesKit from '../../src';
65
import EditorComponent from './Editor';
@@ -37,7 +36,7 @@ class Playground extends React.Component {
3736

3837
onChange = (payload) => {
3938
if (payload.type === actionTypes.MSON_PARSED) {
40-
const minimNamespace = minim.namespace().use(minimParseResult);
39+
const minimNamespace = new Namespace();
4140
payload = {
4241
errors: payload.errors,
4342
dataStructures: minimNamespace.fromRefract(payload.dataStructures),

scripts/generateFixtures.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import msonZoo from 'mson-zoo';
55
import jsBeautify from 'js-beautify';
66
import fs from 'fs';
77
import path from 'path';
8-
import minim from 'minim';
9-
import minimParseResult from 'minim-parse-result';
8+
import { Namespace } from 'api-elements';
109

1110
import parseMson from '../playground/parseMson';
1211
import AttributesKit from '../dist/attributes-kit-server';
@@ -33,7 +32,7 @@ async.forEachOfLimit(msonZoo.samples, 10, (sample, sampleIndex, next) => {
3332
return next(new Error('No data structure elements were returned.'));
3433
}
3534

36-
const minimNamespace = minim.namespace().use(minimParseResult);
35+
const minimNamespace = new Namespace();
3736
dataStructureElements = minimNamespace.fromRefract(dataStructureElements);
3837

3938
const renderedElement = React.createElement(AttributesKit.Attributes, {

src/Components/Attributes/test/Attributes.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { assert } from 'chai';
2-
import minim from 'minim';
3-
import minimParseResult from 'minim-parse-result';
2+
import { Namespace } from 'api-elements';
43
import cloneDeep from 'lodash/cloneDeep';
54

65
import Attributes from '../Attributes';
@@ -38,21 +37,22 @@ describe('Attributes', () => {
3837
});
3938

4039
describe('#minimSupport', () => {
41-
const minimNamespace = minim.namespace().use(minimParseResult);
40+
const minimNamespace = new Namespace();
41+
const ObjectElement = minimNamespace.getElementClass('object');
4242
const Category = minimNamespace.getElementClass('category');
4343
const DataStructure = minimNamespace.getElementClass('dataStructure');
4444
const createReferenceElement = function createReferenceElement(ref) {
45-
const element = new minim.Element();
45+
const element = new minimNamespace.Element();
4646
element.element = ref.toValue();
4747
return element;
4848
};
4949

50-
const addressObject = new minim.ObjectElement({
50+
const addressObject = new ObjectElement({
5151
street: 'Main St.',
5252
city: 'Prague',
5353
zip: 11150,
5454
}, { id: 'Address' });
55-
const userObject = new minim.ObjectElement({
55+
const userObject = new ObjectElement({
5656
name: 'Doe',
5757
address: createReferenceElement(addressObject.id),
5858
}, { id: 'User' });
@@ -65,7 +65,7 @@ describe('Attributes', () => {
6565
{ classes: ['dataStructures'] }
6666
);
6767

68-
describe('It handles minim.Element instance `element` property', () => {
68+
describe('It handles minim Element instance `element` property', () => {
6969
let addressMember;
7070

7171
before(() => {
@@ -112,7 +112,7 @@ describe('Attributes', () => {
112112
});
113113
});
114114

115-
describe('It handles minim.ArraySlice `dataStructures` property', () => {
115+
describe('It handles minim ArraySlice `dataStructures` property', () => {
116116
let addressMember;
117117

118118
before(() => {

test/fixturesComparision.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import jsBeautify from 'js-beautify';
55
import fs from 'fs';
66
import path from 'path';
77
import assert from 'assert';
8-
import minim from 'minim';
9-
import minimParseResult from 'minim-parse-result';
8+
import { Namespace } from 'api-elements';
109
import pipe from 'lodash/fp/pipe';
1110

1211
import parseMson from '../playground/parseMson';
@@ -55,7 +54,7 @@ describe('Comparision with reference fixtures', () => {
5554
}
5655

5756
// to minim
58-
const minimNamespace = minim.namespace().use(minimParseResult);
57+
const minimNamespace = new Namespace();
5958
dataStructureElements = minimNamespace.fromRefract(dataStructureElements);
6059

6160
renderedElement = React.createElement(Attributes, {

0 commit comments

Comments
 (0)