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

Feature: Option to load the internal type definitions from a custom path #14

Open
tinchoz49 opened this issue Jan 23, 2017 · 2 comments

Comments

@tinchoz49
Copy link

Hi @Raynos, how are you?

What do you think about having an option to define a custom path where you can have your type definitions separated. Like the --definitions argument but for internal definitions.

e.g.

project/
    src/
        index.js
        lib/
            somelib.js
    definitions/
        index.hjs
        lib/
            somelib.hjs
@tinchoz49 tinchoz49 changed the title Option to load the type definitions from a custom path Option to load the internal type definitions from a custom path Jan 23, 2017
@tinchoz49 tinchoz49 changed the title Option to load the internal type definitions from a custom path Feature: Option to load the internal type definitions from a custom path Jan 23, 2017
@Raynos
Copy link
Owner

Raynos commented Jan 23, 2017

I think that's useful, I've currently implemented a _types folder based resolution.

https://github.com/Raynos/jsig/blob/master/type-checker/index.js#L283-L291

project/
    src/
        _types/
            index.hjs
        index.js
        lib/
            _types/
                somelib.hjs
            somelib.js

There would be three different header file lookups then:

  • adjacent to source
  • in _types folder, in the same source folder
  • in a top level headers folder, matching same recursive structure as source code.

@tinchoz49
Copy link
Author

wow! i didn't know about the _types folder resolution, that can be helpful, I will try it later.

And I agree about the three different header file lookups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants