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

Build system overhaul. #22045

Merged
merged 1 commit into from
Apr 20, 2017
Merged

Build system overhaul. #22045

merged 1 commit into from
Apr 20, 2017

Conversation

bardiharborow
Copy link
Member

@bardiharborow bardiharborow commented Feb 21, 2017

This PR switches every build task to a NPM script, except saucelabs (this is surprisingly non-trivial, and I'm pushing it to a later PR as this has taken way too long as it is). Closes #20332.

List of tasks that need to included. A ticked checkbox indicates that the task has been tested.

  • CSS
    • Linting (scss-lint)
      • Core
      • Docs
    • Compile (node-sass)
      • Core
      • Docs
    • Prefix (postcss)
      • Core
      • Docs
    • Minify (cleancss)
      • Core
      • Docs
  • JavaScript
    • Linting (eslint)
      • Core
      • Docs
    • Concatenate + Transpile (Babel)
      • Bundle
      • Individual plugins
    • Minify (uglifyjs)
      • Core
      • Docs
    • Test (qunit + PhantomJS)
      • Local
      • SauceLabs (punting conversion to npm)
  • Docs
    • Clean (cp -r dist/* docs/dist/)
    • Linting (htmlhint + htmllint)
    • Compile (Jekyll)
      • Local
      • GitHub
    • Serve (Jekyll)
    • Push to GitHub (punting)
  • Maintenance
    • Update dependencies (npm-check-update)
    • Shrinkwrap (npm)
  • Release
    • Change version number (custom node script)
    • Package zip file (GNU zip)
    • Push to npm, etc. (punting)

@bardiharborow bardiharborow added this to the v4.0.0-beta milestone Feb 21, 2017
@bardiharborow bardiharborow self-assigned this Feb 21, 2017
@mdo
Copy link
Member

mdo commented Mar 5, 2017

How best can I give feedback on this @bardiharborow? Do you have a checklist of remaining todos, or specific things that need testing?

@bardiharborow bardiharborow mentioned this pull request Mar 12, 2017
@bardiharborow
Copy link
Member Author

bardiharborow commented Mar 12, 2017

@mdo I've added a list of tasks and their review status. A local npm test now works (finally!). I have to work on replacing grunt-stamp, grunt-saucelabs and grunt-build-control, and then we might actually be done!

@mdo
Copy link
Member

mdo commented Mar 13, 2017

grunt-build-control can probably go away. I don't use it right now and just manually copy-pasta our generated docs and stuff :). I'd love something that actual worked, but in the spirit of moving this forward, we can do that later.

@hanakin
Copy link

hanakin commented Mar 31, 2017

Pls consider using stylelint over scss lint as it offers far more control and flexibility in code control with plugin support for additional control

@bardiharborow
Copy link
Member Author

@hanakin We'll be shipping that after this PR merges. It's just going to require a lot of config wrangling, and I'm juggling enough changes in this PR as it is.

@bardiharborow
Copy link
Member Author

bardiharborow commented Apr 19, 2017

Preparing to ship this. I have every expectation that something will go wrong and I'll be thoroughly trouted for it, but anyway...

@bardiharborow bardiharborow requested review from mdo and Johann-S April 19, 2017 12:49
package.json Outdated
"js-lint": "eslint js/ && eslint --config js/tests/.eslintrc.json --env node build/",
"js-lint-docs": "eslint --config js/tests/.eslintrc.json docs/assets/js/",
"js-compile": "npm-run-all --parallel js-compile-*",
"js-compile-bundle": "shx cat js/src/util.js 'js/src/!(util|popover).js' js/src/popover.js | shx sed 's/^(import|export).*//' | babel --filename js/src/bootstrap.js | node build/stamp.js > dist/js/bootstrap.js",
Copy link
Member

Choose a reason for hiding this comment

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

Hi @bardiharborow,

I have an error when this task is runned see :

image

I know my screenshot is in french, but it said :
'popover).js'' isn't known at an intern or extern command

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay. I thought that shx was performing the glob expansion, but maybe bash is doing it, and that obviously won't work on Windows. I'll replace this with a static list for now.

@bardiharborow bardiharborow merged commit b4ac48f into twbs:v4-dev Apr 20, 2017
@bardiharborow bardiharborow deleted the build branch April 20, 2017 04:36
@mdo mdo mentioned this pull request Apr 20, 2017
@Johann-S Johann-S mentioned this pull request Apr 20, 2017
@patrickhlauke
Copy link
Member

patrickhlauke commented Apr 20, 2017

not sure if it's something broken at my end, but: i fetched and rebased my fork on my machine, did a new npm install...but now when i try to run grunt i simply get Warning: Task "default" not found. Use --force to continue.

[edit: ah, don't mind me...i guess the whole way of building is now different and i should build the local docs and read them...]

@Johann-S
Copy link
Member

Johann-S commented Apr 20, 2017

They are just one task on our Gruntfile.js the other are in package.json

And for example to run the css task you have to do :
npm run css

@patrickhlauke
Copy link
Member

so forgive me being thick, but...what's the equivalent now of the old grunt which built everything, followed by bundle exec jekyll serve

@Johann-S
Copy link
Member

It seems it's test task and after you can call docs-serve task which will call bundle exec jekyll serve

@patrickhlauke
Copy link
Member

patrickhlauke commented Apr 20, 2017

tried npm run test on a hunch, and it errors out with "Could not find jekyll-sitemap-1.1.1 in any of the sources". joys of running this on windows...

(every time the build process changes subtly i end up with not being able to do anything on my windows machine until i uninstall everything and then reinstall everything based on the docs...so if the relevant docs could also be updated to reflect anything that needs to be done, and in what order, that'd be super)

[edit: rerunning gem install bundler and bundle install - hopefully that'll fix that]

@Johann-S
Copy link
Member

Yes it seems they are several bugs on Windows (I'm on Windows too) a PR is open here #22477 we should report any issues here

@mdo
Copy link
Member

mdo commented Apr 22, 2017

Awesome to see this merged! You're amazing @bardiharborow. Super happy to see things consolidated :). Only hiccup has been some Sauce failures with running the Sauce grunt task. See #22395 and #22496. Unsure what's going on there just yet.

@silverwind
Copy link

Would it make sense to have a npm run dist? I've been using the old grunt dist to just build CSS+JS, and found this to be roughly equal in the new build system (thought it does not do parallelism):

npm-run-all css-compile css-prefix css-minify js-compile-bundle js-compile-plugins js-minify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants