From db1773beae53d84db1632f24819d50deb708ba2c Mon Sep 17 00:00:00 2001 From: Justineo Date: Tue, 3 Aug 2021 21:00:38 +0800 Subject: [PATCH] build: switch to recursive-readdir because of fshost/node-dir#53 --- packages/veui/build/components.js | 11 +- packages/veui/components.json | 20 +-- packages/veui/package-lock.json | 254 ++++++++++++++++++++++++++++-- packages/veui/package.json | 2 +- 4 files changed, 262 insertions(+), 25 deletions(-) diff --git a/packages/veui/build/components.js b/packages/veui/build/components.js index 486d0b905..353aeb6f0 100644 --- a/packages/veui/build/components.js +++ b/packages/veui/build/components.js @@ -1,13 +1,13 @@ const { writeFileSync, statSync, existsSync } = require('fs') const { resolve, relative, join, extname } = require('path') -const dir = require('node-dir') +const recursive = require('recursive-readdir') const { getSortedComponents } = require('./utils') const componentDir = resolve(__dirname, '../src/components') async function genComponentJson () { - let mappings = dir - .files(componentDir, { sync: true }) + let files = await recursive(componentDir) + let mappings = files .reduce((mappings, file) => { let modulePath = relative(componentDir, file) let segments = modulePath.split('/') @@ -39,8 +39,9 @@ async function genComponentJson () { ) } -function genComponentIndex () { - let res = dir +async function genComponentIndex () { + let files = await recursive(componentDir) + let res = files .files(componentDir, 'combine', null, { sync: true, recursive: false, diff --git a/packages/veui/components.json b/packages/veui/components.json index b8f28f859..59afb917b 100644 --- a/packages/veui/components.json +++ b/packages/veui/components.json @@ -233,27 +233,27 @@ }, { "name": "GridColumn", - "path": "Grid/GridColumn.vue" + "path": "GridColumn.js" }, { "name": "GridColumn", - "path": "GridColumn.js" + "path": "Grid/GridColumn.vue" }, { "name": "GridContainer", - "path": "Grid/GridContainer.vue" + "path": "GridContainer.js" }, { "name": "GridContainer", - "path": "GridContainer.js" + "path": "Grid/GridContainer.vue" }, { "name": "GridRow", - "path": "Grid/GridRow.vue" + "path": "GridRow.js" }, { "name": "GridRow", - "path": "GridRow.js" + "path": "Grid/GridRow.vue" }, { "name": "Lightbox", @@ -261,19 +261,19 @@ }, { "name": "Menu", - "path": "Menu/Menu.vue" + "path": "Menu.js" }, { "name": "Menu", - "path": "Menu.js" + "path": "Menu/Menu.vue" }, { "name": "Nav", - "path": "Menu/Nav.vue" + "path": "Nav.js" }, { "name": "Nav", - "path": "Nav.js" + "path": "Menu/Nav.vue" }, { "name": "NumberInput", diff --git a/packages/veui/package-lock.json b/packages/veui/package-lock.json index 4c51d7540..181b6519b 100644 --- a/packages/veui/package-lock.json +++ b/packages/veui/package-lock.json @@ -1164,12 +1164,40 @@ "glob-to-regexp": "^0.3.0" } }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + } + } + }, "@nodelib/fs.stat": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", "dev": true }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, "@rollup/plugin-alias": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-3.1.2.tgz", @@ -2476,6 +2504,12 @@ "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", "dev": true }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -2858,6 +2892,12 @@ "@babel/helper-define-polyfill-provider": "^0.2.2" } }, + "babel-plugin-veui": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-veui/-/babel-plugin-veui-2.0.1.tgz", + "integrity": "sha512-ETtv64VpfkjnbhrAbxtjXMZVnAcrWJ7wfiiXbQKM18rk0bUKZ7rwHkIjSIuGMbZygmXdvoJcyCs2D46sIjboVw==", + "dev": true + }, "babel-walk": { "version": "3.0.0-canary-5", "resolved": "https://registry.npmjs.org/babel-walk/-/babel-walk-3.0.0-canary-5.tgz", @@ -3887,6 +3927,12 @@ "color-name": "1.1.3" } }, + "color-converters": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/color-converters/-/color-converters-0.1.1.tgz", + "integrity": "sha512-z38H2Ukv9BI0EQf1AT3ev3lbyBql4K9wSBJ6W32blnKxArRE59TbPxKdlQq/VC7Kl1lxCJuUFAV9Fy96pWfCaw==", + "dev": true + }, "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", @@ -5102,11 +5148,26 @@ "path-type": "^3.0.0" } }, + "dls-color-palette": { + "version": "0.0.1-alpha.3", + "resolved": "https://registry.npmjs.org/dls-color-palette/-/dls-color-palette-0.0.1-alpha.3.tgz", + "integrity": "sha512-/pfSbFKP51+c1KIi/scbrVzYV5cVQ+KFHKhxJslNse3UocMkevTgBQkkElS4O7luH7UCP16VsJPJtc+quBZKvw==", + "dev": true, + "requires": { + "color-converters": "^0.1.1" + } + }, "dls-graphics": { "version": "1.0.0-alpha.3", "resolved": "https://registry.npmjs.org/dls-graphics/-/dls-graphics-1.0.0-alpha.3.tgz", "integrity": "sha512-hcjpES2w/BOwmFGKRClsXfQ1QQYkK9KH8Zx6OOMpda5G4ti1kHQWtSqoOHFAL+HxYLE05fb1PUY+O3jvZaQzvg==" }, + "dls-icons-vue": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/dls-icons-vue/-/dls-icons-vue-0.23.1.tgz", + "integrity": "sha512-Em9cf8rEGih+vOynW9FVNlD+pK7b9hs15yVvKoeWnyW7kg8gmnocv6wyTmSe9dsgPSmtGJJno4YIbfzrp6/ZAg==", + "dev": true + }, "dns-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", @@ -6102,6 +6163,12 @@ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true }, + "esm": { + "version": "3.2.25", + "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", + "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", + "dev": true + }, "espree": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", @@ -6518,6 +6585,15 @@ "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==", "dev": true }, + "fastq": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.1.tgz", + "integrity": "sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "faye-websocket": { "version": "0.11.4", "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", @@ -8926,6 +9002,83 @@ } } }, + "less-plugin-dls": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/less-plugin-dls/-/less-plugin-dls-1.0.0-beta.2.tgz", + "integrity": "sha512-dtr6asA3eM6DySKxsw5tVgfWtqe2XZRroBZf69zPDgqk2McWKI6NNDl4D+y8/R3hJ8HlTn0q29iWKt2LpV36JA==", + "dev": true, + "requires": { + "arg": "^4.1.3", + "dls-color-palette": "0.0.1-alpha.3", + "esm": "^3.2.25", + "fast-glob": "^3.0.4", + "pkg-dir": "^4.2.0" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fast-glob": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, "less-plugin-est": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/less-plugin-est/-/less-plugin-est-3.0.1.tgz", @@ -10252,15 +10405,6 @@ "lower-case": "^1.1.1" } }, - "node-dir": { - "version": "0.1.17", - "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", - "integrity": "sha1-X1Zl2TNRM1yqvvjxxVRRbPXx5OU=", - "dev": true, - "requires": { - "minimatch": "^3.0.2" - } - }, "node-environment-flags": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", @@ -12222,6 +12366,12 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -12352,6 +12502,15 @@ "picomatch": "^2.2.1" } }, + "recursive-readdir": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", + "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", + "dev": true, + "requires": { + "minimatch": "3.0.4" + } + }, "regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -12665,6 +12824,12 @@ "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rfdc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", @@ -12775,6 +12940,15 @@ "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, "run-queue": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", @@ -14786,6 +14960,68 @@ "extsprintf": "^1.2.0" } }, + "veui-loader": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/veui-loader/-/veui-loader-2.0.1.tgz", + "integrity": "sha512-cOh7G6eLNjJfFBxEwQd8gycVyCzDzUojxcPK9VlUuXvHJPZ/9eKd7iNfRFKAt2CPOi7RSBUor0nnzJ5bG6bSGQ==", + "dev": true, + "requires": { + "loader-utils": "^2.0.0", + "magic-string": "^0.25.7", + "pkg-dir": "^4.2.0", + "slash": "^3.0.0" + }, + "dependencies": { + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + } + } + }, + "veui-theme-dls": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/veui-theme-dls/-/veui-theme-dls-2.0.1.tgz", + "integrity": "sha512-5u/HLFNszVT6pY3V/Jme5yxFS0Nxf+U/7Ygr4fQl8Ohy2lKCqqJP7HRfYun2mPUBXuYdH+HBJ+HAa1BwtCC4bQ==", + "dev": true, + "requires": { + "classlist-polyfill": "^1.2.0", + "dls-icons-vue": "^0.23.0", + "focus-visible": "^4.1.0", + "less-plugin-dls": "^1.0.0-alpha.36", + "less-plugin-est": "^3.0.0", + "veui-theme-dls-icons": "^2.0.1" + } + }, + "veui-theme-dls-icons": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/veui-theme-dls-icons/-/veui-theme-dls-icons-2.0.1.tgz", + "integrity": "sha512-ttEUi0U8iNy6th6K/WSBYtQUgVVOvM7Gq4xm7jNexXaz92+LNThwAGUngY8Iy1v8ITHdFpIVy+2MuINiuhwCdg==", + "dev": true, + "requires": { + "dls-icons-vue": "^0.33.0" + }, + "dependencies": { + "dls-icons-vue": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/dls-icons-vue/-/dls-icons-vue-0.33.0.tgz", + "integrity": "sha512-cj7lsPKo5E9V1uNupugQEj2SPzTcOML+iRRutEv5g5EQedfB2h12WdEZEFdd+pb/2WEn6j1NUEMIbgJs0u8ikw==", + "dev": true + } + } + }, "vm-browserify": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", diff --git a/packages/veui/package.json b/packages/veui/package.json index 5de1bbbd5..ee179805e 100644 --- a/packages/veui/package.json +++ b/packages/veui/package.json @@ -76,8 +76,8 @@ "lint-staged": "^8.1.4", "mocha": "^7.2.0", "moment": "^2.27.0", - "node-dir": "^0.1.17", "promise-polyfill": "^8.1.0", + "recursive-readdir": "^2.2.2", "rollup": "^2.49.0", "rollup-plugin-replace": "^2.2.0", "rollup-plugin-vue": "^5.1.9",