@dcloudio/uni-push 0.0.1-nvue3.3040020220228001 → 3.0.0-3060520221121001
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/uni-push.es.js +132 -39
- package/dist/uni-push.plus.es.js +42 -14
- package/lib/gtpush-min.d.ts +4 -0
- package/lib/gtpush-min.js +32 -16
- package/lib/uni.plugin.js +18 -16
- package/package.json +2 -6
- package/lib/gtpush.map +0 -1
package/lib/uni.plugin.js
CHANGED
@@ -1,18 +1,16 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
var path = require('path');
|
4
|
-
var debug = require('debug');
|
5
4
|
var uniCliShared = require('@dcloudio/uni-cli-shared');
|
6
5
|
|
7
6
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
8
7
|
|
9
8
|
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
10
|
-
var debug__default = /*#__PURE__*/_interopDefaultLegacy(debug);
|
11
9
|
|
12
|
-
const debugPush = debug__default["default"]('uni:push');
|
13
10
|
var index = () => [
|
14
11
|
uniCliShared.defineUniMainJsPlugin((opts) => {
|
15
|
-
let
|
12
|
+
let isEnableV1 = false;
|
13
|
+
let isEnableV2 = false;
|
16
14
|
let isOffline = false;
|
17
15
|
return {
|
18
16
|
name: 'uni:push',
|
@@ -23,36 +21,40 @@ var index = () => [
|
|
23
21
|
}
|
24
22
|
const inputDir = process.env.UNI_INPUT_DIR;
|
25
23
|
const platform = process.env.UNI_PLATFORM;
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
isEnableV1 = uniCliShared.isEnableUniPushV1(inputDir, platform);
|
25
|
+
isEnableV2 = uniCliShared.isEnableUniPushV2(inputDir, platform);
|
26
|
+
// v1
|
27
|
+
if (isEnableV1) {
|
28
|
+
return;
|
29
|
+
}
|
30
|
+
if (!isEnableV2) {
|
29
31
|
return;
|
30
32
|
}
|
31
|
-
|
32
|
-
|
33
|
-
if (
|
33
|
+
// v2
|
34
|
+
isOffline = platform === 'app' && uniCliShared.isUniPushOffline(inputDir);
|
35
|
+
if (isOffline) {
|
34
36
|
return;
|
35
37
|
}
|
36
|
-
debugPush('appid', appid, 'deubg', debug);
|
37
38
|
return {
|
38
39
|
define: {
|
39
|
-
'process.env.
|
40
|
-
'process.env.UNI_PUSH_DEBUG': !!debug,
|
40
|
+
'process.env.UNI_PUSH_DEBUG': false,
|
41
41
|
},
|
42
42
|
};
|
43
43
|
},
|
44
44
|
resolveId(id) {
|
45
45
|
if (id === '@dcloudio/uni-push') {
|
46
|
-
return uniCliShared.resolveBuiltIn(path__default["default"].join('@dcloudio/uni-push', isOffline
|
46
|
+
return uniCliShared.resolveBuiltIn(path__default["default"].join('@dcloudio/uni-push', isOffline || isEnableV1
|
47
|
+
? 'dist/uni-push.plus.es.js'
|
48
|
+
: 'dist/uni-push.es.js'));
|
47
49
|
}
|
48
50
|
},
|
49
51
|
transform(code, id) {
|
50
52
|
if (!opts.filter(id)) {
|
51
53
|
return;
|
52
54
|
}
|
53
|
-
if (
|
55
|
+
if (isEnableV1 || isEnableV2) {
|
54
56
|
return {
|
55
|
-
code:
|
57
|
+
code: `import '@dcloudio/uni-push';` + code,
|
56
58
|
map: null,
|
57
59
|
};
|
58
60
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dcloudio/uni-push",
|
3
|
-
"version": "0.0
|
3
|
+
"version": "3.0.0-3060520221121001",
|
4
4
|
"description": "@dcloudio/uni-push",
|
5
5
|
"main": "lib/uni-push.js",
|
6
6
|
"module": "lib/uni-push.js",
|
@@ -20,10 +20,6 @@
|
|
20
20
|
},
|
21
21
|
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
|
22
22
|
"dependencies": {
|
23
|
-
"@dcloudio/uni-cli-shared": "0.0
|
24
|
-
"debug": "^4.3.3"
|
25
|
-
},
|
26
|
-
"devDependencies": {
|
27
|
-
"@types/debug": "^4.1.7"
|
23
|
+
"@dcloudio/uni-cli-shared": "3.0.0-3060520221121001"
|
28
24
|
}
|
29
25
|
}
|