mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
refactor: install private packages from gh packages
This commit is contained in:
1
apps/web/.npmrc
Normal file
1
apps/web/.npmrc
Normal file
@@ -0,0 +1 @@
|
||||
@streetwriters:registry=https://npm.pkg.github.com
|
||||
@@ -15,8 +15,10 @@
|
||||
"@mdi/react": "^1.4.0",
|
||||
"@notesnook/crypto": "^1.0.0",
|
||||
"@notesnook/desktop": "file:desktop",
|
||||
"@notesnook/theme": "github:streetwriters/themeprovider",
|
||||
"@rebass/forms": "^4.0.6",
|
||||
"@streetwriters/editor": "^1.0.2",
|
||||
"@streetwriters/notesnook-core": "^7.0.1",
|
||||
"@streetwriters/theme": "1.0.0",
|
||||
"allotment": "^1.12.1",
|
||||
"async-mutex": "^0.3.2",
|
||||
"axios": "^0.21.4",
|
||||
@@ -35,8 +37,6 @@
|
||||
"localforage-driver-memory": "^1.0.5",
|
||||
"localforage-getitems": "https://github.com/thecodrr/localForage-getItems.git",
|
||||
"nncryptoworker": "file:packages/nncryptoworker",
|
||||
"notes-core": "npm:@streetwriters/notesnook-core@latest",
|
||||
"notesnook-editor": "github:streetwriters/notesnook-editor#develop",
|
||||
"phone": "^3.1.14",
|
||||
"platform": "^1.3.6",
|
||||
"print-js": "^1.6.0",
|
||||
|
||||
@@ -8,7 +8,7 @@ import { resetReminders } from "./common/reminders";
|
||||
import { introduceFeatures, showUpgradeReminderDialogs } from "./common";
|
||||
import { AppEventManager, AppEvents } from "./common/app-events";
|
||||
import { db } from "./common/db";
|
||||
import { CHECK_IDS, EV, EVENTS } from "notes-core/common";
|
||||
import { CHECK_IDS, EV, EVENTS } from "@streetwriters/notesnook-core/common";
|
||||
import { registerKeyMap } from "./common/key-map";
|
||||
import { isUserPremium } from "./hooks/use-is-user-premium";
|
||||
import { loadTrackerScript } from "./utils/analytics";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import EventManager from "notes-core/utils/eventmanager";
|
||||
import EventManager from "@streetwriters/notesnook-core/utils/eventmanager";
|
||||
|
||||
export const AppEventManager = new EventManager();
|
||||
export const AppEvents = {
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import { EventSourcePolyfill as EventSource } from "event-source-polyfill";
|
||||
import { EVENTS } from "notes-core/common";
|
||||
import { EVENTS } from "@streetwriters/notesnook-core/common";
|
||||
import { TaskManager } from "./task-manager";
|
||||
|
||||
/**
|
||||
* @type {import("notes-core/api").default}
|
||||
* @type {import("@streetwriters/notesnook-core/api").default}
|
||||
*/
|
||||
var db;
|
||||
async function initializeDatabase(persistence) {
|
||||
const { default: Database } = await import("notes-core/api");
|
||||
const { default: Database } = await import(
|
||||
"@streetwriters/notesnook-core/api"
|
||||
);
|
||||
const { NNStorage } = await import("../interfaces/storage");
|
||||
const { default: FS } = await import("../interfaces/fs");
|
||||
db = new Database(new NNStorage(persistence), EventSource, FS);
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Box, Flex, Text } from "rebass";
|
||||
import * as Icon from "../components/icons";
|
||||
import Config from "../utils/config";
|
||||
|
||||
import { formatDate } from "notes-core/utils/date";
|
||||
import { formatDate } from "@streetwriters/notesnook-core/utils/date";
|
||||
import downloadUpdate from "../commands/download-update";
|
||||
import installUpdate from "../commands/install-update";
|
||||
import { AppVersion, getChangelog } from "../utils/version";
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { getDefaultPresets, ToolbarGroupDefinition } from "notesnook-editor";
|
||||
import {
|
||||
getDefaultPresets,
|
||||
ToolbarGroupDefinition,
|
||||
} from "@streetwriters/editor";
|
||||
import { db } from "./db";
|
||||
|
||||
const defaultPresets = getDefaultPresets();
|
||||
|
||||
@@ -20,7 +20,7 @@ import { usePersistentState } from "../../utils/hooks";
|
||||
import AccentItem from "../accent-item";
|
||||
import { useCallback, useState } from "react";
|
||||
import Config from "../../utils/config";
|
||||
import { getAllAccents } from "@notesnook/theme";
|
||||
import { getAllAccents } from "@streetwriters/theme";
|
||||
|
||||
const newUserSteps = [
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
ToolbarGroupDefinition,
|
||||
ToolDefinition,
|
||||
ToolId,
|
||||
} from "notesnook-editor";
|
||||
} from "@streetwriters/editor";
|
||||
import {
|
||||
closestCenter,
|
||||
DndContext,
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
import { useEffect, useState } from "react";
|
||||
import { CSS } from "@dnd-kit/utilities";
|
||||
import { createPortal } from "react-dom";
|
||||
import id from "notes-core/utils/id";
|
||||
import id from "@streetwriters/notesnook-core/utils/id";
|
||||
import { Label, Radio } from "@rebass/forms";
|
||||
import { db } from "../../common/db";
|
||||
import { useToolbarConfig } from "../editor/context";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { formatDate } from "notes-core/utils/date";
|
||||
import { formatDate } from "@streetwriters/notesnook-core/utils/date";
|
||||
import { Flex, Button } from "rebass";
|
||||
|
||||
function ContentToggle(props) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import createStore from "../../common/store";
|
||||
import BaseStore from "../../stores";
|
||||
import { UseStore } from "zustand";
|
||||
import shallow from "zustand/shallow";
|
||||
import { ToolbarDefinition } from "notesnook-editor";
|
||||
import { ToolbarDefinition } from "@streetwriters/editor";
|
||||
|
||||
type EditorSubState = {
|
||||
editor?: IEditor;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { formatDate } from "notes-core/utils/date";
|
||||
import { formatDate } from "@streetwriters/notesnook-core/utils/date";
|
||||
import { Flex, Text } from "rebass";
|
||||
import { useStore } from "../../stores/editor-store";
|
||||
import { Loading, Saved, NotSaved } from "../icons";
|
||||
|
||||
@@ -11,7 +11,7 @@ import { useStore, store as editorstore } from "../../stores/editor-store";
|
||||
import Toolbar from "./toolbar";
|
||||
import { AppEventManager, AppEvents } from "../../common/app-events";
|
||||
import { FlexScrollContainer } from "../scroll-container";
|
||||
import { formatDate } from "notes-core/utils/date";
|
||||
import { formatDate } from "@streetwriters/notesnook-core/utils/date";
|
||||
import { debounceWithId } from "../../utils/debounce";
|
||||
import Tiptap from "./tiptap";
|
||||
import Header from "./header";
|
||||
@@ -20,7 +20,7 @@ import { useEditorInstance } from "./context";
|
||||
import { attachFile, AttachmentProgress, insertAttachment } from "./picker";
|
||||
import { DropEvent } from "react-dropzone";
|
||||
import { downloadAttachment } from "../../common/attachments";
|
||||
import { EV, EVENTS } from "notes-core/common";
|
||||
import { EV, EVENTS } from "@streetwriters/notesnook-core/common";
|
||||
import { db } from "../../common/db";
|
||||
import useMobile from "../../utils/use-mobile";
|
||||
import Titlebox from "./title-box";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import "notesnook-editor/styles/styles.css";
|
||||
import "notesnook-editor/styles/katex.min.css";
|
||||
import "notesnook-editor/styles/katexfonts.css";
|
||||
import "notesnook-editor/styles/fonts.css";
|
||||
import "notesnook-editor/styles/prism-theme.css";
|
||||
import { Theme } from "@notesnook/theme";
|
||||
import "@streetwriters/editor/styles/styles.css";
|
||||
import "@streetwriters/editor/styles/katex.min.css";
|
||||
import "@streetwriters/editor/styles/katexfonts.css";
|
||||
import "@streetwriters/editor/styles/fonts.css";
|
||||
import "@streetwriters/editor/styles/prism-theme.css";
|
||||
import { Theme } from "@streetwriters/theme";
|
||||
import { useTheme } from "emotion-theming";
|
||||
import {
|
||||
Toolbar,
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
Editor,
|
||||
AttachmentType,
|
||||
usePermissionHandler,
|
||||
} from "notesnook-editor";
|
||||
} from "@streetwriters/editor";
|
||||
import { Box, Flex } from "rebass";
|
||||
import { PropsWithChildren, useEffect, useRef, useState } from "react";
|
||||
import useMobile from "../../utils/use-mobile";
|
||||
|
||||
@@ -12,7 +12,7 @@ import Toggle from "./toggle";
|
||||
import { navigate } from "../../navigation";
|
||||
import IconTag from "../icon-tag";
|
||||
import ScrollContainer from "../scroll-container";
|
||||
import { formatDate } from "notes-core/utils/date";
|
||||
import { formatDate } from "@streetwriters/notesnook-core/utils/date";
|
||||
import Vault from "../../common/vault";
|
||||
import TimeAgo from "../time-ago";
|
||||
import Attachment from "../attachment";
|
||||
|
||||
@@ -8,7 +8,7 @@ import { db } from "../../common/db";
|
||||
import * as clipboard from "clipboard-polyfill/text";
|
||||
import ThemeProvider from "../theme-provider";
|
||||
import { showToast } from "../../utils/toast";
|
||||
import { EV, EVENTS } from "notes-core/common";
|
||||
import { EV, EVENTS } from "@streetwriters/notesnook-core/common";
|
||||
import { useStore } from "../../stores/monograph-store";
|
||||
import { closeOpenedDialog } from "../../common/dialog-controller";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useStore } from "../../stores/theme-store";
|
||||
import { ThemeProvider as EmotionThemeProvider } from "emotion-theming";
|
||||
import { useTheme } from "@notesnook/theme";
|
||||
import { useTheme } from "@streetwriters/theme";
|
||||
|
||||
function ThemeProviderWrapper(props) {
|
||||
const theme = useStore((store) => store.theme);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { formatDate } from "notes-core/utils/date";
|
||||
import { formatDate } from "@streetwriters/notesnook-core/utils/date";
|
||||
import React, { useEffect, useRef } from "react";
|
||||
import { Text } from "rebass";
|
||||
import { register, format, cancel, render } from "timeago.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import "notes-core/types";
|
||||
import "@streetwriters/notesnook-core/types";
|
||||
import { EVENTS } from "@notesnook/desktop/events";
|
||||
import { render } from "react-dom";
|
||||
import { AppEventManager } from "./common/app-events";
|
||||
|
||||
@@ -5,8 +5,8 @@ import axios from "axios";
|
||||
import { AppEventManager, AppEvents } from "../common/app-events";
|
||||
import { StreamableFS } from "streamablefs";
|
||||
import { getNNCrypto } from "./nncrypto.stub";
|
||||
import hosts from "notes-core/utils/constants";
|
||||
import { sendAttachmentsProgressEvent } from "notes-core/common";
|
||||
import hosts from "@streetwriters/notesnook-core/utils/constants";
|
||||
import { sendAttachmentsProgressEvent } from "@streetwriters/notesnook-core/common";
|
||||
import { saveAs } from "file-saver";
|
||||
import { showToast } from "../utils/toast";
|
||||
import { db } from "../common/db";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import EventManager from "notes-core/utils/eventmanager";
|
||||
import EventManager from "@streetwriters/notesnook-core/utils/eventmanager";
|
||||
import Config from "../utils/config";
|
||||
|
||||
export function navigate(url, replaceOrQuery, replace) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { store as attachmentStore } from "./attachment-store";
|
||||
import BaseStore from "./index";
|
||||
import { showToast } from "../utils/toast";
|
||||
import { resetReminders } from "../common/reminders";
|
||||
import { EVENTS } from "notes-core/common";
|
||||
import { EVENTS } from "@streetwriters/notesnook-core/common";
|
||||
|
||||
var syncStatusTimeout = 0;
|
||||
const BATCH_SIZE = 50;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { store as appStore } from "./app-store";
|
||||
import { store as tagStore } from "./tag-store";
|
||||
import { db } from "../common/db";
|
||||
import BaseStore from ".";
|
||||
import { EV, EVENTS } from "notes-core/common";
|
||||
import { EV, EVENTS } from "@streetwriters/notesnook-core/common";
|
||||
import { hashNavigate } from "../navigation";
|
||||
|
||||
const SESSION_STATES = {
|
||||
|
||||
@@ -6,10 +6,10 @@ import { store as appStore } from "./app-store";
|
||||
import { store as selectionStore } from "./selection-store";
|
||||
import Vault from "../common/vault";
|
||||
import BaseStore from ".";
|
||||
import { EV, EVENTS } from "notes-core/common";
|
||||
import { EV, EVENTS } from "@streetwriters/notesnook-core/common";
|
||||
import Config from "../utils/config";
|
||||
import { hashNavigate } from "../navigation";
|
||||
import { groupArray } from "notes-core/utils/grouping";
|
||||
import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
|
||||
|
||||
class NoteStore extends BaseStore {
|
||||
notes = [];
|
||||
|
||||
@@ -3,7 +3,7 @@ import createStore from "../common/store";
|
||||
import { store as appStore } from "./app-store";
|
||||
import { store as noteStore } from "./note-store";
|
||||
import BaseStore from "./index";
|
||||
import { groupArray } from "notes-core/utils/grouping";
|
||||
import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
|
||||
import Config from "../utils/config";
|
||||
|
||||
class NotebookStore extends BaseStore {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import createStore from "../common/store";
|
||||
import { db } from "../common/db";
|
||||
import BaseStore from "./index";
|
||||
import { groupArray } from "notes-core/utils/grouping";
|
||||
import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
|
||||
|
||||
class TagStore extends BaseStore {
|
||||
tags = [];
|
||||
|
||||
@@ -2,7 +2,7 @@ import createStore from "../common/store";
|
||||
import BaseStore from "./index";
|
||||
import Config from "../utils/config";
|
||||
import changeAppTheme from "../commands/change-app-theme";
|
||||
import { getDefaultAccentColor } from "@notesnook/theme";
|
||||
import { getDefaultAccentColor } from "@streetwriters/theme";
|
||||
|
||||
class ThemeStore extends BaseStore {
|
||||
theme = Config.get("theme", "light");
|
||||
|
||||
@@ -3,7 +3,7 @@ import createStore from "../common/store";
|
||||
import BaseStore from "./index";
|
||||
import { store as appStore } from "./app-store";
|
||||
import { store as notestore } from "./note-store";
|
||||
import { groupArray } from "notes-core/utils/grouping";
|
||||
import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
|
||||
|
||||
class TrashStore extends BaseStore {
|
||||
trash = [];
|
||||
|
||||
@@ -3,7 +3,7 @@ import { db } from "../common/db";
|
||||
import { store as appStore } from "./app-store";
|
||||
import BaseStore from "./index";
|
||||
import config from "../utils/config";
|
||||
import { EV, EVENTS } from "notes-core/common";
|
||||
import { EV, EVENTS } from "@streetwriters/notesnook-core/common";
|
||||
import {
|
||||
showAccountLoggedOutNotice,
|
||||
showOnboardingDialog,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import EventManager from "notes-core/utils/eventmanager";
|
||||
import EventManager from "@streetwriters/notesnook-core/utils/eventmanager";
|
||||
|
||||
const GlobalKeyboard = {};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useStore as useNotesStore } from "../stores/note-store";
|
||||
import NotesPlaceholder from "../components/placeholders/notesplacholder";
|
||||
import { hashNavigate, navigate } from "../navigation";
|
||||
import FavoritesPlaceholder from "../components/placeholders/favorites-placeholder";
|
||||
import { groupArray } from "notes-core/utils/grouping";
|
||||
import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
|
||||
import { db } from "../common/db";
|
||||
import { Flex, Text } from "rebass";
|
||||
import { SyncError } from "../components/icons";
|
||||
|
||||
@@ -32,7 +32,7 @@ import ScrollContainer from "../components/scroll-container";
|
||||
import { showToast } from "../utils/toast";
|
||||
import { hardNavigate, hashNavigate } from "../navigation";
|
||||
import { appVersion } from "../utils/version";
|
||||
import { CHECK_IDS } from "notes-core/common";
|
||||
import { CHECK_IDS } from "@streetwriters/notesnook-core/common";
|
||||
import Tip from "../components/tip";
|
||||
import Toggle from "../components/toggle";
|
||||
import { isDesktop } from "../utils/platform";
|
||||
@@ -42,7 +42,7 @@ import { Slider } from "@rebass/forms";
|
||||
import useZoomFactor from "../hooks/use-zoom-factor";
|
||||
import { PATHS } from "@notesnook/desktop/paths";
|
||||
import { openPath } from "../commands/open";
|
||||
import { getAllAccents } from "@notesnook/theme";
|
||||
import { getAllAccents } from "@streetwriters/theme";
|
||||
import { debounce } from "../utils/debounce";
|
||||
|
||||
function subscriptionStatusToString(user) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import TopicsPlaceholder from "../components/placeholders/topics-placeholder";
|
||||
import { Button, Flex, Text } from "rebass";
|
||||
import { Edit, RemoveShortcutLink, ShortcutLink } from "../components/icons";
|
||||
import { getTotalNotes } from "../common";
|
||||
import { formatDate } from "notes-core/utils/date";
|
||||
import { formatDate } from "@streetwriters/notesnook-core/utils/date";
|
||||
import { db } from "../common/db";
|
||||
import { pluralize } from "../utils/string";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user