Skip to content

add psm1 support #46

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

Closed
wants to merge 1 commit into from
Closed

Conversation

TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Sep 10, 2018

I'm going to defer any fancy entry point checking for #15

This allows a user to use a psm1 - they just need to make sure they specify an entrypoint and export that module member.

fixes #46

@TylerLeonhardt
Copy link
Member Author

Question for the room... should I ALSO add psd1 so that a user can use a module manifest?

@daxian-dbw
Copy link
Contributor

It feels to me not useful to allow .psd1, and it would add complexity to how we load a module when LoadFunctionRequest comes in -- there will be request for each files with the legit extension, and we need to know which psm1 is associated with which psd1, this will be harder if the psm1 file has a name that is different from the psd1.

@TylerLeonhardt
Copy link
Member Author

@daxian-dbw I think I'm confused by what you're saying. Why do we need to make the association between psm1 and psd1? If we allow psd1, then a user could have a module manifest that we import and then we try to invoke the entry point they specified.

This gives them the ability to expose that entry point using RootModule, ScriptsToProcess, all of the module manifest goodness.

@SteveL-MSFT
Copy link

I don't understand how the .psm1 will get used with AzF. Does this simply mean treating a .psm1 as a .ps1?

Copy link
Contributor

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

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

Given our discussion with @joeyaiello, shall we defer the support to .psm1 files?

@daxian-dbw
Copy link
Contributor

@SteveL-MSFT Users are allowed to specify the entrypoint in function.json, so in theory, they can have a psm1 file along with an entry point specified, which is the name of a function in the psm1 file. Then the language worker imports the module and calls that function.

@TylerLeonhardt
Copy link
Member Author

Yeah we can defer this for now, but Dongbo gave good context as to what this is all about.

@SteveL-MSFT
Copy link

@daxian-dbw I can see how it's possible, but I don't see the value as it adds complexity for the user

@daxian-dbw
Copy link
Contributor

@SteveL-MSFT We got the same feedback from @joeyaiello when talking to him about this, and decided to put off this change until it's asked by the user.

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