react-native-ui-lib 7.42.0 → 7.43.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ui-lib",
3
- "version": "7.42.0",
3
+ "version": "7.43.0",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -1,5 +1,6 @@
1
1
  const fs = require('fs');
2
2
  const _ = require('lodash');
3
+ const chalk = require('chalk');
3
4
  const childProcess = require('child_process');
4
5
  const readline = require('readline');
5
6
 
@@ -30,10 +31,10 @@ function parsePR(prContent) {
30
31
  return PRInfo;
31
32
  }
32
33
 
33
- async function fetchMergedPRs(postMergedDate) {
34
+ async function fetchMergedPRs(postMergedDate, _repo, isPatchRelease) {
34
35
  console.log('Find all merged PRs since - ', postMergedDate);
35
36
  // process.stderr.write(`Loading page ${page}..`);
36
- const str = childProcess.execSync('gh pr list --json headRefName,body,title,number,mergedAt,url --limit 100 --state merged --search "base:master"',
37
+ const str = childProcess.execSync('gh pr list --json headRefName,body,title,number,mergedAt,url,labels --limit 100 --state merged --search "base:master"',
37
38
  {
38
39
  encoding: 'utf8'
39
40
  });
@@ -44,8 +45,19 @@ async function fetchMergedPRs(postMergedDate) {
44
45
  console.log('\x1b[31m', 'Something went wrong', PRs.message);
45
46
  return;
46
47
  }
48
+ const filteringMessageStyle = chalk.bgYellow.black;
49
+ console.log(filteringMessageStyle(isPatchRelease
50
+ ? 'Patch release - only hotfix PRs will be included.'
51
+ : 'Non-patch release - hotfix PRs will be excluded.'));
47
52
 
48
53
  const relevantPRs = _.flow(prs => _.filter(prs, pr => !!pr.mergedAt && new Date(pr.mergedAt) > postMergedDate),
54
+ prs => _.filter(prs, pr => {
55
+ const isHotfix = pr.labels.some(label => label.name === 'hotfix');
56
+ if (isHotfix && !isPatchRelease) {
57
+ console.log(filteringMessageStyle(`PR ${pr.number} is a hotfix and was excluded from the release notes.`));
58
+ }
59
+ return isPatchRelease ? isHotfix : !isHotfix;
60
+ }),
49
61
  prs => _.sortBy(prs, 'mergedAt'),
50
62
  prs =>
51
63
  _.map(prs, pr => {
@@ -60,9 +72,10 @@ async function fetchMergedPRs(postMergedDate) {
60
72
  };
61
73
  } catch {
62
74
  console.error('Failed parsing PR: ', pr.url);
75
+ return null;
63
76
  }
64
- }))(PRs);
65
-
77
+ }),
78
+ prs => _.compact(prs))(PRs);
66
79
  return relevantPRs;
67
80
  }
68
81
 
@@ -151,9 +164,9 @@ function getReleaseNotesForType(PRs, title) {
151
164
  return releaseNotes;
152
165
  }
153
166
 
154
- async function _generateReleaseNotes(latestVersion, newVersion, fileNamePrefix, repo, header, tagPrefix, categories) {
167
+ async function _generateReleaseNotes(latestVersion, newVersion, fileNamePrefix, repo, header, tagPrefix, categories, isPatchRelease) {
155
168
  const latestReleaseDate = fetchLatestReleaseDate(tagPrefix, latestVersion);
156
- const PRs = await fetchMergedPRs(latestReleaseDate, repo);
169
+ const PRs = await fetchMergedPRs(latestReleaseDate, repo, isPatchRelease);
157
170
  if (!PRs) {
158
171
  return;
159
172
  }
@@ -192,6 +205,13 @@ async function _generateReleaseNotes(latestVersion, newVersion, fileNamePrefix,
192
205
  console.log(`\x1b[1m\x1b[32m✔\x1b[0m \x1b[32m${fileNamePrefix}-release-notes.txt was successfully written to ${process.env.HOME}/Downloads\x1b[0m \x1b[1m\x1b[32m✔\x1b[0m`);
193
206
  }
194
207
 
208
+ function isPatchRelease(lastVersion, newVersion) {
209
+ const [lastMajor, lastMinor, lastPatch] = lastVersion.split('.').map(Number);
210
+ const [newMajor, newMinor, newPatch] = newVersion.split('.').map(Number);
211
+
212
+ return lastMajor === newMajor && lastMinor === newMinor && newPatch - lastPatch > 0;
213
+ }
214
+
195
215
  async function generateReleaseNotes(latestVersion,
196
216
  newVersion,
197
217
  fileNamePrefix,
@@ -213,11 +233,12 @@ async function generateReleaseNotes(latestVersion,
213
233
  });
214
234
  });
