Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
"camelCase": false,
"snakeCase": false,
"pascalCase": true
},
"ignore": ["zh-Hans.ts"]
}
}
],
"unicorn/consistent-function-scoping": "off",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ To read the notebook interactively, you need Jupyter Lab with a TypeScript kerne

```sh
bun install
tslab install --user # register TS kernel
bun jupyter-bun install # register TS kernel
```

Then open `whitepaper.ipynb` in your viewer (Jupyter WebUI or VSCode), choose the TS kernel.
Expand Down
138 changes: 43 additions & 95 deletions bun.lock

Large diffs are not rendered by default.

Binary file added jupyter-bun.tgz
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
},
"devDependencies": {
"@types/bun": "^1.4.2",
"jupyter-bun": "./jupyter-bun.tgz",
"oxfmt": "^0.72.0",
"oxlint": "^1.87.0",
"oxlint-tsgolint": "^7.0.2004",
"tsdown": "^0.23.1",
"tslab": "^1.0.22"
"tsdown": "^0.23.1"
},
"packageManager": "bun@1.4.2"
}
21 changes: 6 additions & 15 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,25 @@ let
in
pkgs.mkShell {
buildInputs = with pkgs; [
nodejs-slim_latest
bun
python3
python314Packages.jupyterlab
];

shellHook = ''
export JUPYTER_DATA_DIR="$(pwd)/.jupyter/data"
export JUPYTER_CONFIG_DIR="$(pwd)/.jupyter/config"
export TSLAB_RUNTIME_DIR="$(pwd)/node_modules/.bin/tslab"
mkdir -p "$JUPYTER_DATA_DIR/kernels/tslab"
mkdir -p "$JUPYTER_DATA_DIR/kernels/jslab"
export JUPYTER_BUN_KERNEL="$(pwd)/node_modules/jupyter-bun/dist/index.js"
mkdir -p "$JUPYTER_DATA_DIR/kernels/typescript-bun"

cat > "$JUPYTER_DATA_DIR/kernels/tslab/kernel.json" <<EOF
cat > "$JUPYTER_DATA_DIR/kernels/typescript-bun/kernel.json" <<EOF
{
"argv": ["$TSLAB_RUNTIME_DIR", "kernel", "--config-path", "{connection_file}"],
"display_name": "TypeScript",
"argv": ["bun", "$JUPYTER_BUN_KERNEL", "{connection_file}"],
"display_name": "TypeScript (Bun)",
"language": "typescript"
}
EOF

cat > "$JUPYTER_DATA_DIR/kernels/jslab/kernel.json" <<EOF
{
"argv": ["$TSLAB_RUNTIME_DIR", "kernel", "--config-path", "{connection_file}", "--js"],
"display_name": "JavaScript",
"language": "javascript"
}
EOF

cat > "$JUPYTER_CONFIG_DIR/jupyter_server_config.py" << EOF
c.FileCheckpoints.checkpoint_dir = ".jupyter/checkpoints"
EOF
Expand Down