SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.01k forks source link

Request to support --no-install or --skip-install for yeoman generator #235

Closed gavinbarron closed 7 years ago

gavinbarron commented 8 years ago

Category

If I run yo @microsoft/sharepoint --skip-install no dependencies from bower or npm are installed

Observed Behavior

If I run yo @microsoft/sharepoint --help I'm told that there is a --skip-install option. That's part of the base set of options that come with yeoman it turns out. I would suggest that this command line option is used rather than the --no-install that has been discussed on here previously (and isn't working)

Steps to Reproduce

run yo @microsoft/sharepoint --skip-install You will see that the npm dependencies are installed

waldekmastykarz commented 8 years ago

This is caused by how the options are passed into the subgenerators. Instead of passing the options object from the parent a new set of options is created in the ./generators/app/index.js file on line 36. That way all options passed to the main generator are lost. Instead of creating a new options object it would be better if the existing object was cloned and extended with the properties required by the specific subgenerators.

Also in ./generators/solution/index.js on line 37 options are not passed into the this.npmInstall() function.

chakkaradeep commented 8 years ago

@gavinbarron can you gives us more information on where this scenario is applicable?

@nickpape-msft do we have this command?

waldekmastykarz commented 8 years ago

@chakkaradeep imagine an organization would have a standardized set of dependencies they have tested and approved for their projects. They would have a Docker image with these dependencies installed. When creating a new project they would create it without dependencies and run a Docker container based on the standard image to run the project.

chakkaradeep commented 8 years ago

@waldekmastykarz Thanks! We are working to make these scenarios better but totally see the use for this command.

andrewconnell commented 7 years ago

Here's another reason why we want this @chakkaradeep - NPM shouldn't be forced as the only game in town. Using Yarn, you can speed up dependency acquisition by 70% and even support full offline dev (after the first web part you create).

See this for more info & demos: http://www.andrewconnell.com/blog/speed-up-every-new-spfx-web-part-creation-by-up-to-70-with-yarn

gavinbarron commented 7 years ago

Yarn is what I was actually playing with when I discovered that these flags do nothing.

On Dec 8, 2016 7:24 AM, "Andrew Connell" notifications@github.com wrote:

Here's another reason why we want this @chakkaradeep https://github.com/chakkaradeep - NPM shouldn't be forced as the only game in town. Using Yarn, you can speed up dependency acquisition by 70% and even support full offline dev (after the first web part you create).

See this for more info & demos: http://www.andrewconnell.com/ blog/speed-up-every-new-spfx-web-part-creation-by-up-to-70-with-yarn

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SharePoint/sp-dev-docs/issues/235#issuecomment-265766882, or mute the thread https://github.com/notifications/unsubscribe-auth/AGyvHH0FvNmwpKpShAikb7DYAgULCpDRks5rGCEvgaJpZM4KVDZg .

chakkaradeep commented 7 years ago

@andrewconnell We are keeping an eye on Yarn. There are few issues we have identified internally that needs to be addressed either in the toolchain or in the yarn system itself.

However, this is not about forcing npm. Node/NPM is widely used and many have bet against it for their systems. That said, improvements and innovations come by. Yarn is certainly interesting and has its use. SPFx tool chain will evolve as we progress to evaluate and incorporate such improvements for sure. That is indeed our goal.

Now, tech aside:

andrewconnell commented 7 years ago

I'm not trying to push Yarn, I'm simply saying that users should have an option to bypass the step of downloading all packages. Using Yarn instead of NPM was simply a scenario as to why we want this flag... just responding to your request above.

What key question / scenario you're trying to enable: to let developers work the way they want to work and not forcing specific path that isn't configurable unless you hit CTRL+C to abort what's going on.

Not to mention it also seems you intend on supporting it as the flag is in the code, it's just not being respected when the step of running npm install by the generator.

CharlieDLee commented 7 years ago

This gets my vote. Anything that gives me options and does not tie me to one technology component in the stack can only be a good thing regardless of why you might choose to do it. We currently do use NPM as our package manager, but who can say that we won't want to use something else tomorrow!

chakkaradeep commented 7 years ago

All,

This should be fixed in the RC0 release. You can now use the option as follows:

yo @microsoft/sharepoint --skip-install

Please let us know if you still find issues.

Thanks!

patmill commented 7 years ago

Closing...

msft-github-bot commented 4 years ago

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues