From 9c2bae4f5fd4fcd676e0b70b91527daaab91618e Mon Sep 17 00:00:00 2001 From: Alfonso Garcia-Caro Date: Tue, 6 Oct 2020 07:17:42 +0900 Subject: [PATCH] Upgrade to Nagareyama --- .config/dotnet-tools.json | 6 ++++++ .gitignore | 1 + README.md | 6 +++--- build.fsx | 4 ++-- fake.sh | 2 ++ package.json | 5 +++-- webpack.config.js | 12 +----------- yarn.lock | 17 ----------------- 8 files changed, 18 insertions(+), 35 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 1decfe5..898cf67 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -13,6 +13,12 @@ "commands": [ "paket" ] + }, + "fable": { + "version": "3.0.0-nagareyama-alpha-014", + "commands": [ + "fable" + ] } } } \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2e5ac80..e81f81f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.fs.js packages/ paket-files/ paket.local diff --git a/README.md b/README.md index 51d77ea..bc45008 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ Run: `./fake.sh build -t Watch` # Running Fable without FAKE -- Install NPM dependencies: `yarn` -- Building for development: `yarn run webpack-dev-server` -- Building for production: `yarn run webpack` +- Install tools: `dotnet tool restore && yarn` +- Building for development: `dotnet fable watch src --run webpack-dev-server` +- Building for production: `dotnet fable src --run webpack` # Debugging in VS Code diff --git a/build.fsx b/build.fsx index 98ed331..15f93cb 100644 --- a/build.fsx +++ b/build.fsx @@ -35,11 +35,11 @@ Target.create "YarnInstall" (fun _ -> ) Target.create "Build" (fun _ -> - Yarn.exec "webpack" id + DotNet.exec id "fable" "src --run webpack" |> ignore ) Target.create "Watch" (fun _ -> - Yarn.exec "webpack-dev-server" id + DotNet.exec id "fable" "watch src --run webpack-dev-server" |> ignore ) // Where to push generated documentation diff --git a/fake.sh b/fake.sh index ed88753..656ab02 100755 --- a/fake.sh +++ b/fake.sh @@ -1,2 +1,4 @@ +#!/bin/bash + dotnet tool restore dotnet fake $@ diff --git a/package.json b/package.json index 245133a..5cda0d0 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,9 @@ "author": "Maxime Mangel", "license": "MIT", "private": true, + "scripts": { + "foo": "echo $PATH" + }, "dependencies": { "@fortawesome/fontawesome-free": "^5.13.0", "bulma": "^0.8.1", @@ -24,8 +27,6 @@ "copy-webpack-plugin": "^5.1.1", "core-js": "^3.6.4", "css-loader": "^3.5.1", - "fable-compiler": "^2.4.22", - "fable-loader": "^2.1.9", "file-loader": "^6.0.0", "html-webpack-plugin": "^4.0.4", "mini-css-extract-plugin": "^0.9.0", diff --git a/webpack.config.js b/webpack.config.js index a5b2ce6..b5b0a0d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,7 +6,7 @@ var CONFIG = { indexHtmlTemplate: './src/index.html', - fsharpEntry: './src/Demo.fsproj', + fsharpEntry: './src/App.fs.js', cssEntry: './src/scss/main.scss', outputDir: './output', assetsDir: './public', @@ -107,21 +107,11 @@ module.exports = { hot: true, inline: true }, - // - fable-loader: transforms F# into JS // - babel-loader: transforms JS to old syntax (compatible with old browsers) // - sass-loaders: transforms SASS/SCSS into JS // - file-loader: Moves files referenced in the code (fonts, images) into output folder module: { rules: [ - { - test: /\.fs(x|proj)?$/, - use: { - loader: "fable-loader", - options: { - babel: CONFIG.babel - } - }, - }, { test: /\.js$/, exclude: /node_modules/, diff --git a/yarn.lock b/yarn.lock index 02f5a9c..a818be6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2526,23 +2526,6 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -fable-babel-plugins@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/fable-babel-plugins/-/fable-babel-plugins-2.3.0.tgz#cb4f652bbe78bd8e4a34e17c851d940fa6f3fa44" - integrity sha512-alGBNw5HZJzTEznXKfypFEkD5aWsspbCcoVDu9j8Mqdi77dgp4BSjhYSg61mQEg9UluIAZxRM5lhGARYbU97DQ== - -fable-compiler@^2.4.22: - version "2.4.22" - resolved "https://registry.yarnpkg.com/fable-compiler/-/fable-compiler-2.4.22.tgz#653325d97d88e3565fb974da58c4ccffa2b13346" - integrity sha512-WFyyt/jXzK6E5coPOMz2i4jplyn4WV9JljT6o5UY+vYVx+hz5z1x7kepYxfO4YY6u/VRak5Q/ZM70JRhhJr1+Q== - -fable-loader@^2.1.9: - version "2.1.9" - resolved "https://registry.yarnpkg.com/fable-loader/-/fable-loader-2.1.9.tgz#ca54f57359e5ee416d15c0313ab2beb708560050" - integrity sha512-ffFfAx4+92yGRjV7iZQOCzqsjQF1he6Lei6hDqfaW1Qjbyx9bhVa8jCX53+I1mhWEw2JWIQpFzwHnYwz2eT4Hw== - dependencies: - fable-babel-plugins "^2.3.0" - fast-deep-equal@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4"