addio-ecomm-sdk 1.3.77 → 1.3.78

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.
Files changed (106) hide show
  1. package/.vscode/settings.json +34 -34
  2. package/README.md +79 -79
  3. package/dist/index.d.ts +203 -203
  4. package/dist/index.js +1237 -1237
  5. package/dist/lib/constants/components/CreditCardInput.d.ts +11 -11
  6. package/dist/lib/constants/components/CreditCardInput.js +65 -65
  7. package/dist/lib/constants/components/Snackbar.d.ts +11 -11
  8. package/dist/lib/constants/components/Snackbar.js +29 -29
  9. package/dist/lib/constants/contexts/CartContext/CartContextProvider.d.ts +7 -7
  10. package/dist/lib/constants/contexts/CartContext/CartContextProvider.js +640 -640
  11. package/dist/lib/constants/contexts/CartContext/index.d.ts +79 -79
  12. package/dist/lib/constants/contexts/CartContext/index.js +47 -47
  13. package/dist/lib/constants/contexts/DataContext/DataContextProvider.d.ts +15 -15
  14. package/dist/lib/constants/contexts/DataContext/DataContextProvider.js +173 -173
  15. package/dist/lib/constants/contexts/DataContext/index.d.ts +47 -47
  16. package/dist/lib/constants/contexts/DataContext/index.js +27 -27
  17. package/dist/lib/constants/contexts/LogContext/LogContextProvider.d.ts +6 -6
  18. package/dist/lib/constants/contexts/LogContext/LogContextProvider.js +40 -40
  19. package/dist/lib/constants/contexts/LogContext/index.d.ts +7 -7
  20. package/dist/lib/constants/contexts/LogContext/index.js +7 -7
  21. package/dist/lib/constants/contexts/ModalContext/ModalContextProvider.d.ts +7 -7
  22. package/dist/lib/constants/contexts/ModalContext/ModalContextProvider.js +61 -61
  23. package/dist/lib/constants/contexts/ModalContext/index.d.ts +14 -14
  24. package/dist/lib/constants/contexts/ModalContext/index.js +16 -16
  25. package/dist/lib/constants/contexts/SDKContext/SDKProvider.d.ts +8 -8
  26. package/dist/lib/constants/contexts/SDKContext/SDKProvider.js +23 -23
  27. package/dist/lib/constants/contexts/SDKContext/index.d.ts +4 -4
  28. package/dist/lib/constants/contexts/SDKContext/index.js +4 -4
  29. package/dist/lib/constants/contexts/SnackbarContext/SnackbarContext.d.ts +4 -4
  30. package/dist/lib/constants/contexts/SnackbarContext/SnackbarContext.js +6 -6
  31. package/dist/lib/constants/contexts/SnackbarContext/SnackbarContextProvider.d.ts +12 -12
  32. package/dist/lib/constants/contexts/SnackbarContext/SnackbarContextProvider.js +38 -38
  33. package/dist/lib/constants/contexts/SnackbarContext/interfaces/ISnackbarContext.d.ts +19 -19
  34. package/dist/lib/constants/contexts/SnackbarContext/interfaces/ISnackbarContext.js +21 -21
  35. package/dist/lib/constants/contexts/StockNotifContext/StockNotifContextProvider.d.ts +7 -7
  36. package/dist/lib/constants/contexts/StockNotifContext/StockNotifContextProvider.js +112 -112
  37. package/dist/lib/constants/contexts/StockNotifContext/index.d.ts +10 -10
  38. package/dist/lib/constants/contexts/StockNotifContext/index.js +10 -10
  39. package/dist/lib/constants/contexts/UserContext/UserContextProvider.d.ts +5 -5
  40. package/dist/lib/constants/contexts/UserContext/UserContextProvider.js +313 -313
  41. package/dist/lib/constants/contexts/UserContext/index.d.ts +54 -54
  42. package/dist/lib/constants/contexts/UserContext/index.js +28 -28
  43. package/dist/lib/constants/contexts/WishlistContext/WishlistContextProvider.d.ts +6 -6
  44. package/dist/lib/constants/contexts/WishlistContext/WishlistContextProvider.js +231 -231
  45. package/dist/lib/constants/contexts/WishlistContext/index.d.ts +12 -12
  46. package/dist/lib/constants/contexts/WishlistContext/index.js +12 -12
  47. package/dist/lib/constants/hooks/useCart.d.ts +2 -2
  48. package/dist/lib/constants/hooks/useCart.js +11 -11
  49. package/dist/lib/constants/hooks/useData.d.ts +2 -2
  50. package/dist/lib/constants/hooks/useData.js +11 -11
  51. package/dist/lib/constants/hooks/useLogs.d.ts +2 -2
  52. package/dist/lib/constants/hooks/useLogs.js +11 -11
  53. package/dist/lib/constants/hooks/useModal.d.ts +2 -2
  54. package/dist/lib/constants/hooks/useModal.js +11 -11
  55. package/dist/lib/constants/hooks/useSDK.d.ts +2 -2
  56. package/dist/lib/constants/hooks/useSDK.js +11 -11
  57. package/dist/lib/constants/hooks/useSnackbar.d.ts +2 -2
  58. package/dist/lib/constants/hooks/useSnackbar.js +11 -11
  59. package/dist/lib/constants/hooks/useStockNotif.d.ts +2 -2
  60. package/dist/lib/constants/hooks/useStockNotif.js +11 -11
  61. package/dist/lib/constants/hooks/useUser.d.ts +2 -2
  62. package/dist/lib/constants/hooks/useUser.js +11 -11
  63. package/dist/lib/constants/hooks/useWishlist.d.ts +2 -2
  64. package/dist/lib/constants/hooks/useWishlist.js +11 -11
  65. package/dist/lib/models/image/index.d.ts +6 -6
  66. package/dist/lib/models/image/index.js +10 -10
  67. package/dist/lib/models/stockNotification/index.d.ts +13 -13
  68. package/dist/lib/models/stockNotification/index.js +70 -70
  69. package/dist/lib/models/wishlist/index.d.ts +14 -14
  70. package/dist/lib/models/wishlist/index.js +86 -86
  71. package/dist/utils/StripeErrors.d.ts +24 -24
  72. package/dist/utils/StripeErrors.js +55 -55
  73. package/dist/utils/algolia.d.ts +3 -3
  74. package/dist/utils/algolia.js +35 -35
  75. package/dist/utils/analytics.d.ts +71 -71
  76. package/dist/utils/analytics.js +246 -246
  77. package/dist/utils/cart.d.ts +3 -3
  78. package/dist/utils/cart.js +65 -65
  79. package/dist/utils/contentful.d.ts +10 -10
  80. package/dist/utils/contentful.js +63 -63
  81. package/dist/utils/functions.d.ts +21 -21
  82. package/dist/utils/functions.js +183 -183
  83. package/dist/utils/getSDK.d.ts +4 -4
  84. package/dist/utils/getSDK.js +19 -19
  85. package/dist/utils/initStoreData.d.ts +3 -3
  86. package/dist/utils/initStoreData.js +17 -17
  87. package/dist/utils/interfaces/IClientCMSData.d.ts +132 -132
  88. package/dist/utils/interfaces/IClientCMSData.js +2 -2
  89. package/dist/utils/interfaces/IEndpointResult.d.ts +10 -10
  90. package/dist/utils/interfaces/IEndpointResult.js +2 -2
  91. package/dist/utils/interfaces/IFacebookUserProfile.d.ts +10 -10
  92. package/dist/utils/interfaces/IFacebookUserProfile.js +2 -2
  93. package/dist/utils/interfaces/IFilter.d.ts +23 -23
  94. package/dist/utils/interfaces/IFilter.js +2 -2
  95. package/dist/utils/interfaces/IGoogleUserProfile.d.ts +7 -7
  96. package/dist/utils/interfaces/IGoogleUserProfile.js +2 -2
  97. package/dist/utils/interfaces/ISDKConfig.d.ts +7 -7
  98. package/dist/utils/interfaces/ISDKConfig.js +2 -2
  99. package/dist/utils/interfaces/ISpaceData.d.ts +18 -18
  100. package/dist/utils/interfaces/ISpaceData.js +2 -2
  101. package/dist/utils/larivieremeunier.d.ts +3 -3
  102. package/dist/utils/larivieremeunier.js +156 -156
  103. package/dist/utils/technosupply.d.ts +3 -3
  104. package/dist/utils/technosupply.js +155 -155
  105. package/package.json +61 -61
  106. package/publish.sh +132 -132
