Skip to content

Commit

Permalink
chore: add dd prop to judge whether to adapt multiplatform (#2899)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-huxiyang authored Dec 30, 2024
1 parent 744bb5b commit 5e3428d
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 119 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/common/pageWhiteTest.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const checkTaroBlank = () => {
nav.forEach((item) => {
const path = item.enName
item.packages
.filter((i) => i.show && i.taro && i.version === '3.0.0')
.filter((i) => i.show && i.taro && i.dd)
.forEach((i) => {
visitTaroDemo(path, i.name)
})
Expand Down
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const adaptedNameArray = []
// eslint-disable-next-line array-callback-return
config.nav.map((item) => {
item.packages.forEach((element) => {
const { name, version } = element
if (version !== '3.0.0') return // 未适配不导出
const { name, version, dd } = element
if (!dd) return // 未适配不导出
adaptedNameArray.push(name.toLowerCase())
})
})
Expand Down
4 changes: 2 additions & 2 deletions packages/nutui-taro-demo/scripts/taro/generate-nutui-taro.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const raws = []

config.nav.map((item) => {
item.packages.forEach((element) => {
let { name, show, type, taro, exportEmpty, exclude, version, rn } = element
let { name, show, type, taro, exportEmpty, exclude, version, rn, dd } = element
if (exclude) return
if (version !== '3.0.0') return
if (!dd) return

importStr += `import ${name} from '@/packages/${name.toLowerCase()}/index.taro'\n`
importStr += `export * from '@/packages/${name.toLowerCase()}/index.taro'\n`
Expand Down
2 changes: 1 addition & 1 deletion packages/nutui-taro-demo/src/pages/index/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const Index = () => {
)}
<View className="index-components-sublist">
{nav.packages.map((com) =>
com.show && com.taro && com.version === '3.0.0' && (!search || new RegExp(search, 'ig').test(com.name.toLowerCase())) ? (
com.show && com.taro && com.dd && (!search || new RegExp(search, 'ig').test(com.name.toLowerCase())) ? (
<View
key={com.name}
className="index-components-sublist-item"
Expand Down
4 changes: 2 additions & 2 deletions scripts/rn/copy-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ console.log('rn copy-file.js args', args)
const adaptedArray = []
config.nav.map((item) => {
item.packages.forEach((element) => {
const { name, version } = element
if (version !== '3.0.0') return // 未适配不导出
const { name, version,dd } = element
if (!dd) return // 未适配不导出
adaptedArray.push({
...element,
lowercaseName: element.name.toLowerCase(),
Expand Down
4 changes: 2 additions & 2 deletions scripts/rn/update-taro-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ function specialComponent(name) {
const adaptedArray = []
config.nav.map((item) => {
item.packages.forEach((element) => {
const { name, version } = element
if (version !== '3.0.0') return // 未适配不导出
const { name, version, dd } = element
if (!dd) return // 未适配不导出
if (specialComponent(name)) return
adaptedArray.push({
...element,
Expand Down
2 changes: 1 addition & 1 deletion scripts/sync-to-taro-playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function main() {
pages: [],
})
nav.packages.forEach((package) => {
if (package.version === '3.0.0' && package.show) {
if (package.dd && package.show) {
const name = package.name.toLowerCase()
v3.push(name)
subPackages[subPackages.length - 1].pages.push(`pages/${name}/index`)
Expand Down
4 changes: 2 additions & 2 deletions scripts/taro/generate-taro-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const config = require('../../src/config.json')
const adaptedArray = []
config.nav.map((item) => {
item.packages.forEach((element) => {
const { name, version } = element
if (version !== '3.0.0') return // 未适配不导出
const { name, version, dd } = element
if (!dd) return // 未适配不导出
adaptedArray.push(element.name.toLowerCase())
})
})
Expand Down
Loading

0 comments on commit 5e3428d

Please sign in to comment.