@dcloudio/uni-cli-shared 3.0.0-alpha-3060420220922004 → 3.0.0-alpha-3060420220922005

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.
@@ -26,36 +26,37 @@ function uniModulesExportsPlugin({ enable, }) {
26
26
  if (!enable) {
27
27
  return '';
28
28
  }
29
- const uniModulesDir = path_1.default.resolve(process.env.UNI_INPUT_DIR, 'uni_modules');
30
- if (!fs_extra_1.default.existsSync(uniModulesDir)) {
31
- return '';
32
- }
33
- const importCodes = [];
34
- const assignCodes = [];
35
- fs_extra_1.default.readdirSync(uniModulesDir).forEach((uniModuleDir) => {
36
- var _a, _b;
37
- const pkgPath = path_1.default.resolve(uniModulesDir, uniModuleDir, 'package.json');
38
- if (!fs_extra_1.default.existsSync(pkgPath)) {
39
- return;
40
- }
41
- const exports = (_b = (_a = (0, json_1.parseJson)(fs_extra_1.default.readFileSync(pkgPath, 'utf8'))) === null || _a === void 0 ? void 0 : _a.uni_modules) === null || _b === void 0 ? void 0 : _b.exports;
42
- if (exports) {
43
- const [exportsImportCodes, exportsAssignCodes] = parseExports(process.env.UNI_PLATFORM === 'h5'
44
- ? 'web'
45
- : process.env.UNI_PLATFORM, `@/uni_modules/${uniModuleDir}`, exports);
46
- importCodes.push(...exportsImportCodes);
47
- assignCodes.push(...exportsAssignCodes);
48
- }
49
- });
50
- if (!importCodes.length) {
51
- return '';
52
- }
53
- return `${importCodes.join('\n')}
54
- ${assignCodes.join('\n')}`;
29
+ return genUniModulesExports();
55
30
  },
56
31
  };
57
32
  }
58
33
  exports.uniModulesExportsPlugin = uniModulesExportsPlugin;
34
+ function genUniModulesExports() {
35
+ const uniModulesDir = path_1.default.resolve(process.env.UNI_INPUT_DIR, 'uni_modules');
36
+ if (!fs_extra_1.default.existsSync(uniModulesDir)) {
37
+ return '';
38
+ }
39
+ const importCodes = [];
40
+ const assignCodes = [];
41
+ fs_extra_1.default.readdirSync(uniModulesDir).forEach((uniModuleDir) => {
42
+ var _a, _b;
43
+ const pkgPath = path_1.default.resolve(uniModulesDir, uniModuleDir, 'package.json');
44
+ if (!fs_extra_1.default.existsSync(pkgPath)) {
45
+ return;
46
+ }
47
+ const exports = (_b = (_a = (0, json_1.parseJson)(fs_extra_1.default.readFileSync(pkgPath, 'utf8'))) === null || _a === void 0 ? void 0 : _a.uni_modules) === null || _b === void 0 ? void 0 : _b.exports;
48
+ if (exports) {
49
+ const [exportsImportCodes, exportsAssignCodes] = parseExports(process.env.UNI_PLATFORM === 'h5' ? 'web' : process.env.UNI_PLATFORM, `@/uni_modules/${uniModuleDir}`, exports);
50
+ importCodes.push(...exportsImportCodes);
51
+ assignCodes.push(...exportsAssignCodes);
52
+ }
53
+ });
54
+ if (!importCodes.length) {
55
+ return '';
56
+ }
57
+ return `${importCodes.join('\n')}
58
+ ${assignCodes.join('\n')}`;
59
+ }
59
60
  function parseExports(platform, source, exports = {}) {
60
61
  const rootDefines = {};
61
62
  Object.keys(exports).forEach((name) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "3.0.0-alpha-3060420220922004",
3
+ "version": "3.0.0-alpha-3060420220922005",
4
4
  "description": "@dcloudio/uni-cli-shared",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,17 +25,17 @@
25
25
  "@babel/core": "^7.18.13",
26
26
  "@babel/parser": "^7.18.13",
27
27
  "@babel/types": "^7.17.0",
28
- "@dcloudio/uni-i18n": "3.0.0-alpha-3060420220922004",
29
- "@dcloudio/uni-shared": "3.0.0-alpha-3060420220922004",
28
+ "@dcloudio/uni-i18n": "3.0.0-alpha-3060420220922005",
29
+ "@dcloudio/uni-shared": "3.0.0-alpha-3060420220922005",
30
30
  "@intlify/core-base": "9.1.9",
31
31
  "@intlify/shared": "9.1.9",
32
32
  "@intlify/vue-devtools": "9.1.9",
33
33
  "@rollup/pluginutils": "^4.2.0",
34
- "@vue/compiler-core": "3.2.39",
35
- "@vue/compiler-dom": "3.2.39",
36
- "@vue/compiler-sfc": "3.2.39",
37
- "@vue/server-renderer": "3.2.39",
38
- "@vue/shared": "3.2.39",
34
+ "@vue/compiler-core": "3.2.40",
35
+ "@vue/compiler-dom": "3.2.40",
36
+ "@vue/compiler-sfc": "3.2.40",
37
+ "@vue/server-renderer": "3.2.40",
38
+ "@vue/shared": "3.2.40",
39
39
  "autoprefixer": "^10.4.12",
40
40
  "base64url": "^3.0.1",
41
41
  "chokidar": "^3.5.3",
@@ -76,6 +76,6 @@
76
76
  "@types/sass": "^1.43.1",
77
77
  "@types/stylus": "^0.48.36",
78
78
  "postcss": "^8.4.16",
79
- "vue": "3.2.39"
79
+ "vue": "3.2.40"
80
80
  }
81
81
  }