Skip to content

Commit

Permalink
Merge pull request #6 from fp-china/data-to-code
Browse files Browse the repository at this point in the history
try to use &data-to-code function
  • Loading branch information
NoEgAm authored Dec 1, 2023
2 parents ef9cfde + 9337e9e commit fb0570a
Show file tree
Hide file tree
Showing 7 changed files with 322 additions and 266 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

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

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

- name: "compiles to js"
run: >
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion assets/play-azure.js → assets/play-azure.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// import * as sdk from "microsoft-cognitiveservices-speech-sdk";
import * as SpeechSDK from "microsoft-cognitiveservices-speech-sdk/distrib/es2015/microsoft.cognitiveservices.speech.sdk";
import * as SpeechSDK from "microsoft-cognitiveservices-speech-sdk/distrib/lib/microsoft.cognitiveservices.speech.sdk";

console.log("speechsdk", SpeechSDK);

Expand Down
107 changes: 43 additions & 64 deletions calcit.cirru

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

28 changes: 10 additions & 18 deletions compact.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{} $ :style
merge ui/column $ {} (:width "\"28%")
:background-color $ hsl 0 0 94
memof-call comp-menu $ :voice? state
memof1-call comp-menu $ :voice? state
div
{} $ :style
merge ui/row-parted $ {} (:padding "\"0 8px") (:user-select :none)
Expand All @@ -51,9 +51,9 @@
d! cursor $ update state :voice? not
div
{} $ :style (merge ui/expand ui/column)
memof-call comp-header
memof1-call comp-header
comp-messages $ :messages store
memof-call comp-input $ >> states :input
memof1-call comp-input $ >> states :input
when dev? $ comp-reel (>> states :reel) reel ({})
|comp-header $ %{} :CodeEntry (:doc |)
:code $ quote
Expand Down Expand Up @@ -232,16 +232,7 @@
scroll-view!
|reading-list $ %{} :CodeEntry (:doc |)
:code $ quote
def reading-list $ []
parse-cirru-edn $ slurp "\"data/009-ghc-wasm.cirru"
parse-cirru-edn $ slurp "\"data/008-haskell-generics.cirru"
parse-cirru-edn $ slurp "\"data/007-immutable-channel.cirru"
parse-cirru-edn $ slurp "\"data/006-database-perf-usage.cirru"
parse-cirru-edn $ slurp "\"data/005-talk-cat.cirru"
parse-cirru-edn $ slurp "\"data/004-web-frontend.cirru"
parse-cirru-edn $ slurp "\"data/003-tutorial-learning.cirru"
parse-cirru-edn $ slurp "\"data/002-haskell-hiring.cirru"
parse-cirru-edn $ slurp "\"data/001-haskell-tiobe.cirru"
def reading-list $ [] (slurp-data "\"data/009-ghc-wasm.cirru") (slurp-data "\"data/008-haskell-generics.cirru") (slurp-data "\"data/007-immutable-channel.cirru") (slurp-data "\"data/006-database-perf-usage.cirru") (slurp-data "\"data/005-talk-cat.cirru") (slurp-data "\"data/004-web-frontend.cirru") (slurp-data "\"data/003-tutorial-learning.cirru") (slurp-data "\"data/002-haskell-hiring.cirru") (slurp-data "\"data/001-haskell-tiobe.cirru")
|santinize-voice $ %{} :CodeEntry (:doc |)
:code $ quote
defn santinize-voice (text)
Expand All @@ -267,9 +258,10 @@
.!scrollIntoView last-child
js/console.warn "\"no target"
, 100
|slurp $ %{} :CodeEntry (:doc |)
|slurp-data $ %{} :CodeEntry (:doc |)
:code $ quote
defmacro slurp (path) (; println "\"reading path" path) (read-file path)
defmacro slurp-data (path) (; println "\"reading path" path)
&data-to-code $ parse-cirru-edn (read-file path)
|speech! $ %{} :CodeEntry (:doc |)
:code $ quote
defn speech! (text cb)
Expand Down Expand Up @@ -310,11 +302,11 @@
reel.comp.reel :refer $ comp-reel
respo-md.comp.md :refer $ comp-md
app.config :refer $ dev? api-target
memof.alias :refer $ memof-call
memof.once :refer $ memof1-call
"\"jdenticon" :as jdenticon
"\"../xunfei/sdk" :refer $ speakXunfei
"\"../assets/play-azure" :refer $ synthesizeAzureSpeech
"\"../assets/play-audio" :refer $ requestAudioSpeech
"\"../assets/play-azure.mjs" :refer $ synthesizeAzureSpeech
"\"../assets/play-audio.mjs" :refer $ requestAudioSpeech
feather.core :refer $ comp-icon comp-i
|app.config $ %{} :FileEntry
:defs $ {}
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"dependencies": {
"@calcit/procs": "^0.8.0",
"@calcit/procs": "^0.8.12",
"jdenticon": "^3.2.0",
"microsoft-cognitiveservices-speech-sdk": "^1.32.0"
"microsoft-cognitiveservices-speech-sdk": "^1.33.1"
},
"devDependencies": {
"bottom-tip": "^0.1.5",
"crypto-js": "^4.1.1",
"crypto-js": "^4.2.0",
"feather-icons": "^4.29.1",
"js-base64": "^3.7.5",
"vite": "^4.4.9"
"vite": "^5.0.2"
},
"version": "0.0.1"
}
Loading

0 comments on commit fb0570a

Please sign in to comment.