Skip to content

Commit 51c6381

Browse files
committed
update scripts (fix #57)
1 parent 3438af8 commit 51c6381

16 files changed

+532
-1778
lines changed

Gruntfile.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ module.exports = grunt => {
3030
clean: grunt.file.readJSON('tasks/clean.json'),
3131
eslint: grunt.file.readJSON('tasks/eslint.json'),
3232
jsbeautifier: grunt.file.readJSON('tasks/jsbeautifier.json'),
33-
yuidoc: grunt.file.readJSON('tasks/yuidoc.json'),
3433
mocha_istanbul: grunt.file.readJSON('tasks/mocha_istanbul.json'),
3534
karma: grunt.file.readJSON('tasks/karma.json'),
3635
browserify: grunt.file.readJSON('tasks/browserify.json'),
@@ -47,30 +46,29 @@ module.exports = grunt => {
4746
// test
4847
grunt.registerTask('test', [
4948
'json_merge',
50-
'concat:systemModule',
49+
'concat:system',
5150
'mocha_istanbul:coverage'
5251
]);
5352

5453
// build
5554
grunt.registerTask('build', [
5655
'clean',
5756
'json_merge',
58-
'concat:systemModule',
57+
'concat:system',
5958
'jsbeautifier',
6059
'eslint',
6160
'mocha_istanbul:coverage',
6261
'browserify:debug',
6362
'browserify:release',
6463
'uglify:release',
6564
'concat:license',
66-
'karma:release',
67-
'yuidoc'
65+
'karma:release'
6866
]);
6967

7068
// coveralls
7169
grunt.registerTask('coveralls', [
7270
'json_merge',
73-
'concat:systemModule',
71+
'concat:system',
7472
'mocha_istanbul:coveralls'
7573
]);
7674

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,28 @@
4242
"coveralls": "grunt coveralls"
4343
},
4444
"devDependencies": {
45-
"chai": "^4.1.2",
46-
"coveralls": "^3.0.0",
4745
"grunt": "^1.0.1",
4846
"grunt-browserify": "^5.2.0",
4947
"grunt-cli": "^1.2.0",
5048
"grunt-contrib-clean": "^1.1.0",
5149
"grunt-contrib-concat": "^1.0.1",
5250
"grunt-contrib-uglify": "^3.2.1",
5351
"grunt-contrib-watch": "^1.0.0",
54-
"grunt-contrib-yuidoc": "^1.0.0",
5552
"grunt-eslint": "^20.1.0",
5653
"grunt-jsbeautifier": "^0.2.13",
5754
"grunt-json-merge": "^0.2.2",
5855
"grunt-karma": "^2.0.0",
5956
"grunt-mocha-istanbul": "^5.0.2",
57+
"load-grunt-tasks": "^3.5.2",
58+
"chai": "^4.1.2",
59+
"mocha": "^4.0.1",
60+
"coveralls": "^3.0.0",
6061
"istanbul": "^0.4.5",
6162
"karma": "^1.7.1",
6263
"karma-chrome-launcher": "^2.2.0",
6364
"karma-coverage": "^1.1.1",
6465
"karma-chai": "^0.1.0",
6566
"karma-mocha": "^1.3.0",
66-
"karma-script-launcher": "^1.0.0",
67-
"load-grunt-tasks": "^3.5.2",
68-
"mocha": "^4.0.1",
69-
"yuidoc-lucid-theme": "^0.1.2"
67+
"karma-script-launcher": "^1.0.0"
7068
}
7169
}
Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1 @@
11
;
2-
3-
/* exports */
4-
5-
6-
/**
7-
* This module contains Runtime core system.
8-
*
9-
* @module system
10-
* @class system
11-
* @static
12-
*/
13-
14-
15-
/**
16-
* Runtime core system
17-
* @property {_System} system
18-
*/
19-
exports.system = system;

src/banners/systemmodule-header.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
/* Public properties */
3333

3434

35-
/*
35+
/**
3636
* Runtime core system
3737
* @property {_System} system
3838
*/
39-
var system =
39+
exports.system =

src/behavior.js

Lines changed: 20 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* limitations under the License.
1919
*/
2020

21-
/**
21+
/*
2222
* This module manages the behaviors of all components.
2323
* A behavior is a mecanism that allow users to add actions that will be executed
2424
* when a specific state of a component will change.
@@ -61,7 +61,7 @@ var store = {};
6161
* @return {Function} the created function
6262
* @private
6363
*/
64-
function createFunction (name, func, core, useCoreAPI) {
64+
function createFunction(name, func, core, useCoreAPI) {
6565
var beginBody = -1,
6666
funcParams = '',
6767
params = [],
@@ -147,7 +147,7 @@ function createFunction (name, func, core, useCoreAPI) {
147147
/* Public methods */
148148

149149

150-
/*
150+
/**
151151
* Add a behavior that will be stored in System Runtime database.
152152
* @method add
153153
* @param {String} id id of the component
@@ -157,7 +157,7 @@ function createFunction (name, func, core, useCoreAPI) {
157157
* @param {Boolean} core if true, behavior can not be exported
158158
* @return {String} id of the behavior created in System Runtime database
159159
*/
160-
function add (id, state, action, useCoreAPI, core) {
160+
exports.add = function add(id, state, action, useCoreAPI, core) {
161161
var behaviorId = $helper.generateId(),
162162
strAction = action.toString();
163163

@@ -182,10 +182,10 @@ function add (id, state, action, useCoreAPI, core) {
182182
});
183183

184184
return behaviorId;
185-
}
185+
};
186186

187187

188-
/*
188+
/**
189189
* Remove a behavior with its id or remove all the behaviors for a specific state
190190
* of the component.
191191
* @method remove
@@ -194,7 +194,7 @@ function add (id, state, action, useCoreAPI, core) {
194194
* {String} state state of the component <br>
195195
* {String} behaviorId id of the behavior (optional)) <br>
196196
*/
197-
function remove (params) {
197+
exports.remove = function remove(params) {
198198
var result = [];
199199

200200
params = params || {};
@@ -226,27 +226,27 @@ function remove (params) {
226226
});
227227
}
228228
}
229-
}
229+
};
230230

