Skip to content

Commit 5eb3d08

Browse files
committed
docs: Add doc comments to services and generate docs
1 parent 0a2c280 commit 5eb3d08

37 files changed

+843
-577
lines changed

.github/workflows/workflow.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,10 @@ jobs:
5454
GH_TOKEN: ${{ secrets.GH_TOKEN }}
5555
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5656
run: npx semantic-release
57-
- name: Verify docs changed
58-
uses: tj-actions/[email protected]
59-
with:
60-
files: |
61-
docusaurus
62-
id: changed_files
57+
- name: Generate service docs
58+
run: |
59+
npm run generate-docs
6360
- name: Push to docusaurus
64-
if: steps.changed_files.outputs.any_changed == 'true' || github.ref == 'refs/heads/master'
6561
uses: GetStream/push-stream-chat-docusaurus-action@main
6662
with:
6763
target-branch: ${{ github.ref == 'refs/heads/master' && 'production' || 'staging' }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ yarn-error.log
4040
testem.log
4141
/typings
4242

43+
# Generated docs
44+
temp-docs
45+
docusaurus/docs/Angular/services/*.mdx
46+
4347
# System Files
4448
.DS_Store
4549
Thumbs.db

.vscode/extensions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
5+
// List of extensions which should be recommended for users of this workspace.
6+
"recommendations": ["bierner.jsdoc-markdown-highlighting"],
7+
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
8+
"unwantedRecommendations": []
9+
}

copy-generated-docs.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
const fs = require('fs');
2+
3+
const sourcePath = 'temp-docs/classes';
4+
const targetPath = 'docusaurus/docs/Angular/services';
5+
6+
fs.readdir(targetPath, (err: any, files: string[]) => {
7+
if (err) {
8+
throw err;
9+
}
10+
files.forEach((file) => {
11+
if (file !== '_category_.json') {
12+
try {
13+
fs.unlinkSync(`${targetPath}/${file}`);
14+
} catch (err: any) {
15+
throw err;
16+
}
17+
}
18+
});
19+
});
20+
21+
fs.readdir(sourcePath, (err: any, files: string[]) => {
22+
if (err) {
23+
throw err;
24+
}
25+
files.forEach((file) => {
26+
fs.readFile(`${sourcePath}/${file}`, 'utf8', (err: any, data: string) => {
27+
if (err) {
28+
throw err;
29+
}
30+
const result = data.replace(/# Class:/g, '#');
31+
32+
fs.writeFile(`${sourcePath}/${file}`, result, 'utf8', (err: any) => {
33+
if (err) {
34+
throw err;
35+
}
36+
fs.copyFile(
37+
`${sourcePath}/${file}`,
38+
`${targetPath}/${file}x`,
39+
(err: any) => {
40+
if (err) {
41+
throw err;
42+
}
43+
}
44+
);
45+
});
46+
});
47+
});
48+
});

docusaurus/docs/Angular/components/attachment-list.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ title: Attachments
66

77
import AttachmentsScreenshot from "../assets/attachments-screenshot.png";
88

9+
TEST
10+
911
The `AttachmentList` compontent displays the attachments of a message. The following attachments are supported:
1012

1113
- Images (including GIFs) are displayed inline

docusaurus/docs/Angular/components/attachment-preview-list.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ A typical use case for the `AttachmentPreviewList` component would be to use in
2929
export class CustomMessageInputComponent {}
3030
```
3131

32-
The `AttachmentPreviewList` uses the [`AttachmentService`](../services/attachment.mdx) to display the attachment previews.
32+
The `AttachmentPreviewList` uses the [`AttachmentService`](../services/AttachmentService.mdx) to display the attachment previews.

docusaurus/docs/Angular/components/autocomplete-textarea.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,19 @@ You can provide your own template for the autocomplete list for user mentions.
6565

6666
You can also set this input on the [`MessageInput`](./message-input.mdx/#inputs) component.
6767

68-
| Type |
69-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
70-
| [`TemplateRef<MentionAutcompleteListItemContext>`](<(https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts)>) |
68+
| Type |
69+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
70+
| [`TemplateRef<MentionAutcompleteListItemContext>`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts) |
7171

7272
### commandAutocompleteItemTemplate
7373

7474
You can provide your own template for the autocomplete list for commands.
7575

7676
You can also set this input on the [`MessageInput`](./message-input.mdx/#inputs) component.
7777

78-
| Type |
79-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
80-
| [`TemplateRef<CommandAutcompleteListItemContext>`](<(https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts)>) |
78+
| Type |
79+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
80+
| [`TemplateRef<CommandAutcompleteListItemContext>`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts) |
8181

8282
### mentionScope
8383

docusaurus/docs/Angular/components/channel-header.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ If you want to, you can create your own custom channel header, here is how to us
2626
</stream-channel>
2727
```
2828

29-
If you create your own channel header, you can use the [`ChannelService`](../services/channel.mdx) to access the currently active channel. Please note that, the default channel header also contains the menu button to [toggle the channel list](../services/channel-list-toggle.mdx). Here is a simple implementation of a custom channel header to guide you:
29+
If you create your own channel header, you can use the [`ChannelService`](../services/ChannelService.mdx) to access the currently active channel. Please note that, the default channel header also contains the menu button to [toggle the channel list](../services/ChannelListToggleService.mdx). Here is a simple implementation of a custom channel header to guide you:
3030

3131
```typescript
3232
@Component({

docusaurus/docs/Angular/components/channel-list.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ If you want to create a custom channel list component, here is how to use it:
2626
```
2727

2828
:::note
29-
If you want to create your own channel list, you can use the [`ChannelService`](../services/channel.mdx) to receive the channels and interact with the Stream API.
29+
If you want to create your own channel list, you can use the [`ChannelService`](../services/ChannelService.mdx) to receive the channels and interact with the Stream API.
3030

3131
Other building blocks, that you might find useful:
3232

3333
### Toggle
3434

35-
The channel list is always visible on desktop devices, on mobile devices, the list can be opened or closed controlled by a button in the `ChannelHeader` component. The open/close mechanism is implemented by the [`ChannelListToggleService`](../services/channel-list-toggle.mdx).
35+
The channel list is always visible on desktop devices, on mobile devices, the list can be opened or closed controlled by a button in the `ChannelHeader` component. The open/close mechanism is implemented by the [`ChannelListToggleService`](../services/ChannelListToggleService.mdx).
3636

3737
### Loading indicator
3838

docusaurus/docs/Angular/components/message-input.mdx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ If you want to create your own message input, you can use the following building
5252

5353
### Send and update messages
5454

55-
You can use [`ChannelService`](../services/channel.mdx) to send and update messages.
55+
You can use [`ChannelService`](../services/ChannelService.mdx) to send and update messages.
5656

5757
### File uploads
5858

59-
You can use the [`AttachmentService`](../services/attachment.mdx) to manage file uploads.
59+
You can use the [`AttachmentService`](../services/AttachmentService.mdx) to manage file uploads.
6060

6161
If more than one message input component can exist on your chat UI you should provide the `AttachmentService` on the component level:
6262

@@ -81,7 +81,7 @@ You can use the [`Textarea`](./textarea.mdx) or the [`AutocompleteTextarea`](./a
8181

8282
If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).
8383

84-
If no value is provided, it is set from the [`MessageInputConfigService`](../services/message-input-config.mdx).
84+
If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).
8585

8686
| Type |
8787
| ------- |
@@ -93,7 +93,7 @@ If no value is provided, it is set from the [`MessageInputConfigService`](../ser
9393

9494
You can narrow the accepted file types by providing the [accepted types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept). By default every file type is accepted.
9595

96-
If no value is provided, it is set from the [`MessageInputConfigService`](../services/message-input-config.mdx).
96+
If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).
9797

9898
| Type |
9999
| ---------- |
@@ -103,7 +103,7 @@ If no value is provided, it is set from the [`MessageInputConfigService`](../ser
103103

104104
If true, users can select multiple files to upload.
105105

106-
If no value is provided, it is set from the [`MessageInputConfigService`](../services/message-input-config.mdx).
106+
If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).
107107

108108
| Type |
109109
| ------- |
@@ -113,7 +113,7 @@ If no value is provided, it is set from the [`MessageInputConfigService`](../ser
113113

114114
If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecure.mdx) for this feature to work.
115115

116-
If no value is provided, it is set from the [`MessageInputConfigService`](../services/message-input-config.mdx).
116+
If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).
117117

118118
| Type |
119119
| ------- |
@@ -123,27 +123,27 @@ If no value is provided, it is set from the [`MessageInputConfigService`](../ser
123123

124124
You can provide your own template for the autocomplete list for user mentions. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecure.mdx) for this feature to work.
125125

126-
If no value is provided, it is set from the [`MessageInputConfigService`](../services/message-input-config.mdx).
126+
If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).
127127

128-
| Type |
129-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
130-
| [`TemplateRef<MentionAutcompleteListItemContext>`](<(https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts)>) |
128+
| Type |
129+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
130+
| [`TemplateRef<MentionAutcompleteListItemContext>`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts) |
131131

132132
### commandAutocompleteItemTemplate
133133

134134
You can provide your own template for the autocomplete list for commands. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecure.mdx) for this feature to work.
135135

136-
If no value is provided, it is set from the [`MessageInputConfigService`](../services/message-input-config.mdx).
136+
If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).
137137

138-
| Type |
139-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
140-
| [`TemplateRef<CommandAutcompleteListItemContext>`](<(https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts)>) |
138+
| Type |
139+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
140+
| [`TemplateRef<CommandAutcompleteListItemContext>`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts) |
141141

142142
### mentionScope
143143

144144
The scope for user mentions, either members of the current channel of members of the application.
145145

146-
If no value is provided, it is set from the [`MessageInputConfigService`](../services/message-input-config.mdx).
146+
If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).
147147

148148
| Type |
149149
| -------------------------- |

0 commit comments

Comments
 (0)