up angular-basic with lib setup
This commit is contained in:
		
							parent
							
								
									b9f3e4769e
								
							
						
					
					
						commit
						4d3a3d34b8
					
				
					 147 changed files with 15408 additions and 16030 deletions
				
			
		
							
								
								
									
										53
									
								
								angular-basic/setup.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										53
									
								
								angular-basic/setup.sh
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,53 @@ | |||
| #!/bin/bash | ||||
| set -euo pipefail | ||||
| echo "============= setup script" | ||||
| 
 | ||||
| node --version | ||||
| npm version | ||||
| 
 | ||||
| # Déterminer les chemins | ||||
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||||
| APP_DIR="$SCRIPT_DIR" | ||||
| 
 | ||||
| # Supporter deux structures: | ||||
| # 1) `angular-basic/my-workspace/projects/sae-lib` (quand le contexte de build est le dossier angular-basic) | ||||
| # 2) `../my-workspace/projects/sae-lib` (quand on copie my-workspace à côté d'angular-basic dans /app) | ||||
| LIB_DIR_CANDIDATES=( | ||||
|   "$APP_DIR/my-workspace/projects/sae-lib" | ||||
|   "$APP_DIR/../my-workspace/projects/sae-lib" | ||||
| ) | ||||
| 
 | ||||
| LIB_DIR="" | ||||
| for d in "${LIB_DIR_CANDIDATES[@]}"; do | ||||
|   if [ -d "$d" ]; then | ||||
|     LIB_DIR="$d" | ||||
|     break | ||||
|     fi | ||||
| done | ||||
| 
 | ||||
| if [ -z "$LIB_DIR" ]; then | ||||
|   echo "Erreur: impossible de localiser le dossier de la librairie sae-lib." >&2 | ||||
|   echo "Cherché dans: ${LIB_DIR_CANDIDATES[*]}" >&2 | ||||
|     exit 1 | ||||
| fi | ||||
| 
 | ||||
| echo "Préparation de sae-lib (pack) depuis: $LIB_DIR" | ||||
| mkdir ./node_modules/sae-lib -p | ||||
| cp -r $LIB_DIR ./node_modules/sae-lib | ||||
| #cd "$LIB_DIR" | ||||
| ## Créer un paquet tarball local sans toucher au prefix global | ||||
| #TARBALL_NAME=$(npm pack --silent) | ||||
| #TARBALL_PATH="$LIB_DIR/$TARBALL_NAME" | ||||
| #echo "Tarball créé: $TARBALL_PATH" | ||||
| 
 | ||||
| cd "$APP_DIR" | ||||
| echo "Installation des dépendances de l'app..." | ||||
| npm install --legacy-peer-deps | ||||
| #echo "Installation de sae-lib depuis le tarball local..." | ||||
| #npm install --legacy-peer-deps "$TARBALL_PATH" | ||||
| 
 | ||||
| # Installer les peerDependencies nécessaires à sae-lib (si absents) | ||||
| #echo "Installation des peer deps de sae-lib (remixicon, bulma, shepherd.js) ..." | ||||
| npm install --legacy-peer-deps remixicon bulma shepherd.js | ||||
| 
 | ||||
| echo "============= setup script done" | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Tykayn
						Tykayn