Skip to content

Commit bdc7890

Browse files
committed
fix: remove stream-chat module augmentation from stream-chat-angular
1 parent 1eeb655 commit bdc7890

File tree

10 files changed

+639
-139
lines changed

10 files changed

+639
-139
lines changed

package-lock.json

Lines changed: 587 additions & 112 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "stream-chat-angular",
33
"version": "0.0.0",
4+
"watch": {
5+
"remove-stream-chat-augmentation": "dist/stream-chat-angular/stream-chat.d.ts.map"
6+
},
47
"scripts": {
58
"prepare": "husky install",
69
"postinstall": "npm run config:dev & npm run copy-css",
@@ -14,8 +17,14 @@
1417
"prestart:dev:customizations-example": "npm run config:dev",
1518
"start:dev:customizations-example": "rm -rf dist & npm run watch & (wait-on dist && ng serve customizations-example --host 0.0.0.0)",
1619
"build": "ng build stream-chat-angular",
20+
"postbuild": "npm run remove-stream-chat-augmentation",
21+
"delete-stream-chat-declaration": "rm -f dist/stream-chat-angular/stream-chat.d.ts",
22+
"delete-stream-chat-declaration-map": "rm -f dist/stream-chat-angular/stream-chat.d.ts.map",
23+
"remove-stream-chat-reference": "replace '/// <reference path=\"stream-chat.d.ts\" />' '' dist/stream-chat-angular/public-api.d.ts",
24+
"remove-stream-chat-augmentation": "npm run delete-stream-chat-declaration && npm run delete-stream-chat-declaration-map && npm run remove-stream-chat-reference",
1725
"build:prod": "npm run copy-css && ng build stream-chat-angular --configuration production",
18-
"watch": "ng build stream-chat-angular --watch --configuration development",
26+
"postbuild:prod": "npm run remove-stream-chat-augmentation",
27+
"watch": "ng build stream-chat-angular --watch --configuration development & npm-watch",
1928
"test": "rm -rf dist & npm run watch & (wait-on dist && ng run stream-chat-angular:test)",
2029
"test:ci": "ng run stream-chat-angular:test --browsers ChromeHeadlessCustom --watch false",
2130
"lint": "ng lint",
@@ -115,10 +124,12 @@
115124
"emoji-regex": "^10.3.0",
116125
"fix-webm-duration": "^1.0.6",
117126
"ngx-float-ui": "^15.0.0",
127+
"npm-watch": "^0.13.0",
118128
"pretty-bytes": "^6.1.1",
129+
"replace": "^1.2.2",
119130
"rxjs": "~7.4.0",
120131
"starwars-names": "^1.6.0",
121-
"stream-chat": "9.0.0-rc.5",
132+
"stream-chat": "9.0.0-rc.6",
122133
"ts-node": "^10.9.2",
123134
"tslib": "^2.3.0",
124135
"uuid": "^9.0.1",

projects/customizations-example/src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
let-latestMessageText="latestMessageText"
257257
let-latestMessage="latestMessage"
258258
>
259-
<div>Channel title: {{ channel.title }}</div>
259+
<div>Channel title: {{ channel.name }}</div>
260260
<div>Display title: {{ channelDisplayTitle }}</div>
261261
<div>Unread count: {{ unreadCount }}</div>
262262
<div>Latest message text: {{ latestMessageText }}</div>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { DefaultAttachmentData, DefaultChannelData } from 'stream-chat-angular';
2+
3+
declare module 'stream-chat' {
4+
interface CustomChannelData extends DefaultChannelData {}
5+
6+
interface CustomAttachmentData extends DefaultAttachmentData {}
7+
}

projects/stream-chat-angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@breezystack/lamejs": "^1.2.7",
2323
"@ngx-translate/core": "^14.0.0 || ^15.0.0 || ^16.0.0",
2424
"rxjs": "^7.4.0",
25-
"stream-chat": "9.0.0-rc.5"
25+
"stream-chat": "9.0.0-rc.6"
2626
},
2727
"peerDependenciesMeta": {
2828
"@breezystack/lamejs": {

projects/stream-chat-angular/src/lib/types.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,3 +470,20 @@ export type GalleryAttachment = {
470470
type: 'gallery';
471471
images: Attachment[];
472472
};
473+
474+
export interface DefaultChannelData {
475+
image?: string;
476+
}
477+
478+
export interface DefaultAttachmentData {
479+
/**
480+
* @deprecated Please use `image_url` instead
481+
*/
482+
img_url?: string;
483+
/**
484+
* Will be `true` if an attachment was added using `attachmentService.addAttachment`
485+
*
486+
* This is a non-standard property, other SDKs will ignore this property
487+
*/
488+
isCustomAttachment?: boolean;
489+
}

projects/stream-chat-angular/src/public-api.ts

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
1-
declare module 'stream-chat' {
2-
interface CustomUserData {
3-
image?: string;
4-
}
5-
interface CustomAttachmentData {
6-
/**
7-
* @deprecated Please use `image_url` instead
8-
*/
9-
img_url?: string;
10-
/**
11-
* Will be `true` if an attachment was added using `attachmentService.addAttachment`
12-
*
13-
* This is a non-standard property, other SDKs will ignore this property
14-
*/
15-
isCustomAttachment?: boolean;
16-
}
17-
18-
interface CustomChannelData {
19-
image?: string;
20-
}
21-
}
221
/*
232
* Public API Surface of stream-chat-angular
243
*/
4+
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
5+
/// <reference path="stream-chat.ts" />
256
export * from './lib/chat-client.service';
267
export * from './lib/channel.service';
278
export * from './lib/theme.service';
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import 'stream-chat';
2+
import { DefaultChannelData, DefaultAttachmentData } from './lib/types';
3+
4+
declare module 'stream-chat' {
5+
interface CustomAttachmentData extends DefaultAttachmentData {}
6+
7+
interface CustomChannelData extends DefaultChannelData {}
8+
}

projects/stream-chat-angular/src/test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
2-
2+
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
3+
/// <reference path="stream-chat.ts" />
34
import 'zone.js';
45
import 'zone.js/testing';
56
import { getTestBed } from '@angular/core/testing';

projects/stream-chat-angular/tsconfig.spec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"outDir": "../../out-tsc/spec",
66
"types": ["jasmine"]
77
},
8-
"files": ["src/test.ts", "src/public-api.ts"],
8+
"files": ["src/test.ts"],
99
"include": ["**/*.spec.ts", "**/*.d.ts"]
1010
}

0 commit comments

Comments
 (0)