Skip to content

Commit cdf5dc5

Browse files
committed
[refactor] Remove helpers from data model
Helpers turned out to be less unique than originally thought. This PR removes the simplistic notion of helpers and leaves it to the API docs themselves to determine what the helper in a module is (class, function, etc).
1 parent aec8862 commit cdf5dc5

File tree

7 files changed

+2
-17
lines changed

7 files changed

+2
-17
lines changed

lib/models/functions.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,4 @@ class Method extends BaseFunction {
5353
}
5454
}
5555

56-
class Helper extends Function {
57-
static detect(doc) {
58-
return super.detect(doc) && doc.file.match(/helpers\//) !== null;
59-
}
60-
}
61-
62-
module.exports = { Function, Method, Helper };
56+
module.exports = { Function, Method };

lib/models/module.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class Module {
77
// Attributes
88
this.file = doc.name;
99
this.functions = [];
10-
this.helpers = [];
1110
this.variables = [];
1211

1312
// Relationships

lib/preprocessors/generate-yuidoc-jsonapi.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const Component = require('../models/classes').Component;
99

1010
const Function = require('../models/functions').Function;
1111
const Method = require('../models/functions').Method;
12-
const Helper = require('../models/functions').Helper;
1312

1413
const Variable = require('../models/variables').Variable;
1514
const Field = require('../models/variables').Field;
@@ -78,9 +77,6 @@ module.exports = function generateYuiDocJsonApi(inputPaths, project) {
7877
} else if (Field.detect(item)) {
7978
klass.fields.push(new Field(item));
8079

81-
} else if (Helper.detect(item)) {
82-
module.helpers.push(new Helper(item));
83-
8480
} else if (Function.detect(item)) {
8581
module.functions.push(new Function(item));
8682

node-tests/fixtures/basic-class/output.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"attributes": {
1010
"file": "foo",
1111
"functions": [],
12-
"helpers": [],
1312
"variables": []
1413
},
1514
"relationships": {

node-tests/fixtures/basic-component/output.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"attributes": {
1010
"file": "components/foo",
1111
"functions": [],
12-
"helpers": [],
1312
"variables": []
1413
},
1514
"relationships": {

node-tests/fixtures/basic-module/output.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
"exportType": "named"
8080
}
8181
],
82-
"helpers": [],
8382
"variables": [
8483
{
8584
"name": "baz",

node-tests/fixtures/helper-module/output.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
"id": "helpers/foo",
99
"attributes": {
1010
"file": "helpers/foo",
11-
"functions": [],
12-
"helpers": [
11+
"functions": [
1312
{
1413
"name": "helper",
1514
"file": "helpers/foo",

0 commit comments

Comments
 (0)