agora-toolchain 3.7.8 → 3.8.0-alpha

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.
@@ -43,4 +43,19 @@ app.addListener('ready', () => {
43
43
  enable(mainWindow.webContents);
44
44
 
45
45
  mainWindow.loadURL(baseUrl);
46
+
47
+ mainWindow.webContents.setWindowOpenHandler(() => {
48
+ return {
49
+ action: 'allow',
50
+ overrideBrowserWindowOptions: {
51
+ webPreferences: {
52
+ ...defaultWebPreferences,
53
+ },
54
+ },
55
+ };
56
+ });
57
+
58
+ mainWindow.webContents.on('did-create-window', (window) => {
59
+ enable(window.webContents);
60
+ });
46
61
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-toolchain",
3
- "version": "3.7.8",
3
+ "version": "3.8.0-alpha",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "agora-tc-transpile": "./scripts/transpile.js",
@@ -5,6 +5,9 @@ const path = require('path');
5
5
  const cwd = process.cwd();
6
6
 
7
7
  const pattern = opts.file ?? '**/*.test.ts';
8
+ const singleRun = opts.singleRun ?? false;
9
+ const fakeMedia = opts.fakeMedia ?? false;
10
+ const headless = opts.headless ?? false;
8
11
 
9
12
  const files =
10
13
  process.env.platform === 'browser'
@@ -26,7 +29,21 @@ const preprocessors =
26
29
  [path.join(cwd, '__test__/electron/**/*.test.ts')]: ['webpack'],
27
30
  };
28
31
 
29
- const browsers = process.env.platform === 'browser' ? ['Chrome'] : [];
32
+ const browsers = process.env.platform === 'browser' ? ['Chrome_Custom'] : [];
33
+ const launcherFlags = [];
34
+
35
+ if (fakeMedia) {
36
+ launcherFlags.push('--use-fake-ui-for-media-stream', '--use-fake-device-for-media-stream');
37
+ }
38
+
39
+ if (headless) {
40
+ launcherFlags.push(
41
+ '--headless=new',
42
+ '--no-sandbox',
43
+ '--disable-gpu',
44
+ '--window-size=1280,800',
45
+ );
46
+ }
30
47
 
31
48
  module.exports = (config) => {
32
49
  config.set({
@@ -88,10 +105,17 @@ module.exports = (config) => {
88
105
 
89
106
  // Continuous Integration mode
90
107
  // if true, Karma captures browsers, runs the tests and exits
91
- singleRun: false,
108
+ singleRun,
92
109
 
93
110
  // Concurrency level
94
111
  // how many browser instances should be started simultaneously
95
112
  concurrency: Infinity,
113
+
114
+ customLaunchers: {
115
+ Chrome_Custom: {
116
+ base: 'Chrome',
117
+ flags: launcherFlags,
118
+ },
119
+ },
96
120
  });
97
121
  };
@@ -13,7 +13,9 @@ module.exports = {
13
13
  AGORA_TEST_RTM_APP_CERTIFICATE: JSON.stringify(process.env.AGORA_TEST_RTM_APP_CERTIFICATE),
14
14
  DEMO_APP_VERSION: JSON.stringify(require(resolveCwd('package.json')).version),
15
15
  DEMO_APP_SHARE_LINK: JSON.stringify(process.env.fcr_app_share_link),
16
- DEMO_APP_BUILD_TIME: JSON.stringify(new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toISOString().replace('Z', '+08:00')),
16
+ DEMO_APP_BUILD_TIME: JSON.stringify(
17
+ new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toISOString().replace('Z', '+08:00'),
18
+ ),
17
19
  }),
18
20
  ],
19
21
  resolve: {
@@ -35,6 +37,7 @@ module.exports = {
35
37
  'agora-ui-foundation',
36
38
  'agora-rte-sdk',
37
39
  'fcr-core',
40
+ 'fcr-ui-widget-sdk',
38
41
  'fcr-ui-scene',
39
42
  'fcr-ui-scene-mobile',
40
43
  ]),
@@ -90,6 +93,10 @@ module.exports = {
90
93
  test: /\.(png|jpe?g|gif|svg|mp4|webm|ogg|mp3|wav|flac|aac|woff|woff2|eot|ttf)$/,
91
94
  type: 'asset',
92
95
  },
96
+ {
97
+ resourceQuery: /raw/,
98
+ type: 'asset/source',
99
+ },
93
100
  ],
94
101
  },
95
102
  };
@@ -233,6 +233,12 @@ module.exports = createConfig = ({ entry, analyze, out = 'dist' }) => {
233
233
  to: resolveCwd('dist/extensions'),
234
234
  noErrorOnMissing: true,
235
235
  },
236
+ // meeting-manager.js
237
+ {
238
+ from: resolveAtBaseModule('public/meeting-manager.js'),
239
+ to: resolveCwd('dist/meeting-manager.js'),
240
+ noErrorOnMissing: true,
241
+ },
236
242
  ],
237
243
  }),
238
244
  ...htmlPlugins,
@@ -14,6 +14,23 @@ const targetPlatform = platform;
14
14
 
15
15
  const targetArch = arch;
16
16
 
17
+ // 读取 package.json 获取版本号
18
+ const packageJsonPath = resolveCwd('package.json');
19
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
20
+ const originalVersion = packageJson.version;
21
+ let builderVersion = packageJson.version;
22
+ // Windows 不支持预发布版本号(如 3.7.8-rc.2),需要转换为标准版本号
23
+ // 移除预发布标识符(-rc.2, -beta.1 等)
24
+ const baseVersion = builderVersion.split('-')[0];
25
+ // 获取 job 号(从环境变量)
26
+ const jobNumber = process.env.BUILD_NUMBER || process.env.JOB_NUMBER || '0';
27
+
28
+ // Windows 版本号格式: major.minor.patch.jobNumber
29
+ builderVersion = `${baseVersion}.${jobNumber}`;
30
+
31
+ console.log(`Windows Platform version number from ${originalVersion} Convert to ${builderVersion}`);
32
+
33
+
17
34
  function copyDirSync(source, target) {
18
35
  if (!fs.existsSync(target)) {
19
36
  fs.mkdirSync(target);
@@ -54,9 +71,11 @@ const options = {
54
71
  schemes: ['fcr-meeting'],
55
72
  },
56
73
 
57
- // "store | normal | "maximum". - For testing builds, use 'store' to reduce build time significantly.
74
+ // "store" | "normal" | "maximum". - For testing builds, use 'store' to reduce build time significantly.
58
75
  compression: isDebug ? 'store' : 'normal',
59
76
  removePackageScripts: true,
77
+ buildVersion: builderVersion,
78
+ buildNumber: jobNumber,
60
79
 
61
80
  afterSign: async (context) => {
62
81
  // Mac releases require hardening+notarization: https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution
@@ -2,6 +2,9 @@ const { program } = require('commander');
2
2
 
3
3
  const opts = program
4
4
  .option('--file <file>', 'Specify an UT to run')
5
+ .option('--single-run', 'Run tests once and exit', false)
6
+ .option('--fake-media', 'Use fake media devices in browser tests', false)
7
+ .option('--headless', 'Run browser tests in headless mode', false)
5
8
  .parse(process.argv)
6
9
  .opts();
7
10