Skip to content

Commit

Permalink
Simplify repo and build process
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsogarciacaro committed Nov 3, 2018
1 parent e234caf commit b7cf1b1
Show file tree
Hide file tree
Showing 26 changed files with 735 additions and 1,390 deletions.
9 changes: 1 addition & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
temp
public/**/*.*
!public/img/**/*.*
!public/repl/**/*.*
!public/css/highlight.css
!public/404.html
!public/CNAME
!public/README.md
deploy
**/.DS_Store
tools/.version

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
Expand Down
30 changes: 20 additions & 10 deletions .paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,26 @@
<PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
<PaketRestoreCacheFile>$(PaketRootPath)paket-files\paket.restore.cached</PaketRestoreCacheFile>
<PaketLockFilePath>$(PaketRootPath)paket.lock</PaketLockFilePath>
<PaketBootstrapperStyle>classic</PaketBootstrapperStyle>
<PaketBootstrapperStyle Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">proj</PaketBootstrapperStyle>
<PaketExeImage>assembly</PaketExeImage>
<PaketExeImage Condition=" '$(PaketBootstrapperStyle)' == 'proj' ">native</PaketExeImage>
<MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
<MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath>
<!-- Paket command -->
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketToolsPath)paket')">$(PaketToolsPath)paket</PaketExePath>
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>

<!-- .net core fdd -->
<_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension>
<PaketCommand Condition=" '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand>
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' ">$(PaketToolsPath)paket.exe</PaketExePath>
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND '$(PaketExeImage)' == 'assembly' ">$(PaketToolsPath)paket.exe</PaketExePath>
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND '$(PaketExeImage)' == 'native' ">$(PaketToolsPath)paket</PaketExePath>

<!-- no extension is a shell script -->
<PaketCommand Condition=" '$(_PaketExeExtension)' == '' ">"$(PaketExePath)"</PaketCommand>
<!-- Paket command -->
<_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension>
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand>
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' != 'Windows_NT' AND '$(_PaketExeExtension)' == '.exe' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' != 'Windows_NT'">"$(PaketExePath)"</PaketCommand>

<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
Expand All @@ -38,7 +44,11 @@
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
</PropertyGroup>

<Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" >
<Target Name="PaketBootstrapping" Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">
<MSBuild Projects="$(PaketToolsPath)paket.bootstrapper.proj" Targets="Restore" />
</Target>

<Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" DependsOnTargets="PaketBootstrapping">

<!-- Step 1 Check if lockfile is properly restored -->
<PropertyGroup>
Expand Down Expand Up @@ -77,7 +87,7 @@
</PropertyGroup>

<!-- Do a global restore if required -->
<Exec Command='$(PaketBootStrapperCommand)' Condition="Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
<Exec Command='$(PaketBootStrapperCommand)' Condition=" '$(PaketBootstrapperStyle)' == 'classic' AND Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />

