From 1896be5ee5892bfb0c6d323cec5092e22aaf4057 Mon Sep 17 00:00:00 2001 From: "Alex.hxy" <1872591453@qq.com> Date: Mon, 30 Dec 2024 11:12:10 +0800 Subject: [PATCH] chore: add dd prop --- cypress/e2e/common/pageWhiteTest.cy.js | 2 +- gulpfile.js | 4 +- .../scripts/taro/generate-nutui-taro.js | 4 +- .../nutui-taro-demo/src/pages/index/index.tsx | 2 +- scripts/rn/copy-file.js | 4 +- scripts/rn/update-taro-entry.js | 4 +- scripts/sync-to-taro-playground.js | 2 +- scripts/taro/generate-taro-pages.js | 4 +- src/config.json | 316 ++++++++++++------ 9 files changed, 223 insertions(+), 119 deletions(-) diff --git a/cypress/e2e/common/pageWhiteTest.cy.js b/cypress/e2e/common/pageWhiteTest.cy.js index 34fd1256d5..69b58927e4 100644 --- a/cypress/e2e/common/pageWhiteTest.cy.js +++ b/cypress/e2e/common/pageWhiteTest.cy.js @@ -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) }) diff --git a/gulpfile.js b/gulpfile.js index 6aba063d58..1bd16983c7 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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()) }) }) diff --git a/packages/nutui-taro-demo/scripts/taro/generate-nutui-taro.js b/packages/nutui-taro-demo/scripts/taro/generate-nutui-taro.js index 241b20aa34..c76f7c5a73 100644 --- a/packages/nutui-taro-demo/scripts/taro/generate-nutui-taro.js +++ b/packages/nutui-taro-demo/scripts/taro/generate-nutui-taro.js @@ -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` diff --git a/packages/nutui-taro-demo/src/pages/index/index.tsx b/packages/nutui-taro-demo/src/pages/index/index.tsx index 2252ac79f1..2859569420 100644 --- a/packages/nutui-taro-demo/src/pages/index/index.tsx +++ b/packages/nutui-taro-demo/src/pages/index/index.tsx @@ -81,7 +81,7 @@ const Index = () => { )} {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())) ? ( { 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(), diff --git a/scripts/rn/update-taro-entry.js b/scripts/rn/update-taro-entry.js index 22d1789714..a8a4c7b971 100644 --- a/scripts/rn/update-taro-entry.js +++ b/scripts/rn/update-taro-entry.js @@ -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, diff --git a/scripts/sync-to-taro-playground.js b/scripts/sync-to-taro-playground.js index 66885563c9..4e15708a52 100644 --- a/scripts/sync-to-taro-playground.js +++ b/scripts/sync-to-taro-playground.js @@ -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`) diff --git a/scripts/taro/generate-taro-pages.js b/scripts/taro/generate-taro-pages.js index 9b82f07093..6561f80c9c 100644 --- a/scripts/taro/generate-taro-pages.js +++ b/scripts/taro/generate-taro-pages.js @@ -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()) }) }) diff --git a/src/config.json b/src/config.json index 30e85c3ff1..f1e59064e0 100644 --- a/src/config.json +++ b/src/config.json @@ -79,7 +79,8 @@ "sort": 1, "show": true, "taro": true, - "author": "" + "author": "", + "dd": true }, { "version": "3.0.0", @@ -90,7 +91,8 @@ "sort": 2, "show": true, "taro": true, - "author": "songsong" + "author": "songsong", + "dd": true }, { "version": "3.0.0", @@ -102,7 +104,8 @@ "show": false, "taro": true, "exportEmpty": true, - "author": "songsong" + "author": "songsong", + "dd": true }, { "version": "3.0.0", @@ -114,7 +117,8 @@ "show": true, "exportEmpty": true, "taro": true, - "author": "hanyuxinting" + "author": "hanyuxinting", + "dd": true }, { "version": "3.0.0", @@ -126,7 +130,8 @@ "show": true, "taro": true, "exclude": true, - "author": "oasis-cloud" + "author": "oasis-cloud", + "dd": true }, { "version": "3.0.0", @@ -138,7 +143,8 @@ "sort": 8, "show": true, "taro": true, - "author": "vickyYE" + "author": "vickyYE", + "dd": true }, { "version": "3.0.0", @@ -149,7 +155,8 @@ "sort": 5, "show": true, "taro": true, - "author": "junjun" + "author": "junjun", + "dd": true } ] }, @@ -166,7 +173,8 @@ "sort": 3, "show": false, "exportEmpty": true, - "author": "yushuang24" + "author": "yushuang24", + "dd": true }, { "version": "3.0.0", @@ -177,7 +185,8 @@ "sort": 7, "show": true, "taro": true, - "author": "vickyYE" + "author": "vickyYE", + "dd": true }, { "version": "3.0.0", @@ -189,7 +198,8 @@ "show": true, "taro": true, "v15": true, - "author": "yangxiaolu" + "author": "yangxiaolu", + "dd": true }, { "version": "3.0.0", @@ -201,7 +211,8 @@ "show": false, "taro": true, "exportEmpty": true, - "author": "yangxiaolu" + "author": "yangxiaolu", + "dd": true }, { "version": "3.0.0", @@ -212,7 +223,8 @@ "sort": 1, "show": true, "taro": true, - "author": "yushuang24" + "author": "yushuang24", + "dd": true }, { "version": "3.0.0", @@ -223,7 +235,8 @@ "sort": 2, "show": false, "exportEmpty": true, - "author": "yushuang24" + "author": "yushuang24", + "dd": true }, { "version": "3.0.0", @@ -234,7 +247,8 @@ "sort": 8, "show": true, "taro": true, - "author": "ivan" + "author": "ivan", + "dd": true }, { "version": "2.0.0", @@ -245,7 +259,8 @@ "sort": 7, "show": true, "taro": true, - "author": "hx" + "author": "hx", + "dd": false }, { "version": "3.0.0", @@ -256,7 +271,8 @@ "sort": 9, "show": true, "taro": true, - "author": "oasis" + "author": "oasis", + "dd": true } ] }, @@ -275,7 +291,8 @@ "show": true, "taro": true, "v15": true, - "author": "vickyYe" + "author": "vickyYe", + "dd": true }, { "version": "3.0.0", @@ -286,7 +303,8 @@ "sort": 4, "show": true, "taro": true, - "author": "songsong" + "author": "songsong", + "dd": true }, { "version": "2.0.0", @@ -297,7 +315,8 @@ "sort": 5, "show": true, "taro": true, - "author": "Ymm0008" + "author": "Ymm0008", + "dd": false }, { "version": "3.0.0", @@ -308,7 +327,8 @@ "sort": 5, "show": true, "taro": true, - "author": "Ymm0008" + "author": "Ymm0008", + "dd": true }, { "version": "3.0.0", @@ -320,7 +340,8 @@ "sort": 5, "show": false, "taro": true, - "author": "Ymm0008" + "author": "Ymm0008", + "dd": true }, { "version": "3.0.0", @@ -332,7 +353,8 @@ "show": true, "taro": true, "v15": true, - "author": "dsj" + "author": "dsj", + "dd": true }, { "version": "2.0.0", @@ -343,7 +365,8 @@ "sort": 9, "show": true, "taro": true, - "author": "hx" + "author": "hx", + "dd": false }, { "version": "2.0.0", @@ -354,7 +377,8 @@ "desc": "用于侧边栏导航子组件", "sort": 11, "show": false, - "author": "hx" + "author": "hx", + "dd": false }, { "version": "2.0.0", @@ -365,7 +389,8 @@ "exportEmpty": true, "sort": 10, "show": false, - "author": "hx" + "author": "hx", + "dd": false }, { "version": "3.0.0", @@ -376,7 +401,8 @@ "sort": 2, "show": true, "taro": true, - "author": "dsj" + "author": "dsj", + "dd": true }, { "version": "3.0.0", @@ -388,7 +414,8 @@ "taro": true, "exportEmpty": true, "desc": "标签栏子组件", - "author": "dsj" + "author": "dsj", + "dd": true }, { "version": "3.0.0", @@ -399,7 +426,8 @@ "show": false, "exportEmpty": true, "desc": "选项卡切换子组件", - "author": "张晶发" + "author": "张晶发", + "dd": true }, { "version": "3.0.0", @@ -410,7 +438,8 @@ "sort": 12, "show": true, "taro": true, - "author": "oasis" + "author": "oasis", + "dd": true } ] }, @@ -427,7 +456,8 @@ "sort": 3, "show": true, "taro": true, - "author": "yangxiaolu" + "author": "yangxiaolu", + "dd": false }, { "version": "2.0.0", @@ -438,7 +468,8 @@ "sort": 10, "show": true, "taro": true, - "author": "szg2008" + "author": "szg2008", + "dd": false }, { "version": "2.0.0", @@ -449,7 +480,8 @@ "sort": 10, "show": false, "exportEmpty": true, - "author": "szg2008" + "author": "szg2008", + "dd": false }, { "version": "3.0.0", @@ -460,7 +492,8 @@ "sort": 10, "show": true, "taro": true, - "author": "eiinu" + "author": "eiinu", + "dd": true }, { "version": "2.0.0", @@ -471,7 +504,8 @@ "sort": 1, "show": true, "taro": true, - "author": "ailululu" + "author": "ailululu", + "dd": false }, { "version": "3.0.0", @@ -483,7 +517,8 @@ "show": true, "taro": true, "v15": true, - "author": "oasis" + "author": "oasis", + "dd": true }, { "version": "3.0.0", @@ -495,7 +530,8 @@ "show": false, "v15": true, "exportEmpty": true, - "author": "oasis" + "author": "oasis", + "dd": true }, { "version": "2.0.0", @@ -506,7 +542,8 @@ "sort": 15, "show": true, "taro": true, - "author": "dsj" + "author": "dsj", + "dd": false }, { "version": "2.0.0", @@ -517,7 +554,8 @@ "sort": 19, "show": true, "taro": true, - "author": "hanyuxinting" + "author": "hanyuxinting", + "dd": false }, { "version": "2.0.0", @@ -529,7 +567,8 @@ "show": false, "taro": true, "exportEmpty": true, - "author": "hanyuxinting" + "author": "hanyuxinting", + "dd": false }, { "version": "3.0.0", @@ -541,7 +580,8 @@ "show": true, "taro": true, "v15": true, - "author": "VickyYe" + "author": "VickyYe", + "dd": true }, { "version": "3.0.0", @@ -553,7 +593,8 @@ "show": true, "taro": true, "v15": true, - "author": "swag~jun" + "author": "swag~jun", + "dd": true } ] }, @@ -570,7 +611,8 @@ "sort": 13, "show": true, "taro": true, - "author": "oasis-cloud" + "author": "oasis-cloud", + "dd": false }, { "version": "2.0.0", @@ -582,7 +624,8 @@ "exportEmpty": true, "show": false, "taro": true, - "author": "oasis-cloud" + "author": "oasis-cloud", + "dd": false }, { "version": "3.0.0", @@ -593,7 +636,8 @@ "sort": 16, "show": true, "taro": true, - "author": "Drjingfubo" + "author": "Drjingfubo", + "dd": true }, { "version": "2.0.0", @@ -604,7 +648,8 @@ "sort": 10, "show": true, "taro": true, - "author": "dsj" + "author": "dsj", + "dd": false }, { "version": "3.0.0", @@ -616,7 +661,8 @@ "show": true, "taro": true, "v15": true, - "author": "oasis" + "author": "oasis", + "dd": true }, { "version": "3.0.0", @@ -628,7 +674,8 @@ "exportEmpty": true, "show": false, "v15": true, - "author": "oasis" + "author": "oasis", + "dd": true }, { "version": "3.0.0", @@ -639,7 +686,8 @@ "sort": 3, "show": true, "taro": true, - "author": "vickyYe" + "author": "vickyYe", + "dd": true }, { "version": "3.0.0", @@ -651,7 +699,8 @@ "show": true, "taro": true, "v15": true, - "author": "dsj" + "author": "dsj", + "dd": true }, { "version": "3.0.0", @@ -662,7 +711,8 @@ "sort": 16, "show": true, "taro": true, - "author": "Ymm0008" + "author": "Ymm0008", + "dd": true }, { "version": "2.0.0", @@ -673,7 +723,8 @@ "sort": 10, "show": true, "taro": true, - "author": "Drjingfubo" + "author": "Drjingfubo", + "dd": false }, { "version": "2.0.0", @@ -684,7 +735,8 @@ "sort": 1, "show": true, "taro": true, - "author": "songsong" + "author": "songsong", + "dd": false }, { "version": "3.0.0", @@ -696,7 +748,8 @@ "show": true, "taro": true, "v15": true, - "author": "dsj" + "author": "dsj", + "dd": true }, { "version": "3.0.0", @@ -708,7 +761,8 @@ "show": true, "taro": true, "v15": true, - "author": "VickyYe" + "author": "VickyYe", + "dd": true }, { "version": "3.0.0", @@ -720,7 +774,8 @@ "sort": 1, "show": true, "taro": true, - "author": "swag~jun" + "author": "swag~jun", + "dd": true } ] }, @@ -737,7 +792,8 @@ "sort": 11, "show": true, "taro": true, - "author": "dsj" + "author": "dsj", + "dd": true }, { "version": "3.0.0", @@ -749,7 +805,8 @@ "show": true, "taro": true, "v15": true, - "author": "lzz" + "author": "lzz", + "dd": true }, { "version": "3.0.0", @@ -760,7 +817,8 @@ "sort": 12, "show": true, "taro": true, - "author": "yangjinjun3" + "author": "yangjinjun3", + "dd": true }, { "version": "2.0.0", @@ -771,7 +829,8 @@ "sort": 1, "show": true, "taro": true, - "author": "songsong" + "author": "songsong", + "dd": false }, { "version": "3.0.0", @@ -783,7 +842,8 @@ "show": true, "taro": true, "author": "liukun", - "v15": true + "v15": true, + "dd": true }, { "version": "3.0.0", @@ -795,7 +855,8 @@ "show": true, "taro": true, "v15": true, - "author": "songsong" + "author": "songsong", + "dd": true }, { "version": "3.0.0", @@ -808,7 +869,8 @@ "show": true, "taro": true, "v15": true, - "author": "swag~jun" + "author": "swag~jun", + "dd": true }, { "version": "3.0.0", @@ -819,8 +881,9 @@ "sort": 15, "show": true, "taro": true, - "v15":true, - "author": "mike8625" + "v15": true, + "author": "mike8625", + "dd": true }, { "version": "2.0.0", @@ -831,7 +894,8 @@ "sort": 11, "show": true, "taro": true, - "author": "vickyYe" + "author": "vickyYe", + "dd": false }, { "version": "3.0.0", @@ -843,7 +907,8 @@ "sort": 11, "show": true, "taro": true, - "author": "vickyYE" + "author": "vickyYE", + "dd": true }, { "version": "3.0.0", @@ -855,7 +920,8 @@ "show": true, "taro": true, "v15": true, - "author": "lzz" + "author": "lzz", + "dd": true }, { "version": "3.0.0", @@ -868,7 +934,8 @@ "v15": true, "rn": true, "desc": "弹出层容器,用于展示弹窗、信息提示等内容,支持多个弹出层叠加展示", - "author": "szg2008" + "author": "szg2008", + "dd": true }, { "version": "3.0.0", @@ -879,7 +946,8 @@ "sort": 10, "show": true, "taro": true, - "author": "oasis" + "author": "oasis", + "dd": true }, { "version": "3.0.0", @@ -890,7 +958,8 @@ "sort": 15, "show": true, "taro": true, - "author": "swag~jun" + "author": "swag~jun", + "dd": true }, { "version": "3.0.0", @@ -901,7 +970,8 @@ "sort": 9, "show": true, "taro": true, - "author": "Ymm0008" + "author": "Ymm0008", + "dd": true }, { "version": "3.0.0", @@ -914,7 +984,8 @@ "show": true, "taro": true, "v15": true, - "author": "VickyYe" + "author": "VickyYe", + "dd": true } ] }, @@ -931,7 +1002,8 @@ "sort": 27, "show": true, "taro": true, - "author": "swag~jun" + "author": "swag~jun", + "dd": false }, { "version": "3.0.0", @@ -942,7 +1014,8 @@ "sort": 7, "show": true, "taro": true, - "author": "songsong" + "author": "songsong", + "dd": true }, { "version": "2.0.0", @@ -953,7 +1026,8 @@ "sort": 21, "show": true, "taro": false, - "author": "libin" + "author": "libin", + "dd": false }, { "version": "3.0.0", @@ -964,7 +1038,8 @@ "sort": 2, "show": true, "taro": true, - "author": "junjun" + "author": "junjun", + "dd": true }, { "version": "3.0.0", @@ -975,7 +1050,8 @@ "sort": 18, "show": false, "exportEmpty": true, - "author": "swag~jun" + "author": "swag~jun", + "dd": true }, { "version": "2.0.0", @@ -986,7 +1062,8 @@ "sort": 7, "show": true, "taro": true, - "author": "swag~jun" + "author": "swag~jun", + "dd": false }, { "version": "2.0.0", @@ -997,7 +1074,8 @@ "sort": 2, "show": true, "taro": true, - "author": "zhenyulei" + "author": "zhenyulei", + "dd": false }, { "version": "2.0.0", @@ -1008,7 +1086,8 @@ "sort": 13, "show": false, "exportEmpty": true, - "author": "zhenyulei" + "author": "zhenyulei", + "dd": false }, { "version": "3.0.0", @@ -1020,7 +1099,8 @@ "show": true, "taro": true, "v15": true, - "author": "songsong" + "author": "songsong", + "dd": true }, { "version": "2.0.0", @@ -1031,7 +1111,8 @@ "sort": 27, "show": true, "taro": true, - "author": "vickyYE" + "author": "vickyYE", + "dd": false }, { "version": "3.0.0", @@ -1042,7 +1123,8 @@ "sort": 23, "show": true, "taro": true, - "author": "yangjinjun3" + "author": "yangjinjun3", + "dd": true }, { "version": "3.0.0", @@ -1054,7 +1136,8 @@ "show": true, "taro": true, "v15": true, - "author": "liukun" + "author": "liukun", + "dd": true }, { "version": "3.0.0", @@ -1066,7 +1149,8 @@ "show": true, "taro": true, "v15": true, - "author": "swag~jun" + "author": "swag~jun", + "dd": false }, { "version": "3.0.0", @@ -1078,7 +1162,8 @@ "show": true, "taro": true, "v15": true, - "author": "lkjh3214" + "author": "lkjh3214", + "dd": true }, { "version": "3.0.0", @@ -1090,7 +1175,8 @@ "show": true, "taro": true, "v15": true, - "author": "lkjh3214" + "author": "lkjh3214", + "dd": true }, { "version": "3.0.0", @@ -1102,7 +1188,8 @@ "show": true, "taro": true, "v15": true, - "author": "songsong" + "author": "songsong", + "dd": true }, { "version": "3.0.0", @@ -1113,7 +1200,8 @@ "sort": 20, "show": true, "taro": true, - "author": "ailululu" + "author": "ailululu", + "dd": true }, { "version": "2.0.0", @@ -1124,7 +1212,8 @@ "show": false, "exportEmpty": true, "desc": "步骤条子组件", - "author": "swag~jun" + "author": "swag~jun", + "dd": false }, { "version": "2.0.0", @@ -1135,7 +1224,8 @@ "sort": 7, "show": true, "taro": true, - "author": "swag~jun" + "author": "swag~jun", + "dd": false }, { "version": "3.0.0", @@ -1146,7 +1236,8 @@ "sort": 14, "show": true, "taro": true, - "author": "liukun" + "author": "liukun", + "dd": true }, { "version": "3.0.0", @@ -1157,7 +1248,8 @@ "sort": 14, "show": false, "exportEmpty": true, - "author": "liukun" + "author": "liukun", + "dd": true }, { "version": "2.0.0", @@ -1168,7 +1260,8 @@ "sort": 21, "show": true, "taro": true, - "author": "yangjinjun3" + "author": "yangjinjun3", + "dd": false }, { "version": "3.0.0", @@ -1179,7 +1272,8 @@ "sort": 4, "show": true, "taro": true, - "author": "lzz" + "author": "lzz", + "dd": true }, { "version": "2.0.0", @@ -1190,7 +1284,8 @@ "sort": 24, "show": true, "taro": true, - "author": "swag~jun" + "author": "swag~jun", + "dd": false }, { "version": "3.0.0", @@ -1202,7 +1297,8 @@ "sort": 20, "show": true, "taro": true, - "author": "swag~jun" + "author": "swag~jun", + "dd": true }, { "version": "2.0.0", @@ -1214,7 +1310,8 @@ "tarodoc": true, "show": true, "taro": true, - "author": "hx" + "author": "hx", + "dd": false } ] }, @@ -1231,7 +1328,8 @@ "sort": 2, "show": true, "taro": true, - "author": "swag~jun" + "author": "swag~jun", + "dd": false }, { "version": "3.0.0", @@ -1242,7 +1340,8 @@ "sort": 6, "show": true, "taro": true, - "author": "songsong" + "author": "songsong", + "dd": true }, { "version": "3.0.0", @@ -1253,7 +1352,8 @@ "sort": 8, "show": false, "exportEmpty": true, - "author": "zhaoqian16" + "author": "zhaoqian16", + "dd": true }, { "version": "3.0.0", @@ -1264,7 +1364,8 @@ "sort": 20, "show": true, "taro": true, - "author": "zhaoqian16" + "author": "zhaoqian16", + "dd": true }, { "version": "3.0.0", @@ -1275,7 +1376,8 @@ "sort": 25, "show": true, "taro": true, - "author": "songsong" + "author": "songsong", + "dd": true }, { "version": "2.0.0", @@ -1286,7 +1388,8 @@ "sort": 25, "show": true, "taro": true, - "author": "swag~jun" + "author": "swag~jun", + "dd": false }, { "version": "2.0.0", @@ -1297,9 +1400,10 @@ "sort": 26, "show": true, "taro": true, - "author": "Marvin" + "author": "Marvin", + "dd": false } ] } ] -} +} \ No newline at end of file