ov-components: Added v2compatibility suffix to library and webcomponent

pull/821/merge
Carlos Santos 2024-06-21 11:20:34 +02:00
parent dc759dffd4
commit 6698ae2314
6 changed files with 1309 additions and 2155 deletions

View File

@ -10,21 +10,21 @@ openvidu-components-angular
└───projects └───projects
└─── openvidu-angular └─── openvidu-angular-v2compatibility
``` ```
## How to develop with ease: ## How to develop with ease:
Run `ng serve` for a dev server. Run `ng serve` for a dev server.
Run, in a new terminal, `npm run lib:serve` for serving the openvidu-angular library with live reload for listening changes Run, in a new terminal, `npm run lib:serve` for serving the openvidu-angular-v2compatibility library with live reload for listening changes
## Code scaffolding ## Code scaffolding
For generate new components in openvidu-angular: For generate new components in openvidu-angular-v2compatibility:
```bash ```bash
ng g component components/component-name --project=openvidu-angular ng g component components/component-name --project=openvidu-angular-v2compatibility
``` ```

View File

@ -3,6 +3,7 @@ const concat = require('concat');
const VERSION = require('./package.json').version; const VERSION = require('./package.json').version;
const ovWebcomponentRCPath = './dist/openvidu-webcomponent-rc'; const ovWebcomponentRCPath = './dist/openvidu-webcomponent-rc';
const ovWebcomponentProdPath = './dist/openvidu-webcomponent'; const ovWebcomponentProdPath = './dist/openvidu-webcomponent';
const bundleName = 'openvidu-webcomponent-v2compatibility-' + VERSION;
module.exports.buildWebcomponent = async () => { module.exports.buildWebcomponent = async () => {
console.log('Building OpenVidu Web Component (' + VERSION + ')'); console.log('Building OpenVidu Web Component (' + VERSION + ')');
@ -16,7 +17,7 @@ module.exports.buildWebcomponent = async () => {
await copyFiles(e2eWcPath); await copyFiles(e2eWcPath);
await renameWebComponentTestName(e2eWcPath); await renameWebComponentTestName(e2eWcPath);
console.log(`OpenVidu Web Component (${VERSION}) built`); console.log(`OpenVidu Web Component V2 Compatibility (${VERSION}) built`);
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }
@ -27,21 +28,21 @@ async function buildElement() {
try { try {
await fs.ensureDir('./dist/openvidu-webcomponent'); await fs.ensureDir('./dist/openvidu-webcomponent');
await concat(files, `${ovWebcomponentProdPath}/openvidu-webcomponent-${VERSION}.js`); await concat(files, `${ovWebcomponentProdPath}/${bundleName}.js`);
await fs.copy(`${ovWebcomponentRCPath}/styles.css`, `${ovWebcomponentProdPath}/openvidu-webcomponent-${VERSION}.css`); await fs.copy(`${ovWebcomponentRCPath}/styles.css`, `${ovWebcomponentProdPath}/${bundleName}.css`);
// await fs.copy( // await fs.copy(
// "./dist/openvidu-webcomponent/assets", // "./dist/openvidu-webcomponent/assets",
// "./openvidu-webcomponent/assets" // "./openvidu-webcomponent/assets"
// ); // );
} catch (err) { } catch (err) {
console.error('Error executing build function in webcomponent-builds.js'); console.error('Error executing buildElement function in openvidu-webcomponent-builds.js');
throw err; throw err;
} }
} }
function renameWebComponentTestName(dir) { function renameWebComponentTestName(dir) {
fs.renameSync(`${dir}/openvidu-webcomponent-${VERSION}.js`, `${dir}/openvidu-webcomponent-dev.js`); fs.renameSync(`${dir}/${bundleName}.js`, `${dir}/openvidu-webcomponent-dev.js`);
fs.renameSync(`${dir}/openvidu-webcomponent-${VERSION}.css`, `${dir}/openvidu-webcomponent-dev.css`); fs.renameSync(`${dir}/${bundleName}.css`, `${dir}/openvidu-webcomponent-dev.css`);
} }
async function copyFiles(destination) { async function copyFiles(destination) {

File diff suppressed because it is too large Load Diff

View File

@ -78,5 +78,5 @@
"webcomponent:e2e-pro-ci": "cross-env LAUNCH_MODE=CI npm run webcomponent:e2e-pro", "webcomponent:e2e-pro-ci": "cross-env LAUNCH_MODE=CI npm run webcomponent:e2e-pro",
"webcomponent:serve-testapp": "npx http-server ./e2e/webcomponent-app/ && echo http://localhost:8080/?OV_URL=https://localhost:4443&OV_SECRET=MY_SECRET&prejoin=false" "webcomponent:serve-testapp": "npx http-server ./e2e/webcomponent-app/ && echo http://localhost:8080/?OV_URL=https://localhost:4443&OV_SECRET=MY_SECRET&prejoin=false"
}, },
"version": "2.30.0" "version": "3.0.0-beta1"
} }

