mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 05:42:44 +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 libDir = path.join(__dirname, '../lib');
|
||||
const srcDir = path.join(__dirname, '../packages');
|
||||
const srcDir = path.join(__dirname, '../src');
|
||||
const veturDir = path.join(__dirname, '../vetur');
|
||||
const babelConfig = {
|
||||
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();
|
||||
|
@ -11,6 +11,6 @@ const excludes = [
|
||||
];
|
||||
|
||||
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);
|
||||
};
|
||||
|
@ -50,7 +50,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@import '../../packages/style/var';
|
||||
@import '../../src/style/var';
|
||||
|
||||
body {
|
||||
color: @text-color;
|
||||
|
@ -68,7 +68,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@import '../../../packages/style/var';
|
||||
@import '../../../src/style/var';
|
||||
|
||||
.side-nav {
|
||||
box-sizing: border-box;
|
||||
|
@ -26,7 +26,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Locale } from '../../../packages';
|
||||
import { Locale } from '../../../src';
|
||||
|
||||
Locale.add({
|
||||
'zh-CN': {
|
||||
|
@ -6,8 +6,8 @@ import Vue from 'vue';
|
||||
import VueRouter from 'vue-router';
|
||||
import VantDoc, { DemoBlock, DemoSection } from '@vant/doc';
|
||||
import i18n from './utils/i18n';
|
||||
import Vant, { Lazyload, Locale } from '../../packages';
|
||||
import { camelize } from '../../packages/utils/format/string';
|
||||
import Vant, { Lazyload, Locale } from '../../src';
|
||||
import { camelize } from '../../src/utils/format/string';
|
||||
|
||||
Vue
|
||||
.use(Vant)
|
||||
|
@ -13,7 +13,7 @@ Vue.use(VueRouter).use(VantDoc);
|
||||
|
||||
const docs = {};
|
||||
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, docsFromPackages);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import '../../packages/index.less';
|
||||
import '../../src/index.less';
|
||||
import Vue from 'vue';
|
||||
import VueRouter from 'vue-router';
|
||||
import App from './WapApp';
|
||||
@ -7,7 +7,7 @@ import { importAll } from './utils';
|
||||
import '@vant/touch-emulator';
|
||||
|
||||
const componentMap = {};
|
||||
const context = require.context('../../packages', true, /demo\/index.vue$/);
|
||||
const context = require.context('../../src', true, /demo\/index.vue$/);
|
||||
|
||||
importAll(componentMap, context);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// component mixin
|
||||
import { get } from '../../../packages/utils';
|
||||
import { camelize } from '../../../packages/utils/format/string';
|
||||
import { get } from '../../../src/utils';
|
||||
import { camelize } from '../../../src/utils/format/string';
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Locale from '../../../packages/locale';
|
||||
import zhCN from '../../../packages/locale/lang/zh-CN';
|
||||
import enUS from '../../../packages/locale/lang/en-US';
|
||||
import Locale from '../../../src/locale';
|
||||
import zhCN from '../../../src/locale/lang/zh-CN';
|
||||
import enUS from '../../../src/locale/lang/en-US';
|
||||
|
||||
const langMap = {
|
||||
'en-US': {
|
||||
|
@ -7,11 +7,11 @@ module.exports = {
|
||||
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
|
||||
},
|
||||
moduleNameMapper: {
|
||||
'^packages/(.*)$': '<rootDir>/packages/$1'
|
||||
'^src/(.*)$': '<rootDir>/src/$1'
|
||||
},
|
||||
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
|
||||
collectCoverageFrom: [
|
||||
'packages/**/*.{js,ts,tsx,vue}',
|
||||
'src/**/*.{js,ts,tsx,vue}',
|
||||
'!**/style/**',
|
||||
'!**/demo/**',
|
||||
'!**/locale/lang/**',
|
||||
|
@ -15,7 +15,7 @@
|
||||
"scripts": {
|
||||
"bootstrap": "yarn || npm i",
|
||||
"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:changelog": "vant-doc changelog ./docs/markdown/changelog.generated.md --tag 2.0.0",
|
||||
"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