@dcloudio/uni-cli-shared 3.0.0-alpha-3041720220614001 → 3.0.0-alpha-3041720220614002
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/checkUpdate.js +1 -1
- package/dist/hbx/log.js +2 -1
- package/dist/json/pages.js +2 -2
- package/dist/logs/format.js +2 -1
- package/dist/vite/plugins/inject.js +3 -3
- package/dist/vite/plugins/vitejs/plugins/asset.js +4 -3
- package/dist/vite/plugins/vitejs/plugins/css.js +7 -6
- package/dist/vite/utils/plugin.js +1 -1
- package/dist/watcher.js +2 -1
- package/lib/.DS_Store +0 -0
- package/lib/vue-i18n/.DS_Store +0 -0
- package/package.json +3 -3
package/dist/checkUpdate.js
CHANGED
package/dist/hbx/log.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.errorFormatter = exports.removeWarnFormatter = exports.removeInfoFormatt
|
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const picocolors_1 = __importDefault(require("picocolors"));
|
|
10
|
+
const shared_1 = require("@vue/shared");
|
|
10
11
|
const utils_1 = require("../utils");
|
|
11
12
|
const constants_1 = require("../constants");
|
|
12
13
|
const ast_1 = require("../vite/utils/ast");
|
|
@@ -52,7 +53,7 @@ const REMOVED_MSGS = [
|
|
|
52
53
|
];
|
|
53
54
|
exports.removeInfoFormatter = {
|
|
54
55
|
test(msg) {
|
|
55
|
-
return !!REMOVED_MSGS.find((m) =>
|
|
56
|
+
return !!REMOVED_MSGS.find((m) => ((0, shared_1.isString)(m) ? msg.includes(m) : m(msg)));
|
|
56
57
|
},
|
|
57
58
|
format() {
|
|
58
59
|
return '';
|
package/dist/json/pages.js
CHANGED
|
@@ -103,7 +103,7 @@ function normalizePagesJson(jsonStr, platform, { subpackages, } = { subpackages:
|
|
|
103
103
|
}
|
|
104
104
|
exports.normalizePagesJson = normalizePagesJson;
|
|
105
105
|
function validatePages(pagesJson, jsonStr) {
|
|
106
|
-
if (!
|
|
106
|
+
if (!(0, shared_1.isArray)(pagesJson.pages)) {
|
|
107
107
|
pagesJson.pages = [];
|
|
108
108
|
throw new Error(`[uni-app] Error: pages.json->pages parse failed.`);
|
|
109
109
|
}
|
|
@@ -140,7 +140,7 @@ function normalizePages(pages, platform) {
|
|
|
140
140
|
}
|
|
141
141
|
function normalizeSubpackages(subpackages) {
|
|
142
142
|
const pages = [];
|
|
143
|
-
if (
|
|
143
|
+
if ((0, shared_1.isArray)(subpackages)) {
|
|
144
144
|
subpackages.forEach(({ root, pages: subPages }) => {
|
|
145
145
|
if (root && subPages.length) {
|
|
146
146
|
subPages.forEach((subPage) => {
|
package/dist/logs/format.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatWarnMsg = exports.formatInfoMsg = exports.removeNVueInfoFormatter = exports.formatErrMsg = void 0;
|
|
4
4
|
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
5
|
+
const shared_1 = require("@vue/shared");
|
|
5
6
|
const env_1 = require("../hbx/env");
|
|
6
7
|
const alias_1 = require("../hbx/alias");
|
|
7
8
|
const log_1 = require("../hbx/log");
|
|
@@ -45,7 +46,7 @@ const REMOVED_NVUE_MSGS = [
|
|
|
45
46
|
];
|
|
46
47
|
exports.removeNVueInfoFormatter = {
|
|
47
48
|
test(msg) {
|
|
48
|
-
return !!REMOVED_NVUE_MSGS.find((m) =>
|
|
49
|
+
return !!REMOVED_NVUE_MSGS.find((m) => (0, shared_1.isString)(m) ? msg.includes(m) : m(msg));
|
|
49
50
|
},
|
|
50
51
|
format() {
|
|
51
52
|
return '';
|
|
@@ -74,7 +74,7 @@ function uniViteInjectPlugin(name, options) {
|
|
|
74
74
|
if (mods.length === 2) {
|
|
75
75
|
mod = namespaceModulesMap.get(mods[0] + '.');
|
|
76
76
|
if (mod) {
|
|
77
|
-
if (
|
|
77
|
+
if ((0, shared_1.isArray)(mod)) {
|
|
78
78
|
const testFn = mod[1];
|
|
79
79
|
if (testFn(mods[1])) {
|
|
80
80
|
mod = [mod[0], mods[1]];
|
|
@@ -90,7 +90,7 @@ function uniViteInjectPlugin(name, options) {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
if (mod && !imports.has(name) && !scope.contains(name)) {
|
|
93
|
-
if (
|
|
93
|
+
if ((0, shared_1.isString)(mod))
|
|
94
94
|
mod = [mod, 'default'];
|
|
95
95
|
if (mod[0] === id)
|
|
96
96
|
return false;
|
|
@@ -188,7 +188,7 @@ const flatten = (startNode) => {
|
|
|
188
188
|
};
|
|
189
189
|
function normalizeModulesMap(modulesMap) {
|
|
190
190
|
modulesMap.forEach((mod, key) => {
|
|
191
|
-
modulesMap.set(key,
|
|
191
|
+
modulesMap.set(key, (0, shared_1.isArray)(mod)
|
|
192
192
|
? [mod[0].split(path_1.sep).join('/'), mod[1]]
|
|
193
193
|
: mod.split(path_1.sep).join('/'));
|
|
194
194
|
});
|
|
@@ -35,6 +35,7 @@ const magic_string_1 = __importDefault(require("magic-string"));
|
|
|
35
35
|
const crypto_1 = require("crypto");
|
|
36
36
|
const utils_1 = require("../utils");
|
|
37
37
|
const utils_2 = require("../../../../vite/utils/utils");
|
|
38
|
+
const shared_1 = require("@vue/shared");
|
|
38
39
|
exports.assetUrlRE = /__VITE_ASSET__([a-z\d]{8})__(?:\$_(.*?)__)?/g;
|
|
39
40
|
// urls in JS must be quoted as strings, so when replacing them we need
|
|
40
41
|
// a different regex
|
|
@@ -178,17 +179,17 @@ function assetFileNamesToFileName(assetFileNames, file, contentHash, content) {
|
|
|
178
179
|
const ext = extname.substring(1);
|
|
179
180
|
const name = basename.slice(0, -extname.length);
|
|
180
181
|
const hash = contentHash;
|
|
181
|
-
if (
|
|
182
|
+
if ((0, shared_1.isFunction)(assetFileNames)) {
|
|
182
183
|
assetFileNames = assetFileNames({
|
|
183
184
|
name: file,
|
|
184
185
|
source: content,
|
|
185
186
|
type: 'asset',
|
|
186
187
|
});
|
|
187
|
-
if (
|
|
188
|
+
if (!(0, shared_1.isString)(assetFileNames)) {
|
|
188
189
|
throw new TypeError('assetFileNames must return a string');
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
|
-
else if (
|
|
192
|
+
else if (!(0, shared_1.isString)(assetFileNames)) {
|
|
192
193
|
throw new TypeError('assetFileNames must be a string or a function');
|
|
193
194
|
}
|
|
194
195
|
const fileName = assetFileNames.replace(/\[\w+\]/g, (placeholder) => {
|
|
@@ -40,6 +40,7 @@ const esbuild_1 = require("esbuild");
|
|
|
40
40
|
const preprocess_1 = require("../../../../preprocess");
|
|
41
41
|
const constants_1 = require("../../../../constants");
|
|
42
42
|
const cleanString_1 = require("../cleanString");
|
|
43
|
+
const shared_1 = require("@vue/shared");
|
|
43
44
|
const cssLangs = `\\.(css|less|sass|scss|styl|stylus|pcss|postcss)($|\\?)`;
|
|
44
45
|
exports.cssLangRE = new RegExp(cssLangs);
|
|
45
46
|
const cssModuleRE = new RegExp(`\\.module${cssLangs}`);
|
|
@@ -341,7 +342,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
341
342
|
...modulesOptions,
|
|
342
343
|
getJSON(cssFileName, _modules, outputFileName) {
|
|
343
344
|
modules = _modules;
|
|
344
|
-
if (modulesOptions &&
|
|
345
|
+
if (modulesOptions && (0, shared_1.isFunction)(modulesOptions.getJSON)) {
|
|
345
346
|
modulesOptions.getJSON(cssFileName, _modules, outputFileName);
|
|
346
347
|
}
|
|
347
348
|
},
|
|
@@ -494,7 +495,7 @@ async function resolvePostcssConfig(config) {
|
|
|
494
495
|
};
|
|
495
496
|
}
|
|
496
497
|
else {
|
|
497
|
-
const searchPath =
|
|
498
|
+
const searchPath = (0, shared_1.isString)(inlineOptions) ? inlineOptions : config.root;
|
|
498
499
|
try {
|
|
499
500
|
// @ts-ignore
|
|
500
501
|
result = await (0, postcss_load_config_1.default)({}, searchPath);
|
|
@@ -710,7 +711,7 @@ const scss = async (source, root, options, resolvers, isNVue) => {
|
|
|
710
711
|
};
|
|
711
712
|
const importer = [internalImporter];
|
|
712
713
|
if (options.importer) {
|
|
713
|
-
|
|
714
|
+
(0, shared_1.isArray)(options.importer)
|
|
714
715
|
? importer.push(...options.importer)
|
|
715
716
|
: importer.push(options.importer);
|
|
716
717
|
}
|
|
@@ -798,7 +799,7 @@ async function rebaseUrls(file, rootFile, alias, isNVue = false) {
|
|
|
798
799
|
return url;
|
|
799
800
|
// match alias, no need to rewrite
|
|
800
801
|
for (const { find } of alias) {
|
|
801
|
-
const matches =
|
|
802
|
+
const matches = (0, shared_1.isString)(find) ? url.startsWith(find) : find.test(url);
|
|
802
803
|
if (matches) {
|
|
803
804
|
return url;
|
|
804
805
|
}
|
|
@@ -963,9 +964,9 @@ function formatStylusSourceMap(mapBefore, root) {
|
|
|
963
964
|
async function getSource(source, filename, additionalData, enableSourcemap, sep = '') {
|
|
964
965
|
if (!additionalData)
|
|
965
966
|
return { content: source };
|
|
966
|
-
if (
|
|
967
|
+
if ((0, shared_1.isFunction)(additionalData)) {
|
|
967
968
|
const newContent = await additionalData(source, filename);
|
|
968
|
-
if (
|
|
969
|
+
if ((0, shared_1.isString)(newContent)) {
|
|
969
970
|
return { content: newContent };
|
|
970
971
|
}
|
|
971
972
|
return newContent;
|
|
@@ -31,7 +31,7 @@ function replacePlugins(plugins, config) {
|
|
|
31
31
|
}
|
|
32
32
|
exports.replacePlugins = replacePlugins;
|
|
33
33
|
function removePlugins(plugins, config) {
|
|
34
|
-
if (!
|
|
34
|
+
if (!(0, shared_1.isArray)(plugins)) {
|
|
35
35
|
plugins = [plugins];
|
|
36
36
|
}
|
|
37
37
|
plugins.forEach((name) => {
|
package/dist/watcher.js
CHANGED
|
@@ -7,9 +7,10 @@ exports.FileWatcher = void 0;
|
|
|
7
7
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const chokidar_1 = require("chokidar");
|
|
10
|
+
const shared_1 = require("@vue/shared");
|
|
10
11
|
class FileWatcher {
|
|
11
12
|
constructor({ src, dest, transform, verbose }) {
|
|
12
|
-
this.src = !
|
|
13
|
+
this.src = !(0, shared_1.isArray)(src) ? [src] : src;
|
|
13
14
|
this.dest = dest;
|
|
14
15
|
this.transform = transform;
|
|
15
16
|
this.verbose = verbose;
|
package/lib/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
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-3041720220614002",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"@babel/core": "^7.17.9",
|
|
23
23
|
"@babel/parser": "^7.17.9",
|
|
24
24
|
"@babel/types": "^7.17.0",
|
|
25
|
-
"@dcloudio/uni-i18n": "3.0.0-alpha-
|
|
26
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
25
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-3041720220614002",
|
|
26
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3041720220614002",
|
|
27
27
|
"@intlify/core-base": "9.1.9",
|
|
28
28
|
"@intlify/shared": "9.1.9",
|
|
29
29
|
"@intlify/vue-devtools": "9.1.9",
|