Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #180

Merged
merged 7 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ jobs:
- run: npm ci
- run: npm run check-format
- run: npm run lint
- run: npm run typecheck
28,972 changes: 15,979 additions & 12,993 deletions package-lock.json

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,40 @@
"fix-lint": "npm run lint -- --fix"
},
"dependencies": {
"@docusaurus/core": "^3.6.1",
"@docusaurus/faster": "^3.6.1",
"@docusaurus/plugin-client-redirects": "^3.6.1",
"@docusaurus/preset-classic": "^3.6.1",
"@mdx-js/react": "^3.0.1",
"@docusaurus/core": "^3.6.3",
"@docusaurus/faster": "^3.6.3",
"@docusaurus/plugin-client-redirects": "^3.6.3",
"@docusaurus/preset-classic": "^3.6.3",
"@mdx-js/react": "^3.1.0",
"@webcoder49/code-input": "^2.2.1",
"clsx": "^2.1.1",
"docusaurus-plugin-openapi-docs": "0.0.0-949",
"docusaurus-theme-openapi-docs": "0.0.0-949",
"prism-react-renderer": "^2.3.0",
"docusaurus-plugin-openapi-docs": "^4.3.0",
"docusaurus-theme-openapi-docs": "^4.3.0",
"prism-react-renderer": "^2.4.1",
"prismjs": "^1.29.0",
"react": "^18.3.1",
"react-aria-components": "^1.2.1",
"react-aria-components": "^1.5.0",
"react-dom": "^18.3.1",
"url": "^0.11.4"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.6.1",
"@docusaurus/tsconfig": "^3.6.1",
"@docusaurus/types": "^3.6.1",
"@docusaurus/module-type-aliases": "^3.6.3",
"@docusaurus/tsconfig": "^3.6.3",
"@docusaurus/types": "^3.6.3",
"@eslint/js": "^9.15.0",
"dotenv": "^16.4.4",
"eslint": "^9.15.0",
"dotenv": "^16.4.7",
"eslint": "^9.17.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-compiler": "^19.0.0-beta-df7b47d-20241124",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-compiler": "19.0.0-beta-201e55d-20241215",
"eslint-plugin-react-hooks": "^5.1.0",
"exports-loader": "^5.0.0",
"globals": "^15.12.0",
"globals": "^15.13.0",
"imports-loader": "^5.0.0",
"prettier": "^3.3.2",
"prettier": "^3.4.2",
"raw-loader": "^4.0.2",
"serve-handler": "^6.1.5",
"typescript": "~5.4.5",
"typescript-eslint": "^8.16.0",
"serve-handler": "^6.1.6",
"typescript": "^5.7.2",
"typescript-eslint": "^8.18.1",
"unist-util-visit": "^5.0.0"
},
"overrides": {
Expand Down
33 changes: 19 additions & 14 deletions sidebarsTheoplayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
SidebarItemConfig,
SidebarItemHtml,
SidebarItemLink,
} from '@docusaurus/plugin-content-docs/lib/sidebars/types';
} from '@docusaurus/plugin-content-docs/lib/sidebars/types.d.ts';

const platformNames = ['web', 'android', 'ios', 'react', 'react-native', 'chromecast', 'roku', 'flutter'] as const;
const sidebars: SidebarsConfig = {
Expand Down Expand Up @@ -233,7 +233,12 @@ const sidebars: SidebarsConfig = {
],
};

function mergeSidebarItems<T extends SidebarItemBase>(base: T, config: T): T {
type MakeOptional<T, OptionalKeys extends keyof T> = Pick<T, Exclude<keyof T, OptionalKeys>> & Partial<Pick<T, OptionalKeys>>;
type PredefinedSidebarItemKeys = 'type' | 'label' | 'description' | 'customProps';
type PartialSidebarItemCategoryConfig = MakeOptional<SidebarItemCategoryConfig, PredefinedSidebarItemKeys>;
type PartialSidebarItemLink = MakeOptional<SidebarItemLink, PredefinedSidebarItemKeys>;

function mergeSidebarItems<T extends Partial<SidebarItemBase>, U extends Partial<SidebarItemBase>>(base: T, config: U): T & U {
return {
...base,
...config,
Expand All @@ -244,10 +249,10 @@ function mergeSidebarItems<T extends SidebarItemBase>(base: T, config: T): T {
};
}

function gettingStartedCategory(config: SidebarItemCategoryConfig): SidebarItemCategoryConfig {
function gettingStartedCategory(config: PartialSidebarItemCategoryConfig): SidebarItemCategoryConfig {
return mergeSidebarItems(
{
type: 'category',
type: 'category' as const,
label: 'Getting started',
description: 'Set up your first THEOplayer in just a few minutes!',
customProps: {
Expand All @@ -258,10 +263,10 @@ function gettingStartedCategory(config: SidebarItemCategoryConfig): SidebarItemC
);
}

function examplesCategory(config: SidebarItemCategoryConfig): SidebarItemCategoryConfig {
function examplesCategory(config: PartialSidebarItemCategoryConfig): SidebarItemCategoryConfig {
return mergeSidebarItems(
{
type: 'category',
type: 'category' as const,
label: 'Examples',
description: 'See the player in action!',
customProps: {
Expand All @@ -272,10 +277,10 @@ function examplesCategory(config: SidebarItemCategoryConfig): SidebarItemCategor
);
}

function connectorsCategory(config: SidebarItemCategoryConfig): SidebarItemCategoryConfig {
function connectorsCategory(config: PartialSidebarItemCategoryConfig): SidebarItemCategoryConfig {
return mergeSidebarItems(
{
type: 'category',
type: 'category' as const,
label: 'Connectors',
description: `Integrate third-party solutions with THEOplayer using our pre-built connectors.`,
customProps: {
Expand All @@ -286,10 +291,10 @@ function connectorsCategory(config: SidebarItemCategoryConfig): SidebarItemCateg
);
}

function howToGuidesCategory(config: SidebarItemCategoryConfig): SidebarItemCategoryConfig {
function howToGuidesCategory(config: PartialSidebarItemCategoryConfig): SidebarItemCategoryConfig {
return mergeSidebarItems(
{
type: 'category',
type: 'category' as const,
label: 'How-to guides',
description: 'Learn how to implement our rich set of features and integrations.',
customProps: {
Expand All @@ -300,10 +305,10 @@ function howToGuidesCategory(config: SidebarItemCategoryConfig): SidebarItemCate
);
}

function apiReferencesLink(config: SidebarItemLink): SidebarItemLink {
function apiReferencesLink(config: PartialSidebarItemLink): SidebarItemLink {
return mergeSidebarItems(
{
type: 'link',
type: 'link' as const,
label: 'API references',
description: 'Discover all properties and functions of THEOplayer.',
customProps: {
Expand All @@ -314,10 +319,10 @@ function apiReferencesLink(config: SidebarItemLink): SidebarItemLink {
);
}

function githubLink(config: SidebarItemLink): SidebarItemLink {
function githubLink(config: PartialSidebarItemLink): SidebarItemLink {
return mergeSidebarItems(
{
type: 'link',
type: 'link' as const,
label: 'GitHub',
description: 'Browse the source code or report issues on GitHub.',
customProps: {
Expand Down
4 changes: 3 additions & 1 deletion src/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
declare module '*.svg' {
const svg: string;
import type { ReactSVG } from 'react';

const svg: ReactSVG['svg'];
export default svg;
}

Expand Down
22 changes: 3 additions & 19 deletions src/plugin/sidebarItemsGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
import type {
NormalizedSidebar,
NormalizedSidebarItem,
SidebarItemConfig,
SidebarItemsGenerator,
SidebarItemsGeneratorArgs,
} from '@docusaurus/plugin-content-docs/lib/sidebars/types';
} from '@docusaurus/plugin-content-docs/lib/sidebars/types.d.ts';

type SidebarItemWithCustomProps = NormalizedSidebarItem & {
customProps?: {
exclude: string[];
additionalItems?: AdditionalItem[];
exclude?: string[];
};
};

interface AdditionalItem extends SidebarItemConfig {
position?: number;
}

interface PostProcessArgs extends Omit<SidebarItemsGeneratorArgs, 'item'> {
item: SidebarItemWithCustomProps;
}
Expand All @@ -42,16 +36,6 @@ function postProcessChildren(parent: SidebarItemWithCustomProps, children: Norma
}
}
}
// Add additional items
if (parent.customProps?.additionalItems) {
for (const { position, ...additionalItem } of parent.customProps.additionalItems) {
if (position !== undefined) {
children.splice(position - 1, 0, additionalItem);
} else {
children.push(additionalItem);
}
}
}
}

export default async function sidebarItemsGenerator({
Expand All @@ -61,7 +45,7 @@ export default async function sidebarItemsGenerator({
}: { defaultSidebarItemsGenerator: SidebarItemsGenerator } & SidebarItemsGeneratorArgs) {
const sidebarItems: NormalizedSidebar = await defaultSidebarItemsGenerator({ item, ...args });
for (const item of sidebarItems) {
postProcess({ item, defaultSidebarItemsGenerator, ...args });
postProcess({ item, ...args });
}
postProcessChildren(item, sidebarItems);
return sidebarItems;
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"compilerOptions": {
"target": "es2021",
"lib": ["es2021", "dom"],
"types": ["@docusaurus/module-type-aliases", "@docusaurus/theme-classic"],
"baseUrl": "."
}
},
"include": ["sidebars*.ts", "src/", "theoplayer/", "theoads/", "open-video-ui/", "contributing/"],
"exclude": ["theoplayer/external/", "open-video-ui/external/", "theoplayer_versioned_docs/"]
}
Loading