Skip to content

Commit f22cb6d

Browse files
committed
Initial Project scaffolding
1 parent 4298d57 commit f22cb6d

12 files changed

Lines changed: 1050 additions & 1069 deletions

.eslintignore

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
11
**/node_modules/**/*.js
22
src/thirdparty/**
3-
src/assets/new-project/assets/thirdparty/**
4-
src/widgets/bootstrap-*.js
5-
src/extensions/**/unittest-files/**/*.js
6-
src/extensions/**/thirdparty/**/*.js
7-
src/extensions/dev/**
8-
src/extensions/disabled/**
93
src/**/*-min.js
104
src/**/*.min.js
11-
src/virtual-server-main.js
12-
src/service-worker.js
13-
14-
test/perf/*-files/**/*.js
15-
test/spec/*-files/**/*.js
16-
test/spec/*-known-goods/**/*.js
17-
test/spec/FindReplace-test-files-*/**/*.js
18-
test/smokes/**
19-
test/temp/**
20-
test/thirdparty/**
21-
test/**/node_modules/**/*.js
22-
test/virtual-server-test.js
23-
24-

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"extends": "eslint:recommended",
1111
"parserOptions": {
12-
"ecmaVersion": 2017,
12+
"ecmaVersion": 2019,
1313
"sourceType": "module"
1414
},
1515
"rules": {

example/index.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
/* eslint no-console:0 */
22

3-
import { Workbox } from 'https://storage.googleapis.com/workbox-cdn/releases/4.0.0/workbox-window.prod.mjs';
3+
import {Workbox} from 'https://storage.googleapis.com/workbox-cdn/releases/4.0.0/workbox-window.prod.mjs';
44

55
function serverReady() {
6-
console.log('Server ready! use `window.Filer.fs if you need an fs');
6+
console.log('Server ready! use `window.Filer.fs if you need an fs');
77
}
88

99
function serverInstall() {
10-
console.log('Server installed for first time');
10+
console.log('Server installed for first time');
1111

12-
const fs = window.Filer.fs;
13-
fs.writeFile('/The Bridge.txt', 'hello world!', function(err) {
14-
if(err) console.error(err);
15-
});
12+
const fs = window.Filer.fs;
13+
fs.writeFile('/The Bridge.txt', 'hello world!', function (err) {
14+
if (err) console.error(err);
15+
});
1616
}
1717

1818
/**
1919
* Register the nohost service worker, passing `route` or other options.
2020
*/
2121
if ('serviceWorker' in navigator) {
22-
const wb = new Workbox('/nohost-sw.js?debug');
22+
const wb = new Workbox('/nohost-sw.js?debug');
2323

24-
// Wait on the server to be fully ready to handle routing requests
25-
wb.controlling.then(serverReady);
24+
// Wait on the server to be fully ready to handle routing requests
25+
wb.controlling.then(serverReady);
2626

27-
// Deal with first-run install, if necessary
28-
wb.addEventListener('installed', (event) => {
29-
if(!event.isUpdate) {
30-
serverInstall();
31-
}
32-
});
27+
// Deal with first-run install, if necessary
28+
wb.addEventListener('installed', (event) => {
29+
if (!event.isUpdate) {
30+
serverInstall();
31+
}
32+
});
3333

34-
wb.register();
34+
wb.register();
3535
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"license": "GNU-AGPL3.0",
1414
"scripts": {
1515
"eslint": "eslint src example",
16+
"eslint:fix": "eslint src example --fix",
1617
"test": "npm run eslint",
1718
"build-example": "copyfiles -u 1 example/index* dist",
1819
"build-sw": "parcel build src/fslib.js --detailed-report",

src/filerlib_copy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ async function _copyFolder(srcFolder, dst) {
130130
}
131131
}
132132

133-
async function copy(src, dst, callback, recursive = true) {
133+
async function copy(src, dst, callback) {
134134
try {
135135
let srcStat = await _stat(src);
136136
if(!srcStat){

src/fslib.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
/*eslint no-console: 0*/
2222
/*eslint strict: ["error", "global"]*/
2323

24-
import ERR_CODES, {Errors} from "./errno.js";
25-
import NativeFS from "./fslib_native.js";
26-
import Constants from "./constants.js";
27-
import Mounts from "./fslib_mounts.js";
28-
import FsWatch from "./fslib_watch.js";
29-
import filerCopy from "./filerlib_copy.js";
24+
import ERR_CODES, {Errors} from './errno.js';
25+
import NativeFS from './fslib_native.js';
26+
import Constants from './constants.js';
27+
import Mounts from './fslib_mounts.js';
28+
import FsWatch from './fslib_watch.js';
29+
import filerCopy from './filerlib_copy.js';
3030

3131
let filerLib = null;
3232
let filerShell = null;

src/fslib_mounts.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
/*eslint strict: ["error", "global"]*/
2323

2424

25-
import {Errors} from "./errno.js";
26-
import MountPointsStore from "./mount_point_storage.js";
27-
import Constants from "./constants.js";
25+
import {Errors} from './errno.js';
26+
import MountPointsStore from './mount_point_storage.js';
27+
import Constants from './constants.js';
2828

2929
const MOUNT_POINT_CHANGED_NOTIFICATION = 'PHOENIX_MOUNT_POINT_CHANGED_NOTIFICATION';
3030

src/fslib_native.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
*/
1818

1919
// jshint ignore: start
20-
/*global Blob, Response, TextDecoder, buffer*/
20+
/*global TextDecoder, buffer*/
2121
/*eslint no-console: 0*/
2222
/*eslint strict: ["error", "global"]*/
2323

24-
import Mounts from "./fslib_mounts.js";
25-
import {Errors} from "./errno.js";
26-
import Constants from "./constants.js";
27-
import Utils from "./utils.js";
24+
import Mounts from './fslib_mounts.js';
25+
import {Errors} from './errno.js';
26+
import Constants from './constants.js';
27+
import Utils from './utils.js';
2828

2929

3030
async function _listDir(handle, callback) {

src/fslib_watch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
let _channel = null;
2626
let _watchListeners = [];
27-
let _globmatch = require("./thirdparty/globmatch");
27+
let _globmatch = require('./thirdparty/globmatch');
2828

2929
const WATCH_EVENT_NOTIFICATION = 'PHOENIX_WATCH_EVENT_NOTIFICATION';
3030
const WATCH_EVENT_CREATED = 'created';
@@ -80,7 +80,7 @@ function _processFsWatchEvent(event, broadcast=true) {
8080
function _listenToExternalFsWatchEvents() {
8181
_setupBroadcastChannel();
8282
_channel.onmessage = async function(event) {
83-
console.log("External fs watch event: ", event.data);
83+
console.log('External fs watch event: ', event.data);
8484
_processFsWatchEvent(event.data, false);
8585
};
8686
}

src/mount_point_storage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/**
2525
* Persists serialised mounted native file system handles to indexed db to usage across tabs and sessions.
2626
**/
27-
import Constants from "./constants.js";
27+
import Constants from './constants.js';
2828

2929
const PHOENIX_MOUNTS_DB_NAME = 'PHOENIX_MOUNTS';
3030
const STORE_NAME = 'FS_ACCESS';

0 commit comments

Comments
 (0)