Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: v2.54.0 启用可选功能, 丢失测试功能 #5855

Closed
wangjue666 opened this issue Jun 20, 2024 · 5 comments
Closed

[Bug]: v2.54.0 启用可选功能, 丢失测试功能 #5855

wangjue666 opened this issue Jun 20, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@wangjue666
Copy link
Contributor

wangjue666 commented Jun 20, 2024

版本信息

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor

    Memory: 6.89 GB / 15.95 GB
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (119.0.2151.72)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    @modern-js/eslint-config: 2.54.0 => 2.54.0
    @modern-js/module-tools: 2.54.0 => 2.54.0
    @modern-js/plugin-rspress: 1.25.0 => 1.25.0
  node版本 v20.5.0

问题详情

 npx @modern-js/create test-modernjs
? 请选择你想创建的工程类型 Npm 模块
? 请填写项目名称 test-modernjs
? 请选择开发语言 TS
? 请选择包管理工具 pnpm
 WARN  deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
 WARN  5 deprecated subdependencies found: @humanwhocodes/[email protected], @humanwhocodes/[email protected], [email protected], [email protected], [email protected]
Packages: +727
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 791, reused 727, downloaded 0, added 727, done

> [email protected] prepare E:\test\test-modernjs
> modern build && husky install

  Modern.js Module v2.54.0

info    Build succeed in 1.1s
info    Bundle generated 3 files

Bundle Files           Size
dist\types\index.d.ts  82.0 B
dist\es\index.js       104.0 B
dist\lib\index.js      990.0 B
husky - Git hooks installed

devDependencies:
+ @modern-js/eslint-config 2.54.0
+ @modern-js/module-tools 2.54.0
+ @types/node 16.11.68 (20.14.6 is available)
+ husky 8.0.3 (9.0.11 is available)
+ lint-staged 13.1.4 (15.2.7 is available)
+ prettier 2.8.8 (3.3.2 is available)
+ rimraf 3.0.2 (5.0.7 is available) deprecated
+ typescript 5.0.4 (5.4.5 is available)

Done in 23s
[INFO] 依赖自动安装成功
[INFO] git 仓库初始化成功
[INFO] 创建成功!
pnpm run dev          # 运行和调试模块
pnpm run build        # 构建生产环境产物
pnpm run lint         # 运行 ESLint 并自动修复问题
pnpm run change       # 新增 changeset 变更
pnpm run bump         # 基于 changeset 更新版本号和 changelog
pnpm run new          # 启用可选功能
pnpm run test         # 运行测试用例
pnpm run release      # 发布当前 npm 包
[INFO] 你可以执行 'cd test-modernjs' 进入目录

复现链接

复现步骤

npx @modern-js/create test-modernjs

我记得之前版本初始化项目是没有 pnpm run test 这个命令,是需要手动启用测试功能才有的,但是项目结构也没有test相关的文件

image

1718876603486

image

这是肿么回事呢? @caohuilin @chenhuang444

@wangjue666 wangjue666 added the bug Something isn't working label Jun 20, 2024
@wangjue666
Copy link
Contributor Author

我之前使用咱们的 2.51.0 版本还正常的呢, 意思是新版本 测试功能 默认合并到初始化项目中? 所以启用可选功能这块移除了吗? 是我哪里操作有遗漏吗?盼回复! 感谢

@caohuilin
Copy link
Member

最新版本我们把 new 命令开启 test 功能移除了,原因是 Modern.js 提供的 test 插件只是简单的 jest 封装,并没有什么新的能力提供,推荐用户直接使用社区的 test 工具

@wangjue666
Copy link
Contributor Author

这样呀, 我个人挺烦配置的,所以觉得官方有直接提供测试功能蛮方便的~

那还需要麻烦咱们团队更新下官网文档这里:) https://modernjs.dev/module-tools/guide/basic/command-preview.html#modern-test

@wangjue666
Copy link
Contributor Author

image

包括初始化项目这块

@caohuilin
Copy link
Member

#5856

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants