Skip to content

Commit d0b6458

Browse files
committed
Merge pull request #150 from parallaxinc/replace-browserify-fs
replace browserify-fs with chrome-sync-fs
2 parents 04e9083 + 6d2419f commit d0b6458

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"default_locale": "en",
77
"permissions": [
88
"serial",
9-
"unlimitedStorage"
9+
"unlimitedStorage",
10+
"syncFileSystem"
1011
],
1112
"icons": {
1213
"16": "icons/icon16.png",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"alt": "^0.16.7",
1111
"bs2-serial": "^0.8.0",
1212
"codemirror": "^4.13.0",
13-
"frylord": "^0.5.0",
13+
"frylord": "^0.6.0",
1414
"holovisor": "^0.2.0",
1515
"iggins": "^0.2.1",
1616
"irken": "^0.6.1",
@@ -33,8 +33,8 @@
3333
"babel-runtime": "^4.7.16",
3434
"babelify": "^5.0.4",
3535
"browser-serialport": "git://github.com/garrows/browser-serialport#update",
36-
"browserify-fs": "^1.0.0",
3736
"chalk": "^1.0.0",
37+
"chrome-sync-fs": "git://github.com/2fast2fourier/chrome-sync-fs#sync-fs",
3838
"css-loader": "^0.9.1",
3939
"del": "^1.1.1",
4040
"expect": "git://github.com/phated/expect",

plugins/sidebar/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ function sidebar(app, opts, done){
3232

3333
editorStore.workspace = space;
3434

35+
function refreshDirectory(){
36+
// TODO: expose a method to refresh directory without changing it
37+
space.changeDir(space.cwd.deref());
38+
}
39+
40+
// TODO: move into frylord?
41+
chrome.syncFileSystem.onFileStatusChanged.addListener(function(detail){
42+
if(detail.direction === 'remote_to_local'){
43+
refreshDirectory();
44+
}
45+
});
46+
chrome.syncFileSystem.onServiceStatusChanged.addListener(refreshDirectory);
47+
3548
function loadFile(filename, cb = noop){
3649
if(filename){
3750
space.loadFile(filename, (err) => {

webpack.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ module.exports = {
5555
// inside a symlinked subdependency
5656
root: path.join(__dirname, 'node_modules'),
5757
alias: {
58-
// replacing `fs` with a browser-compatible version
59-
fs: 'browserify-fs',
60-
'graceful-fs': 'browserify-fs',
58+
// replacing `fs` with a Chrome syncFileSystem version
59+
fs: 'chrome-sync-fs',
60+
'graceful-fs': 'chrome-sync-fs',
6161
memdown: 'level-js',
6262
serialport: 'browser-serialport'
6363
}

0 commit comments

Comments
 (0)