Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

api: move storage to interfaces

thecodrrf869f748fb93
diff --git a/apps/web/package.json b/apps/web/package.json
index 2bdcea0a3..7609e4593 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -5,6 +5,8 @@
"dependencies": {
"@rebass/forms": "^4.0.6",
"emotion-theming": "^10.0.19",
+ "notes-core": "npm:@streetwriters/notesnook-core@latest",
+ "notes-web": "../notes-web",
"quill-blot-formatter": "^1.0.5",
"quill-emoji": "^0.1.7",
"quill-magic-url": "^1.0.3",
@@ -23,7 +25,8 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
- "eject": "react-scripts eject"
+ "eject": "react-scripts eject",
+ "update": "npm i @streetwriters/editor@latest @streetwriters/notesnook-core@latest @streetwriters/theme@latest"
},
"eslintConfig": {
"extends": "react-app"
diff --git a/apps/web/src/index.js b/apps/web/src/index.js
index 87d1be551..cea174fa5 100644
--- a/apps/web/src/index.js
+++ b/apps/web/src/index.js
@@ -1,12 +1,16 @@
-import React from 'react';
-import ReactDOM from 'react-dom';
-import './index.css';
-import App from './App';
-import * as serviceWorker from './serviceWorker';
+import React from "react";
+import ReactDOM from "react-dom";
+import "./index.css";
+import App from "./App";
+import * as serviceWorker from "./serviceWorker";
+import Storage from "notes-core/sync/storage";
+import StorageInterface from "./interfaces/storage";
-ReactDOM.render(<App />, document.getElementById('root'));
+ReactDOM.render(<App />, document.getElementById("root"));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
+
+export const storage = new Storage(StorageInterface);
diff --git a/apps/web/src/utils/storage.js b/apps/web/src/interfaces/storage.js
similarity index 100%
rename from apps/web/src/utils/storage.js
rename to apps/web/src/interfaces/storage.js
diff --git a/apps/web/yarn.lock b/apps/web/yarn.lock
index ab1148137..6870fa111 100644
--- a/apps/web/yarn.lock
+++ b/apps/web/yarn.lock
@@ -7022,6 +7022,26 @@ normalize-url@^3.0.0, normalize-url@^3.0.1:
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559"
integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==
+notes-core@../notes-core/:
+ version "0.1.0"
+
+notes-web@../notes-web:
+ version "0.1.0"
+ dependencies:
+ "@rebass/forms" "^4.0.6"
+ emotion-theming "^10.0.19"
+ notes-core "../notes-core/"
+ quill-blot-formatter "^1.0.5"
+ quill-emoji "^0.1.7"
+ quill-magic-url "^1.0.3"
+ quill-markdown-shortcuts "^0.0.10"
+ react "^16.11.0"
+ react-dom "^16.11.0"
+ react-feather "^2.0.3"
+ react-quill "^1.3.3"
+ react-scripts "3.2.0"
+ rebass "^4.0.7"
+
npm-bundled@^1.0.1:
version "1.0.6"
resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd"