Skip to content

Commit bfdbc04

Browse files
committed
fix: 修复目录结构与 package.json 导出不一致
1 parent c691a9b commit bfdbc04

File tree

8 files changed

+34
-27
lines changed

8 files changed

+34
-27
lines changed

.scripts/build.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ const entries: PackageEntry[] = [
3434
{
3535
from: 'package.json',
3636
handle: ({ archive, innerPath }) => {
37-
const { devDependencies: _devDependencies, ...pkgWithoutDevDeps } = pkg
38-
const pkgJsonContent = `${JSON.stringify(pkgWithoutDevDeps, null, 2)}\n`
37+
const {
38+
devDependencies: _devDependencies,
39+
scripts: _scripts,
40+
'simple-git-hooks': _simpleGitHooks,
41+
...restOptions
42+
} = pkg
43+
const pkgJsonContent = `${JSON.stringify(restOptions, null, 2)}\n`
3944
archive.append(pkgJsonContent, { name: innerPath })
4045
},
4146
},

src/element-plus/components/use-pagination/index.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,31 @@ import type {
22
PaginationEmits as ElPaginationEmits,
33
PaginationPropsPublic,
44
} from 'element-plus'
5-
import type { Writable } from 'type-fest'
5+
import type { Simplify, Writable } from 'type-fest'
66
import type { FunctionalComponent } from 'vue'
77
import type { ComponentSlots } from 'vue-component-type-helpers'
88
import type { UsePaginationReturn } from '../../../shared/uses/use-pagination'
99
import { ElPagination } from 'element-plus'
1010
import { mergeProps } from 'vue'
1111
import { objectPick } from '../../../_internal/utils'
12-
import { useSetupConfig } from '../../../setup-config'
12+
import { useSetupConfig } from '../../../shared/setup-config'
1313
import { defaultPropKeys } from './default-prop-keys'
1414

15+
declare module '../../../shared/setup-config' {
16+
interface SetupConfig {
17+
ElementPlus?: {
18+
ElUsePagination?: {
19+
/**
20+
* 默认属性
21+
*/
22+
defaultProps?: Simplify<
23+
Pick<PaginationPropsPublic, (typeof defaultPropKeys)[number]>
24+
>
25+
}
26+
}
27+
}
28+
}
29+
1530
export interface ElUsePaginationProps
1631
extends Partial<
1732
Omit<

src/index.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/shared/components/section-layout/components/item.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" setup>
22
import type { SectionItemProps } from '../interface'
33
import { createBEM } from '../../../../_internal/bem'
4-
import { useSetupConfig } from '../../../../setup-config'
4+
import { useSetupConfig } from '../../../setup-config'
55
66
defineOptions({
77
name: 'SectionItem',

src/shared/components/section-layout/components/main.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" setup>
22
import type { SectionMainProps } from '../interface'
33
import { createBEM } from '../../../../_internal/bem'
4-
import { useSetupConfig } from '../../../../setup-config'
4+
import { useSetupConfig } from '../../../setup-config'
55
66
defineOptions({
77
name: 'SectionMain',

src/shared/components/section-layout/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import type { SectionLayoutProps } from './interface'
33
import { computed } from 'vue'
44
import { createBEM } from '../../../_internal/bem'
5-
import { useSetupConfig } from '../../../setup-config'
5+
import { useSetupConfig } from '../../setup-config'
66
77
defineOptions({
88
name: 'SectionLayout',

src/shared/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* eslint-disable perfectionist/sort-exports */
2+
export * from './setup-config'
3+
4+
export * from './components/section-layout'
5+
export * from './components/toolbar'
6+
export * from './uses/use-pagination'
7+
export * from './uses/use-selection'

src/setup-config.ts renamed to src/shared/setup-config.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import type { PaginationPropsPublic as ElPaginationProps } from 'element-plus'
2-
import type { Simplify } from 'type-fest'
31
import type { Reactive } from 'vue'
4-
import type { defaultPropKeys as ElUsePaginationDefaultPropKeys } from './element-plus/components/use-pagination/default-prop-keys'
52
import { reactive } from 'vue'
63

74
export interface SetupConfig {
@@ -11,17 +8,6 @@ export interface SetupConfig {
118
*/
129
cardClass?: any
1310
}
14-
15-
ElementPlus?: {
16-
ElUsePagination?: {
17-
/**
18-
* 默认属性
19-
*/
20-
defaultProps?: Simplify<
21-
Pick<ElPaginationProps, (typeof ElUsePaginationDefaultPropKeys)[number]>
22-
>
23-
}
24-
}
2511
}
2612

2713
const config = reactive<SetupConfig>({})

0 commit comments

Comments
 (0)