Skip to content

Commit

Permalink
chore: add prettier and husky for formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
vandreleal committed Jun 28, 2023
1 parent 293fc68 commit 76a4fa6
Show file tree
Hide file tree
Showing 55 changed files with 1,387 additions and 1,136 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn pretty-quick --staged
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
node_modules
build
coverage
.docusaurus
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"arrowParens": "avoid",
"semi": false,
"importOrder": ["^react$", "<THIRD_PARTY_MODULES>", "^@(.*)$", "^[./]"],
"importOrderCaseInsensitive": true,
"importOrderParserPlugins": ["jsx", "typescript"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,23 @@ For example for React Native, there is a file at `/docusaurus/reactnative-docusa
module.exports = {
plugins: [
[
'@docusaurus/plugin-content-docs',
"@docusaurus/plugin-content-docs",
{
lastVersion: '3.x.x',
lastVersion: "3.x.x",
versions: {
current: {
label: '4.0.0',
banner: 'unreleased',
path: '4.0.0',
label: "4.0.0",
banner: "unreleased",
path: "4.0.0",
},
'3.x.x': {
label: '3.x.x',
"3.x.x": {
label: "3.x.x",
},
},
},
],
],
};
}
```

## Sidebars
Expand All @@ -117,7 +117,7 @@ To share content between multiple SDKs, put markdown files in the `shared` direc
Then, import and render the shared content using mdx:

```mdx
import SharedContent from '../../../shared/_example-shared-content.md';
import SharedContent from "../../../shared/_example-shared-content.md"

<SharedContent />
```
Expand Down Expand Up @@ -171,13 +171,13 @@ To make use of the `<ImageShowcase />` component, remember to add the correct im
Example of how to use it:

```jsx
import ImageShowcase from '@site/src/components/ImageShowcase';
import ImageShowcase from "@site/src/components/ImageShowcase"

import channelList from '../assets/channel_list.png';
import messageInput from '../assets/message_input.png';
import messageList from '../assets/message_list.png';
import channelList from "../assets/channel_list.png"
import messageInput from "../assets/message_input.png"
import messageList from "../assets/message_list.png"

<ImageShowcase
;<ImageShowcase
items={[
{
image: channelList,
Expand All @@ -186,12 +186,12 @@ import messageList from '../assets/message_list.png';
<code>ChannelList</code> can be used with no props
</span>
),
alt: 'Example of how to use channelList component',
alt: "Example of how to use channelList component",
},
{ image: messageInput, caption: 'Message input design' },
{ image: messageList, caption: 'Message list sample' },
{ image: messageInput, caption: "Message input design" },
{ image: messageList, caption: "Message list sample" },
]}
/>;
/>
```

![Example ImageShowcase desktop](./assets/images/Example_showcase.png)
Expand All @@ -205,12 +205,12 @@ You can also add border to the images using the boolean prop `border` like the f
{
image: image1,
caption: <span>Images with border 🙂</span>,
alt: 'Example of custom message',
alt: "Example of custom message",
},
{
image: image2,
caption: <span>Another one!</span>,
alt: 'Example of custom message part 2',
alt: "Example of custom message part 2",
},
]}
/>
Expand Down
19 changes: 12 additions & 7 deletions admonition-icons.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
const note = '<svg width="14" height="14" viewBox="0 0 14 14" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M7 13.7A6.7 6.7 0 117 .3a6.7 6.7 0 010 13.4zm0-1.4A5.3 5.3 0 107 1.7a5.3 5.3 0 100 10.6zm-.7-8.6h1.4V5H6.3V3.7zm0 2.6h1.4v4H6.3v-4z"/></svg>';
const note =
'<svg width="14" height="14" viewBox="0 0 14 14" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M7 13.7A6.7 6.7 0 117 .3a6.7 6.7 0 010 13.4zm0-1.4A5.3 5.3 0 107 1.7a5.3 5.3 0 100 10.6zm-.7-8.6h1.4V5H6.3V3.7zm0 2.6h1.4v4H6.3v-4z"/></svg>'

const tip = '<svg width="15" height="15" viewBox="0 0 15 15" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M7.5 14.6A7 7 0 117.5.4a7 7 0 010 14.2zM4.7 8.2a2.8 2.8 0 105.6 0H4.7zm0-1.4a1 1 0 100-2.1 1 1 0 000 2zm5.6 0a1 1 0 100-2.1 1 1 0 000 2z"/></svg>';
const tip =
'<svg width="15" height="15" viewBox="0 0 15 15" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M7.5 14.6A7 7 0 117.5.4a7 7 0 010 14.2zM4.7 8.2a2.8 2.8 0 105.6 0H4.7zm0-1.4a1 1 0 100-2.1 1 1 0 000 2zm5.6 0a1 1 0 100-2.1 1 1 0 000 2z"/></svg>'

const info = '<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M10 12.7H6c-.4 0-.7-.3-.7-.7v-.3c0-1-.4-1.9-1.1-2.6-1-1.1-1.6-2.5-1.5-4C2.8 2.3 5 .1 7.9 0H8a5.3 5.3 0 013.7 9.1c-.7.7-1 1.6-1 2.6v.3c0 .4-.3.7-.7.7zm-3.3-1.4h2.6a5 5 0 011.5-3.2c.8-.7 1.2-1.7 1.2-2.8a4 4 0 00-4-4 4 4 0 00-4 3.9 4 4 0 001.1 3c1 .9 1.5 2 1.6 3.1z"/><path d="M8 16a2.7 2.7 0 01-2.7-2.7V12c0-.4.3-.7.7-.7h4c.4 0 .7.3.7.7v1.3c0 1.5-1.2 2.7-2.7 2.7zm-1.3-3.3v.6c0 .8.6 1.4 1.3 1.4.7 0 1.3-.6 1.3-1.4v-.6H6.7zM6 6c-.4 0-.7-.3-.7-.7C5.3 4 6.5 2.7 8 2.7c.4 0 .7.2.7.6 0 .4-.3.7-.7.7-.7 0-1.3.6-1.3 1.3 0 .4-.3.7-.7.7z"/></svg>';
const info =
'<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M10 12.7H6c-.4 0-.7-.3-.7-.7v-.3c0-1-.4-1.9-1.1-2.6-1-1.1-1.6-2.5-1.5-4C2.8 2.3 5 .1 7.9 0H8a5.3 5.3 0 013.7 9.1c-.7.7-1 1.6-1 2.6v.3c0 .4-.3.7-.7.7zm-3.3-1.4h2.6a5 5 0 011.5-3.2c.8-.7 1.2-1.7 1.2-2.8a4 4 0 00-4-4 4 4 0 00-4 3.9 4 4 0 001.1 3c1 .9 1.5 2 1.6 3.1z"/><path d="M8 16a2.7 2.7 0 01-2.7-2.7V12c0-.4.3-.7.7-.7h4c.4 0 .7.3.7.7v1.3c0 1.5-1.2 2.7-2.7 2.7zm-1.3-3.3v.6c0 .8.6 1.4 1.3 1.4.7 0 1.3-.6 1.3-1.4v-.6H6.7zM6 6c-.4 0-.7-.3-.7-.7C5.3 4 6.5 2.7 8 2.7c.4 0 .7.2.7.6 0 .4-.3.7-.7.7-.7 0-1.3.6-1.3 1.3 0 .4-.3.7-.7.7z"/></svg>'

const caution = '<svg width="17" height="16" viewBox="0 0 17 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M16.3 15.3H1.6A.7.7 0 011 15a.6.6 0 010-.7L8.4 1c.2-.4.9-.4 1.2 0l7.3 13.3v.7c-.1.2-.3.3-.6.3zM2.8 14h12.4L9 2.7 2.8 14z"/><path d="M9 10.7c-.4 0-.7-.3-.7-.7V6.7c0-.4.3-.7.7-.7.4 0 .6.3.6.7V10c0 .4-.2.7-.6.7zM9.4 11.5a.7.7 0 11-1 1 .7.7 0 011-1z"/><path d="M9 13a1 1 0 01-1-1c0-.5.4-1 1-1 .5 0 1 .5 1 1s-.5 1-1 1zm0-1.3c-.2 0-.4.1-.4.3 0 .2.2.3.4.3s.3-.1.3-.3c0-.2-.1-.3-.3-.3z"/></svg>';
const caution =
'<svg width="17" height="16" viewBox="0 0 17 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M16.3 15.3H1.6A.7.7 0 011 15a.6.6 0 010-.7L8.4 1c.2-.4.9-.4 1.2 0l7.3 13.3v.7c-.1.2-.3.3-.6.3zM2.8 14h12.4L9 2.7 2.8 14z"/><path d="M9 10.7c-.4 0-.7-.3-.7-.7V6.7c0-.4.3-.7.7-.7.4 0 .6.3.6.7V10c0 .4-.2.7-.6.7zM9.4 11.5a.7.7 0 11-1 1 .7.7 0 011-1z"/><path d="M9 13a1 1 0 01-1-1c0-.5.4-1 1-1 .5 0 1 .5 1 1s-.5 1-1 1zm0-1.3c-.2 0-.4.1-.4.3 0 .2.2.3.4.3s.3-.1.3-.3c0-.2-.1-.3-.3-.3z"/></svg>'

