Skip to content

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

refactor: @streetwriters/notesnook-core -> @notesnook/core

Abdullah Atta6b2a90a6d4f1
diff --git a/apps/mobile/app/common/database/index.js b/apps/mobile/app/common/database/index.js
index 2ea388d47..474bb0fb7 100644
--- a/apps/mobile/app/common/database/index.js
+++ b/apps/mobile/app/common/database/index.js
@@ -1,8 +1,5 @@
-import Database from "@streetwriters/notesnook-core/api/index";
-import {
- initalize,
- logger as dbLogger
-} from "@streetwriters/notesnook-core/logger";
+import Database from "@notesnook/core/api/index";
+import { initalize, logger as dbLogger } from "@notesnook/core/logger";
import { Platform } from "react-native";
import { MMKVLoader } from "react-native-mmkv-storage";
import filesystem from "../filesystem";
@@ -16,7 +13,7 @@ initalize(new KV(LoggerStorage));
export const DatabaseLogger = dbLogger;
/**
- * @type {import("@streetwriters/notesnook-core/api/index").default}
+ * @type {import("@notesnook/core/api/index").default}
*/
export var db = new Database(
Storage,
diff --git a/apps/mobile/app/common/filesystem/download.js b/apps/mobile/app/common/filesystem/download.js
index dbd1f694d..409bf2542 100644
--- a/apps/mobile/app/common/filesystem/download.js
+++ b/apps/mobile/app/common/filesystem/download.js
@@ -1,5 +1,5 @@
import NetInfo from "@react-native-community/netinfo";
-import hosts from "@streetwriters/notesnook-core/utils/constants";
+import hosts from "@notesnook/core/utils/constants";
import React from "react";
import { Platform } from "react-native";
import * as ScopedStorage from "react-native-scoped-storage";
diff --git a/apps/mobile/app/hooks/use-app-events.js b/apps/mobile/app/hooks/use-app-events.js
index c37b258b8..fe79b7622 100644
--- a/apps/mobile/app/hooks/use-app-events.js
+++ b/apps/mobile/app/hooks/use-app-events.js
@@ -1,5 +1,5 @@
import NetInfo from "@react-native-community/netinfo";
-import { EV, EVENTS } from "@streetwriters/notesnook-core/common";
+import { EV, EVENTS } from "@notesnook/core/common";
import { useEffect, useRef } from "react";
import {
Appearance,
diff --git a/apps/mobile/app/hooks/use-sync-progress.ts b/apps/mobile/app/hooks/use-sync-progress.ts
index 6d555899e..a30d86108 100644
--- a/apps/mobile/app/hooks/use-sync-progress.ts
+++ b/apps/mobile/app/hooks/use-sync-progress.ts
@@ -1,5 +1,5 @@
//@ts-ignore
-import { EVENTS } from "@streetwriters/notesnook-core/common";
+import { EVENTS } from "@notesnook/core/common";
import { useCallback, useEffect, useState } from "react";
import { db } from "../common/database";
diff --git a/apps/mobile/app/package.json b/apps/mobile/app/package.json
index 1e974e44f..bf8377932 100644
--- a/apps/mobile/app/package.json
+++ b/apps/mobile/app/package.json
@@ -6,7 +6,7 @@
"@flyerhq/react-native-link-preview": "^1.6.0",
"@mdi/js": "^6.7.96",
"@streetwriters/editor": "*",
- "@streetwriters/notesnook-core": "^7.3.5",
+ "@notesnook/core": "*",
"absolutify": "^0.1.0",
"buffer": "^6.0.3",
"dayjs": "^1.10.4",
@@ -22,7 +22,6 @@
"react-native-reanimated-material-menu": "github:ammarahm-ed/react-native-reanimated-material-menu",
"react-native-reanimated-progress-bar": "1.0.1",
"showdown": "github:thecodrr/showdown",
- "showndown": "github:thecodrr/showdown",
"toggle-switch-react-native": "3.2.0",
"url": "^0.11.0",
"validator": "^13.5.2",
diff --git a/apps/mobile/app/screens/editor/index.tsx b/apps/mobile/app/screens/editor/index.tsx
index fe1c97878..4c0b424f7 100755
--- a/apps/mobile/app/screens/editor/index.tsx
+++ b/apps/mobile/app/screens/editor/index.tsx
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
-import { EV, EVENTS } from "@streetwriters/notesnook-core/common";
+import { EV, EVENTS } from "@notesnook/core/common";
import React, {
forwardRef,
useEffect,
diff --git a/apps/mobile/app/screens/notebook/index.tsx b/apps/mobile/app/screens/notebook/index.tsx
index 367dd30a0..9e7bf52a0 100644
--- a/apps/mobile/app/screens/notebook/index.tsx
+++ b/apps/mobile/app/screens/notebook/index.tsx
@@ -1,4 +1,4 @@
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+import { groupArray } from "@notesnook/core/utils/grouping";
import { qclone } from "qclone";
import React, { useEffect, useRef, useState } from "react";
import { db } from "../../common/database";
diff --git a/apps/mobile/app/screens/notes/colored.tsx b/apps/mobile/app/screens/notes/colored.tsx
index 6b6809f36..0990d8c0b 100644
--- a/apps/mobile/app/screens/notes/colored.tsx
+++ b/apps/mobile/app/screens/notes/colored.tsx
@@ -1,4 +1,4 @@
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+import { groupArray } from "@notesnook/core/utils/grouping";
import React from "react";
import NotesPage, { PLACEHOLDER_DATA } from ".";
import { db } from "../../common/database";
diff --git a/apps/mobile/app/screens/notes/monographs.tsx b/apps/mobile/app/screens/notes/monographs.tsx
index 19aba469e..fe1818a8f 100644
--- a/apps/mobile/app/screens/notes/monographs.tsx
+++ b/apps/mobile/app/screens/notes/monographs.tsx
@@ -1,4 +1,4 @@
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+import { groupArray } from "@notesnook/core/utils/grouping";
import React from "react";
import NotesPage, { PLACEHOLDER_DATA } from ".";
import { db } from "../../common/database";
diff --git a/apps/mobile/app/screens/notes/tagged.tsx b/apps/mobile/app/screens/notes/tagged.tsx
index abb910070..782b195d2 100644
--- a/apps/mobile/app/screens/notes/tagged.tsx
+++ b/apps/mobile/app/screens/notes/tagged.tsx
@@ -1,4 +1,4 @@
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+import { groupArray } from "@notesnook/core/utils/grouping";
import React from "react";
import NotesPage, { PLACEHOLDER_DATA } from ".";
import { db } from "../../common/database";
diff --git a/apps/mobile/app/screens/notes/topic-notes.tsx b/apps/mobile/app/screens/notes/topic-notes.tsx
index 24c8d7423..d6facec3a 100644
--- a/apps/mobile/app/screens/notes/topic-notes.tsx
+++ b/apps/mobile/app/screens/notes/topic-notes.tsx
@@ -1,4 +1,4 @@
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+import { groupArray } from "@notesnook/core/utils/grouping";
import React from "react";
import NotesPage, { PLACEHOLDER_DATA } from ".";
import { db } from "../../common/database";
diff --git a/apps/mobile/app/screens/settings/debug.tsx b/apps/mobile/app/screens/settings/debug.tsx
index 1e820cd76..4405cb1d9 100644
--- a/apps/mobile/app/screens/settings/debug.tsx
+++ b/apps/mobile/app/screens/settings/debug.tsx
@@ -1,10 +1,6 @@
import Clipboard from "@react-native-clipboard/clipboard";
import { LogMessage } from "@streetwriters/logger";
-import {
- format,
- LogLevel,
- logManager
-} from "@streetwriters/notesnook-core/logger";
+import { format, LogLevel, logManager } from "@notesnook/core/logger";
import React, { useEffect, useState } from "react";
import { FlatList, Platform, TouchableOpacity, View } from "react-native";
import * as ScopedStorage from "react-native-scoped-storage";
diff --git a/apps/mobile/app/services/event-manager.ts b/apps/mobile/app/services/event-manager.ts
index 2486cc6bb..efff214fb 100644
--- a/apps/mobile/app/services/event-manager.ts
+++ b/apps/mobile/app/services/event-manager.ts
@@ -1,5 +1,5 @@
import Clipboard from "@react-native-clipboard/clipboard";
-import EventManager from "@streetwriters/notesnook-core/utils/eventmanager";
+import EventManager from "@notesnook/core/utils/eventmanager";
import { RefObject } from "react";
import ActionSheet from "react-native-actions-sheet";
import { Config } from "react-native-config";
diff --git a/apps/mobile/app/services/premium.js b/apps/mobile/app/services/premium.js
index 5f99e4849..b888e09ee 100644
--- a/apps/mobile/app/services/premium.js
+++ b/apps/mobile/app/services/premium.js
@@ -1,4 +1,4 @@
-import { CHECK_IDS } from "@streetwriters/notesnook-core/common";
+import { CHECK_IDS } from "@notesnook/core/common";
import React from "react";
import { Platform } from "react-native";
import * as RNIap from "react-native-iap";
diff --git a/apps/mobile/app/services/sync.js b/apps/mobile/app/services/sync.js
index f5207708f..99d98d9c6 100644
--- a/apps/mobile/app/services/sync.js
+++ b/apps/mobile/app/services/sync.js
@@ -1,5 +1,5 @@
import NetInfo from "@react-native-community/netinfo";
-import { EVENTS } from "@streetwriters/notesnook-core/common";
+import { EVENTS } from "@notesnook/core/common";
import { initAfterSync } from "../stores/index";
import { useUserStore } from "../stores/use-user-store";
import { doInBackground } from "../utils";
diff --git a/apps/mobile/app/stores/use-favorite-store.ts b/apps/mobile/app/stores/use-favorite-store.ts
index ef385bf3b..257e6ccb5 100644
--- a/apps/mobile/app/stores/use-favorite-store.ts
+++ b/apps/mobile/app/stores/use-favorite-store.ts
@@ -1,5 +1,5 @@
//@ts-ignore
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+import { groupArray } from "@notesnook/core/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { NoteType } from "../utils/types";
diff --git a/apps/mobile/app/stores/use-notebook-store.ts b/apps/mobile/app/stores/use-notebook-store.ts
index 884986e9c..5a25de7fc 100644
--- a/apps/mobile/app/stores/use-notebook-store.ts
+++ b/apps/mobile/app/stores/use-notebook-store.ts
@@ -1,5 +1,5 @@
//@ts-ignore
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+import { groupArray } from "@notesnook/core/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { NotebookType } from "../utils/types";
diff --git a/apps/mobile/app/stores/use-notes-store.ts b/apps/mobile/app/stores/use-notes-store.ts
index fc597ce1c..3473c6475 100644
--- a/apps/mobile/app/stores/use-notes-store.ts
+++ b/apps/mobile/app/stores/use-notes-store.ts
@@ -1,5 +1,5 @@
//@ts-ignore
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+import { groupArray } from "@notesnook/core/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { NoteType } from "../utils/types";
diff --git a/apps/mobile/app/stores/use-tag-store.ts b/apps/mobile/app/stores/use-tag-store.ts
index 36dcebf13..9c0cfbb3f 100644
--- a/apps/mobile/app/stores/use-tag-store.ts
+++ b/apps/mobile/app/stores/use-tag-store.ts
@@ -1,6 +1,6 @@
//@ts-ignore
-import "@streetwriters/notesnook-core/types";
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+import "@notesnook/core/types";
+import { groupArray } from "@notesnook/core/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { TagType } from "../utils/types";
diff --git a/apps/mobile/app/stores/use-trash-store.ts b/apps/mobile/app/stores/use-trash-store.ts
index db0b36776..b1ad6b13c 100644
--- a/apps/mobile/app/stores/use-trash-store.ts
+++ b/apps/mobile/app/stores/use-trash-store.ts
@@ -1,5 +1,5 @@
//@ts-ignore
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+import { groupArray } from "@notesnook/core/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { TrashType } from "../utils/types";
diff --git a/apps/mobile/native/package.json b/apps/mobile/native/package.json
index 0456d5c8c..a5230d1a0 100644
--- a/apps/mobile/native/package.json
+++ b/apps/mobile/native/package.json
@@ -12,7 +12,6 @@
"test": "jest --forceExit",
"lint": "eslint .",
"build-detox-android": "REACT_NATIVE_DEPENDENCIES=$HOME/Repos/notesnook-mobile/rn-build-deps/ ENVFILE=.env.test detox build -c android.emu.debug",
- "update": "yarn add @streetwriters/notesnook-core",
"test-android": "adb reverse tcp:8081 tcp:8081 && yarn detox test --configuration android.emu.debug --detectOpenHandles",
"test-android-release": "detox test --configuration android.emu.release",
"bump": "npx react-native bump-version --skip-semver-for android",
diff --git a/apps/mobile/share/share.js b/apps/mobile/share/share.js
index e885b8225..dd856891a 100644
--- a/apps/mobile/share/share.js
+++ b/apps/mobile/share/share.js
@@ -1,5 +1,5 @@
import { getPreviewData } from "@flyerhq/react-native-link-preview";
-import { parseHTML } from "@streetwriters/notesnook-core/utils/htmlparser";
+import { parseHTML } from "@notesnook/core/utils/htmlparser";
import React, { useEffect, useRef, useState } from "react";
import {
ActivityIndicator,