@next-core/brick-utils 2.36.0 → 2.37.2

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,36 @@
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.37.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.1...@next-core/brick-utils@2.37.2) (2022-03-28)
7
+
8
+ **Note:** Version bump only for package @next-core/brick-utils
9
+
10
+
11
+
12
+
13
+
14
+ ## [2.37.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.0...@next-core/brick-utils@2.37.1) (2022-03-24)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * ignore `previewSettings` when building route node ([8cffb40](https://github.com/easyops-cn/next-core/commit/8cffb40b0c583a989c29518a1ed3ef2c8b24ad62))
20
+
21
+
22
+
23
+
24
+
25
+ # [2.37.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.36.0...@next-core/brick-utils@2.37.0) (2022-03-24)
26
+
27
+
28
+ ### Features
29
+
30
+ * support APP.getMenu ([#1651](https://github.com/easyops-cn/next-core/issues/1651)) ([5b9f53a](https://github.com/easyops-cn/next-core/commit/5b9f53a3367087a062f415dd68070f15b98bf966))
31
+
32
+
33
+
34
+
35
+
6
36
  # [2.36.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.35.3...@next-core/brick-utils@2.36.0) (2022-03-18)
7
37
 
8
38
 
@@ -21058,6 +21058,46 @@
21058
21058
  };
21059
21059
  }
21060
21060
 
21061
+ var APP = "APP";
21062
+ var GET_MENUS = "getMenu";
21063
+ function scanAppGetMenuInStoryboard(storyboard) {
21064
+ var _storyboard$meta;
21065
+
21066
+ var collection = new Set();
21067
+ var beforeVisitPermissions = beforeVisitAppFactory(collection);
21068
+ var {
21069
+ customTemplates,
21070
+ functions
21071
+ } = (_storyboard$meta = storyboard.meta) !== null && _storyboard$meta !== void 0 ? _storyboard$meta : {};
21072
+ visitStoryboardExpressions([storyboard.routes, customTemplates], beforeVisitPermissions, APP);
21073
+ visitStoryboardFunctions(functions, beforeVisitPermissions);
21074
+ return Array.from(collection);
21075
+ }
21076
+ function scanAppGetMenuInAny(data) {
21077
+ var collection = new Set();
21078
+ visitStoryboardExpressions(data, beforeVisitAppFactory(collection), APP);
21079
+ return Array.from(collection);
21080
+ }
21081
+
21082
+ function beforeVisitAppFactory(collection) {
21083
+ return function beforeVisitAPP(node, parent) {
21084
+ if (node.name === APP) {
21085
+ var memberParent = parent[parent.length - 1];
21086
+ var callParent = parent[parent.length - 2];
21087
+
21088
+ if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === "CallExpression" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === "callee" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === "MemberExpression" && memberParent.key === "object" && !memberParent.node.computed && memberParent.node.property.type === "Identifier" && memberParent.node.property.name === GET_MENUS) {
21089
+ if (callParent.node.arguments.length === 1) {
21090
+ var menuId = callParent.node.arguments[0];
21091
+
21092
+ if (menuId.type === "Literal" && typeof menuId.value === "string") {
21093
+ collection.add(menuId.value);
21094
+ }
21095
+ }
21096
+ }
21097
+ }
21098
+ };
21099
+ }
21100
+
21061
21101
  var LexicalStatus;
21062
21102
 
21063
21103
  (function (LexicalStatus) {
@@ -21960,7 +22000,7 @@
21960
22000
 
21961
22001
  var yamlFieldsInBrick = ["permissionsPreCheck", "transformFrom"]; // Fields started with `_` will be removed by default.
21962
22002
 
21963
- var baseFieldsToRemove = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
22003
+ var baseFieldsToRemove = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "previewSettings", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
21964
22004
  var fieldsToRemoveInRoute = baseFieldsToRemove.concat("instanceId");
21965
22005
  var fieldsToRemoveInBrick = baseFieldsToRemove.concat("type", "alias"); // Those fields can be disposed if value is null.
21966
22006
 
@@ -22209,6 +22249,8 @@
22209
22249
  exports.prefetchScript = prefetchScript;
22210
22250
  exports.resolveContextConcurrently = resolveContextConcurrently;
22211
22251
  exports.restoreDynamicTemplates = restoreDynamicTemplates;
22252
+ exports.scanAppGetMenuInAny = scanAppGetMenuInAny;
22253
+ exports.scanAppGetMenuInStoryboard = scanAppGetMenuInStoryboard;
22212
22254
  exports.scanBricksInBrickConf = scanBricksInBrickConf;
22213
22255
  exports.scanBricksInStoryboard = scanBricksInStoryboard;
22214
22256
  exports.scanCustomApisInStoryboard = scanCustomApisInStoryboard;