agora-toolchain 3.7.8 → 3.7.9-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-toolchain",
3
- "version": "3.7.8",
3
+ "version": "3.7.9-alpha",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "agora-tc-transpile": "./scripts/transpile.js",
@@ -99,7 +99,10 @@ module.exports = createConfig = ({ entry, analyze, out = 'dist' }) => {
99
99
  codeAppendPlugins.push(
100
100
  new AppendCodePlugin({
101
101
  code: `window.runtime && window.runtime.setFragmentOptions('${fragment}', ${windowOptions} || {}, ${webPreferences} || {});`,
102
- patterns: [/main.[0-9a-f]{20}.js$/, ...fragments.map((f) => new RegExp(`${f}.[0-9a-f]{20}.js$`))],
102
+ patterns: [
103
+ /main.[0-9a-f]{20}.js$/,
104
+ ...fragments.map((f) => new RegExp(`${f}.[0-9a-f]{20}.js$`)),
105
+ ],
103
106
  }),
104
107
  );
105
108
 
@@ -123,11 +126,21 @@ module.exports = createConfig = ({ entry, analyze, out = 'dist' }) => {
123
126
  otherPlugins.push(new BundleAnalyzerPlugin());
124
127
  }
125
128
 
126
- const prodConfig = {
127
- // mode: 'development',
129
+ const debug = process.env.fcr_debug === true || process.env.fcr_debug === 'true';
130
+
131
+ console.log('webpack prod debug:', debug);
132
+
133
+ const baseWebpackConfig = {
128
134
  mode: 'production',
129
- // devtool: 'eval',
130
- // devtool: 'source-map',
135
+ };
136
+
137
+ if (debug) {
138
+ baseWebpackConfig.mode = 'development';
139
+ baseWebpackConfig.devtool = 'eval-source-map';
140
+ }
141
+
142
+ const prodConfig = {
143
+ ...baseWebpackConfig,
131
144
  entry: entries,
132
145
  output: {
133
146
  clean: true,
@@ -233,6 +246,12 @@ module.exports = createConfig = ({ entry, analyze, out = 'dist' }) => {
233
246
  to: resolveCwd('dist/extensions'),
234
247
  noErrorOnMissing: true,
235
248
  },
249
+ // meeting-manager.js
250
+ {
251
+ from: resolveAtBaseModule('public/meeting-manager.js'),
252
+ to: resolveCwd('dist/meeting-manager.js'),
253
+ noErrorOnMissing: true,
254
+ },
236
255
  ],
237
256
  }),
238
257
  ...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
@@ -1,14 +0,0 @@
1
- // excluding regex trick: http://www.rexegg.com/regex-best-trick.html
2
-
3
- // Not anything inside double quotes
4
- // Not anything inside single quotes
5
- // Not anything inside url()
6
- // Any digit followed by px
7
- // !singlequotes|!doublequotes|!url()|pixelunit
8
- function getUnitRegexp(unit) {
9
- return new RegExp('"[^"]+"|\'[^\']+\'|url\\([^\\)]+\\)|(\\d*\\.?\\d+)' + unit, 'g');
10
- }
11
-
12
- module.exports = {
13
- getUnitRegexp,
14
- };
@@ -1,118 +0,0 @@
1
- var filterPropList = {
2
- exact: function (list) {
3
- return list.filter(function (m) {
4
- return m.match(/^[^\*\!]+$/);
5
- });
6
- },
7
- contain: function (list) {
8
- return list
9
- .filter(function (m) {
10
- return m.match(/^\*.+\*$/);
11
- })
12
- .map(function (m) {
13
- return m.substr(1, m.length - 2);
14
- });
15
- },
16
- endWith: function (list) {
17
- return list
18
- .filter(function (m) {
19
- return m.match(/^\*[^\*]+$/);
20
- })
21
- .map(function (m) {
22
- return m.substr(1);
23
- });
24
- },
25
- startWith: function (list) {
26
- return list
27
- .filter(function (m) {
28
- return m.match(/^[^\*\!]+\*$/);
29
- })
30
- .map(function (m) {
31
- return m.substr(0, m.length - 1);
32
- });
33
- },
34
- notExact: function (list) {
35
- return list
36
- .filter(function (m) {
37
- return m.match(/^\![^\*].*$/);
38
- })
39
- .map(function (m) {
40
- return m.substr(1);
41
- });
42
- },
43
- notContain: function (list) {
44
- return list
45
- .filter(function (m) {
46
- return m.match(/^\!\*.+\*$/);
47
- })
48
- .map(function (m) {
49
- return m.substr(2, m.length - 3);
50
- });
51
- },
52
- notEndWith: function (list) {
53
- return list
54
- .filter(function (m) {
55
- return m.match(/^\!\*[^\*]+$/);
56
- })
57
- .map(function (m) {
58
- return m.substr(2);
59
- });
60
- },
61
- notStartWith: function (list) {
62
- return list
63
- .filter(function (m) {
64
- return m.match(/^\![^\*]+\*$/);
65
- })
66
- .map(function (m) {
67
- return m.substr(1, m.length - 2);
68
- });
69
- },
70
- };
71
-
72
- function createPropListMatcher(propList) {
73
- var hasWild = propList.indexOf('*') > -1;
74
- var matchAll = hasWild && propList.length === 1;
75
- var lists = {
76
- exact: filterPropList.exact(propList),
77
- contain: filterPropList.contain(propList),
78
- startWith: filterPropList.startWith(propList),
79
- endWith: filterPropList.endWith(propList),
80
- notExact: filterPropList.notExact(propList),
81
- notContain: filterPropList.notContain(propList),
82
- notStartWith: filterPropList.notStartWith(propList),
83
- notEndWith: filterPropList.notEndWith(propList),
84
- };
85
- return function (prop) {
86
- if (matchAll) return true;
87
- return (
88
- (hasWild ||
89
- lists.exact.indexOf(prop) > -1 ||
90
- lists.contain.some(function (m) {
91
- return prop.indexOf(m) > -1;
92
- }) ||
93
- lists.startWith.some(function (m) {
94
- return prop.indexOf(m) === 0;
95
- }) ||
96
- lists.endWith.some(function (m) {
97
- return prop.indexOf(m) === prop.length - m.length;
98
- })) &&
99
- !(
100
- lists.notExact.indexOf(prop) > -1 ||
101
- lists.notContain.some(function (m) {
102
- return prop.indexOf(m) > -1;
103
- }) ||
104
- lists.notStartWith.some(function (m) {
105
- return prop.indexOf(m) === 0;
106
- }) ||
107
- lists.notEndWith.some(function (m) {
108
- return prop.indexOf(m) === prop.length - m.length;
109
- })
110
- )
111
- );
112
- };
113
- }
114
-
115
- module.exports = {
116
- filterPropList,
117
- createPropListMatcher,
118
- };