update import paths and enhance development commands for shared-meet-components

This commit is contained in:
Carlos Santos 2025-10-20 13:44:20 +02:00
parent 45ef1f53b1
commit 2f5bc8b2ee
3 changed files with 31 additions and 16 deletions

View File

@ -1,13 +1,17 @@
import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper'; import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
import { provideHttpClient, withInterceptors } from '@angular/common/http'; import { provideHttpClient, withInterceptors } from '@angular/common/http';
import { ApplicationConfig, importProvidersFrom, provideZoneChangeDetection, inject, provideAppInitializer } from '@angular/core'; import {
ApplicationConfig,
importProvidersFrom,
provideZoneChangeDetection,
inject,
provideAppInitializer
} from '@angular/core';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { provideRouter } from '@angular/router'; import { provideRouter } from '@angular/router';
import { routes } from '@app/app.routes'; import { routes } from '@app/app.routes';
import { environment } from '@environment/environment'; import { environment } from '@environment/environment';
import { httpInterceptor } from '@openvidu-meet/shared/interceptors'; import { CustomParticipantModel, httpInterceptor, ThemeService } from '@openvidu-meet/shared-components';
import { CustomParticipantModel } from '@openvidu-meet/shared/models';
import { ThemeService } from '@openvidu-meet/shared/services';
import { OpenViduComponentsConfig, OpenViduComponentsModule, ParticipantProperties } from 'openvidu-components-angular'; import { OpenViduComponentsConfig, OpenViduComponentsModule, ParticipantProperties } from 'openvidu-components-angular';
const ovComponentsconfig: OpenViduComponentsConfig = { const ovComponentsconfig: OpenViduComponentsConfig = {
@ -18,9 +22,12 @@ const ovComponentsconfig: OpenViduComponentsConfig = {
export const appConfig: ApplicationConfig = { export const appConfig: ApplicationConfig = {
providers: [ providers: [
provideAppInitializer(() => { provideAppInitializer(() => {
const initializerFn = ((themeService: ThemeService) => () => themeService.initializeTheme())(inject(ThemeService)); const initializerFn = (
return initializerFn(); (themeService: ThemeService) => () =>
}), themeService.initializeTheme()
)(inject(ThemeService));
return initializerFn();
}),
importProvidersFrom(OpenViduComponentsModule.forRoot(ovComponentsconfig)), importProvidersFrom(OpenViduComponentsModule.forRoot(ovComponentsconfig)),
provideZoneChangeDetection({ eventCoalescing: true }), provideZoneChangeDetection({ eventCoalescing: true }),
provideRouter(routes), provideRouter(routes),

View File

@ -1,4 +1,4 @@
import { Routes } from '@angular/router'; import { Routes } from '@angular/router';
import { baseRoutes } from '@openvidu-meet/shared/routes/base-routes'; import { baseRoutes } from '@openvidu-meet/shared-components';
export const routes: Routes = baseRoutes; export const routes: Routes = baseRoutes;

24
meet.sh
View File

@ -357,8 +357,6 @@ select_edition() {
# Helper: Add common commands (components, typings, docs) # Helper: Add common commands (components, typings, docs)
add_common_dev_commands() { add_common_dev_commands() {
local components_path="$1"
# Components watcher # Components watcher
CMD_NAMES+=("components") CMD_NAMES+=("components")
CMD_COLORS+=("red") CMD_COLORS+=("red")
@ -368,21 +366,27 @@ add_common_dev_commands() {
CMD_NAMES+=("typings") CMD_NAMES+=("typings")
CMD_COLORS+=("green") CMD_COLORS+=("green")
CMD_COMMANDS+=("./scripts/dev/watch-typings.sh") CMD_COMMANDS+=("./scripts/dev/watch-typings.sh")
# shared-meet-components watcher
CMD_NAMES+=("shared-meet-components")
CMD_COLORS+=("yellow")
CMD_COMMANDS+=("pnpm --filter @openvidu-meet/frontend run lib:serve")
} }
# Helper: Add CE-specific commands (backend, frontend) # Helper: Add CE-specific commands (backend, frontend)
add_ce_commands() { add_ce_commands() {
local components_path="$1" local components_path="$1"
local shared_meet_components_path="$2"
# Run backend # Run backend
CMD_NAMES+=("backend") CMD_NAMES+=("backend")
CMD_COLORS+=("cyan") CMD_COLORS+=("cyan")
CMD_COMMANDS+=("node ./scripts/dev/watch-with-typings-guard.mjs 'pnpm run dev:backend'") CMD_COMMANDS+=("node ./scripts/dev/watch-with-typings-guard.mjs 'pnpm run dev:backend'")
# Run frontend after components are ready # Run frontend after components-angular and shared-meet-components are ready
CMD_NAMES+=("frontend") CMD_NAMES+=("frontend")
CMD_COLORS+=("magenta") CMD_COLORS+=("magenta")
CMD_COMMANDS+=("wait-on ${components_path} && sleep 1 && node ./scripts/dev/watch-with-typings-guard.mjs 'pnpm run dev:frontend'") CMD_COMMANDS+=("wait-on ${components_path} && wait-on ${shared_meet_components_path} && sleep 1 && node ./scripts/dev/watch-with-typings-guard.mjs 'pnpm run dev:frontend'")
} }
# Helper: Add PRO-specific commands (backend-pro, backend-ce-watch, frontend-pro) # Helper: Add PRO-specific commands (backend-pro, backend-ce-watch, frontend-pro)
@ -459,9 +463,12 @@ launch_dev_watchers() {
echo -e "${BLUE}Processes: ${#CMD_NAMES[@]}${NC}" echo -e "${BLUE}Processes: ${#CMD_NAMES[@]}${NC}"
echo echo
# Clean up components package.json to ensure fresh install # Clean up components package.json to ensure wait-on works
rm -rf "${components_path}" rm -rf "${components_path}"
# Clean up shared-meet-components package.json to ensure wait-on works
rm -rf "${shared_meet_components_path}"
# Build concurrently arguments from arrays # Build concurrently arguments from arrays
local names_arg=$(IFS=,; echo "${CMD_NAMES[*]}") local names_arg=$(IFS=,; echo "${CMD_NAMES[*]}")
local colors_arg=$(IFS=,; echo "${CMD_COLORS[*]}") local colors_arg=$(IFS=,; echo "${CMD_COLORS[*]}")
@ -489,6 +496,7 @@ dev() {
# Define paths # Define paths
local components_path="../openvidu/openvidu-components-angular/dist/openvidu-components-angular/package.json" local components_path="../openvidu/openvidu-components-angular/dist/openvidu-components-angular/package.json"
local shared_meet_components_path="meet-ce/frontend/projects/shared-meet-components/dist/package.json"
local browsersync_path local browsersync_path
# Initialize command arrays # Initialize command arrays
@ -496,8 +504,8 @@ dev() {
CMD_COLORS=() CMD_COLORS=()
CMD_COMMANDS=() CMD_COMMANDS=()
# Add common commands (components, typings) # Add common commands (components-angular, typings, shared-meet-components)
add_common_dev_commands "$components_path" add_common_dev_commands
# Add edition-specific commands and set paths # Add edition-specific commands and set paths
if [ "$edition" = "pro" ]; then if [ "$edition" = "pro" ]; then
@ -505,7 +513,7 @@ dev() {
add_pro_commands "$components_path" add_pro_commands "$components_path"
else else
browsersync_path="meet-ce/backend/public/**/*" browsersync_path="meet-ce/backend/public/**/*"
add_ce_commands "$components_path" add_ce_commands "$components_path" "$shared_meet_components_path"
fi fi
# Add docs and browser-sync commands # Add docs and browser-sync commands