@dcloudio/uni-cli-shared 3.0.0-alpha-4020720240904001 → 3.0.0-alpha-4020720240905001
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/json/manifest.d.ts +1 -0
- package/dist/json/manifest.js +32 -17
- package/dist/json/theme.js +2 -1
- package/dist/vite/features.js +4 -3
- package/package.json +4 -4
package/dist/json/manifest.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare function getRouterOptions(manifestJson: Record<string, any>): {
|
|
|
30
30
|
};
|
|
31
31
|
export declare function isEnableTreeShaking(manifestJson: Record<string, any>): boolean;
|
|
32
32
|
export declare function getDevServerOptions(manifestJson: Record<string, any>): any;
|
|
33
|
+
export declare function getPlatformManifestJson(manifestJson: any, platform?: UniApp.PLATFORM): any;
|
|
33
34
|
export declare function getPlatformManifestJsonOnce(): any;
|
|
34
35
|
export declare function validateThemeValue(value: string): boolean;
|
|
35
36
|
export {};
|
package/dist/json/manifest.js
CHANGED
|
@@ -3,7 +3,7 @@ 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.validateThemeValue = exports.getPlatformManifestJsonOnce = exports.getDevServerOptions = exports.isEnableTreeShaking = exports.getRouterOptions = exports.isUniPushOffline = exports.hasPushModule = exports.isEnableSecureNetwork = exports.isEnableUniPushV2 = exports.isEnableUniPushV1 = exports.getUniStatistics = exports.normalizeNetworkTimeout = exports.parseCompatConfigOnce = exports.parseRpx2UnitOnce = exports.parseManifestJsonOnce = exports.parseManifestJson = void 0;
|
|
6
|
+
exports.validateThemeValue = exports.getPlatformManifestJsonOnce = exports.getPlatformManifestJson = exports.getDevServerOptions = exports.isEnableTreeShaking = exports.getRouterOptions = exports.isUniPushOffline = exports.hasPushModule = exports.isEnableSecureNetwork = exports.isEnableUniPushV2 = exports.isEnableUniPushV1 = exports.getUniStatistics = exports.normalizeNetworkTimeout = exports.parseCompatConfigOnce = exports.parseRpx2UnitOnce = exports.parseManifestJsonOnce = exports.parseManifestJson = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const shared_1 = require("@vue/shared");
|
|
@@ -24,7 +24,8 @@ exports.parseRpx2UnitOnce = (0, uni_shared_1.once)((inputDir, platform = 'h5') =
|
|
|
24
24
|
const rpx2unit = platform === 'h5' || platform === 'app' || platform === 'app-harmony'
|
|
25
25
|
? uni_shared_1.defaultRpx2Unit
|
|
26
26
|
: uni_shared_1.defaultMiniProgramRpx2Unit;
|
|
27
|
-
const
|
|
27
|
+
const manifestJson = (0, exports.parseManifestJsonOnce)(inputDir);
|
|
28
|
+
let platformOptions = getPlatformManifestJson(manifestJson, platform);
|
|
28
29
|
if (platformOptions && platformOptions.rpx) {
|
|
29
30
|
return (0, shared_1.extend)({}, rpx2unit, platformOptions);
|
|
30
31
|
}
|
|
@@ -50,10 +51,8 @@ function normalizeNetworkTimeout(networkTimeout) {
|
|
|
50
51
|
exports.normalizeNetworkTimeout = normalizeNetworkTimeout;
|
|
51
52
|
function getUniStatistics(inputDir, platform) {
|
|
52
53
|
const manifest = (0, exports.parseManifestJsonOnce)(inputDir);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
return (0, shared_1.extend)({}, manifest.uniStatistics, manifest[platform] && manifest[platform].uniStatistics);
|
|
54
|
+
let platformManifest = getPlatformManifestJson(manifest, platform);
|
|
55
|
+
return (0, shared_1.extend)({}, manifest.uniStatistics, platformManifest && platformManifest.uniStatistics);
|
|
57
56
|
}
|
|
58
57
|
exports.getUniStatistics = getUniStatistics;
|
|
59
58
|
function isEnableUniPushV1(inputDir, platform) {
|
|
@@ -72,19 +71,20 @@ function isEnableUniPushV1(inputDir, platform) {
|
|
|
72
71
|
exports.isEnableUniPushV1 = isEnableUniPushV1;
|
|
73
72
|
function isEnableUniPushV2(inputDir, platform) {
|
|
74
73
|
const manifest = (0, exports.parseManifestJsonOnce)(inputDir);
|
|
74
|
+
const platformManifest = getPlatformManifestJson(manifest, platform);
|
|
75
75
|
if (platform === 'app') {
|
|
76
|
-
return (
|
|
77
|
-
'2');
|
|
76
|
+
return (platformManifest?.distribute?.sdkConfigs?.push?.unipush?.version == '2');
|
|
78
77
|
}
|
|
79
|
-
return
|
|
78
|
+
return platformManifest?.unipush?.enable === true;
|
|
80
79
|
}
|
|
81
80
|
exports.isEnableUniPushV2 = isEnableUniPushV2;
|
|
82
81
|
function isEnableSecureNetwork(inputDir, platform) {
|
|
83
82
|
const manifest = (0, exports.parseManifestJsonOnce)(inputDir);
|
|
83
|
+
const platformManifest = getPlatformManifestJson(manifest, platform);
|
|
84
84
|
if (platform === 'app') {
|
|
85
|
-
return !!
|
|
85
|
+
return !!platformManifest?.modules?.SecureNetwork;
|
|
86
86
|
}
|
|
87
|
-
return
|
|
87
|
+
return platformManifest?.secureNetwork?.enable === true;
|
|
88
88
|
}
|
|
89
89
|
exports.isEnableSecureNetwork = isEnableSecureNetwork;
|
|
90
90
|
function hasPushModule(inputDir) {
|
|
@@ -99,7 +99,7 @@ function isUniPushOffline(inputDir) {
|
|
|
99
99
|
}
|
|
100
100
|
exports.isUniPushOffline = isUniPushOffline;
|
|
101
101
|
function getRouterOptions(manifestJson) {
|
|
102
|
-
return (0, shared_1.extend)({}, manifestJson
|
|
102
|
+
return (0, shared_1.extend)({}, getPlatformManifestJson(manifestJson, 'h5')?.router);
|
|
103
103
|
}
|
|
104
104
|
exports.getRouterOptions = getRouterOptions;
|
|
105
105
|
function isEnableTreeShaking(manifestJson) {
|
|
@@ -107,18 +107,33 @@ function isEnableTreeShaking(manifestJson) {
|
|
|
107
107
|
if (process.env.UNI_AUTOMATOR_WS_ENDPOINT) {
|
|
108
108
|
return false;
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
const platformManifest = getPlatformManifestJson(manifestJson, 'h5');
|
|
111
|
+
return platformManifest?.optimization?.treeShaking?.enable !== false;
|
|
111
112
|
}
|
|
112
113
|
exports.isEnableTreeShaking = isEnableTreeShaking;
|
|
113
114
|
function getDevServerOptions(manifestJson) {
|
|
114
|
-
|
|
115
|
+
const platformManifest = getPlatformManifestJson(manifestJson, 'h5');
|
|
116
|
+
return (0, shared_1.extend)({}, platformManifest?.devServer);
|
|
115
117
|
}
|
|
116
118
|
exports.getDevServerOptions = getDevServerOptions;
|
|
119
|
+
function getPlatformManifestJson(manifestJson, platform) {
|
|
120
|
+
if (!platform) {
|
|
121
|
+
platform = process.env.UNI_PLATFORM;
|
|
122
|
+
}
|
|
123
|
+
if (platform === 'app') {
|
|
124
|
+
return manifestJson['app-plus'] || manifestJson['plus'] || {};
|
|
125
|
+
}
|
|
126
|
+
if (platform === 'h5') {
|
|
127
|
+
return manifestJson.web || manifestJson.h5 || {};
|
|
128
|
+
}
|
|
129
|
+
return manifestJson[platform] || {};
|
|
130
|
+
}
|
|
131
|
+
exports.getPlatformManifestJson = getPlatformManifestJson;
|
|
117
132
|
function getPlatformManifestJsonOnce() {
|
|
118
|
-
const
|
|
119
|
-
return !process.env.UNI_INPUT_DIR
|
|
133
|
+
const manifestJson = !process.env.UNI_INPUT_DIR
|
|
120
134
|
? {}
|
|
121
|
-
: (0, exports.parseManifestJsonOnce)(process.env.UNI_INPUT_DIR)
|
|
135
|
+
: (0, exports.parseManifestJsonOnce)(process.env.UNI_INPUT_DIR);
|
|
136
|
+
return getPlatformManifestJson(manifestJson);
|
|
122
137
|
}
|
|
123
138
|
exports.getPlatformManifestJsonOnce = getPlatformManifestJsonOnce;
|
|
124
139
|
const themeValues = ['dark', 'light', 'auto'];
|
package/dist/json/theme.js
CHANGED
|
@@ -8,6 +8,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const json_1 = require("./json");
|
|
10
10
|
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
11
|
+
const manifest_1 = require("./manifest");
|
|
11
12
|
function hasThemeJson(themeLocation) {
|
|
12
13
|
if (!fs_1.default.existsSync(themeLocation)) {
|
|
13
14
|
return false;
|
|
@@ -84,7 +85,7 @@ exports.normalizeThemeConfigOnce = (0, uni_shared_1.once)((manifestJsonPlatform
|
|
|
84
85
|
});
|
|
85
86
|
function initTheme(manifestJson, pagesJson) {
|
|
86
87
|
const platform = process.env.UNI_PLATFORM === 'app' ? 'app-plus' : process.env.UNI_PLATFORM;
|
|
87
|
-
const manifestPlatform = manifestJson
|
|
88
|
+
const manifestPlatform = (0, manifest_1.getPlatformManifestJson)(manifestJson, platform) || {};
|
|
88
89
|
const themeConfig = (0, exports.normalizeThemeConfigOnce)(manifestPlatform);
|
|
89
90
|
return (0, uni_shared_1.normalizeStyles)(pagesJson, themeConfig);
|
|
90
91
|
}
|
package/dist/vite/features.js
CHANGED
|
@@ -135,9 +135,10 @@ function initManifestFeature({ manifestJson, command, platform, }) {
|
|
|
135
135
|
// features.wxs = false
|
|
136
136
|
// features.longpress = false
|
|
137
137
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
const webManifest = manifestJson.web || manifestJson.h5;
|
|
139
|
+
if (webManifest &&
|
|
140
|
+
webManifest.router &&
|
|
141
|
+
webManifest.router.mode === 'history') {
|
|
141
142
|
features.routerMode = '"history"';
|
|
142
143
|
}
|
|
143
144
|
// TODO other features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-cli-shared",
|
|
3
|
-
"version": "3.0.0-alpha-
|
|
3
|
+
"version": "3.0.0-alpha-4020720240905001",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@babel/core": "^7.23.3",
|
|
27
27
|
"@babel/parser": "^7.23.9",
|
|
28
28
|
"@babel/types": "^7.20.7",
|
|
29
|
-
"@dcloudio/uni-i18n": "3.0.0-alpha-
|
|
30
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
29
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-4020720240905001",
|
|
30
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-4020720240905001",
|
|
31
31
|
"@intlify/core-base": "9.1.9",
|
|
32
32
|
"@intlify/shared": "9.1.9",
|
|
33
33
|
"@intlify/vue-devtools": "9.1.9",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
},
|
|
72
72
|
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@dcloudio/uni-uts-v1": "3.0.0-alpha-
|
|
74
|
+
"@dcloudio/uni-uts-v1": "3.0.0-alpha-4020720240905001",
|
|
75
75
|
"@types/adm-zip": "^0.5.5",
|
|
76
76
|
"@types/babel__code-frame": "^7.0.6",
|
|
77
77
|
"@types/babel__core": "^7.1.19",
|