Skip to content

Commit 961c950

Browse files
committed
refactor tutorial, tutorials into modules
1 parent 42fed98 commit 961c950

File tree

56 files changed

+195
-94
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+195
-94
lines changed

lib/actions/_types.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,3 @@ exports.PROGRESS_LOAD = 'PROGRESS_LOAD';
77
exports.PROGRESS_PAGE_POSITION_LOAD = 'PROGRESS_PAGE_POSITION_LOAD';
88
exports.SETUP_PACKAGE = 'SETUP_PACKAGE';
99
exports.SETUP_VERIFY = 'SETUP_VERIFY';
10-
exports.TUTORIAL_SET = 'TUTORIAL_SET';
11-
exports.TUTORIAL_UPDATE = 'TUTORIAL_UPDATE';
12-
exports.TUTORIALS_FIND = 'TUTORIALS_FIND';

lib/actions/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ exports.progressPagePositionLoad = progress_1.progressPagePositionLoad;
77
var page_1 = require('./page');
88
exports.pageSet = page_1.pageSet;
99
exports.pageNext = page_1.pageNext;
10-
var tutorial_1 = require('./tutorial');
11-
exports.tutorialsFind = tutorial_1.tutorialsFind;
12-
exports.tutorialSet = tutorial_1.tutorialSet;
13-
exports.tutorialUpdate = tutorial_1.tutorialUpdate;
1410
var toggle_1 = require('./toggle');
1511
exports.devToolsToggle = toggle_1.devToolsToggle;
1612
var actions_1 = require('../modules/alert/actions');
@@ -29,3 +25,8 @@ exports.testRun = actions_5.testRun;
2925
exports.testResult = actions_5.testResult;
3026
exports.testSave = actions_5.testSave;
3127
exports.testComplete = actions_5.testComplete;
28+
var actions_6 = require('../modules/tutorial/actions');
29+
exports.tutorialSet = actions_6.tutorialSet;
30+
var actions_7 = require('../modules/tutorials/actions');
31+
exports.tutorialsFind = actions_7.tutorialsFind;
32+
exports.tutorialUpdate = actions_7.tutorialUpdate;

lib/components/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ var Routes_1 = require('./Routes');
1111
exports.Routes = Routes_1.default;
1212
var Start_1 = require('./Start');
1313
exports.Start = Start_1.default;
14-
var Tutorials_1 = require('./Tutorials');
15-
exports.Tutorials = Tutorials_1.default;
1614
var Markdown_1 = require('./common/Markdown');
1715
exports.Markdown = Markdown_1.default;
1816
var ContentCard_1 = require('./common/ContentCard');
@@ -23,3 +21,5 @@ var route_1 = require('../modules/route');
2321
exports.RouteButton = route_1.RouteButton;
2422
var setup_1 = require('../modules/setup');
2523
exports.Checks = setup_1.Checks;
24+
var tutorials_1 = require('../modules/tutorials');
25+
exports.Tutorials = tutorials_1.Tutorials;

lib/modules/setup/utils/verify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
var check_system_1 = require('./check-system');
3-
var check_1 = require('../../../reducers/tutorial-list/check');
3+
var check_1 = require('../../tutorials/utils/check');
44
function allTrue(obj) {
55
return Object.values(obj).every(function (x) { return x === true; });
66
}

lib/modules/tests/task-position/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
var types_1 = require('../types');
3-
function taskPositionReducer(taskPosition, action) {
3+
function taskPosition(taskPosition, action) {
44
if (taskPosition === void 0) { taskPosition = 0; }
55
switch (action.type) {
66
case 'PAGE_SET':
@@ -12,4 +12,4 @@ function taskPositionReducer(taskPosition, action) {
1212
}
1313
}
1414
Object.defineProperty(exports, "__esModule", { value: true });
15-
exports.default = taskPositionReducer;
15+
exports.default = taskPosition;

lib/modules/tests/test-run/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var run_1 = require('../utils/run');
44
var editor_1 = require('../../../atom/editor');
55
var pageTimeout = 800;
66
var previous = new Date().getTime();
7-
function runTestReducer(testRun, action) {
7+
function runTest(testRun, action) {
88
if (testRun === void 0) { testRun = false; }
99
switch (action.type) {
1010
case types_1.TEST_RUN:
@@ -27,4 +27,4 @@ function runTestReducer(testRun, action) {
2727
}
2828
}
2929
Object.defineProperty(exports, "__esModule", { value: true });
30-
exports.default = runTestReducer;
30+
exports.default = runTest;

lib/modules/tutorial/actions.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"use strict";
2+
var types_1 = require('./types');
3+
var actions_1 = require('../../actions');
4+
function tutorialSet(name) {
5+
return function (dispatch, getState) {
6+
var dir = getState().dir;
7+
dispatch({ type: types_1.TUTORIAL_SET, payload: { name: name, dir: dir } });
8+
dispatch(actions_1.progressLoad());
9+
dispatch(actions_1.routeSet('progress'));
10+
};
11+
}
12+
exports.tutorialSet = tutorialSet;

lib/modules/tutorial/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"use strict";
2+
var reducer_1 = require('./reducer');
3+
exports.reducer = reducer_1.default;

lib/reducers/tutorial/index.js renamed to lib/modules/tutorial/reducer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use strict";
22
var path_1 = require('path');
3-
var tutorial_config_1 = require('./tutorial-config');
4-
var _types_1 = require('../../actions/_types');
5-
var config_paths_1 = require('./config-paths');
3+
var tutorial_config_1 = require('./utils/tutorial-config');
4+
var types_1 = require('./types');
5+
var config_paths_1 = require('./utils/config-paths');
66
var _tutorial = {
77
name: null,
88
info: null,
@@ -13,7 +13,7 @@ var _tutorial = {
1313
function tutorialReducer(tutorial, action) {
1414
if (tutorial === void 0) { tutorial = _tutorial; }
1515
switch (action.type) {
16-
case _types_1.TUTORIAL_SET:
16+
case types_1.TUTORIAL_SET:
1717
var _a = action.payload, name_1 = _a.name, dir = _a.dir;
1818
var packagePath = path_1.join(dir, 'node_modules', name_1);
1919
var packageJson = require(path_1.join(packagePath, 'package.json'));

lib/modules/tutorial/types.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"use strict";
2+
exports.TUTORIAL_SET = 'TUTORIAL_SET';

0 commit comments

Comments
 (0)