Skip to content

Commit

Permalink
build: switch to recursive-readdir because of fshost/node-dir#53
Browse files Browse the repository at this point in the history
  • Loading branch information
Justineo committed Aug 3, 2021
1 parent 3611c35 commit db1773b
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 25 deletions.
11 changes: 6 additions & 5 deletions packages/veui/build/components.js
Original file line number Diff line number Diff line change
@@ -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('/')
Expand Down Expand Up @@ -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,
Expand Down
20 changes: 10 additions & 10 deletions packages/veui/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,47 +233,47 @@
},
{
"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",
"path": "Lightbox.vue"
},
{
"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",
Expand Down
Loading

0 comments on commit db1773b

Please sign in to comment.