infra frontendTesting: tsconfig.test.json doesn't work in a standalone extension, and webpack.config.js is left behind
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
调研方向
从 src/steps/gen-ext-scaffolder.ts 中的 frontendTesting 模块定义开始,检查生成的 tsconfig.test.json、webpack.config.cjs 和 js/package.json。将生成的 TypeScript include 和 shim 路径与 issue 中描述的独立 extension 配置进行比较,并检查生成器如何处理旧的 webpack 配置。完成标准是:独立 extension 的测试类型检查正常运行,只保留预期的 webpack 配置,并且 package 文件的 diff 范围明确。
由索引模型根据 Issue 内容生成。
描述
Running flarum-cli infra frontendTesting -n (3.0.15) on an existing standalone (Composer-installed) Flarum 2 extension gives a setup where yarn test runs, but the tests don't type-check and an old file is left behind:
js/tsconfig.test.jsonpoints at the monorepo'snode_modules."files": ["../../../node_modules/@flarum/jest-config/shims.d.ts"]only resolves inside flarum/framework. In a standalone extension it should be./node_modules/@flarum/jest-config/shims.d.ts, as the testing docs show.js/tsconfig.test.jsonreplaces the baseincludewith["tests/**/*"]. Tests that import the extension'ssrcthen lose core's global typings (../vendor/*/*/js/dist-typings/@types/**/*) and the extension's own declaration files.tsc -p tsconfig.test.json --noEmitfails withCannot find name 'm',Cannot find name 'flarum', and errors on model attributes added through declaration merging. Repeating the baseincludewithtestsadded fixes it:"include": ["src/**/*", "tests/**/*", "../vendor/*/*/js/dist-typings/@types/**/*", "@types/**/*"],js/webpack.config.jsis left in place next to the newjs/webpack.config.cjs. The module adds the.cjsfile (needed now that"type": "module"is set) but doesn't remove the.jsone, which the docs say to rename.- Minor:
js/package.jsonis rewritten with 4-space indentation, so the whole file shows up in the diff.
3.x has the same skeleton tsconfig.test.json and the same frontendTesting module definition in src/steps/gen-ext-scaffolder.ts.
- 主要语言
- TypeScript
- 星标
- 47
- 派生
- 4
- 平均合并
- 8 分钟
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
flarum/cli 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 20/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 38/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
Yeraze/meshmonitor#6239 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
better-auth/better-auth#12292 · 1 个 reaction ·
维护者通常 1 天内回复
-
The sample email preview's ResizeObserver is never disconnected and keeps raising errors after leaving Settings可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
area:ui bug effort:S priority:P2
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Typo in WSL project description on Projects page可能已有人在做 @akhil9tiet 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 75/100
microsoft/opensource.microsoft.com#1066 · 1 条评论 ·