alias-quokka-plugin icon indicating copy to clipboard operation
alias-quokka-plugin copied to clipboard

does not traverse subdirectories

Open granteagon opened this issue 6 years ago • 3 comments

I have a bunch of modules under @app, for example @app/api. alias-quokka-plugin won't let me make an alias to @app, then find things under @app by traversing subdirectories.

Example: I have few packages:

  • @app/api
  • @app/lib/interface/status
  • @app/lib/enums
  • @app/lib/controller/BaseFormController

I would like to do this and have this package traverse subdirectories by itself:

    "quokka": {
        "plugins": ["alias-quokka-plugin"],
        "alias": {
            "@app": "src/app"
        }
    },

However, I have to do it this way, which is troublesome:

    "quokka": {
        "plugins": ["alias-quokka-plugin"],
        "alias": {
            "@app/api": "src/app/api",
            "@app/lib/interface/status": "src/app/lib/interface/status",
            "@app/lib/enums": "src/app/lib/enums",
            "@app/lib/controller/BaseFormController": "src/app/lib/controller/BaseFormController"
        }
    },

Can this be fixed?

granteagon avatar Apr 20 '18 13:04 granteagon

better yet, just support the mappings in my tsconfig AND subdirectory traversal 😄

From my tsconfig:

        "paths": {
            "@app/*": [
                "app/*"
            ],
            "@env/*": [
                "environments/*"
            ],
            "@angular/*": [
                "../node_modules/@angular/*"
            ],
            "@cm/*": [
                "../node_modules/@cm/*"
            ]
        }

granteagon avatar Apr 20 '18 14:04 granteagon

Have the same problems. Pls fix it :)

ckruppe avatar Jun 21 '18 07:06 ckruppe

@granteagon - I'm about to start work on a PR for ts config mapping:

  • https://github.com/Gozala/alias-quokka-plugin/issues/6

I don't understand what you mean by subdirectories though?

As I understand it, aliases should not have additional logic other than being an alias. You're suggesting that the alias should glob subdirectories?

That being the case, globbing syntax should probably be used, and it feels like it should be a separate plugin?

"@app": "src/app/**/*"

davestewart avatar Sep 29 '18 11:09 davestewart