agora-appbuilder-core 2.3.0-beta.8 → 3.0.0

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.
Files changed (205) hide show
  1. package/Readme.md +11 -6
  2. package/package.json +1 -1
  3. package/template/Gulpfile.js +121 -83
  4. package/template/_gitignore +2 -2
  5. package/template/_package-lock.json +12959 -13248
  6. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +2 -2
  7. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +2 -0
  8. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +3 -3
  9. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +4 -5
  10. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +3 -1
  11. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +2 -2
  12. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +1 -1
  13. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +1 -1
  14. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +1 -1
  15. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +1 -1
  16. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +4 -4
  17. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +7 -5
  18. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -1
  19. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -1
  20. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +2 -2
  21. package/template/agora-rn-uikit/src/Rtc/Create.tsx +88 -43
  22. package/template/agora-rn-uikit/src/Rtc/Join.tsx +13 -4
  23. package/template/agora-rn-uikit/src/RtcConfigure.tsx +36 -19
  24. package/template/agora-rn-uikit/src/Utils/permission.ts +17 -6
  25. package/template/babel.config.js +9 -9
  26. package/template/bridge/rtc/webNg/RtcEngine.ts +51 -26
  27. package/template/customization-api/action-library.ts +22 -0
  28. package/template/{fpe-api/context.ts → customization-api/app-state.ts} +16 -14
  29. package/template/customization-api/customEvents.ts +9 -0
  30. package/template/{fpe-api/install.ts → customization-api/customize.ts} +27 -26
  31. package/template/{fpe-api → customization-api}/index.ts +11 -6
  32. package/template/{fpe-api/components.ts → customization-api/sub-components.ts} +22 -3
  33. package/template/{fpe-api → customization-api}/typeDefinition.ts +13 -14
  34. package/template/customization-api/utils.ts +30 -0
  35. package/template/{fpe-implementation → customization-implementation}/createHook.ts +0 -0
  36. package/template/{fpe-implementation/dummyFpe.ts → customization-implementation/dummyConfig.ts} +4 -4
  37. package/template/customization-implementation/index.ts +4 -0
  38. package/template/{fpe-api/useFpe.tsx → customization-implementation/useCustomization.tsx} +12 -12
  39. package/template/{fpe.config.js → customization.config.js} +11 -11
  40. package/template/electron/main/index.js +42 -35
  41. package/template/esbuild.rsdk.go +8 -17
  42. package/template/global.d.ts +4 -3
  43. package/template/index.rsdk.tsx +13 -5
  44. package/template/index.wsdk.tsx +21 -5
  45. package/template/package.json +3 -0
  46. package/template/react-native-toast-message/src/index.js +3 -7
  47. package/template/react-native-toast-message/src/{index.wsdk.js → index.sdk.tsx} +1 -1
  48. package/template/react-native-toast-message/src/styles.sdk.ts +17 -0
  49. package/template/src/App.tsx +8 -4
  50. package/template/src/AppWrapper.tsx +8 -6
  51. package/template/src/SDKAppWrapper.tsx +28 -21
  52. package/template/src/app-state/useLocalUserInfo.ts +8 -0
  53. package/template/src/app-state/useMessages.ts +52 -0
  54. package/template/src/atoms/PrimaryButton.tsx +2 -2
  55. package/template/src/atoms/SecondaryButton.tsx +12 -4
  56. package/template/src/atoms/TextInput.tsx +2 -2
  57. package/template/src/components/Chat.tsx +22 -11
  58. package/template/src/components/ChatContext.ts +10 -27
  59. package/template/src/components/Controls.native.tsx +13 -7
  60. package/template/src/components/Controls.tsx +15 -24
  61. package/template/src/components/DeviceConfigure.tsx +4 -3
  62. package/template/src/components/EventsConfigure.tsx +54 -0
  63. package/template/src/components/GridVideo.tsx +5 -6
  64. package/template/src/components/HostControlView.tsx +13 -19
  65. package/template/src/components/Navbar.tsx +54 -41
  66. package/template/src/components/NetworkQualityContext.tsx +4 -3
  67. package/template/src/components/ParticipantsView.tsx +7 -7
  68. package/template/src/components/PinnedVideo.tsx +3 -4
  69. package/template/src/components/Precall.native.tsx +3 -3
  70. package/template/src/components/Precall.tsx +14 -10
  71. package/template/src/components/RTMConfigure.tsx +61 -219
  72. package/template/src/components/SettingsView.tsx +6 -3
  73. package/template/src/components/Share.tsx +24 -18
  74. package/template/src/components/chat-messages/useChatMessages.tsx +397 -80
  75. package/template/src/components/chat-notification/useChatNotification.tsx +2 -2
  76. package/template/src/components/chat-ui/useChatUIControl.tsx +1 -1
  77. package/template/src/components/common/Logo.tsx +3 -2
  78. package/template/src/components/contexts/LiveStreamDataContext.tsx +3 -3
  79. package/template/src/components/contexts/ScreenShareContext.tsx +3 -1
  80. package/template/src/components/contexts/VideoMeetingDataContext.tsx +85 -0
  81. package/template/src/components/contexts/WhiteboardContext.tsx +8 -8
  82. package/template/src/components/livestream/LiveStreamContext.tsx +88 -74
  83. package/template/src/components/meeting-info/useMeetingInfo.tsx +23 -19
  84. package/template/src/components/meeting-info/useSetMeetingInfo.tsx +1 -1
  85. package/template/src/components/participants/AllAudienceParticipants.tsx +2 -2
  86. package/template/src/components/participants/AllHostParticipants.tsx +4 -4
  87. package/template/src/components/participants/MeParticipant.tsx +5 -3
  88. package/template/src/components/participants/ParticipantName.tsx +2 -2
  89. package/template/src/components/participants/RemoteParticipants.tsx +9 -7
  90. package/template/src/components/precall/LocalMute.native.tsx +14 -10
  91. package/template/src/components/precall/LocalMute.tsx +7 -5
  92. package/template/src/components/precall/VideoPreview.native.tsx +6 -6
  93. package/template/src/components/precall/VideoPreview.tsx +3 -3
  94. package/template/src/components/precall/joinCallBtn.tsx +3 -3
  95. package/template/src/components/precall/meetingTitle.tsx +3 -1
  96. package/template/src/components/precall/selectDevice.tsx +2 -2
  97. package/template/src/components/precall/usePreCall.tsx +1 -1
  98. package/template/src/components/styles.ts +3 -3
  99. package/template/src/components/useShareLink.tsx +69 -29
  100. package/template/src/components/useUserPreference.tsx +16 -15
  101. package/template/src/components/useWakeLock.tsx +3 -3
  102. package/template/src/language/i18nTypes.ts +1 -1
  103. package/template/src/language/index.ts +2 -2
  104. package/template/src/language/useLanguage.tsx +2 -3
  105. package/template/src/pages/Authenticate.tsx +3 -2
  106. package/template/src/pages/Create.tsx +18 -20
  107. package/template/src/pages/Join.tsx +6 -7
  108. package/template/src/pages/VideoCall.tsx +74 -66
  109. package/template/src/pages/create/useCreate.tsx +1 -1
  110. package/template/src/pages/video-call/CustomUserContextHolder.tsx +14 -6
  111. package/template/src/pages/video-call/DefaultLayouts.ts +8 -8
  112. package/template/src/pages/video-call/{NameWithMicStatus.tsx → NameWithMicIcon.tsx} +8 -1
  113. package/template/src/pages/video-call/RenderComponent.tsx +7 -10
  114. package/template/src/pages/video-call/VideoCallScreen.tsx +31 -22
  115. package/template/src/pages/video-call/VideoComponent.tsx +13 -15
  116. package/template/src/pages/video-call/VideoRenderer.tsx +6 -6
  117. package/template/src/pages/video-call/useLayoutsData.ts +23 -0
  118. package/template/src/rtm/RTMEngine.ts +13 -0
  119. package/template/src/rtm-events/EventUtils.ts +20 -20
  120. package/template/src/rtm-events/EventsQueue.ts +9 -3
  121. package/template/src/rtm-events/constants.ts +5 -0
  122. package/template/src/rtm-events/index.tsx +1 -3
  123. package/template/src/{custom-events/CustomEvents.ts → rtm-events-api/Events.ts} +67 -61
  124. package/template/src/rtm-events-api/index.tsx +6 -0
  125. package/template/src/rtm-events-api/types.ts +22 -0
  126. package/template/src/subComponents/ChatBubble.tsx +24 -8
  127. package/template/src/subComponents/ChatContainer.tsx +24 -15
  128. package/template/src/subComponents/ChatInput.tsx +56 -42
  129. package/template/src/subComponents/LanguageSelector.tsx +2 -2
  130. package/template/src/subComponents/LayoutIconDropdown.native.tsx +5 -5
  131. package/template/src/subComponents/LayoutIconDropdown.tsx +7 -7
  132. package/template/src/subComponents/LocalAudioMute.tsx +3 -4
  133. package/template/src/subComponents/LocalEndCall.tsx +3 -6
  134. package/template/src/subComponents/LocalSwitchCamera.tsx +3 -4
  135. package/template/src/subComponents/LocalVideoMute.tsx +3 -3
  136. package/template/src/subComponents/NetworkQualityPill.tsx +8 -9
  137. package/template/src/subComponents/OpenInNativeButton.tsx +2 -3
  138. package/template/src/subComponents/RemoteAudioMute.tsx +5 -11
  139. package/template/src/subComponents/RemoteEndCall.tsx +3 -10
  140. package/template/src/subComponents/RemoteVideoMute.tsx +3 -10
  141. package/template/src/subComponents/SelectDevice.tsx +1 -1
  142. package/template/src/subComponents/SelectOAuth.tsx +3 -2
  143. package/template/src/subComponents/SidePanelButtons.ts +6 -5
  144. package/template/src/subComponents/TextWithTooltip.tsx +6 -2
  145. package/template/src/subComponents/{toastConfig.tsx → ToastConfig.tsx} +2 -2
  146. package/template/src/subComponents/chat/ChatParticipants.tsx +6 -5
  147. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +2 -2
  148. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +4 -3
  149. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +2 -2
  150. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +2 -4
  151. package/template/src/subComponents/livestream/index.ts +2 -2
  152. package/template/src/subComponents/recording/useRecording.tsx +44 -23
  153. package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +11 -5
  154. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +46 -34
  155. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +97 -38
  156. package/template/src/subComponents/screenshare/useScreenshare.tsx +1 -1
  157. package/template/src/utils/SdkEvents.ts +9 -46
  158. package/template/src/utils/common.tsx +25 -9
  159. package/template/src/utils/getUniqueID.ts +5 -0
  160. package/template/src/utils/isMobileOrTablet.native.ts +2 -2
  161. package/template/src/utils/isMobileOrTablet.ts +21 -8
  162. package/template/src/utils/useButtonTemplate.tsx +1 -1
  163. package/template/src/utils/useCreateMeeting.ts +21 -10
  164. package/template/src/utils/useGetMeetingPhrase.ts +11 -8
  165. package/template/src/utils/{IsAttendeeUser.ts → useIsAttendee.ts} +3 -1
  166. package/template/src/utils/{isAudioEnabled.ts → useIsAudioEnabled.ts} +4 -4
  167. package/template/src/utils/{isHostUser.ts → useIsHost.ts} +13 -16
  168. package/template/src/utils/{isPSTNUser.ts → useIsPSTN.ts} +2 -2
  169. package/template/src/utils/{isScreenShareUser.ts → useIsScreenShare.ts} +0 -0
  170. package/template/src/utils/{isVideoEnabled.ts → useIsVideoEnabled.ts} +5 -6
  171. package/template/src/utils/useJoinMeeting.ts +8 -6
  172. package/template/src/utils/useLayout.tsx +5 -5
  173. package/template/src/utils/useMutePSTN.ts +5 -3
  174. package/template/src/utils/useMuteToggleLocal.ts +3 -4
  175. package/template/src/utils/useRemoteEndCall.ts +11 -10
  176. package/template/src/utils/useRemoteMute.ts +42 -20
  177. package/template/src/utils/useSidePanel.tsx +1 -1
  178. package/template/src/utils/useString.ts +2 -2
  179. package/template/src/utils/useUserName.ts +11 -0
  180. package/template/tsconfig_fpeApi.json +8 -9
  181. package/template/tsconfig_rsdk_index.json +8 -9
  182. package/template/tsconfig_wsdk_index.json +8 -9
  183. package/template/webpack.commons.js +9 -9
  184. package/template/webpack.rsdk.config.js +4 -2
  185. package/template/webpack.ts.config.js +6 -6
  186. package/template/webpack.wsdk.config.js +2 -1
  187. package/template/fpe-api/fpeEvents.ts +0 -9
  188. package/template/fpe-api/utils.ts +0 -61
  189. package/template/fpe-implementation/index.ts +0 -1
  190. package/template/fpe-todo.txt +0 -14
  191. package/template/src/components/RTMEvents.tsx +0 -84
  192. package/template/src/custom-events/index.tsx +0 -4
  193. package/template/src/custom-events/types.ts +0 -51
  194. package/template/src/pages/video-call/CustomLayout.ts +0 -17
  195. package/template/src/rtm-events/types.ts +0 -7
  196. package/template/src/utils/getMeetingInvite.ts +0 -53
  197. package/template/src/utils/useGroupMessages.ts +0 -24
  198. package/template/src/utils/useNavParams.ts +0 -6
  199. package/template/src/utils/useNavigateTo.ts +0 -8
  200. package/template/src/utils/usePrivateMessages.ts +0 -33
  201. package/template/src/utils/useSendControlMessage.ts +0 -51
  202. package/template/src/utils/useSendMessage.ts +0 -40
  203. package/template/src/utils/useSetUnreadMessageCount.ts +0 -43
  204. package/template/src/utils/useUnreadMessageCount.ts +0 -50
  205. 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
