mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[improvement] rename packages dir to src (#3659)
This commit is contained in:
parent
8489918dca
commit
75c79b7044
@ -8,7 +8,7 @@ const markdownVetur = require('@vant/markdown-vetur');
|
|||||||
|
|
||||||
const esDir = path.join(__dirname, '../es');
|
const esDir = path.join(__dirname, '../es');
|
||||||
const libDir = path.join(__dirname, '../lib');
|
const libDir = path.join(__dirname, '../lib');
|
||||||
const srcDir = path.join(__dirname, '../packages');
|
const srcDir = path.join(__dirname, '../src');
|
||||||
const veturDir = path.join(__dirname, '../vetur');
|
const veturDir = path.join(__dirname, '../vetur');
|
||||||
const babelConfig = {
|
const babelConfig = {
|
||||||
configFile: path.join(__dirname, '../babel.config.js')
|
configFile: path.join(__dirname, '../babel.config.js')
|
||||||
|
@ -56,7 +56,7 @@ export default {
|
|||||||
};
|
};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
fs.writeFileSync(path.join(__dirname, '../packages/index.ts'), content);
|
fs.writeFileSync(path.join(__dirname, '../src/index.ts'), content);
|
||||||
}
|
}
|
||||||
|
|
||||||
buildEntry();
|
buildEntry();
|
||||||
|
@ -11,6 +11,6 @@ const excludes = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
const dirs = fs.readdirSync(path.resolve(__dirname, '../packages'));
|
const dirs = fs.readdirSync(path.resolve(__dirname, '../src'));
|
||||||
return dirs.filter(dirName => excludes.indexOf(dirName) === -1);
|
return dirs.filter(dirName => excludes.indexOf(dirName) === -1);
|
||||||
};
|
};
|
||||||
|
@ -50,7 +50,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@import '../../packages/style/var';
|
@import '../../src/style/var';
|
||||||
|
|
||||||
body {
|
body {
|
||||||
color: @text-color;
|
color: @text-color;
|
||||||
|
@ -68,7 +68,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@import '../../../packages/style/var';
|
@import '../../../src/style/var';
|
||||||
|
|
||||||
.side-nav {
|
.side-nav {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Locale } from '../../../packages';
|
import { Locale } from '../../../src';
|
||||||
|
|
||||||
Locale.add({
|
Locale.add({
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
|
@ -6,8 +6,8 @@ import Vue from 'vue';
|
|||||||
import VueRouter from 'vue-router';
|
import VueRouter from 'vue-router';
|
||||||
import VantDoc, { DemoBlock, DemoSection } from '@vant/doc';
|
import VantDoc, { DemoBlock, DemoSection } from '@vant/doc';
|
||||||
import i18n from './utils/i18n';
|
import i18n from './utils/i18n';
|
||||||
import Vant, { Lazyload, Locale } from '../../packages';
|
import Vant, { Lazyload, Locale } from '../../src';
|
||||||
import { camelize } from '../../packages/utils/format/string';
|
import { camelize } from '../../src/utils/format/string';
|
||||||
|
|
||||||
Vue
|
Vue
|
||||||
.use(Vant)
|
.use(Vant)
|
||||||
|
@ -13,7 +13,7 @@ Vue.use(VueRouter).use(VantDoc);
|
|||||||
|
|
||||||
const docs = {};
|
const docs = {};
|
||||||
const docsFromMarkdown = require.context('../markdown', false, /(en-US|zh-CN)\.md$/);
|
const docsFromMarkdown = require.context('../markdown', false, /(en-US|zh-CN)\.md$/);
|
||||||
const docsFromPackages = require.context('../../packages', true, /(en-US|zh-CN)\.md$/);
|
const docsFromPackages = require.context('../../src', true, /(en-US|zh-CN)\.md$/);
|
||||||
|
|
||||||
importAll(docs, docsFromMarkdown);
|
importAll(docs, docsFromMarkdown);
|
||||||
importAll(docs, docsFromPackages);
|
importAll(docs, docsFromPackages);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import '../../packages/index.less';
|
import '../../src/index.less';
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import VueRouter from 'vue-router';
|
import VueRouter from 'vue-router';
|
||||||
import App from './WapApp';
|
import App from './WapApp';
|
||||||
@ -7,7 +7,7 @@ import { importAll } from './utils';
|
|||||||
import '@vant/touch-emulator';
|
import '@vant/touch-emulator';
|
||||||
|
|
||||||
const componentMap = {};
|
const componentMap = {};
|
||||||
const context = require.context('../../packages', true, /demo\/index.vue$/);
|
const context = require.context('../../src', true, /demo\/index.vue$/);
|
||||||
|
|
||||||
importAll(componentMap, context);
|
importAll(componentMap, context);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// component mixin
|
// component mixin
|
||||||
import { get } from '../../../packages/utils';
|
import { get } from '../../../src/utils';
|
||||||
import { camelize } from '../../../packages/utils/format/string';
|
import { camelize } from '../../../src/utils/format/string';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Locale from '../../../packages/locale';
|
import Locale from '../../../src/locale';
|
||||||
import zhCN from '../../../packages/locale/lang/zh-CN';
|
import zhCN from '../../../src/locale/lang/zh-CN';
|
||||||
import enUS from '../../../packages/locale/lang/en-US';
|
import enUS from '../../../src/locale/lang/en-US';
|
||||||
|
|
||||||
const langMap = {
|
const langMap = {
|
||||||
'en-US': {
|
'en-US': {
|
||||||
|
@ -7,11 +7,11 @@ module.exports = {
|
|||||||
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
|
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
|
||||||
},
|
},
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'^packages/(.*)$': '<rootDir>/packages/$1'
|
'^src/(.*)$': '<rootDir>/src/$1'
|
||||||
},
|
},
|
||||||
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
|
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
|
||||||
collectCoverageFrom: [
|
collectCoverageFrom: [
|
||||||
'packages/**/*.{js,ts,tsx,vue}',
|
'src/**/*.{js,ts,tsx,vue}',
|
||||||
'!**/style/**',
|
'!**/style/**',
|
||||||
'!**/demo/**',
|
'!**/demo/**',
|
||||||
'!**/locale/lang/**',
|
'!**/locale/lang/**',
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"bootstrap": "yarn || npm i",
|
"bootstrap": "yarn || npm i",
|
||||||
"dev": "npm run build:entry && webpack-dev-server --config build/webpack.dev.js",
|
"dev": "npm run build:entry && webpack-dev-server --config build/webpack.dev.js",
|
||||||
"lint": "eslint ./packages --ext .js,.vue,.ts,.tsx && stylelint \"packages/**/*.less\" --fix",
|
"lint": "eslint ./src --ext .js,.vue,.ts,.tsx && stylelint \"src/**/*.less\" --fix",
|
||||||
"build:entry": "node build/build-entry.js",
|
"build:entry": "node build/build-entry.js",
|
||||||
"build:changelog": "vant-doc changelog ./docs/markdown/changelog.generated.md --tag 2.0.0",
|
"build:changelog": "vant-doc changelog ./docs/markdown/changelog.generated.md --tag 2.0.0",
|
||||||
"build:lib": "node build/build-lib.js",
|
"build:lib": "node build/build-lib.js",
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user