@ututrust/web-components 2.3.0-alpha.8 → 2.3.1

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 (4) hide show
  1. package/README.md +129 -10
  2. package/dist/index.cjs +212 -213
  3. package/dist/index.js +25818 -27002
  4. package/package.json +20 -8
package/README.md CHANGED
@@ -24,15 +24,16 @@ $ npm install @ututrust/web-components
24
24
 
25
25
  ## Configuration options
26
26
 
27
- The SDK can be configured by dispatching an `utuConfig` event. It
28
- currently supports only one element: `production` (`boolean`).
27
+ The SDK can be configured by calling a function on the SDK to inform it what the environment is so
28
+ that the SDK talks to the correct endpoints:
29
29
 
30
- If set to `true`, the SDK will connect to UTU's production API services.
31
- Otherwise (default), it will connect to UTU API testing services.
32
-
33
- Use it like so, after the SDK has been loaded:
34
30
  ```
35
- window.dispatchEvent(new CustomEvent("utuConfig", { detail: { production: true } }));
31
+ const config: IConfig = {
32
+ production,
33
+ provider: walletProvider
34
+ };
35
+
36
+ updateConfig(config);
36
37
  ```
37
38
 
38
39
  ## Examples
@@ -224,6 +225,20 @@ To mock an UTU API response, specify ```api-url``` of ```<x-utu-root>```:
224
225
 
225
226
  Example of a JSON file can be find at ```/packages/utu-web-components/src/api-mock```
226
227
 
228
+ ## Using / Not using Unlock
229
+
230
+ Unlock is a library that allows us to charge for access to signal. The SDK can be built / run with unlock integrated or not integrated. This is controlled by an .env file.
231
+
232
+ Please copy .env_example and rename it to .env
233
+
234
+ Inside the .env file it has:
235
+
236
+ ```
237
+ VITE_USE_UNLOCK=false
238
+ ```
239
+
240
+ If you want to use Unlock set the above variable to true
241
+
227
242
  ## Local Development
228
243
  Development stack:
229
244
  - [preactjs](https://preactjs.com)
@@ -247,13 +262,30 @@ Install dependencies
247
262
  $ npm install
248
263
  ```
249
264
 
250
- Start watch mode with preview in a browser
265
+ Start watch mode with preview in a browser.
251
266
 
252
267
  ```bash
253
- $ npm start
268
+ $ npm run dev
269
+ ```
270
+ To mock out talking to the UTU backend run this command in another terminal window:
271
+
272
+ ```
273
+ npm run api-mock
274
+ ```
275
+
276
+ To mock out the video recording make sure you are in this directory:
277
+
278
+ ```
279
+ <project-dir>/packages/video-server-mock
280
+ ```
281
+
282
+ and run this command in another terminal window:
283
+
284
+ ```
285
+ npm run start
254
286
  ```
255
287
 
256
- Production build
288
+ To test that there are no compilation issues in the Production build run:
257
289
 
258
290
  ```bash
259
291
  $ npm run build
@@ -282,3 +314,90 @@ This will generate a ```.tgz``` file at the directory’s root with a structure
282
314
  ```bash
283
315
  $ npm install <path to the package>/utu-web-components-1.0.0.tgz
284
316
  ```
317
+
318
+ ## 🚀Release Workflow
319
+
320
+ We maintain **two types of releases** for the SDK:
321
+
322
+ - **Production release** → `UnlockGateway` **enabled**
323
+ - **Staging release** → `UnlockGateway` **commented out**
324
+
325
+ ---
326
+
327
+ ### 🔹Production Release
328
+
329
+ ```bash
330
+ # make sure main is up to date
331
+ git checkout main
332
+ git pull
333
+
334
+ # create + switch to a release branch
335
+ git checkout -b release-[version]
336
+
337
+ ```
338
+
339
+ ➡️ To get `FeedbackDetails.tsx` to NOT use Unlock for showing feedback you need to set the .env file to have this attribute:
340
+
341
+ ```
342
+ VITE_USE_UNLOCK=false
343
+ ```
344
+
345
+ Internally it will not inject the UnlockGateway tags
346
+
347
+ Note that Unlock functionality is about the user paying to see Signal.
348
+
349
+ ➡️ In `package.json`
350
+
351
+ Update the release version number (e.g. `1.2.3`)
352
+
353
+ ```bash
354
+ git add .
355
+ git commit -m "Production release: enabled UnlockGateway + version bump"
356
+ git push origin release-[version]
357
+
358
+ # build + publish production
359
+ npm run build
360
+ npm login
361
+ npm publish
362
+
363
+ ```
364
+
365
+ ---
366
+
367
+ ### 🔹Staging Release
368
+
369
+ ```bash
370
+ # back to main
371
+ git checkout main
372
+ git pull
373
+
374
+ # create + switch to a staging branch
375
+ git checkout -b release-[version]-alpha
376
+ ```
377
+
378
+ ➡️ To get `FeedbackDetails.tsx` to use Unlock for showing feedback you need to set the .env file to have this attribute:
379
+
380
+ ```
381
+ VITE_USE_UNLOCK=true
382
+ ```
383
+
384
+ Internally it will inject the UnlockGateway tags
385
+
386
+ Note that Unlock functionality is about the user paying to see Signal.
387
+
388
+
389
+ ➡️ In `package.json`
390
+
391
+ Update the version number with an alpha tag (e.g. `1.2.3-alpha.0`)
392
+
393
+ ```bash
394
+ git add .
395
+ git commit -m "Staging release: commented UnlockGateway + version bump"
396
+ git push origin release-[version]-alpha
397
+
398
+ # build + publish staging
399
+ npm run build
400
+ npm login
401
+ npm publish
402
+
403
+ ```