@dcloudio/uni-cli-shared 3.0.0-alpha-3081220230802001 → 3.0.0-alpha-3090020230826001
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.js +1 -1
- package/dist/logs/index.d.ts +1 -0
- package/dist/logs/index.js +8 -1
- package/dist/messages/en.d.ts +1 -0
- package/dist/messages/en.js +1 -0
- package/dist/messages/index.d.ts +2 -0
- package/dist/messages/zh_CN.d.ts +1 -0
- package/dist/messages/zh_CN.js +1 -0
- package/dist/preprocess/context.d.ts +1 -1
- package/dist/preprocess/context.js +7 -1
- package/dist/vite/plugins/copy.js +7 -4
- package/dist/vite/plugins/vitejs/plugins/css.js +1 -1
- package/dist/vite/utils/ast.d.ts +2 -1
- package/dist/vite/utils/ast.js +5 -1
- package/dist/watcher.js +1 -1
- package/package.json +4 -4
package/dist/constants.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.TEXT_STYLE = exports.DEFAULT_ASSETS_RE = exports.KNOWN_ASSET_TYPES = exp
|
|
|
4
4
|
exports.PUBLIC_DIR = 'static';
|
|
5
5
|
exports.EXTNAME_JS = ['.js', '.ts', '.jsx', '.tsx'];
|
|
6
6
|
exports.EXTNAME_TS = ['.ts', '.tsx'];
|
|
7
|
-
exports.EXTNAME_VUE = ['.vue', '.nvue'];
|
|
7
|
+
exports.EXTNAME_VUE = ['.vue', '.nvue', '.uvue'];
|
|
8
8
|
exports.EXTNAME_VUE_TEMPLATE = ['.vue', '.nvue', '.jsx', '.tsx'];
|
|
9
9
|
exports.EXTNAME_VUE_RE = /\.(vue|nvue)$/;
|
|
10
10
|
exports.EXTNAME_JS_RE = /\.(js|jsx|ts|tsx|mjs)$/;
|
package/dist/logs/index.d.ts
CHANGED
package/dist/logs/index.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.output = exports.formatWarnMsg = exports.formatInfoMsg = exports.formatErrMsg = void 0;
|
|
3
|
+
exports.output = exports.resetOutput = exports.formatWarnMsg = exports.formatInfoMsg = exports.formatErrMsg = void 0;
|
|
4
4
|
var format_1 = require("./format");
|
|
5
5
|
Object.defineProperty(exports, "formatErrMsg", { enumerable: true, get: function () { return format_1.formatErrMsg; } });
|
|
6
6
|
Object.defineProperty(exports, "formatInfoMsg", { enumerable: true, get: function () { return format_1.formatInfoMsg; } });
|
|
7
7
|
Object.defineProperty(exports, "formatWarnMsg", { enumerable: true, get: function () { return format_1.formatWarnMsg; } });
|
|
8
8
|
let lastType;
|
|
9
9
|
let lastMsg;
|
|
10
|
+
function resetOutput(type) {
|
|
11
|
+
if (type === lastType) {
|
|
12
|
+
lastType = undefined;
|
|
13
|
+
lastMsg = '';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.resetOutput = resetOutput;
|
|
10
17
|
function output(type, msg) {
|
|
11
18
|
if (type === lastType && msg === lastMsg) {
|
|
12
19
|
return;
|
package/dist/messages/en.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ declare const _default: {
|
|
|
9
9
|
readonly 'dev.watching.end': "DONE Build complete. Watching for changes...";
|
|
10
10
|
readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
|
|
11
11
|
readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
|
|
12
|
+
readonly 'build.failed': "DONE Build failed.";
|
|
12
13
|
readonly 'compiler.build.failed': "Build failed with errors.";
|
|
13
14
|
readonly 'stat.warn.appid': "The current application is not configured with Appid, and uni statistics cannot be used. For details, see https://ask.dcloud.net.cn/article/36303";
|
|
14
15
|
readonly 'stat.warn.version': "The uni statistics version is not configured. The default version is 1.0.uni statistics version 2.0 is recommended, private deployment data is more secure and code is open source and customizable. details: https://uniapp.dcloud.io/uni-stat";
|
package/dist/messages/en.js
CHANGED
|
@@ -11,6 +11,7 @@ exports.default = {
|
|
|
11
11
|
'dev.watching.end': 'DONE Build complete. Watching for changes...',
|
|
12
12
|
'dev.watching.end.pages': 'DONE Build complete. PAGES:{pages}',
|
|
13
13
|
'dev.watching.end.files': 'DONE Build complete. FILES:{files}',
|
|
14
|
+
'build.failed': 'DONE Build failed.',
|
|
14
15
|
'compiler.build.failed': 'Build failed with errors.',
|
|
15
16
|
'stat.warn.appid': 'The current application is not configured with Appid, and uni statistics cannot be used. For details, see https://ask.dcloud.net.cn/article/36303',
|
|
16
17
|
'stat.warn.version': 'The uni statistics version is not configured. The default version is 1.0.uni statistics version 2.0 is recommended, private deployment data is more secure and code is open source and customizable. details: https://uniapp.dcloud.io/uni-stat',
|
package/dist/messages/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const M: {
|
|
|
9
9
|
readonly 'dev.watching.end': "DONE Build complete. Watching for changes...";
|
|
10
10
|
readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
|
|
11
11
|
readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
|
|
12
|
+
readonly 'build.failed': "DONE Build failed.";
|
|
12
13
|
readonly 'compiler.build.failed': "编译失败";
|
|
13
14
|
readonly 'stat.warn.appid': "当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303";
|
|
14
15
|
readonly 'stat.warn.version': "当前应用未配置uni统计版本,默认使用1.0版本;建议使用uni统计2.0版本 ,私有部署数据更安全,代码开源可定制。详情:https://uniapp.dcloud.io/uni-stat";
|
|
@@ -50,6 +51,7 @@ export declare const M: {
|
|
|
50
51
|
readonly 'dev.watching.end': "DONE Build complete. Watching for changes...";
|
|
51
52
|
readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
|
|
52
53
|
readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
|
|
54
|
+
readonly 'build.failed': "DONE Build failed.";
|
|
53
55
|
readonly 'compiler.build.failed': "Build failed with errors.";
|
|
54
56
|
readonly 'stat.warn.appid': "The current application is not configured with Appid, and uni statistics cannot be used. For details, see https://ask.dcloud.net.cn/article/36303";
|
|
55
57
|
readonly 'stat.warn.version': "The uni statistics version is not configured. The default version is 1.0.uni statistics version 2.0 is recommended, private deployment data is more secure and code is open source and customizable. details: https://uniapp.dcloud.io/uni-stat";
|
package/dist/messages/zh_CN.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ declare const _default: {
|
|
|
9
9
|
readonly 'dev.watching.end': "DONE Build complete. Watching for changes...";
|
|
10
10
|
readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
|
|
11
11
|
readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
|
|
12
|
+
readonly 'build.failed': "DONE Build failed.";
|
|
12
13
|
readonly 'compiler.build.failed': "编译失败";
|
|
13
14
|
readonly 'stat.warn.appid': "当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303";
|
|
14
15
|
readonly 'stat.warn.version': "当前应用未配置uni统计版本,默认使用1.0版本;建议使用uni统计2.0版本 ,私有部署数据更安全,代码开源可定制。详情:https://uniapp.dcloud.io/uni-stat";
|
package/dist/messages/zh_CN.js
CHANGED
|
@@ -11,6 +11,7 @@ exports.default = {
|
|
|
11
11
|
'dev.watching.end': 'DONE Build complete. Watching for changes...',
|
|
12
12
|
'dev.watching.end.pages': 'DONE Build complete. PAGES:{pages}',
|
|
13
13
|
'dev.watching.end.files': 'DONE Build complete. FILES:{files}',
|
|
14
|
+
'build.failed': 'DONE Build failed.',
|
|
14
15
|
'compiler.build.failed': '编译失败',
|
|
15
16
|
'stat.warn.appid': '当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303',
|
|
16
17
|
'stat.warn.version': '当前应用未配置uni统计版本,默认使用1.0版本;建议使用uni统计2.0版本 ,私有部署数据更安全,代码开源可定制。详情:https://uniapp.dcloud.io/uni-stat',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare function getPreVueContext(): any;
|
|
2
2
|
export declare function getPreNVueContext(): any;
|
|
3
3
|
export declare function getPreUVueContext(): any;
|
|
4
|
-
export declare function initPreContext(platform: UniApp.PLATFORM, userPreContext?: Record<string, boolean> | string, utsPlatform?: typeof process.env.UNI_UTS_PLATFORM): void;
|
|
4
|
+
export declare function initPreContext(platform: UniApp.PLATFORM, userPreContext?: Record<string, boolean> | string, utsPlatform?: typeof process.env.UNI_UTS_PLATFORM, isX?: boolean): void;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.initPreContext = exports.getPreUVueContext = exports.getPreNVueContext = exports.getPreVueContext = void 0;
|
|
4
4
|
const shared_1 = require("@vue/shared");
|
|
5
5
|
const DEFAULT_KEYS = [
|
|
6
|
+
'UNI_APP_X',
|
|
6
7
|
'APP',
|
|
7
8
|
'APP_NVUE',
|
|
8
9
|
'APP_PLUS',
|
|
@@ -44,7 +45,7 @@ function getPreUVueContext() {
|
|
|
44
45
|
return preUVueContext;
|
|
45
46
|
}
|
|
46
47
|
exports.getPreUVueContext = getPreUVueContext;
|
|
47
|
-
function initPreContext(platform, userPreContext, utsPlatform) {
|
|
48
|
+
function initPreContext(platform, userPreContext, utsPlatform, isX) {
|
|
48
49
|
const vueContext = Object.create(null);
|
|
49
50
|
const nvueContext = Object.create(null);
|
|
50
51
|
const uvueContext = Object.create(null);
|
|
@@ -56,6 +57,11 @@ function initPreContext(platform, userPreContext, utsPlatform) {
|
|
|
56
57
|
vueContext.VUE3 = true;
|
|
57
58
|
nvueContext.VUE3 = true;
|
|
58
59
|
uvueContext.VUE3 = true;
|
|
60
|
+
if (isX) {
|
|
61
|
+
vueContext.UNI_APP_X = true;
|
|
62
|
+
nvueContext.UNI_APP_X = true;
|
|
63
|
+
uvueContext.UNI_APP_X = true;
|
|
64
|
+
}
|
|
59
65
|
if (platform === 'app' || platform === 'app-plus') {
|
|
60
66
|
defaultContext.APP = true;
|
|
61
67
|
defaultContext.APP_PLUS = true;
|
|
@@ -4,6 +4,7 @@ exports.uniViteCopyPlugin = void 0;
|
|
|
4
4
|
const watcher_1 = require("../../watcher");
|
|
5
5
|
const messages_1 = require("../../messages");
|
|
6
6
|
const logs_1 = require("../../logs");
|
|
7
|
+
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
7
8
|
function uniViteCopyPlugin({ targets, verbose, }) {
|
|
8
9
|
let resolvedConfig;
|
|
9
10
|
let initialized = false;
|
|
@@ -24,6 +25,11 @@ function uniViteCopyPlugin({ targets, verbose, }) {
|
|
|
24
25
|
return new Promise((resolve) => {
|
|
25
26
|
Promise.all(targets.map(({ watchOptions, ...target }) => {
|
|
26
27
|
return new Promise((resolve) => {
|
|
28
|
+
// 防抖,可能短时间触发很多次add,unlink
|
|
29
|
+
const onChange = (0, uni_shared_1.debounce)(() => {
|
|
30
|
+
(0, logs_1.resetOutput)('log');
|
|
31
|
+
(0, logs_1.output)('log', messages_1.M['dev.watching.end']);
|
|
32
|
+
}, 100, { setTimeout, clearTimeout });
|
|
27
33
|
new watcher_1.FileWatcher({
|
|
28
34
|
verbose,
|
|
29
35
|
...target,
|
|
@@ -40,10 +46,7 @@ function uniViteCopyPlugin({ targets, verbose, }) {
|
|
|
40
46
|
else {
|
|
41
47
|
resolve(void 0);
|
|
42
48
|
}
|
|
43
|
-
},
|
|
44
|
-
// TODO 目前初始化编译时,也会不停地触发此函数。
|
|
45
|
-
(0, logs_1.output)('log', messages_1.M['dev.watching.end']);
|
|
46
|
-
});
|
|
49
|
+
}, onChange);
|
|
47
50
|
});
|
|
48
51
|
})).then(() => resolve());
|
|
49
52
|
});
|
|
@@ -177,7 +177,7 @@ function cssPostPlugin(config, { platform, isJsCode, chunkCssFilename, chunkCssC
|
|
|
177
177
|
const filename = chunkCssFilename(id);
|
|
178
178
|
if (filename) {
|
|
179
179
|
if (platform === 'app' &&
|
|
180
|
-
(filename === 'app.css' || filename.startsWith('App.
|
|
180
|
+
(filename === 'app.css' || filename.startsWith('App.style'))) {
|
|
181
181
|
// 获取 unocss 的样式文件信息
|
|
182
182
|
const ids = Object.keys(chunk.modules).filter((id) => styles.has(id) &&
|
|
183
183
|
(id.includes('__uno.css') || id.includes('-unocss-')));
|
package/dist/vite/utils/ast.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Literal, BaseNode, Property, Identifier, CallExpression, AssignmentExpression, MemberExpression, MethodDefinition, ExportSpecifier } from 'estree';
|
|
2
|
-
import { Node, ElementNode, DirectiveNode, SimpleExpressionNode, AttributeNode } from '@vue/compiler-core';
|
|
2
|
+
import { Node, ElementNode, DirectiveNode, SimpleExpressionNode, AttributeNode, CompoundExpressionNode } from '@vue/compiler-core';
|
|
3
3
|
export declare const isProperty: (node: BaseNode) => node is Property;
|
|
4
4
|
export declare const isIdentifier: (node: BaseNode) => node is Identifier;
|
|
5
5
|
export declare const isAssignmentExpression: (node: BaseNode) => node is AssignmentExpression;
|
|
@@ -16,3 +16,4 @@ export declare function isElementNode(node: Node): node is ElementNode;
|
|
|
16
16
|
export declare function isAttributeNode(node: Node): node is AttributeNode;
|
|
17
17
|
export declare function isDirectiveNode(node: Node): node is DirectiveNode;
|
|
18
18
|
export declare function isSimpleExpressionNode(node: Node): node is SimpleExpressionNode;
|
|
19
|
+
export declare function isCompoundExpressionNode(node: Node): node is CompoundExpressionNode;
|
package/dist/vite/utils/ast.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSimpleExpressionNode = exports.isDirectiveNode = exports.isAttributeNode = exports.isElementNode = exports.parseVue = exports.createCallExpression = exports.createIdentifier = exports.createLiteral = exports.isReference = exports.isExportSpecifier = exports.isMethodDefinition = exports.isMemberExpression = exports.isCallExpression = exports.isAssignmentExpression = exports.isIdentifier = exports.isProperty = void 0;
|
|
3
|
+
exports.isCompoundExpressionNode = exports.isSimpleExpressionNode = exports.isDirectiveNode = exports.isAttributeNode = exports.isElementNode = exports.parseVue = exports.createCallExpression = exports.createIdentifier = exports.createLiteral = exports.isReference = exports.isExportSpecifier = exports.isMethodDefinition = exports.isMemberExpression = exports.isCallExpression = exports.isAssignmentExpression = exports.isIdentifier = exports.isProperty = void 0;
|
|
4
4
|
const compiler_dom_1 = require("@vue/compiler-dom");
|
|
5
5
|
const isProperty = (node) => node.type === 'Property';
|
|
6
6
|
exports.isProperty = isProperty;
|
|
@@ -87,3 +87,7 @@ function isSimpleExpressionNode(node) {
|
|
|
87
87
|
return node.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */;
|
|
88
88
|
}
|
|
89
89
|
exports.isSimpleExpressionNode = isSimpleExpressionNode;
|
|
90
|
+
function isCompoundExpressionNode(node) {
|
|
91
|
+
return node.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */;
|
|
92
|
+
}
|
|
93
|
+
exports.isCompoundExpressionNode = isCompoundExpressionNode;
|
package/dist/watcher.js
CHANGED
|
@@ -53,7 +53,7 @@ class FileWatcher {
|
|
|
53
53
|
copy(from) {
|
|
54
54
|
const to = this.to(from);
|
|
55
55
|
this.info('copy', from + '=>' + to);
|
|
56
|
-
let content;
|
|
56
|
+
let content = '';
|
|
57
57
|
if (this.transform) {
|
|
58
58
|
const filename = this.from(from);
|
|
59
59
|
content = this.transform(fs_extra_1.default.readFileSync(filename), filename);
|
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-3090020230826001",
|
|
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.21.3",
|
|
26
26
|
"@babel/parser": "^7.16.4",
|
|
27
27
|
"@babel/types": "^7.20.7",
|
|
28
|
-
"@dcloudio/uni-i18n": "3.0.0-alpha-
|
|
29
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
28
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-3090020230826001",
|
|
29
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3090020230826001",
|
|
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-3090020230826001",
|
|
68
68
|
"@types/babel__core": "^7.1.19",
|
|
69
69
|
"@types/debug": "^4.1.7",
|
|
70
70
|
"@types/estree": "^0.0.51",
|