babel-plugin-hylid-bridge 2.12.0-alpha.4 → 2.12.0-alpha.6

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,24 @@
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.12.0-alpha.6] (2023-07-21)
7
+
8
+
9
+ ### Features
10
+
11
+ * 判断 ts 文件
12
+
13
+
14
+
15
+ ## [2.12.0-alpha.5] (2023-07-20)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * 检查文件是否存在
21
+
22
+
23
+
6
24
  ## [2.12.0-alpha.4] (2023-07-20)
7
25
 
8
26
 
package/lib/index.js CHANGED
@@ -48,7 +48,7 @@ function isApiExists(name, target, libraryDir, polyfillDir) {
48
48
  if (targetSplit.length !== 2) {
49
49
  throw new Error("Wrong target configuration: ".concat(target, "."));
50
50
  }
51
- return _fsExtra.default.existsSync(_path.default.resolve(libraryDir, "./lib/clients/".concat(targetSplit[0], "/").concat(targetSplit[1], "/").concat(name, ".js"))) || polyfillDir && _fsExtra.default.existsSync(_path.default.resolve(polyfillDir, "./".concat(targetSplit[0], "/").concat(targetSplit[1], "/").concat(name, ".js")));
51
+ return _fsExtra.default.existsSync(_path.default.resolve(libraryDir, "./lib/clients/".concat(targetSplit[0], "/").concat(targetSplit[1], "/").concat(name, ".js"))) || polyfillDir && (_fsExtra.default.existsSync(_path.default.resolve(polyfillDir, "./".concat(targetSplit[0], "/").concat(targetSplit[1], "/").concat(name, ".js"))) || _fsExtra.default.existsSync(_path.default.resolve(polyfillDir, "./".concat(targetSplit[0], "/").concat(targetSplit[1], "/").concat(name, ".ts"))));
52
52
  }
53
53
  function getUserAppEnvPath(appEnvPath) {
54
54
  var realAppEnvPath = appEnvPath !== null && appEnvPath !== void 0 ? appEnvPath : _path.default.resolve(process.cwd(), './src/appEnv.ts');
@@ -194,7 +194,8 @@ var _default = function _default(core, opts) {
194
194
  nodes.push.apply(nodes, (0, _toConsumableArray2.default)(targets.map(function (target) {
195
195
  var targetSplit = splitTarget(target);
196
196
  var innerIndexPath = "".concat(libraryName, "/lib/clients/").concat(targetSplit[0], "/").concat(targetSplit[1], "/index");
197
- var normalizedIndexPath = polyfillDir ? (0, _combineExports.default)(require.resolve(innerIndexPath), _path.default.resolve(polyfillDir, targetSplit[0], targetSplit[1])) : innerIndexPath;
197
+ var polyfillIndexPath = polyfillDir && _path.default.resolve(polyfillDir, targetSplit[0], targetSplit[1], 'index');
198
+ var normalizedIndexPath = polyfillIndexPath && (_fsExtra.default.existsSync("".concat(polyfillIndexPath, ".js")) || _fsExtra.default.existsSync("".concat(polyfillIndexPath, ".ts"))) ? (0, _combineExports.default)(require.resolve(innerIndexPath), polyfillIndexPath) : innerIndexPath;
198
199
  return babelTypes.importDeclaration([babelTypes.importDefaultSpecifier(babelTypes.identifier("".concat(identifierPrefix).concat(targetSplit[0], "_").concat(targetSplit[1], "_my__")))], babelTypes.stringLiteral(normalizedIndexPath));
199
200
  })));
200
201
  var buildElseIf = function buildElseIf(targetList) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-plugin-hylid-bridge",
3
- "version": "2.12.0-alpha.4",
3
+ "version": "2.12.0-alpha.6",
4
4
  "description": "babel-plugin-hylid-bridge",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "devDependencies": {
23
23
  "babel-plugin-tester": "^10.1.0",
24
- "hylid-bridge": "^2.12.0-alpha.4"
24
+ "hylid-bridge": "^2.12.0-alpha.6"
25
25
  },
26
26
  "sideEffects": false,
27
27
  "registry": "https://registry.npmjs.org/"