Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye authored Sep 17, 2023
0 parents commit cec7fc5
Show file tree
Hide file tree
Showing 10 changed files with 341 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
35 changes: 35 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Tests

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

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

- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

- uses: supplypike/setup-bin@v3
with:
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.8.0/cr'
name: 'cr'
version: '0.8.0'

- uses: supplypike/setup-bin@v3
with:
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.8.0/caps'
name: 'caps'
version: '0.8.0'

- name: "test"
run: caps --ci && 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
168 changes: 168 additions & 0 deletions calcit.cirru

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

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

{} (: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 $ %{} :FileEntry
:defs $ {}
|calling-func $ %{} :CodeEntry (:doc |)
:code $ quote
defn calling-func () $ println "\"todo bcc"
|main! $ %{} :CodeEntry (:doc |)
:code $ quote
defn main! () (run-tests)
set-interval 2000 $ fn () (calling-func)
|on-error $ %{} :CodeEntry (:doc |)
:code $ quote
defn on-error (message) (; draw-error-message message)
|reload! $ %{} :CodeEntry (:doc |)
:code $ quote
defn reload! () $ echo "\"Reloaded."
:ns $ %{} :CodeEntry (:doc |)
:code $ quote
ns app.main $ :require
app.test :refer $ run-tests
calcit.std.time :refer $ set-interval
|app.test $ %{} :FileEntry
:defs $ {}
|main! $ %{} :CodeEntry (:doc |)
:code $ quote
defn main! () $ run-tests
|reload! $ %{} :CodeEntry (:doc |)
:code $ quote
defn reload! () $ println "\"TODO reload"
|run-tests $ %{} :CodeEntry (:doc |)
:code $ quote
defn run-tests () (reset! *quit-on-failure? true) (test-add)
|test-add $ %{} :CodeEntry (:doc |)
:code $ quote
deftest test-add $ testing |add
is $ = 2 (+ 1 1)
:ns $ %{} :CodeEntry (:doc |)
:code $ 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_()
6 changes: 6 additions & 0 deletions package.cirru
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

{}
:dependencies $ {}
|calcit-lang/calcit-test |main
|calcit-lang/calcit.std |main

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.8.0"
},
"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 cec7fc5

Please sign in to comment.