215
235
 
236
+
216
237
  rl.on('close', () => {
217
238
  const header = getHeader(newVer);
218
239
  console.info(`Current latest version is v${latestVer}`);
219
240
  console.info(`Generating release notes out or PRs for v${newVer}`);
220
- _generateReleaseNotes(latestVer, newVer, fileNamePrefix, repo, header, tagPrefix, categories);
241
+ _generateReleaseNotes(latestVer, newVer, fileNamePrefix, repo, header, tagPrefix, categories, isPatchRelease(latestVer, newVer));
221
242
  });
222
243
  }
223
244
 
@@ -237,89 +237,12 @@
237
237
  },
238
238
  {
239
239
  "type": "section",
240
- "title": "Main Button",
240
+ "title": "Button",
241
241
  "description": ""
242
242
  },
243
243
  {
244
244
  "type": "table",
245
- "columns": ["Property", "Component"],
246
- "items": [
247
- {
248
- "title": "Primary",
249
- "description": "",
250
- "content": [
251
- {
252
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_priority_primary.png"
253
- }
254
- ]
255
- },
256
- {
257
- "title": "Secondary",
258
- "description": "",
259
- "content": [
260
- {
261
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_priority_secondary.png"
262
- }
263
- ]
264
- }
265
- ],
266
- "title": "",
267
- "description": "",
268
- "name": "Priority"
269
- },
270
- {
271
- "type": "table",
272
- "columns": ["Property", "Primary", "Secondary"],
273
- "items": [
274
- {
275
- "title": "Main",
276
- "description": "The default button style, used for most actions.",
277
- "content": [
278
- {
279
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_presets_mainPrimary.png"
280
- },
281
- {
282
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_presets_mainSecondary.png"
283
- }
284
- ]
285
- },
286
- {
287
- "title": "Inverted",
288
- "description": "Used on top of images and dark background. ",
289
- "content": [
290
- {
291
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_presets_invertedPrimary.png"
292
- },
293
- {
294
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_presets_invertedSecondary.png"
295
- }
296
- ]
297
- },
298
- {
299
- "title": "Destructive",
300
- "description": "Used for destructive actions such as Delete and Log out. ",
301
- "content": [
302
- {
303
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_presets_distructivePrimary.png"
304
- },
305
- {
306
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_presets_distructiveSecondary.png"
307
- }
308
- ]
309
- }
310
- ],
311
- "title": "",
312
- "description": "",
313
- "name": "Presets"
314
- },
315
- {
316
- "type": "section",
317
- "title": "States",
318
- "description": ""
319
- },
320
- {
321
- "type": "table",
322
- "columns": ["Property", "Primary", "Secondary"],
245
+ "columns": ["Property", "Default", "Outline"],
323
246
  "items": [
324
247
  {
325
248
  "title": "Active",
@@ -333,18 +256,6 @@
333
256
  }
334
257
  ]
335
258
  },
336
- {
337
- "title": "Loading",
338
- "description": "",
339
- "content": [
340
- {
341
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_states_mainLoadingPrimary.png"
342
- },
343
- {
344
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_states_mainLoadingSecondary.png"
345
- }
346
- ]
347
- },
348
259
  {
349
260
  "title": "Disabled",
350
261
  "description": "",
@@ -362,51 +273,6 @@
362
273
  "description": "",
363
274
  "name": "Main"
364
275
  },
