Skip to content

Compile with TypeScript #36

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"fable": {
"version": "4.1.3",
"commands": [
"fable"
]
}
}
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.ionide
.vs
node_modules/
src/dotnet/obj/
src/dotnet/bin/
src/compost/obj/
src/compost/bin/
src/compost-ts
docs/_site
dist/
13 changes: 8 additions & 5 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
.ionide
docs
public
src
.vs
.config
node_modules/
src/
docs/
public/
compost.gif
Nuget.config
webpack.config.js
node_modules
ts.config.json
vite.config.ts
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@ using [the Fable compiler](https://fable.io). To build Compost, you will need to

### Developing Compost
To work on Compost, you can use the WebPack dev server. The following will serve the
`public/index.html` file and compile the `src/project/demos.js` source code at
`public/index.html` file and compile the `src/project/` source code at
http://localhost:8080

```
dotnet tool restore
npm install
npm start
```

### Building Compost
There are two ways to build Compost. Running `npm run build` will use `fable-splitter`
to generate nice JavaScript files for a NPM package in the `dist` folder, which is then
packaged and published on NPM. Running `npm run standalone` builds a standalone
Running `npm run build` will generate nice JavaScript files with type declarations for a NPM package in the `dist` folder, which can be published on NPM.

> **Temporarily disabled**: Running `npm run standalone` builds a standalone
JavaScript file that is added to the `releases` folder of the `docs` with the current
version number in the filename (and also updates the `latest` file).
This should all happen automatically when using `npm run release`.
Expand Down
20 changes: 3 additions & 17 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<style>
.youguess button {
Expand Down Expand Up @@ -28,22 +29,7 @@
</style>
</head>
<body style="background:#ffffff">
<h1>DEMO #1</h1>
<div id="out1" style="margin-left:100px;width:400px;height:300px;"></div>

<h1>DEMO #2</h1>
<div id="out2" style="margin-left:100px;width:400px;height:300px;"></div>

<h1>DEMO #3</h1>
<div id="out3" style="margin-left:100px;width:600px;height:400px;"></div>

<h1>DEMO #4</h1>
<div id="out4" style="margin-left:100px;width:600px;height:400px;"></div>

<h1>DEMO #5</h1>
<div id="out5" style="margin-left:100px"></div>

<br /><br /><br /><br /><br /><br /><br />
<script src="bundle.js"></script>
<div id="root"></div>
<script type="module" src="/src/project/main.tsx"></script>
</body>
</html>
Loading