@dcloudio/uni-cli-shared 3.0.0-alpha-3060020220831001 → 3.0.0-alpha-3060120220907001
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/hbx/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { formatAtFilename } from './log';
|
|
2
2
|
export * from './env';
|
|
3
3
|
export { initModuleAlias, installHBuilderXPlugin, formatInstallHBuilderXPluginTips, } from './alias';
|
|
4
|
-
export declare function uniHBuilderXConsolePlugin(): import("vite").Plugin;
|
|
4
|
+
export declare function uniHBuilderXConsolePlugin(method?: string): import("vite").Plugin;
|
package/dist/hbx/index.js
CHANGED
|
@@ -28,8 +28,9 @@ var alias_1 = require("./alias");
|
|
|
28
28
|
Object.defineProperty(exports, "initModuleAlias", { enumerable: true, get: function () { return alias_1.initModuleAlias; } });
|
|
29
29
|
Object.defineProperty(exports, "installHBuilderXPlugin", { enumerable: true, get: function () { return alias_1.installHBuilderXPlugin; } });
|
|
30
30
|
Object.defineProperty(exports, "formatInstallHBuilderXPluginTips", { enumerable: true, get: function () { return alias_1.formatInstallHBuilderXPluginTips; } });
|
|
31
|
-
function uniHBuilderXConsolePlugin() {
|
|
31
|
+
function uniHBuilderXConsolePlugin(method = '__f__') {
|
|
32
32
|
return (0, console_1.uniConsolePlugin)({
|
|
33
|
+
method,
|
|
33
34
|
filename(filename) {
|
|
34
35
|
filename = path_1.default.relative(process.env.UNI_INPUT_DIR, filename);
|
|
35
36
|
if (filename.startsWith('.') || path_1.default.isAbsolute(filename)) {
|
package/dist/logs/console.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function rewriteConsoleExpr(id: string, filename: string, code: string, sourceMap?: boolean): {
|
|
1
|
+
export declare function rewriteConsoleExpr(method: string, id: string, filename: string, code: string, sourceMap?: boolean): {
|
|
2
2
|
code: string;
|
|
3
3
|
map: import("magic-string").SourceMap | null;
|
|
4
4
|
};
|
package/dist/logs/console.js
CHANGED
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.rewriteConsoleExpr = void 0;
|
|
7
7
|
const magic_string_1 = __importDefault(require("magic-string"));
|
|
8
8
|
const utils_1 = require("../utils");
|
|
9
|
-
|
|
10
|
-
function rewriteConsoleExpr(id, filename, code, sourceMap = false) {
|
|
9
|
+
function rewriteConsoleExpr(method, id, filename, code, sourceMap = false) {
|
|
11
10
|
filename = (0, utils_1.normalizePath)(filename);
|
|
12
11
|
const re = /(console\.(log|info|debug|warn|error))\(([^)]+)\)/g;
|
|
13
12
|
const locate = getLocator(code);
|
|
@@ -15,7 +14,7 @@ function rewriteConsoleExpr(id, filename, code, sourceMap = false) {
|
|
|
15
14
|
let match;
|
|
16
15
|
while ((match = re.exec(code))) {
|
|
17
16
|
const [, expr, type] = match;
|
|
18
|
-
s.overwrite(match.index, match.index + expr.length + 1,
|
|
17
|
+
s.overwrite(match.index, match.index + expr.length + 1, method + `('${type}','at ${filename}:${locate(match.index).line + 1}',`);
|
|
19
18
|
}
|
|
20
19
|
return {
|
|
21
20
|
code: s.toString(),
|
|
@@ -35,7 +35,7 @@ function uniConsolePlugin(options) {
|
|
|
35
35
|
return null;
|
|
36
36
|
}
|
|
37
37
|
debugConsole(id);
|
|
38
|
-
return (0, console_1.rewriteConsoleExpr)(id, filename, code, (0, utils_2.withSourcemap)(resolvedConfig));
|
|
38
|
+
return (0, console_1.rewriteConsoleExpr)(options.method, id, filename, code, (0, utils_2.withSourcemap)(resolvedConfig));
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
41
|
}
|
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-3060120220907001",
|
|
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-3060120220907001",
|
|
26
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3060120220907001",
|
|
27
27
|
"@intlify/core-base": "9.1.9",
|
|
28
28
|
"@intlify/shared": "9.1.9",
|
|
29
29
|
"@intlify/vue-devtools": "9.1.9",
|