const danger = '<svg width="17" height="16" viewBox="0 0 17 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M9 15.3a5 5 0 005-5 5 5 0 00-.4-1.6c-1 1-2 1.6-2.5 1.6 2.7-4.6 1.2-6.6-2.8-9.3.3 3.3-1.9 4.8-2.8 5.7A5 5 0 009 15.3zm.4-11.8c2.2 1.8 2.2 3.2.5 6.2-.5.9.2 2 1.2 2 .5 0 1-.2 1.4-.4a3.7 3.7 0 11-6-3.6l.5-.5.7-.7a7 7 0 001.7-3z"/></svg>';
const danger =
'<svg width="17" height="16" viewBox="0 0 17 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M9 15.3a5 5 0 005-5 5 5 0 00-.4-1.6c-1 1-2 1.6-2.5 1.6 2.7-4.6 1.2-6.6-2.8-9.3.3 3.3-1.9 4.8-2.8 5.7A5 5 0 009 15.3zm.4-11.8c2.2 1.8 2.2 3.2.5 6.2-.5.9.2 2 1.2 2 .5 0 1-.2 1.4-.4a3.7 3.7 0 11-6-3.6l.5-.5.7-.7a7 7 0 001.7-3z"/></svg>'

module.exports = {
note,
tip,
info,
caution,
danger
};
danger,
}
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-undef */
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
}
82 changes: 41 additions & 41 deletions constants.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
const folderMapping = {
android: 'Android',
flutter: 'Flutter',
ios: 'iOS',
react: 'React',
reactnative: 'React Native',
angular: 'Angular',
api: 'API',
};
android: "Android",
flutter: "Flutter",
ios: "iOS",
react: "React",
reactnative: "React Native",
angular: "Angular",
api: "API",
}

const platformMapping = {
android: 'android',
flutter: 'flutter-dart',
ios: 'ios-swift',
react: 'react',
reactnative: 'react-native',
angular: 'angular',
api: 'api',
};
android: "android",
flutter: "flutter-dart",
ios: "ios-swift",
react: "react",
reactnative: "react-native",
angular: "angular",
api: "api",
}

const languageMapping = {
android: 'kotlin',
flutter: 'dart',
ios: 'swift',
react: 'javascript',
reactnative: 'javascript',
angular: 'javascript',
api: 'javascript',
};
android: "kotlin",
flutter: "dart",
ios: "swift",
react: "javascript",
reactnative: "javascript",
angular: "javascript",
api: "javascript",
}

const PRODUCT = process.env.PRODUCT;
const PRODUCT = process.env.PRODUCT
let DOCUSAURUS_INDEX =
process.env.DEPLOYMENT_ENV === 'production'
? `DOCUSAURUS${PRODUCT === 'video' ? '_VIDEO' : ''}`
: `DOCUSAURUS${PRODUCT === 'video' ? '_VIDEO' : ''}_STG`;
const CMS_INDEX = 'DOCS';
process.env.DEPLOYMENT_ENV === "production"
? `DOCUSAURUS${PRODUCT === "video" ? "_VIDEO" : ""}`
: `DOCUSAURUS${PRODUCT === "video" ? "_VIDEO" : ""}_STG`
const CMS_INDEX = "DOCS"

const IGNORED_DIRECTORIES = ['common-content'];
const IGNORED_DIRECTORIES = ["common-content"]

const SDK_ORDER = [
'react',
'ios',
'android',
'reactnative',
'flutter',
'angular',
'api',
];
"react",
"ios",
"android",
"reactnative",
"flutter",
"angular",
"api",
]

const ignoredVideoSDKsStaging = ['angular'];
const ignoredVideoSDKsProduction = ['angular', 'reactnative'];
const ignoredVideoSDKsStaging = ["angular"]
const ignoredVideoSDKsProduction = ["angular", "reactnative"]

module.exports = {
IGNORED_DIRECTORIES,
Expand All @@ -60,4 +60,4 @@ module.exports = {
SDK_ORDER,
ignoredVideoSDKsStaging,
ignoredVideoSDKsProduction,
};
}

0 comments on commit 76a4fa6

Please sign in to comment.