Skip to content

Commit

Permalink
update to latest Rust runtime; bump 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Aug 20, 2021
1 parent 2d3c42c commit e55cd60
Show file tree
Hide file tree
Showing 7 changed files with 1,371 additions and 904 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/compile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,43 @@ on:
push:
branches:
- master
- main
pull_request: {}

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: wget
run: mkdir ci-bin/ && wget -O ci-bin/calcit_runner http://repo.calcit-lang.org/binaries/linux/calcit_runner
- name: "permission"
run: chmod +x ci-bin/calcit_runner
- uses: actions/checkout@v2


- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
name: Cache node modules of yarn
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- 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 http://repo.calcit-lang.org/binaries/linux/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/
- name: "compiles to js"
run: >
./ci-bin/calcit_runner --emit-js --once
&& ./ci-bin/calcit_runner --emit-js --once --emit-path out-page/ --init-fn cumulo-util.client/main! --reload-fn cumulo-util.client/reload!
cr --emit-js --once
&& cr --emit-js --once --emit-path out-page/ --init-fn cumulo-util.client/main! --reload-fn cumulo-util.client/reload!
1,373 changes: 917 additions & 456 deletions calcit.cirru

Large diffs are not rendered by default.

48 changes: 22 additions & 26 deletions compact.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
{} (:package |cumulo-util)
:configs $ {} (:init-fn |cumulo-util.app/main!) (:reload-fn |cumulo-util.app/reload!)
:modules $ []
:version |0.0.1
:version |0.0.2
:files $ {}
|cumulo-util.client $ {}
:ns $ quote
ns cumulo-util.client $ :require
[] cumulo-util.core :refer $ [] on-page-touch
:defs $ {}
|main! $ quote
defn main! () $ on-page-touch
fn () $ println "\"called"
|reload! $ quote
defn reload! $
|cumulo-util.app $ {}
:ns $ quote
ns cumulo-util.app $ :require
Expand All @@ -12,29 +22,16 @@
:defs $ {}
|main! $ quote
defn main! () (println "\"Started") (task!) (write-mildly! "\"a/a/a" "\"a")
|reload! $ quote
defn reload! () (println "\"Reload") (task!)
|task! $ quote
defn task! () $ echo "\"Task..."
:proc $ quote ()
|cumulo-util.client $ {}
:ns $ quote
ns cumulo-util.client $ :require
[] cumulo-util.core :refer $ [] on-page-touch
:defs $ {}
|main! $ quote
defn main! () $ on-page-touch
fn () $ println "\"called"
|reload! $ quote
defn reload! $
:proc $ quote ()
defn reload! () (println "\"Reload") (task!)
|cumulo-util.core $ {}
:ns $ quote
ns cumulo-util.core $ :require ([] "\"shortid" :as shortid)
:defs $ {}
|delay! $ quote
defn delay! (duration task)
js/setTimeout task $ * 1000 duration
|unix-time! $ quote
defn unix-time! () $ .valueOf (new js/Date)
|id! $ quote
defn id! () $ shortid/generate
|on-page-touch $ quote
Expand All @@ -48,17 +45,20 @@
when
= "\"visible" $ .-visibilityState js/document
call-listener
|*cooling $ quote (defatom *cooling false)
|delay! $ quote
defn delay! (duration task)
js/setTimeout task $ * 1000 duration
|repeat! $ quote
defn repeat! (duration task)
js/setInterval task $ * 1000 duration
|unix-time! $ quote
defn unix-time! () $ .valueOf (new js/Date)
|*cooling $ quote (defatom *cooling false)
:proc $ quote ()
|cumulo-util.file $ {}
:ns $ quote
ns cumulo-util.file $ :require ([] "\"path" :as path) ([] "\"fs" :as fs) ([] "\"child_process" :as cp) ([] "\"net" :as net)
:defs $ {}
|sh! $ quote
defn sh! (command) (println command)
println $ .toString (cp/execSync command)
|get-backup-path! $ quote
defn get-backup-path! () $ let
now $ new js/Date
Expand All @@ -73,15 +73,12 @@
if found?
parse-cirru-edn $ fs/readFileSync filepath |utf8
, nil
|sh! $ quote
defn sh! (command) (println command)
println $ .toString (cp/execSync command)
|write-mildly! $ quote
defn write-mildly! (file-path content)
let
dir $ path/dirname file-path
filename $ path/basename file-path
temp-name $ str "\"/tmp/" (.now js/Date) "\"-" (.random js/Math) "\"-" filename
temp-name $ str "\"/tmp/" (js/Date.now) "\"-" (js/Math.random) "\"-" filename
do-write! $ fn () (fs/writeFileSync temp-name content) (fs/renameSync temp-name file-path) (println "\"Write to file:" file-path)
if (fs/existsSync file-path)
let
Expand All @@ -94,4 +91,3 @@
fs/mkdirSync dir $ to-js-data
{} $ :recursive true
do-write!
:proc $ quote ()
6 changes: 3 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

import { main_BANG_ } from "./out-page/cumulo-util.client.js"
import { main_$x_ } from "./out-page/cumulo-util.client.js"

main_BANG_()
main_$x_()

if (import.meta.hot) {
import.meta.hot.accept('./out-page/cumulo-util.client.js', (main) => {
main.reload_BANG_()
main.reload_$x_()
})
}
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"dependencies": {
"@calcit/procs": "^0.3.0-a11"
"@calcit/procs": "^0.4.18"
},
"scripts": {
"watch-server": "calcit_runner --emit-js",
"watch-server": "cr --emit-js",
"build-server": "target=node entry=./server.js yarn webpack && node js-out/bundle.js",
"watch-page": "calcit_runner --emit-js --emit-path out-page/ --init-fn cumulo-util.client/main! --reload-fn cumulo-util.client/reload!"
"watch-page": "cr --emit-js --emit-path out-page/ --init-fn cumulo-util.client/main! --reload-fn cumulo-util.client/reload!"
},
"devDependencies": {
"shortid": "^2.2.16",
"vite": "^2.2.3",
"webpack": "^5.36.0",
"webpack-cli": "^4.6.0",
"ws": "^7.4.5"
"vite": "^2.5.0",
"webpack": "^5.51.1",
"webpack-cli": "^4.8.0",
"ws": "^8.2.0"
},
"version": "0.0.1"
"version": "0.0.2"
}
6 changes: 3 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

import { main_BANG_ } from "./js-out/cumulo-util.app.js"
import { main_$x_ } from "./js-out/cumulo-util.app.js"

main_BANG_()
main_$x_()

if (import.meta.hot) {
import.meta.hot.accept('./js-out/cumulo-util.app.js', (main) => {
main.reload_BANG_()
main.reload_$x_()
})
}
Loading

0 comments on commit e55cd60

Please sign in to comment.