xhs-mp-compiler-cli 2.0.4-beta.3 → 2.0.4
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/utils/apm.d.ts +3 -3
- package/dist/utils/apm.js +25 -18
- package/package.json +11 -11
package/dist/utils/apm.d.ts
CHANGED
|
@@ -8,13 +8,13 @@ declare class Reporter implements FeatureReporter.IReporter {
|
|
|
8
8
|
private apm;
|
|
9
9
|
constructor(apm: APM);
|
|
10
10
|
reportThirdFramework(name: FeatureReporter.ThirdFramework): void;
|
|
11
|
+
reportDevelopMode(name: FeatureReporter.DevelopMode): void;
|
|
11
12
|
reportMlFeature(feature: FeatureReporter.ML): void;
|
|
12
13
|
reportMlWebComponent(value: string): void;
|
|
13
|
-
|
|
14
|
-
reportStyleIsolation(value: string): void;
|
|
14
|
+
reportComponentJSON(name: FeatureReporter.ComponentJSON, value?: unknown): void;
|
|
15
15
|
reportAppJSON(name: FeatureReporter.AppExtJSON): void;
|
|
16
16
|
reportExtJSON(name: FeatureReporter.AppExtJSON): void;
|
|
17
|
-
|
|
17
|
+
reportPageJSON(name: FeatureReporter.PageJSON): void;
|
|
18
18
|
}
|
|
19
19
|
export declare function createReporter(project: Project, option: ICompileAndZipOptions): Reporter | undefined;
|
|
20
20
|
export {};
|
package/dist/utils/apm.js
CHANGED
|
@@ -61,6 +61,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
61
61
|
name,
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
+
reportDevelopMode(name) {
|
|
65
|
+
var _a, _b;
|
|
66
|
+
(_b = (_a = this.apm) === null || _a === void 0 ? void 0 : _a.report) === null || _b === void 0 ? void 0 : _b.call(_a, APMKEY, {
|
|
67
|
+
type: xhs_mp_shared_1.FeatureReporter.MODULE.developMode,
|
|
68
|
+
name,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
64
71
|
reportMlFeature(feature) {
|
|
65
72
|
var _a, _b;
|
|
66
73
|
(_b = (_a = this.apm) === null || _a === void 0 ? void 0 : _a.report) === null || _b === void 0 ? void 0 : _b.call(_a, APMKEY, {
|
|
@@ -77,18 +84,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
77
84
|
});
|
|
78
85
|
}
|
|
79
86
|
// 在reporter 创建阶段即可根据传入project信息进行上报
|
|
80
|
-
|
|
87
|
+
reportComponentJSON(name, value) {
|
|
81
88
|
var _a, _b;
|
|
82
89
|
(_b = (_a = this.apm) === null || _a === void 0 ? void 0 : _a.report) === null || _b === void 0 ? void 0 : _b.call(_a, APMKEY, {
|
|
83
90
|
type: xhs_mp_shared_1.FeatureReporter.MODULE.componentJSON,
|
|
84
91
|
name,
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
reportStyleIsolation(value) {
|
|
88
|
-
var _a, _b;
|
|
89
|
-
(_b = (_a = this.apm) === null || _a === void 0 ? void 0 : _a.report) === null || _b === void 0 ? void 0 : _b.call(_a, APMKEY, {
|
|
90
|
-
type: xhs_mp_shared_1.FeatureReporter.MODULE.componentJSON,
|
|
91
|
-
name: xhs_mp_shared_1.FeatureReporter.JSONComponent.styleIsolation,
|
|
92
92
|
value,
|
|
93
93
|
});
|
|
94
94
|
}
|
|
@@ -106,10 +106,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
106
106
|
name,
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
reportPageJSON(name) {
|
|
110
110
|
var _a, _b;
|
|
111
111
|
(_b = (_a = this.apm) === null || _a === void 0 ? void 0 : _a.report) === null || _b === void 0 ? void 0 : _b.call(_a, APMKEY, {
|
|
112
|
-
type: xhs_mp_shared_1.FeatureReporter.MODULE.
|
|
112
|
+
type: xhs_mp_shared_1.FeatureReporter.MODULE.pageJSON,
|
|
113
113
|
name,
|
|
114
114
|
});
|
|
115
115
|
}
|
|
@@ -119,16 +119,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
119
119
|
], Reporter.prototype, "reportThirdFramework", null);
|
|
120
120
|
__decorate([
|
|
121
121
|
onceByParams
|
|
122
|
-
], Reporter.prototype, "
|
|
122
|
+
], Reporter.prototype, "reportDevelopMode", null);
|
|
123
123
|
__decorate([
|
|
124
124
|
onceByParams
|
|
125
|
-
], Reporter.prototype, "
|
|
125
|
+
], Reporter.prototype, "reportMlFeature", null);
|
|
126
126
|
__decorate([
|
|
127
127
|
onceByParams
|
|
128
|
-
], Reporter.prototype, "
|
|
128
|
+
], Reporter.prototype, "reportMlWebComponent", null);
|
|
129
129
|
__decorate([
|
|
130
130
|
onceByParams
|
|
131
|
-
], Reporter.prototype, "
|
|
131
|
+
], Reporter.prototype, "reportComponentJSON", null);
|
|
132
132
|
__decorate([
|
|
133
133
|
onceByParams
|
|
134
134
|
], Reporter.prototype, "reportAppJSON", null);
|
|
@@ -137,7 +137,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
137
137
|
], Reporter.prototype, "reportExtJSON", null);
|
|
138
138
|
__decorate([
|
|
139
139
|
onceByParams
|
|
140
|
-
], Reporter.prototype, "
|
|
140
|
+
], Reporter.prototype, "reportPageJSON", null);
|
|
141
141
|
function createReporter(project, option) {
|
|
142
142
|
var _a, _b, _c;
|
|
143
143
|
try {
|
|
@@ -160,7 +160,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
160
160
|
});
|
|
161
161
|
const reporter = new Reporter(apm);
|
|
162
162
|
function reportAppJSON() {
|
|
163
|
-
var _a, _b, _c, _d, _e;
|
|
163
|
+
var _a, _b, _c, _d, _e, _f;
|
|
164
164
|
// 分包
|
|
165
165
|
if (!(0, lodash_1.isEmpty)(((_a = project.appJsonContent) === null || _a === void 0 ? void 0 : _a.subPackages) || ((_b = project.appJsonContent) === null || _b === void 0 ? void 0 : _b.subpackages))) {
|
|
166
166
|
reporter.reportAppJSON(xhs_mp_shared_1.FeatureReporter.AppExtJSON.subPackages);
|
|
@@ -184,15 +184,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
184
184
|
const style = componentsMap[key].styleIsolation;
|
|
185
185
|
// 样式隔离类型
|
|
186
186
|
if (style) {
|
|
187
|
-
reporter.
|
|
187
|
+
reporter.reportComponentJSON(xhs_mp_shared_1.FeatureReporter.ComponentJSON.styleIsolation, style);
|
|
188
188
|
}
|
|
189
189
|
// 占位组件
|
|
190
190
|
const componentPlaceholder = componentsMap[key].componentPlaceholder;
|
|
191
191
|
if (!(0, lodash_1.isEmpty)(componentPlaceholder)) {
|
|
192
|
-
reporter.
|
|
192
|
+
reporter.reportComponentJSON(xhs_mp_shared_1.FeatureReporter.ComponentJSON.componentPlaceholder);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
+
// 骨架埋点
|
|
197
|
+
(_f = project.getPages()) === null || _f === void 0 ? void 0 : _f.forEach(page => {
|
|
198
|
+
var _a;
|
|
199
|
+
if ((_a = page === null || page === void 0 ? void 0 : page.skeleton) === null || _a === void 0 ? void 0 : _a.path) {
|
|
200
|
+
reporter.reportPageJSON(xhs_mp_shared_1.FeatureReporter.PageJSON.skeleton);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
196
203
|
}
|
|
197
204
|
function reportExtJSON() {
|
|
198
205
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xhs-mp-compiler-cli",
|
|
3
|
-
"version": "2.0.4
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "xhs mp command tool.",
|
|
5
5
|
"preferGlobal": true,
|
|
6
6
|
"category": "esm",
|
|
@@ -88,18 +88,18 @@
|
|
|
88
88
|
"webpack-chain": "^6.5.1",
|
|
89
89
|
"webpack-sources": "^3.2.2",
|
|
90
90
|
"xhs-mp-workerpool": "^9.1.3",
|
|
91
|
-
"xhs-mp-ml-loader": "2.0.4
|
|
92
|
-
"xhs-mp-compiler-utils": "2.0.4
|
|
93
|
-
"xhs-mp-pack": "2.0.4
|
|
94
|
-
"xhs-mp-project": "2.0.4
|
|
95
|
-
"xhs-mp-shared": "2.0.4
|
|
96
|
-
"xhs-mp-shared-fs": "2.0.4
|
|
97
|
-
"xhs-mp-sjs-loader": "2.0.4
|
|
98
|
-
"xhs-mp-sketch-loader": "2.0.4
|
|
91
|
+
"xhs-mp-ml-loader": "2.0.4",
|
|
92
|
+
"xhs-mp-compiler-utils": "2.0.4",
|
|
93
|
+
"xhs-mp-pack": "2.0.4",
|
|
94
|
+
"xhs-mp-project": "2.0.4",
|
|
95
|
+
"xhs-mp-shared": "2.0.4",
|
|
96
|
+
"xhs-mp-shared-fs": "2.0.4",
|
|
97
|
+
"xhs-mp-sjs-loader": "2.0.4",
|
|
98
|
+
"xhs-mp-sketch-loader": "2.0.4",
|
|
99
99
|
"yauzl": "^2.10.0"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
|
-
"xhs-mp-ml-parser": "2.0.4
|
|
102
|
+
"xhs-mp-ml-parser": "2.0.4"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@types/babel__generator": "7.6.3",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"typescript": "5.1.6",
|
|
124
124
|
"vue3-jest": "27.0.0-alpha.2",
|
|
125
125
|
"webpack-dev-server": "4.0.0-beta.3",
|
|
126
|
-
"xhs-mp-ml-parser": "2.0.4
|
|
126
|
+
"xhs-mp-ml-parser": "2.0.4"
|
|
127
127
|
},
|
|
128
128
|
"scripts": {
|
|
129
129
|
"version": "formula changelog && git add .",
|