aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay <[email protected]>2023-08-01 22:45:01 -0400
committerAjay <[email protected]>2023-08-01 22:45:01 -0400
commit16005e417d9bcf21afc13465fdd285d3664d8600 (patch)
tree3fe7f671827218e188fdfcd12ed008f55d4b74e1
parent8840dba90fcd0381d3ba501f2042e66ec28d18c6 (diff)
downloadSponsorBlock-16005e417d9bcf21afc13465fdd285d3664d8600.tar.gz
SponsorBlock-16005e417d9bcf21afc13465fdd285d3664d8600.zip
Remove maze utils symlink
-rw-r--r--CONTRIBUTING.md9
-rw-r--r--src/background.ts10
-rw-r--r--src/components/CategoryPillComponent.tsx2
-rw-r--r--src/components/ChapterVoteComponent.tsx2
-rw-r--r--src/components/SkipNoticeComponent.tsx4
-rw-r--r--src/components/SponsorTimeEditComponent.tsx2
-rw-r--r--src/components/options/KeybindComponent.tsx2
-rw-r--r--src/components/options/KeybindDialogComponent.tsx2
-rw-r--r--src/config.ts4
-rw-r--r--src/content.ts18
-rw-r--r--src/document.ts2
-rw-r--r--src/help.ts4
-rw-r--r--src/js-components/previewBar.ts6
-rw-r--r--src/js-components/skipButtonControlBar.ts2
l---------src/maze-utils1
-rw-r--r--src/options.ts8
-rw-r--r--src/permissions.ts2
-rw-r--r--src/popup.ts8
-rw-r--r--src/render/CategoryPill.tsx6
-rw-r--r--src/utils.ts10
-rw-r--r--src/utils/crossExtension.ts4
-rw-r--r--src/utils/exporter.ts4
-rw-r--r--src/utils/pageUtils.ts2
-rw-r--r--src/utils/thumbnails.ts4
-rw-r--r--src/utils/videoLabels.ts2
-rw-r--r--src/utils/warnings.ts4
26 files changed, 58 insertions, 66 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8fd62361..eb3709f0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -5,11 +5,4 @@ Make sure to pull and update all submodules
`git submodule update --init --recursive`
"? property does not exist on type ConfigClass"
-> Make sure to copy `config.json.example` to `config.json` and remove comments
-
-# Windows
-"Cannot find module "../maze-utils"
-- Enable "Developer Mode" in windows for symlinks
-- `src/maze-utils` will not appear properly and builds will fail since it is is only rendered as a file
-- Enable symlink support in git `git config --global core.symlinks true`
-- run `git checkout -- src/maze-utils` in order to create a symlink instead of a text file \ No newline at end of file
+> Make sure to copy `config.json.example` to `config.json` and remove comments \ No newline at end of file
diff --git a/src/background.ts b/src/background.ts
index a915b199..7ed4d2b2 100644
--- a/src/background.ts
+++ b/src/background.ts
@@ -3,9 +3,9 @@ import * as CompileConfig from "../config.json";
import Config from "./config";
import { Registration } from "./types";
import "content-scripts-register-polyfill";
-import { sendRealRequestToCustomServer, setupBackgroundRequestProxy } from "./maze-utils/background-request-proxy";
-import { setupTabUpdates } from "./maze-utils/tab-updates";
-import { generateUserID } from "./maze-utils/setup";
+import { sendRealRequestToCustomServer, setupBackgroundRequestProxy } from "../maze-utils/src/background-request-proxy";
+import { setupTabUpdates } from "../maze-utils/src/tab-updates";
+import { generateUserID } from "../maze-utils/src/setup";
// Make the config public for debugging purposes
@@ -13,8 +13,8 @@ window.SB = Config;
import Utils from "./utils";
import { getExtensionIdsToImportFrom } from "./utils/crossExtension";
-import { isFirefoxOrSafari } from "./maze-utils";
-import { injectUpdatedScripts } from "./maze-utils/cleanup";
+import { isFirefoxOrSafari } from "../maze-utils/src";
+import { injectUpdatedScripts } from "../maze-utils/src/cleanup";
import { logWarn } from "./utils/logger";
const utils = new Utils({
registerFirefoxContentScript,
diff --git a/src/components/CategoryPillComponent.tsx b/src/components/CategoryPillComponent.tsx
index 39ccdb90..1d39a400 100644
--- a/src/components/CategoryPillComponent.tsx
+++ b/src/components/CategoryPillComponent.tsx
@@ -8,7 +8,7 @@ import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils";
import { VoteResponse } from "../messageTypes";
import { AnimationUtils } from "../utils/animationUtils";
import { Tooltip } from "../render/Tooltip";
-import { getErrorMessage } from "../maze-utils/formating";
+import { getErrorMessage } from "../../maze-utils/src/formating";
export interface CategoryPillProps {
vote: (type: number, UUID: SegmentUUID, category?: Category) => Promise<VoteResponse>;
diff --git a/src/components/ChapterVoteComponent.tsx b/src/components/ChapterVoteComponent.tsx
index 4d571f77..9ee75727 100644
--- a/src/components/ChapterVoteComponent.tsx
+++ b/src/components/ChapterVoteComponent.tsx
@@ -8,7 +8,7 @@ import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils";
import { VoteResponse } from "../messageTypes";
import { AnimationUtils } from "../utils/animationUtils";
import { Tooltip } from "../render/Tooltip";
-import { getErrorMessage } from "../maze-utils/formating";
+import { getErrorMessage } from "../../maze-utils/src/formating";
export interface ChapterVoteProps {
vote: (type: number, UUID: SegmentUUID, category?: Category) => Promise<VoteResponse>;
diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx
index 2ee1018c..d03e135e 100644
--- a/src/components/SkipNoticeComponent.tsx
+++ b/src/components/SkipNoticeComponent.tsx
@@ -12,8 +12,8 @@ import ThumbsUpSvg from "../svg-icons/thumbs_up_svg";
import ThumbsDownSvg from "../svg-icons/thumbs_down_svg";
import PencilSvg from "../svg-icons/pencil_svg";
import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils";
-import { generateUserID } from "../maze-utils/setup";
-import { keybindToString } from "../maze-utils/config";
+import { generateUserID } from "../../maze-utils/src/setup";
+import { keybindToString } from "../../maze-utils/src/config";
enum SkipButtonState {
Undo, // Unskip
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx
index 53f88741..4f0f656d 100644
--- a/src/components/SponsorTimeEditComponent.tsx
+++ b/src/components/SponsorTimeEditComponent.tsx
@@ -7,7 +7,7 @@ import SubmissionNoticeComponent from "./SubmissionNoticeComponent";
import { RectangleTooltip } from "../render/RectangleTooltip";
import SelectorComponent, { SelectorOption } from "./SelectorComponent";
import { DEFAULT_CATEGORY } from "../utils/categoryUtils";
-import { getFormattedTime, getFormattedTimeToSeconds } from "../maze-utils/formating";
+import { getFormattedTime, getFormattedTimeToSeconds } from "../../maze-utils/src/formating";
const utils = new Utils();
diff --git a/src/components/options/KeybindComponent.tsx b/src/components/options/KeybindComponent.tsx
index b80c55d9..6f5b8e60 100644
--- a/src/components/options/KeybindComponent.tsx
+++ b/src/components/options/KeybindComponent.tsx
@@ -2,7 +2,7 @@ import * as React from "react";
import { createRoot, Root } from 'react-dom/client';
import Config from "../../config";
import KeybindDialogComponent from "./KeybindDialogComponent";
-import { formatKey, Keybind, keybindEquals, keybindToString } from "../../maze-utils/config";
+import { formatKey, Keybind, keybindEquals, keybindToString } from "../../../maze-utils/src/config";
export interface KeybindProps {
option: string;
diff --git a/src/components/options/KeybindDialogComponent.tsx b/src/components/options/KeybindDialogComponent.tsx
index e36fd705..057a3b05 100644
--- a/src/components/options/KeybindDialogComponent.tsx
+++ b/src/components/options/KeybindDialogComponent.tsx
@@ -1,7 +1,7 @@
import * as React from "react";
import { ChangeEvent } from "react";
import Config from "../../config";
-import { Keybind, formatKey, keybindEquals } from "../../maze-utils/config";
+import { Keybind, formatKey, keybindEquals } from "../../../maze-utils/src/config";
export interface KeybindDialogProps {
option: string;
diff --git a/src/config.ts b/src/config.ts
index 4b92b48b..61b32937 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -1,8 +1,8 @@
import * as CompileConfig from "../config.json";
import * as invidiousList from "../ci/invidiouslist.json";
import { Category, CategorySelection, CategorySkipOption, NoticeVisbilityMode, PreviewBarOption, SponsorTime, VideoID, SponsorHideType } from "./types";
-import { Keybind, ProtoConfig, keybindEquals } from "./maze-utils/config";
-import { HashedValue } from "./maze-utils/hash";
+import { Keybind, ProtoConfig, keybindEquals } from "../maze-utils/src/config";
+import { HashedValue } from "../maze-utils/src/hash";
export interface Permission {
canSubmit: boolean;
diff --git a/src/content.ts b/src/content.ts
index 379d28d0..dbc834a3 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -32,21 +32,21 @@ import { logDebug } from "./utils/logger";
import { importTimes } from "./utils/exporter";
import { ChapterVote } from "./render/ChapterVote";
import { openWarningDialog } from "./utils/warnings";
-import { isFirefoxOrSafari, waitFor } from "./maze-utils";
-import { getErrorMessage, getFormattedTime } from "./maze-utils/formating";
-import { getChannelIDInfo, getVideo, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube } from "./maze-utils/video";
-import { Keybind, StorageChangesObject, isSafari, keybindEquals } from "./maze-utils/config";
-import { findValidElement, waitForElement } from "./maze-utils/dom"
-import { getHash, HashedValue } from "./maze-utils/hash";
-import { generateUserID } from "./maze-utils/setup";
-import { updateAll } from "./maze-utils/thumbnailManagement";
+import { isFirefoxOrSafari, waitFor } from "../maze-utils/src";
+import { getErrorMessage, getFormattedTime } from "../maze-utils/src/formating";
+import { getChannelIDInfo, getVideo, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube } from "../maze-utils/src/video";
+import { Keybind, StorageChangesObject, isSafari, keybindEquals } from "../maze-utils/src/config";
+import { findValidElement, waitForElement } from "../maze-utils/src/dom"
+import { getHash, HashedValue } from "../maze-utils/src/hash";
+import { generateUserID } from "../maze-utils/src/setup";
+import { updateAll } from "../maze-utils/src/thumbnailManagement";
import { setupThumbnailListener } from "./utils/thumbnails";
import * as documentScript from "../dist/js/document.js";
import { Tooltip } from "./render/Tooltip";
import { isDeArrowInstalled } from "./utils/crossExtension";
import { runCompatibilityChecks } from "./utils/compatibility";
import { cleanPage } from "./utils/pageCleaner";
-import { addCleanupListener } from "./maze-utils/cleanup";
+import { addCleanupListener } from "../maze-utils/src/cleanup";
cleanPage();
diff --git a/src/document.ts b/src/document.ts
index 17579b56..fb18ccb0 100644
--- a/src/document.ts
+++ b/src/document.ts
@@ -1,3 +1,3 @@
-import { init } from "./maze-utils/injected/document";
+import { init } from "../maze-utils/src/injected/document";
init(); \ No newline at end of file
diff --git a/src/help.ts b/src/help.ts
index 4fe729df..3b8c636b 100644
--- a/src/help.ts
+++ b/src/help.ts
@@ -1,8 +1,8 @@
-import { localizeHtmlPage } from "./maze-utils/setup";
+import { localizeHtmlPage } from "../maze-utils/src/setup";
import Config from "./config";
import { showDonationLink } from "./utils/configUtils";
-import { waitFor } from "./maze-utils";
+import { waitFor } from "../maze-utils/src";
if (document.readyState === "complete") {
init();
diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts
index bcadbf3b..a3659aad 100644
--- a/src/js-components/previewBar.ts
+++ b/src/js-components/previewBar.ts
@@ -11,9 +11,9 @@ import { ActionType, Category, SegmentContainer, SponsorHideType, SponsorSourceT
import { partition } from "../utils/arrayUtils";
import { DEFAULT_CATEGORY, shortCategoryName } from "../utils/categoryUtils";
import { normalizeChapterName } from "../utils/exporter";
-import { getFormattedTimeToSeconds } from "../maze-utils/formating";
-import { findValidElement } from "../maze-utils/dom";
-import { addCleanupListener } from "../maze-utils/cleanup";
+import { getFormattedTimeToSeconds } from "../../maze-utils/src/formating";
+import { findValidElement } from "../../maze-utils/src/dom";
+import { addCleanupListener } from "../../maze-utils/src/cleanup";
const TOOLTIP_VISIBLE_CLASS = 'sponsorCategoryTooltipVisible';
const MIN_CHAPTER_SIZE = 0.003;
diff --git a/src/js-components/skipButtonControlBar.ts b/src/js-components/skipButtonControlBar.ts
index 84b6a45f..f8b2439f 100644
--- a/src/js-components/skipButtonControlBar.ts
+++ b/src/js-components/skipButtonControlBar.ts
@@ -2,7 +2,7 @@ import Config from "../config";
import { SponsorTime } from "../types";
import { getSkippingText } from "../utils/categoryUtils";
import { AnimationUtils } from "../utils/animationUtils";
-import { keybindToString } from "../maze-utils/config";
+import { keybindToString } from "../../maze-utils/src/config";
export interface SkipButtonControlBarProps {
skip: (segment: SponsorTime) => void;
diff --git a/src/maze-utils b/src/maze-utils
deleted file mode 120000
index a31448d9..00000000
--- a/src/maze-utils
+++ /dev/null
@@ -1 +0,0 @@
-../maze-utils/src/ \ No newline at end of file
diff --git a/src/options.ts b/src/options.ts
index 6e0cb6e0..8f89ecde 100644
--- a/src/options.ts
+++ b/src/options.ts
@@ -13,10 +13,10 @@ import CategoryChooser from "./render/CategoryChooser";
import UnsubmittedVideos from "./render/UnsubmittedVideos";
import KeybindComponent from "./components/options/KeybindComponent";
import { showDonationLink } from "./utils/configUtils";
-import { localizeHtmlPage } from "./maze-utils/setup";
-import { StorageChangesObject } from "./maze-utils/config";
-import { getHash } from "./maze-utils/hash";
-import { isFirefoxOrSafari } from "./maze-utils";
+import { localizeHtmlPage } from "../maze-utils/src/setup";
+import { StorageChangesObject } from "../maze-utils/src/config";
+import { getHash } from "../maze-utils/src/hash";
+import { isFirefoxOrSafari } from "../maze-utils/src";
import { isDeArrowInstalled } from "./utils/crossExtension";
const utils = new Utils();
let embed = false;
diff --git a/src/permissions.ts b/src/permissions.ts
index e55b197f..e42a08d8 100644
--- a/src/permissions.ts
+++ b/src/permissions.ts
@@ -1,6 +1,6 @@
import Config from "./config";
import Utils from "./utils";
-import { localizeHtmlPage } from "./maze-utils/setup";
+import { localizeHtmlPage } from "../maze-utils/src/setup";
const utils = new Utils();
// This is needed, if Config is not imported before Utils, things break.
diff --git a/src/popup.ts b/src/popup.ts
index 4034be7c..02404b6a 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -21,12 +21,12 @@ import {
import { showDonationLink } from "./utils/configUtils";
import { AnimationUtils } from "./utils/animationUtils";
import { shortCategoryName } from "./utils/categoryUtils";
-import { localizeHtmlPage } from "./maze-utils/setup";
+import { localizeHtmlPage } from "../maze-utils/src/setup";
import { exportTimes } from "./utils/exporter";
import GenericNotice from "./render/GenericNotice";
-import { getErrorMessage, getFormattedTime } from "./maze-utils/formating";
-import { StorageChangesObject } from "./maze-utils/config";
-import { getHash } from "./maze-utils/hash";
+import { getErrorMessage, getFormattedTime } from "../maze-utils/src/formating";
+import { StorageChangesObject } from "../maze-utils/src/config";
+import { getHash } from "../maze-utils/src/hash";
const utils = new Utils();
diff --git a/src/render/CategoryPill.tsx b/src/render/CategoryPill.tsx
index e30d1965..57730af9 100644
--- a/src/render/CategoryPill.tsx
+++ b/src/render/CategoryPill.tsx
@@ -5,9 +5,9 @@ import Config from "../config";
import { VoteResponse } from "../messageTypes";
import { Category, SegmentUUID, SponsorTime } from "../types";
import { Tooltip } from "./Tooltip";
-import { waitFor } from "../maze-utils";
-import { getYouTubeTitleNode } from "../maze-utils/elements";
-import { addCleanupListener } from "../maze-utils/cleanup";
+import { waitFor } from "../../maze-utils/src";
+import { getYouTubeTitleNode } from "../../maze-utils/src/elements";
+import { addCleanupListener } from "../../maze-utils/src/cleanup";
const id = "categoryPill";
diff --git a/src/utils.ts b/src/utils.ts
index e55c4e44..bf6199d5 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -1,12 +1,12 @@
import Config, { VideoDownvotes } from "./config";
import { CategorySelection, SponsorTime, BackgroundScriptContainer, Registration, VideoID, SponsorHideType, CategorySkipOption } from "./types";
-import { getHash, HashedValue } from "./maze-utils/hash";
+import { getHash, HashedValue } from "../maze-utils/src/hash";
import * as CompileConfig from "../config.json";
-import { isFirefoxOrSafari, waitFor } from "./maze-utils";
-import { findValidElementFromSelector } from "./maze-utils/dom";
-import { FetchResponse, sendRequestToCustomServer } from "./maze-utils/background-request-proxy"
-import { isSafari } from "./maze-utils/config";
+import { isFirefoxOrSafari, waitFor } from "../maze-utils/src";
+import { findValidElementFromSelector } from "../maze-utils/src/dom";
+import { FetchResponse, sendRequestToCustomServer } from "../maze-utils/src/background-request-proxy"
+import { isSafari } from "../maze-utils/src/config";
export default class Utils {
diff --git a/src/utils/crossExtension.ts b/src/utils/crossExtension.ts
index c67c8943..183ae931 100644
--- a/src/utils/crossExtension.ts
+++ b/src/utils/crossExtension.ts
@@ -1,8 +1,8 @@
import * as CompileConfig from "../../config.json";
import Config from "../config";
-import { isSafari } from "../maze-utils/config";
-import { isFirefoxOrSafari } from "../maze-utils";
+import { isSafari } from "../../maze-utils/src/config";
+import { isFirefoxOrSafari } from "../../maze-utils/src";
export function isDeArrowInstalled(): Promise<boolean> {
if (Config.config.deArrowInstalled) {
diff --git a/src/utils/exporter.ts b/src/utils/exporter.ts
index 97208841..a5871b65 100644
--- a/src/utils/exporter.ts
+++ b/src/utils/exporter.ts
@@ -1,8 +1,8 @@
import { ActionType, Category, SegmentUUID, SponsorSourceType, SponsorTime } from "../types";
import { shortCategoryName } from "./categoryUtils";
import * as CompileConfig from "../../config.json";
-import { getFormattedTime, getFormattedTimeToSeconds } from "../maze-utils/formating";
-import { generateUserID } from "../maze-utils/setup";
+import { getFormattedTime, getFormattedTimeToSeconds } from "../../maze-utils/src/formating";
+import { generateUserID } from "../../maze-utils/src/setup";
const inTest = typeof chrome === "undefined";
diff --git a/src/utils/pageUtils.ts b/src/utils/pageUtils.ts
index 2b79c2ec..f38ad503 100644
--- a/src/utils/pageUtils.ts
+++ b/src/utils/pageUtils.ts
@@ -1,5 +1,5 @@
import { ActionType, Category, SponsorSourceType, SponsorTime, VideoID } from "../types";
-import { getFormattedTimeToSeconds } from "../maze-utils/formating";
+import { getFormattedTimeToSeconds } from "../../maze-utils/src/formating";
export function getControls(): HTMLElement {
const controlsSelectors = [
diff --git a/src/utils/thumbnails.ts b/src/utils/thumbnails.ts
index 39ba5bda..61d28f18 100644
--- a/src/utils/thumbnails.ts
+++ b/src/utils/thumbnails.ts
@@ -1,7 +1,7 @@
-import { isOnInvidious, parseYouTubeVideoIDFromURL } from "../maze-utils/video";
+import { isOnInvidious, parseYouTubeVideoIDFromURL } from "../../maze-utils/src/video";
import Config from "../config";
import { getVideoLabel } from "./videoLabels";
-import { setThumbnailListener } from "../maze-utils/thumbnailManagement";
+import { setThumbnailListener } from "../../maze-utils/src/thumbnailManagement";
export async function labelThumbnails(thumbnails: HTMLImageElement[]): Promise<void> {
await Promise.all(thumbnails.map((t) => labelThumbnail(t)));
diff --git a/src/utils/videoLabels.ts b/src/utils/videoLabels.ts
index 23faa807..731bfd33 100644
--- a/src/utils/videoLabels.ts
+++ b/src/utils/videoLabels.ts
@@ -1,5 +1,5 @@
import { Category, CategorySkipOption, VideoID } from "../types";
-import { getHash } from "../maze-utils/hash";
+import { getHash } from "../../maze-utils/src/hash";
import Utils from "../utils";
import { logWarn } from "./logger";
diff --git a/src/utils/warnings.ts b/src/utils/warnings.ts
index 9bcf03aa..8e3110f2 100644
--- a/src/utils/warnings.ts
+++ b/src/utils/warnings.ts
@@ -1,5 +1,5 @@
-import { objectToURI } from "../maze-utils";
-import { getHash } from "../maze-utils/hash";
+import { objectToURI } from "../../maze-utils/src";
+import { getHash } from "../../maze-utils/src/hash";
import Config from "../config";
import GenericNotice, { NoticeOptions } from "../render/GenericNotice";
import { ContentContainer } from "../types";