@dcloudio/uni-cli-shared 2.0.1-alpha-36920221114002 → 2.0.1-alpha-36920221117002

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.
@@ -125,18 +125,24 @@ export default {
125
125
  methods: {
126
126
  setNavigationBarTitle () {
127
127
  uni.setNavigationBarTitle({
128
+ // #ifndef MP
128
129
  __page__: this.__$page,
130
+ // #endif
129
131
  title: this.title
130
132
  })
131
133
  },
132
134
  setNavigationBarLoading () {
133
135
  uni[(this.loading ? 'show' : 'hide') + 'NavigationBarLoading']({
136
+ // #ifndef MP
134
137
  __page__: this.__$page
138
+ // #endif
135
139
  })
136
140
  },
137
141
  setNavigationBarColor () {
138
142
  uni.setNavigationBarColor({
143
+ // #ifndef MP
139
144
  __page__: this.__$page,
145
+ // #endif
140
146
  frontColor: this.frontColor,
141
147
  backgroundColor: this.backgroundColor,
142
148
  animation: {
package/lib/pages.js CHANGED
@@ -463,7 +463,10 @@ function initAutoImportComponents (easycom = {}) {
463
463
  }
464
464
  initBuiltInEasycom(BUILT_IN_EASYCOMS, usingAutoImportComponents)
465
465
  // 目前仅 mp-weixin 内置支持 page-meta 等组件
466
- if (process.env.UNI_PLATFORM !== 'mp-weixin') {
466
+ if (process.env.UNI_PLATFORM === 'mp-weixin') {
467
+ } else if (process.env.UNI_PLATFORM === 'mp-alipay') {
468
+ initBuiltInEasycom(BUILT_IN_COMPONENTS_ALIPAY, usingAutoImportComponents)
469
+ } else {
467
470
  initBuiltInEasycom(BUILT_IN_COMPONENTS, usingAutoImportComponents)
468
471
  }
469
472
 
@@ -530,6 +533,7 @@ function parseUsingAutoImportComponents (usingAutoImportComponents) {
530
533
  }
531
534
 
532
535
  const BUILT_IN_COMPONENTS = ['page-meta', 'navigation-bar', 'uni-match-media']
536
+ const BUILT_IN_COMPONENTS_ALIPAY = ['navigation-bar']
533
537
 
534
538
  const BUILT_IN_EASYCOMS = ['unicloud-db', 'uniad', 'ad-rewarded-video', 'ad-fullscreen-video', 'ad-interstitial',
535
539
  'ad-interactive'
package/lib/uts/utils.js CHANGED
@@ -1,6 +1,37 @@
1
+ const fs = require('fs')
2
+ const path = require('path')
1
3
  const {
2
4
  normalizePath
3
5
  } = require('../util')
6
+
7
+ function hasProjectYarn (cwd) {
8
+ return fs.existsSync(path.join(cwd, 'yarn.lock'))
9
+ }
10
+
11
+ function hasProjectPnpm (cwd) {
12
+ return fs.existsSync(path.join(cwd, 'pnpm-lock.yaml'))
13
+ }
14
+
15
+ function getInstallCommand (cwd) {
16
+ return hasProjectYarn(cwd)
17
+ ? 'yarn add'
18
+ : hasProjectPnpm(cwd)
19
+ ? 'pnpm i'
20
+ : 'npm i'
21
+ }
22
+
23
+ function installDepTips (
24
+ type,
25
+ module,
26
+ version
27
+ ) {
28
+ const command =
29
+ `${getInstallCommand(process.cwd())} ${module + (version ? '@' + version : '')}${type === 'devDependencies' ? ' -D' : ''}`
30
+ return `Cannot find module: ${module}
31
+ Please run \`${command}\` and try again.`
32
+ }
33
+
4
34
  module.exports = {
5
- normalizePath
35
+ normalizePath,
36
+ installDepTips
6
37
  }
package/lib/uts/uts.js CHANGED
@@ -87,10 +87,14 @@ function resolveUTSCompiler() {
87
87
  paths: [process.env.UNI_CLI_CONTEXT],
88
88
  });
89
89
  }
90
- catch (e) { }
91
- }
92
- if (!compilerPath) {
93
- throw 'uts compiler is not found';
90
+ catch (e) {
91
+ let version = require('@dcloudio/uni-cli-shared/package.json').version;
92
+ if (version.startsWith('2.0.')) {
93
+ version = '^3.0.0-alpha-3060920221117001';
94
+ }
95
+ console.error((0, utils_1.installDepTips)('devDependencies', '@dcloudio/uni-uts-v1', version));
96
+ process.exit(0);
97
+ }
94
98
  }
95
99
  return require(compilerPath);
96
100
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "2.0.1-alpha-36920221114002",
3
+ "version": "2.0.1-alpha-36920221117002",
4
4
  "description": "uni-cli-shared",
5
5
  "main": "lib/index.js",
6
6
  "repository": {
@@ -25,5 +25,5 @@
25
25
  "postcss-urlrewrite": "^0.2.2",
26
26
  "strip-json-comments": "^2.0.1"
27
27
  },
28
- "gitHead": "b54a41b95819e420dac9fb6ca5fe8c8d44021ece"
28
+ "gitHead": "c3b10d572732e9bdd0e7658f04f3b5586e31a5b0"
29
29
  }