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

feat(main): add recursive parsing for included idls #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ilatovsky
Copy link

Recursively resolve and parse included files.

@ilatovsky
Copy link
Author

@kevin-greene-ck review please

(acc: IFileIncludes, parsedFile, index) => {
const namedIncludes: IFileIncludes = {};
Object.keys(parsedFile.includes).forEach(include => {
const includePath = path.resolve(parsedFile.includes[include].importedFrom, parsedFile.includes[include].path);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to give a little flexibility to the way we import idls from either a relative path or absolute path from the sourceDir.

                let includePath = path.resolve(
                    parsedFile.includes[include].importedFrom,
                    parsedFile.includes[include].path,
                )
                if (!fs.existsSync(includePath)) {
                    includePath = path.resolve(
                        options.sourceDir,
                        parsedFile.includes[include].path,
                    )
                }

@ramakrishna-battala-ck
Copy link
Contributor

Hey @ilatovsky sorry for the delay here. A huge thanks for this PR. Really helpful. Had a minor comment. Could you take a look at it.

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

Successfully merging this pull request may close these issues.

3 participants