This repository was archived by the owner on Apr 8, 2020. It is now read-only.
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.
33This project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
44
55## [ 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'
78- much improved setup ui & checks
89 - check Node, NPM versions
910 - Stepper UI
11+ - loading tutorials
12+ - check for new versions
13+ - update tutorial button
1014- remove 'lodash' dependency
1115- attach hints to toolbar
1216
Original file line number Diff line number Diff line change 11"use strict" ;
22var check_system_1 = require ( './check-system' ) ;
33var root_package_1 = require ( '../../services/root-package' ) ;
4+ var check_tutorials_1 = require ( '../tutorials/check-tutorials' ) ;
45var result = function ( x ) { return x ; } ;
56function allTrue ( obj ) {
67 return Object . values ( obj ) . every ( function ( x ) { return x === true ; } ) ;
78}
8- function hasTutorialDep ( ) {
9- var tutorials = root_package_1 . default . getTutorials ( ) ;
10- return ! ! tutorials && tutorials . length > 0 ;
11- }
129function setupVerify ( ) {
1310 var dir = ! ! window . coderoad . dir ;
1411 var packageJson = false ;
1512 var tutorial = false ;
1613 root_package_1 . default . set ( ) ;
14+ var pj = root_package_1 . default . get ( ) ;
1715 if ( dir ) {
18- packageJson = ! ! root_package_1 . default . get ( ) ;
16+ packageJson = ! ! pj ;
1917 }
2018 if ( dir && packageJson ) {
21- tutorial = hasTutorialDep ( ) ;
19+ tutorial = ! ! check_tutorials_1 . searchForTutorials ( pj . dependencies ) . length || ! ! check_tutorials_1 . searchForTutorials ( pj . devDependencies ) . length ;
2220 }
2321 var checks = {
2422 system : {
Original file line number Diff line number Diff line change 22var _types_1 = require ( '../../actions/_types' ) ;
33var update_tutorial_1 = require ( './update-tutorial' ) ;
44var root_package_1 = require ( '../../services/root-package' ) ;
5+ var check_tutorials_1 = require ( './check-tutorials' ) ;
56function tutorialsReducer ( tutorials , action ) {
67 if ( tutorials === void 0 ) { tutorials = [ ] ; }
78 switch ( action . type ) {
89 case _types_1 . TUTORIAL_UPDATE :
910 update_tutorial_1 . tutorialUpdate ( action . payload . name ) ;
1011 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 ) ) ) ;
1216 default :
1317 return tutorials ;
1418 }
Original file line number Diff line number Diff line change 22var fs_1 = require ( 'fs' ) ;
33var exists_1 = require ( './exists' ) ;
44var path_1 = require ( 'path' ) ;
5- var check_tutorials_1 = require ( '../reducers/tutorials/check-tutorials' ) ;
65var RootPackageService = ( function ( ) {
76 function RootPackageService ( ) {
87 this . packageJson = null ;
@@ -19,16 +18,6 @@ var RootPackageService = (function () {
1918 RootPackageService . prototype . get = function ( ) {
2019 return this . packageJson ;
2120 } ;
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- } ;
3221 return RootPackageService ;
3322} ( ) ) ;
3423Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
Original file line number Diff line number Diff line change 11import { npmMinVersion , nodeMinVersion } from './check-system' ;
2- // import {hasDirectory} from './check-setup';
32import RootPackage from '../../services/root-package' ;
3+ import { searchForTutorials } from '../tutorials/check-tutorials' ;
44
55const result = ( x ) => x ;
66function allTrue ( obj : Object ) : boolean {
77 return Object . values ( obj ) . every ( ( x ) => x === true ) ;
88}
99
10- function hasTutorialDep ( ) : boolean {
11- const tutorials = RootPackage . getTutorials ( ) ;
12- return ! ! tutorials && tutorials . length > 0 ;
13- }
14-
1510export default function setupVerify ( ) : CR . Checks {
1611 let dir = ! ! window . coderoad . dir ;
1712 let packageJson = false ;
1813 let tutorial = false ;
1914
2015 RootPackage . set ( ) ;
16+ let pj = RootPackage . get ( ) ;
2117
2218 if ( dir ) {
23- packageJson = ! ! RootPackage . get ( ) ;
19+ packageJson = ! ! pj ;
2420 }
2521 if ( dir && packageJson ) {
26- tutorial = hasTutorialDep ( ) ;
22+ tutorial = ! ! searchForTutorials ( pj . dependencies ) . length || ! ! searchForTutorials ( pj . devDependencies ) . length ;
2723 }
2824
2925 let checks : CR . Checks = {
Original file line number Diff line number Diff line change 11import { TUTORIAL_UPDATE , TUTORIALS_FIND } from '../../actions/_types' ;
22import { tutorialUpdate } from './update-tutorial' ;
33import RootPackage from '../../services/root-package' ;
4+ import { searchForTutorials } from './check-tutorials' ;
45
56export default function tutorialsReducer ( tutorials = [ ] ,
67 action : CR . Action ) : CR . Tutorial [ ] {
@@ -9,7 +10,10 @@ export default function tutorialsReducer(tutorials = [],
910 tutorialUpdate ( action . payload . name ) ;
1011 /* falls through */
1112 case TUTORIALS_FIND :
12- return RootPackage . getTutorials ( ) ;
13+ const packageJson = RootPackage . get ( ) ;
14+ return ( [ ]
15+ . concat ( searchForTutorials ( packageJson . dependencies ) )
16+ . concat ( searchForTutorials ( packageJson . devDependencies ) ) ) ;
1317 default :
1418 return tutorials ;
1519 }
Original file line number Diff line number Diff line change 11import { readFileSync } from 'fs' ;
22import { fileExists } from './exists' ;
33import { join } from 'path' ;
4- import { searchForTutorials } from '../reducers/tutorials/check-tutorials' ;
54
65class RootPackageService {
76 packageJson : PackageJson ;
@@ -20,14 +19,5 @@ class RootPackageService {
2019 get ( ) : PackageJson {
2120 return this . packageJson ;
2221 }
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- }
3222}
3323export default new RootPackageService ( ) ;
You can’t perform that action at this time.
0 commit comments