agora-appbuilder-core 2.3.0-beta.9 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +11 -6
- package/package.json +1 -1
- package/template/Gulpfile.js +121 -83
- package/template/_gitignore +2 -2
- package/template/_package-lock.json +12959 -13248
- package/template/agora-rn-uikit/src/AgoraUIKit.tsx +2 -2
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +2 -0
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +3 -3
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +4 -5
- package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +3 -1
- package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +2 -2
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +4 -4
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +7 -5
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +2 -2
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +88 -43
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +13 -4
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +36 -19
- package/template/agora-rn-uikit/src/Utils/permission.ts +17 -6
- package/template/babel.config.js +9 -9
- package/template/bridge/rtc/webNg/RtcEngine.ts +51 -26
- package/template/customization-api/action-library.ts +22 -0
- package/template/{fpe-api/context.ts → customization-api/app-state.ts} +21 -14
- package/template/customization-api/customEvents.ts +9 -0
- package/template/{fpe-api/install.ts → customization-api/customize.ts} +27 -26
- package/template/{fpe-api → customization-api}/index.ts +11 -6
- package/template/{fpe-api/components.ts → customization-api/sub-components.ts} +22 -3
- package/template/{fpe-api → customization-api}/typeDefinition.ts +13 -14
- package/template/customization-api/utils.ts +30 -0
- package/template/{fpe-implementation → customization-implementation}/createHook.ts +0 -0
- package/template/{fpe-implementation/dummyFpe.ts → customization-implementation/dummyConfig.ts} +4 -4
- package/template/customization-implementation/index.ts +4 -0
- package/template/{fpe-api/useFpe.tsx → customization-implementation/useCustomization.tsx} +12 -12
- package/template/{fpe.config.js → customization.config.js} +11 -11
- package/template/electron/main/index.js +42 -35
- package/template/esbuild.rsdk.go +8 -17
- package/template/global.d.ts +4 -3
- package/template/index.rsdk.tsx +13 -5
- package/template/index.wsdk.tsx +21 -5
- package/template/package.json +3 -0
- package/template/react-native-toast-message/src/index.js +3 -7
- package/template/react-native-toast-message/src/{index.wsdk.js → index.sdk.tsx} +1 -1
- package/template/react-native-toast-message/src/styles.sdk.ts +17 -0
- package/template/src/App.tsx +8 -4
- package/template/src/AppWrapper.tsx +8 -6
- package/template/src/SDKAppWrapper.tsx +28 -21
- package/template/src/app-state/useLocalUserInfo.ts +11 -0
- package/template/src/app-state/useMessages.ts +55 -0
- package/template/src/atoms/PrimaryButton.tsx +2 -2
- package/template/src/atoms/SecondaryButton.tsx +12 -4
- package/template/src/atoms/TextInput.tsx +2 -2
- package/template/src/components/Chat.tsx +22 -11
- package/template/src/components/ChatContext.ts +10 -27
- package/template/src/components/Controls.native.tsx +13 -7
- package/template/src/components/Controls.tsx +15 -24
- package/template/src/components/DeviceConfigure.tsx +4 -3
- package/template/src/components/EventsConfigure.tsx +54 -0
- package/template/src/components/GridVideo.tsx +5 -6
- package/template/src/components/HostControlView.tsx +13 -19
- package/template/src/components/Navbar.tsx +54 -41
- package/template/src/components/NetworkQualityContext.tsx +4 -3
- package/template/src/components/ParticipantsView.tsx +7 -7
- package/template/src/components/PinnedVideo.tsx +3 -4
- package/template/src/components/Precall.native.tsx +3 -3
- package/template/src/components/Precall.tsx +14 -10
- package/template/src/components/RTMConfigure.tsx +61 -219
- package/template/src/components/SettingsView.tsx +6 -3
- package/template/src/components/Share.tsx +24 -18
- package/template/src/components/chat-messages/useChatMessages.tsx +397 -80
- package/template/src/components/chat-notification/useChatNotification.tsx +2 -2
- package/template/src/components/chat-ui/useChatUIControl.tsx +4 -1
- package/template/src/components/common/Logo.tsx +3 -2
- package/template/src/components/contexts/LiveStreamDataContext.tsx +3 -3
- package/template/src/components/contexts/ScreenShareContext.tsx +3 -1
- package/template/src/components/contexts/VideoMeetingDataContext.tsx +85 -0
- package/template/src/components/contexts/WhiteboardContext.tsx +8 -8
- package/template/src/components/livestream/LiveStreamContext.tsx +88 -74
- package/template/src/components/meeting-info/useMeetingInfo.tsx +26 -19
- package/template/src/components/meeting-info/useSetMeetingInfo.tsx +1 -1
- package/template/src/components/participants/AllAudienceParticipants.tsx +2 -2
- package/template/src/components/participants/AllHostParticipants.tsx +4 -4
- package/template/src/components/participants/MeParticipant.tsx +5 -3
- package/template/src/components/participants/ParticipantName.tsx +2 -2
- package/template/src/components/participants/RemoteParticipants.tsx +9 -7
- package/template/src/components/precall/LocalMute.native.tsx +14 -10
- package/template/src/components/precall/LocalMute.tsx +7 -5
- package/template/src/components/precall/VideoPreview.native.tsx +6 -6
- package/template/src/components/precall/VideoPreview.tsx +3 -3
- package/template/src/components/precall/joinCallBtn.tsx +3 -3
- package/template/src/components/precall/meetingTitle.tsx +3 -1
- package/template/src/components/precall/selectDevice.tsx +2 -2
- package/template/src/components/precall/usePreCall.tsx +1 -1
- package/template/src/components/styles.ts +3 -3
- package/template/src/components/useShareLink.tsx +69 -29
- package/template/src/components/useUserPreference.tsx +16 -15
- package/template/src/components/useWakeLock.tsx +3 -3
- package/template/src/language/i18nTypes.ts +1 -1
- package/template/src/language/index.ts +2 -2
- package/template/src/language/useLanguage.tsx +2 -3
- package/template/src/pages/Authenticate.tsx +3 -2
- package/template/src/pages/Create.tsx +18 -20
- package/template/src/pages/Join.tsx +6 -7
- package/template/src/pages/VideoCall.tsx +74 -66
- package/template/src/pages/create/useCreate.tsx +1 -1
- package/template/src/pages/video-call/CustomUserContextHolder.tsx +14 -6
- package/template/src/pages/video-call/DefaultLayouts.ts +8 -8
- package/template/src/pages/video-call/{NameWithMicStatus.tsx → NameWithMicIcon.tsx} +8 -1
- package/template/src/pages/video-call/RenderComponent.tsx +7 -10
- package/template/src/pages/video-call/VideoCallScreen.tsx +31 -22
- package/template/src/pages/video-call/VideoComponent.tsx +13 -15
- package/template/src/pages/video-call/VideoRenderer.tsx +6 -6
- package/template/src/pages/video-call/useLayoutsData.ts +23 -0
- package/template/src/rtm/RTMEngine.ts +13 -0
- package/template/src/rtm-events/EventUtils.ts +20 -20
- package/template/src/rtm-events/EventsQueue.ts +9 -3
- package/template/src/rtm-events/constants.ts +5 -0
- package/template/src/rtm-events/index.tsx +1 -3
- package/template/src/rtm-events-api/Events.ts +255 -0
- package/template/src/rtm-events-api/index.tsx +6 -0
- package/template/src/rtm-events-api/types.ts +22 -0
- package/template/src/subComponents/ChatBubble.tsx +24 -8
- package/template/src/subComponents/ChatContainer.tsx +24 -15
- package/template/src/subComponents/ChatInput.tsx +56 -42
- package/template/src/subComponents/LanguageSelector.tsx +2 -2
- package/template/src/subComponents/LayoutIconDropdown.native.tsx +5 -5
- package/template/src/subComponents/LayoutIconDropdown.tsx +7 -7
- package/template/src/subComponents/LocalAudioMute.tsx +3 -4
- package/template/src/subComponents/LocalEndCall.tsx +3 -6
- package/template/src/subComponents/LocalSwitchCamera.tsx +3 -4
- package/template/src/subComponents/LocalVideoMute.tsx +3 -3
- package/template/src/subComponents/NetworkQualityPill.tsx +8 -9
- package/template/src/subComponents/OpenInNativeButton.tsx +2 -3
- package/template/src/subComponents/RemoteAudioMute.tsx +5 -11
- package/template/src/subComponents/RemoteEndCall.tsx +3 -10
- package/template/src/subComponents/RemoteVideoMute.tsx +3 -10
- package/template/src/subComponents/SelectDevice.tsx +4 -3
- package/template/src/subComponents/SelectOAuth.tsx +3 -2
- package/template/src/subComponents/SidePanelButtons.ts +6 -5
- package/template/src/subComponents/TextWithTooltip.tsx +6 -2
- package/template/src/subComponents/{toastConfig.tsx → ToastConfig.tsx} +2 -2
- package/template/src/subComponents/chat/ChatParticipants.tsx +6 -5
- package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +2 -2
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +4 -3
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +2 -2
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +2 -4
- package/template/src/subComponents/livestream/index.ts +2 -2
- package/template/src/subComponents/recording/useRecording.tsx +47 -24
- package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +11 -5
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +46 -34
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +98 -39
- package/template/src/subComponents/screenshare/useScreenshare.tsx +1 -1
- package/template/src/utils/SdkEvents.ts +9 -46
- package/template/src/utils/common.tsx +41 -9
- package/template/src/utils/getUniqueID.ts +5 -0
- package/template/src/utils/isMobileOrTablet.native.ts +6 -2
- package/template/src/utils/isMobileOrTablet.ts +25 -8
- package/template/src/utils/useButtonTemplate.tsx +1 -1
- package/template/src/utils/useCreateMeeting.ts +24 -10
- package/template/src/utils/useGetMeetingPhrase.ts +11 -8
- package/template/src/utils/{IsAttendeeUser.ts → useIsAttendee.ts} +12 -16
- package/template/src/utils/{isAudioEnabled.ts → useIsAudioEnabled.ts} +8 -4
- package/template/src/utils/{isHostUser.ts → useIsHost.ts} +17 -16
- package/template/src/utils/{isPSTNUser.ts → useIsPSTN.ts} +4 -3
- package/template/src/utils/{isScreenShareUser.ts → useIsScreenShare.ts} +1 -1
- package/template/src/utils/{isVideoEnabled.ts → useIsVideoEnabled.ts} +9 -6
- package/template/src/utils/useJoinMeeting.ts +11 -7
- package/template/src/utils/useLayout.tsx +8 -6
- package/template/src/utils/useMutePSTN.ts +5 -3
- package/template/src/utils/useMuteToggleLocal.ts +6 -4
- package/template/src/utils/useRemoteEndCall.ts +14 -10
- package/template/src/utils/useRemoteMute.ts +45 -20
- package/template/src/utils/useSidePanel.tsx +4 -1
- package/template/src/utils/useString.ts +2 -2
- package/template/src/utils/useUserName.ts +14 -0
- package/template/tsconfig_fpeApi.json +8 -9
- package/template/tsconfig_rsdk_index.json +8 -9
- package/template/tsconfig_wsdk_index.json +8 -9
- package/template/webpack.commons.js +9 -9
- package/template/webpack.rsdk.config.js +4 -2
- package/template/webpack.ts.config.js +6 -6
- package/template/webpack.wsdk.config.js +2 -1
- package/template/fpe-api/fpeEvents.ts +0 -9
- package/template/fpe-api/utils.ts +0 -61
- package/template/fpe-implementation/index.ts +0 -1
- package/template/fpe-todo.txt +0 -14
- package/template/src/components/RTMEvents.tsx +0 -84
- package/template/src/custom-events/CustomEvents.ts +0 -238
- package/template/src/custom-events/index.tsx +0 -4
- package/template/src/custom-events/types.ts +0 -51
- package/template/src/pages/video-call/CustomLayout.ts +0 -17
- package/template/src/rtm-events/types.ts +0 -7
- package/template/src/utils/getMeetingInvite.ts +0 -53
- package/template/src/utils/useGroupMessages.ts +0 -24
- package/template/src/utils/useNavParams.ts +0 -6
- package/template/src/utils/useNavigateTo.ts +0 -8
- package/template/src/utils/usePrivateMessages.ts +0 -33
- package/template/src/utils/useSendControlMessage.ts +0 -51
- package/template/src/utils/useSendMessage.ts +0 -40
- package/template/src/utils/useSetUnreadMessageCount.ts +0 -43
- package/template/src/utils/useUnreadMessageCount.ts +0 -50
- package/template/src/utils/useUserList.ts +0 -26
package/Readme.md
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
# App builder core
|
|
2
|
+
|
|
2
3
|
This repository is a part of [RTE app builder](https://appbuilder.agora.io).
|
|
3
4
|
|
|
4
5
|
## Development instructions
|
|
6
|
+
|
|
5
7
|
1. Clone the repo
|
|
6
8
|
|
|
7
9
|
2. Navigate into project directory and run:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
```
|
|
11
|
+
npm run dev-setup -- meeting
|
|
12
|
+
npm run dev-setup -- live-streaming
|
|
13
|
+
npm run dev-setup -- voice-chat
|
|
14
|
+
npm run dev-setup -- audio-livecast
|
|
15
|
+
```
|
|
16
|
+
This command will automatically set everything up for development
|
|
13
17
|
|
|
14
18
|
To build react sdk using esbuild,
|
|
19
|
+
|
|
15
20
|
1. Install the go compiler from https://go.dev/doc/install
|
|
16
21
|
2. Run `go mod tidy` to download dependencies
|
|
17
22
|
|
|
18
|
-
You can now build react sdk using esbuild through npm script
|
|
23
|
+
You can now build react sdk using esbuild through npm script
|
package/package.json
CHANGED
package/template/Gulpfile.js
CHANGED
|
@@ -18,41 +18,48 @@ const config = require('./config.json');
|
|
|
18
18
|
const replace = require('gulp-replace');
|
|
19
19
|
const concat = require('gulp-concat');
|
|
20
20
|
const header = require('gulp-header');
|
|
21
|
+
const semver = require('semver');
|
|
21
22
|
|
|
22
23
|
const webpack = require('webpack');
|
|
23
24
|
const WebpackDevServer = require('webpack-dev-server');
|
|
24
25
|
const webpackConfig = require('./webpack.renderer.config');
|
|
25
26
|
const webpackRsdkConfig = require('./webpack.rsdk.config');
|
|
26
27
|
|
|
27
|
-
const outPathArg = process.argv.indexOf('--outpath')
|
|
28
|
+
const outPathArg = process.argv.indexOf('--outpath');
|
|
28
29
|
getBuildPath = () => {
|
|
29
30
|
if (outPathArg == -1) {
|
|
30
31
|
return process.env.TARGET === 'wsdk'
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
? path.join(__dirname, '../Builds/web-sdk')
|
|
33
|
+
: process.env.TARGET === 'rsdk'
|
|
34
|
+
? path.join(__dirname, '../Builds/react-sdk')
|
|
35
|
+
: process.env.TARGET === 'android'
|
|
36
|
+
? path.join(__dirname, '../Builds/android')
|
|
37
|
+
: path.join(__dirname, '../Builds/.electron');
|
|
37
38
|
} else {
|
|
38
|
-
return process.argv[outPathArg+1].split('/').slice(0, -1).join('/')
|
|
39
|
+
return process.argv[outPathArg + 1].split('/').slice(0, -1).join('/');
|
|
39
40
|
}
|
|
40
|
-
}
|
|
41
|
+
};
|
|
41
42
|
const BUILD_PATH = getBuildPath();
|
|
42
|
-
const TS_DEFS_BUILD_PATH =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
const TS_DEFS_BUILD_PATH =
|
|
44
|
+
process.env.TARGET === 'wsdk'
|
|
45
|
+
? path.join(__dirname, '../Builds/ts-defs/web-sdk')
|
|
46
|
+
: process.env.TARGET === 'rsdk'
|
|
47
|
+
? path.join(__dirname, '../Builds/ts-defs/react-sdk')
|
|
48
|
+
: process.env.TARGET === 'android'
|
|
49
|
+
? path.join(__dirname, '../Builds/ts-defs/android')
|
|
50
|
+
: path.join(__dirname, '../Builds/ts-defs/.electron');
|
|
49
51
|
|
|
50
|
-
const
|
|
51
|
-
const PACKAGE_NAME = pkgNameArg == -1
|
|
52
|
-
? 'agora-app-builder-sdk'
|
|
53
|
-
: process.argv[pkgNameArg+1]
|
|
52
|
+
const debugFlag = process.argv.indexOf('--debug') !== -1;
|
|
54
53
|
|
|
55
|
-
|
|
54
|
+
const pkgNameArg = process.argv.indexOf('--pkgname');
|
|
55
|
+
const PACKAGE_NAME =
|
|
56
|
+
pkgNameArg == -1
|
|
57
|
+
? process.env.TARGET === 'rsdk'
|
|
58
|
+
? '@appbuilder/react'
|
|
59
|
+
: process.env.TARGET === 'wsdk'
|
|
60
|
+
? '@appbuilder/web'
|
|
61
|
+
: 'agora-app-builder-sdk'
|
|
62
|
+
: process.argv[pkgNameArg + 1];
|
|
56
63
|
|
|
57
64
|
const runCli = (cmd, cb) => {
|
|
58
65
|
const [arg1, ...arg2] = cmd.split(' ');
|
|
@@ -63,33 +70,48 @@ const runCli = (cmd, cb) => {
|
|
|
63
70
|
proc.on('exit', cb);
|
|
64
71
|
};
|
|
65
72
|
|
|
73
|
+
const runCliNoOutput = (cmd, cb) => {
|
|
74
|
+
const [arg1, ...arg2] = cmd.split(' ');
|
|
75
|
+
const proc = spawn(arg1, arg2, {
|
|
76
|
+
stdio: 'ignore',
|
|
77
|
+
shell: true,
|
|
78
|
+
});
|
|
79
|
+
proc.on('exit', cb);
|
|
80
|
+
};
|
|
81
|
+
|
|
66
82
|
const general = {
|
|
67
83
|
clean: () => {
|
|
68
84
|
return del([`${BUILD_PATH}/**/*`], {force: true});
|
|
69
85
|
},
|
|
70
86
|
packageJson: async (cb) => {
|
|
71
|
-
let
|
|
87
|
+
let {private, author, description, dependencies} = JSON.parse(
|
|
72
88
|
await fs.readFile(path.join(__dirname, 'package.json')),
|
|
73
89
|
);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
let
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
|
|
91
|
+
// Tries to fetch version and dependencies from parent package.json
|
|
92
|
+
|
|
93
|
+
let {dependencies: parentDependencies, version: parentVersion} = JSON.parse(
|
|
94
|
+
await fs.readFile(path.join(__dirname, '..', 'package.json')),
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
// If parentDependencies present derives base version from cli version ( prod )
|
|
98
|
+
// otherwise uses version number from parent package.json ( dev )
|
|
99
|
+
|
|
100
|
+
let baseVersion = parentDependencies
|
|
101
|
+
? parentDependencies['agora-app-builder-cli']
|
|
102
|
+
: parentVersion;
|
|
103
|
+
|
|
104
|
+
// Generates unique hash
|
|
105
|
+
|
|
106
|
+
const nanoid = await import('nanoid');
|
|
107
|
+
const alphabet =
|
|
108
|
+
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
109
|
+
|
|
110
|
+
let versionHash = nanoid.customAlphabet(alphabet, 10)();
|
|
111
|
+
|
|
112
|
+
// Hash appended to base version to create unique version for every build.
|
|
113
|
+
|
|
114
|
+
let version = semver.minVersion(`${baseVersion}-${versionHash}`).version;
|
|
93
115
|
|
|
94
116
|
let newPackage = {
|
|
95
117
|
name: PACKAGE_NAME,
|
|
@@ -97,11 +119,6 @@ const general = {
|
|
|
97
119
|
private,
|
|
98
120
|
author,
|
|
99
121
|
description,
|
|
100
|
-
// dependencies: natives,
|
|
101
|
-
// agora_electron: {
|
|
102
|
-
// electron_version: '5.0.8',
|
|
103
|
-
// prebuilt: true,
|
|
104
|
-
// },
|
|
105
122
|
};
|
|
106
123
|
|
|
107
124
|
// Target specific changes
|
|
@@ -135,13 +152,25 @@ const general = {
|
|
|
135
152
|
return fs.mkdir(BUILD_PATH, {recursive: true});
|
|
136
153
|
},
|
|
137
154
|
typescript: (cb) => {
|
|
138
|
-
runCli
|
|
139
|
-
|
|
155
|
+
const cli = debugFlag ? runCli : runCliNoOutput;
|
|
156
|
+
cli(
|
|
157
|
+
'npx -p typescript tsc --project tsconfig_fpeApi.json --outFile ../Builds/customization-api.d.ts',
|
|
140
158
|
() => cb(),
|
|
141
159
|
);
|
|
142
160
|
},
|
|
143
161
|
typescriptFix: () => {
|
|
144
|
-
return src('../Builds/
|
|
162
|
+
return src(['../Builds/customization-api.d.ts', './global.d.ts'])
|
|
163
|
+
.pipe(concat('./customization-api.d.ts'))
|
|
164
|
+
.pipe(
|
|
165
|
+
replace(
|
|
166
|
+
`declare var $config: ConfigInterface;
|
|
167
|
+
declare module 'customization' {
|
|
168
|
+
const customizationConfig: {};
|
|
169
|
+
export default customizationConfig;
|
|
170
|
+
}`,
|
|
171
|
+
' ',
|
|
172
|
+
),
|
|
173
|
+
)
|
|
145
174
|
.pipe(replace('"agora-rn-uikit"', '"agora-rn-uikit/src/index"'))
|
|
146
175
|
.pipe(dest('../Builds/'));
|
|
147
176
|
},
|
|
@@ -149,14 +178,17 @@ const general = {
|
|
|
149
178
|
return del([`${path.join(BUILD_PATH, '../', '/')}*.d.ts`], {force: true});
|
|
150
179
|
},
|
|
151
180
|
genTsDefs: (cb) => {
|
|
152
|
-
runCli(
|
|
181
|
+
runCli(
|
|
182
|
+
`mkdir -p ${TS_DEFS_BUILD_PATH} && cp ${BUILD_PATH}/index.d.ts ${TS_DEFS_BUILD_PATH}/index.d.ts`,
|
|
183
|
+
cb,
|
|
184
|
+
);
|
|
153
185
|
},
|
|
154
186
|
useTsDefs: (cb) => {
|
|
155
|
-
runCli(`cp ${TS_DEFS_BUILD_PATH}/index.d.ts ${BUILD_PATH}/index.d.ts`, cb)
|
|
187
|
+
runCli(`cp ${TS_DEFS_BUILD_PATH}/index.d.ts ${BUILD_PATH}/index.d.ts`, cb);
|
|
156
188
|
},
|
|
157
189
|
npmPack: (cb) => {
|
|
158
|
-
runCli(`cd ${BUILD_PATH} && npm pack`, cb)
|
|
159
|
-
}
|
|
190
|
+
runCli(`cd ${BUILD_PATH} && npm pack`, cb);
|
|
191
|
+
},
|
|
160
192
|
};
|
|
161
193
|
|
|
162
194
|
const electron = {
|
|
@@ -176,6 +208,9 @@ const electron = {
|
|
|
176
208
|
const config = webpack(webpackConfig);
|
|
177
209
|
new WebpackDevServer(config, {
|
|
178
210
|
hot: true,
|
|
211
|
+
client: {
|
|
212
|
+
overlay: false,
|
|
213
|
+
},
|
|
179
214
|
}).listen(webpackConfig.devServer.port, 'localhost', (err) => {
|
|
180
215
|
if (err) {
|
|
181
216
|
console.error(err);
|
|
@@ -186,7 +221,7 @@ const electron = {
|
|
|
186
221
|
},
|
|
187
222
|
|
|
188
223
|
start: (cb) => {
|
|
189
|
-
runCli('electron .', cb);
|
|
224
|
+
runCli('electron ./electron/main/index.js', cb);
|
|
190
225
|
},
|
|
191
226
|
};
|
|
192
227
|
|
|
@@ -197,38 +232,43 @@ const reactSdk = {
|
|
|
197
232
|
esbuild: (cb) => {
|
|
198
233
|
let outPath = '';
|
|
199
234
|
if (outPathArg != -1) {
|
|
200
|
-
outPath = ` --outpath ${process.argv[outPathArg+1]}
|
|
235
|
+
outPath = ` --outpath ${process.argv[outPathArg + 1]}`;
|
|
201
236
|
}
|
|
202
237
|
let configTransformerPath = '';
|
|
203
|
-
const configTransformerPathArg = process.argv.indexOf(
|
|
238
|
+
const configTransformerPathArg = process.argv.indexOf(
|
|
239
|
+
'--configtransformerpath',
|
|
240
|
+
);
|
|
204
241
|
if (configTransformerPathArg != -1) {
|
|
205
|
-
configTransformerPath = ` --configtransformerpath ${
|
|
242
|
+
configTransformerPath = ` --configtransformerpath ${
|
|
243
|
+
process.argv[configTransformerPathArg + 1]
|
|
244
|
+
}`;
|
|
206
245
|
}
|
|
207
|
-
let esbuildCmd = `go build -o ../esbuild-bin/rsdk ./esbuild.rsdk.go && ../esbuild-bin/rsdk${outPath}${configTransformerPath}
|
|
208
|
-
console.log(esbuildCmd)
|
|
246
|
+
let esbuildCmd = `go build -o ../esbuild-bin/rsdk ./esbuild.rsdk.go && ../esbuild-bin/rsdk${outPath}${configTransformerPath}`;
|
|
247
|
+
console.log(esbuildCmd);
|
|
209
248
|
runCli(esbuildCmd, cb);
|
|
210
249
|
},
|
|
211
250
|
typescript: (cb) => {
|
|
212
|
-
runCli
|
|
251
|
+
const cli = debugFlag ? runCli : runCliNoOutput;
|
|
252
|
+
cli(
|
|
213
253
|
//'npx -p typescript tsc index.rsdk.tsx --declaration --emitDeclarationOnly --noResolve --outFile ../Builds/temp.d.ts',
|
|
214
254
|
'npx -p typescript tsc --project tsconfig_rsdk_index.json --outFile ../Builds/reactSdk.d.ts',
|
|
215
255
|
() => cb(),
|
|
216
256
|
);
|
|
217
257
|
},
|
|
218
258
|
typescriptFix: () => {
|
|
219
|
-
return src(['../Builds/
|
|
259
|
+
return src(['../Builds/customization-api.d.ts', '../Builds/reactSdk.d.ts'])
|
|
220
260
|
.pipe(concat('index.d.ts'))
|
|
221
261
|
.pipe(
|
|
222
262
|
replace(
|
|
223
263
|
'declare module "index.rsdk"',
|
|
224
|
-
|
|
264
|
+
`declare module "${PACKAGE_NAME}"`,
|
|
225
265
|
),
|
|
226
266
|
)
|
|
227
|
-
.pipe(replace("'
|
|
228
|
-
.pipe(replace('"
|
|
267
|
+
.pipe(replace("'customization-api'", "'customization-api/index'"))
|
|
268
|
+
.pipe(replace('"customization-api"', '"customization-api/index"'))
|
|
229
269
|
.pipe(header('// @ts-nocheck\n'))
|
|
230
270
|
.pipe(dest(BUILD_PATH));
|
|
231
|
-
}
|
|
271
|
+
},
|
|
232
272
|
};
|
|
233
273
|
|
|
234
274
|
const webSdk = {
|
|
@@ -236,28 +276,29 @@ const webSdk = {
|
|
|
236
276
|
runCli('webpack --config ./webpack.wsdk.config.js', cb);
|
|
237
277
|
},
|
|
238
278
|
typescript: (cb) => {
|
|
239
|
-
runCli
|
|
279
|
+
const cli = debugFlag ? runCli : runCliNoOutput;
|
|
280
|
+
cli(
|
|
240
281
|
'npx -p typescript tsc --project tsconfig_wsdk_index.json --outFile ../Builds/webSdk.d.ts',
|
|
241
282
|
() => cb(),
|
|
242
283
|
);
|
|
243
284
|
},
|
|
244
285
|
typescriptFix: () => {
|
|
245
|
-
return src(['../Builds/
|
|
286
|
+
return src(['../Builds/customization-api.d.ts', '../Builds/webSdk.d.ts'])
|
|
246
287
|
.pipe(concat('index.d.ts'))
|
|
247
288
|
.pipe(
|
|
248
289
|
replace(
|
|
249
290
|
'declare module "index.wsdk"',
|
|
250
|
-
|
|
291
|
+
`declare module "${PACKAGE_NAME}"`,
|
|
251
292
|
),
|
|
252
293
|
)
|
|
253
|
-
.pipe(replace("'
|
|
254
|
-
.pipe(replace('"
|
|
294
|
+
.pipe(replace("'customization-api'", "'customization-api/index'"))
|
|
295
|
+
.pipe(replace('"customization-api"', '"customization-api/index"'))
|
|
255
296
|
.pipe(header('// @ts-nocheck\n'))
|
|
256
297
|
.pipe(dest(BUILD_PATH));
|
|
257
298
|
},
|
|
258
299
|
npmPack: (cb) => {
|
|
259
|
-
runCli('cd ../Builds/web-sdk && npm pack',cb)
|
|
260
|
-
}
|
|
300
|
+
runCli('cd ../Builds/web-sdk && npm pack', cb);
|
|
301
|
+
},
|
|
261
302
|
};
|
|
262
303
|
|
|
263
304
|
const android = {
|
|
@@ -324,7 +365,7 @@ module.exports.reactSdk = series(
|
|
|
324
365
|
);
|
|
325
366
|
|
|
326
367
|
// react-sdk-esbuild
|
|
327
|
-
module.exports.reactSdkEsbuild = series
|
|
368
|
+
module.exports.reactSdkEsbuild = series(
|
|
328
369
|
general.clean,
|
|
329
370
|
general.createBuildDirectory,
|
|
330
371
|
general.packageJson,
|
|
@@ -335,31 +376,31 @@ module.exports.reactSdkEsbuild = series (
|
|
|
335
376
|
reactSdk.typescriptFix,
|
|
336
377
|
general.typescriptClean,
|
|
337
378
|
general.npmPack,
|
|
338
|
-
)
|
|
379
|
+
);
|
|
339
380
|
|
|
340
381
|
// generate typescript definitions
|
|
341
|
-
module.exports.makeRsdkTsDefs = series
|
|
382
|
+
module.exports.makeRsdkTsDefs = series(
|
|
342
383
|
general.clean,
|
|
343
384
|
general.createBuildDirectory,
|
|
344
385
|
general.packageJson,
|
|
345
|
-
reactSdk.
|
|
386
|
+
reactSdk.webpack,
|
|
346
387
|
general.typescript,
|
|
347
388
|
general.typescriptFix,
|
|
348
389
|
reactSdk.typescript,
|
|
349
390
|
reactSdk.typescriptFix,
|
|
350
391
|
general.typescriptClean,
|
|
351
392
|
general.genTsDefs,
|
|
352
|
-
)
|
|
393
|
+
);
|
|
353
394
|
|
|
354
395
|
// react-sdk-esbuild with cached type definitions
|
|
355
|
-
module.exports.reactSdkEsbuildCachedTsc = series
|
|
396
|
+
module.exports.reactSdkEsbuildCachedTsc = series(
|
|
356
397
|
general.clean,
|
|
357
398
|
general.createBuildDirectory,
|
|
358
399
|
general.packageJson,
|
|
359
400
|
reactSdk.esbuild,
|
|
360
401
|
general.useTsDefs,
|
|
361
402
|
general.npmPack,
|
|
362
|
-
)
|
|
403
|
+
);
|
|
363
404
|
|
|
364
405
|
// web-sdk
|
|
365
406
|
module.exports.webSdk = series(
|
|
@@ -400,10 +441,7 @@ module.exports.webSdkCachedTsc = series(
|
|
|
400
441
|
general.clean,
|
|
401
442
|
general.createBuildDirectory,
|
|
402
443
|
general.packageJson,
|
|
403
|
-
parallel(
|
|
404
|
-
webSdk.webpack,
|
|
405
|
-
general.useTsDefs,
|
|
406
|
-
),
|
|
444
|
+
parallel(webSdk.webpack, general.useTsDefs),
|
|
407
445
|
general.npmPack,
|
|
408
446
|
);
|
|
409
447
|
|
package/template/_gitignore
CHANGED