Skip to content

Commit

Permalink
ov-components: Added v2compatibility suffix to library and webcomponent
Browse files Browse the repository at this point in the history
  • Loading branch information
CSantosM committed Jun 21, 2024
1 parent dc759df commit 6698ae2
Show file tree
Hide file tree
Showing 6 changed files with 2,178 additions and 3,024 deletions.
8 changes: 4 additions & 4 deletions openvidu-components-angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ openvidu-components-angular
└───projects
└─── openvidu-angular
└─── openvidu-angular-v2compatibility
```

## How to develop with ease:

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

For generate new components in openvidu-angular:
For generate new components in openvidu-angular-v2compatibility:

```bash
ng g component components/component-name --project=openvidu-angular
ng g component components/component-name --project=openvidu-angular-v2compatibility
```


Expand Down
13 changes: 7 additions & 6 deletions openvidu-components-angular/openvidu-webcomponent-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const concat = require('concat');
const VERSION = require('./package.json').version;
const ovWebcomponentRCPath = './dist/openvidu-webcomponent-rc';
const ovWebcomponentProdPath = './dist/openvidu-webcomponent';
const bundleName = 'openvidu-webcomponent-v2compatibility-' + VERSION;

module.exports.buildWebcomponent = async () => {
console.log('Building OpenVidu Web Component (' + VERSION + ')');
Expand All @@ -16,7 +17,7 @@ module.exports.buildWebcomponent = async () => {
await copyFiles(e2eWcPath);
await renameWebComponentTestName(e2eWcPath);

console.log(`OpenVidu Web Component (${VERSION}) built`);
console.log(`OpenVidu Web Component V2 Compatibility (${VERSION}) built`);
} catch (error) {
console.error(error);
}
Expand All @@ -27,21 +28,21 @@ async function buildElement() {

try {
await fs.ensureDir('./dist/openvidu-webcomponent');
await concat(files, `${ovWebcomponentProdPath}/openvidu-webcomponent-${VERSION}.js`);
await fs.copy(`${ovWebcomponentRCPath}/styles.css`, `${ovWebcomponentProdPath}/openvidu-webcomponent-${VERSION}.css`);
await concat(files, `${ovWebcomponentProdPath}/${bundleName}.js`);
await fs.copy(`${ovWebcomponentRCPath}/styles.css`, `${ovWebcomponentProdPath}/${bundleName}.css`);
// await fs.copy(
// "./dist/openvidu-webcomponent/assets",
// "./openvidu-webcomponent/assets"
// );
} 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;
}
}

function renameWebComponentTestName(dir) {
fs.renameSync(`${dir}/openvidu-webcomponent-${VERSION}.js`, `${dir}/openvidu-webcomponent-dev.js`);
fs.renameSync(`${dir}/openvidu-webcomponent-${VERSION}.css`, `${dir}/openvidu-webcomponent-dev.css`);
fs.renameSync(`${dir}/${bundleName}.js`, `${dir}/openvidu-webcomponent-dev.js`);
fs.renameSync(`${dir}/${bundleName}.css`, `${dir}/openvidu-webcomponent-dev.css`);
}

async function copyFiles(destination) {
Expand Down
Loading

0 comments on commit 6698ae2

Please sign in to comment.