@dcloudio/uni-cli-shared 3.0.0-alpha-3060820221027001 → 3.0.0-alpha-3060820221027002
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/constants.d.ts +0 -1
- package/dist/constants.js +1 -2
- package/dist/json/app/manifest/index.js +1 -4
- package/dist/json/app/manifest/statusbar.js +2 -2
- package/dist/json/app/manifest/tabBar.js +7 -1
- package/dist/json/app/pages/uniConfig.js +0 -4
- package/dist/json/index.d.ts +0 -1
- package/dist/json/index.js +0 -1
- package/dist/json/mp/pages.js +3 -10
- package/dist/json/pages.js +4 -14
- package/package.json +4 -4
- package/dist/json/theme.d.ts +0 -3
- package/dist/json/theme.js +0 -30
package/dist/constants.d.ts
CHANGED
|
@@ -27,4 +27,3 @@ export declare const BASE_COMPONENTS_STYLE_PATH = "@dcloudio/uni-components/styl
|
|
|
27
27
|
export declare const COMMON_EXCLUDE: RegExp[];
|
|
28
28
|
export declare const KNOWN_ASSET_TYPES: string[];
|
|
29
29
|
export declare const DEFAULT_ASSETS_RE: RegExp;
|
|
30
|
-
export declare const TEXT_STYLE: string[];
|
package/dist/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DEFAULT_ASSETS_RE = exports.KNOWN_ASSET_TYPES = exports.COMMON_EXCLUDE = exports.BASE_COMPONENTS_STYLE_PATH = exports.H5_COMPONENTS_STYLE_PATH = exports.H5_FRAMEWORK_STYLE_PATH = exports.H5_API_STYLE_PATH = exports.PAGE_EXTNAME = exports.PAGE_EXTNAME_APP = exports.BINDING_COMPONENTS = exports.APP_CONFIG_SERVICE = exports.APP_CONFIG = exports.APP_SERVICE_FILENAME = exports.ASSETS_INLINE_LIMIT = exports.JSON_JS_MAP = exports.MANIFEST_JSON_JS = exports.PAGES_JSON_JS = exports.extensions = exports.EXTNAME_TS_RE = exports.EXTNAME_JS_RE = exports.EXTNAME_VUE_RE = exports.EXTNAME_VUE_TEMPLATE = exports.EXTNAME_VUE = exports.EXTNAME_TS = exports.EXTNAME_JS = exports.PUBLIC_DIR = void 0;
|
|
4
4
|
exports.PUBLIC_DIR = 'static';
|
|
5
5
|
exports.EXTNAME_JS = ['.js', '.ts', '.jsx', '.tsx'];
|
|
6
6
|
exports.EXTNAME_TS = ['.ts', '.tsx'];
|
|
@@ -77,4 +77,3 @@ exports.KNOWN_ASSET_TYPES = [
|
|
|
77
77
|
'txt',
|
|
78
78
|
];
|
|
79
79
|
exports.DEFAULT_ASSETS_RE = new RegExp(`\\.(` + exports.KNOWN_ASSET_TYPES.join('|') + `)(\\?.*)?$`);
|
|
80
|
-
exports.TEXT_STYLE = ['black', 'white'];
|
|
@@ -29,11 +29,8 @@ const launchwebview_1 = require("./launchwebview");
|
|
|
29
29
|
const checksystemwebview_1 = require("./checksystemwebview");
|
|
30
30
|
const tabBar_1 = require("./tabBar");
|
|
31
31
|
const i18n_1 = require("./i18n");
|
|
32
|
-
const theme_1 = require("../../theme");
|
|
33
32
|
function normalizeAppManifestJson(userManifestJson, pagesJson) {
|
|
34
|
-
const manifestJson = (0, merge_1.initRecursiveMerge)((0, defaultManifestJson_1.initDefaultManifestJson)(), userManifestJson);
|
|
35
|
-
pagesJson = (0, theme_1.initTheme)(manifestJson, pagesJson);
|
|
36
|
-
(0, statusbar_1.initAppStatusbar)(manifestJson, pagesJson);
|
|
33
|
+
const manifestJson = (0, merge_1.initRecursiveMerge)((0, statusbar_1.initAppStatusbar)((0, defaultManifestJson_1.initDefaultManifestJson)(), pagesJson), userManifestJson);
|
|
37
34
|
(0, arguments_1.initArguments)(manifestJson, pagesJson);
|
|
38
35
|
(0, plus_1.initPlus)(manifestJson, pagesJson);
|
|
39
36
|
(0, nvue_1.initNVue)(manifestJson, pagesJson);
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.initAppStatusbar = void 0;
|
|
4
4
|
function initAppStatusbar(manifestJson, pagesJson) {
|
|
5
5
|
var _a;
|
|
6
|
-
const { titleColor = '#
|
|
6
|
+
const { titleColor = '#000', backgroundColor = '#000000' } = ((_a = pagesJson.globalStyle) === null || _a === void 0 ? void 0 : _a.navigationBar) || {};
|
|
7
7
|
manifestJson.plus.statusbar = {
|
|
8
8
|
immersed: 'supportedDevice',
|
|
9
|
-
style: titleColor === '#
|
|
9
|
+
style: titleColor === '#000' ? 'dark' : 'light',
|
|
10
10
|
background: backgroundColor,
|
|
11
11
|
};
|
|
12
12
|
return manifestJson;
|
|
@@ -2,13 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initTabBar = void 0;
|
|
4
4
|
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
5
|
+
const borderStyles = {
|
|
6
|
+
black: 'rgba(0,0,0,0.4)',
|
|
7
|
+
white: 'rgba(255,255,255,0.4)',
|
|
8
|
+
};
|
|
5
9
|
function initTabBar(entryPagePath, manifestJson, pagesJson) {
|
|
6
10
|
var _a, _b;
|
|
7
11
|
if (!((_b = (_a = pagesJson.tabBar) === null || _a === void 0 ? void 0 : _a.list) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
8
12
|
return;
|
|
9
13
|
}
|
|
10
14
|
const tabBar = JSON.parse(JSON.stringify(pagesJson.tabBar));
|
|
11
|
-
tabBar.borderStyle
|
|
15
|
+
if (tabBar.borderStyle in borderStyles) {
|
|
16
|
+
tabBar.borderStyle = borderStyles[tabBar.borderStyle];
|
|
17
|
+
}
|
|
12
18
|
if (!tabBar.selectedColor) {
|
|
13
19
|
tabBar.selectedColor = uni_shared_1.SELECTED_COLOR;
|
|
14
20
|
}
|
|
@@ -10,11 +10,9 @@ const manifest_1 = require("../../manifest");
|
|
|
10
10
|
const manifest_2 = require("../manifest");
|
|
11
11
|
const arguments_1 = require("../manifest/arguments");
|
|
12
12
|
const splashscreen_1 = require("../manifest/splashscreen");
|
|
13
|
-
const theme_1 = require("../../theme");
|
|
14
13
|
function normalizeAppUniConfig(pagesJson, manifestJson) {
|
|
15
14
|
var _a;
|
|
16
15
|
const { autoclose, alwaysShowBeforeRender } = (0, splashscreen_1.getSplashscreen)(manifestJson);
|
|
17
|
-
const platformConfig = manifestJson[process.env.UNI_PLATFORM === 'app' ? 'app-plus' : process.env.UNI_PLATFORM] || {};
|
|
18
16
|
const config = {
|
|
19
17
|
pages: [],
|
|
20
18
|
globalStyle: pagesJson.globalStyle,
|
|
@@ -34,8 +32,6 @@ function normalizeAppUniConfig(pagesJson, manifestJson) {
|
|
|
34
32
|
networkTimeout: (0, manifest_1.normalizeNetworkTimeout)(manifestJson.networkTimeout),
|
|
35
33
|
tabBar: pagesJson.tabBar,
|
|
36
34
|
locales: (0, i18n_1.initLocales)(path_1.default.join(process.env.UNI_INPUT_DIR, 'locale')),
|
|
37
|
-
darkmode: platformConfig.darkmode || false,
|
|
38
|
-
themeConfig: (0, theme_1.normalizeThemeConfigOnce)(platformConfig),
|
|
39
35
|
};
|
|
40
36
|
// TODO 待支持分包
|
|
41
37
|
return JSON.stringify(config);
|
package/dist/json/index.d.ts
CHANGED
package/dist/json/index.js
CHANGED
package/dist/json/mp/pages.js
CHANGED
|
@@ -12,8 +12,6 @@ const pages_1 = require("../pages");
|
|
|
12
12
|
const utils_1 = require("./utils");
|
|
13
13
|
const utils_2 = require("../../utils");
|
|
14
14
|
const project_1 = require("./project");
|
|
15
|
-
const manifest_1 = require("../manifest");
|
|
16
|
-
const theme_1 = require("../theme");
|
|
17
15
|
function parseMiniProgramPagesJson(jsonStr, platform, options = { subpackages: false }) {
|
|
18
16
|
return parsePagesJson(jsonStr, platform, options);
|
|
19
17
|
}
|
|
@@ -39,11 +37,11 @@ exports.mergeMiniProgramAppJson = mergeMiniProgramAppJson;
|
|
|
39
37
|
function parsePagesJson(jsonStr, platform, { debug, darkmode, networkTimeout, subpackages, windowOptionsMap, tabBarOptionsMap, tabBarItemOptionsMap, } = {
|
|
40
38
|
subpackages: false,
|
|
41
39
|
}) {
|
|
42
|
-
|
|
40
|
+
const appJson = {
|
|
43
41
|
pages: [],
|
|
44
42
|
};
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
const pageJsons = {};
|
|
44
|
+
const nvuePages = [];
|
|
47
45
|
// preprocess
|
|
48
46
|
const pagesJson = (0, json_1.parseJson)(jsonStr, true);
|
|
49
47
|
if (!pagesJson) {
|
|
@@ -129,11 +127,6 @@ function parsePagesJson(jsonStr, platform, { debug, darkmode, networkTimeout, su
|
|
|
129
127
|
appJson.darkmode = true;
|
|
130
128
|
appJson.themeLocation = 'theme.json';
|
|
131
129
|
}
|
|
132
|
-
else {
|
|
133
|
-
const manifestJson = (0, manifest_1.parseManifestJsonOnce)(process.env.UNI_INPUT_DIR);
|
|
134
|
-
appJson = (0, theme_1.initTheme)(manifestJson, appJson);
|
|
135
|
-
pageJsons = (0, theme_1.initTheme)(manifestJson, pageJsons);
|
|
136
|
-
}
|
|
137
130
|
return {
|
|
138
131
|
appJson,
|
|
139
132
|
pageJsons,
|
package/dist/json/pages.js
CHANGED
|
@@ -13,8 +13,6 @@ const json_1 = require("./json");
|
|
|
13
13
|
const utils_2 = require("../vue/utils");
|
|
14
14
|
const vite_1 = require("../vite");
|
|
15
15
|
const constants_1 = require("../constants");
|
|
16
|
-
const theme_1 = require("./theme");
|
|
17
|
-
const manifest_1 = require("./manifest");
|
|
18
16
|
const pagesCacheSet = new Set();
|
|
19
17
|
function isUniPageFile(file, inputDir = process.env.UNI_INPUT_DIR) {
|
|
20
18
|
if (inputDir && path_1.default.isAbsolute(file)) {
|
|
@@ -111,9 +109,7 @@ function normalizePagesJson(jsonStr, platform, { subpackages, } = { subpackages:
|
|
|
111
109
|
// 缓存页面列表
|
|
112
110
|
pagesCacheSet.clear();
|
|
113
111
|
pagesJson.pages.forEach((page) => pagesCacheSet.add(page.path));
|
|
114
|
-
return
|
|
115
|
-
? pagesJson
|
|
116
|
-
: (0, theme_1.initTheme)((0, manifest_1.parseManifestJsonOnce)(process.env.UNI_INPUT_DIR), pagesJson);
|
|
112
|
+
return pagesJson;
|
|
117
113
|
}
|
|
118
114
|
exports.normalizePagesJson = normalizePagesJson;
|
|
119
115
|
function validatePages(pagesJson, jsonStr) {
|
|
@@ -275,13 +271,8 @@ function normalizeNavigationBar(pageStyle) {
|
|
|
275
271
|
delete navigationBar.titleText;
|
|
276
272
|
}
|
|
277
273
|
if (!navigationBar.titleColor && (0, shared_1.hasOwn)(navigationBar, 'textStyle')) {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
navigationBar.titleColor = (0, uni_shared_1.normalizeTitleColor)(textStyle);
|
|
281
|
-
}
|
|
282
|
-
else {
|
|
283
|
-
navigationBar.titleColor = navigationBar.textStyle;
|
|
284
|
-
}
|
|
274
|
+
navigationBar.titleColor =
|
|
275
|
+
navigationBar.textStyle === 'black' ? '#000000' : '#ffffff';
|
|
285
276
|
delete navigationBar.textStyle;
|
|
286
277
|
}
|
|
287
278
|
if (pageStyle.navigationBarShadow &&
|
|
@@ -289,9 +280,8 @@ function normalizeNavigationBar(pageStyle) {
|
|
|
289
280
|
navigationBar.shadowColorType = pageStyle.navigationBarShadow.colorType;
|
|
290
281
|
delete pageStyle.navigationBarShadow;
|
|
291
282
|
}
|
|
292
|
-
const parsedNavigationBar = (0, theme_1.initTheme)((0, manifest_1.parseManifestJsonOnce)(process.env.UNI_INPUT_DIR), navigationBar);
|
|
293
283
|
if ((0, shared_1.isArray)(navigationBar.buttons)) {
|
|
294
|
-
navigationBar.buttons = navigationBar.buttons.map((btn) => normalizeNavigationBarButton(btn, navigationBar.type,
|
|
284
|
+
navigationBar.buttons = navigationBar.buttons.map((btn) => normalizeNavigationBarButton(btn, navigationBar.type, navigationBar.titleColor));
|
|
295
285
|
}
|
|
296
286
|
if ((0, shared_1.isPlainObject)(navigationBar.searchInput)) {
|
|
297
287
|
navigationBar.searchInput = normalizeNavigationBarSearchInput(navigationBar.searchInput);
|
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-3060820221027002",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"@babel/core": "^7.18.13",
|
|
26
26
|
"@babel/parser": "^7.18.13",
|
|
27
27
|
"@babel/types": "^7.17.0",
|
|
28
|
-
"@dcloudio/uni-i18n": "3.0.0-alpha-
|
|
29
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
28
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-3060820221027002",
|
|
29
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3060820221027002",
|
|
30
30
|
"@intlify/core-base": "9.1.9",
|
|
31
31
|
"@intlify/shared": "9.1.9",
|
|
32
32
|
"@intlify/vue-devtools": "9.1.9",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@dcloudio/uni-uts-v1": "3.0.0-alpha-
|
|
67
|
+
"@dcloudio/uni-uts-v1": "3.0.0-alpha-3060820221027002",
|
|
68
68
|
"@types/babel__core": "^7.1.19",
|
|
69
69
|
"@types/debug": "^4.1.7",
|
|
70
70
|
"@types/estree": "^0.0.51",
|
package/dist/json/theme.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const parseThemeJson: (themeLocation?: string) => UniApp.ThemeJson;
|
|
2
|
-
export declare const normalizeThemeConfigOnce: (manifestJsonPlatform?: Record<string, any>) => UniApp.ThemeJson;
|
|
3
|
-
export declare function initTheme<T extends object>(manifestJson: Record<string, any>, pagesJson: T): T;
|
package/dist/json/theme.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.initTheme = exports.normalizeThemeConfigOnce = exports.parseThemeJson = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const json_1 = require("./json");
|
|
10
|
-
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
11
|
-
const parseThemeJson = (themeLocation = 'theme.json') => {
|
|
12
|
-
if (!themeLocation) {
|
|
13
|
-
return {};
|
|
14
|
-
}
|
|
15
|
-
themeLocation = path_1.default.join(process.env.UNI_INPUT_DIR, themeLocation);
|
|
16
|
-
if (!fs_1.default.existsSync(themeLocation)) {
|
|
17
|
-
return {};
|
|
18
|
-
}
|
|
19
|
-
const jsonStr = fs_1.default.readFileSync(themeLocation, 'utf8');
|
|
20
|
-
return (0, json_1.parseJson)(jsonStr, true);
|
|
21
|
-
};
|
|
22
|
-
exports.parseThemeJson = parseThemeJson;
|
|
23
|
-
exports.normalizeThemeConfigOnce = (0, uni_shared_1.once)((manifestJsonPlatform = {}) => (0, exports.parseThemeJson)(manifestJsonPlatform.themeLocation));
|
|
24
|
-
function initTheme(manifestJson, pagesJson) {
|
|
25
|
-
const platform = process.env.UNI_PLATFORM === 'app' ? 'app-plus' : process.env.UNI_PLATFORM;
|
|
26
|
-
const manifestPlatform = manifestJson['plus'] || manifestJson[platform] || {};
|
|
27
|
-
const themeConfig = (0, exports.normalizeThemeConfigOnce)(manifestPlatform);
|
|
28
|
-
return (0, uni_shared_1.normalizeStyles)(pagesJson, themeConfig);
|
|
29
|
-
}
|
|
30
|
-
exports.initTheme = initTheme;
|