@dcloudio/uni-cli-shared 2.0.2-alpha-3061620230106001 → 2.0.2-alpha-3061620230109002
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/components/page-meta.vue +16 -18
- package/lib/pages.js +2 -11
- package/lib/uts/uts.js +1 -64
- package/package.json +2 -3
package/components/page-meta.vue
CHANGED
|
@@ -53,10 +53,10 @@ export default {
|
|
|
53
53
|
pageStyle: {
|
|
54
54
|
type: String,
|
|
55
55
|
default: ''
|
|
56
|
-
},
|
|
57
|
-
enablePullDownRefresh: {
|
|
58
|
-
type: [Boolean, String],
|
|
59
|
-
default: false
|
|
56
|
+
},
|
|
57
|
+
enablePullDownRefresh: {
|
|
58
|
+
type: [Boolean, String],
|
|
59
|
+
default: false
|
|
60
60
|
},
|
|
61
61
|
rootFontSize: {
|
|
62
62
|
type: String,
|
|
@@ -81,8 +81,8 @@ export default {
|
|
|
81
81
|
// 父节点一定是 page
|
|
82
82
|
this.$pageVm.$on('hook:onPageScroll', evt => {
|
|
83
83
|
this.$emit('scroll', evt)
|
|
84
|
-
})
|
|
85
|
-
|
|
84
|
+
})
|
|
85
|
+
|
|
86
86
|
// #ifdef APP-PLUS
|
|
87
87
|
this._currentWebview = page.$getAppWebview()
|
|
88
88
|
if (this.enablePullDownRefresh) {
|
|
@@ -90,7 +90,7 @@ export default {
|
|
|
90
90
|
}
|
|
91
91
|
this.$watch('enablePullDownRefresh', (val) => {
|
|
92
92
|
this.setPullDownRefresh(this._currentWebview, val)
|
|
93
|
-
})
|
|
93
|
+
})
|
|
94
94
|
// #endif
|
|
95
95
|
|
|
96
96
|
// props
|
|
@@ -124,18 +124,16 @@ export default {
|
|
|
124
124
|
this.setPageMeta()
|
|
125
125
|
}
|
|
126
126
|
this.backgroundTextStyle && this.setBackgroundTextStyle()
|
|
127
|
-
},
|
|
128
|
-
mounted () {
|
|
129
127
|
this.scrollTop && this.pageScrollTo()
|
|
130
128
|
},
|
|
131
|
-
methods: {
|
|
132
|
-
setPullDownRefresh (webview, enabled) {
|
|
133
|
-
webview.setStyle({
|
|
134
|
-
pullToRefresh: {
|
|
135
|
-
support: enabled,
|
|
136
|
-
style: plus.os.name === 'Android' ? 'circle' : 'default'
|
|
137
|
-
}
|
|
138
|
-
})
|
|
129
|
+
methods: {
|
|
130
|
+
setPullDownRefresh (webview, enabled) {
|
|
131
|
+
webview.setStyle({
|
|
132
|
+
pullToRefresh: {
|
|
133
|
+
support: enabled,
|
|
134
|
+
style: plus.os.name === 'Android' ? 'circle' : 'default'
|
|
135
|
+
}
|
|
136
|
+
})
|
|
139
137
|
},
|
|
140
138
|
setPageMeta () {
|
|
141
139
|
// h5 和 app-plus 设置 rootFontSize
|
|
@@ -189,4 +187,4 @@ export default {
|
|
|
189
187
|
}
|
|
190
188
|
}
|
|
191
189
|
}
|
|
192
|
-
</script>
|
|
190
|
+
</script>
|
package/lib/pages.js
CHANGED
|
@@ -425,16 +425,6 @@ function initAutoComponents () {
|
|
|
425
425
|
|
|
426
426
|
function initAutoImportScanComponents () {
|
|
427
427
|
const components = initAutoComponents()
|
|
428
|
-
|
|
429
|
-
const {
|
|
430
|
-
initUTSComponents
|
|
431
|
-
} = require('./uts/uts.js')
|
|
432
|
-
|
|
433
|
-
initUTSComponents(process.env.UNI_INPUT_DIR, process.env.UNI_PLATFORM).forEach((item) => {
|
|
434
|
-
components[item.pattern.source] = item.replacement.replace('\0', '').replace('?uts-proxy',
|
|
435
|
-
'/package.json?uts-proxy')
|
|
436
|
-
})
|
|
437
|
-
|
|
438
428
|
if (process.env.UNI_PLATFORM === 'quickapp-native') {
|
|
439
429
|
if (!uniQuickAppAutoImportScanComponents) {
|
|
440
430
|
uniQuickAppAutoImportScanComponents = getAutoComponentsByDir(
|
|
@@ -473,7 +463,8 @@ function initAutoImportComponents (easycom = {}) {
|
|
|
473
463
|
}
|
|
474
464
|
initBuiltInEasycom(BUILT_IN_EASYCOMS, usingAutoImportComponents)
|
|
475
465
|
// 目前仅 mp-weixin 内置支持 page-meta 等组件
|
|
476
|
-
if (process.env.UNI_PLATFORM === 'mp-weixin') {
|
|
466
|
+
if (process.env.UNI_PLATFORM === 'mp-weixin') {
|
|
467
|
+
} else if (process.env.UNI_PLATFORM === 'mp-alipay') {
|
|
477
468
|
initBuiltInEasycom(BUILT_IN_COMPONENTS_ALIPAY, usingAutoImportComponents)
|
|
478
469
|
} else {
|
|
479
470
|
initBuiltInEasycom(BUILT_IN_COMPONENTS, usingAutoImportComponents)
|
package/lib/uts/uts.js
CHANGED
|
@@ -3,10 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.resolveUTSCompiler = exports.resolveUtsModule = exports.resolveUtsAppModule = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
10
9
|
const hbx_1 = require("./hbx");
|
|
11
10
|
const utils_1 = require("./utils");
|
|
12
11
|
/**
|
|
@@ -100,65 +99,3 @@ function resolveUTSCompiler() {
|
|
|
100
99
|
return require(compilerPath);
|
|
101
100
|
}
|
|
102
101
|
exports.resolveUTSCompiler = resolveUTSCompiler;
|
|
103
|
-
function initUTSComponents(inputDir, platform) {
|
|
104
|
-
const components = [];
|
|
105
|
-
if (platform !== 'app' && platform !== 'app-plus') {
|
|
106
|
-
return components;
|
|
107
|
-
}
|
|
108
|
-
const easycomsObj = Object.create(null);
|
|
109
|
-
const dirs = resolveUTSComponentDirs(inputDir);
|
|
110
|
-
dirs.forEach((dir) => {
|
|
111
|
-
const is_uni_modules_utssdk = dir.endsWith('utssdk');
|
|
112
|
-
const is_ussdk = !is_uni_modules_utssdk && path_1.default.dirname(dir).endsWith('utssdk');
|
|
113
|
-
if (is_uni_modules_utssdk || is_ussdk) {
|
|
114
|
-
fast_glob_1.default
|
|
115
|
-
.sync('**/*.vue', {
|
|
116
|
-
cwd: dir,
|
|
117
|
-
absolute: true,
|
|
118
|
-
})
|
|
119
|
-
.forEach((file) => {
|
|
120
|
-
let name = parseVueComponentName(file);
|
|
121
|
-
if (!name) {
|
|
122
|
-
if (file.endsWith('index.vue')) {
|
|
123
|
-
name = path_1.default.basename(is_uni_modules_utssdk ? path_1.default.dirname(dir) : dir);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
if (name) {
|
|
127
|
-
const importDir = (0, utils_1.normalizePath)(is_uni_modules_utssdk ? path_1.default.dirname(dir) : dir);
|
|
128
|
-
easycomsObj[`^${name}$`] = `\0${importDir}?uts-proxy`;
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
Object.keys(easycomsObj).forEach((name) => {
|
|
134
|
-
components.push({
|
|
135
|
-
pattern: new RegExp(name),
|
|
136
|
-
replacement: easycomsObj[name],
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
return components;
|
|
140
|
-
}
|
|
141
|
-
exports.initUTSComponents = initUTSComponents;
|
|
142
|
-
function resolveUTSComponentDirs(inputDir) {
|
|
143
|
-
const utssdkDir = path_1.default.resolve(inputDir, 'utssdk');
|
|
144
|
-
const uniModulesDir = path_1.default.resolve(inputDir, 'uni_modules');
|
|
145
|
-
return fast_glob_1.default
|
|
146
|
-
.sync('*', {
|
|
147
|
-
cwd: utssdkDir,
|
|
148
|
-
absolute: true,
|
|
149
|
-
onlyDirectories: true,
|
|
150
|
-
})
|
|
151
|
-
.concat(fast_glob_1.default.sync('*/utssdk', {
|
|
152
|
-
cwd: uniModulesDir,
|
|
153
|
-
absolute: true,
|
|
154
|
-
onlyDirectories: true,
|
|
155
|
-
}));
|
|
156
|
-
}
|
|
157
|
-
const nameRE = /name\s*:\s*['|"](.*)['|"]/;
|
|
158
|
-
function parseVueComponentName(file) {
|
|
159
|
-
const content = fs_1.default.readFileSync(file, 'utf8');
|
|
160
|
-
const matches = content.match(nameRE);
|
|
161
|
-
if (matches) {
|
|
162
|
-
return matches[1];
|
|
163
|
-
}
|
|
164
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-cli-shared",
|
|
3
|
-
"version": "2.0.2-alpha-
|
|
3
|
+
"version": "2.0.2-alpha-3061620230109002",
|
|
4
4
|
"description": "uni-cli-shared",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -20,11 +20,10 @@
|
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"escape-string-regexp": "^4.0.0",
|
|
23
|
-
"fast-glob": "^3.2.11",
|
|
24
23
|
"glob-escape": "^0.0.2",
|
|
25
24
|
"hash-sum": "^1.0.2",
|
|
26
25
|
"postcss-urlrewrite": "^0.2.2",
|
|
27
26
|
"strip-json-comments": "^2.0.1"
|
|
28
27
|
},
|
|
29
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "fefb2b2fb035d3909588b8fc31fb0147c38f3148"
|
|
30
29
|
}
|