babel-plugin-hylid-bridge 2.4.0-alpha.1 → 2.4.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 +36 -0
- package/lib/getLibraryDir.js +1 -1
- package/lib/index.js +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,42 @@
|
|
|
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.4.0](https://code.alipay.com/ant-ife/hylid-bridge/compare/v2.4.0-alpha.4...v2.4.0) (2022-08-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package babel-plugin-hylid-bridge
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.4.0-alpha.4](https://code.alipay.com/ant-ife/hylid-bridge/compare/v2.1.0...v2.4.0-alpha.4) (2022-08-18)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* 避免频繁打印日志* 不修改全局的 my, 新建本地变量* 调整 eslint 配置* 根据源码注入 hylid-bridge 相应模块* 固定三方依赖版本号* 适配 Remix 中会编译所有 node_modules 下模块的逻辑
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* 依赖* build error* split the target
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## [2.4.0-alpha.3](https://code.alipay.com/ant-ife/hylid-bridge/compare/v2.4.0-alpha.2...v2.4.0-alpha.3) (2022-08-17)
|
|
27
|
+
|
|
28
|
+
**Note:** Version bump only for package babel-plugin-hylid-bridge
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## [2.4.0-alpha.2](https://code.alipay.com/ant-ife/hylid-bridge/compare/v2.4.0-alpha.1...v2.4.0-alpha.2) (2022-08-16)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
* 避免频繁打印日志* 适配 Remix 中会编译所有 node_modules 下模块的逻辑
|
|
40
|
+
|
|
41
|
+
|
|
6
42
|
## [2.4.0-alpha.1](https://code.alipay.com/ant-ife/hylid-bridge/compare/v2.4.0-alpha.0...v2.4.0-alpha.1) (2022-08-15)
|
|
7
43
|
|
|
8
44
|
|
package/lib/getLibraryDir.js
CHANGED
|
@@ -17,11 +17,11 @@ function getLibraryDir() {
|
|
|
17
17
|
libraryDir = process.env.HYLID_BRIDGE_PACKAGE_DIR || require.resolve('hylid-bridge/package.json', {
|
|
18
18
|
paths: [cwd]
|
|
19
19
|
}).replace('package.json', '');
|
|
20
|
+
(0, _utils.log)("Find the hylid-bridge package: ".concat(libraryDir));
|
|
20
21
|
} catch (e) {
|
|
21
22
|
(0, _utils.error)("Can not resolve the hylid-bridge package from the directory: ".concat(cwd, "."), e);
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
(0, _utils.log)("Find the hylid-bridge package: ".concat(libraryDir));
|
|
26
26
|
return libraryDir;
|
|
27
27
|
}
|
package/lib/index.js
CHANGED
|
@@ -104,12 +104,14 @@ var _default = function _default(_, opts) {
|
|
|
104
104
|
name: 'babel-plugin-hylid-bridge',
|
|
105
105
|
visitor: {
|
|
106
106
|
MemberExpression: function MemberExpression(path, state) {
|
|
107
|
-
var _this
|
|
107
|
+
var _this$filename,
|
|
108
|
+
_this = this;
|
|
108
109
|
|
|
109
110
|
var objectName = path.node.object.name;
|
|
110
111
|
var propertyName = path.node.property.name;
|
|
111
112
|
|
|
112
|
-
if (
|
|
113
|
+
if ( // Remix 中会编译所有 node_modules 下的模块
|
|
114
|
+
(_this$filename = this.filename) !== null && _this$filename !== void 0 && _this$filename.includes("".concat(_path.default.sep, "node_modules").concat(_path.default.sep, "hylid-bridge").concat(_path.default.sep)) || !targets || !targets.length || objectName !== 'my' || path.scope.hasBinding('my')) {
|
|
113
115
|
return;
|
|
114
116
|
}
|
|
115
117
|
|