@calcit/procs 0.9.7 → 0.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -22
- package/lib/calcit.procs.mjs +1 -1
- package/lib/package.json +3 -3
- package/package.json +3 -3
- package/rust-toolchain.toml +1 -1
- package/ts-src/calcit.procs.mts +1 -1
package/README.md
CHANGED
|
@@ -43,21 +43,8 @@ Snippets evaling:
|
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
45
|
cr eval 'range 100'
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
multi-lines snippet:
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
cr eval '
|
|
52
46
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
->
|
|
56
|
-
range 100
|
|
57
|
-
map $ fn (x)
|
|
58
|
-
* x x
|
|
59
|
-
|
|
60
|
-
'
|
|
47
|
+
cr eval 'thread-first 100 range (map $ \ * % %)'
|
|
61
48
|
```
|
|
62
49
|
|
|
63
50
|
Run with a [compact.cirru](https://github.com/calcit-lang/lilac/blob/main/compact.cirru):
|
|
@@ -65,19 +52,21 @@ Run with a [compact.cirru](https://github.com/calcit-lang/lilac/blob/main/compac
|
|
|
65
52
|
```bash
|
|
66
53
|
cr compact.cirru -1 # run only once
|
|
67
54
|
|
|
68
|
-
cr
|
|
55
|
+
cr -1 # by default, it picks `compact.cirru`
|
|
56
|
+
|
|
57
|
+
cr # watch mode enabled by default
|
|
69
58
|
```
|
|
70
59
|
|
|
71
60
|
By default Calcit reads `:init-fn` and `:reload-fn` inside `compact.cirru` configs. You may also specify functions,
|
|
72
61
|
|
|
73
62
|
```bash
|
|
74
|
-
cr
|
|
63
|
+
cr --init-fn='app.main/main!' --reload-fn='app.main/reload!'
|
|
75
64
|
```
|
|
76
65
|
|
|
77
66
|
and even configure `:entries` in `compact.cirru`:
|
|
78
67
|
|
|
79
68
|
```bash
|
|
80
|
-
cr
|
|
69
|
+
cr --entry server
|
|
81
70
|
```
|
|
82
71
|
|
|
83
72
|
### JavaScript codegen
|
|
@@ -85,15 +74,15 @@ cr compact.cirru --entry server
|
|
|
85
74
|
It compiles to JavaScript and runs in consistet semantics. However it might require a lot of JavaScript interop.
|
|
86
75
|
|
|
87
76
|
```bash
|
|
88
|
-
cr
|
|
89
|
-
cr
|
|
77
|
+
cr js # compile to js, also picks `compact.cirru` by default
|
|
78
|
+
cr js --emit-path=out/ # compile to js and save in `out/`
|
|
90
79
|
```
|
|
91
80
|
|
|
92
81
|
By default, js code is generated to `js-out/`. You will need Vite or Node to run it, from an entry file:
|
|
93
82
|
|
|
94
83
|
```js
|
|
95
84
|
import { main_$x_, reload_$x_ } from "./js-out/app.main.mjs";
|
|
96
|
-
main_$x_();
|
|
85
|
+
main_$x_(); // which corresponds to `main!` function in calcit
|
|
97
86
|
```
|
|
98
87
|
|
|
99
88
|
### Calcit Editor & Bundler
|
|
@@ -111,6 +100,7 @@ Read more in [Respo Calcit Workflow](https://github.com/calcit-lang/respo-calcit
|
|
|
111
100
|
|
|
112
101
|
```cirru
|
|
113
102
|
{}
|
|
103
|
+
:calcit-version |0.9.9
|
|
114
104
|
:dependencies $ {}
|
|
115
105
|
|calcit-lang/memof |0.0.11
|
|
116
106
|
|calcit-lang/lilac |main
|
|
@@ -118,7 +108,9 @@ Read more in [Respo Calcit Workflow](https://github.com/calcit-lang/respo-calcit
|
|
|
118
108
|
|
|
119
109
|
Run `caps` to download. Sources are downloaded into `~/.config/calcit/modules/`. If a module contains `build.sh`, it will be executed mostly for compiling Rust dylibs.
|
|
120
110
|
|
|
121
|
-
|
|
111
|
+
`:calcit-version` helps in check version, and provides hints in [CI](https://github.com/calcit-lang/setup-cr) environment.
|
|
112
|
+
|
|
113
|
+
To load modules, use `:modules` configuration and `compact.cirru`(which normally generated from `calcit.cirru`):
|
|
122
114
|
|
|
123
115
|
```cirru
|
|
124
116
|
:configs $ {}
|
|
@@ -128,7 +120,7 @@ To load modules, use `:modules` configuration in `calcit.cirru` and `compact.cir
|
|
|
128
120
|
Paths defined in `:modules` field are just loaded as files from `~/.config/calcit/modules/`,
|
|
129
121
|
i.e. `~/.config/calcit/modules/memof/compact.cirru`.
|
|
130
122
|
|
|
131
|
-
Modules that ends with `/`s are automatically suffixed `compact.cirru` since it's the default
|
|
123
|
+
Modules that ends with `/`s are automatically suffixed `compact.cirru` since it's the default entry.
|
|
132
124
|
|
|
133
125
|
### Development
|
|
134
126
|
|
package/lib/calcit.procs.mjs
CHANGED
package/lib/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@calcit/procs",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
4
4
|
"main": "./lib/calcit.procs.mjs",
|
|
5
5
|
"devDependencies": {
|
|
6
|
-
"@types/node": "^22.10.
|
|
7
|
-
"typescript": "^5.7.
|
|
6
|
+
"@types/node": "^22.10.7",
|
|
7
|
+
"typescript": "^5.7.3"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"compile": "rm -rfv lib/* && tsc",
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@calcit/procs",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
4
4
|
"main": "./lib/calcit.procs.mjs",
|
|
5
5
|
"devDependencies": {
|
|
6
|
-
"@types/node": "^22.10.
|
|
7
|
-
"typescript": "^5.7.
|
|
6
|
+
"@types/node": "^22.10.7",
|
|
7
|
+
"typescript": "^5.7.3"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"compile": "rm -rfv lib/* && tsc",
|
package/rust-toolchain.toml
CHANGED
package/ts-src/calcit.procs.mts
CHANGED