Skip to content

Commit 516410a

Browse files
committed
feat(uni-mp-xhs): 产物 project.config.json 生成框架信息 for 开发者工具埋点上报
1 parent 5844068 commit 516410a

File tree

2 files changed

+77
-2
lines changed

2 files changed

+77
-2
lines changed

packages/uni-mp-xhs/dist/uni.compiler.js

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,59 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
1010
var initMiniProgramPlugin__default = /*#__PURE__*/_interopDefault(initMiniProgramPlugin);
1111
var path__default = /*#__PURE__*/_interopDefault(path);
1212

13+
var name = "@dcloudio/uni-mp-xhs";
14+
var version = "3.0.0-alpha-4010820240517001";
15+
var description$1 = "uniapp mp-xhs";
16+
var main = "dist/index.js";
17+
var files = [
18+
"dist",
19+
"lib"
20+
];
21+
var repository = {
22+
type: "git",
23+
url: "git+https://github.com/dcloudio/uni-app.git",
24+
directory: "packages/uni-mp-xhs"
25+
};
26+
var scripts = {
27+
test: "echo \"Error: no test specified\" && exit 1"
28+
};
29+
var license = "Apache-2.0";
30+
var gitHead = "33e807d66e1fe47e2ee08ad9c59247e37b8884da";
31+
var devDependencies = {
32+
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-4010820240517001",
33+
"@dcloudio/uni-mp-alipay": "3.0.0-alpha-4010820240517001",
34+
"@vue/compiler-core": "3.4.21"
35+
};
36+
var dependencies = {
37+
"@dcloudio/uni-cli-shared": "3.0.0-alpha-4010820240517001",
38+
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-4010820240517001",
39+
"@dcloudio/uni-mp-vite": "3.0.0-alpha-4010820240517001",
40+
"@dcloudio/uni-mp-vue": "3.0.0-alpha-4010820240517001",
41+
"@dcloudio/uni-shared": "3.0.0-alpha-4010820240517001",
42+
"@vue/shared": "3.4.21"
43+
};
44+
var packageJson = {
45+
name: name,
46+
version: version,
47+
description: description$1,
48+
main: main,
49+
files: files,
50+
repository: repository,
51+
scripts: scripts,
52+
license: license,
53+
"uni-app": {
54+
name: "mp-xhs",
55+
title: "小红书小程序",
56+
apply: [
57+
"mp-xhs"
58+
],
59+
main: "dist/uni.compiler.js"
60+
},
61+
gitHead: gitHead,
62+
devDependencies: devDependencies,
63+
dependencies: dependencies
64+
};
65+
1366
var description = "项目配置文件。";
1467
var packOptions = {
1568
ignore: [
@@ -73,6 +126,16 @@ const compilerOptions = {
73126
directiveTransforms,
74127
};
75128
const COMPONENTS_DIR = 'xhscomponents';
129+
/**
130+
* 收集 Uniapp 框架信息,for 小红书开发者工具埋点上报
131+
*/
132+
const uniappInfoSource = Object.assign(source, {
133+
framework: {
134+
tool: 'Uniapp',
135+
name: packageJson.name,
136+
version: packageJson.version,
137+
},
138+
});
76139
const miniProgram = {
77140
class: {
78141
array: false,
@@ -150,7 +213,7 @@ const options = {
150213
project: {
151214
filename: projectConfigFilename,
152215
config: ['project.config.json'],
153-
source,
216+
source: uniappInfoSource,
154217
},
155218
template: Object.assign(Object.assign({}, miniProgram), { filter: {
156219
extname: '.sjs',

packages/uni-mp-xhs/src/compiler/options.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
transformRef,
88
} from '@dcloudio/uni-cli-shared'
99
import type { UniMiniProgramPluginOptions } from '@dcloudio/uni-mp-vite'
10+
import packageJson from '@dcloudio/uni-mp-xhs/package.json'
1011

1112
import source from './project.config.json'
1213
import { transformOn } from './transforms/vOn'
@@ -24,6 +25,17 @@ export const compilerOptions: CompilerOptions = {
2425

2526
const COMPONENTS_DIR = 'xhscomponents'
2627

28+
/**
29+
* 收集 Uniapp 框架信息,for 小红书开发者工具埋点上报
30+
*/
31+
const uniappInfoSource = Object.assign(source, {
32+
framework: {
33+
tool: 'Uniapp',
34+
name: packageJson.name,
35+
version: packageJson.version,
36+
},
37+
})
38+
2739
export const miniProgram: MiniProgramCompilerOptions = {
2840
class: {
2941
array: false,
@@ -102,7 +114,7 @@ export const options: UniMiniProgramPluginOptions = {
102114
project: {
103115
filename: projectConfigFilename,
104116
config: ['project.config.json'],
105-
source,
117+
source: uniappInfoSource,
106118
},
107119
template: {
108120
/* eslint-disable no-restricted-syntax */

0 commit comments

Comments
 (0)