@next-core/brick-utils 2.28.6 → 2.28.10

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/CHANGELOG.md CHANGED
@@ -3,6 +3,41 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.28.10](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.28.9...@next-core/brick-utils@2.28.10) (2021-10-21)
7
+
8
+ **Note:** Version bump only for package @next-core/brick-utils
9
+
10
+
11
+
12
+
13
+
14
+ ## [2.28.9](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.28.8...@next-core/brick-utils@2.28.9) (2021-10-20)
15
+
16
+ **Note:** Version bump only for package @next-core/brick-utils
17
+
18
+
19
+
20
+
21
+
22
+ ## [2.28.8](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.28.7...@next-core/brick-utils@2.28.8) (2021-10-20)
23
+
24
+ **Note:** Version bump only for package @next-core/brick-utils
25
+
26
+
27
+
28
+
29
+
30
+ ## [2.28.7](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.28.6...@next-core/brick-utils@2.28.7) (2021-10-13)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * get clean segues when building storyboard ([fd51ffd](https://github.com/easyops-cn/next-core/commit/fd51ffde311681e43e1c7d06d27d794a919ee1f7))
36
+
37
+
38
+
39
+
40
+
6
41
  ## [2.28.6](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.28.5...@next-core/brick-utils@2.28.6) (2021-10-12)
7
42
 
8
43
  **Note:** Version bump only for package @next-core/brick-utils
@@ -18589,7 +18589,11 @@
18589
18589
  }
18590
18590
 
18591
18591
  function preevaluate(raw, options) {
18592
- var source = raw.replace(/^\s*<%~?\s|\s%>\s*$/g, "");
18592
+ var fixes = [];
18593
+ var source = raw.replace(/^\s*<%~?\s|\s%>\s*$/g, m => {
18594
+ fixes.push(m);
18595
+ return "";
18596
+ });
18593
18597
  var expression = parseAsEstreeExpression(source);
18594
18598
  var attemptToVisitGlobals = precook(expression, _objectSpread__default["default"](_objectSpread__default["default"]({}, options), {}, {
18595
18599
  expressionOnly: true
@@ -18597,7 +18601,9 @@
18597
18601
  return {
18598
18602
  expression,
18599
18603
  attemptToVisitGlobals,
18600
- source
18604
+ source,
18605
+ prefix: fixes[0],
18606
+ suffix: fixes[1]
18601
18607
  };
18602
18608
  }
18603
18609
  function isEvaluable(raw) {
@@ -20424,14 +20430,22 @@
20424
20430
  }
20425
20431
 
20426
20432
  function normalizeBuilderRouteNode(node) {
20427
- return normalize(node, fieldsToRemoveInRoute, jsonFieldsInRoute, yamlFieldsInRoute);
20433
+ return normalize(node, fieldsToRemoveInRoute, jsonFieldsInRoute, yamlFieldsInRoute, true);
20428
20434
  }
20429
20435
 
20430
- function normalize(node, fieldsToRemove, jsonFields, yamlFields) {
20436
+ function normalize(node, fieldsToRemove, jsonFields, yamlFields, cleanUpSegues) {
20431
20437
  return Object.fromEntries(Object.entries(node) // Remove unused fields from CMDB.
20432
20438
  // Consider fields started with `_` as unused.
20433
20439
  .filter(([key]) => key[0] !== "_" && !fieldsToRemove.includes(key)) // Parse json fields.
20434
- .map(([key, value]) => [key, jsonFields.includes(key) ? safeJsonParse(value) : yamlFields.includes(key) ? safeYamlParse(value) : lodash.cloneDeep(value)]));
20440
+ .map(([key, value]) => [key, cleanUpSegues && key === "segues" ? getCleanSegues(value) : jsonFields.includes(key) ? safeJsonParse(value) : yamlFields.includes(key) ? safeYamlParse(value) : lodash.cloneDeep(value)]));
20441
+ } // Clear `segue._view` which is for development only.
20442
+
20443
+
20444
+ function getCleanSegues(string) {
20445
+ var segues = safeJsonParse(string);
20446
+ return segues && Object.fromEntries(Object.entries(segues).map(([id, segue]) => [id, segue && {
20447
+ target: segue.target
20448
+ }]));
20435
20449
  }
20436
20450
 
20437
20451
  function safeJsonParse(value) {