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

If generator is loaded as an object, resolved and namespace values are dropped #107

Closed
esheffield opened this issue Oct 26, 2018 · 3 comments

Comments

@esheffield
Copy link
Contributor

I'm developing a generator using Typescript. I've found that when the generator is instantiated the resolved and namespace properties are lost and default to unknown and * respectively.

Doing some experimenting with environment.js I found that when calling my generator the Generator variable has this structure:

{
  resolved: "..."
  namespace: "..."
  default: function() // my class constructor
}

compared to other generators I examined where Generator loads as a function (the class constructor) with the resolved and namespace as properties of the function.

There's a check for this at environment.js#L378, but it then calls 'this.instantiate' only passing the constructor. Therefore the other properties are lost.

@SBoudrias
Copy link
Member

Sounds like something we might've forgot. Do you want to send a PR fixing this? Sounds like you found all the relevant code pieces

@esheffield
Copy link
Contributor Author

Sure, I experimented a bit with a local patch that seems to take care of. I'll clean that up and should be able to have something in a day or two.

esheffield added a commit to EOSIO/environment that referenced this issue Oct 29, 2018
In the case of a module generator, the namespace and resolved properties
were being lost as the instantiate function expects them to be attached
as properties of the constructor function. This commit ensures they
are being passed where the instantiate function expects to find them.

For issue yeoman#107
SBoudrias pushed a commit that referenced this issue Nov 4, 2018
In the case of a module generator, the namespace and resolved properties
were being lost as the instantiate function expects them to be attached
as properties of the constructor function. This commit ensures they
are being passed where the instantiate function expects to find them.

For issue #107
@mshima
Copy link
Member

mshima commented Dec 18, 2019

Looks like this is fixed.

@mshima mshima closed this as completed Dec 18, 2019
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

3 participants