<!-- Step 2 Detect project specific changes -->
Expand Down
40 changes: 5 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,17 @@ This project generates the static web pages for [Fable website](http://fable.io)

The F# project in `src` is compiled to a node app using Fable and then executed to generate the static pages. To run the app in development mode (with live reload of the server whenever F# sources change) run the following commands.

> TL;DR Run `yarn` to install dependencies, `yarn start-all` for development and `yarn deploy` to update the site.
Install JS and F# dependencies (only first time or whenever dependencies change):

```shell
yarn install
```

To execute Fable in watch mode, run:

```shell
cd src
dotnet fable fable-splitter -- -w
```

> If you only want to build the node app and run it once, type `dotnet fable fable-splitter` instead.
The web pages will be output to `public` directory. To start a local server with live reloading capabilities to visualize them, in a **new terminal**, type:

```shell
yarn server
yarn
yarn start
```

The web uses a customized version of the [Bulma CSS framework](http://bulma.io/documentation/overview/customize/). The [SASS file](http://sass-lang.com/) for the customization can be found in `files/styles.sass`. To compile it to CSS use:
For deployment run:

```shell
yarn sass -w
yarn deploy
```

> The `-w` argument activates the watch mode of the SASS compiler. You can omit it if you only want to compile the file once.
Alternatively, you can run the following to run the three processes (Fable, server and SASS compiler) at once concurrently:

```shell
yarn start-all
```

## Render the pages and publish them to Github

Run `yarn deploy` (this assumes you already compiled the F# project).

## Other repositories

The tool expects the [Fable](https://github.com/fable-compiler/Fable) repository to be cloned on the same directory level as this one.
The tool expects the [Fable](https://github.com/fable-compiler/Fable) repository to be cloned on the same directory level as this one.
45 changes: 0 additions & 45 deletions files/template.hbs

This file was deleted.

46 changes: 0 additions & 46 deletions files/tips.js

This file was deleted.

40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
"private": true,
"scripts": {
"postinstall": "dotnet restore src",
"server": "reload -b --dir public",
"sass": "node-sass files/styles.sass public/css/bulma.custom.css",
"sass-watch": "yarn sass && yarn sass -w",
"start-all": "concurrently -k \"cd src && dotnet fable fable-splitter -- -w\" \"yarn server\" \"yarn sass-watch\"",
"build-all": "concurrently \"cd src && dotnet fable fable-splitter\" \"yarn sass\"",
"predeploy": "yarn sass && node build/Main.js",
"deploy": "gh-pages -d public -b master"
"start-server": "reload -b --dir deploy",
"build-sass": "node-sass src/styles/main.sass deploy/css/styles.css",
"start-sass": "yarn build-sass && yarn build-sass -w",
"start-fable": "cd src && dotnet fable fable-splitter -- -w",
"build-fable": "cd src && dotnet fable fable-splitter",
"start": "concurrently npm:start-*",
"build": "concurrently npm:build-*",
"deploy": "yarn build && node build/Main.js && gh-pages -d deploy -b master",
"deploy-fast": "node build/Main.js && gh-pages -d deploy -b master"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"bulma": "^0.7.1",
"bulma-carousel": "^3.0.0",
"dependencies": {
"@babel/core": "^7.1.2",
"@babel/plugin-transform-modules-commonjs": "^7.1.0",
"bulma": "^0.7.2",
"concurrently": "^4.0.1",
"fable-splitter": "2.0.0-alpha-003",
"fable-splitter": "^2.0.2",
"fs-extra": "^7.0.0",
"gh-pages": "^1.2.0",
"handlebars": "^4.0.11",
"highlight.js": "^9.12.0",
"marked": "^0.5.0",
"node-sass": "^4.9.3",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"gh-pages": "^2.0.1",
"highlight.js": "^9.13.1",
"marked": "^0.5.1",
"node-sass": "^4.9.4",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"reload": "^2.3.1"
}
}
18 changes: 5 additions & 13 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,10 @@ source https://nuget.org/api/v2
storage:none
framework:netstandard2.0,netcoreapp2.0

clitool dotnet-fable prerelease
nuget Fable.Core prerelease
nuget Fable.PowerPack prerelease
nuget Fable.React prerelease
clitool dotnet-fable
nuget Fable.Core
nuget Fable.PowerPack
nuget Fable.React
nuget Fable.Import.Browser
nuget Fable.Import.Node
nuget Fulma prerelease

group Build
source https://nuget.org/api/v2
storage: packages
framework >= net45

nuget FAKE ~> 4
github fsharp/FAKE modules/Octokit/Octokit.fsx
nuget Fulma
64 changes: 26 additions & 38 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,44 @@ STORAGE: NONE
RESTRICTION: || (== netcoreapp2.0) (== netstandard2.0)
NUGET
remote: https://www.nuget.org/api/v2
dotnet-fable (2.0.0-beta-003) - clitool: true
dotnet-fable (2.0.8) - clitool: true
Dotnet.ProjInfo (>= 0.9) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
FSharp.Compiler.Service (>= 23.0.3) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
FSharp.Core (>= 4.3.4) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
FSharp.Compiler.Service (>= 25.0.1) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
FSharp.Core (>= 4.5.2) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
Microsoft.NETCore.App (>= 2.0) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
Newtonsoft.Json (>= 11.0.2) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
Dotnet.ProjInfo (0.9) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
FSharp.Core (>= 4.2.3)
Fable.Core (2.0.0-beta-001)
FSharp.Core (>= 4.3.4)
Dotnet.ProjInfo (0.12.2) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
FSharp.Core (>= 4.1.18)
Fable.Core (2.0.1)
FSharp.Core (>= 4.5.2)
Fable.Import.Browser (1.3)
Fable.Core (>= 1.3.17)
Fable.Import.Node (0.4.3)
Fable.Core (>= 1.3.8)
Fable.PowerPack (2.0.0-beta-004)
Fable.Core (>= 2.0.0-beta-001)
Fable.Import.Browser (>= 1.2.0-beta-001)
Fable.PowerPack (2.0.1)
Fable.Core (>= 2.0)
Fable.Import.Browser (>= 1.3)
FSharp.Core (>= 4.5.2)
Thoth.Json (>= 2.0)
Fable.React (4.1.1)
Fable.Core (>= 2.0)
Fable.Import.Browser (>= 1.3)
FSharp.Core (>= 4.5.2)
Thoth.Json (>= 2.0.0-beta-004)
Fable.React (4.0.0-alpha-001)
Fable.Core (>= 2.0.0-alpha-006)
Fable.Import.Browser (>= 1.1.1)
FSharp.Core (>= 4.3.4)
FSharp.Compiler.Service (23.0.3) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
FSharp.Compiler.Service (25.0.1) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
FSharp.Core (>= 4.1.18)
System.Collections.Immutable (>= 1.3.1)
System.Collections.Immutable (>= 1.5)
System.Diagnostics.Process (>= 4.1)
System.Diagnostics.TraceSource (>= 4.0)
System.Reflection.Emit (>= 4.3)
System.Reflection.Metadata (>= 1.4.2)
System.Reflection.Metadata (>= 1.6)
System.Reflection.TypeExtensions (>= 4.3)
System.Runtime.Loader (>= 4.0)
System.Security.Cryptography.Algorithms (>= 4.3)
FSharp.Core (4.5.2)
Fulma (1.0.0-beta-026)
Fable.Core (>= 1.3.12)
Fable.React (>= 3.1)
Microsoft.NETCore.App (2.1.3) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
Fulma (1.0)
Fable.Core (>= 2.0)
Fable.React (>= 4.0.1)
Microsoft.NETCore.App (2.1.5) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
Microsoft.NETCore.Platforms (2.1.1) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
Microsoft.NETCore.Targets (2.1) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
Microsoft.Win32.Primitives (4.3) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
Expand Down Expand Up @@ -205,7 +205,7 @@ NUGET
System.Runtime (4.3) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime.CompilerServices.Unsafe (4.5.1) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
System.Runtime.CompilerServices.Unsafe (4.5.2) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
System.Runtime.Extensions (4.3) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
Expand Down Expand Up @@ -269,7 +269,7 @@ NUGET
System.Runtime (>= 4.3)
System.Threading (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.Security.Principal.Windows (4.5) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
System.Security.Principal.Windows (4.5.1) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
Microsoft.NETCore.Platforms (>= 2.0) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
System.Text.Encoding (4.3) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
Microsoft.NETCore.Platforms (>= 1.1)
Expand All @@ -292,18 +292,6 @@ NUGET
System.Threading.ThreadPool (4.3) - restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))
System.Runtime (>= 4.3)
System.Runtime.Handles (>= 4.3)
Thoth.Json (2.0.0-beta-005)
Fable.Core (>= 2.0.0-beta-001)
Thoth.Json (2.3)
Fable.Core (>= 2.0)
FSharp.Core (>= 4.5.2)

GROUP Build
STORAGE: PACKAGES
RESTRICTION: >= net45
NUGET
remote: https://www.nuget.org/api/v2
FAKE (4.64.13)
Octokit (0.31)
GITHUB
remote: fsharp/FAKE
modules/Octokit/Octokit.fsx (1fe6a9d37a67c975eb36cbc88b7eab9a098247f1)
Octokit (>= 0.20)

0 comments on commit b7cf1b1

Please sign in to comment.