enefel 1.2.3 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npmrc-example +8 -0
- package/dist/index.js +6 -1
- package/dist/package-lock.json +2 -2
- package/dist/package.json +1 -1
- package/index.ts +2 -0
- package/npm-login.sh +46 -0
- package/npm-publish.sh +101 -0
- package/package.json +1 -1
package/.npmrc-example
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Exemple de fichier .npmrc avec un token d'authentification persistant
|
|
2
|
+
# Copiez ce fichier dans ~/.npmrc ou créez-le avec npm login --auth-type=legacy
|
|
3
|
+
|
|
4
|
+
# Configuration pour rester connecté
|
|
5
|
+
//registry.npmjs.org/:_authToken=VOTRE_TOKEN_ICI
|
|
6
|
+
|
|
7
|
+
# Pour éviter de toujours demander l'authentification à deux facteurs
|
|
8
|
+
npm_config_otp=""
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TAKE_BALL_TYPE = exports.swapArrayLocs = exports.POSTULATION_HOURS = exports.PLAYER_STAT = exports.PLAYER_HISTORY_TYPE = exports.PLAYER_HISTORY_INFO = exports.p = exports.MAX_PLAYER_USER = exports.MAX_PLAYER_TEAM = exports.LAST_SEASON_ALPHA = exports.isSquareValidToPushBack = exports.isSamePlayer = exports.isOnLine = exports.isOnField = exports.isCoach = exports.INACTIVE_DAYS = exports.haveSameTeam = exports.getThrowingBonus = exports.getTeamXP = exports.getTeamMoralByPlayer = exports.getTeamMoral = exports.getPlayerOnCell = exports.getMoralModifier = exports.getMaxPlayers = exports.getInactiveDays = exports.getHypnoticGazeMalus = exports.getDicesBlock = exports.getDefenderStrength = exports.getBlockAssistance = exports.getBestInterceptor = exports.getAttackerStrength = exports.GAME_HISTORY_TYPE = exports.GAME_HISTORY_INFO = exports.FORMATION_DEFAULT_NAME = exports.canPlayerIntercepts = exports.availableSquaresToPushBack = exports.arrayMove = void 0;
|
|
6
|
+
exports.version = exports.TAKE_BALL_TYPE = exports.swapArrayLocs = exports.POSTULATION_HOURS = exports.PLAYER_STAT = exports.PLAYER_HISTORY_TYPE = exports.PLAYER_HISTORY_INFO = exports.p = exports.MAX_PLAYER_USER = exports.MAX_PLAYER_TEAM = exports.LAST_SEASON_ALPHA = exports.isSquareValidToPushBack = exports.isSamePlayer = exports.isOnLine = exports.isOnField = exports.isCoach = exports.INACTIVE_DAYS = exports.haveSameTeam = exports.getThrowingBonus = exports.getTeamXP = exports.getTeamMoralByPlayer = exports.getTeamMoral = exports.getPlayerOnCell = exports.getMoralModifier = exports.getMaxPlayers = exports.getInactiveDays = exports.getHypnoticGazeMalus = exports.getDicesBlock = exports.getDefenderStrength = exports.getBlockAssistance = exports.getBestInterceptor = exports.getAttackerStrength = exports.GAME_HISTORY_TYPE = exports.GAME_HISTORY_INFO = exports.FORMATION_DEFAULT_NAME = exports.canPlayerIntercepts = exports.availableSquaresToPushBack = exports.arrayMove = void 0;
|
|
4
7
|
exports.addSeconds = addSeconds;
|
|
5
8
|
exports.canBlock = canBlock;
|
|
6
9
|
exports.canEndTurn = canEndTurn;
|
|
@@ -23,6 +26,8 @@ const position_1 = require("./position");
|
|
|
23
26
|
const race_1 = require("./race");
|
|
24
27
|
const skill_1 = require("./skill");
|
|
25
28
|
const status_1 = require("./status");
|
|
29
|
+
const version_1 = __importDefault(require("./version"));
|
|
30
|
+
exports.version = version_1.default;
|
|
26
31
|
const POSTULATION_HOURS = 24;
|
|
27
32
|
exports.POSTULATION_HOURS = POSTULATION_HOURS;
|
|
28
33
|
const INACTIVE_DAYS = 10;
|
package/dist/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "enefel",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "enefel",
|
|
9
|
-
"version": "1.2.
|
|
9
|
+
"version": "1.2.8",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"seedrandom": "3.0.5",
|
package/dist/package.json
CHANGED
package/index.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
hasStatusStanding,
|
|
20
20
|
hasStatusTacleZone,
|
|
21
21
|
} from "./status";
|
|
22
|
+
import version from "./version";
|
|
22
23
|
|
|
23
24
|
const POSTULATION_HOURS = 24;
|
|
24
25
|
const INACTIVE_DAYS = 10;
|
|
@@ -1022,4 +1023,5 @@ export {
|
|
|
1022
1023
|
POSTULATION_HOURS,
|
|
1023
1024
|
swapArrayLocs,
|
|
1024
1025
|
TAKE_BALL_TYPE,
|
|
1026
|
+
version,
|
|
1025
1027
|
};
|
package/npm-login.sh
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Script pour se connecter à npm et stocker un token d'authentification persistant
|
|
4
|
+
|
|
5
|
+
# Couleurs pour les messages
|
|
6
|
+
RED='\033[0;31m'
|
|
7
|
+
GREEN='\033[0;32m'
|
|
8
|
+
BLUE='\033[0;34m'
|
|
9
|
+
NC='\033[0m' # No Color
|
|
10
|
+
|
|
11
|
+
echo -e "${BLUE}=== Configuration de l'authentification persistante pour npm ===${NC}"
|
|
12
|
+
|
|
13
|
+
# Vérifier si npm est installé
|
|
14
|
+
if ! command -v npm &> /dev/null; then
|
|
15
|
+
echo -e "${RED}npm n'est pas installé. Veuillez installer npm d'abord.${NC}"
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
# Se connecter à npm et créer un token d'authentification
|
|
20
|
+
echo -e "${BLUE}Connexion à npm...${NC}"
|
|
21
|
+
echo -e "Vous allez être invité à entrer vos identifiants npm."
|
|
22
|
+
echo -e "Ce token sera stocké dans votre ~/.npmrc et vous permettra de rester connecté."
|
|
23
|
+
|
|
24
|
+
# Utiliser le legacy auth pour une meilleure compatibilité
|
|
25
|
+
npm login --auth-type=legacy
|
|
26
|
+
|
|
27
|
+
# Vérifier si la connexion a réussi
|
|
28
|
+
if [ $? -eq 0 ]; then
|
|
29
|
+
echo -e "${GREEN}Authentification réussie !${NC}"
|
|
30
|
+
|
|
31
|
+
# Vérifier que le token est bien dans le .npmrc
|
|
32
|
+
if grep -q "authToken" ~/.npmrc; then
|
|
33
|
+
echo -e "${GREEN}Token d'authentification trouvé dans ~/.npmrc${NC}"
|
|
34
|
+
echo -e "${GREEN}Vous êtes maintenant connecté de façon persistante à npm.${NC}"
|
|
35
|
+
echo -e "${BLUE}Vous pouvez maintenant publier votre package avec 'npm publish'${NC}"
|
|
36
|
+
else
|
|
37
|
+
echo -e "${RED}Aucun token trouvé dans ~/.npmrc. La connexion peut ne pas être persistante.${NC}"
|
|
38
|
+
echo -e "${BLUE}Alternative : vous pouvez essayer de créer un token manuellement :${NC}"
|
|
39
|
+
echo -e "npm token create"
|
|
40
|
+
echo -e "Puis ajoutez-le à votre ~/.npmrc :"
|
|
41
|
+
echo -e "//registry.npmjs.org/:_authToken=VOTRE_TOKEN"
|
|
42
|
+
fi
|
|
43
|
+
else
|
|
44
|
+
echo -e "${RED}La connexion a échoué.${NC}"
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
package/npm-publish.sh
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Script pour publier un package npm avec une authentification persistante
|
|
4
|
+
|
|
5
|
+
# Couleurs pour les messages
|
|
6
|
+
RED='\033[0;31m'
|
|
7
|
+
GREEN='\033[0;32m'
|
|
8
|
+
BLUE='\033[0;34m'
|
|
9
|
+
YELLOW='\033[0;33m'
|
|
10
|
+
NC='\033[0m' # No Color
|
|
11
|
+
|
|
12
|
+
echo -e "${BLUE}=== Publication du package npm ===${NC}"
|
|
13
|
+
|
|
14
|
+
# Vérifier si npm est installé
|
|
15
|
+
if ! command -v npm &> /dev/null; then
|
|
16
|
+
echo -e "${RED}npm n'est pas installé. Veuillez installer npm d'abord.${NC}"
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
# Vérifier si l'utilisateur est connecté
|
|
21
|
+
if ! npm whoami &> /dev/null; then
|
|
22
|
+
echo -e "${YELLOW}Vous n'êtes pas connecté à npm.${NC}"
|
|
23
|
+
echo -e "${YELLOW}Exécution du script de connexion...${NC}"
|
|
24
|
+
|
|
25
|
+
# Exécuter le script de connexion
|
|
26
|
+
./npm-login.sh
|
|
27
|
+
|
|
28
|
+
# Vérifier si la connexion a réussi
|
|
29
|
+
if [ $? -ne 0 ]; then
|
|
30
|
+
echo -e "${RED}La connexion a échoué. Impossible de publier le package.${NC}"
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
else
|
|
34
|
+
echo -e "${GREEN}Vous êtes connecté à npm en tant que $(npm whoami)${NC}"
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Demander s'il faut incrémenter la version
|
|
38
|
+
echo -e "${BLUE}Souhaitez-vous incrémenter la version avant de publier ?${NC}"
|
|
39
|
+
echo -e "1) Patch (x.y.Z) - pour les corrections de bugs"
|
|
40
|
+
echo -e "2) Minor (x.Y.0) - pour les nouvelles fonctionnalités rétrocompatibles"
|
|
41
|
+
echo -e "3) Major (X.0.0) - pour les changements incompatibles"
|
|
42
|
+
echo -e "4) Ne pas incrémenter la version"
|
|
43
|
+
read -p "Votre choix (1-4): " version_choice
|
|
44
|
+
|
|
45
|
+
case $version_choice in
|
|
46
|
+
1)
|
|
47
|
+
echo -e "${BLUE}Incrémentation de la version (patch)...${NC}"
|
|
48
|
+
npm version patch
|
|
49
|
+
;;
|
|
50
|
+
2)
|
|
51
|
+
echo -e "${BLUE}Incrémentation de la version (minor)...${NC}"
|
|
52
|
+
npm version minor
|
|
53
|
+
;;
|
|
54
|
+
3)
|
|
55
|
+
echo -e "${BLUE}Incrémentation de la version (major)...${NC}"
|
|
56
|
+
npm version major
|
|
57
|
+
;;
|
|
58
|
+
4)
|
|
59
|
+
echo -e "${YELLOW}La version ne sera pas incrémentée.${NC}"
|
|
60
|
+
;;
|
|
61
|
+
*)
|
|
62
|
+
echo -e "${YELLOW}Choix non valide. La version ne sera pas incrémentée.${NC}"
|
|
63
|
+
;;
|
|
64
|
+
esac
|
|
65
|
+
|
|
66
|
+
# Construire le package
|
|
67
|
+
echo -e "${BLUE}Construction du package...${NC}"
|
|
68
|
+
npm run build
|
|
69
|
+
|
|
70
|
+
# Proposer un dry-run
|
|
71
|
+
echo -e "${BLUE}Souhaitez-vous effectuer une simulation de publication (dry-run) avant de publier ?${NC}"
|
|
72
|
+
read -p "Simuler la publication (o/n): " dry_run
|
|
73
|
+
|
|
74
|
+
if [[ $dry_run == "o" || $dry_run == "O" || $dry_run == "oui" || $dry_run == "Oui" ]]; then
|
|
75
|
+
echo -e "${BLUE}Simulation de publication...${NC}"
|
|
76
|
+
npm publish --dry-run
|
|
77
|
+
|
|
78
|
+
echo -e "${BLUE}Voulez-vous continuer avec la publication réelle ?${NC}"
|
|
79
|
+
read -p "Publier (o/n): " confirm_publish
|
|
80
|
+
|
|
81
|
+
if [[ $confirm_publish != "o" && $confirm_publish != "O" && $confirm_publish != "oui" && $confirm_publish != "Oui" ]]; then
|
|
82
|
+
echo -e "${YELLOW}Publication annulée.${NC}"
|
|
83
|
+
exit 0
|
|
84
|
+
fi
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
# Publier le package
|
|
88
|
+
echo -e "${BLUE}Publication du package...${NC}"
|
|
89
|
+
npm publish
|
|
90
|
+
|
|
91
|
+
# Vérifier si la publication a réussi
|
|
92
|
+
if [ $? -eq 0 ]; then
|
|
93
|
+
echo -e "${GREEN}Package publié avec succès !${NC}"
|
|
94
|
+
|
|
95
|
+
# Afficher les informations sur le package
|
|
96
|
+
echo -e "${BLUE}Informations sur le package :${NC}"
|
|
97
|
+
npm view
|
|
98
|
+
else
|
|
99
|
+
echo -e "${RED}La publication a échoué.${NC}"
|
|
100
|
+
exit 1
|
|
101
|
+
fi
|