datakeen-session-react 1.1.135-dev.0 → 1.1.135-dev.4
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/.gitlab-ci.yml +44 -78
- package/README.md +18 -11
- package/package.json +1 -1
package/.gitlab-ci.yml
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
workflow:
|
|
2
|
+
rules:
|
|
3
|
+
# Force pipeline sur les Merge Requests
|
|
4
|
+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
5
|
+
# Pipeline sur les branches protégées
|
|
6
|
+
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
7
|
+
- if: '$CI_COMMIT_BRANCH == "staging"'
|
|
8
|
+
- if: '$CI_COMMIT_BRANCH == "dev"'
|
|
9
|
+
# Sinon, pas de pipeline (évite les doublons)
|
|
10
|
+
|
|
1
11
|
stages:
|
|
2
12
|
- test
|
|
3
13
|
- lint
|
|
@@ -21,19 +31,14 @@ cache:
|
|
|
21
31
|
test:
|
|
22
32
|
stage: test
|
|
23
33
|
image: node:20
|
|
24
|
-
cache:
|
|
25
|
-
key:
|
|
26
|
-
files:
|
|
27
|
-
- package-lock.json
|
|
28
|
-
paths:
|
|
29
|
-
- node_modules/
|
|
30
34
|
script:
|
|
31
35
|
- npm ci
|
|
32
36
|
- echo "[TODO] TESTS"
|
|
33
37
|
rules:
|
|
34
38
|
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
35
|
-
-
|
|
36
|
-
|
|
39
|
+
- if: '$CI_COMMIT_BRANCH == "dev"'
|
|
40
|
+
- if: '$CI_COMMIT_BRANCH == "staging"'
|
|
41
|
+
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
37
42
|
|
|
38
43
|
############################################
|
|
39
44
|
# #
|
|
@@ -44,19 +49,14 @@ test:
|
|
|
44
49
|
lint:
|
|
45
50
|
stage: lint
|
|
46
51
|
image: node:20
|
|
47
|
-
cache:
|
|
48
|
-
key:
|
|
49
|
-
files:
|
|
50
|
-
- package-lock.json
|
|
51
|
-
paths:
|
|
52
|
-
- node_modules/
|
|
53
52
|
script:
|
|
54
53
|
- npm ci
|
|
55
54
|
- npm run lint || true
|
|
56
55
|
rules:
|
|
57
56
|
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
58
|
-
-
|
|
59
|
-
|
|
57
|
+
- if: '$CI_COMMIT_BRANCH == "dev"'
|
|
58
|
+
- if: '$CI_COMMIT_BRANCH == "staging"'
|
|
59
|
+
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
60
60
|
needs:
|
|
61
61
|
- test
|
|
62
62
|
|
|
@@ -69,12 +69,6 @@ lint:
|
|
|
69
69
|
build:
|
|
70
70
|
stage: build
|
|
71
71
|
image: node:20
|
|
72
|
-
cache:
|
|
73
|
-
key:
|
|
74
|
-
files:
|
|
75
|
-
- package-lock.json
|
|
76
|
-
paths:
|
|
77
|
-
- node_modules/
|
|
78
72
|
script:
|
|
79
73
|
- npm ci
|
|
80
74
|
- npm run build
|
|
@@ -85,13 +79,11 @@ build:
|
|
|
85
79
|
expire_in: 30 days
|
|
86
80
|
rules:
|
|
87
81
|
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
88
|
-
needs:
|
|
89
|
-
- lint
|
|
90
82
|
- if: '$CI_COMMIT_BRANCH == "dev"'
|
|
91
83
|
- if: '$CI_COMMIT_BRANCH == "staging"'
|
|
92
84
|
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
93
|
-
|
|
94
|
-
|
|
85
|
+
needs:
|
|
86
|
+
- lint
|
|
95
87
|
|
|
96
88
|
#################################################
|
|
97
89
|
# #
|
|
@@ -107,35 +99,26 @@ publish:main:
|
|
|
107
99
|
variables:
|
|
108
100
|
NPM_CONFIG_PROVENANCE: "false"
|
|
109
101
|
|
|
110
|
-
# OIDC Configuration
|
|
111
102
|
id_tokens:
|
|
112
103
|
NPM_ID_TOKEN:
|
|
113
104
|
aud: "npm:registry.npmjs.org"
|
|
114
|
-
SIGSTORE_ID_TOKEN:
|
|
115
|
-
aud: sigstore
|
|
116
105
|
|
|
117
106
|
environment:
|
|
118
107
|
name: npm
|
|
119
108
|
url: https://www.npmjs.com/package/datakeen-session-react
|
|
120
109
|
|
|
121
110
|
script:
|
|
122
|
-
- git config user.email "ci@
|
|
123
|
-
- git config user.name "CI
|
|
111
|
+
- git config user.email "ci@datakeen.io"
|
|
112
|
+
- git config user.name "Datakeen CI"
|
|
124
113
|
- git remote set-url origin https://${CI_PUSH_USER}:${CI_PUSH_TOKEN}@gitlab.com/datakeenteam/teamfullstack/client-sessions-react-sdk.git
|
|
125
|
-
|
|
126
|
-
# Update npm
|
|
127
114
|
- npm install -g npm@latest
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
- git push origin HEAD:main
|
|
133
|
-
- git push origin --tags
|
|
134
|
-
|
|
135
|
-
# Auth dynamique & Publish
|
|
115
|
+
- 'npm version patch -m "chore(release): %s"'
|
|
116
|
+
- git push -o ci.skip origin HEAD:main
|
|
117
|
+
- git push -o ci.skip origin --tags
|
|
136
118
|
- npm publish --access public
|
|
137
|
-
|
|
138
|
-
|
|
119
|
+
|
|
120
|
+
rules:
|
|
121
|
+
- if: '$CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE != "merge_request_event"'
|
|
139
122
|
needs:
|
|
140
123
|
- build
|
|
141
124
|
|
|
@@ -147,35 +130,26 @@ publish:staging:
|
|
|
147
130
|
variables:
|
|
148
131
|
NPM_CONFIG_PROVENANCE: "false"
|
|
149
132
|
|
|
150
|
-
# OIDC Configuration
|
|
151
133
|
id_tokens:
|
|
152
134
|
NPM_ID_TOKEN:
|
|
153
135
|
aud: "npm:registry.npmjs.org"
|
|
154
|
-
SIGSTORE_ID_TOKEN:
|
|
155
|
-
aud: sigstore
|
|
156
136
|
|
|
157
137
|
environment:
|
|
158
138
|
name: npm
|
|
159
|
-
url: https://www.npmjs.com/package/datakeen-session-react
|
|
139
|
+
url: https://www.npmjs.com/package/datakeen-session-react?activeTab=versions
|
|
160
140
|
|
|
161
141
|
script:
|
|
162
|
-
- git config user.email "ci@
|
|
163
|
-
- git config user.name "CI
|
|
142
|
+
- git config user.email "ci@datakeen.io"
|
|
143
|
+
- git config user.name "Datakeen CI"
|
|
164
144
|
- git remote set-url origin https://${CI_PUSH_USER}:${CI_PUSH_TOKEN}@gitlab.com/datakeenteam/teamfullstack/client-sessions-react-sdk.git
|
|
165
|
-
|
|
166
|
-
# Update npm
|
|
167
145
|
- npm install -g npm@latest
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
-
|
|
171
|
-
|
|
172
|
-
- git push origin HEAD:staging
|
|
173
|
-
- git push origin --tags
|
|
174
|
-
|
|
175
|
-
# Auth dynamique & Publish sur le tag RC
|
|
146
|
+
- 'npm version prerelease --preid=rc -m "chore(release): %s"'
|
|
147
|
+
- git push -o ci.skip origin HEAD:staging
|
|
148
|
+
- git push -o ci.skip origin --tags
|
|
176
149
|
- npm publish --access public --tag rc
|
|
177
|
-
|
|
178
|
-
|
|
150
|
+
|
|
151
|
+
rules:
|
|
152
|
+
- if: '$CI_COMMIT_BRANCH == "staging" && $CI_PIPELINE_SOURCE != "merge_request_event"'
|
|
179
153
|
needs:
|
|
180
154
|
- build
|
|
181
155
|
|
|
@@ -187,33 +161,25 @@ publish:dev:
|
|
|
187
161
|
variables:
|
|
188
162
|
NPM_CONFIG_PROVENANCE: "false"
|
|
189
163
|
|
|
190
|
-
# OIDC Configuration
|
|
191
164
|
id_tokens:
|
|
192
165
|
NPM_ID_TOKEN:
|
|
193
166
|
aud: "npm:registry.npmjs.org"
|
|
194
|
-
SIGSTORE_ID_TOKEN:
|
|
195
|
-
aud: sigstore
|
|
196
167
|
|
|
197
168
|
environment:
|
|
198
169
|
name: npm
|
|
199
|
-
url: https://www.npmjs.com/package/datakeen-session-react
|
|
170
|
+
url: https://www.npmjs.com/package/datakeen-session-react?activeTab=versions
|
|
200
171
|
|
|
201
172
|
script:
|
|
202
|
-
- git config user.email "ci@
|
|
203
|
-
- git config user.name "CI
|
|
173
|
+
- git config user.email "ci@datakeen.io"
|
|
174
|
+
- git config user.name "Datakeen CI"
|
|
204
175
|
- git remote set-url origin https://${CI_PUSH_USER}:${CI_PUSH_TOKEN}@gitlab.com/datakeenteam/teamfullstack/client-sessions-react-sdk.git
|
|
205
|
-
|
|
206
|
-
# Update npm
|
|
207
176
|
- npm install -g npm@latest
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
-
|
|
211
|
-
|
|
212
|
-
- git push origin HEAD:dev
|
|
213
|
-
- git push origin --tags
|
|
214
|
-
|
|
177
|
+
- 'npm version prerelease --preid=dev -m "chore(release): %s"'
|
|
178
|
+
- git push -o ci.skip origin HEAD:dev
|
|
179
|
+
- git push -o ci.skip origin --tags
|
|
215
180
|
- npm publish --access public --tag dev
|
|
216
|
-
|
|
217
|
-
|
|
181
|
+
|
|
182
|
+
rules:
|
|
183
|
+
- if: '$CI_COMMIT_BRANCH == "dev" && $CI_PIPELINE_SOURCE != "merge_request_event"'
|
|
218
184
|
needs:
|
|
219
185
|
- build
|
package/README.md
CHANGED
|
@@ -24,17 +24,17 @@ yarn add datakeen-session-react
|
|
|
24
24
|
pnpm add datakeen-session-react
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
### 🔖 Stratégie de publication multi-
|
|
27
|
+
### 🔖 Stratégie de publication automatique multi-environnements
|
|
28
28
|
|
|
29
|
-
Le SDK utilise une
|
|
29
|
+
Le SDK utilise une **pipeline CI/CD automatisée** qui publie automatiquement sur npm avec trois tags distincts selon la branche Git :
|
|
30
30
|
|
|
31
|
-
| Branche Git | Tag NPM
|
|
32
|
-
|
|
33
|
-
| `main`
|
|
34
|
-
| `staging`
|
|
35
|
-
| `dev`
|
|
31
|
+
| Branche Git | Tag NPM | Format de version | Environnement | Commande d'installation |
|
|
32
|
+
| ----------- | --------- | ----------------------------------- | --------------------------- | ---------------------------------------- |
|
|
33
|
+
| `main` | `@latest` | `1.1.135` (Stable) | **Production** | `npm install datakeen-session-react` |
|
|
34
|
+
| `staging` | `@rc` | `1.1.135-rc.0` (Release Candidate) | **Pré-production** (QA/UAT) | `npm install datakeen-session-react@rc` |
|
|
35
|
+
| `dev` | `@dev` | `1.1.135-dev.3` (Integration Build) | **Développement** | `npm install datakeen-session-react@dev` |
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
#### 📦 Installation par environnement
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
# Production (stable) - par défaut
|
|
@@ -42,15 +42,22 @@ npm install datakeen-session-react
|
|
|
42
42
|
# ou explicitement
|
|
43
43
|
npm install datakeen-session-react@latest
|
|
44
44
|
|
|
45
|
-
# Pré-production (Release Candidate pour QA/UAT)
|
|
45
|
+
# Pré-production (Release Candidate pour tests QA/UAT)
|
|
46
46
|
npm install datakeen-session-react@rc
|
|
47
47
|
|
|
48
|
-
# Développement (dernières fonctionnalités)
|
|
48
|
+
# Développement (dernières fonctionnalités en cours)
|
|
49
49
|
npm install datakeen-session-react@dev
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
#### 🔄 Processus de publication automatique
|
|
53
53
|
|
|
54
|
+
Chaque merge sur les branches principales déclenche automatiquement :
|
|
55
|
+
|
|
56
|
+
1. **Branche `dev`** → Incrémente la pré-version → Publie sur `@dev` (ex: `1.1.135-dev.0`, `1.1.135-dev.1`, ...)
|
|
57
|
+
2. **Branche `staging`** → Incrémente la pré-version RC → Publie sur `@rc` (ex: `1.1.135-rc.0`, `1.1.135-rc.1`, ...)
|
|
58
|
+
3. **Branche `main`** → Incrémente le patch → Publie sur `@latest` (ex: `1.1.135`, `1.1.136`, ...)
|
|
59
|
+
|
|
60
|
+
> **💡 Note :** Ce système permet de tester et valider les nouvelles fonctionnalités à travers plusieurs environnements avant leur déploiement en production, garantissant ainsi la stabilité du SDK.
|
|
54
61
|
|
|
55
62
|
## 🚀 Guide de démarrage rapide
|
|
56
63
|
|