Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add dd prop to judge whether to adapt multiplatform #2899

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading