eggjs / eggjs/egg-ts-helper

在指定多个controller目录的自定义目录场景下,无法跳过中间目录

Open
#84 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
161
Forks
31
PR merge metrics
No merged PRs in 30d

Description

https://github.com/whxaxes/egg-ts-helper/blob/4cfed82e3ff89fed2b1ffb61dfa06d425721ce07/src/generators/class.ts#L42

比如项目以feature-base的方式建立了多个模块:

  • modules
    • session
      • controller
        • main.js
    • student
      • controller
        • main.js

期望可以生成 app.controller.session.main 和 app.controller.student.main 的声明,但由于目录结构是自定义的,实际只能生成 app.controller.session.controller.main 和 app.controller.student.controller.main

image

希望通过caseStyle的方式可以生成期望的声明

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/generators/class.ts around line 42 and inspect how multiple custom controller directories are converted into declaration paths. Reproduce the feature-base layout from the issue, then verify that caseStyle can skip the intermediate controller directory and produce app.controller.session.main and app.controller.student.main.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.