365
- {
366
- "type": "table",
367
- "columns": ["Property", "Primary", "Secondary"],
368
- "items": [
369
- {
370
- "title": "Active",
371
- "description": "",
372
- "content": [
373
- {
374
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_states_invertedActivePrimary.png"
375
- },
376
- {
377
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_states_invertedActiveSecondary.png"
378
- }
379
- ]
380
- },
381
- {
382
- "title": "Loading",
383
- "description": "",
384
- "content": [
385
- {
386
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_states_invertedLoadingPrimary.png"
387
- },
388
- {
389
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_states_invertedLoadingSecondary.png"
390
- }
391
- ]
392
- },
393
- {
394
- "title": "Disabled",
395
- "description": "",
396
- "content": [
397
- {
398
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_states_invertedDisabledPrimary.png"
399
- },
400
- {
401
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_states_invertedDisabledSecondary.png"
402
- }
403
- ]
404
- }
405
- ],
406
- "title": "",
407
- "description": "",
408
- "name": "Inverted"
409
- },
410
276
  {
411
277
  "type": "table",
412
278
  "columns": ["Property", "Component"],
@@ -478,7 +344,7 @@
478
344
  "columns": ["Property", "Component"],
479
345
  "items": [
480
346
  {
481
- "title": "Primary",
347
+ "title": "Default",
482
348
  "description": "",
483
349
  "content": [
484
350
  {
@@ -487,7 +353,7 @@
487
353
  ]
488
354
  },
489
355
  {
490
- "title": "Secondary",
356
+ "title": "Outline",
491
357
  "description": "",
492
358
  "content": [
493
359
  {
@@ -499,37 +365,6 @@
499
365
  "title": "Priority",
500
366
  "description": ""
501
367
  },
502
- {
503
- "type": "table",
504
- "columns": ["Property", "Primary", "Secondary"],
505
- "items": [
506
- {
507
- "title": "Main",
508
- "description": "The default button style, used for most actions.",
509
- "content": [
510
- {
511
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_iconButton_presets_mainPrimary.png"
512
- },
513
- {
514
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_iconButton_presets_mainSecondary.png"
515
- }
516
- ]
517
- },
518
- {
519
- "title": "Inverted",
520
- "description": "Used on top of images and dark background. ",
521
- "content": [
522
- {
523
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_iconButton_presets_invertedPrimary.png"
524
- },
525
- {
526
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_iconButton_presets_invertedSecondary.png"
527
- }
528
- ]
529
- }
530
- ],
531
- "title": "Presets"
532
- },
533
368
  {
534
369
  "type": "section",
535
370
  "title": "States",
@@ -537,7 +372,7 @@
537
372
  },
538
373
  {
539
374
  "type": "table",
540
- "columns": ["Property", "Primary", "Secondary"],
375
+ "columns": ["Property", "Default", "Outline"],
541
376
  "items": [
542
377
  {
543
378
  "title": "Active",
@@ -596,15 +431,6 @@
596
431
  }
597
432
  ]
598
433
  },
599
- {
600
- "title": "Destructive",
601
- "description": "text style: bodyBold, $textDangerLight",
602
- "content": [
603
- {
604
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_linkButton_presets_distructive.png"
605
- }
606
- ]
607
- },
608
434
  {
609
435
  "title": "Disabled",
610
436
  "description": "text style: bodyBold, $textDisabled",
@@ -691,24 +517,6 @@
691
517
  "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_fullWidth_presets_main.png"
692
518
  }
693
519
  ]
694
- },
695
- {
696
- "title": "Destructive ",
697
- "description": "",
698
- "content": [
699
- {
700
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_fullWidth_presets_destructive.png"
701
- }
702
- ]
703
- },
704
- {
705
- "title": "Premium",
706
- "description": "",
707
- "content": [
708
- {
709
- "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Button/button_overview_fullWidth_presets_premium.png"
710
- }
711
- ]
712
520
  }
713
521
  ],
714
522
  "title": "Presets",