mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
test(compiler): auto create example index.wxml
This commit is contained in:
parent
5778acc088
commit
565d71eedb
@ -1,3 +1,4 @@
|
||||
const fs = require('fs');
|
||||
const gulp = require('gulp');
|
||||
const path = require('path');
|
||||
const less = require('gulp-less');
|
||||
@ -16,8 +17,10 @@ const exampleConfig = path.resolve(__dirname, '../tsconfig.example.json');
|
||||
|
||||
const libDir = path.resolve(__dirname, '../lib');
|
||||
const esDir = path.resolve(__dirname, '../dist');
|
||||
const exampleDir = path.resolve(__dirname, '../example/dist');
|
||||
const exampleDistDir = path.resolve(__dirname, '../example/dist');
|
||||
const examplePagesDir = path.resolve(__dirname, '../example/pages');
|
||||
|
||||
const exampleAppJsonPath = path.resolve(__dirname, '../example/app.json');
|
||||
const baseCssPath = path.resolve(__dirname, '../packages/common/index.wxss');
|
||||
|
||||
const lessCompiler = (dist) =>
|
||||
@ -101,18 +104,34 @@ const tasks = [
|
||||
}, {});
|
||||
|
||||
tasks.buildExample = gulp.series(
|
||||
cleaner(exampleDir),
|
||||
cleaner(exampleDistDir),
|
||||
gulp.parallel(
|
||||
tsCompiler(exampleDir, exampleConfig),
|
||||
lessCompiler(exampleDir),
|
||||
staticCopier(exampleDir),
|
||||
tsCompiler(exampleDistDir, exampleConfig),
|
||||
lessCompiler(exampleDistDir),
|
||||
staticCopier(exampleDistDir),
|
||||
() =>
|
||||
gulp.src(`${icons}/**/*`).pipe(gulp.dest(`${exampleDir}/@vant/icons`)),
|
||||
gulp
|
||||
.src(`${icons}/**/*`)
|
||||
.pipe(gulp.dest(`${exampleDistDir}/@vant/icons`)),
|
||||
() => {
|
||||
gulp.watch(`${src}/**/*.less`, lessCompiler(exampleDir));
|
||||
gulp.watch(`${src}/**/*.wxml`, copier(exampleDir, 'wxml'));
|
||||
gulp.watch(`${src}/**/*.wxs`, copier(exampleDir, 'wxs'));
|
||||
gulp.watch(`${src}/**/*.json`, copier(exampleDir, 'json'));
|
||||
const appJson = JSON.parse(fs.readFileSync(exampleAppJsonPath));
|
||||
appJson.pages.forEach((path) => {
|
||||
const component = path.replace(/(pages\/|\/index)/g, '');
|
||||
fs.writeFileSync(
|
||||
`${examplePagesDir}/${component}/index.js`,
|
||||
"import Page from '../../common/page';Page();"
|
||||
);
|
||||
fs.writeFileSync(
|
||||
`${examplePagesDir}/${component}/index.wxml`,
|
||||
`<van-${component}-demo />`
|
||||
);
|
||||
});
|
||||
},
|
||||
() => {
|
||||
gulp.watch(`${src}/**/*.less`, lessCompiler(exampleDistDir));
|
||||
gulp.watch(`${src}/**/*.wxml`, copier(exampleDistDir, 'wxml'));
|
||||
gulp.watch(`${src}/**/*.wxs`, copier(exampleDistDir, 'wxs'));
|
||||
gulp.watch(`${src}/**/*.json`, copier(exampleDistDir, 'json'));
|
||||
}
|
||||
)
|
||||
);
|
||||
|
@ -63,122 +63,57 @@
|
||||
},
|
||||
"usingComponents": {
|
||||
"demo-block": "./components/demo-block/index",
|
||||
"van-action-sheet": "./dist/action-sheet/index",
|
||||
"van-action-sheet-demo": "./dist/action-sheet/demo/index",
|
||||
"van-area": "./dist/area/index",
|
||||
"van-area-demo": "./dist/area/demo/index",
|
||||
"van-button": "./dist/button/index",
|
||||
"van-button-demo": "./dist/button/demo/index",
|
||||
"van-card": "./dist/card/index",
|
||||
"van-card-demo": "./dist/card/demo/index",
|
||||
"van-cell": "./dist/cell/index",
|
||||
"van-cell-demo": "./dist/cell/demo/index",
|
||||
"van-cell-group": "./dist/cell-group/index",
|
||||
"van-checkbox": "./dist/checkbox/index",
|
||||
"van-checkbox-demo": "./dist/checkbox/demo/index",
|
||||
"van-checkbox-group": "./dist/checkbox-group/index",
|
||||
"van-col": "./dist/col/index",
|
||||
"van-col-demo": "./dist/col/demo/index",
|
||||
"van-count-down": "./dist/count-down/index",
|
||||
"van-count-down-demo": "./dist/count-down/demo/index",
|
||||
"van-dialog": "./dist/dialog/index",
|
||||
"van-dialog-demo": "./dist/dialog/demo/index",
|
||||
"van-divider": "./dist/divider/index",
|
||||
"van-divider-demo": "./dist/divider/demo/index",
|
||||
"van-empty": "./dist/empty/index",
|
||||
"van-empty-demo": "./dist/empty/demo/index",
|
||||
"van-field": "./dist/field/index",
|
||||
"van-field-demo": "./dist/field/demo/index",
|
||||
"van-goods-action": "./dist/goods-action/index",
|
||||
"van-goods-action-demo": "./dist/goods-action/demo/index",
|
||||
"van-goods-action-icon": "./dist/goods-action-icon/index",
|
||||
"van-goods-action-button": "./dist/goods-action-button/index",
|
||||
"van-icon": "./dist/icon/index",
|
||||
"van-icon-demo": "./dist/icon/demo/index",
|
||||
"van-image": "./dist/image/index",
|
||||
"van-image-demo": "./dist/image/demo/index",
|
||||
"van-loading": "./dist/loading/index",
|
||||
"van-loading-demo": "./dist/loading/demo/index",
|
||||
"van-nav-bar": "./dist/nav-bar/index",
|
||||
"van-nav-bar-demo": "./dist/nav-bar/demo/index",
|
||||
"van-notice-bar": "./dist/notice-bar/index",
|
||||
"van-notice-bar-demo": "./dist/notice-bar/demo/index",
|
||||
"van-notify": "./dist/notify/index",
|
||||
"van-notify-demo": "./dist/notify/demo/index",
|
||||
"van-panel": "./dist/panel/index",
|
||||
"van-panel-demo": "./dist/panel/demo/index",
|
||||
"van-popup": "./dist/popup/index",
|
||||
"van-popup-demo": "./dist/popup/demo/index",
|
||||
"van-progress": "./dist/progress/index",
|
||||
"van-progress-demo": "./dist/progress/demo/index",
|
||||
"van-radio": "./dist/radio/index",
|
||||
"van-radio-demo": "./dist/radio/demo/index",
|
||||
"van-radio-group": "./dist/radio-group/index",
|
||||
"van-row": "./dist/row/index",
|
||||
"van-search": "./dist/search/index",
|
||||
"van-search-demo": "./dist/search/demo/index",
|
||||
"van-sidebar": "./dist/sidebar/index",
|
||||
"van-sidebar-demo": "./dist/sidebar/demo/index",
|
||||
"van-sidebar-item": "./dist/sidebar-item/index",
|
||||
"van-slider": "./dist/slider/index",
|
||||
"van-slider-demo": "./dist/slider/demo/index",
|
||||
"van-stepper": "./dist/stepper/index",
|
||||
"van-stepper-demo": "./dist/stepper/demo/index",
|
||||
"van-steps": "./dist/steps/index",
|
||||
"van-steps-demo": "./dist/steps/demo/index",
|
||||
"van-sticky": "./dist/sticky/index",
|
||||
"van-sticky-demo": "./dist/sticky/demo/index",
|
||||
"van-submit-bar": "./dist/submit-bar/index",
|
||||
"van-submit-bar-demo": "./dist/submit-bar/demo/index",
|
||||
"van-swipe-cell": "./dist/swipe-cell/index",
|
||||
"van-swipe-cell-demo": "./dist/swipe-cell/demo/index",
|
||||
"van-uploader": "./dist/uploader/index",
|
||||
"van-uploader-demo": "./dist/uploader/demo/index",
|
||||
"van-switch": "./dist/switch/index",
|
||||
"van-switch-demo": "./dist/switch/demo/index",
|
||||
"van-tab": "./dist/tab/index",
|
||||
"van-tab-demo": "./dist/tab/demo/index",
|
||||
"van-tabs": "./dist/tabs/index",
|
||||
"van-tabbar": "./dist/tabbar/index",
|
||||
"van-tabbar-demo": "./dist/tabbar/demo/index",
|
||||
"van-tabbar-item": "./dist/tabbar-item/index",
|
||||
"van-tag": "./dist/tag/index",
|
||||
"van-tag-demo": "./dist/tag/demo/index",
|
||||
"van-toast": "./dist/toast/index",
|
||||
"van-toast-demo": "./dist/toast/demo/index",
|
||||
"van-transition": "./dist/transition/index",
|
||||
"van-transition-demo": "./dist/transition/demo/index",
|
||||
"van-tree-select": "./dist/tree-select/index",
|
||||
"van-tree-select-demo": "./dist/tree-select/demo/index",
|
||||
"van-datetime-picker": "./dist/datetime-picker/index",
|
||||
"van-datetime-picker-demo": "./dist/datetime-picker/demo/index",
|
||||
"van-rate": "./dist/rate/index",
|
||||
"van-rate-demo": "./dist/rate/demo/index",
|
||||
"van-collapse": "./dist/collapse/index",
|
||||
"van-collapse-demo": "./dist/collapse/demo/index",
|
||||
"van-collapse-item": "./dist/collapse-item/index",
|
||||
"van-picker": "./dist/picker/index",
|
||||
"van-picker-demo": "./dist/picker/demo/index",
|
||||
"van-overlay": "./dist/overlay/index",
|
||||
"van-overlay-demo": "./dist/overlay/demo/index",
|
||||
"van-circle": "./dist/circle/index",
|
||||
"van-circle-demo": "./dist/circle/demo/index",
|
||||
"van-index-bar": "./dist/index-bar/index",
|
||||
"van-index-bar-demo": "./dist/index-bar/demo/index",
|
||||
"van-index-anchor": "./dist/index-anchor/index",
|
||||
"van-grid": "./dist/grid/index",
|
||||
"van-grid-demo": "./dist/grid/demo/index",
|
||||
"van-grid-item": "./dist/grid-item/index",
|
||||
"van-dropdown-menu": "./dist/dropdown-menu/index",
|
||||
"van-dropdown-menu-demo": "./dist/dropdown-menu/demo/index",
|
||||
"van-dropdown-item": "./dist/dropdown-item/index",
|
||||
"van-skeleton": "./dist/skeleton/index",
|
||||
"van-skeleton-demo": "./dist/skeleton/demo/index",
|
||||
"van-calendar": "./dist/calendar/index",
|
||||
"van-calendar-demo": "./dist/calendar/demo/index",
|
||||
"van-share-sheet": "./dist/share-sheet/index",
|
||||
"van-share-sheet-demo": "./dist/share-sheet/demo/index",
|
||||
"van-config-provider": "./dist/config-provider/index",
|
||||
"van-config-provider-demo": "./dist/config-provider/demo/index"
|
||||
},
|
||||
"sitemapLocation": "sitemap.json"
|
||||
|
@ -1 +1 @@
|
||||
<van-action-sheet-demo />
|
||||
<van-action-sheet-demo />
|
@ -1 +1 @@
|
||||
<van-area-demo />
|
||||
<van-area-demo />
|
@ -1 +1 @@
|
||||
<van-button-demo />
|
||||
<van-button-demo />
|
@ -1 +1 @@
|
||||
<van-calendar-demo />
|
||||
<van-calendar-demo />
|
@ -1 +1 @@
|
||||
<van-card-demo />
|
||||
<van-card-demo />
|
@ -1 +1 @@
|
||||
<van-cell-demo />
|
||||
<van-cell-demo />
|
@ -1 +1 @@
|
||||
<van-checkbox-demo />
|
||||
<van-checkbox-demo />
|
@ -1 +1 @@
|
||||
<van-circle-demo />
|
||||
<van-circle-demo />
|
@ -1 +1 @@
|
||||
<van-col-demo />
|
||||
<van-col-demo />
|
@ -1 +1 @@
|
||||
<van-collapse-demo />
|
||||
<van-collapse-demo />
|
@ -1 +1 @@
|
||||
<van-config-provider-demo />
|
||||
<van-config-provider-demo />
|
@ -1 +1 @@
|
||||
<van-count-down-demo />
|
||||
<van-count-down-demo />
|
@ -1,8 +1,3 @@
|
||||
import list from '../../config';
|
||||
import Page from '../../common/page';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
list
|
||||
},
|
||||
});
|
||||
Page();
|
||||
|
@ -1 +1 @@
|
||||
<demo-home list="{{ list }}" />
|
||||
<van-dashboard-demo />
|
@ -1 +1 @@
|
||||
<van-datetime-picker-demo />
|
||||
<van-datetime-picker-demo />
|
@ -1 +1 @@
|
||||
<van-dialog-demo />
|
||||
<van-dialog-demo />
|
@ -1 +1 @@
|
||||
<van-divider-demo />
|
||||
<van-divider-demo />
|
@ -1 +1 @@
|
||||
<van-dropdown-menu-demo />
|
||||
<van-dropdown-menu-demo />
|
@ -1 +1 @@
|
||||
<van-empty-demo />
|
||||
<van-empty-demo />
|
@ -1 +1 @@
|
||||
<van-field-demo />
|
||||
<van-field-demo />
|
@ -1 +1 @@
|
||||
<van-goods-action-demo />
|
||||
<van-goods-action-demo />
|
@ -1 +1 @@
|
||||
<van-grid-demo />
|
||||
<van-grid-demo />
|
@ -1 +1 @@
|
||||
<van-icon-demo />
|
||||
<van-icon-demo />
|
@ -1 +1 @@
|
||||
<van-image-demo />
|
||||
<van-image-demo />
|
@ -1 +1 @@
|
||||
<van-index-bar-demo />
|
||||
<van-index-bar-demo />
|
@ -1 +1 @@
|
||||
<van-loading-demo />
|
||||
<van-loading-demo />
|
@ -1 +1 @@
|
||||
<van-nav-bar-demo />
|
||||
<van-nav-bar-demo />
|
@ -1 +1 @@
|
||||
<van-notice-bar-demo />
|
||||
<van-notice-bar-demo />
|
@ -1 +1 @@
|
||||
<van-notify-demo />
|
||||
<van-notify-demo />
|
@ -1 +1 @@
|
||||
<van-overlay-demo />
|
||||
<van-overlay-demo />
|
@ -1 +1 @@
|
||||
<van-panel-demo />
|
||||
<van-panel-demo />
|
@ -1 +1 @@
|
||||
<van-picker-demo />
|
||||
<van-picker-demo />
|
@ -1 +1 @@
|
||||
<van-popup-demo />
|
||||
<van-popup-demo />
|
@ -1 +1 @@
|
||||
<van-progress-demo />
|
||||
<van-progress-demo />
|
@ -1 +1 @@
|
||||
<van-radio-demo />
|
||||
<van-radio-demo />
|
@ -1 +1 @@
|
||||
<van-rate-demo />
|
||||
<van-rate-demo />
|
@ -1 +1 @@
|
||||
<van-search-demo />
|
||||
<van-search-demo />
|
@ -1 +1 @@
|
||||
<van-share-sheet-demo />
|
||||
<van-share-sheet-demo />
|
@ -1 +1 @@
|
||||
<van-sidebar-demo />
|
||||
<van-sidebar-demo />
|
@ -1 +1 @@
|
||||
<van-skeleton-demo />
|
||||
<van-skeleton-demo />
|
@ -1 +1 @@
|
||||
<van-slider-demo />
|
||||
<van-slider-demo />
|
@ -1 +1 @@
|
||||
<van-stepper-demo />
|
||||
<van-stepper-demo />
|
@ -1 +1 @@
|
||||
<van-steps-demo />
|
||||
<van-steps-demo />
|
@ -1 +1 @@
|
||||
<van-sticky-demo />
|
||||
<van-sticky-demo />
|
@ -1 +1 @@
|
||||
<van-submit-bar-demo />
|
||||
<van-submit-bar-demo />
|
@ -1 +1 @@
|
||||
<van-swipe-cell-demo />
|
||||
<van-swipe-cell-demo />
|
@ -1 +1 @@
|
||||
<van-switch-demo />
|
||||
<van-switch-demo />
|
@ -1 +1 @@
|
||||
<van-tab-demo />
|
||||
<van-tab-demo />
|
@ -1 +1 @@
|
||||
<van-tabbar-demo />
|
||||
<van-tabbar-demo />
|
@ -1 +1 @@
|
||||
<van-tag-demo />
|
||||
<van-tag-demo />
|
@ -1 +1 @@
|
||||
<van-toast-demo />
|
||||
<van-toast-demo />
|
@ -1 +1 @@
|
||||
<van-transition-demo />
|
||||
<van-transition-demo />
|
@ -1 +1 @@
|
||||
<van-tree-select-demo />
|
||||
<van-tree-select-demo />
|
@ -1 +1 @@
|
||||
<van-uploader-demo />
|
||||
<van-uploader-demo />
|
Loading…
x
Reference in New Issue
Block a user