package/package.json CHANGED
@@ -1,61 +1,61 @@
1
- {
2
- "name": "addio-ecomm-sdk",
3
- "version": "1.3.77",
4
- "description": "",
5
- "main": "dist/index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1",
8
- "build": "tsc",
9
- "dev": "yarn build --watch",
10
- "update-sdk": "yarn add addio-admin-sdk && yarn build",
11
- "update-canary": "yarn add addio-admin-sdk@canary",
12
- "link-sdk": "yarn remove addio-admin-sdk && yarn add @types/js-cookie && cd ../addio-admin-sdk && yarn link && cd ../addio-ecomm-sdk && yarn link addio-admin-sdk",
13
- "unlink-sdk": "yarn unlink addio-admin-sdk && yarn remove @types/js-cookie && cd ../addio-ecomm-sdk && yarn add addio-admin-sdk",
14
- "unlink-canary": "yarn unlink addio-admin-sdk && yarn remove @types/js-cookie && cd ../addio-ecomm-sdk && yarn add addio-admin-sdk@canary",
15
- "pub": "sh publish.sh"
16
- },
17
- "author": "",
18
- "license": "ISC",
19
- "dependencies": {
20
- "@googlemaps/js-api-loader": "^1.11.3",
21
- "addio-admin-sdk": "1.7.62",
22
- "algoliasearch": "^4.13.0",
23
- "contentful": "^9.1.28",
24
- "encoding": "^0.1.13",
25
- "firebase": "^7.17.2",
26
- "google-auth-library": "^6.0.6",
27
- "isomorphic-unfetch": "^3.0.0",
28
- "js-cookie": "^3.0.1",
29
- "jsonwebtoken": "^8.5.1",
30
- "lodash": "^4.17.20",
31
- "moment": "^2.28.0",
32
- "react-gtm-module": "^2.0.11",
33
- "react-input-mask": "^2.0.4",
34
- "stripe": "^8.145.0",
35
- "use-state-promise": "^0.1.1"
36
- },
37
- "devDependencies": {
38
- "@babel/cli": "^7.10.5",
39
- "@babel/core": "^7.11.1",
40
- "@babel/plugin-proposal-class-properties": "^7.10.4",
41
- "@babel/plugin-proposal-object-rest-spread": "^7.11.0",
42
- "@babel/plugin-transform-react-jsx": "^7.10.4",
43
- "@babel/preset-env": "^7.11.0",
44
- "@babel/preset-react": "^7.10.4",
45
- "@babel/preset-typescript": "^7.10.4",
46
- "@types/bson": "^4.2.0",
47
- "@types/google.maps": "^3.45.6",
48
- "@types/jsonwebtoken": "^8.5.0",
49
- "@types/lodash": "^4.14.160",
50
- "@types/node-fetch": "^2.5.7",
51
- "@types/react": "^17.0.30",
52
- "@types/react-dom": "^17.0.9",
53
- "@types/react-gtm-module": "^2.0.1",
54
- "@types/react-input-mask": "^3.0.1",
55
- "jsdoc-babel": "^0.5.0",
56
- "jsdoc-to-markdown": "^6.0.1",
57
- "react": "^17.0.2",
58
- "react-dom": "^17.0.2",
59
- "typescript": "^4.7.4"
60
- }
61
- }
1
+ {
2
+ "name": "addio-ecomm-sdk",
3
+ "version": "1.3.78",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "build": "tsc",
9
+ "dev": "yarn build --watch",
10
+ "update-sdk": "yarn add addio-admin-sdk && yarn build",
11
+ "update-canary": "yarn add addio-admin-sdk@canary",
12
+ "link-sdk": "yarn remove addio-admin-sdk && yarn add @types/js-cookie && cd ../addio-admin-sdk && yarn link && cd ../addio-ecomm-sdk && yarn link addio-admin-sdk",
13
+ "unlink-sdk": "yarn unlink addio-admin-sdk && yarn remove @types/js-cookie && cd ../addio-ecomm-sdk && yarn add addio-admin-sdk",
14
+ "unlink-canary": "yarn unlink addio-admin-sdk && yarn remove @types/js-cookie && cd ../addio-ecomm-sdk && yarn add addio-admin-sdk@canary",
15
+ "pub": "sh publish.sh"
16
+ },
17
+ "author": "",
18
+ "license": "ISC",
19
+ "dependencies": {
20
+ "@googlemaps/js-api-loader": "^1.11.3",
21
+ "addio-admin-sdk": "1.7.77",
22
+ "algoliasearch": "^4.13.0",
23
+ "contentful": "^9.1.28",
24
+ "encoding": "^0.1.13",
25
+ "firebase": "^7.17.2",
26
+ "google-auth-library": "^6.0.6",
27
+ "isomorphic-unfetch": "^3.0.0",
28
+ "js-cookie": "^3.0.1",
29
+ "jsonwebtoken": "^8.5.1",
30
+ "lodash": "^4.17.20",
31
+ "moment": "^2.28.0",
32
+ "react-gtm-module": "^2.0.11",
33
+ "react-input-mask": "^2.0.4",
34
+ "stripe": "^8.145.0",
35
+ "use-state-promise": "^0.1.1"
36
+ },
37
+ "devDependencies": {
38
+ "@babel/cli": "^7.10.5",
39
+ "@babel/core": "^7.11.1",
40
+ "@babel/plugin-proposal-class-properties": "^7.10.4",
41
+ "@babel/plugin-proposal-object-rest-spread": "^7.11.0",
42
+ "@babel/plugin-transform-react-jsx": "^7.10.4",
43
+ "@babel/preset-env": "^7.11.0",
44
+ "@babel/preset-react": "^7.10.4",
45
+ "@babel/preset-typescript": "^7.10.4",
46
+ "@types/bson": "^4.2.0",
47
+ "@types/google.maps": "^3.45.6",
48
+ "@types/jsonwebtoken": "^8.5.0",
49
+ "@types/lodash": "^4.14.160",
50
+ "@types/node-fetch": "^2.5.7",
51
+ "@types/react": "^17.0.30",
52
+ "@types/react-dom": "^17.0.9",
53
+ "@types/react-gtm-module": "^2.0.1",
54
+ "@types/react-input-mask": "^3.0.1",
55
+ "jsdoc-babel": "^0.5.0",
56
+ "jsdoc-to-markdown": "^6.0.1",
57
+ "react": "^17.0.2",
58
+ "react-dom": "^17.0.2",
59
+ "typescript": "^4.7.4"
60
+ }
61
+ }
package/publish.sh CHANGED
@@ -1,133 +1,133 @@
1
- # High Intensity
2
- IBlack='\033[0;90m' # Black
3
- IRed='\033[0;91m' # Red
4
- IGreen='\033[0;92m' # Green
5
- IYellow='\033[0;93m' # Yellow
6
- IBlue='\033[0;94m' # Blue
7
- IPurple='\033[0;95m' # Purple
8
- ICyan='\033[0;96m' # Cyan
9
- IWhite='\033[0;97m' # White
10
-
11
- NC='\033[0m' # No Color
12
-
13
- while getopts "f" flag
14
- do
15
- case "${flag}" in
16
- f) force=true ;;
17
- esac
18
- done
19
-
20
- proposedVersion=""
21
-
22
- updateVersion()
23
- {
24
- [[ ${1} =~ ^(.*[^0-9])?([0-9]+)$ ]] && \
25
- [[ ${#BASH_REMATCH[1]} -gt 0 ]] && \
26
- printf "%s%0${#BASH_REMATCH[2]}d" "${BASH_REMATCH[1]}" "$((10#${BASH_REMATCH[2]} + 1 ))" || \
27
- printf "%0${#BASH_REMATCH[2]}d" "$((10#${BASH_REMATCH[2]} + 1))" || \
28
- printf "${1}"
29
- }
30
-
31
- updateNPM()
32
- {
33
- npmVersionUpdate=$(npm version $proposedVersion --no-commit-hooks --no-git-tag-version)
34
- npmPublishAction=$(yarn publish --tag=${1} 2>/dev/null) || {
35
- proposedVersion=$(updateVersion "$proposedVersion")
36
- updateNPM "${1}"
37
- echo "Version existante, nouvel essai avec $proposedVersion"
38
- }
39
- }
40
-
41
- echo "Publication du ${IWhite}SDK Front (gng-ecomm-sdk) - ${IBlue}Addio${NC}"
42
-
43
- changes=$(git status --porcelain)
44
-
45
- if [[ "$changes" != "" ]] && [[ $force != true ]]; then
46
- echo "${IRed}Attention:${NC} Il y a des changements non commités. ${IYellow}Assurez-vous de faire les commits avant de publier.${NC}"
47
- exit
48
- fi
49
-
50
- yarn build 2>/dev/null || {
51
- echo "${IRed}La version actuelle ne build pas. Veuillez corriger les erreurs de build et réessayer${NC}"
52
- exit
53
- }
54
-
55
- echo "${IGreen}Build avec succès!${NC}"
56
-
57
- if [ "$publish" = "y" ] || [ "$publish" = "Y" ] || [ "$publish" = "" ]; then
58
- go=true
59
- else
60
- echo "${IRed}Annulation de la publication${NC}"
61
- exit
62
- fi
63
-
64
- actualVersion=$(npm pkg get version | tr -d '"')
65
- branch=$(git branch --show-current)
66
- tag="latest"
67
-
68
- echo "Version actuelle: ${IGreen}$actualVersion${NC}"
69
-
70
- if [ "$branch" = "master" ]; then
71
- git pull origin master 2>/dev/null || {
72
- echo "${IRed}La sync contient des erreurs. Veuillez mettre master à jour avec origin${NC}"
73
- exit
74
- }
75
- read -p "Voulez-vous publier un canary? (Y/n)" isCanary
76
- else
77
- isCanary="y"
78
- fi
79
-
80
- if [ "$isCanary" = "y" ] || [ "$isCanary" = "Y" ] || [ "$isCanary" = "" ]; then
81
- if [[ "$actualVersion" == *"canary"* ]]; then
82
- proposedVersion=$(updateVersion $actualVersion)
83
- else
84
- proposedVersion=$(updateVersion "$actualVersion-canary-0")
85
- fi
86
-
87
- tag="canary"
88
- else
89
- proposedVersion=${actualVersion%-canary*}
90
- proposedVersion=$(updateVersion "$proposedVersion")
91
- fi
92
-
93
-
94
-
95
- echo "Version proposée: ${IYellow}$proposedVersion${NC}"
96
- if [[ $force != true ]]; then
97
- if [ "$branch" = "master" ]; then
98
- read -p "(Laissez vide si la version proposée convient, sinon entrer la version complète) " newVersion
99
- else
100
- read -p "Voulez-vous continuer? (Y/n)" keepGoing
101
- if [[ "$keepGoing" != "y" ]] && [[ "$keepGoing" != "Y" ]] && [[ "$keepGoing" != "" ]]; then
102
- echo "${IRed}Annulation de la publication${NC}"
103
- exit
104
- fi
105
- fi
106
- fi
107
-
108
- if [ "$newVersion" = "" ]; then
109
- proposedVersion=$proposedVersion
110
- else
111
- proposedVersion=$newVersion
112
- fi
113
-
114
- npmVersionUpdate=$(npm version $proposedVersion --no-commit-hooks --no-git-tag-version)
115
- npmPublishAction=$(yarn publish --tag=$tag 2>/dev/null) || {
116
- updateNPM "$tag"
117
- }
118
- echo "${IGreen}Version $proposedVersion publiée sur NPM${NC}"
119
-
120
- git add . 2>/dev/null || exit
121
- echo "${IGreen}Commit de version préparé${NC}"
122
-
123
- if [ "$isCanary" = "y" ] || [ "$isCanary" = "Y" ] || [ "$isCanary" = "" ]; then
124
- git commit -m "Canary build: $actualVersion => $proposedVersion" 2>/dev/null || exit
125
- echo "${IGreen}Commit de version enregistré: Canary build: $actualVersion => $proposedVersion${NC}"
126
- else
127
- git commit -m "Latest build: $actualVersion => $proposedVersion" 2>/dev/null || exit
128
- echo "${IGreen}Commit de version enregistré: Latest build: $actualVersion => $proposedVersion${NC}"
129
- fi
130
-
131
- git push 2>/dev/null || exit
132
-
1
+ # High Intensity
2
+ IBlack='\033[0;90m' # Black
3
+ IRed='\033[0;91m' # Red
4
+ IGreen='\033[0;92m' # Green
5
+ IYellow='\033[0;93m' # Yellow
6
+ IBlue='\033[0;94m' # Blue
7
+ IPurple='\033[0;95m' # Purple
8
+ ICyan='\033[0;96m' # Cyan
9
+ IWhite='\033[0;97m' # White
10
+
11
+ NC='\033[0m' # No Color
12
+
13
+ while getopts "f" flag
14
+ do
15
+ case "${flag}" in
16
+ f) force=true ;;
17
+ esac
18
+ done
19
+
20
+ proposedVersion=""
21
+
22
+ updateVersion()
23
+ {
24
+ [[ ${1} =~ ^(.*[^0-9])?([0-9]+)$ ]] && \
25
+ [[ ${#BASH_REMATCH[1]} -gt 0 ]] && \
26
+ printf "%s%0${#BASH_REMATCH[2]}d" "${BASH_REMATCH[1]}" "$((10#${BASH_REMATCH[2]} + 1 ))" || \
27
+ printf "%0${#BASH_REMATCH[2]}d" "$((10#${BASH_REMATCH[2]} + 1))" || \
28
+ printf "${1}"
29
+ }
30
+
31
+ updateNPM()
32
+ {
33
+ npmVersionUpdate=$(npm version $proposedVersion --no-commit-hooks --no-git-tag-version)
34
+ npmPublishAction=$(yarn publish --tag=${1} 2>/dev/null) || {
35
+ proposedVersion=$(updateVersion "$proposedVersion")
36
+ updateNPM "${1}"
37
+ echo "Version existante, nouvel essai avec $proposedVersion"
38
+ }
39
+ }
40
+
41
+ echo "Publication du ${IWhite}SDK Front (gng-ecomm-sdk) - ${IBlue}Addio${NC}"
42
+
43
+ changes=$(git status --porcelain)
44
+
45
+ if [[ "$changes" != "" ]] && [[ $force != true ]]; then
46
+ echo "${IRed}Attention:${NC} Il y a des changements non commités. ${IYellow}Assurez-vous de faire les commits avant de publier.${NC}"
47
+ exit
48
+ fi
49
+
50
+ yarn build 2>/dev/null || {
51
+ echo "${IRed}La version actuelle ne build pas. Veuillez corriger les erreurs de build et réessayer${NC}"
52
+ exit
53
+ }
54
+
55
+ echo "${IGreen}Build avec succès!${NC}"
56
+
57
+ if [ "$publish" = "y" ] || [ "$publish" = "Y" ] || [ "$publish" = "" ]; then
58
+ go=true
59
+ else
60
+ echo "${IRed}Annulation de la publication${NC}"
61
+ exit
62
+ fi
63
+
64
+ actualVersion=$(npm pkg get version | tr -d '"')
65
+ branch=$(git branch --show-current)
66
+ tag="latest"
67
+
68
+ echo "Version actuelle: ${IGreen}$actualVersion${NC}"
69
+
70
+ if [ "$branch" = "master" ]; then
71
+ git pull origin master 2>/dev/null || {
72
+ echo "${IRed}La sync contient des erreurs. Veuillez mettre master à jour avec origin${NC}"
73
+ exit
74
+ }
75
+ read -p "Voulez-vous publier un canary? (Y/n)" isCanary
76
+ else
77
+ isCanary="y"
78
+ fi
79
+
80
+ if [ "$isCanary" = "y" ] || [ "$isCanary" = "Y" ] || [ "$isCanary" = "" ]; then
81
+ if [[ "$actualVersion" == *"canary"* ]]; then
82
+ proposedVersion=$(updateVersion $actualVersion)
83
+ else
84
+ proposedVersion=$(updateVersion "$actualVersion-canary-0")
85
+ fi
86
+
87
+ tag="canary"
88
+ else
89
+ proposedVersion=${actualVersion%-canary*}
90
+ proposedVersion=$(updateVersion "$proposedVersion")
91
+ fi
92
+
93
+
94
+
95
+ echo "Version proposée: ${IYellow}$proposedVersion${NC}"
96
+ if [[ $force != true ]]; then
97
+ if [ "$branch" = "master" ]; then
98
+ read -p "(Laissez vide si la version proposée convient, sinon entrer la version complète) " newVersion
99
+ else
100
+ read -p "Voulez-vous continuer? (Y/n)" keepGoing
101
+ if [[ "$keepGoing" != "y" ]] && [[ "$keepGoing" != "Y" ]] && [[ "$keepGoing" != "" ]]; then
102
+ echo "${IRed}Annulation de la publication${NC}"
103
+ exit
104
+ fi
105
+ fi
106
+ fi
107
+
108
+ if [ "$newVersion" = "" ]; then
109
+ proposedVersion=$proposedVersion
110
+ else
111
+ proposedVersion=$newVersion
112
+ fi
113
+
114
+ npmVersionUpdate=$(npm version $proposedVersion --no-commit-hooks --no-git-tag-version)
115
+ npmPublishAction=$(yarn publish --tag=$tag 2>/dev/null) || {
116
+ updateNPM "$tag"
117
+ }
118
+ echo "${IGreen}Version $proposedVersion publiée sur NPM${NC}"
119
+
120
+ git add . 2>/dev/null || exit
121
+ echo "${IGreen}Commit de version préparé${NC}"
122
+
123
+ if [ "$isCanary" = "y" ] || [ "$isCanary" = "Y" ] || [ "$isCanary" = "" ]; then
124
+ git commit -m "Canary build: $actualVersion => $proposedVersion" 2>/dev/null || exit
125
+ echo "${IGreen}Commit de version enregistré: Canary build: $actualVersion => $proposedVersion${NC}"
126
+ else
127
+ git commit -m "Latest build: $actualVersion => $proposedVersion" 2>/dev/null || exit
128
+ echo "${IGreen}Commit de version enregistré: Latest build: $actualVersion => $proposedVersion${NC}"
129
+ fi
130
+
131
+ git push 2>/dev/null || exit
132
+
133
133
  echo "${IBlue}Publication terminée!${NC}"