Skip to content

Commit

Permalink
fix: jsx namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
fudiwei committed Feb 27, 2024
1 parent 252d8f3 commit 745fd22
Show file tree
Hide file tree
Showing 27 changed files with 96 additions and 94 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"highlight.js": "^11.9.0",
"naive-ui": "^2.38.1",
"prettier": "^3.2.5",
"rollup": "^4.12.0",
"rollup": "^3.29.4",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-string": "^3.0.0",
"rollup-plugin-vue": "^6.0.0",
Expand Down
109 changes: 44 additions & 65 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ function configureMain() {
}),

rollupPluginESBuild({
tsconfig: path.resolve('./tsconfig.json'),
tsconfig: path.resolve('./tsconfig.esbuild.json'),
target: 'ESNext',
sourceMap: true
sourceMap: true,
jsx: 'preserve',
jsxFactory: 'h',
jsxFragment: 'Fragment',
jsxImportSource: 'vue'
}),

rollupPluginVue(),
Expand Down
4 changes: 1 addition & 3 deletions src/_utils/v-prop.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mergeProps, camelize } from 'vue';
import { camelize } from 'vue';

export const getVProp = <T extends object, K extends keyof T>(props: T, name: K): T[K] | undefined => {
if (!props || !name) {
Expand Down Expand Up @@ -34,8 +34,6 @@ export const getVPropAsNumber = <T extends object, K extends keyof T>(props: T,
return r;
};

export { mergeProps as mergeVProps };

export const normalizeVProps = (props: any): object => {
const temp = {} as any;
for (const [k, v] of Object.entries(props || {})) {
Expand Down
3 changes: 2 additions & 1 deletion src/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { SlotsType, ExtractPublicPropTypes } from 'vue';
/* @jsxImportSource vue */
import type { SlotsType, ExtractPublicPropTypes } from 'vue';
import { defineComponent, computed } from 'vue';
import { NButton, buttonProps as defaultNButtonProps } from 'naive-ui';

Expand Down
3 changes: 2 additions & 1 deletion src/cascader/Cascader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { PropType, SlotsType, ExtractPublicPropTypes } from 'vue';
/* @jsxImportSource vue */
import type { PropType, SlotsType, ExtractPublicPropTypes } from 'vue';
import type { CascaderOption as NCascaderOption, CascaderInst as NCascaderInst } from 'naive-ui';
import { defineComponent, ref, computed } from 'vue';
import { NCascader, cascaderProps as defaultNCascaderProps } from 'naive-ui';
Expand Down
3 changes: 2 additions & 1 deletion src/data-table/DataTable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { VNode, Slots, PropType, SlotsType, ExtractPublicPropTypes } from 'vue';
/* @jsxImportSource vue */
import type { VNode, Slots, PropType, SlotsType, ExtractPublicPropTypes } from 'vue';
import type {
DataTableColumn as NDataTableColumn,
DataTableBaseColumn as NDataTableBaseColumn,
Expand Down
3 changes: 2 additions & 1 deletion src/data-table/DataTableColumn.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { PropType, SlotsType, ExtractPropTypes } from 'vue';
/* @jsxImportSource vue */
import type { PropType, SlotsType, ExtractPropTypes } from 'vue';
import type {
DataTableColumn as NDataTableColumn,
DataTableBaseColumn as NDataTableBaseColumn,
Expand Down
3 changes: 2 additions & 1 deletion src/data-table/DataTableSummaryCell.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { PropType, SlotsType, ExtractPropTypes } from 'vue';
/* @jsxImportSource vue */
import type { PropType, SlotsType, ExtractPropTypes } from 'vue';
import { defineComponent } from 'vue';

import type { DataTableRowData, DataTableRenderSummaryParams } from './DataTable';
Expand Down
3 changes: 2 additions & 1 deletion src/data-table/DataTableSummaryRow.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { SlotsType } from 'vue';
/* @jsxImportSource vue */
import type { SlotsType } from 'vue';
import { defineComponent } from 'vue';

import type { DataTableRowData, DataTableRenderSummaryParams } from './DataTable';
Expand Down
3 changes: 2 additions & 1 deletion src/dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { HTMLAttributes, VNode, Slots, PropType, SlotsType, ExtractPublicPropTypes } from 'vue';
/* @jsxImportSource vue */
import type { HTMLAttributes, VNode, Slots, PropType, SlotsType, ExtractPublicPropTypes } from 'vue';
import type {
DropdownOption as NDropdownOption,
DropdownGroupOption as NDropdownGroupOption,
Expand Down
3 changes: 2 additions & 1 deletion src/dropdown/DropdownDivider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineComponent } from 'vue';
/* @jsxImportSource vue */
import { defineComponent } from 'vue';

export default defineComponent({
name: 'XNDropdownDivider',
Expand Down
3 changes: 2 additions & 1 deletion src/dropdown/DropdownItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { PropType, SlotsType, ExtractPropTypes } from 'vue';
/* @jsxImportSource vue */
import type { PropType, SlotsType, ExtractPropTypes } from 'vue';
import { defineComponent } from 'vue';

const _props = {
Expand Down
Loading

0 comments on commit 745fd22

Please sign in to comment.