HearthSim / Joust

🍿 Hearthstone replays in your browser.
https://hearthsim.info/joust/
118 stars 20 forks source link

Land Yarn #169

Closed beheh closed 7 years ago

beheh commented 8 years ago

Yarn is a new package manager from Facebook and Google: https://yarnpkg.com/. It's been more reliable and much faster on my development machine, and I hope to speed up build time like this, since dependency installation is a non-trivial amount of time spent every single time.

The only caveat is that Travis currently always will run npm install when it detects a package.json and I'd like a way to disable this: travis-ci/travis-ci#6713 (I've submitted a PR). We can override this behaviour.

We'll also have to install yarn to our internal build server, but that should be pretty straight forward.

beheh commented 8 years ago

Also, the install script from package.json is not run, which means we don't have typings or enums. That's being tracked though: yarnpkg/yarn#721 and PR at yarnpkg/yarn#800.

yarnpkg/yarn#800 has landed, waiting for the next yarn release.

Yarn 0.16 has been released, testing build infrastructure.

beheh commented 8 years ago

Urgh, and now yarn install --production is failing because of yarnpkg/yarn#761. Sad story.

More specifically typings install fails postinstall because the module wrappy does not exist. Yarn sees it as a devDependency, because jasmine#glob#inflight requires it (with Jasmine being devDependency), and therefore discards it. On the other hand it's required by gulp#orchestrator#end-of-stream#once (with gulp being normal dependency).

beheh commented 8 years ago

This was supposedly fixed with yarnpkg/yarn#1739, but this still fails as of Yarn 0.17.0.

jleclanche commented 7 years ago

@beheh where are we at on this? Is it still blocked on yarn?

jleclanche commented 7 years ago

It looks like the --production issues have been fixed in yarn 0.18.

beheh commented 7 years ago

Yep, looks fine. I'm personally not feeling to good right now, but I'll try and land this soon.

beheh commented 7 years ago

--production is still broken (seriously?). Once again fs-realpath (as a dependency of glob) is excluded, even though glob is required for development (jasmine, karma) and for production (gulp-less) installs:

benedict@thundersnow ~/D/joust (yarn)> yarn install --production
yarn install v0.18.0
info No lockfile found.
[1/4] Resolving packages...
warning karma-phantomjs-launcher > phantomjs-prebuilt > request > node-uuid@1.4.7: use uuid module instead
warning gulp > vinyl-fs > glob-stream > minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > glob > graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
[2/4] Fetching packages...
warning fsevents@1.0.15: The platform "linux" is incompatible with this module.
info "fsevents@1.0.15" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
$ concurrently "typings install" "gulp enums:download"
[1] module.js:472
[1]     throw err;
[1]     ^
[1] 
[1] Error: Cannot find module 'fs.realpath'
[1]     at Function.Module._resolveFilename (module.js:470:15)
[1]     at Function.Module._load (module.js:418:25)
[1]     at Module.require (module.js:498:17)
[1]     at require (internal/module.js:20:19)
[1]     at Object.<anonymous> (/home/benedict/Dokumente/joust/node_modules/glob/glob.js:44:10)
[1]     at Module._compile (module.js:571:32)
[1]     at Object.Module._extensions..js (module.js:580:10)
[1]     at Module.load (module.js:488:32)
[1]     at tryModuleLoad (module.js:447:12)
[1]     at Function.Module._load (module.js:439:3)
[1] gulp enums:download exited with code 1
[0] typings WARN deprecated 3.12.2016: "registry:dt/react#0.14.0+20161117000655" is deprecated (updated, replaced or removed)
[0] 
[0] 
[0] ├── async (global)
[0] ├── cookiejs (global)
[0] ├── immutable (global)
[0] ├── jasmine (global)
[0] ├── lodash (global)
[0] ├── node (global)
[0] ├── react (global)
[0] ├── react-dom (global)
[0] └── sax (global)
[0] 
[0] typings install exited with code 0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
benedict@thundersnow ~/D/joust (yarn)> yarn why glob
yarn why v0.18.0
[1/4] Why do we have the module "glob"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
info Reasons this module exists
   - "jasmine" depends on it
   - "karma" depends on it
   - "gulp-less#accord" depends on it
info Disk size without dependencies: "68kB"
info Disk size with unique dependencies: "68kB"
info Disk size with transitive dependencies: "68kB"
info Amount of shared dependencies: 9
Done in 0.57s.
beheh commented 7 years ago

Finally looking good with https://github.com/yarnpkg/yarn/pull/2537, included in yarn 0.20.0.