Moonofweisheng / wot-design-uni

一个基于Vue3+TS开发的uni-app组件库,提供70+高质量组件,支持暗黑模式、国际化和自定义主题。
https://wot-design-uni.pages.dev
MIT License
896 stars 145 forks source link

vue-tsc 检查报错找不到wot-design-uni/global.d.ts #381

Closed spriteApe closed 3 months ago

spriteApe commented 3 months ago

Wot Design Uni 版本号

1.2.26

平台

h5, 微信小程序, 支付宝小程序, APP, 钉钉小程序, 其他小程序

复现Demo地址

https://gitee.com/ly_test/wot-design-uni-demo

重现步骤

  1. pnpm add wot-design-uni
  2. image

  3. image

期望的结果是什么?

运行vue-tsc 不要报错说找不到wot-design-uni/global.d.ts文件, 也不要运行vue-tsc 就报node_modules/wot-design-uni目录下的错 tsconfig.json文件配置 "exclude": ["node_modules"]是没用的,因为项目中有引用到wot-design-uni相关的组件。

期望提供一个快速的解决方案,或者把wot-design-uni的代码都改一遍符合vue-tsc 的要求,不要报错

实际的结果是什么?

使用easycom规范会报错找不到wot-design-uni/global.d.ts文件, 基于vite配置自动引入组件自动引入方案 会报node_modules/wot-design-uni目录下的错

环境信息

No response

其他补充信息

No response

Moonofweisheng commented 3 months ago

https://github.com/Moonofweisheng/wot-starter-retail

参考这个看看

---原始邮件--- 发件人: @.> 发送时间: 2024年6月19日(周三) 晚上6:42 收件人: @.>; 抄送: @.***>; 主题: [Moonofweisheng/wot-design-uni] vue-tsc 检查报错找不到wot-design-uni/global.d.ts (Issue #381)

Wot Design Uni 版本号

1.2.26

平台

h5, 微信小程序, 支付宝小程序, APP, 钉钉小程序, 其他小程序

复现Demo地址

https://gitee.com/ly_test/wot-design-uni-demo

重现步骤

pnpm add wot-design-uni

image.png (view on web) 3. image.png (view on web)

期望的结果是什么?

运行vue-tsc 不要报错说找不到wot-design-uni/global.d.ts文件, 也不要运行vue-tsc 就报node_modules/wot-design-uni目录下的错 tsconfig.json文件配置 "exclude": ["node_modules"]是没用的,因为项目中有引用到wot-design-uni相关的组件。

期望提供一个快速的解决方案,或者把wot-design-uni的代码都改一遍符合vue-tsc 的要求,不要报错

实际的结果是什么?

使用easycom规范会报错找不到wot-design-uni/global.d.ts文件, 基于vite配置自动引入组件自动引入方案 会报node_modules/wot-design-uni目录下的错

环境信息

No response

其他补充信息

No response

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

spriteApe commented 3 months ago

https://github.com/Moonofweisheng/wot-starter-retail 参考这个看看 ---原始邮件--- 发件人: @.> 发送时间: 2024年6月19日(周三) 晚上6:42 收件人: @.>; 抄送: @.>; 主题: [Moonofweisheng/wot-design-uni] vue-tsc 检查报错找不到wot-design-uni/global.d.ts (Issue #381) Wot Design Uni 版本号 1.2.26 平台 h5, 微信小程序, 支付宝小程序, APP, 钉钉小程序, 其他小程序 复现Demo地址 https://gitee.com/ly_test/wot-design-uni-demo 重现步骤 pnpm add wot-design-uni image.png (view on web) 3. image.png (view on web) 期望的结果是什么? 运行vue-tsc 不要报错说找不到wot-design-uni/global.d.ts文件, 也不要运行vue-tsc 就报node_modules/wot-design-uni目录下的错 tsconfig.json文件配置 "exclude": ["node_modules"]是没用的,因为项目中有引用到wot-design-uni相关的组件。 期望提供一个快速的解决方案,或者把wot-design-uni的代码都改一遍符合vue-tsc 的要求,不要报错 实际的结果是什么? 使用easycom规范会报错找不到wot-design-uni/global.d.ts文件, 基于vite配置自动引入组件自动引入方案 会报node_modules/wot-design-uni目录下的错 环境信息 No response 其他补充信息 No response — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>

去掉.d.ts后就会报node_modules/wot-design-uni目录下的错

3997e8c04e261e6ecebbe36069f0df50
Moonofweisheng commented 3 months ago

https://github.com/Moonofweisheng/wot-starter-retail 参考这个看看 ---原始邮件--- 发件人: @.**> 发送时间: 2024年6月19日(周三) 晚上6:42 收件人: @.**>; 抄送: @._>; 主题: [Moonofweisheng/wot-design-uni] vue-tsc 检查报错找不到wot-design-uni/global.d.ts (Issue #381) Wot Design Uni 版本号 1.2.26 平台 h5, 微信小程序, 支付宝小程序, APP, 钉钉小程序, 其他小程序 复现Demo地址 https://gitee.com/ly_test/wot-design-uni-demo 重现步骤 pnpm add wot-design-uni image.png (view on web) 3. image.png (view on web) 期望的结果是什么? 运行vue-tsc 不要报错说找不到wot-design-uni/global.d.ts文件, 也不要运行vue-tsc 就报node_modules/wot-design-uni目录下的错 tsconfig.json文件配置 "exclude": ["node_modules"]是没用的,因为项目中有引用到wot-design-uni相关的组件。 期望提供一个快速的解决方案,或者把wot-design-uni的代码都改一遍符合vue-tsc 的要求,不要报错 实际的结果是什么? 使用easycom规范会报错找不到wot-design-uni/global.d.ts文件, 基于vite配置自动引入组件自动引入方案 会报nodemodules/wot-design-uni目录下的错 环境信息 No response 其他补充信息 No response — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @_._>

去掉.d.ts后就会报node_modules/wot-design-uni目录下的错 3997e8c04e261e6ecebbe36069f0df50

tsconfig.json用这个

// tsconfig.json
{
  // "extends": "@vue/tsconfig/tsconfig.json",
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "strict": true,
    "jsx": "preserve",
    "resolveJsonModule": true,
    "noImplicitAny": false,
    "importHelpers": true,
    "moduleResolution": "node",
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "experimentalDecorators": true,
    "sourceMap": false,
    "skipLibCheck": true,
    "baseUrl": ".",
    "types": [
      "@dcloudio/types",
      "wot-design-uni/global"
    ],
    "paths": {
      "@/*": [
        "./src/*"
      ]
    },
    "lib": [
      "esnext",
      "dom",
      "dom.iterable",
      "scripthost"
    ]
  },
  "exclude": [
    "node_modules",
    "unpackage",
    "src/**/*.nvue"
  ],
}
github-actions[bot] commented 2 months ago

此 issue 已被自动锁定,因为关闭后没有任何近期活动。如果有相关 bug,请重新创建一个新 issue。