@dcloudio/uni-cli-shared 3.0.0-alpha-3021320211123002 → 3.0.0-alpha-3030020211124001

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/dist/hbx/alias.js CHANGED
@@ -23,7 +23,7 @@ function initModuleAlias() {
23
23
  }
24
24
  exports.initModuleAlias = initModuleAlias;
25
25
  function supportAutoInstallPlugin() {
26
- return true;
26
+ return !!process.env.HX_Version;
27
27
  }
28
28
  function installHBuilderXPlugin(plugin) {
29
29
  if (!supportAutoInstallPlugin()) {
@@ -284,7 +284,7 @@ const DATA_RE = /^data:.*,.*/;
284
284
  function normalizeFilepath(filepath) {
285
285
  if (!(SCHEME_RE.test(filepath) || DATA_RE.test(filepath)) &&
286
286
  filepath.indexOf('/') !== 0) {
287
- return '/' + filepath;
287
+ return (0, uni_shared_1.addLeadingSlash)(filepath);
288
288
  }
289
289
  return filepath;
290
290
  }
@@ -1,2 +1,4 @@
1
1
  export declare const COMPONENT_ON_LINK = "onVI";
2
2
  export declare const COMPONENT_BIND_LINK = "__l";
3
+ export declare const COMPONENT_CUSTOM_HIDDEN = "data-c-h";
4
+ export declare const COMPONENT_CUSTOM_HIDDEN_BIND: string;
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COMPONENT_BIND_LINK = exports.COMPONENT_ON_LINK = void 0;
3
+ exports.COMPONENT_CUSTOM_HIDDEN_BIND = exports.COMPONENT_CUSTOM_HIDDEN = exports.COMPONENT_BIND_LINK = exports.COMPONENT_ON_LINK = void 0;
4
4
  exports.COMPONENT_ON_LINK = 'onVI';
5
5
  exports.COMPONENT_BIND_LINK = '__l';
6
+ exports.COMPONENT_CUSTOM_HIDDEN = 'data-c-h';
7
+ exports.COMPONENT_CUSTOM_HIDDEN_BIND = 'bind:-' + exports.COMPONENT_CUSTOM_HIDDEN;
@@ -39,6 +39,12 @@ export interface MiniProgramCompilerOptions {
39
39
  filter?: {
40
40
  lang: string;
41
41
  };
42
+ component?: {
43
+ /**
44
+ * 自定义组件自定义 hidden 属性用于实现 v-show
45
+ */
46
+ vShow: string;
47
+ };
42
48
  directive: string;
43
49
  emitFile?: (emittedFile: EmittedAsset) => string;
44
50
  }
@@ -12,6 +12,7 @@ const magic_string_1 = __importDefault(require("magic-string"));
12
12
  const messages_1 = require("../messages");
13
13
  const constants_1 = require("../constants");
14
14
  const utils_1 = require("../utils");
15
+ const uni_shared_1 = require("@dcloudio/uni-shared");
15
16
  async function transformVueComponentImports(code, importer, { root, resolve, global, dynamicImport, babelParserPlugins, }) {
16
17
  if (!global && !code.includes(constants_1.BINDING_COMPONENTS)) {
17
18
  return { code, usingComponents: {} };
@@ -32,8 +33,7 @@ async function transformVueComponentImports(code, importer, { root, resolve, glo
32
33
  s.overwrite(start, end, dynamicImport(specifier.local.name, resolveId.id) + ';');
33
34
  const componentName = (0, shared_1.hyphenate)(tag);
34
35
  if (!usingComponents[componentName]) {
35
- usingComponents[componentName] =
36
- '/' + (0, utils_1.removeExt)((0, utils_1.normalizeMiniProgramFilename)(resolveId.id, root));
36
+ usingComponents[componentName] = (0, uni_shared_1.addLeadingSlash)((0, utils_1.removeExt)((0, utils_1.normalizeMiniProgramFilename)(resolveId.id, root)));
37
37
  }
38
38
  }
39
39
  }
@@ -1,7 +1,9 @@
1
1
  import { AttributeNode, ComponentNode, DirectiveNode, ElementNode, RootNode, ExpressionNode, TemplateChildNode, TransformContext } from '@vue/compiler-core';
2
2
  export declare const VUE_REF = "r";
3
3
  export declare const VUE_REF_IN_FOR = "r-i-f";
4
- export declare function isUserComponent(node: RootNode | TemplateChildNode, context: TransformContext): node is ComponentNode;
4
+ export declare function isUserComponent(node: RootNode | TemplateChildNode, context: {
5
+ isBuiltInComponent: TransformContext['isBuiltInComponent'];
6
+ }): node is ComponentNode;
5
7
  export declare function createAttributeNode(name: string, content: string): AttributeNode;
6
8
  export declare function addStaticClass(node: ElementNode, clazz: string): string | number | undefined;
7
9
  export declare function createDirectiveNode(name: string, arg: string, exp: string | ExpressionNode): DirectiveNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "3.0.0-alpha-3021320211123002",
3
+ "version": "3.0.0-alpha-3030020211124001",
4
4
  "description": "@dcloudio/uni-cli-shared",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,8 +20,8 @@
20
20
  "dependencies": {
21
21
  "@babel/parser": "^7.15.0",
22
22
  "@babel/types": "^7.15.0",
23
- "@dcloudio/uni-i18n": "3.0.0-alpha-3021320211123002",
24
- "@dcloudio/uni-shared": "3.0.0-alpha-3021320211123002",
23
+ "@dcloudio/uni-i18n": "3.0.0-alpha-3030020211124001",
24
+ "@dcloudio/uni-shared": "3.0.0-alpha-3030020211124001",
25
25
  "@rollup/pluginutils": "^4.1.1",
26
26
  "@vue/compiler-core": "3.2.22",
27
27
  "@vue/compiler-dom": "3.2.22",