- npm run dev-setup -- meeting
10
- npm run dev-setup -- live-streaming
11
- ```
12
- This command will automatically set everything up for development
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "2.3.0-beta.8",
3
+ "version": "3.0.0",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -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
- ? path.join(__dirname, '../Builds/web-sdk')
32
- : process.env.TARGET === 'rsdk'
33
- ? path.join(__dirname, '../Builds/react-sdk')
34
- : process.env.TARGET === 'android'
35
- ? path.join(__dirname, '../Builds/android')
36
- : path.join(__dirname, '../Builds/.electron');
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 = process.env.TARGET === 'wsdk'
43
- ? path.join(__dirname, '../Builds/ts-defs/web-sdk')
44
- : process.env.TARGET === 'rsdk'
45
- ? path.join(__dirname, '../Builds/ts-defs/react-sdk')
46
- : process.env.TARGET === 'android'
47
- ? path.join(__dirname, '../Builds/ts-defs/android')
48
- : path.join(__dirname, '../Builds/ts-defs/.electron');
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 pkgNameArg = process.argv.indexOf('--pkgname')
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
- let PRODUCT_NAME;
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 package = JSON.parse(
87
+ let {private, author, description, dependencies} = JSON.parse(
72
88
  await fs.readFile(path.join(__dirname, 'package.json')),
73
89
  );
74
- let {
75
- name,
76
- version,
77
- private,
78
- author,
79
- description,
80
- dependencies,
81
- optionalDependencies,
82
- } = package;
83
- PRODUCT_NAME = name;
84
- let nativeDeps = require('./nativeDeps').default;
85
- let natives = {};
86
- let searchDeps = {
87
- ...dependencies,
88
- ...optionalDependencies,
89
- };
90
- nativeDeps.map((k) => {
91
- natives[k] = searchDeps[k];
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
- 'npx -p typescript tsc --project tsconfig_fpeApi.json --outFile ../Builds/fpe-api.d.ts',
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/fpe-api.d.ts')
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(`mkdir -p ${TS_DEFS_BUILD_PATH} && cp ${BUILD_PATH}/index.d.ts ${TS_DEFS_BUILD_PATH}/index.d.ts`, cb);
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('--configtransformerpath')
238
+ const configTransformerPathArg = process.argv.indexOf(
239
+ '--configtransformerpath',
240
+ );
204
241
  if (configTransformerPathArg != -1) {
205
- configTransformerPath = ` --configtransformerpath ${process.argv[configTransformerPathArg+1]}`
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/fpe-api.d.ts', '../Builds/reactSdk.d.ts'])
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
- 'declare module "agora-app-builder-sdk"',
264
+ `declare module "${PACKAGE_NAME}"`,
225
265
  ),
226
266
  )
227
- .pipe(replace("'fpe-api'", "'fpe-api/index'"))
228
- .pipe(replace('"fpe-api"', '"fpe-api/index"'))
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/fpe-api.d.ts', '../Builds/webSdk.d.ts'])
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
- 'declare module "agora-app-builder-sdk"',
291
+ `declare module "${PACKAGE_NAME}"`,
251
292
  ),
252
293
  )
253
- .pipe(replace("'fpe-api'", "'fpe-api/index'"))
254
- .pipe(replace('"fpe-api"', '"fpe-api/index"'))
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.esbuild,
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
 
@@ -73,5 +73,5 @@ dist/
73
73
  .webpack/
74
74
  out/
75
75
 
76
- #FPE plugin folder
77
- template/test-fpe/*
76
+ #Customization plugin folder
77
+ template/customization/*