Skip to content

Commit ba76d4d

Browse files
committed
Add git support to build. Also add js-numbers library to db
1 parent 10634f8 commit ba76d4d

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

scripts/shop/build.rkt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
(make-directory* deps)
3636

3737
(define (entry->package entry)
38-
(if (string? entry)
39-
entry
40-
(format "~a@~a" (dict-ref entry 'name) (dict-ref entry 'version))))
38+
(cond [(string? entry) entry]
39+
[(= (dict-ref entry 'type) "git") (dict-ref entry 'name)]
40+
[else (format "~a@~a" (dict-ref entry 'name) (dict-ref entry 'version))]))
4141

4242
(define (entry->path entry)
4343
(if (string? entry) entry (dict-ref entry 'name)))
@@ -51,8 +51,7 @@
5151
(parameterize ([current-directory (make-temporary-file "tmp~a" 'directory)])
5252
(printf "Building: ~a~n" out)
5353
(when verbose
54-
(printf "Build Directory Location: ~a~n" (current-directory)))
55-
(when verbose
54+
(printf "Build Directory Location: ~a~n" (current-directory))
5655
(printf "Setting up environment...~n"))
5756
(copy-file webpack-config "webpack.config.js")
5857
(copy-file dynamic-loader "dynamic-loader.js")
@@ -70,11 +69,16 @@
7069
"@babel/preset-env" "@babel/preset-react")
7170
(when verbose
7271
(printf "Downloading deps...~n"))
73-
(cond
74-
[(generic-set? (dict-ref d 'package false))
75-
(for ([p (dict-ref d 'package)])
76-
(system* npm "install" (entry->package p)))]
77-
[else (system* npm "install" (entry->package (dict-ref d 'package)))])
72+
(let loop ([d (dict-ref d 'package false)])
73+
(cond
74+
[(generic-set? d)
75+
(for ([p d])
76+
(loop p))]
77+
[(dict? d)
78+
(case (dict-ref d 'type)
79+
[("git") (system* git "clone" (dict-ref d 'url))]
80+
[else (system* npm "install" (entry->package d))])]
81+
[else (system* npm "install" (entry->package d))]))
7882
(system* npx "webpack" path (format "--output-filename=~a.js" out))
7983
(for ([f (in-glob "dist/*")])
8084
(copy-file f (build-path deps (file-name-from-path f)) #t)))))

scripts/shop/database.sml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,12 @@ highlightjs-github-css:
4242
iink-js:
4343
{package: "iink-js" path: "dist/iink.min.js"}
4444

45+
js-numbers:
46+
{package: "js-numbers"
47+
path: "src/js-numbers.js"}
48+
4549
konva:
46-
{package: "konva" path: "lib/index.js"}
50+
{package: "konva" path: "konva.js"}
4751

4852
luxon:
4953
{package: "luxon" path: "build/global/luxon.js"}
@@ -112,7 +116,8 @@ react-icons:
112116
react-konva:
113117
{package: ["react-konva" "konva"]
114118
full-path: "./node_modules/react-konva/lib/ReactKonva.js"
115-
externals: {konva: "konva"}}
119+
;; externals: {konva: "konva"}
120+
}
116121

117122
react-player:
118123
{package: "react-player" path: "dist/ReactPlayer.js"}

0 commit comments

Comments
 (0)