Skip to content

Commit

Permalink
feat(uni-mp-xhs): 产物 project.config.json 生成框架信息 for 开发者工具埋点上报
Browse files Browse the repository at this point in the history
  • Loading branch information
jzhmcoo1 committed May 22, 2024
1 parent 5844068 commit 516410a
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 2 deletions.
65 changes: 64 additions & 1 deletion packages/uni-mp-xhs/dist/uni.compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,59 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
var initMiniProgramPlugin__default = /*#__PURE__*/_interopDefault(initMiniProgramPlugin);
var path__default = /*#__PURE__*/_interopDefault(path);

var name = "@dcloudio/uni-mp-xhs";
var version = "3.0.0-alpha-4010820240517001";
var description$1 = "uniapp mp-xhs";
var main = "dist/index.js";
var files = [
"dist",
"lib"
];
var repository = {
type: "git",
url: "git+https://github.com/dcloudio/uni-app.git",
directory: "packages/uni-mp-xhs"
};
var scripts = {
test: "echo \"Error: no test specified\" && exit 1"
};
var license = "Apache-2.0";
var gitHead = "33e807d66e1fe47e2ee08ad9c59247e37b8884da";
var devDependencies = {
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-4010820240517001",
"@dcloudio/uni-mp-alipay": "3.0.0-alpha-4010820240517001",
"@vue/compiler-core": "3.4.21"
};
var dependencies = {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-4010820240517001",
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-4010820240517001",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-4010820240517001",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-4010820240517001",
"@dcloudio/uni-shared": "3.0.0-alpha-4010820240517001",
"@vue/shared": "3.4.21"
};
var packageJson = {
name: name,
version: version,
description: description$1,
main: main,
files: files,
repository: repository,
scripts: scripts,
license: license,
"uni-app": {
name: "mp-xhs",
title: "小红书小程序",
apply: [
"mp-xhs"
],
main: "dist/uni.compiler.js"
},
gitHead: gitHead,
devDependencies: devDependencies,
dependencies: dependencies
};

var description = "项目配置文件。";
var packOptions = {
ignore: [
Expand Down Expand Up @@ -73,6 +126,16 @@ const compilerOptions = {
directiveTransforms,
};
const COMPONENTS_DIR = 'xhscomponents';
/**
* 收集 Uniapp 框架信息,for 小红书开发者工具埋点上报
*/
const uniappInfoSource = Object.assign(source, {
framework: {
tool: 'Uniapp',
name: packageJson.name,
version: packageJson.version,
},
});
const miniProgram = {
class: {
array: false,
Expand Down Expand Up @@ -150,7 +213,7 @@ const options = {
project: {
filename: projectConfigFilename,
config: ['project.config.json'],
source,
source: uniappInfoSource,
},
template: Object.assign(Object.assign({}, miniProgram), { filter: {
extname: '.sjs',
Expand Down
14 changes: 13 additions & 1 deletion packages/uni-mp-xhs/src/compiler/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
transformRef,
} from '@dcloudio/uni-cli-shared'
import type { UniMiniProgramPluginOptions } from '@dcloudio/uni-mp-vite'
import packageJson from '@dcloudio/uni-mp-xhs/package.json'

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

const COMPONENTS_DIR = 'xhscomponents'

/**
* 收集 Uniapp 框架信息,for 小红书开发者工具埋点上报
*/
const uniappInfoSource = Object.assign(source, {
framework: {
tool: 'Uniapp',
name: packageJson.name,
version: packageJson.version,
},
})

export const miniProgram: MiniProgramCompilerOptions = {
class: {
array: false,
Expand Down Expand Up @@ -102,7 +114,7 @@ export const options: UniMiniProgramPluginOptions = {
project: {
filename: projectConfigFilename,
config: ['project.config.json'],
source,
source: uniappInfoSource,
},
template: {
/* eslint-disable no-restricted-syntax */
Expand Down

0 comments on commit 516410a

Please sign in to comment.