We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent61bdd7c commitffa81b0Copy full SHA for ffa81b0
lib/atom/main.js
@@ -2,6 +2,8 @@
2
varrender_1=require('../components/render');
3
varpolyfills_1=require('../services/polyfills');
4
varsubscriptions_1=require('./subscriptions');
5
+varstore_1=require('../store/store');
6
+varAction=require('../actions/actions');
7
functionsetDir(){
8
if(atom.project.rootDirectories.length>0){
9
returnatom.project.rootDirectories[0].path;
@@ -15,11 +17,12 @@ function setWin() {
15
17
}
16
18
varMain=(function(){
19
functionMain(){
20
+polyfills_1.default();
21
window.coderoad={
22
dir:setDir(),
23
win:setWin()
24
};
-polyfills_1.default();
25
+store_1.store.dispatch(Action.verifySetup());
26
this.root=render_1.initRoot();
27
28
Main.prototype.activate=function(){
lib/reducers/checks/check-system.js
@@ -1,7 +1,7 @@
1
"use strict";
varcommand_line_1=require('../../services/command-line');
+varminVersion=3;
functionnpmVersionThreeOrLater(){
-varminVersion=3;
returnnewPromise(function(resolve,reject){
varthreeOrLater=command_line_1.default('npm','-v').then(function(res){returnparseInt(res,10)>=minVersion;});
if(!threeOrLater){
lib/reducers/checks/setup.js
@@ -14,12 +14,12 @@ function verifySetup() {
14
varchecks={
system:{
node:true,
-npm:check_system_1.npmVersionThreeOrLater().then(result)
+npm:!!check_system_1.npmVersionThreeOrLater()
},
setup:{
-dir:check_setup_1.hasDirectory().then(result),
-packageJson:check_setup_1.hasPackageJson().then(result),
-tutorial:check_setup_1.hasTutorialDep().then(result)
+dir:!!check_setup_1.hasDirectory(),
+packageJson:!!check_setup_1.hasPackageJson(),
+tutorial:!!check_setup_1.hasTutorialDep()
checks.passed=verified(checks);
src/atom/main.ts
@@ -4,6 +4,11 @@ import {render, initRoot, togglePanel} from '../components/render';
importloadPolyfillsfrom'../services/polyfills';
import{onActivate,onDeactivate,addToStatusBar}from'./subscriptions';
+import{store}from'../store/store';
+import*asActionfrom'../actions/actions';
+
10
+// TODO: find a better place to load globals
11
12
functionsetDir():string{
13
@@ -19,11 +24,12 @@ class Main {
root:HTMLElement;
statusBarTile:StatusBar.IStatusBarView;
constructor(){
+loadPolyfills();// remove with later version of Chrome
29
30
31
-loadPolyfills();
32
+store.dispatch(Action.verifySetup());
33
this.root=initRoot();
34
35
activate():void{
src/reducers/checks/check-system.ts
importcommandLinefrom'../../services/command-line';
+constminVersion=3;
exportfunctionnpmVersionThreeOrLater():Promise<boolean>{
-constminVersion=3;
returnnewPromise((resolve,reject)=>{
letthreeOrLater:Promise<boolean>=commandLine('npm','-v').then((res:string)=>parseInt(res,10)>=minVersion);
src/reducers/checks/setup.ts
@@ -21,12 +21,12 @@ export default function verifySetup(): CR.Checks {
letchecks:CR.Checks={
-npm:npmVersionThreeOrLater().then(result)
+npm:!!npmVersionThreeOrLater()
-dir:hasDirectory().then(result),
-packageJson:hasPackageJson().then(result),
-tutorial:hasTutorialDep().then(result)
+dir:!!hasDirectory(),
+packageJson:!!hasPackageJson(),
+tutorial:!!hasTutorialDep()
src/reducers/globals/globals.ts
@@ -1,5 +1,5 @@
import*asTypefrom'../../actions/actionTypes';
-import{setWin,setGlobals}from'./set-globals';
+import{setGlobals}from'./set-globals';
// TODO: refactor out globals into state
src/reducers/tutorials/check-tutorials.ts
@@ -7,7 +7,7 @@ import {canUpdateTutorial} from './update-tutorial';
lettutorialError='This is an error with the tutorial itself';
exportfunctionpackageJsonExists():boolean{
-console.log('packageJsonExists?')
+console.log('packageJsonExists?');
constpathToPackageJson=path.join(window.coderoad.dir,'package.json');
returnfileExists(pathToPackageJson);