File tree Expand file tree Collapse file tree 7 files changed +23
-38
lines changed Expand file tree Collapse file tree 7 files changed +23
-38
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,14 @@ All notable changes to this project will be documented in this file.
3
3
This project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
4
4
5
5
## [ 0.7.0] - in progress
6
- - move to 'material-ui@0.15-beta.1'
6
+ - update to 'react@15'
7
+ - move to 'material-ui@0.15'
7
8
- much improved setup ui & checks
8
9
- check Node, NPM versions
9
10
- Stepper UI
11
+ - loading tutorials
12
+ - check for new versions
13
+ - update tutorial button
10
14
- remove 'lodash' dependency
11
15
- attach hints to toolbar
12
16
Original file line number Diff line number Diff line change 1
1
"use strict" ;
2
2
var check_system_1 = require ( './check-system' ) ;
3
3
var root_package_1 = require ( '../../services/root-package' ) ;
4
+ var check_tutorials_1 = require ( '../tutorials/check-tutorials' ) ;
4
5
var result = function ( x ) { return x ; } ;
5
6
function allTrue ( obj ) {
6
7
return Object . values ( obj ) . every ( function ( x ) { return x === true ; } ) ;
7
8
}
8
- function hasTutorialDep ( ) {
9
- var tutorials = root_package_1 . default . getTutorials ( ) ;
10
- return ! ! tutorials && tutorials . length > 0 ;
11
- }
12
9
function setupVerify ( ) {
13
10
var dir = ! ! window . coderoad . dir ;
14
11
var packageJson = false ;
15
12
var tutorial = false ;
16
13
root_package_1 . default . set ( ) ;
14
+ var pj = root_package_1 . default . get ( ) ;
17
15
if ( dir ) {
18
- packageJson = ! ! root_package_1 . default . get ( ) ;
16
+ packageJson = ! ! pj ;
19
17
}
20
18
if ( dir && packageJson ) {
21
- tutorial = hasTutorialDep ( ) ;
19
+ tutorial = ! ! check_tutorials_1 . searchForTutorials ( pj . dependencies ) . length || ! ! check_tutorials_1 . searchForTutorials ( pj . devDependencies ) . length ;
22
20
}
23
21
var checks = {
24
22
system : {
Original file line number Diff line number Diff line change 2
2
var _types_1 = require ( '../../actions/_types' ) ;
3
3
var update_tutorial_1 = require ( './update-tutorial' ) ;
4
4
var root_package_1 = require ( '../../services/root-package' ) ;
5
+ var check_tutorials_1 = require ( './check-tutorials' ) ;
5
6
function tutorialsReducer ( tutorials , action ) {
6
7
if ( tutorials === void 0 ) { tutorials = [ ] ; }
7
8
switch ( action . type ) {
8
9
case _types_1 . TUTORIAL_UPDATE :
9
10
update_tutorial_1 . tutorialUpdate ( action . payload . name ) ;
10
11
case _types_1 . TUTORIALS_FIND :
11
- return root_package_1 . default . getTutorials ( ) ;
12
+ var packageJson = root_package_1 . default . get ( ) ;
13
+ return ( [ ]
14
+ . concat ( check_tutorials_1 . searchForTutorials ( packageJson . dependencies ) )
15
+ . concat ( check_tutorials_1 . searchForTutorials ( packageJson . devDependencies ) ) ) ;
12
16
default :
13
17
return tutorials ;
14
18
}
Original file line number Diff line number Diff line change 2
2
var fs_1 = require ( 'fs' ) ;
3
3
var exists_1 = require ( './exists' ) ;
4
4
var path_1 = require ( 'path' ) ;
5
- var check_tutorials_1 = require ( '../reducers/tutorials/check-tutorials' ) ;
6
5
var RootPackageService = ( function ( ) {
7
6
function RootPackageService ( ) {
8
7
this . packageJson = null ;
@@ -19,16 +18,6 @@ var RootPackageService = (function () {
19
18
RootPackageService . prototype . get = function ( ) {
20
19
return this . packageJson ;
21
20
} ;
22
- RootPackageService . prototype . getTutorials = function ( ) {
23
- if ( this . packageJson ) {
24
- return ( [ ]
25
- . concat ( check_tutorials_1 . searchForTutorials ( this . packageJson . dependencies ) )
26
- . concat ( check_tutorials_1 . searchForTutorials ( this . packageJson . devDependencies ) ) ) ;
27
- }
28
- else {
29
- return null ;
30
- }
31
- } ;
32
21
return RootPackageService ;
33
22
} ( ) ) ;
34
23
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
Original file line number Diff line number Diff line change 1
1
import { npmMinVersion , nodeMinVersion } from './check-system' ;
2
- // import {hasDirectory} from './check-setup';
3
2
import RootPackage from '../../services/root-package' ;
3
+ import { searchForTutorials } from '../tutorials/check-tutorials' ;
4
4
5
5
const result = ( x ) => x ;
6
6
function allTrue ( obj : Object ) : boolean {
7
7
return Object . values ( obj ) . every ( ( x ) => x === true ) ;
8
8
}
9
9
10
- function hasTutorialDep ( ) : boolean {
11
- const tutorials = RootPackage . getTutorials ( ) ;
12
- return ! ! tutorials && tutorials . length > 0 ;
13
- }
14
-
15
10
export default function setupVerify ( ) : CR . Checks {
16
11
let dir = ! ! window . coderoad . dir ;
17
12
let packageJson = false ;
18
13
let tutorial = false ;
19
14
20
15
RootPackage . set ( ) ;
16
+ let pj = RootPackage . get ( ) ;
21
17
22
18
if ( dir ) {
23
- packageJson = ! ! RootPackage . get ( ) ;
19
+ packageJson = ! ! pj ;
24
20
}
25
21
if ( dir && packageJson ) {
26
- tutorial = hasTutorialDep ( ) ;
22
+ tutorial = ! ! searchForTutorials ( pj . dependencies ) . length || ! ! searchForTutorials ( pj . devDependencies ) . length ;
27
23
}
28
24
29
25
let checks : CR . Checks = {
Original file line number Diff line number Diff line change 1
1
import { TUTORIAL_UPDATE , TUTORIALS_FIND } from '../../actions/_types' ;
2
2
import { tutorialUpdate } from './update-tutorial' ;
3
3
import RootPackage from '../../services/root-package' ;
4
+ import { searchForTutorials } from './check-tutorials' ;
4
5
5
6
export default function tutorialsReducer ( tutorials = [ ] ,
6
7
action : CR . Action ) : CR . Tutorial [ ] {
@@ -9,7 +10,10 @@ export default function tutorialsReducer(tutorials = [],
9
10
tutorialUpdate ( action . payload . name ) ;
10
11
/* falls through */
11
12
case TUTORIALS_FIND :
12
- return RootPackage . getTutorials ( ) ;
13
+ const packageJson = RootPackage . get ( ) ;
14
+ return ( [ ]
15
+ . concat ( searchForTutorials ( packageJson . dependencies ) )
16
+ . concat ( searchForTutorials ( packageJson . devDependencies ) ) ) ;
13
17
default :
14
18
return tutorials ;
15
19
}
Original file line number Diff line number Diff line change 1
1
import { readFileSync } from 'fs' ;
2
2
import { fileExists } from './exists' ;
3
3
import { join } from 'path' ;
4
- import { searchForTutorials } from '../reducers/tutorials/check-tutorials' ;
5
4
6
5
class RootPackageService {
7
6
packageJson : PackageJson ;
@@ -20,14 +19,5 @@ class RootPackageService {
20
19
get ( ) : PackageJson {
21
20
return this . packageJson ;
22
21
}
23
- getTutorials ( ) : CR . Tutorial [ ] {
24
- if ( this . packageJson ) {
25
- return ( [ ]
26
- . concat ( searchForTutorials ( this . packageJson . dependencies ) )
27
- . concat ( searchForTutorials ( this . packageJson . devDependencies ) ) ) ;
28
- } else {
29
- return null ;
30
- }
31
- }
32
22
}
33
23
export default new RootPackageService ( ) ;
You can’t perform that action at this time.
0 commit comments