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

Modernizr Build Instructions are ambiguous #1910

Closed
zackhall opened this issue Mar 2, 2016 · 15 comments
Closed

Modernizr Build Instructions are ambiguous #1910

zackhall opened this issue Mar 2, 2016 · 15 comments

Comments

@zackhall
Copy link

zackhall commented Mar 2, 2016

I'm having difficulty with the build instructions for Modernizr in the README.

Generate everything in config-all.json

The first step is:

npm install
./bin/modernizr -c lib/config-all.json
//outputs to ./modernizr.js

On Windows, running ./bin/modernizr -c lib/config-all.json results in:

> .\bin\modernizr -c lib\config-all.json
'.\bin\modernizr' is not recognized as an internal or external command,
operable program or batch file.

To run tests (in Browswer)

Next issue is trying to run tests in the browser following:

grunt build
serve .
visit <url>/test

serve isn't recognized as a command. I dug into the Gruntfile.js and saw the browserTests task, but that stops the server after the test completes. Is there a serve command similar to the one above that allows me to just refresh the browser window to re-run the tests?

@SlexAxton
Copy link
Member

serve is a popular npm module that just serves a directory on port 3000.

npm install -g serve should do the trick, then http://127.0.0.1:3000/test

@zackhall
Copy link
Author

zackhall commented Mar 2, 2016

Thanks, @SlexAxton! That's very helpful.

What about the ./bin/modernizr -c lib/config-all.json command? What does that command do and do you know how to call it without error?

@SlexAxton
Copy link
Member

Not sure why that's going wrong. Maybe make sure you have a recent node.js version installed and that you successfully ran npm install

~/code/Modernizr master
❯ ./bin/modernizr -c lib/config-all.json
Modernizr build saved to /Users/alex/code/Modernizr/modernizr.js

~/code/Modernizr master*
❯ tail -f /Users/alex/code/Modernizr/modernizr.js
    Modernizr._q[i]();
  }

  // Leak Modernizr namespace
  window.Modernizr = Modernizr;


;

})(window, document);

@patrickkettner
Copy link
Member

What about the ./bin/modernizr -c lib/config-all.json command? What does that command do

that is how you create a build from the command line

and do you know how to call it without error?

it does run on windows (at least it does for me). You should be running it from the root of the repo, after running npm install.

If you feel like you are able to make the directions clearer, please update the readme

cheers!

@zackhall
Copy link
Author

zackhall commented Mar 3, 2016

Here's what I'm seeing on my windows machine:

image

Video which plays back quicker.

@roblarsen
Copy link
Contributor

isn't this #1714?

@zackhall
Copy link
Author

zackhall commented Mar 3, 2016

Great find, @roblarsen. Thanks for pointing that out. I believe it is.

@patrickkettner
Copy link
Member

thanks @roblarsen!

lemme know if there is anything else, @zackhall

@roblarsen
Copy link
Contributor

@patrickkettner I think fixing this would be a good thing. You never know how many people don't even make it here.

It's either documentation or something like this:

https://github.com/roblarsen/Modernizr/blob/windows-command-line/bin/modernizr.bat

Which just makes the errors go away on Windows (although I didn't thoroughly test it)

@patrickkettner
Copy link
Member

Care to make a PR?

@roblarsen
Copy link
Contributor

@patrickkettner Yeah, I was planning to either way, I just wanted to put that option out there to see if it seemed okay before going through the time to test it.

ryanseddon added a commit that referenced this issue Mar 10, 2016
Passthrough script for Powershell and cmd.exe, fixes #1910
@patrickkettner
Copy link
Member

patrickkettner commented Mar 11, 2016 via email

@tomshaw
Copy link

tomshaw commented Apr 11, 2016

The whole purpose of bower is to automagically download the dependency working/ready inst it? Now I'm being asked to cd into my bower dependencies Modernizr directory and issue a series of commands. Is there any possible way to include a pre-built ready version when using bower or is the modernizr file size becoming an issue?

@SlexAxton
Copy link
Member

@tomshaw you're installing a builder, which is automagically downloaded and working. If you want to install a build you should use the zip functionality of our web builder:

> npm install https://modernizr.com/download?contenteditable-emoji-notification-prefixedcssvalue-setclasses.zip
> bower install https://modernizr.com/download?contenteditable-emoji-notification-prefixedcssvalue-setclasses.zip

@tomshaw
Copy link

tomshaw commented Apr 11, 2016

Manually downloading a build is an option I do so with gsap and place it in my bower dependency folder. Another options is to manually check for the specific functionality by hand. Either way thanks for your help.

check-if-a-css-property-is-supported

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

5 participants