refactor!: cleanup platform support (#306)

* refactor!: cleanup platform support

* chore: lint

* fix: web platform

* feat: provide UniversalCache

Provide UniversalCache as a wrapper around Platform.shim.Cache.

* fix: invalid import

* refactor: remove isolated-vm support

* fix: type info

* refactor: cleanup exports

* fix: mark jintr as external dependency

In the bundled CJS node build, mark jintr as external.

* chore: add additional exports

web exports provide a way to select web implementation manually without
relying on the bundler to select it correctly from the "exports" field

web points to src/platform/web.js
web.bundle points to bundle/browser.js
web.bundle.browser points to bundle/browser.min.js

agnostic exports provide users of the library to provide their own
platform implementation without first importing the default one.

agnostic points to src/platform/lib.ts

* fix: toDash on web

* revert: eval is synchronous

* fix: use serializeDOM in FormatUtils

* ci: automate releases with `release-please`

* chore: clean up workflow files

* ci: fix NPM publish action

---------

Co-authored-by: LuanRT <luan.lrt4@gmail.com>
This commit is contained in:
Daniel Wykerd
2023-02-12 09:21:44 +02:00
committed by GitHub
parent a69e43bf3a
commit 2ccbe2ce62
504 changed files with 11184 additions and 6279 deletions

View File

@@ -1,6 +1,6 @@
import Parser from '../../index';
import { YTNode } from '../../helpers';
import type LiveChatBanner from './items/LiveChatBanner';
import Parser from '../../index.js';
import { YTNode } from '../../helpers.js';
import type LiveChatBanner from './items/LiveChatBanner.js';
class AddBannerToLiveChatCommand extends YTNode {
static type = 'AddBannerToLiveChatCommand';

View File

@@ -1,5 +1,5 @@
import Parser from '../../index';
import { YTNode } from '../../helpers';
import Parser from '../../index.js';
import { YTNode } from '../../helpers.js';
class AddChatItemAction extends YTNode {
static type = 'AddChatItemAction';

View File

@@ -1,5 +1,5 @@
import Parser from '../../index';
import { YTNode } from '../../helpers';
import Parser from '../../index.js';
import { YTNode } from '../../helpers.js';
class AddLiveChatTickerItemAction extends YTNode {
static type = 'AddLiveChatTickerItemAction';

View File

@@ -1,4 +1,4 @@
import { YTNode } from '../../helpers';
import { YTNode } from '../../helpers.js';
class DimChatItemAction extends YTNode {
static type = 'DimChatItemAction';

View File

@@ -1,5 +1,5 @@
import Parser from '../../index';
import { YTNode } from '../../helpers';
import Parser from '../../index.js';
import { YTNode } from '../../helpers.js';
class LiveChatActionPanel extends YTNode {
static type = 'LiveChatActionPanel';

View File

@@ -1,5 +1,5 @@
import Text from '../misc/Text';
import { YTNode } from '../../helpers';
import Text from '../misc/Text.js';
import { YTNode } from '../../helpers.js';
class MarkChatItemAsDeletedAction extends YTNode {
static type = 'MarkChatItemAsDeletedAction';

View File

@@ -1,5 +1,5 @@
import Text from '../misc/Text';
import { YTNode } from '../../helpers';
import Text from '../misc/Text.js';
import { YTNode } from '../../helpers.js';
class MarkChatItemsByAuthorAsDeletedAction extends YTNode {
static type = 'MarkChatItemsByAuthorAsDeletedAction';

View File

@@ -1,4 +1,4 @@
import { YTNode } from '../../helpers';
import { YTNode } from '../../helpers.js';
class RemoveBannerForLiveChatCommand extends YTNode {
static type = 'RemoveBannerForLiveChatCommand';

View File

@@ -1,4 +1,4 @@
import { YTNode } from '../../helpers';
import { YTNode } from '../../helpers.js';
class RemoveChatItemAction extends YTNode {
static type = 'RemoveChatItemAction';

View File

@@ -1,4 +1,4 @@
import { YTNode } from '../../helpers';
import { YTNode } from '../../helpers.js';
class RemoveChatItemByAuthorAction extends YTNode {
static type = 'RemoveChatItemByAuthorAction';

View File

@@ -1,5 +1,5 @@
import Parser from '../../index';
import { YTNode } from '../../helpers';
import Parser from '../../index.js';
import { YTNode } from '../../helpers.js';
class ReplaceChatItemAction extends YTNode {
static type = 'ReplaceChatItemAction';

View File

@@ -1,5 +1,5 @@
import Parser from '../../index';
import { YTNode } from '../../helpers';
import Parser from '../../index.js';
import { YTNode } from '../../helpers.js';
class ReplayChatItemAction extends YTNode {
static type = 'ReplayChatItemAction';

View File

@@ -1,6 +1,6 @@
import Parser from '../../index';
import { YTNode } from '../../helpers';
import LiveChatActionPanel from './LiveChatActionPanel';
import Parser from '../../index.js';
import { YTNode } from '../../helpers.js';
import LiveChatActionPanel from './LiveChatActionPanel.js';
class ShowLiveChatActionPanelAction extends YTNode {
static type = 'ShowLiveChatActionPanelAction';

View File

@@ -1,5 +1,5 @@
import Parser from '../..';
import { YTNode } from '../../helpers';
import Parser from '../../index.js';
import { YTNode } from '../../helpers.js';
class ShowLiveChatDialogAction extends YTNode {
static type = 'ShowLiveChatDialogAction';

View File

@@ -1,5 +1,5 @@
import Parser from '../../index';
import { YTNode } from '../../helpers';
import Parser from '../../index.js';
import { YTNode } from '../../helpers.js';
class ShowLiveChatTooltipCommand extends YTNode {
static type = 'ShowLiveChatTooltipCommand';

View File

@@ -1,5 +1,5 @@
import Text from '../misc/Text';
import { YTNode } from '../../helpers';
import Text from '../misc/Text.js';
import { YTNode } from '../../helpers.js';
class UpdateDateTextAction extends YTNode {
static type = 'UpdateDateTextAction';

View File

@@ -1,5 +1,5 @@
import Text from '../misc/Text';
import { YTNode } from '../../helpers';
import Text from '../misc/Text.js';
import { YTNode } from '../../helpers.js';
class UpdateDescriptionAction extends YTNode {
static type = 'UpdateDescriptionAction';

View File

@@ -1,5 +1,5 @@
import Parser from '../../index';
import { YTNode } from '../../helpers';
import Parser from '../../index.js';
import { YTNode } from '../../helpers.js';
class UpdateLiveChatPollAction extends YTNode {
static type = 'UpdateLiveChatPollAction';

View File

@@ -1,5 +1,5 @@
import Text from '../misc/Text';
import { YTNode } from '../../helpers';
import Text from '../misc/Text.js';
import { YTNode } from '../../helpers.js';
class UpdateTitleAction extends YTNode {
static type = 'UpdateTitleAction';

View File

@@ -1,5 +1,5 @@
import Text from '../misc/Text';
import { YTNode } from '../../helpers';
import Text from '../misc/Text.js';
import { YTNode } from '../../helpers.js';
class UpdateToggleButtonTextAction extends YTNode {
static type = 'UpdateToggleButtonTextAction';

View File

@@ -1,5 +1,5 @@
import Text from '../misc/Text';
import { YTNode } from '../../helpers';
import Text from '../misc/Text.js';
import { YTNode } from '../../helpers.js';
class UpdateViewershipAction extends YTNode {
static type = 'UpdateViewershipAction';

View File

@@ -1,8 +1,8 @@
import { ObservedArray, YTNode } from '../../../helpers';
import Parser from '../../../index';
import Button from '../../Button';
import Text from '../../misc/Text';
import NavigationEndpoint from '../../NavigationEndpoint';
import { ObservedArray, YTNode } from '../../../helpers.js';
import Parser from '../../../index.js';
import Button from '../../Button.js';
import Text from '../../misc/Text.js';
import NavigationEndpoint from '../../NavigationEndpoint.js';
class LiveChatAutoModMessage extends YTNode {
static type = 'LiveChatAutoModMessage';

View File

@@ -1,6 +1,6 @@
import { YTNode } from '../../../helpers';
import Parser from '../../../index';
import type LiveChatBannerHeader from './LiveChatBannerHeader';
import { YTNode } from '../../../helpers.js';
import Parser from '../../../index.js';
import type LiveChatBannerHeader from './LiveChatBannerHeader.js';
class LiveChatBanner extends YTNode {
static type = 'LiveChatBanner';

View File

@@ -1,7 +1,7 @@
import { YTNode } from '../../../helpers';
import Parser from '../../../index';
import type Button from '../../Button';
import Text from '../../misc/Text';
import { YTNode } from '../../../helpers.js';
import Parser from '../../../index.js';
import type Button from '../../Button.js';
import Text from '../../misc/Text.js';
class LiveChatBannerHeader extends YTNode {
static type = 'LiveChatBannerHeader';

View File

@@ -1,7 +1,7 @@
import { YTNode } from '../../../helpers';
import Parser from '../../../index';
import Text from '../../misc/Text';
import Thumbnail from '../../misc/Thumbnail';
import { YTNode } from '../../../helpers.js';
import Parser from '../../../index.js';
import Text from '../../misc/Text.js';
import Thumbnail from '../../misc/Thumbnail.js';
class LiveChatBannerPoll extends YTNode {
static type = 'LiveChatBannerPoll';

View File

@@ -1,10 +1,10 @@
import { observe, ObservedArray, YTNode } from '../../../helpers';
import Parser from '../../../index';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge';
import MetadataBadge from '../../MetadataBadge';
import Text from '../../misc/Text';
import Thumbnail from '../../misc/Thumbnail';
import NavigationEndpoint from '../../NavigationEndpoint';
import { observe, ObservedArray, YTNode } from '../../../helpers.js';
import Parser from '../../../index.js';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js';
import MetadataBadge from '../../MetadataBadge.js';
import Text from '../../misc/Text.js';
import Thumbnail from '../../misc/Thumbnail.js';
import NavigationEndpoint from '../../NavigationEndpoint.js';
class LiveChatMembershipItem extends YTNode {
static type = 'LiveChatMembershipItem';

View File

@@ -1,10 +1,10 @@
import { observe, ObservedArray, YTNode } from '../../../helpers';
import Parser from '../../../index';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge';
import MetadataBadge from '../../MetadataBadge';
import Text from '../../misc/Text';
import Thumbnail from '../../misc/Thumbnail';
import NavigationEndpoint from '../../NavigationEndpoint';
import { observe, ObservedArray, YTNode } from '../../../helpers.js';
import Parser from '../../../index.js';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js';
import MetadataBadge from '../../MetadataBadge.js';
import Text from '../../misc/Text.js';
import Thumbnail from '../../misc/Thumbnail.js';
import NavigationEndpoint from '../../NavigationEndpoint.js';
class LiveChatPaidMessage extends YTNode {
static type = 'LiveChatPaidMessage';

View File

@@ -1,10 +1,10 @@
import { observe, ObservedArray, YTNode } from '../../../helpers';
import Parser from '../../../index';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge';
import MetadataBadge from '../../MetadataBadge';
import Text from '../../misc/Text';
import Thumbnail from '../../misc/Thumbnail';
import NavigationEndpoint from '../../NavigationEndpoint';
import { observe, ObservedArray, YTNode } from '../../../helpers.js';
import Parser from '../../../index.js';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js';
import MetadataBadge from '../../MetadataBadge.js';
import Text from '../../misc/Text.js';
import Thumbnail from '../../misc/Thumbnail.js';
import NavigationEndpoint from '../../NavigationEndpoint.js';
class LiveChatPaidSticker extends YTNode {
static type = 'LiveChatPaidSticker';

View File

@@ -1,4 +1,4 @@
import { YTNode } from '../../../helpers';
import { YTNode } from '../../../helpers.js';
class LiveChatPlaceholderItem extends YTNode {
static type = 'LiveChatPlaceholderItem';

View File

@@ -1,9 +1,9 @@
import Parser from '../../../index';
import { YTNode } from '../../../helpers';
import Parser from '../../../index.js';
import { YTNode } from '../../../helpers.js';
import Text from '../../misc/Text';
import Thumbnail from '../../misc/Thumbnail';
import NavigationEndpoint from '../../NavigationEndpoint';
import Text from '../../misc/Text.js';
import Thumbnail from '../../misc/Thumbnail.js';
import NavigationEndpoint from '../../NavigationEndpoint.js';
class LiveChatProductItem extends YTNode {
static type = 'LiveChatProductItem';

View File

@@ -1,5 +1,5 @@
import { YTNode } from '../../../helpers';
import Text from '../../misc/Text';
import { YTNode } from '../../../helpers.js';
import Text from '../../misc/Text.js';
class LiveChatRestrictedParticipation extends YTNode {
message: Text;

View File

@@ -1,11 +1,11 @@
import { observe, ObservedArray, YTNode } from '../../../helpers';
import Parser from '../../../index';
import Button from '../../Button';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge';
import MetadataBadge from '../../MetadataBadge';
import Text from '../../misc/Text';
import Thumbnail from '../../misc/Thumbnail';
import NavigationEndpoint from '../../NavigationEndpoint';
import { observe, ObservedArray, YTNode } from '../../../helpers.js';
import Parser from '../../../index.js';
import Button from '../../Button.js';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js';
import MetadataBadge from '../../MetadataBadge.js';
import Text from '../../misc/Text.js';
import Thumbnail from '../../misc/Thumbnail.js';
import NavigationEndpoint from '../../NavigationEndpoint.js';
class LiveChatTextMessage extends YTNode {
static type = 'LiveChatTextMessage';

View File

@@ -1,11 +1,11 @@
import Parser from '../../../index';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge';
import MetadataBadge from '../../MetadataBadge';
import Text from '../../misc/Text';
import Thumbnail from '../../misc/Thumbnail';
import NavigationEndpoint from '../../NavigationEndpoint';
import Parser from '../../../index.js';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js';
import MetadataBadge from '../../MetadataBadge.js';
import Text from '../../misc/Text.js';
import Thumbnail from '../../misc/Thumbnail.js';
import NavigationEndpoint from '../../NavigationEndpoint.js';
import { observe, ObservedArray, YTNode } from '../../../helpers';
import { observe, ObservedArray, YTNode } from '../../../helpers.js';
class LiveChatTickerPaidMessageItem extends YTNode {
static type = 'LiveChatTickerPaidMessageItem';

View File

@@ -1,11 +1,11 @@
import Parser from '../../../index';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge';
import MetadataBadge from '../../MetadataBadge';
import Text from '../../misc/Text';
import Thumbnail from '../../misc/Thumbnail';
import NavigationEndpoint from '../../NavigationEndpoint';
import Parser from '../../../index.js';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js';
import MetadataBadge from '../../MetadataBadge.js';
import Text from '../../misc/Text.js';
import Thumbnail from '../../misc/Thumbnail.js';
import NavigationEndpoint from '../../NavigationEndpoint.js';
import { observe, ObservedArray, YTNode } from '../../../helpers';
import { observe, ObservedArray, YTNode } from '../../../helpers.js';
class LiveChatTickerPaidStickerItem extends YTNode {
static type = 'LiveChatTickerPaidStickerItem';

View File

@@ -1,9 +1,9 @@
import Parser from '../../..';
import { observe, ObservedArray, YTNode } from '../../../helpers';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge';
import MetadataBadge from '../../MetadataBadge';
import Text from '../../misc/Text';
import Thumbnail from '../../misc/Thumbnail';
import Parser from '../../../index.js';
import { observe, ObservedArray, YTNode } from '../../../helpers.js';
import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js';
import MetadataBadge from '../../MetadataBadge.js';
import Text from '../../misc/Text.js';
import Thumbnail from '../../misc/Thumbnail.js';
class LiveChatTickerSponsorItem extends YTNode {
static type = 'LiveChatTickerSponsorItem';

View File

@@ -1,5 +1,5 @@
import Parser from '../../../index';
import LiveChatTextMessage from './LiveChatTextMessage';
import Parser from '../../../index.js';
import LiveChatTextMessage from './LiveChatTextMessage.js';
class LiveChatViewerEngagementMessage extends LiveChatTextMessage {
static type = 'LiveChatViewerEngagementMessage';

View File

@@ -1,7 +1,7 @@
import Text from '../../misc/Text';
import Thumbnail from '../../misc/Thumbnail';
import Parser from '../../../index';
import { YTNode } from '../../../helpers';
import Text from '../../misc/Text.js';
import Thumbnail from '../../misc/Thumbnail.js';
import Parser from '../../../index.js';
import { YTNode } from '../../../helpers.js';
class PollHeader extends YTNode {
static type = 'PollHeader';