Skip to content

Commit a2764cf

Browse files
author
minjk-bl
committed
Edit build&dev control of jupyterlab extension
1 parent f4931c3 commit a2764cf

File tree

8 files changed

+42
-18
lines changed

8 files changed

+42
-18
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
dist/
1+
dist/
2+
jupyterlab/lib/visualpython

colab/build.colab.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#
1111

1212
# set visualpython version
13-
export VP_ORG_VER=2.2.12
14-
export VP_NEW_VER=2.2.13
13+
VP_ORG_VER=2.2.12
14+
VP_NEW_VER=2.2.13
1515

1616
# make directories to save build output
1717
mkdir -p ../dist/colab

jupyterlab/build.jupyterlab.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# Date : 2023. 02. 08
99
# Change Date :
1010
#
11-
export VP_ORG_VER=2.2.12
12-
export VP_NEW_VER=2.2.13
11+
VP_ORG_VER=2.2.12
12+
VP_NEW_VER=2.2.13
1313

1414
# on conda environment
1515
pip install build
@@ -19,15 +19,15 @@ cp ../LICENSE LICENSE
1919
cp ../README.md README.md
2020

2121
# update version info
22-
grep -REil ${VP_ORG_VER//\./\\.} setup.py visualpython/* | xargs sed -i --follow-symlinks "s/${VP_ORG_VER//\./\\.}/${VP_NEW_VER}/g"
22+
grep -REil "version = \"${VP_ORG_VER}\"" pyproject.toml | xargs sed -i "s/version = \"${VP_ORG_VER//\./\\.}\"/version = \"${VP_NEW_VER}\"/g"
23+
grep -REil ${VP_ORG_VER//\./\\.} visualpython/* | xargs sed -i --follow-symlinks "s/${VP_ORG_VER//\./\\.}/${VP_NEW_VER}/g"
2324

24-
mkdir -p ../dist/jupyterlab
25+
# Run dev-build script to build static files to ./visualpython/labextension
26+
# chmod 755 dev-build.jupyterlab.sh
27+
./dev-build.jupyterlab.sh
2528

26-
# run build as static files
27-
# npm install # install npm package dependencies
28-
# npm run build # optional build step if using TypeScript, babel, etc.
29-
# jupyter labextension install # install the current directory as an extension
30-
jlpm run build
29+
# make dist directory if not exist
30+
mkdir -p ../dist/jupyterlab
3131

3232
# build file to output dir
3333
python -m build --outdir ../dist/jupyterlab

jupyterlab/dev-build.jupyterlab.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# Project Name : Visual Python
3+
# Description : GUI-based Python code generator
4+
# File Name : dev-build.jupyterlab.sh
5+
# Author : Black Logic - Minju
6+
# Note : Dev-Build Visual Python for Jupyter Lab
7+
# License : GPLv3 (GNU General Public License v3.0)
8+
# Date : 2023. 02. 08
9+
# Change Date :
10+
#
11+
# cp current core source code
12+
rm -rf lib/visualpython
13+
cp -r ../visualpython lib/visualpython
14+
15+
# convert text-loader, raw-loader, css-loader
16+
grep -rl "vp_text_loader" lib/visualpython/js/* | xargs sed -i "s/vp_text_loader('\(.\+\)')\(.\+$\)/'!!text-loader!\1'\2/g"
17+
grep -rl "vp_raw_loader" lib/visualpython/js/* | xargs sed -i "s/vp_raw_loader('\(.\+\)')\(.\+$\)/'\1'\2/g"
18+
grep -rl "vp_css_loader" lib/visualpython/js/* | xargs sed -i "s/vp_css_loader('\(.\+\)')\(.\+$\)/'\1.css'\2/g"
19+
20+
# run build as static files
21+
# npm install # install npm package dependencies
22+
# npm run build # optional build step if using TypeScript, babel, etc.
23+
# jupyter labextension install # install the current directory as an extension
24+
jlpm run build

jupyterlab/lib/visualpython

Lines changed: 0 additions & 1 deletion
This file was deleted.

jupyterlab/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"email": "blacklogic.dev@gmail.com"
1818
},
1919
"files": [
20-
"lib/**/*.{d.ts,eot,gif,html,py,jpg,js,js.map,json,png,svg,woff2,ttf,otf}",
20+
"lib/**/*.{d.ts,css,eot,gif,html,py,jpg,js,js.map,json,png,svg,woff2,ttf,otf}",
2121
"style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf,otf}"
2222
],
2323
"main": "lib/index.js",

jupyternotebook/build.jupyternotebook.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
# Date : 2023. 02. 08
99
# Change Date :
1010
#
11-
export VP_ORG_VER=2.2.12
12-
export VP_NEW_VER=2.2.13
13-
export CH_DT=`date "+%Y.%m.%d"`
11+
VP_ORG_VER=2.2.12
12+
VP_NEW_VER=2.2.13
1413

1514
# update version info
1615
grep -REil ${VP_ORG_VER//\./\\.} setup.py visualpython/* | xargs sed -i --follow-symlinks "s/${VP_ORG_VER//\./\\.}/${VP_NEW_VER}/g"

visualpython/js/MainFrame.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,8 @@ define([
540540
that.boardFrame.hideLoadingBar();
541541
that.boardFrame.reloadBlockList();
542542
} else {
543-
require(loadMenuList, function() {
543+
let customRequire = eval('require');
544+
customRequire(loadMenuList, function() {
544545
let parentBlock = null;
545546
let prevBlock = null;
546547
loadStateList.forEach(obj => {

0 commit comments

Comments
 (0)