@next-core/brick-utils 2.37.26 → 2.38.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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
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.38.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.26...@next-core/brick-utils@2.38.0) (2022-08-08)
7
+
8
+
9
+ ### Features
10
+
11
+ * support INSTALLED_APPS in standalone mode ([c152053](https://github.com/easyops-cn/next-core/commit/c1520532597c88d1def251aafd44831c7a7fad56))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.37.26](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.25...@next-core/brick-utils@2.37.26) (2022-07-20)
7
18
 
8
19
  **Note:** Version bump only for package @next-core/brick-utils
@@ -20802,7 +20802,7 @@
20802
20802
  loc: {
20803
20803
  start: node.loc.start,
20804
20804
  end: {
20805
- line: node.loc.end.line,
20805
+ line: node.loc.start.line,
20806
20806
  // Only decorate the "var".
20807
20807
  column: node.loc.start.column + 3
20808
20808
  }
@@ -23035,6 +23035,39 @@
23035
23035
  };
23036
23036
  }
23037
23037
 
23038
+ var INSTALLED_APPS = "INSTALLED_APPS";
23039
+ var has = "has";
23040
+ function scanInstalledAppsInStoryboard(storyboard) {
23041
+ var _storyboard$meta;
23042
+
23043
+ var collection = new Set();
23044
+ var beforeVisitInstalledApps = beforeVisitInstalledAppsFactory(collection);
23045
+ var {
23046
+ customTemplates,
23047
+ functions
23048
+ } = (_storyboard$meta = storyboard.meta) !== null && _storyboard$meta !== void 0 ? _storyboard$meta : {};
23049
+ visitStoryboardExpressions([storyboard.routes, customTemplates], beforeVisitInstalledApps, INSTALLED_APPS);
23050
+ visitStoryboardFunctions(functions, beforeVisitInstalledApps);
23051
+ return Array.from(collection);
23052
+ }
23053
+
23054
+ function beforeVisitInstalledAppsFactory(collection) {
23055
+ return function beforeVisitPermissions(node, parent) {
23056
+ if (node.name === INSTALLED_APPS) {
23057
+ var memberParent = parent[parent.length - 1];
23058
+ var callParent = parent[parent.length - 2];
23059
+
23060
+ 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 === has) {
23061
+ var args = callParent.node.arguments;
23062
+
23063
+ if (args.length > 0 && args[0].type === "Literal" && typeof args[0].value === "string") {
23064
+ collection.add(args[0].value);
23065
+ }
23066
+ }
23067
+ }
23068
+ };
23069
+ }
23070
+
23038
23071
  Object.defineProperty(exports, 'pipes', {
23039
23072
  enumerable: true,
23040
23073
  get: function () { return pipes.pipes; }
@@ -23085,6 +23118,7 @@
23085
23118
  exports.scanCustomApisInStoryboard = scanCustomApisInStoryboard;
23086
23119
  exports.scanI18NInAny = scanI18NInAny;
23087
23120
  exports.scanI18NInStoryboard = scanI18NInStoryboard;
23121
+ exports.scanInstalledAppsInStoryboard = scanInstalledAppsInStoryboard;
23088
23122
  exports.scanPermissionActionsInAny = scanPermissionActionsInAny;
23089
23123
  exports.scanPermissionActionsInStoryboard = scanPermissionActionsInStoryboard;
23090
23124
  exports.scanProcessorsInAny = scanProcessorsInAny;