Skip to content

Commit

Permalink
feat: 为jd小程序平台补充 editor 组件 (#16166)
Browse files Browse the repository at this point in the history
Co-authored-by: liuzejia <[email protected]>
  • Loading branch information
ZEJIA-LIU and liuzejia authored Jul 26, 2024
1 parent ea3bd24 commit 3ffe3b8
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/taro-platform-alipay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@tarojs/shared": "workspace:*"
},
"peerDependencies": {
"@tarojs/components": "workspace:*",
"@tarojs/service": "workspace:*",
"@tarojs/shared": "workspace:*"
}
Expand Down
4 changes: 3 additions & 1 deletion packages/taro-platform-jd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
},
"devDependencies": {
"@tarojs/service": "workspace:*",
"@tarojs/shared": "workspace:*"
"@tarojs/shared": "workspace:*",
"@tarojs/components": "workspace:*"
},
"peerDependencies": {
"@tarojs/components": "workspace:*",
"@tarojs/service": "workspace:*",
"@tarojs/shared": "workspace:*"
}
Expand Down
13 changes: 12 additions & 1 deletion packages/taro-platform-jd/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,15 @@ const runtimeUtilsConfig = {
...base
}

export default [compileConfig, runtimeConfig, runtimeUtilsConfig]
// React 下 webpack 会 alias @tarojs/components 为此文件
const otherConfig = {
input: path.join(cwd, 'src/components-react.ts'),
output: {
file: path.join(cwd, 'dist/components-react.js'),
format: 'es',
sourcemap: true
},
...base
}

export default [compileConfig, runtimeConfig, runtimeUtilsConfig, otherConfig]
4 changes: 4 additions & 0 deletions packages/taro-platform-jd/src/components-react.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// For React.createElement's type
export * from '@tarojs/components/mini'
export const Editor = 'editor'

1 change: 1 addition & 0 deletions packages/taro-platform-jd/src/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default class JD extends TaroPlatformBase {
platform = 'jd'
globalObject = 'jd'
projectConfigJson = 'project.jd.json'
taroComponentsPath = `${PACKAGE_NAME}/dist/components-react`
runtimePath = `${PACKAGE_NAME}/dist/runtime`
fileType = {
templ: '.jxml',
Expand Down
1 change: 1 addition & 0 deletions packages/taro-platform-swan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@tarojs/shared": "workspace:*"
},
"peerDependencies": {
"@tarojs/components": "workspace:*",
"@tarojs/service": "workspace:*",
"@tarojs/shared": "workspace:*"
}
Expand Down
1 change: 1 addition & 0 deletions packages/taro-platform-tt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@tarojs/shared": "workspace:*"
},
"peerDependencies": {
"@tarojs/components": "workspace:*",
"@tarojs/shared": "workspace:*",
"@tarojs/service": "workspace:*"
}
Expand Down
1 change: 1 addition & 0 deletions packages/taro-platform-weapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@tarojs/shared": "workspace:*"
},
"peerDependencies": {
"@tarojs/components": "workspace:*",
"@tarojs/service": "workspace:*",
"@tarojs/shared": "workspace:*"
}
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3ffe3b8

Please sign in to comment.