Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Jul 22, 2022
0 parents commit 52d09f6
Show file tree
Hide file tree
Showing 9 changed files with 321 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

calcit.cirru -diff linguist-generated
yarn.lock -diff linguist-generated
34 changes: 34 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tests

on:
push:
branches:
- main
pull_request: {}

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: ACTIONS_ALLOW_UNSECURE_COMMANDS
id: ACTIONS_ALLOW_UNSECURE_COMMANDS
run: echo 'ACTIONS_ALLOW_UNSECURE_COMMANDS=true' >> $GITHUB_ENV

- name: add cr
run: |
mkdir -p $GITHUB_WORKSPACE/bin
wget -O $GITHUB_WORKSPACE/bin/cr https://github.com/calcit-lang/calcit/releases/download/0.6.0-a3-build2/cr
chmod +x $GITHUB_WORKSPACE/bin/cr
echo "::add-path::$GITHUB_WORKSPACE/bin"
- name: "prepare modules"
run: >
mkdir -p ~/.config/calcit/modules/ && cd ~/.config/calcit/modules/
&& git clone https://github.com/calcit-lang/calcit-test.git
- name: "test"
run: cr -1 --entry test

- run: cr --emit-js -1 --entry test && yarn && node ./main.mjs
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

.compact-inc.cirru
.calcit-error.cirru

js-out/
node_modules

example/
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

Calcit Workflow
----

> running in both Calcit and Calcit-js, with hot code reload.
### Usages

Install [Calcit](https://github.com/calcit-lang/calcit) to run demo:

```bash
cr -1 # run once

cr # run and watch
```

run tests:

```bash
cr -1 --entry test
```

run test in JavaScript:

```bash
cr --emit-js -1 --entry test # emit-js once
node main.mjs # run code
```

### Workflow

https://github.com/calcit-lang/calcit-workflow

### License

MIT
165 changes: 165 additions & 0 deletions calcit.cirru

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions compact.cirru
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

{} (:package |app)
:configs $ {} (:init-fn |app.main/main!) (:reload-fn |app.main/reload!) (:version |0.0.1)
:modules $ [] |calcit-test/ |calcit.std/
:entries $ {}
:test $ {} (:init-fn |app.test/main!) (:reload-fn |app.test/reload!)
:modules $ [] |calcit-test/
:files $ {}
|app.main $ {}
:defs $ {}
|calling-func $ quote
defn calling-func () $ println "\"todo bcc"
|main! $ quote
defn main! () (run-tests)
set-interval 2000 $ fn () (calling-func)
|on-error $ quote
defn on-error (message) (; draw-error-message message)
|reload! $ quote
defn reload! () $ echo "\"Reloaded."
:ns $ quote
ns app.main $ :require
app.test :refer $ run-tests
calcit.std.time :refer $ set-interval
|app.test $ {}
:defs $ {}
|main! $ quote
defn main! () $ run-tests
|reload! $ quote
defn reload! () $ println "\"TODO reload"
|run-tests $ quote
defn run-tests () (reset! *quit-on-failure? true) (test-add)
|test-add $ quote
deftest test-add $ testing |add
is $ = 2 (+ 1 1)
:ns $ quote
ns app.test $ :require
calcit-test.core :refer $ deftest testing is *quit-on-failure?
3 changes: 3 additions & 0 deletions main.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { main_$x_, reload_$x_ } from "./js-out/app.test.mjs"

main_$x_()
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": "0.0.7",
"dependencies": {
"@calcit/procs": "^0.6.0-a3"
},
"scripts": {},
"devDependencies": {}
}
27 changes: 27 additions & 0 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 52d09f6

Please sign in to comment.