diff options
author | Ajay <[email protected]> | 2023-06-30 03:07:57 -0400 |
---|---|---|
committer | Ajay <[email protected]> | 2023-06-30 03:07:57 -0400 |
commit | 0f7ed9926c9e85f6693eea812c8e69845710d730 (patch) | |
tree | 70a650a60b60a9be60699fdd019c3f95f098fc3d | |
parent | 75eb63632f32678737ea397cd43ec7b1bb2352fb (diff) | |
download | SponsorBlock-0f7ed9926c9e85f6693eea812c8e69845710d730.tar.gz SponsorBlock-0f7ed9926c9e85f6693eea812c8e69845710d730.zip |
Remove maze utils from npm deps
-rw-r--r-- | package-lock.json | 32 | ||||
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | src/background.ts | 6 | ||||
-rw-r--r-- | src/components/CategoryPillComponent.tsx | 2 | ||||
-rw-r--r-- | src/components/ChapterVoteComponent.tsx | 2 | ||||
-rw-r--r-- | src/components/SkipNoticeComponent.tsx | 4 | ||||
-rw-r--r-- | src/components/SponsorTimeEditComponent.tsx | 2 | ||||
-rw-r--r-- | src/components/options/KeybindComponent.tsx | 2 | ||||
-rw-r--r-- | src/components/options/KeybindDialogComponent.tsx | 2 | ||||
-rw-r--r-- | src/config.ts | 4 | ||||
-rw-r--r-- | src/content.ts | 16 | ||||
-rw-r--r-- | src/document.ts | 2 | ||||
-rw-r--r-- | src/help.ts | 4 | ||||
-rw-r--r-- | src/js-components/previewBar.ts | 4 | ||||
-rw-r--r-- | src/js-components/skipButtonControlBar.ts | 2 | ||||
-rw-r--r-- | src/options.ts | 8 | ||||
-rw-r--r-- | src/permissions.ts | 2 | ||||
-rw-r--r-- | src/popup.ts | 8 | ||||
-rw-r--r-- | src/render/CategoryPill.tsx | 4 | ||||
-rw-r--r-- | src/utils.ts | 10 | ||||
-rw-r--r-- | src/utils/crossExtension.ts | 4 | ||||
-rw-r--r-- | src/utils/exporter.ts | 4 | ||||
-rw-r--r-- | src/utils/pageUtils.ts | 2 | ||||
-rw-r--r-- | src/utils/thumbnails.ts | 4 | ||||
-rw-r--r-- | src/utils/videoLabels.ts | 2 | ||||
-rw-r--r-- | src/utils/warnings.ts | 4 |
26 files changed, 52 insertions, 85 deletions
diff --git a/package-lock.json b/package-lock.json index 3c32d5da..29289be1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,6 @@ ], "license": "LGPL-3.0-or-later", "dependencies": { - "@ajayyy/maze-utils": "1.1.37", "content-scripts-register-polyfill": "^4.0.2", "react": "^18.2.0", "react-dom": "^18.2.0" @@ -66,32 +65,6 @@ "node": ">=16" } }, - "node_modules/@ajayyy/maze-utils": { - "version": "1.1.37", - "resolved": "https://registry.npmjs.org/@ajayyy/maze-utils/-/maze-utils-1.1.37.tgz", - "integrity": "sha512-EOec/tfgTDdG2RFzfGdRpyBE3ACE7sAmzfKGzLZqhNznQGcCt/gELw49dHf7NeFzU+EU5vJ2jzTDizfB96gBMg==", - "funding": [ - { - "type": "individual", - "url": "https://sponsor.ajay.app/donate" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ajayyy-org" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/ajayyy" - }, - { - "type": "individual", - "url": "https://paypal.me/ajayyy" - } - ], - "engines": { - "node": ">=16" - } - }, "node_modules/@ampproject/remapping": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", @@ -13601,11 +13574,6 @@ } }, "dependencies": { - "@ajayyy/maze-utils": { - "version": "1.1.37", - "resolved": "https://registry.npmjs.org/@ajayyy/maze-utils/-/maze-utils-1.1.37.tgz", - "integrity": "sha512-EOec/tfgTDdG2RFzfGdRpyBE3ACE7sAmzfKGzLZqhNznQGcCt/gELw49dHf7NeFzU+EU5vJ2jzTDizfB96gBMg==" - }, "@ampproject/remapping": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", diff --git a/package.json b/package.json index a348c2c3..06439d0c 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "description": "", "main": "background.js", "dependencies": { - "@ajayyy/maze-utils": "1.1.37", "content-scripts-register-polyfill": "^4.0.2", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/src/background.ts b/src/background.ts index c70fcba5..382bfd89 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 "@ajayyy/maze-utils/lib/background-request-proxy"; -import { setupTabUpdates } from "@ajayyy/maze-utils/lib/tab-updates"; -import { generateUserID } from "@ajayyy/maze-utils/lib/setup"; +import { sendRealRequestToCustomServer, setupBackgroundRequestProxy } from "./maze-utils/background-request-proxy"; +import { setupTabUpdates } from "./maze-utils/tab-updates"; +import { generateUserID } from "./maze-utils/setup"; // Make the config public for debugging purposes diff --git a/src/components/CategoryPillComponent.tsx b/src/components/CategoryPillComponent.tsx index adcc7d4a..648983a7 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 "@ajayyy/maze-utils/lib/formating"; +import { getErrorMessage } from "../maze-utils/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 1c37a200..4d571f77 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 "@ajayyy/maze-utils/lib/formating"; +import { getErrorMessage } from "../maze-utils/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 9d7f450f..9615db74 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 "@ajayyy/maze-utils/lib/setup"; -import { keybindToString } from "@ajayyy/maze-utils/lib/config"; +import { generateUserID } from "../maze-utils/setup"; +import { keybindToString } from "../maze-utils/config"; enum SkipButtonState { Undo, // Unskip diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index adf2ca8d..53f88741 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 "@ajayyy/maze-utils/lib/formating"; +import { getFormattedTime, getFormattedTimeToSeconds } from "../maze-utils/formating"; const utils = new Utils(); diff --git a/src/components/options/KeybindComponent.tsx b/src/components/options/KeybindComponent.tsx index 180d57f2..b80c55d9 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 "@ajayyy/maze-utils/lib/config"; +import { formatKey, Keybind, keybindEquals, keybindToString } from "../../maze-utils/config"; export interface KeybindProps { option: string; diff --git a/src/components/options/KeybindDialogComponent.tsx b/src/components/options/KeybindDialogComponent.tsx index 2c5405f3..e36fd705 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 "@ajayyy/maze-utils/lib/config"; +import { Keybind, formatKey, keybindEquals } from "../../maze-utils/config"; export interface KeybindDialogProps { option: string; diff --git a/src/config.ts b/src/config.ts index 1880110d..6ef0112c 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 "@ajayyy/maze-utils/lib/config"; -import { HashedValue } from "@ajayyy/maze-utils/lib/hash"; +import { Keybind, ProtoConfig, keybindEquals } from "./maze-utils/config"; +import { HashedValue } from "./maze-utils/hash"; export interface Permission { canSubmit: boolean; diff --git a/src/content.ts b/src/content.ts index e05055b0..2f15496a 100644 --- a/src/content.ts +++ b/src/content.ts @@ -32,14 +32,14 @@ import { logDebug } from "./utils/logger"; import { importTimes } from "./utils/exporter"; import { ChapterVote } from "./render/ChapterVote"; import { openWarningDialog } from "./utils/warnings"; -import { isFirefoxOrSafari, waitFor } from "@ajayyy/maze-utils"; -import { getErrorMessage, getFormattedTime } from "@ajayyy/maze-utils/lib/formating"; -import { getChannelIDInfo, getVideo, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube } from "@ajayyy/maze-utils/lib/video"; -import { Keybind, StorageChangesObject, isSafari, keybindEquals } from "@ajayyy/maze-utils/lib/config"; -import { findValidElement, waitForElement } from "@ajayyy/maze-utils/lib/dom" -import { getHash, HashedValue } from "@ajayyy/maze-utils/lib/hash"; -import { generateUserID } from "@ajayyy/maze-utils/lib/setup"; -import { updateAll } from "@ajayyy/maze-utils/lib/thumbnailManagement"; +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 { setupThumbnailListener } from "./utils/thumbnails"; import * as documentScript from "../dist/js/document.js"; import { Tooltip } from "./render/Tooltip"; diff --git a/src/document.ts b/src/document.ts index ed4c2840..17579b56 100644 --- a/src/document.ts +++ b/src/document.ts @@ -1,3 +1,3 @@ -import { init } from "@ajayyy/maze-utils/lib/injected/document"; +import { init } from "./maze-utils/injected/document"; init();
\ No newline at end of file diff --git a/src/help.ts b/src/help.ts index 95d84c88..c5de3470 100644 --- a/src/help.ts +++ b/src/help.ts @@ -1,8 +1,8 @@ -import { localizeHtmlPage } from "@ajayyy/maze-utils/lib/setup"; +import { localizeHtmlPage } from "./maze-utils/setup"; import Config from "./config"; import { showDonationLink } from "./utils/configUtils"; -import { waitFor } from "@ajayyy/maze-utils"; +import { waitFor } from "./maze-utils"; window.addEventListener('DOMContentLoaded', init); diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts index 1a068ff1..80d61c8f 100644 --- a/src/js-components/previewBar.ts +++ b/src/js-components/previewBar.ts @@ -11,8 +11,8 @@ 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 "@ajayyy/maze-utils/lib/formating"; -import { findValidElement } from "@ajayyy/maze-utils/lib/dom"; +import { getFormattedTimeToSeconds } from "../maze-utils/formating"; +import { findValidElement } from "../maze-utils/dom"; 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 6b3654f2..84b6a45f 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 "@ajayyy/maze-utils/lib/config"; +import { keybindToString } from "../maze-utils/config"; export interface SkipButtonControlBarProps { skip: (segment: SponsorTime) => void; diff --git a/src/options.ts b/src/options.ts index a4be9f76..71ed6339 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 "@ajayyy/maze-utils/lib/setup"; -import { StorageChangesObject } from "@ajayyy/maze-utils/lib/config"; -import { getHash } from "@ajayyy/maze-utils/lib/hash"; -import { isFirefoxOrSafari } from "@ajayyy/maze-utils"; +import { localizeHtmlPage } from "./maze-utils/setup"; +import { StorageChangesObject } from "./maze-utils/config"; +import { getHash } from "./maze-utils/hash"; +import { isFirefoxOrSafari } from "./maze-utils"; import { isDeArrowInstalled } from "./utils/crossExtension"; const utils = new Utils(); let embed = false; diff --git a/src/permissions.ts b/src/permissions.ts index f38b0bc9..fdb311dc 100644 --- a/src/permissions.ts +++ b/src/permissions.ts @@ -1,6 +1,6 @@ import Config from "./config"; import Utils from "./utils"; -import { localizeHtmlPage } from "@ajayyy/maze-utils/lib/setup"; +import { localizeHtmlPage } from "./maze-utils/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 dc6713e5..4034be7c 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 "@ajayyy/maze-utils/lib/setup"; +import { localizeHtmlPage } from "./maze-utils/setup"; import { exportTimes } from "./utils/exporter"; import GenericNotice from "./render/GenericNotice"; -import { getErrorMessage, getFormattedTime } from "@ajayyy/maze-utils/lib/formating"; -import { StorageChangesObject } from "@ajayyy/maze-utils/lib/config"; -import { getHash } from "@ajayyy/maze-utils/lib/hash"; +import { getErrorMessage, getFormattedTime } from "./maze-utils/formating"; +import { StorageChangesObject } from "./maze-utils/config"; +import { getHash } from "./maze-utils/hash"; const utils = new Utils(); diff --git a/src/render/CategoryPill.tsx b/src/render/CategoryPill.tsx index c089a061..91380c24 100644 --- a/src/render/CategoryPill.tsx +++ b/src/render/CategoryPill.tsx @@ -5,8 +5,8 @@ import Config from "../config"; import { VoteResponse } from "../messageTypes"; import { Category, SegmentUUID, SponsorTime } from "../types"; import { Tooltip } from "./Tooltip"; -import { waitFor } from "@ajayyy/maze-utils"; -import { getYouTubeTitleNode } from "@ajayyy/maze-utils/lib/elements"; +import { waitFor } from "../maze-utils"; +import { getYouTubeTitleNode } from "../maze-utils/elements"; const id = "categoryPill"; diff --git a/src/utils.ts b/src/utils.ts index 7709d9df..cbe4e589 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 "@ajayyy/maze-utils/lib/hash"; +import { getHash, HashedValue } from "./maze-utils/hash"; import * as CompileConfig from "../config.json"; -import { isFirefoxOrSafari, waitFor } from "@ajayyy/maze-utils"; -import { findValidElementFromSelector } from "@ajayyy/maze-utils/lib/dom"; -import { FetchResponse, sendRequestToCustomServer } from "@ajayyy/maze-utils/lib/background-request-proxy" -import { isSafari } from "@ajayyy/maze-utils/lib/config"; +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"; export default class Utils { diff --git a/src/utils/crossExtension.ts b/src/utils/crossExtension.ts index 5b9cb498..c67c8943 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 "@ajayyy/maze-utils/lib/config"; -import { isFirefoxOrSafari } from "@ajayyy/maze-utils"; +import { isSafari } from "../maze-utils/config"; +import { isFirefoxOrSafari } from "../maze-utils"; export function isDeArrowInstalled(): Promise<boolean> { if (Config.config.deArrowInstalled) { diff --git a/src/utils/exporter.ts b/src/utils/exporter.ts index 25b7c254..97208841 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 "@ajayyy/maze-utils/lib/formating"; -import { generateUserID } from "@ajayyy/maze-utils/lib/setup"; +import { getFormattedTime, getFormattedTimeToSeconds } from "../maze-utils/formating"; +import { generateUserID } from "../maze-utils/setup"; const inTest = typeof chrome === "undefined"; diff --git a/src/utils/pageUtils.ts b/src/utils/pageUtils.ts index 83291f1d..ab4d5619 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 "@ajayyy/maze-utils/lib/formating"; +import { getFormattedTimeToSeconds } from "../maze-utils/formating"; export function getControls(): HTMLElement { const controlsSelectors = [ diff --git a/src/utils/thumbnails.ts b/src/utils/thumbnails.ts index a54530a6..39ba5bda 100644 --- a/src/utils/thumbnails.ts +++ b/src/utils/thumbnails.ts @@ -1,7 +1,7 @@ -import { isOnInvidious, parseYouTubeVideoIDFromURL } from "@ajayyy/maze-utils/lib/video"; +import { isOnInvidious, parseYouTubeVideoIDFromURL } from "../maze-utils/video"; import Config from "../config"; import { getVideoLabel } from "./videoLabels"; -import { setThumbnailListener } from "@ajayyy/maze-utils/lib/thumbnailManagement"; +import { setThumbnailListener } from "../maze-utils/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 15815ab9..23faa807 100644 --- a/src/utils/videoLabels.ts +++ b/src/utils/videoLabels.ts @@ -1,5 +1,5 @@ import { Category, CategorySkipOption, VideoID } from "../types"; -import { getHash } from "@ajayyy/maze-utils/lib/hash"; +import { getHash } from "../maze-utils/hash"; import Utils from "../utils"; import { logWarn } from "./logger"; diff --git a/src/utils/warnings.ts b/src/utils/warnings.ts index f4618009..9bcf03aa 100644 --- a/src/utils/warnings.ts +++ b/src/utils/warnings.ts @@ -1,5 +1,5 @@ -import { objectToURI } from "@ajayyy/maze-utils"; -import { getHash } from "@ajayyy/maze-utils/lib/hash"; +import { objectToURI } from "../maze-utils"; +import { getHash } from "../maze-utils/hash"; import Config from "../config"; import GenericNotice, { NoticeOptions } from "../render/GenericNotice"; import { ContentContainer } from "../types"; |