vitarx-router 4.0.5 → 4.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { type CodeLocation, ElementView, type RenderChildren, type WithProps } from 'vitarx';
2
2
  import { type NavigateResult } from '../core/index.js';
3
3
  import { type UseLinkOptions } from '../core/shared/index.js';
4
- export interface RouterLinkProps extends UseLinkOptions, WithProps<'a'> {
4
+ export interface RouterLinkProps extends UseLinkOptions, Omit<WithProps<'a'>, 'href' | 'onClick'> {
5
5
  /**
6
6
  * 子节点插槽
7
7
  */
@@ -99,6 +99,13 @@ export function parseDefinePage(content, filePath) {
99
99
  * @returns 转换后的代码,无需转换返回 null
100
100
  */
101
101
  export function removeDefinePage(code, filename) {
102
+ // 只处理 ts tsx js jsx 文件
103
+ if (!filename.endsWith('.ts') &&
104
+ !filename.endsWith('.tsx') &&
105
+ !filename.endsWith('.js') &&
106
+ !filename.endsWith('.jsx')) {
107
+ return null;
108
+ }
102
109
  if (!code.includes('definePage')) {
103
110
  return null;
104
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitarx-router",
3
- "version": "4.0.5",
3
+ "version": "4.0.6",
4
4
  "description": "Official routing solution for Vitarx framework with declarative routing, navigation guards, dynamic routes, file-based routing with HMR, and full TypeScript support.",
5
5
  "author": "ZhuChonglin <8210856@qq.com>",
6
6
  "license": "MIT",