-
-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathdev-build.jupyterlab.sh
More file actions
executable file
·59 lines (53 loc) · 2.78 KB
/
Copy pathdev-build.jupyterlab.sh
File metadata and controls
executable file
·59 lines (53 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
# Project Name : Visual Python
# Description : GUI-based Python code generator
# File Name : dev-build.jupyterlab.sh
# Author : Black Logic - Minju
# Note : Dev-Build Visual Python for Jupyter Lab
# License : GPLv3 (GNU General Public License v3.0)
# Date : 2023. 02. 08
# Change Date :
#
#=============================================================================
# Replace Source Code and Loader pattern
#=============================================================================
# cp current core source code
rm -rf lib/visualpython
cp -r ../visualpython lib/visualpython
# convert text-loader, raw-loader, css-loader
# __VP_TEXT_LOADER__('vp/path/textfile'), -> '!!text-loader!vp/path/textfile',
# __VP_RAW_LOADER('vp/path/rawfile.json'), -> 'vp/path/rawfile.json',
# __VP_CSS_LOADER('vp/path/cssfile'), -> 'vp/path/cssfile.css',
grep -rl "__VP_TEXT_LOADER__" lib/visualpython/js/* | xargs sed -i "s/__VP_TEXT_LOADER__('\(.\+\)')\(.\+$\)/'\!\!text-loader\!\1'\2/g"
grep -rl "__VP_RAW_LOADER__" lib/visualpython/js/* | xargs sed -i "s/__VP_RAW_LOADER__('\(.\+\)')\(.\+$\)/'\1'\2/g"
grep -rl "__VP_CSS_LOADER__" lib/visualpython/js/* | xargs sed -i "s/__VP_CSS_LOADER__('\(.\+\)')\(.\+$\)/'\1.css'\2/g"
#=============================================================================
# Build as development version (output dir to ./visualpython/labextension)
# Requirements:
# - nodejs, npm, jupyterlab (conda or jupyter)
# ----------------------------------------------------------------------------
# * Install nodejs, npm for linux(ubuntu)
# sudo apt update
# sudo apt install nodejs
# sudo apt install npm # need npm/nodejs to build extension
# ----------------------------------------------------------------------------
# * Install nodejs, npm for WSL2
# sudo apt-get install curl
# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash # install nvm
# nvm install 16.15.1 # install node 16.15.1
# nvm ls # show version
## solution for [node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28` not found error]
# nvm use 16 # use 16 version
#=============================================================================
# python -m pip install jupyterlab
# npm install # install npm package dependencies
# npm run build # optional build step if using TypeScript, babel, etc.
# jupyter labextension install # install the current directory as an extension
# Run Build for jupyterlab extension
jlpm run build
# Run Build for jupyterlite
# jupyter lite build
# Run jupyterlite server
# jupyter lite serve # init + build + serve
# If something went wrong, remove _output/extensions folder and run command below
# jupyter lite init