View File

@ -1,12 +1,12 @@
# openvidu-angular # openvidu-angular-v2compatibility
OpenVidu Components for Angular. OpenVidu Components for Angular.
[![License badge](https://img.shields.io/badge/license-Apache2-orange.svg)](http://www.apache.org/licenses/LICENSE-2.0) [![License badge](https://img.shields.io/badge/license-Apache2-orange.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![OpenVidu Tests](https://github.com/OpenVidu/openvidu/actions/workflows/openvidu-ce-test.yml/badge.svg)](https://github.com/OpenVidu/openvidu/actions/workflows/openvidu-ce-test.yml) [![OpenVidu Tests](https://github.com/OpenVidu/openvidu/actions/workflows/openvidu-ce-test.yml/badge.svg)](https://github.com/OpenVidu/openvidu/actions/workflows/openvidu-ce-test.yml)
[![OpenVidu Tests](https://github.com/OpenVidu/openvidu/actions/workflows/openvidu-components-angular-E2E.yml/badge.svg)](https://github.com/OpenVidu/openvidu/actions/workflows/openvidu-components-angular-E2E.yml) [![OpenVidu Tests](https://github.com/OpenVidu/openvidu/actions/workflows/openvidu-components-angular-E2E.yml/badge.svg)](https://github.com/OpenVidu/openvidu/actions/workflows/openvidu-components-angular-E2E.yml)
[![Npm version](https://img.shields.io/npm/v/openvidu-angular?label=npm-version)](https://npmjs.org/package/openvidu-angular) [![Npm version](https://img.shields.io/npm/v/openvidu-angular-v2compatibility?label=npm-version)](https://npmjs.org/package/openvidu-angular-v2compatibility)
[![Npm downloads](https://img.shields.io/npm/dw/openvidu-angular?label=npm2-downloads)](https://npmjs.org/package/openvidu-angular) [![Npm downloads](https://img.shields.io/npm/dw/openvidu-angular-v2compatibility?label=npm2-downloads)](https://npmjs.org/package/openvidu-angular-v2compatibility)
**The easier way to build powerful OpenVidu videoconference frontend applications.** **The easier way to build powerful OpenVidu videoconference frontend applications.**
@ -21,10 +21,10 @@ ng v
## How to install it ## How to install it
1. You need to install the openvidu-angular library in your Angular application: 1. You need to install the openvidu-angular-v2compatibility library in your Angular application:
``` ```
npm install openvidu-angular npm install openvidu-angular-v2compatibility
``` ```
<br> <br>
@ -33,10 +33,10 @@ npm install openvidu-angular
## Configure it ## Configure it
You need to import the openvidu-angular module in your `app.module.ts`: You need to import the openvidu-angular-v2compatibility module in your `app.module.ts`:
```typescript ```typescript
import { OpenViduAngularConfig, OpenViduAngularModule } from 'openvidu-angular'; import { OpenViduAngularConfig, OpenViduAngularModule } from 'openvidu-angular-v2compatibility';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
const config: OpenViduAngularConfig = { const config: OpenViduAngularConfig = {
@ -80,6 +80,6 @@ You can also add the default styles in your `styles.scss` file:
OpenVidu team has created a few tutorials to help you to start using OpenVidu Angular components. You can find them [here](https://docs.openvidu.io/en/stable/components/#where-to-start). OpenVidu team has created a few tutorials to help you to start using OpenVidu Angular components. You can find them [here](https://docs.openvidu.io/en/stable/components/#where-to-start).
## openvidu-angular API ## openvidu-angular-v2compatibility API
openvidu-angular API documentation is available [here](https://docs.openvidu.io/en/stable/api/openvidu-angular/). openvidu-angular-v2compatibility API documentation is available [here](https://docs.openvidu.io/en/stable/api/openvidu-angular-v2compatibility/).

View File

@ -2,7 +2,7 @@
"dependencies": { "dependencies": {
"tslib": "^2.3.0" "tslib": "^2.3.0"
}, },
"name": "openvidu-angular", "name": "openvidu-angular-v2compatibility",
"peerDependencies": { "peerDependencies": {
"@angular/animations": "^16.0.0 || ^17.0.0", "@angular/animations": "^16.0.0 || ^17.0.0",
"@angular/common": "^16.0.0 || ^17.0.0", "@angular/common": "^16.0.0 || ^17.0.0",
@ -12,7 +12,7 @@
"@angular/material": "^16.0.0 || ^17.0.0", "@angular/material": "^16.0.0 || ^17.0.0",
"autolinker": "^4.0.0", "autolinker": "^4.0.0",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"openvidu-browser": "2.30.0" "openvidu-browser-v2compatibility": "3.0.0-beta1"
}, },
"version": "2.30.0" "version": "3.0.0-beta1"
} }