Skip to content

Commit 191887b

Browse files
committed
embed deps into binary
1 parent fdf0c07 commit 191887b

File tree

10 files changed

+26745
-20
lines changed

10 files changed

+26745
-20
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ insert_final_newline = unset
2424
[examples/server/public/*]
2525
indent_size = 2
2626

27+
[examples/server/public/deps_*]
28+
trim_trailing_whitespace = unset
29+
indent_style = unset
30+
indent_size = unset
31+
32+
[examples/server/deps_*]
33+
trim_trailing_whitespace = unset
34+
indent_style = unset
35+
indent_size = unset
36+
2737
[examples/llama.swiftui/llama.swiftui.xcodeproj/*]
2838
indent_style = tab
2939

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,10 @@ llama-server: \
14581458
examples/server/index.html.hpp \
14591459
examples/server/completion.js.hpp \
14601460
examples/server/loading.html.hpp \
1461+
examples/server/deps_daisyui.min.css.hpp \
1462+
examples/server/deps_markdown-it.js.hpp \
1463+
examples/server/deps_tailwindcss.js.hpp \
1464+
examples/server/deps_vue.esm-browser.js.hpp \
14611465
common/json.hpp \
14621466
common/stb_image.h \
14631467
$(OBJ_ALL)

examples/server/CMakeLists.txt

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,13 @@ set(TARGET_SRCS
1515
httplib.h
1616
)
1717
set(PUBLIC_ASSETS
18-
colorthemes.css
19-
style.css
20-
theme-beeninorder.css
21-
theme-ketivah.css
22-
theme-mangotango.css
23-
theme-playground.css
24-
theme-polarnight.css
25-
theme-snowstorm.css
2618
index.html
27-
index-new.html
28-
index.js
2919
completion.js
30-
system-prompts.js
31-
prompt-formats.js
32-
json-schema-to-grammar.mjs
3320
loading.html
21+
deps_daisyui.min.css
22+
deps_markdown-it.js
23+
deps_tailwindcss.js
24+
deps_vue.esm-browser.js
3425
)
3526

3627
foreach(asset ${PUBLIC_ASSETS})

examples/server/deps.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,20 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
66
PUBLIC=$DIR/public
77

88
echo "download js bundle files"
9-
curl https://npm.reversehttp.com/@preact/signals-core,@preact/signals,htm/preact,preact,preact/hooks > $PUBLIC/index.js
10-
echo >> $PUBLIC/index.js # add newline
9+
10+
# Note for contributors: Always pin to a specific version "maj.min.patch" to avoid breaking the CI
11+
12+
curl -L https://cdn.tailwindcss.com/3.4.14 > $PUBLIC/deps_tailwindcss.js
13+
echo >> $PUBLIC/deps_tailwindcss.js # add newline
14+
15+
curl -L https://cdnjs.cloudflare.com/ajax/libs/daisyui/4.12.14/styled.min.css > $PUBLIC/deps_daisyui.min.css
16+
curl -L https://cdnjs.cloudflare.com/ajax/libs/daisyui/4.12.14/themes.min.css >> $PUBLIC/deps_daisyui.min.css
17+
echo >> $PUBLIC/deps_daisyui.min.css # add newline
18+
19+
curl -L https://unpkg.com/[email protected]/dist/vue.esm-browser.js > $PUBLIC/deps_vue.esm-browser.js
20+
echo >> $PUBLIC/deps_vue.esm-browser.js # add newline
21+
22+
curl -L https://cdnjs.cloudflare.com/ajax/libs/markdown-it/13.0.2/markdown-it.js > $PUBLIC/deps_markdown-it.js
23+
echo >> $PUBLIC/deps_markdown-it.js # add newline
24+
25+
ls -lah $PUBLIC

examples/server/public/deps_daisyui.min.css

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)