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

Move to yarn #1130

Merged
merged 1 commit into from
Sep 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ addons:
packages:
- libunwind8

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.27.5
- export PATH=$HOME/.yarn/bin:$PATH
cache:
yarn: true

before_script:
- nvm install 6.11
- nvm use 6.11
Expand Down
4 changes: 3 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ build:
environment:
nodejs_version: "6.11.0"

cache:
- "%LOCALAPPDATA%\\Yarn"

# Install scripts. (runs after repo cloning)
install:
# Get the latest stable version of Node.js
Expand All @@ -28,4 +31,3 @@ test: off
# name: fable
# - path: samples
# name: samples

18 changes: 14 additions & 4 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,16 @@ module Npm =
else line)
File.WriteAllLines(pkgJson, lines)

module Yarn =
open Fake.YarnHelper

let install workingDir =
Yarn (fun p ->
{ p with
Command = Install Standard
WorkingDirectory = workingDir
})

module Node =
let run workingDir script args =
let args = sprintf "%s %s" script (String.concat " " args)
Expand Down Expand Up @@ -258,13 +268,13 @@ let buildCLI baseDir isRelease () =
|> Util.run (baseDir </> "dotnet-fable") dotnetExePath

let buildCoreJS () =
Npm.install __SOURCE_DIRECTORY__ []
Yarn.install __SOURCE_DIRECTORY__
Npm.script __SOURCE_DIRECTORY__ "tslint" [sprintf "--project %s" coreJsSrcDir]
Npm.script __SOURCE_DIRECTORY__ "tsc" [sprintf "--project %s" coreJsSrcDir]

let buildSplitter () =
let buildDir = __SOURCE_DIRECTORY__ </> "src/js/fable-splitter"
Npm.install __SOURCE_DIRECTORY__ []
Yarn.install __SOURCE_DIRECTORY__
// Npm.script __SOURCE_DIRECTORY__ "tslint" [sprintf "--project %s" buildDir]
Npm.script __SOURCE_DIRECTORY__ "tsc" [sprintf "--project %s" buildDir]

Expand Down Expand Up @@ -306,7 +316,7 @@ let runFableServer args f =
finally fableServer.Kill()

let runTestsJS () =
Npm.install __SOURCE_DIRECTORY__ []
Yarn.install __SOURCE_DIRECTORY__
Util.run __SOURCE_DIRECTORY__ dotnetExePath "restore tests/Main"
Util.run __SOURCE_DIRECTORY__ dotnetExePath "build/fable/dotnet-fable.dll webpack --verbose --port free -- --config tests/webpack.config.js"
Npm.script __SOURCE_DIRECTORY__ "mocha" ["./build/tests/bundle.js"]
Expand Down Expand Up @@ -522,7 +532,7 @@ Target "All" (fun () ->
// > Attention: the generation of libraries metadata is not included in this target
Target "REPL" (fun () ->
let replDir = "src/dotnet/Fable.JS/demo"
Npm.install replDir []
Yarn.install replDir

// Compile fable-core
CreateDir (replDir + "/fable-core")
Expand Down
Loading