From 659310cfa7cbec32f0187ae822164d038185521c Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Fri, 28 Oct 2022 11:45:25 +0530 Subject: [PATCH 1/4] feat: report an error when broken links are detected and added documentation --- README.md | 7 +++++++ docusaurus/docusaurus.config.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c70afd5..99614ea 100644 --- a/README.md +++ b/README.md @@ -260,3 +260,10 @@ slug: / hide_from_search: true --- ``` +### Broken Links + +Docusaurus reports about broken links and broken markdown links while running the project locally or when creating a production build(`yarn build`). + +The broken markdown links are reported by Docusarus when you run your project locally by `yarn start`(for SDK developers - `npx stream-chat-docusaurus -s`) command. You can change the behaviour of the Docusaurus when it detects a broken Markdown link by setting [`onBrokenMarkdownLinks`](https://docusaurus.io/docs/api/docusaurus-config#onBrokenMarkdownLinks) on `docusaurus.config.js`. It accepts the following types: `'ignore' | 'log' | 'warn' | 'throw'`. + +The broken links are only reported by Docusaurs when you create the production build using `yarn build`(for SDK developers - `npx stream-chat-docusaurus -b`) command. You can change the behavious of the Docusarus when it detects a broken links by setting [`onBrokenLinks`](https://docusaurus.io/docs/api/docusaurus-config#onBrokenLinks) on `docusaurus.config.js`. It accepts the following types: `'ignore' | 'log' | 'warn' | 'throw'`. \ No newline at end of file diff --git a/docusaurus/docusaurus.config.js b/docusaurus/docusaurus.config.js index 703fd5a..0ebc694 100644 --- a/docusaurus/docusaurus.config.js +++ b/docusaurus/docusaurus.config.js @@ -236,7 +236,7 @@ module.exports = { baseUrl: URLS.docs.root, trailingSlash: true, favicon: 'https://getstream.imgix.net/images/favicons/favicon-96x96.png', - onBrokenLinks: 'warn', + onBrokenLinks: 'throw', // SDK developers would like to have an error when the links are broken. onBrokenMarkdownLinks: 'warn', organizationName: 'GetStream', plugins, From db6967bc00a6473bc785eeb8e50f9cb9688835d7 Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Mon, 11 Dec 2023 21:44:01 +0530 Subject: [PATCH 2/4] fix: docusaurus config fix: linting issue fix: linting issue fix: linting issue --- README.md | 22 +++---- docusaurus.config.js | 1 - shared/_tokenSnippet.jsx | 72 ++++++++++------------ shared/video/_dashboard-apn-voip-config.md | 16 ++--- shared/video/_dashboard-firebase-config.md | 12 ++-- 5 files changed, 57 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 9725961..f705684 100644 --- a/README.md +++ b/README.md @@ -235,19 +235,19 @@ hide_from_search: true Videos can be added by using the normal html tag. For example, if you would want a video that is centered, you could use the following snippet, ```jsx -import Video from "../assets/video.mp4" - -;
-
- -
+import Video from "../assets/video.mp4"; + +
+
+ +
``` This would show the video centered in the page with control buttons as below. Just make sure you adapt the `width` style property according to your video file. -Example Video Showcase +Example Video Showcase \ No newline at end of file diff --git a/docusaurus.config.js b/docusaurus.config.js index 00ed8a3..542c1c9 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -261,7 +261,6 @@ module.exports = { baseUrl: URLS.docs.root, trailingSlash: true, favicon: "https://getstream.imgix.net/images/favicons/favicon-96x96.png", - onBrokenLinks: "throw", // SDK developers would like to have an error when the links are broken. onBrokenMarkdownLinks: "warn", organizationName: "GetStream", plugins, diff --git a/shared/_tokenSnippet.jsx b/shared/_tokenSnippet.jsx index a6b4037..efc39fc 100644 --- a/shared/_tokenSnippet.jsx +++ b/shared/_tokenSnippet.jsx @@ -1,16 +1,15 @@ -import React from "react" +import React from 'react'; +import './tokenSnippet.css'; -import "./tokenSnippet.css" +const BASE_URL = 'https://stream-calls-dogfood.vercel.app/api/call/sample?'; -const BASE_URL = "https://stream-calls-dogfood.vercel.app/api/call/sample?" - -const STORAGE_KEY = "tokenSnippetDataFor" +const STORAGE_KEY = 'tokenSnippetDataFor'; async function callAPI(sampleApp) { - const constructedUrl = constructUrl(sampleApp) - const response = await fetch(constructedUrl) - const resultObject = await response.json() - return resultObject + const constructedUrl = constructUrl(sampleApp); + const response = await fetch(constructedUrl); + const resultObject = await response.json(); + return resultObject; } function constructUrl(sampleApp) { @@ -19,41 +18,37 @@ function constructUrl(sampleApp) { new URLSearchParams({ app_type: sampleApp, }) - ) + ); } export class TokenSnippet extends React.Component { constructor(props) { - super(props) + super(props); this.state = { loadingFinished: false, sampleApp: props.sampleApp, - userId: "Loading ...", - userName: "Creating user name ...", - callId: "Creating random call ID ...", - callType: "Loading call type ...", - apiKey: "Waiting for an API key ...", - token: "Token is generated ...", - deepLink: "Link is created ...", - displayStyle: props.displayStyle ?? "full", - } + userId: 'Loading ...', + userName: 'Creating user name ...', + callId: 'Creating random call ID ...', + callType: 'Loading call type ...', + apiKey: 'Waiting for an API key ...', + token: 'Token is generated ...', + deepLink: 'Link is created ...', + displayStyle: props.displayStyle ?? 'full', + }; } componentDidMount() { - const storedData = sessionStorage.getItem( - STORAGE_KEY + this.state.sampleApp - ) + const storedData = sessionStorage.getItem(STORAGE_KEY + this.state.sampleApp); if (storedData) { this.setState({ ...this.state, loadingFinished: true, ...JSON.parse(storedData), - }) + }); } else { - callAPI(this.state.sampleApp).then(result => { - const savedData = sessionStorage.getItem( - STORAGE_KEY + this.state.sampleApp - ) + callAPI(this.state.sampleApp).then((result) => { + const savedData = sessionStorage.getItem(STORAGE_KEY + this.state.sampleApp); // We're checking again if another component might have written // the data in the meantime. This is not ideal, but it works for now. // (This happens for multiple elements on the same page) @@ -62,29 +57,26 @@ export class TokenSnippet extends React.Component { ...this.state, loadingFinished: true, ...JSON.parse(savedData), - }) + }); } else { - sessionStorage.setItem( - STORAGE_KEY + this.state.sampleApp, - JSON.stringify(result) - ) + sessionStorage.setItem(STORAGE_KEY + this.state.sampleApp, JSON.stringify(result)); this.setState({ ...this.state, loadingFinished: true, ...result, - }) + }); } - }) + }); } } render() { const showTable = - this.state.displayStyle === "full" || - this.state.displayStyle === "credentials" + this.state.displayStyle === 'full' || + this.state.displayStyle === 'credentials'; const showJoinLink = - this.state.displayStyle === "full" || this.state.displayStyle === "join" + this.state.displayStyle === 'full' || this.state.displayStyle === 'join'; return (
@@ -133,7 +125,7 @@ export class TokenSnippet extends React.Component { {showJoinLink && ( - For testing you can join the call on our web-app:{" "} + For testing you can join the call on our web-app:{' '} )}
- ) + ); } } diff --git a/shared/video/_dashboard-apn-voip-config.md b/shared/video/_dashboard-apn-voip-config.md index 93c2c50..0ea985b 100644 --- a/shared/video/_dashboard-apn-voip-config.md +++ b/shared/video/_dashboard-apn-voip-config.md @@ -22,14 +22,14 @@ In order to configure VoIP Push Notifications, you need to visit your app's [Str From there you can create a new configuration by clicking the `New Configuration` button. After selecting the `APN` Provider, you will be asked to provide the following information: -| Field Name | Usage description | -| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Name` | Used to select this configuration in SDK or API calls. | -| `Description` | Allows you to set a description on the configuration to help identify its usage in your app's context. | -| `Bundle/Topic ID` | Your app's bundle id to which the notification will be pushed to. | -| `TeamID` | The Team ID is generated by Apple for your developer account. Can be found in the top right of your Apple developer account. | -| `KeyID` | This is the unique identifier for the p8 authentication key. You can find your Key ID in the keys section of your [Apple developer](https://developer.apple.com/account/) account. | -| `.p8 Token or .p12 Certificate` | The token or certificate that will be used to send the push notification. | +| Field Name | Usage description | +|---|---| +| `Name` | Used to select this configuration in SDK or API calls. | +| `Description` | Allows you to set a description on the configuration to help identify its usage in your app's context. | +| `Bundle/Topic ID` | Your app's bundle id to which the notification will be pushed to. | +| `TeamID` | The Team ID is generated by Apple for your developer account. Can be found in the top right of your Apple developer account. | +| `KeyID` | This is the unique identifier for the p8 authentication key. You can find your Key ID in the keys section of your [Apple developer](https://developer.apple.com/account/) account. | +| `.p8 Token or .p12 Certificate` | The token or certificate that will be used to send the push notification. | For our example, we are using `voip` as name and we are filling the remaining information as you can see in the image below: diff --git a/shared/video/_dashboard-firebase-config.md b/shared/video/_dashboard-firebase-config.md index a4856ed..5f01ff6 100644 --- a/shared/video/_dashboard-firebase-config.md +++ b/shared/video/_dashboard-firebase-config.md @@ -24,12 +24,12 @@ Next, you need to visit your app's [Stream Dashboard](https://dashboard.getstrea From there you can create a new configuration by clicking the `New Configuration` button. After selecting the `Firebase` Provider, you will be asked to provide the following information: -| Field Name | Usage description | -| ------------------ | ------------------------------------------------------------------------------------------------------ | -| `Name` | Used to select this configuration in SDK or API calls. | -| `Description` | Allows you to set a description on the configuration to help identify its usage in your app's context. | -| `Credentials JSON` | The firebase credentials that will be used to send the push notification. | +| Field Name | Usage description | +|---|---| +| `Name` | Used to select this configuration in SDK or API calls. | +| `Description` | Allows you to set a description on the configuration to help identify its usage in your app's context. | +| `Credentials JSON` | The firebase credentials that will be used to send the push notification. | For our example, we are using `firebase` as name and we are filling the remaining information as you can see in the image below: -![Setting up your Firebase Credentials on the Stream Dashboard](../assets/dashboard-firebase-push-configuration-example.png) +![Setting up your Firebase Credentials on the Stream Dashboard](../assets/dashboard-firebase-push-configuration-example.png) \ No newline at end of file From c4af943face70502bc4d77e9e51fe322994f2219 Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Mon, 11 Dec 2023 21:50:35 +0530 Subject: [PATCH 3/4] fix: linting issue of README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f705684..70f7dfb 100644 --- a/README.md +++ b/README.md @@ -250,4 +250,4 @@ import Video from "../assets/video.mp4"; This would show the video centered in the page with control buttons as below. Just make sure you adapt the `width` style property according to your video file. -Example Video Showcase \ No newline at end of file +Example Video Showcase From 5aecd419c50c386fd27e0ecb9530572c8b07c479 Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Mon, 11 Dec 2023 21:53:17 +0530 Subject: [PATCH 4/4] fix: linting issue of README.md fix: linting issue of README.md