231231

232-
/*
232+
/**
233233
* Remove a behavior with its id from the memory.
234234
* @method removeFromMemory
235235
* @param {String} id id of the component
236236
*/
237-
function removeFromMemory (id) {
237+
exports.removeFromMemory = function removeFromMemory(id) {
238238
delete store[id];
239-
}
239+
};
240240

241241

242-
/*
242+
/**
243243
* Get all the actions of a behavior for a component.
244244
* @method getActions
245245
* @param {String} id id of the component
246246
* @param {String} state name of the state
247247
* @return {Array} all the actions that have to be executed for a specific component and state
248248
*/
249-
function getActions (id, state) {
249+
exports.getActions = function getActions(id, state) {
250250
var result = [],
251251
dbResult = [],
252252
action = null;
@@ -269,56 +269,16 @@ function getActions (id, state) {
269269
});
270270

271271
return result;
272-
}
272+
};
273273

274274

275-
/*
275+
/**
276276
* Remove all the behaviors stored in memory.
277277
* @method clear
278278
*/
279-
function clear () {
279+
exports.clear = function clear() {
280280
store = {};
281-
}
282-
283-
284-
/*
285-
* Get a behavior by its id.
286-
* @method get
287-
* @param {String} id id of the behavior
288-
* @return {Behavior} the behavior
289-
*/
290-
function get (id) {
291-
return store[id];
292-
}
293-
294-
295-
/* exports */
296-
297-
298-
/**
299-
* This module manages the behaviors of all components. A behavior is a mecanism that allow users to add action that will be executed
300-
* when a specific state of a component will change.
301-
*
302-
* @module behavior
303-
* @requires db
304-
* @requires helper
305-
* @requires channel
306-
* @class behavior
307-
* @static
308-
*/
309-
310-
311-
/**
312-
* Add a behavior that will be stored in System Runtime database.
313-
* @method add
314-
* @param {String} id id of the component
315-
* @param {Object} state the state on which the action will be executed
316-
* @param {Object} action the action to execute when the component will have a specific state
317-
* @param {Boolean} useCoreAPI if true, System Runtime core modules will be injected as parameters of the action (default false)
318-
* @param {Boolean} core if true, behavior can not be exported
319-
* @return {String} id of the behavior created in System Runtime database
320-
*/
321-
exports.add = add;
281+
};
322282

323283

324284
/**
@@ -327,41 +287,6 @@ exports.add = add;
327287
* @param {String} id id of the behavior
328288
* @return {Behavior} the behavior
329289
*/
330-
exports.get = get;
331-
332-
333-
/**
334-
* Remove a behavior with its id or remove all the behaviors for a specific state
335-
* of the component.
336-
* @method remove
337-
* @param {Object} params <br>
338-
* {String} componentId id of the component <br>
339-
* {String} state state of the component <br>
340-
* {String} behaviorId id of the behavior (optional)) <br>
341-
*/
342-
exports.remove = remove;
343-
344-
345-
/**
346-
* Get all the actions of a behavior for a component.
347-
* @method getActions
348-
* @param {String} id id of the component
349-
* @param {String} state name of the state
350-
* @return {Array} all the actions that have to be executed for a specific component and state
351-
*/
352-
exports.getActions = getActions;
353-
354-
355-
/**
356-
* Remove all the behaviors stored in memory.
357-
* @method clear
358-
*/
359-
exports.clear = clear;
360-
361-
362-
/**
363-
* Remove a behavior with its id from the memory.
364-
* @method removeFromMemory
365-
* @param {String} id id of the component
366-
*/
367-
exports.removeFromMemory = removeFromMemory;
290+
exports.get = function get(id) {
291+
return store[id];
292+
};

0 commit comments

Comments
 (0)