chore: merge src and src-next

This commit is contained in:
chenjiahan
2020-07-15 20:02:00 +08:00
parent 6672b34618
commit 0304fcb6fa
382 changed files with 464 additions and 24746 deletions

View File

@@ -7,6 +7,7 @@ import {
outputFileSync,
} from 'fs-extra';
import {
ROOT,
SRC_DIR,
getVantConfig,
ROOT_WEBPACK_CONFIG_FILE,
@@ -36,10 +37,15 @@ export function hasDefaultExport(code: string) {
export function getComponents() {
const EXCLUDES = ['.DS_Store'];
const dirs = readdirSync(SRC_DIR);
// TODO
// whitelist for 3.0 development
const whiteList = require(join(ROOT, 'components.js'));
return dirs
.filter(dir => !EXCLUDES.includes(dir))
.filter(dir =>
ENTRY_EXTS.some(ext => {
.filter((dir) => !EXCLUDES.includes(dir))
.filter((dir) =>
ENTRY_EXTS.some((ext) => {
const path = join(SRC_DIR, dir, `index.${ext}`);
if (existsSync(path)) {
return hasDefaultExport(readFileSync(path, 'utf-8'));
@@ -47,7 +53,8 @@ export function getComponents() {
return false;
})
);
)
.filter((dir) => whiteList.includes(dir));
}
export function isDir(dir: string) {