diff --git a/CliClient/app/file-api-test.js b/CliClient/app/file-api-test.js index 22459bf771..ac9998728b 100644 --- a/CliClient/app/file-api-test.js +++ b/CliClient/app/file-api-test.js @@ -1,8 +1,8 @@ -import { FileApi } from 'src/file-api.js'; -import { FileApiDriverLocal } from 'src/file-api-driver-local.js'; -import { Database } from 'src/database.js'; -import { DatabaseDriverNode } from 'src/database-driver-node.js'; -import { Log } from 'src/log.js'; +import { FileApi } from 'lib/file-api.js'; +import { FileApiDriverLocal } from 'lib/file-api-driver-local.js'; +import { Database } from 'lib/database.js'; +import { DatabaseDriverNode } from 'lib/database-driver-node.js'; +import { Log } from 'lib/log.js'; const fs = require('fs'); diff --git a/CliClient/app/import-enex.js b/CliClient/app/import-enex.js index baf2b27816..a09ecdcc94 100644 --- a/CliClient/app/import-enex.js +++ b/CliClient/app/import-enex.js @@ -1,12 +1,12 @@ require('app-module-path').addPath(__dirname); -import { uuid } from 'src/uuid.js'; +import { uuid } from 'lib/uuid.js'; import moment from 'moment'; -import { promiseChain } from 'src/promise-utils.js'; -import { folderItemFilename } from 'src/string-utils.js' -import { BaseModel } from 'src/base-model.js'; -import { Note } from 'src/models/note.js'; -import { Folder } from 'src/models/folder.js'; +import { promiseChain } from 'lib/promise-utils.js'; +import { folderItemFilename } from 'lib/string-utils.js' +import { BaseModel } from 'lib/base-model.js'; +import { Note } from 'lib/models/note.js'; +import { Folder } from 'lib/models/folder.js'; import jsSHA from "jssha"; const Promise = require('promise'); diff --git a/CliClient/app/lib b/CliClient/app/lib new file mode 120000 index 0000000000..7385a30666 --- /dev/null +++ b/CliClient/app/lib @@ -0,0 +1 @@ +/var/www/joplin/CliClient/../lib \ No newline at end of file diff --git a/CliClient/app/main.js b/CliClient/app/main.js index fc07971841..14d5e2fa12 100644 --- a/CliClient/app/main.js +++ b/CliClient/app/main.js @@ -1,20 +1,20 @@ require('source-map-support').install(); require('babel-plugin-transform-runtime'); -import { FileApi } from 'src/file-api.js'; -import { FileApiDriverOneDrive } from 'src/file-api-driver-onedrive.js'; -import { Database } from 'src/database.js'; -import { DatabaseDriverNode } from 'src/database-driver-node.js'; -import { BaseModel } from 'src/base-model.js'; -import { Folder } from 'src/models/folder.js'; -import { Note } from 'src/models/note.js'; -import { Setting } from 'src/models/setting.js'; -import { Synchronizer } from 'src/synchronizer.js'; -import { Logger } from 'src/logger.js'; -import { uuid } from 'src/uuid.js'; +import { FileApi } from 'lib/file-api.js'; +import { FileApiDriverOneDrive } from 'lib/file-api-driver-onedrive.js'; +import { Database } from 'lib/database.js'; +import { DatabaseDriverNode } from 'lib/database-driver-node.js'; +import { BaseModel } from 'lib/base-model.js'; +import { Folder } from 'lib/models/folder.js'; +import { Note } from 'lib/models/note.js'; +import { Setting } from 'lib/models/setting.js'; +import { Synchronizer } from 'lib/synchronizer.js'; +import { Logger } from 'lib/logger.js'; +import { uuid } from 'lib/uuid.js'; import { sprintf } from 'sprintf-js'; import { importEnex } from 'import-enex'; -import { _ } from 'src/locale.js'; +import { _ } from 'lib/locale.js'; import os from 'os'; import fs from 'fs-extra'; diff --git a/CliClient/app/onedrive-server.js b/CliClient/app/onedrive-server.js index eecbe25bff..9a94acdad8 100644 --- a/CliClient/app/onedrive-server.js +++ b/CliClient/app/onedrive-server.js @@ -1,7 +1,7 @@ require('source-map-support').install(); require('babel-plugin-transform-runtime'); -import { OneDriveApi } from 'src/onedrive-api.js'; +import { OneDriveApi } from 'lib/onedrive-api.js'; const fetch = require('node-fetch'); const tcpPortUsed = require('tcp-port-used'); diff --git a/CliClient/app/test-onedrive.js b/CliClient/app/test-onedrive.js index 29cef79d48..82535c0c05 100644 --- a/CliClient/app/test-onedrive.js +++ b/CliClient/app/test-onedrive.js @@ -1,14 +1,14 @@ require('source-map-support').install(); require('babel-plugin-transform-runtime'); -import { OneDriveApi } from 'src/onedrive-api.js'; +import { OneDriveApi } from 'lib/onedrive-api.js'; const MicrosoftGraph = require("@microsoft/microsoft-graph-client"); const fs = require('fs-extra'); const path = require('path'); -import { FileApiDriverOneDrive } from 'src/file-api-driver-onedrive.js'; -import { FileApi } from 'src/file-api.js'; +import { FileApiDriverOneDrive } from 'lib/file-api-driver-onedrive.js'; +import { FileApi } from 'lib/file-api.js'; function configContent() { const configFilePath = path.dirname(__dirname) + '/config.json'; diff --git a/CliClient/package.json b/CliClient/package.json index 6776e8c547..7cf39d51e6 100644 --- a/CliClient/package.json +++ b/CliClient/package.json @@ -39,7 +39,7 @@ }, "scripts": { "babelbuild": "babel app -d build", - "build": "babel-changed app -d build --source-maps && babel-changed app/src/models -d build/src/models --source-maps && babel-changed app/src/services -d build/src/services --source-maps", + "build": "babel-changed app -d build --source-maps && babel-changed app/lib/models -d build/lib/models --source-maps && babel-changed app/lib/services -d build/lib/services --source-maps", "clean": "babel-changed --reset", "test": "babel-changed tests -d tests-build --source-maps && jasmine" } diff --git a/CliClient/run.sh b/CliClient/run.sh index 8cb91b812d..6232a07b26 100755 --- a/CliClient/run.sh +++ b/CliClient/run.sh @@ -1,8 +1,8 @@ #!/bin/bash CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -rm -f "$CLIENT_DIR/app/src" -ln -s "$CLIENT_DIR/../ReactNativeClient/src" "$CLIENT_DIR/app" +rm -f "$CLIENT_DIR/app/lib" +ln -s "$CLIENT_DIR/../lib" "$CLIENT_DIR/app" npm run build && NODE_PATH="$CLIENT_DIR/build/" node build/main.js #npm run build && NODE_PATH="$CLIENT_DIR/build/" node build/test-onedrive.js diff --git a/CliClient/run_test.sh b/CliClient/run_test.sh index 7875747241..d5a1bd98ff 100755 --- a/CliClient/run_test.sh +++ b/CliClient/run_test.sh @@ -1,9 +1,9 @@ #!/bin/bash CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -rm -f "$CLIENT_DIR/tests-build/src" +rm -f "$CLIENT_DIR/tests-build/lib" mkdir -p "$CLIENT_DIR/tests-build/data" -ln -s "$CLIENT_DIR/build/src" "$CLIENT_DIR/tests-build" +ln -s "$CLIENT_DIR/build/lib" "$CLIENT_DIR/tests-build" #npm run build && NODE_PATH="$CLIENT_DIR/tests-build/" npm test tests-build/base-model.js npm run build && NODE_PATH="$CLIENT_DIR/tests-build/" npm test tests-build/synchronizer.js \ No newline at end of file diff --git a/CliClient/sample.enex b/CliClient/sample.enex deleted file mode 100644 index 7008d422d0..0000000000 --- a/CliClient/sample.enex +++ /dev/null @@ -1,48 +0,0 @@ - - - - - Test Note for Export - - - - - Hello, World. -
-
-
-
- -
-
-
-
-
- ]]> -
- 20130730T205204Z - 20130730T205624Z - fake-tag - - 33.88394692352314 - -117.9191355110099 - 96 - Brett Kelly - - - /9j/4AAQSkZJRgABAQAAAQABAAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZ - WiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQ - - kfeIGT/+uufk8DpM0gyVjGfmzkgetesnUoTHJ+5Cxn86zmv4/wB75EW+QHAPUH/P9Ky+s1rtrr/wfvOm - dBSamnq/xPKp/hpLKmS7x4OBjgn6elee6v4OuLJirRSHb/FtyG9s9u1fR0+oTiIRvGq7W4bpisfUGk1C - GVWtkIyM57n1rfDY+uqigtU76ffZkUsA6iajHZ6v/P8A4B//2Q== - image/jpeg - 1280 - 720 - - snapshot-DAE9FC15-88E3-46CF-B744-DA9B1B56EB57.jpg - - -
-
- diff --git a/CliClient/tests/base-model.js b/CliClient/tests/base-model.js index 8528960f6c..e6ea3adff3 100644 --- a/CliClient/tests/base-model.js +++ b/CliClient/tests/base-model.js @@ -1,11 +1,11 @@ -import { time } from 'src/time-utils.js'; +import { time } from 'lib/time-utils.js'; import { setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient } from 'test-utils.js'; import { createFoldersAndNotes } from 'test-data.js'; -import { Folder } from 'src/models/folder.js'; -import { Note } from 'src/models/note.js'; -import { Setting } from 'src/models/setting.js'; -import { BaseItem } from 'src/models/base-item.js'; -import { BaseModel } from 'src/base-model.js'; +import { Folder } from 'lib/models/folder.js'; +import { Note } from 'lib/models/note.js'; +import { Setting } from 'lib/models/setting.js'; +import { BaseItem } from 'lib/models/base-item.js'; +import { BaseModel } from 'lib/base-model.js'; process.on('unhandledRejection', (reason, p) => { console.error('Unhandled promise rejection at: Promise', p, 'reason:', reason); diff --git a/CliClient/tests/services/note-folder-service.js b/CliClient/tests/services/note-folder-service.js index b437d096fe..0759441945 100644 --- a/CliClient/tests/services/note-folder-service.js +++ b/CliClient/tests/services/note-folder-service.js @@ -1,5 +1,5 @@ -import { promiseChain } from 'src/promise-utils.js'; -import { NoteFolderService } from 'src/services/note-folder-service.js'; +import { promiseChain } from 'lib/promise-utils.js'; +import { NoteFolderService } from 'lib/services/note-folder-service.js'; import { setupDatabaseAndSynchronizer } from 'test-utils.js'; import { createFoldersAndNotes } from 'test-data.js'; diff --git a/CliClient/tests/synchronizer.js b/CliClient/tests/synchronizer.js index 6c11c57a2d..a81a1f0194 100644 --- a/CliClient/tests/synchronizer.js +++ b/CliClient/tests/synchronizer.js @@ -1,11 +1,11 @@ -import { time } from 'src/time-utils.js'; +import { time } from 'lib/time-utils.js'; import { setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient } from 'test-utils.js'; import { createFoldersAndNotes } from 'test-data.js'; -import { Folder } from 'src/models/folder.js'; -import { Note } from 'src/models/note.js'; -import { Setting } from 'src/models/setting.js'; -import { BaseItem } from 'src/models/base-item.js'; -import { BaseModel } from 'src/base-model.js'; +import { Folder } from 'lib/models/folder.js'; +import { Note } from 'lib/models/note.js'; +import { Setting } from 'lib/models/setting.js'; +import { BaseItem } from 'lib/models/base-item.js'; +import { BaseModel } from 'lib/base-model.js'; process.on('unhandledRejection', (reason, p) => { console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); diff --git a/CliClient/tests/test-data.js b/CliClient/tests/test-data.js index e497a315af..3f6d9ffd2a 100644 --- a/CliClient/tests/test-data.js +++ b/CliClient/tests/test-data.js @@ -1,6 +1,6 @@ -import { Note } from 'src/models/note.js'; -import { Folder } from 'src/models/folder.js'; -import { promiseChain } from 'src/promise-utils.js'; +import { Note } from 'lib/models/note.js'; +import { Folder } from 'lib/models/folder.js'; +import { promiseChain } from 'lib/promise-utils.js'; function createNotes(id = 1, parentId) { let notes = []; diff --git a/CliClient/tests/test-utils.js b/CliClient/tests/test-utils.js index e259bd067b..053e1ad18a 100644 --- a/CliClient/tests/test-utils.js +++ b/CliClient/tests/test-utils.js @@ -1,14 +1,14 @@ import fs from 'fs-extra'; -import { Database } from 'src/database.js'; -import { DatabaseDriverNode } from 'src/database-driver-node.js'; -import { BaseModel } from 'src/base-model.js'; -import { Folder } from 'src/models/folder.js'; -import { Note } from 'src/models/note.js'; -import { Setting } from 'src/models/setting.js'; -import { BaseItem } from 'src/models/base-item.js'; -import { Synchronizer } from 'src/synchronizer.js'; -import { FileApi } from 'src/file-api.js'; -import { FileApiDriverMemory } from 'src/file-api-driver-memory.js'; +import { Database } from 'lib/database.js'; +import { DatabaseDriverNode } from 'lib/database-driver-node.js'; +import { BaseModel } from 'lib/base-model.js'; +import { Folder } from 'lib/models/folder.js'; +import { Note } from 'lib/models/note.js'; +import { Setting } from 'lib/models/setting.js'; +import { BaseItem } from 'lib/models/base-item.js'; +import { Synchronizer } from 'lib/synchronizer.js'; +import { FileApi } from 'lib/file-api.js'; +import { FileApiDriverMemory } from 'lib/file-api-driver-memory.js'; let databases_ = []; let synchronizers_ = []; diff --git a/ReactNativeClient/index.android.js b/ReactNativeClient/index.android.js index 584a5d31cc..b135da793a 100644 --- a/ReactNativeClient/index.android.js +++ b/ReactNativeClient/index.android.js @@ -1,3 +1,3 @@ -import { main } from 'src/main.js'; +import { main } from 'lib/main.js'; main(); \ No newline at end of file diff --git a/ReactNativeClient/src/components/action-button.js b/ReactNativeClient/src/components/action-button.js index 171a57b5fd..63ddf88864 100644 --- a/ReactNativeClient/src/components/action-button.js +++ b/ReactNativeClient/src/components/action-button.js @@ -3,7 +3,7 @@ import { StyleSheet } from 'react-native'; import Icon from 'react-native-vector-icons/Ionicons'; import ReactNativeActionButton from 'react-native-action-button'; import { connect } from 'react-redux' -import { Log } from 'src/log.js' +import { Log } from 'lib/log.js' const styles = StyleSheet.create({ actionButtonIcon: { diff --git a/ReactNativeClient/src/components/folder-list.js b/ReactNativeClient/src/components/folder-list.js index e1a56ab5d0..1df823143d 100644 --- a/ReactNativeClient/src/components/folder-list.js +++ b/ReactNativeClient/src/components/folder-list.js @@ -1,12 +1,12 @@ import React, { Component } from 'react'; import { connect } from 'react-redux' import { ListView, Text, TouchableHighlight } from 'react-native'; -import { Log } from 'src/log.js'; -import { ItemListComponent } from 'src/components/item-list.js'; -import { Note } from 'src/models/note.js'; -import { Folder } from 'src/models/folder.js'; -import { _ } from 'src/locale.js'; -import { NoteFolderService } from 'src/services/note-folder-service.js'; +import { Log } from 'lib/log.js'; +import { ItemListComponent } from 'lib/components/item-list.js'; +import { Note } from 'lib/models/note.js'; +import { Folder } from 'lib/models/folder.js'; +import { _ } from 'lib/locale.js'; +import { NoteFolderService } from 'lib/services/note-folder-service.js'; class FolderListComponent extends ItemListComponent { diff --git a/ReactNativeClient/src/components/item-list.js b/ReactNativeClient/src/components/item-list.js index e4eacb82b7..06f0a27fb9 100644 --- a/ReactNativeClient/src/components/item-list.js +++ b/ReactNativeClient/src/components/item-list.js @@ -1,11 +1,11 @@ import React, { Component } from 'react'; import { connect } from 'react-redux' import { ListView, Text, TouchableHighlight, Switch, View } from 'react-native'; -import { Log } from 'src/log.js'; -import { _ } from 'src/locale.js'; -import { Checkbox } from 'src/components/checkbox.js'; -import { NoteFolderService } from 'src/services/note-folder-service.js'; -import { Note } from 'src/models/note.js'; +import { Log } from 'lib/log.js'; +import { _ } from 'lib/locale.js'; +import { Checkbox } from 'lib/components/checkbox.js'; +import { NoteFolderService } from 'lib/services/note-folder-service.js'; +import { Note } from 'lib/models/note.js'; class ItemListComponent extends Component { diff --git a/ReactNativeClient/src/components/note-list.js b/ReactNativeClient/src/components/note-list.js index 077ef9f526..e13e93a949 100644 --- a/ReactNativeClient/src/components/note-list.js +++ b/ReactNativeClient/src/components/note-list.js @@ -1,9 +1,9 @@ import React, { Component } from 'react'; import { connect } from 'react-redux' import { ListView, Text, TouchableHighlight } from 'react-native'; -import { Log } from 'src/log.js'; -import { ItemListComponent } from 'src/components/item-list.js'; -import { _ } from 'src/locale.js'; +import { Log } from 'lib/log.js'; +import { ItemListComponent } from 'lib/components/item-list.js'; +import { _ } from 'lib/locale.js'; class NoteListComponent extends ItemListComponent { diff --git a/ReactNativeClient/src/components/screen-header.js b/ReactNativeClient/src/components/screen-header.js index 820f30b3b9..71ecdff285 100644 --- a/ReactNativeClient/src/components/screen-header.js +++ b/ReactNativeClient/src/components/screen-header.js @@ -1,10 +1,10 @@ import React, { Component } from 'react'; import { connect } from 'react-redux' import { View, Text, Button, StyleSheet } from 'react-native'; -import { Log } from 'src/log.js'; +import { Log } from 'lib/log.js'; import { Menu, MenuOptions, MenuOption, MenuTrigger } from 'react-native-popup-menu'; -import { _ } from 'src/locale.js'; -import { Setting } from 'src/models/setting.js'; +import { _ } from 'lib/locale.js'; +import { Setting } from 'lib/models/setting.js'; const styles = StyleSheet.create({ divider: { diff --git a/ReactNativeClient/src/components/screens/folder.js b/ReactNativeClient/src/components/screens/folder.js index 8c29bf604c..bb4902c3ad 100644 --- a/ReactNativeClient/src/components/screens/folder.js +++ b/ReactNativeClient/src/components/screens/folder.js @@ -1,10 +1,10 @@ import React, { Component } from 'react'; import { View, Button, TextInput } from 'react-native'; import { connect } from 'react-redux' -import { Log } from 'src/log.js' -import { Folder } from 'src/models/folder.js' -import { ScreenHeader } from 'src/components/screen-header.js'; -import { NoteFolderService } from 'src/services/note-folder-service.js'; +import { Log } from 'lib/log.js' +import { Folder } from 'lib/models/folder.js' +import { ScreenHeader } from 'lib/components/screen-header.js'; +import { NoteFolderService } from 'lib/services/note-folder-service.js'; class FolderScreenComponent extends React.Component { diff --git a/ReactNativeClient/src/components/screens/folders.js b/ReactNativeClient/src/components/screens/folders.js index 323a8d6362..340b76a938 100644 --- a/ReactNativeClient/src/components/screens/folders.js +++ b/ReactNativeClient/src/components/screens/folders.js @@ -1,11 +1,11 @@ import React, { Component } from 'react'; import { View, Button, Picker, Text, StyleSheet } from 'react-native'; import { connect } from 'react-redux' -import { Log } from 'src/log.js' -import { FolderList } from 'src/components/folder-list.js' -import { ScreenHeader } from 'src/components/screen-header.js'; -import { _ } from 'src/locale.js'; -import { ActionButton } from 'src/components/action-button.js'; +import { Log } from 'lib/log.js' +import { FolderList } from 'lib/components/folder-list.js' +import { ScreenHeader } from 'lib/components/screen-header.js'; +import { _ } from 'lib/locale.js'; +import { ActionButton } from 'lib/components/action-button.js'; class FoldersScreenComponent extends React.Component { diff --git a/ReactNativeClient/src/components/screens/loading.js b/ReactNativeClient/src/components/screens/loading.js index d441c4f98d..6a93ab7228 100644 --- a/ReactNativeClient/src/components/screens/loading.js +++ b/ReactNativeClient/src/components/screens/loading.js @@ -1,10 +1,10 @@ import React, { Component } from 'react'; import { View, Text } from 'react-native'; import { connect } from 'react-redux' -import { Log } from 'src/log.js' -import { Folder } from 'src/models/folder.js' -import { ScreenHeader } from 'src/components/screen-header.js'; -import { NoteFolderService } from 'src/services/note-folder-service.js'; +import { Log } from 'lib/log.js' +import { Folder } from 'lib/models/folder.js' +import { ScreenHeader } from 'lib/components/screen-header.js'; +import { NoteFolderService } from 'lib/services/note-folder-service.js'; class LoadingScreenComponent extends React.Component { diff --git a/ReactNativeClient/src/components/screens/login.js b/ReactNativeClient/src/components/screens/login.js index 3bca677be2..a10c846ae6 100644 --- a/ReactNativeClient/src/components/screens/login.js +++ b/ReactNativeClient/src/components/screens/login.js @@ -1,11 +1,11 @@ import React, { Component } from 'react'; import { View, Button, TextInput, Text } from 'react-native'; import { connect } from 'react-redux' -import { Log } from 'src/log.js' -import { Registry } from 'src/registry.js'; -import { Setting } from 'src/models/setting.js'; -import { ScreenHeader } from 'src/components/screen-header.js'; -import { _ } from 'src/locale.js'; +import { Log } from 'lib/log.js' +import { Registry } from 'lib/registry.js'; +import { Setting } from 'lib/models/setting.js'; +import { ScreenHeader } from 'lib/components/screen-header.js'; +import { _ } from 'lib/locale.js'; class LoginScreenComponent extends React.Component { diff --git a/ReactNativeClient/src/components/screens/note.js b/ReactNativeClient/src/components/screens/note.js index 25d9c4738a..f2a046d567 100644 --- a/ReactNativeClient/src/components/screens/note.js +++ b/ReactNativeClient/src/components/screens/note.js @@ -1,13 +1,13 @@ import React, { Component } from 'react'; import { View, Button, TextInput } from 'react-native'; import { connect } from 'react-redux' -import { Log } from 'src/log.js' -import { Note } from 'src/models/note.js' -import { Registry } from 'src/registry.js' -import { ScreenHeader } from 'src/components/screen-header.js'; -import { Checkbox } from 'src/components/checkbox.js' -import { NoteFolderService } from 'src/services/note-folder-service.js'; -import { _ } from 'src/locale.js'; +import { Log } from 'lib/log.js' +import { Note } from 'lib/models/note.js' +import { Registry } from 'lib/registry.js' +import { ScreenHeader } from 'lib/components/screen-header.js'; +import { Checkbox } from 'lib/components/checkbox.js' +import { NoteFolderService } from 'lib/services/note-folder-service.js'; +import { _ } from 'lib/locale.js'; class NoteScreenComponent extends React.Component { diff --git a/ReactNativeClient/src/components/screens/notes.js b/ReactNativeClient/src/components/screens/notes.js index 5ced433fdc..d3e8ca1126 100644 --- a/ReactNativeClient/src/components/screens/notes.js +++ b/ReactNativeClient/src/components/screens/notes.js @@ -1,13 +1,13 @@ import React, { Component } from 'react'; import { View, Button, Picker } from 'react-native'; import { connect } from 'react-redux' -import { Log } from 'src/log.js' -import { NoteList } from 'src/components/note-list.js' -import { Folder } from 'src/models/folder.js' -import { ScreenHeader } from 'src/components/screen-header.js'; +import { Log } from 'lib/log.js' +import { NoteList } from 'lib/components/note-list.js' +import { Folder } from 'lib/models/folder.js' +import { ScreenHeader } from 'lib/components/screen-header.js'; import { MenuOption, Text } from 'react-native-popup-menu'; -import { _ } from 'src/locale.js'; -import { ActionButton } from 'src/components/action-button.js'; +import { _ } from 'lib/locale.js'; +import { ActionButton } from 'lib/components/action-button.js'; class NotesScreenComponent extends React.Component { diff --git a/ReactNativeClient/src/components/side-menu-content.js b/ReactNativeClient/src/components/side-menu-content.js index accdef6b5b..a292065e79 100644 --- a/ReactNativeClient/src/components/side-menu-content.js +++ b/ReactNativeClient/src/components/side-menu-content.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' import { Button } from 'react-native'; -import { Log } from 'src/log.js'; -import { Note } from 'src/models/note.js'; -import { NoteFolderService } from 'src/services/note-folder-service.js'; +import { Log } from 'lib/log.js'; +import { Note } from 'lib/models/note.js'; +import { NoteFolderService } from 'lib/services/note-folder-service.js'; const React = require('react'); const { diff --git a/ReactNativeClient/src/components/side-menu.js b/ReactNativeClient/src/components/side-menu.js index 54f077fc08..a655db5e2a 100644 --- a/ReactNativeClient/src/components/side-menu.js +++ b/ReactNativeClient/src/components/side-menu.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { connect } from 'react-redux' -import { Log } from 'src/log.js'; +import { Log } from 'lib/log.js'; import SideMenu_ from 'react-native-side-menu'; class SideMenuComponent extends SideMenu_ {}; diff --git a/ReactNativeClient/src/main.js b/ReactNativeClient/src/main.js index 8dd45ecbfb..038d2ed94c 100644 --- a/ReactNativeClient/src/main.js +++ b/ReactNativeClient/src/main.js @@ -7,9 +7,9 @@ // So there's basically still a one way flux: React => SQLite => Redux => React import { AppRegistry } from 'react-native'; -import { Log } from 'src/log.js' -import { Root } from 'src/root.js'; -import { Registry } from 'src/registry.js'; +import { Log } from 'lib/log.js' +import { Root } from 'lib/root.js'; +import { Registry } from 'lib/registry.js'; function main() { Registry.setDebugMode(true); diff --git a/ReactNativeClient/src/package.json b/ReactNativeClient/src/package.json deleted file mode 100644 index 573456ed06..0000000000 --- a/ReactNativeClient/src/package.json +++ /dev/null @@ -1 +0,0 @@ -{ "name": "src" } \ No newline at end of file diff --git a/ReactNativeClient/src/registry.js b/ReactNativeClient/src/registry.js index 836173977d..8c9afaeb43 100644 --- a/ReactNativeClient/src/registry.js +++ b/ReactNativeClient/src/registry.js @@ -4,8 +4,8 @@ // registry should be designed in such a way that they can be converted to use // dependency injection later on (eg. `BaseModel.db()`, `Synchroniser.api()`) -import { Database } from 'src/database.js' -import { WebApi } from 'src/web-api.js' +import { Database } from 'lib/database.js' +import { WebApi } from 'lib/web-api.js' class Registry { diff --git a/ReactNativeClient/src/root.js b/ReactNativeClient/src/root.js index e5eef8bf29..6ce7c205ba 100644 --- a/ReactNativeClient/src/root.js +++ b/ReactNativeClient/src/root.js @@ -6,26 +6,26 @@ import { createStore } from 'redux'; import { combineReducers } from 'redux'; import { StackNavigator } from 'react-navigation'; import { addNavigationHelpers } from 'react-navigation'; -import { Log } from 'src/log.js' -import { Note } from 'src/models/note.js' -import { Folder } from 'src/models/folder.js' -import { BaseModel } from 'src/base-model.js' -import { Database } from 'src/database.js' -import { Registry } from 'src/registry.js' -import { ItemList } from 'src/components/item-list.js' -import { NotesScreen } from 'src/components/screens/notes.js' -import { NoteScreen } from 'src/components/screens/note.js' -import { FolderScreen } from 'src/components/screens/folder.js' -import { FoldersScreen } from 'src/components/screens/folders.js' -import { LoginScreen } from 'src/components/screens/login.js' -import { LoadingScreen } from 'src/components/screens/loading.js' -import { Setting } from 'src/models/setting.js' -import { Synchronizer } from 'src/synchronizer.js' +import { Log } from 'lib/log.js' +import { Note } from 'lib/models/note.js' +import { Folder } from 'lib/models/folder.js' +import { BaseModel } from 'lib/base-model.js' +import { Database } from 'lib/database.js' +import { Registry } from 'lib/registry.js' +import { ItemList } from 'lib/components/item-list.js' +import { NotesScreen } from 'lib/components/screens/notes.js' +import { NoteScreen } from 'lib/components/screens/note.js' +import { FolderScreen } from 'lib/components/screens/folder.js' +import { FoldersScreen } from 'lib/components/screens/folders.js' +import { LoginScreen } from 'lib/components/screens/login.js' +import { LoadingScreen } from 'lib/components/screens/loading.js' +import { Setting } from 'lib/models/setting.js' +import { Synchronizer } from 'lib/synchronizer.js' import { MenuContext } from 'react-native-popup-menu'; -import { SideMenu } from 'src/components/side-menu.js'; -import { SideMenuContent } from 'src/components/side-menu-content.js'; -import { NoteFolderService } from 'src/services/note-folder-service.js'; -import { DatabaseDriverReactNative } from 'src/database-driver-react-native'; +import { SideMenu } from 'lib/components/side-menu.js'; +import { SideMenuContent } from 'lib/components/side-menu-content.js'; +import { NoteFolderService } from 'lib/services/note-folder-service.js'; +import { DatabaseDriverReactNative } from 'lib/database-driver-react-native'; let defaultState = { notes: [], diff --git a/ReactNativeClient/src/services/note-folder-service.js b/ReactNativeClient/src/services/note-folder-service.js index 5f3d144935..ee74a29841 100644 --- a/ReactNativeClient/src/services/note-folder-service.js +++ b/ReactNativeClient/src/services/note-folder-service.js @@ -5,14 +5,14 @@ // - Move setting of geo-location to GUI side (only for note explicitely created on client // - Don't do diffing - make caller explicitely set model properties that need to be saved -import { BaseService } from 'src/base-service.js'; -import { BaseModel } from 'src/base-model.js'; -import { BaseItem } from 'src/models/base-item.js'; -import { Note } from 'src/models/note.js'; -import { Folder } from 'src/models/folder.js'; -import { Log } from 'src/log.js'; -import { time } from 'src/time-utils.js'; -import { Registry } from 'src/registry.js'; +import { BaseService } from 'lib/base-service.js'; +import { BaseModel } from 'lib/base-model.js'; +import { BaseItem } from 'lib/models/base-item.js'; +import { Note } from 'lib/models/note.js'; +import { Folder } from 'lib/models/folder.js'; +import { Log } from 'lib/log.js'; +import { time } from 'lib/time-utils.js'; +import { Registry } from 'lib/registry.js'; class NoteFolderService extends BaseService { diff --git a/ReactNativeClient/src/services/session-service.js b/ReactNativeClient/src/services/session-service.js index eabe67003d..b4a177a1c3 100644 --- a/ReactNativeClient/src/services/session-service.js +++ b/ReactNativeClient/src/services/session-service.js @@ -1,4 +1,4 @@ -import { BaseService } from 'src/base-service.js'; +import { BaseService } from 'lib/base-service.js'; class SessionService extends BaseService { diff --git a/ReactNativeClient/src/shim.js b/ReactNativeClient/src/shim.js index d5e2c450f0..3d5617f89d 100644 --- a/ReactNativeClient/src/shim.js +++ b/ReactNativeClient/src/shim.js @@ -1,4 +1,4 @@ -import { isNode } from 'src/env.js'; +import { isNode } from 'lib/env.js'; const FormData = require('form-data'); const fetch = require('node-fetch'); diff --git a/joplin.sublime-project b/joplin.sublime-project index 64a2ebd70a..7a62cd20f0 100755 --- a/joplin.sublime-project +++ b/joplin.sublime-project @@ -29,6 +29,7 @@ "*.iml", "*.map", "CliClient/app/src", + "CliClient/app/lib", "*.jar", ] } diff --git a/ReactNativeClient/src/base-model.js b/lib/base-model.js similarity index 98% rename from ReactNativeClient/src/base-model.js rename to lib/base-model.js index 6f98118587..253f7bbc72 100644 --- a/ReactNativeClient/src/base-model.js +++ b/lib/base-model.js @@ -1,7 +1,7 @@ -import { Log } from 'src/log.js'; -import { Database } from 'src/database.js'; -import { uuid } from 'src/uuid.js'; -import { time } from 'src/time-utils.js'; +import { Log } from 'lib/log.js'; +import { Database } from 'lib/database.js'; +import { uuid } from 'lib/uuid.js'; +import { time } from 'lib/time-utils.js'; class BaseModel { diff --git a/ReactNativeClient/src/base-service.js b/lib/base-service.js similarity index 70% rename from ReactNativeClient/src/base-service.js rename to lib/base-service.js index d6d0fcd8a2..b66769f829 100644 --- a/ReactNativeClient/src/base-service.js +++ b/lib/base-service.js @@ -1,4 +1,4 @@ -import { Registry } from 'src/registry.js'; +import { Registry } from 'lib/registry.js'; class BaseService { diff --git a/ReactNativeClient/src/database-driver-node.js b/lib/database-driver-node.js similarity index 100% rename from ReactNativeClient/src/database-driver-node.js rename to lib/database-driver-node.js diff --git a/ReactNativeClient/src/database-driver-react-native.js b/lib/database-driver-react-native.js similarity index 100% rename from ReactNativeClient/src/database-driver-react-native.js rename to lib/database-driver-react-native.js diff --git a/ReactNativeClient/src/database.js b/lib/database.js similarity index 98% rename from ReactNativeClient/src/database.js rename to lib/database.js index b3188bf947..8bc417c49e 100644 --- a/ReactNativeClient/src/database.js +++ b/lib/database.js @@ -1,7 +1,7 @@ -import { uuid } from 'src/uuid.js'; -import { promiseChain } from 'src/promise-utils.js'; -import { Logger } from 'src/logger.js' -import { _ } from 'src/locale.js' +import { uuid } from 'lib/uuid.js'; +import { promiseChain } from 'lib/promise-utils.js'; +import { Logger } from 'lib/logger.js' +import { _ } from 'lib/locale.js' const structureSql = ` CREATE TABLE folders ( diff --git a/ReactNativeClient/src/file-api-driver-local.js b/lib/file-api-driver-local.js similarity index 98% rename from ReactNativeClient/src/file-api-driver-local.js rename to lib/file-api-driver-local.js index e0e268a215..d41f991ea2 100644 --- a/ReactNativeClient/src/file-api-driver-local.js +++ b/lib/file-api-driver-local.js @@ -1,6 +1,6 @@ import fs from 'fs'; import fse from 'fs-extra'; -import { promiseChain } from 'src/promise-utils.js'; +import { promiseChain } from 'lib/promise-utils.js'; import moment from 'moment'; class FileApiDriverLocal { diff --git a/ReactNativeClient/src/file-api-driver-memory.js b/lib/file-api-driver-memory.js similarity index 98% rename from ReactNativeClient/src/file-api-driver-memory.js rename to lib/file-api-driver-memory.js index 62230390fc..22006d8df5 100644 --- a/ReactNativeClient/src/file-api-driver-memory.js +++ b/lib/file-api-driver-memory.js @@ -1,4 +1,4 @@ -import { time } from 'src/time-utils.js'; +import { time } from 'lib/time-utils.js'; class FileApiDriverMemory { diff --git a/ReactNativeClient/src/file-api-driver-onedrive.js b/lib/file-api-driver-onedrive.js similarity index 95% rename from ReactNativeClient/src/file-api-driver-onedrive.js rename to lib/file-api-driver-onedrive.js index a52598a2f4..8a8575a7e1 100644 --- a/ReactNativeClient/src/file-api-driver-onedrive.js +++ b/lib/file-api-driver-onedrive.js @@ -1,7 +1,7 @@ import moment from 'moment'; -import { time } from 'src/time-utils.js'; -import { dirname, basename } from 'src/path-utils.js'; -import { OneDriveApi } from 'src/onedrive-api.js'; +import { time } from 'lib/time-utils.js'; +import { dirname, basename } from 'lib/path-utils.js'; +import { OneDriveApi } from 'lib/onedrive-api.js'; class FileApiDriverOneDrive { diff --git a/ReactNativeClient/src/file-api.js b/lib/file-api.js similarity index 95% rename from ReactNativeClient/src/file-api.js rename to lib/file-api.js index f0579a96cf..5805b739a6 100644 --- a/ReactNativeClient/src/file-api.js +++ b/lib/file-api.js @@ -1,5 +1,5 @@ -import { isHidden } from 'src/path-utils.js'; -import { Logger } from 'src/logger.js'; +import { isHidden } from 'lib/path-utils.js'; +import { Logger } from 'lib/logger.js'; class FileApi { diff --git a/ReactNativeClient/src/geolocation.js b/lib/geolocation-react.js similarity index 93% rename from ReactNativeClient/src/geolocation.js rename to lib/geolocation-react.js index deaf88aec7..6dbc5ba095 100644 --- a/ReactNativeClient/src/geolocation.js +++ b/lib/geolocation-react.js @@ -1,4 +1,4 @@ -class Geolocation { +class GeolocationReact { static currentPosition_testResponse() { return { @@ -36,4 +36,4 @@ class Geolocation { } -export { Geolocation }; \ No newline at end of file +export { GeolocationReact }; \ No newline at end of file diff --git a/ReactNativeClient/src/locale.js b/lib/locale.js similarity index 100% rename from ReactNativeClient/src/locale.js rename to lib/locale.js diff --git a/ReactNativeClient/src/log.js b/lib/log.js similarity index 100% rename from ReactNativeClient/src/log.js rename to lib/log.js diff --git a/ReactNativeClient/src/logger.js b/lib/logger.js similarity index 100% rename from ReactNativeClient/src/logger.js rename to lib/logger.js diff --git a/ReactNativeClient/src/models/base-item.js b/lib/models/base-item.js similarity index 93% rename from ReactNativeClient/src/models/base-item.js rename to lib/models/base-item.js index 9bed85a098..3f16126335 100644 --- a/ReactNativeClient/src/models/base-item.js +++ b/lib/models/base-item.js @@ -1,9 +1,9 @@ -import { BaseModel } from 'src/base-model.js'; -import { Note } from 'src/models/note.js'; -import { Folder } from 'src/models/folder.js'; -import { Setting } from 'src/models/setting.js'; -import { Database } from 'src/database.js'; -import { time } from 'src/time-utils.js'; +import { BaseModel } from 'lib/base-model.js'; +import { Note } from 'lib/models/note.js'; +import { Folder } from 'lib/models/folder.js'; +import { Setting } from 'lib/models/setting.js'; +import { Database } from 'lib/database.js'; +import { time } from 'lib/time-utils.js'; import moment from 'moment'; class BaseItem extends BaseModel { diff --git a/ReactNativeClient/src/models/change.js b/lib/models/change.js similarity index 96% rename from ReactNativeClient/src/models/change.js rename to lib/models/change.js index e52b930195..eefd991a9a 100644 --- a/ReactNativeClient/src/models/change.js +++ b/lib/models/change.js @@ -1,5 +1,5 @@ -import { BaseModel } from 'src/base-model.js'; -import { Log } from 'src/log.js'; +import { BaseModel } from 'lib/base-model.js'; +import { Log } from 'lib/log.js'; class Change extends BaseModel { diff --git a/ReactNativeClient/src/models/folder.js b/lib/models/folder.js similarity index 89% rename from ReactNativeClient/src/models/folder.js rename to lib/models/folder.js index 8388f7e7f8..1257a01bc7 100644 --- a/ReactNativeClient/src/models/folder.js +++ b/lib/models/folder.js @@ -1,11 +1,11 @@ -import { BaseModel } from 'src/base-model.js'; -import { Log } from 'src/log.js'; -import { promiseChain } from 'src/promise-utils.js'; -import { Note } from 'src/models/note.js'; -import { Setting } from 'src/models/setting.js'; -import { _ } from 'src/locale.js'; +import { BaseModel } from 'lib/base-model.js'; +import { Log } from 'lib/log.js'; +import { promiseChain } from 'lib/promise-utils.js'; +import { Note } from 'lib/models/note.js'; +import { Setting } from 'lib/models/setting.js'; +import { _ } from 'lib/locale.js'; import moment from 'moment'; -import { BaseItem } from 'src/models/base-item.js'; +import { BaseItem } from 'lib/models/base-item.js'; class Folder extends BaseItem { diff --git a/ReactNativeClient/src/models/item-sync-time.js b/lib/models/item-sync-time.js similarity index 95% rename from ReactNativeClient/src/models/item-sync-time.js rename to lib/models/item-sync-time.js index 1183ae6a6d..056ab0a54e 100644 --- a/ReactNativeClient/src/models/item-sync-time.js +++ b/lib/models/item-sync-time.js @@ -1,4 +1,4 @@ -import { BaseModel } from 'src/base-model.js'; +import { BaseModel } from 'lib/base-model.js'; class ItemSyncTime extends BaseModel { diff --git a/ReactNativeClient/src/models/note.js b/lib/models/note.js similarity index 90% rename from ReactNativeClient/src/models/note.js rename to lib/models/note.js index 4572df8c20..c29ad86f4f 100644 --- a/ReactNativeClient/src/models/note.js +++ b/lib/models/note.js @@ -1,8 +1,8 @@ -import { BaseModel } from 'src/base-model.js'; -import { Log } from 'src/log.js'; -import { Folder } from 'src/models/folder.js'; -import { Geolocation } from 'src/geolocation.js'; -import { BaseItem } from 'src/models/base-item.js'; +import { BaseModel } from 'lib/base-model.js'; +import { Log } from 'lib/log.js'; +import { Folder } from 'lib/models/folder.js'; +import { GeolocationReact } from 'lib/geolocation-react.js'; +import { BaseItem } from 'lib/models/base-item.js'; import moment from 'moment'; class Note extends BaseItem { @@ -59,7 +59,7 @@ class Note extends BaseItem { Log.info('Updating lat/long of note ' + noteId); let geoData = null; - return Geolocation.currentPosition().then((data) => { + return GeolocationReact.currentPosition().then((data) => { Log.info('Got lat/long'); geoData = data; return Note.load(noteId); diff --git a/ReactNativeClient/src/models/session.js b/lib/models/session.js similarity index 67% rename from ReactNativeClient/src/models/session.js rename to lib/models/session.js index 9730fe058a..0e59a3e0ac 100644 --- a/ReactNativeClient/src/models/session.js +++ b/lib/models/session.js @@ -1,4 +1,4 @@ -import { BaseModel } from 'src/base-model.js'; +import { BaseModel } from 'lib/base-model.js'; class Session extends BaseModel { diff --git a/ReactNativeClient/src/models/setting.js b/lib/models/setting.js similarity index 96% rename from ReactNativeClient/src/models/setting.js rename to lib/models/setting.js index b35c23f5fc..0f35dfddb5 100644 --- a/ReactNativeClient/src/models/setting.js +++ b/lib/models/setting.js @@ -1,6 +1,6 @@ -import { BaseModel } from 'src/base-model.js'; -import { Log } from 'src/log.js'; -import { Database } from 'src/database.js'; +import { BaseModel } from 'lib/base-model.js'; +import { Log } from 'lib/log.js'; +import { Database } from 'lib/database.js'; class Setting extends BaseModel { diff --git a/ReactNativeClient/src/onedrive-api.js b/lib/onedrive-api.js similarity index 100% rename from ReactNativeClient/src/onedrive-api.js rename to lib/onedrive-api.js diff --git a/lib/package.json b/lib/package.json new file mode 100644 index 0000000000..adac565885 --- /dev/null +++ b/lib/package.json @@ -0,0 +1 @@ +{ "name": "lib" } \ No newline at end of file diff --git a/ReactNativeClient/src/path-utils.js b/lib/path-utils.js similarity index 100% rename from ReactNativeClient/src/path-utils.js rename to lib/path-utils.js diff --git a/ReactNativeClient/src/promise-utils.js b/lib/promise-utils.js similarity index 100% rename from ReactNativeClient/src/promise-utils.js rename to lib/promise-utils.js diff --git a/ReactNativeClient/src/string-utils.js b/lib/string-utils.js similarity index 100% rename from ReactNativeClient/src/string-utils.js rename to lib/string-utils.js diff --git a/ReactNativeClient/src/synchronizer.js b/lib/synchronizer.js similarity index 97% rename from ReactNativeClient/src/synchronizer.js rename to lib/synchronizer.js index 89708a49a5..ff967f9934 100644 --- a/ReactNativeClient/src/synchronizer.js +++ b/lib/synchronizer.js @@ -1,12 +1,12 @@ require('babel-plugin-transform-runtime'); -import { BaseItem } from 'src/models/base-item.js'; -import { Folder } from 'src/models/folder.js'; -import { Note } from 'src/models/note.js'; -import { BaseModel } from 'src/base-model.js'; +import { BaseItem } from 'lib/models/base-item.js'; +import { Folder } from 'lib/models/folder.js'; +import { Note } from 'lib/models/note.js'; +import { BaseModel } from 'lib/base-model.js'; import { sprintf } from 'sprintf-js'; -import { time } from 'src/time-utils.js'; -import { Logger } from 'src/logger.js' +import { time } from 'lib/time-utils.js'; +import { Logger } from 'lib/logger.js' import moment from 'moment'; class Synchronizer { diff --git a/ReactNativeClient/src/time-utils.js b/lib/time-utils.js similarity index 100% rename from ReactNativeClient/src/time-utils.js rename to lib/time-utils.js diff --git a/ReactNativeClient/src/uuid.js b/lib/uuid.js similarity index 100% rename from ReactNativeClient/src/uuid.js rename to lib/uuid.js diff --git a/ReactNativeClient/src/web-api.js b/lib/web-api.js similarity index 98% rename from ReactNativeClient/src/web-api.js rename to lib/web-api.js index 53b92d5608..061132038d 100644 --- a/ReactNativeClient/src/web-api.js +++ b/lib/web-api.js @@ -1,5 +1,5 @@ -import { Log } from 'src/log.js'; -import { isNode } from 'src/env.js'; +import { Log } from 'lib/log.js'; +import { isNode } from 'lib/env.js'; import { stringify } from 'query-string'; if (isNode()) {