Skip to content
This repository has been archived by the owner on Nov 13, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaid-Ajaj committed Jan 25, 2017
2 parents 9933a48 + c891dcd commit e6a75cf
Show file tree
Hide file tree
Showing 97 changed files with 16,913 additions and 3,062 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*.userprefs

# Build results
npm/
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
Expand Down Expand Up @@ -259,7 +260,7 @@ build/
.paket/paket.exe


public/
docs/public/js/

# Generated documentation folder
docs/output/
Expand Down
Binary file removed .paket/paket.bootstrapper.exe
Binary file not shown.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ deploy:
api_key:
secure: qTksJDsQtgnDiEoVdT6AMEIaZ5kxAE+2A2KJvL/8AlZQ2db0ZOo+yAX2EHukK2dEH82wlr3cLabcwKGz+QK7EoZzMJ+b6G+/RRzl1jGbPDza5Jyuq9Iae9BCLWKgOxSJiFF4GdQbNex+FpN/sbQEGcoMwQ3AIbaHbvWhccMgsUXEXaQz4OFtBar0roxC64gSfE0ecapdbW7mDcSNhrUgpujXhd+kuaaBu91Mc6EDXMgf3tCoDFI/Dno+4T7S4rZHqX3Y+PCDNXPIQzSAA7rOX41pM14+3s+g6/78KIxhgP03pkCY1EEN/RqhAXr7obAH4KdCOvuMKkWdRJkd/G0bgTDUz/VwVN0SK9tqN36LcPYGty9p2Af0hSbpaTVpcb4gzsZXq//8FPedvnhuocCuMP+FfiIl9lyEq0cXXa35Z3fS+bDDX4R0XMu2baejxh80pLl4VbQfS1XAUuMnckRWywm6ucUYv8lOnih1r4yDFk396eGY9Qahu9xIFfzKwk/r8Hcu8TiLTwE7EWzXlM2fy4fCn+s21ziNkdfNpNAHRmm1MFnasleNCdbeLOCuaYksb6AOK4XDF1MhN3665s+7VM0uMP0NkgTdX20U6oCHPLmMmdHBpWAMUxPO184KdEKqefRlLHkJGAySdT6Uw/3gS+1oaXMEPgKMlEsPMky2ePo=
on:
tags: true
repo: fable-compiler/fable-arch
env:
- TRAVIS_NODE_VERSION="7"
install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
before_script:
- npm install -g npm@'>=3'
script: ./build.sh
- npm install -g npm@'>=3'
- npm install
script: node build.js
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# fable-import-virtualdom

Fable bindings for virtual-dom

## Installation

```sh
$ npm install --save virtual-dom fable-core
$ npm install --save-dev fable-arch
```

## Usage

### In an F# project (.fsproj)

```xml
<ItemGroup>
<Reference Include="node_modules/fable-core/Fable.Core.dll" />
</ItemGroup>
<Reference Include="Fable.Arch">
<HintPath>node_modules\fable-arch\Fable.Arch.dll</HintPath>
</Reference>
```

### In an F# script (.fsx)

```fsharp
#r "node_modules/fable-core/Fable.Core.dll"
#r "node_modules\fable-arch\Fable.Arch.dll"
open Fable.Core
open Fable.Import
open Fable.Arch
open Fable.Arch.App
open Fable.Arch.App.AppApi
open Fable.Arch.Html
```

### Rollup

If you are using Rollup has the bundler you need to tell it how to bundle virtual-dom.

Example:

```json
"rollup": {
"dest": "public/bundle.js",
"plugins": {
"commonjs": {
"namedExports": {
"virtual-dom": [ "h", "create", "diff", "patch" ]
}
}
}
}
```
7 changes: 7 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### 0.10.0

* Implements `start` and `startAndExposeMessageSink`

### 0.10.0-alpha.1

* Upgrade to Fable 0.7.0
14 changes: 0 additions & 14 deletions build.cmd

This file was deleted.

90 changes: 0 additions & 90 deletions build.fsx

This file was deleted.

35 changes: 35 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
var path = require("path");
var fs = require("fs-extra");
var fable = require("fable-compiler");
// var fable = require("../Fable/build/fable");

var version;

var targets = {
all() {
return fable.promisify(fs.remove, "npm")
.then(_ => fable.compile({projFile: "src/Fable.Arch"}))
.then(_ => fable.compile({projFile: "src/Fable.Arch", target: "umd"}))
.then(_ => fable.promisify(fs.copy, "package.json", "npm/package.json"))
.then(_ => fable.promisify(fs.copy, "README.md", "npm/README.md"))
.then(_ => fable.promisify(fs.readFile, "RELEASE_NOTES.md"))
.then(line => {
version = /\d[^\s]*/.exec(line)[0];
return fable.runCommand("npm", "npm version " + version);
});
},
publish() {
return this.all()
.then(_ => {
var command = version && version.indexOf("alpha") > -1
? "npm publish --tag next"
: "npm publish";
fable.runCommand("npm", command)
})
}
}

targets[process.argv[2] || "all"]().catch(err => {
console.log("[ERROR] " + err);
process.exit(-1);
});
33 changes: 0 additions & 33 deletions build.sh

This file was deleted.

14 changes: 14 additions & 0 deletions docs/Settings.FSharpLint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<FSharpLintSettings xmlns="https://github.com/fsprojects/FSharpLint/blob/master/ConfigurationSchema.xsd">
<IgnoreFiles Update="Overwrite"><![CDATA[assemblyinfo.*
]]></IgnoreFiles>
<Analysers>
<NameConventions>
<Rules>
<IdentifiersMustNotContainUnderscores>
<Enabled>False</Enabled>
</IdentifiersMustNotContainUnderscores>
</Rules>
</NameConventions>
</Analysers>
</FSharpLintSettings>
39 changes: 39 additions & 0 deletions docs/WebApp.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{BF60BC93-E09B-4E5F-9D85-95A519479D54}"
ProjectSection(SolutionItems) = preProject
build.js = build.js
index.html = index.html
package.json = package.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "public", "public", "{BDC2CBB4-EF50-4A9A-A738-0B2A82A621A3}"
ProjectSection(SolutionItems) = preProject
public\css\style.css = public\css\style.css
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scss", "scss", "{DF9E3093-65E8-4EB5-8870-21D1F3B554B8}"
ProjectSection(SolutionItems) = preProject
scss\main.sass = scss\main.sass
EndProjectSection
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "WebApp", "src\WebApp.fsproj", "{861B39F3-785E-45AB-90B4-3CC720C1EC0B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{861B39F3-785E-45AB-90B4-3CC720C1EC0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{861B39F3-785E-45AB-90B4-3CC720C1EC0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{861B39F3-785E-45AB-90B4-3CC720C1EC0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{861B39F3-785E-45AB-90B4-3CC720C1EC0B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
53 changes: 53 additions & 0 deletions docs/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const path = require('path');
const fs = require('fs-extra');
const fable = require('fable-compiler');

const BUILD_DIR = "public"
const JS_DIR = "js"
const DEST_FILE = "bundle.js"
const PKG_JSON = "package.json"
const README = "README.md"
const RELEASE_NOTES = "RELEASE_NOTES.md"
const PROJ_FILE = "src/WebApp.fsproj"

const fableconfig = {
"babelPlugins": [ "transform-runtime" ],
"projFile": PROJ_FILE,
"rollup": {
"dest": path.join(BUILD_DIR, JS_DIR, DEST_FILE),
"plugins": {
"commonjs": {
"namedExports": {
"virtual-dom": [ "h", "create", "diff", "patch" ]
}
}
}
}
};

const fableconfigDev =
Object.assign({
"sourceMaps": true,
"watch": true,
"symbols": "DEV"
}, fableconfig)

const targets = {
clean() {
return fable.promisify(fs.remove, path.join(BUILD_DIR, JS_DIR))
},
build() {
return this.clean()
.then(_ => fable.compile(fableconfig))
},
dev() {
return this.clean()
.then(_ => fable.compile(fableconfigDev))
}
}

// As with FAKE scripts, run a default target if no one is specified
targets[process.argv[2] || "build"]().catch(err => {
console.log(err);
process.exit(-1);
});
Loading

0 comments on commit e6a75cf

Please sign in to comment.