Skip to content

Commit 1c7ce55

Browse files
author
Sean
committed
fixing repl
1 parent 042e906 commit 1c7ce55

File tree

5 files changed

+20
-36
lines changed

5 files changed

+20
-36
lines changed

build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ SRC_DIR=$SCRIPT_DIR/src
1111
TGT_DIR=$SCRIPT_DIR/tgt
1212
DIST_DIR=$TGT_DIR/dist
1313
TESTS_DIR=$SCRIPT_DIR/tests
14+
LIB_DIR=$SCRIPT_DIR/lib
1415
DIST_DIR=$SCRIPT_DIR/dist
1516

1617
BUILD_TS=0
@@ -70,6 +71,7 @@ case "$1" in
7071
echo Publishing builds to ./dist
7172
rm -rf "$DIST_DIR"
7273
mkdir -p "$DIST_DIR"
74+
cp "$LIB_DIR/require.js" "$DIST_DIR"
7375
cp "$SRC_DIR/cmd.ts" "$DIST_DIR"
7476
cp "$SRC_DIR/repl.html" "$DIST_DIR"
7577
cp "$SRC_DIR/sink.ts" "$DIST_DIR"

dist/repl.html

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,7 @@
22
<html lang="en">
33
<head>
44
<title>Sink REPL</title>
5-
<script>
6-
// provide a dummy `define` function, which is usually provided by RequireJS, but we only have one
7-
// file so who cares
8-
function define(deps, factory){
9-
window.sink = {};
10-
factory(null, window.sink);
11-
}
12-
define.amd = true;
13-
</script>
14-
<script src="sink.js"></script>
15-
<script>
16-
function define(deps, factory){
17-
window.sink_shell = {};
18-
factory(null, window.sink_shell);
19-
}
20-
define.amd = true;
21-
</script>
22-
<script src="sink_shell.js"></script>
5+
<script src="require.js"></script>
236
<style>
247
html, body {
258
padding: 0;
@@ -33,6 +16,7 @@
3316
<body>
3417
<canvas id="cnv" width="1" height="1" tabindex="0"></canvas>
3518
<script>
19+
requirejs(['sink', 'sink_shell'], function(sink, sink_shell){
3620

3721
var cnv = document.getElementById('cnv');
3822
var ctx = cnv.getContext('2d');
@@ -234,6 +218,8 @@
234218
redraw();
235219
}
236220
readLine();
221+
222+
}); // end requirejs
237223
</script>
238224
</body>
239225
</html>

dist/require.js

Lines changed: 5 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)