Skip to content

Commit

Permalink
chore: change build file version (#18)
Browse files Browse the repository at this point in the history
`${pkg.name}_n${nativeSdkVersion}_w${webSdkVersion}_${pkg.version}.js`

---------

Co-authored-by: guoxianzhe <guoxianzhe@users.noreply.github.com>
  • Loading branch information
guoxianzhe and guoxianzhe authored Oct 24, 2023
1 parent 1bb8fda commit edbb123
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# IRIS_WEB

## [0.2.0-build.1](https://github.com/AgoraIO-Extensions/iris_web/compare/v0.1.2-dev.2...v0.2.0-build.1) (2023-10-24)

## [0.1.2-dev.4](https://github.com/AgoraIO-Extensions/iris_web/compare/v0.1.2-dev.3...v0.1.2-dev.4) (2023-10-24)

## [0.1.2-dev.3](https://github.com/AgoraIO-Extensions/iris_web/compare/v0.1.2-dev.2...v0.1.2-dev.3) (2023-10-23)
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"devDependencies": {
"@types/eslint": "^8.44.2",
"@types/node": "^18.17.9",
"@types/js-yaml": "^4.0.8",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.4.1",
Expand All @@ -38,6 +39,7 @@
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-unused-imports": "^3.0.0",
"js-yaml": "^4.1.0",
"prettier": "^2.0.5",
"release-it": "^16.1.3",
"@release-it/conventional-changelog": "^7.0.1"
Expand Down
1 change: 1 addition & 0 deletions packages/@iris/rtc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export * from './generate/IAgoraRtcEngine';
export * from './generate/IAgoraRtcEngineEx';
export * from './generate/IAgoraSpatialAudio';
export * from './generate/IAudioDeviceManager';
export const NATIVE_RTC_VERSION = '4.2.3';
3 changes: 2 additions & 1 deletion packages/@iris/rtc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
},
"dependencies": {
"iris-web-core": "workspace:*"
}
},
"nativeSdkVersion": "4.2.3"
}
4 changes: 2 additions & 2 deletions packages/fake/rtc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iris-web-rtc-fake",
"version": "0.1.2-dev.4",
"version": "0.2.0-build.1",
"description": "wait",
"main": "./index.ts",
"scripts": {
Expand All @@ -13,7 +13,7 @@
"license": "MIT",
"dependencies": {
"@iris/native-rtc-binding": "workspace: *",
"agora-rtc-sdk-ng": "^4.18.2",
"agora-rtc-sdk-ng": "4.18.2",
"@agoraio-extensions/agora-rtc-sdk-ng-fake": "^1.0.6",
"iris-web-rtc": "workspace: *"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/fake/rtc/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');

const NATIVE_RTC_PKG = require('../../@iris/rtc/package.json');

const pkg = require('./package.json');

const nativeSdkVersion = NATIVE_RTC_PKG.nativeSdkVersion.replace(/\./g, '');
const webSdkVersion = pkg.dependencies['agora-rtc-sdk-ng'].replace(/\./g, '');
const environment = process.env.NODE_ENV;

config = {
Expand All @@ -15,7 +19,7 @@ config = {
output: {
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'umd',
filename: `${pkg.name}_${pkg.version}.js`,
filename: `${pkg.name}_n${nativeSdkVersion}_w${webSdkVersion}_${pkg.version}.js`,
environment: {
arrowFunction: false,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/rtc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iris-web-rtc",
"version": "0.1.2-dev.4",
"version": "0.2.0-build.1",
"description": "wait",
"main": "./src/index.ts",
"scripts": {
Expand All @@ -18,7 +18,7 @@
"dependencies": {
"@agoraio-extensions/agora-rtc-sdk-ng-fake": "^1.0.6",
"@iris/native-rtc-binding": "workspace: *",
"agora-rtc-sdk-ng": "^4.18.2",
"agora-rtc-sdk-ng": "4.18.2",
"iris-web-core": "workspace: *"
},
"files": [
Expand Down
6 changes: 5 additions & 1 deletion packages/rtc/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');

const NATIVE_RTC_PKG = require('../@iris/rtc/package.json');

const pkg = require('./package.json');

const nativeSdkVersion = NATIVE_RTC_PKG.nativeSdkVersion.replace(/\./g, '');
const webSdkVersion = pkg.dependencies['agora-rtc-sdk-ng'].replace(/\./g, '');
const environment = process.env.NODE_ENV;

config = {
entry: './src/index.ts',
output: {
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'umd',
filename: `${pkg.name}_${pkg.version}.js`,
filename: `${pkg.name}_n${nativeSdkVersion}_w${webSdkVersion}_${pkg.version}.js`,
environment: {
arrowFunction: false,
},
Expand Down
14 changes: 12 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions scripts/export-types-file-generate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const fs = require('fs');
const path = require('path');

const yaml = require('js-yaml');

const args = process.argv.slice(2);
const generateCodePath = '/generate';

Expand All @@ -19,13 +21,32 @@ if (args.length < 1 || !args[0].startsWith('output-path=')) {
const outputPath = args[0].substring(12);
console.log(outputPath);

const fileContents = fs.readFileSync(
__dirname + '/terra/config/types_configs.yaml',
'utf8'
);

const data = yaml.load(fileContents);

const typesDir = path.join(outputPath, '..', generateCodePath);
console.log(typesDir);

const typesPackageJsonPath = path.join(outputPath, '..', 'package.json');
const packageJson = JSON.parse(fs.readFileSync(typesPackageJsonPath, 'utf8'));

packageJson['nativeSdkVersion'] = data['version'];

fs.writeFileSync(
typesPackageJsonPath,
JSON.stringify(packageJson, null, 2) + '\n'
);

fs.readdir(typesDir, (err, files) => {
files = files.map((file) => {
file = file.replace('.ts', '');
return `export * from '.${generateCodePath}/${file}';`;
});
files.push(`export const NATIVE_RTC_VERSION = '${data['version']}';`);
files = files.join('\n') + '\n';
fs.writeFile(outputPath, files, (err) => {});
});
2 changes: 2 additions & 0 deletions scripts/terra/config/types_configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ parsers:

renderers:
- path: ../index.ts

version: 4.2.3

0 comments on commit edbb123

Please sign in to comment.