-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(log-viewer-webui): Migrate server codebase to TypeScript and update dependencies. #647
base: main
Are you sure you want to change the base?
Changes from 4 commits
89dfb45
1f50cb1
85e6ff2
13192bd
58a434c
a11b15b
ef0aca7
49f7115
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,7 +84,7 @@ tasks: | |
CHECKSUM_FILE: "{{.G_BUILD_DIR}}/{{.TASK}}.md5" | ||
OUTPUT_DIR: "{{.G_PACKAGE_BUILD_DIR}}" | ||
sources: | ||
- "{{.G_BUILD_DIR}}/log-viewer-webui-clients.md5" | ||
- "{{.G_BUILD_DIR}}/log-viewer-webui.md5" | ||
- "{{.G_BUILD_DIR}}/package-venv.md5" | ||
- "{{.G_BUILD_DIR}}/webui.md5" | ||
- "{{.G_BUILD_DIR}}/webui-nodejs.md5" | ||
|
@@ -93,10 +93,6 @@ tasks: | |
- "{{.G_CORE_COMPONENT_BUILD_DIR}}/clp" | ||
- "{{.G_CORE_COMPONENT_BUILD_DIR}}/clp-s" | ||
- "{{.G_CORE_COMPONENT_BUILD_DIR}}/reducer-server" | ||
- "{{.G_LOG_VIEWER_WEBUI_SRC_DIR}}/server/package.json" | ||
- "{{.G_LOG_VIEWER_WEBUI_SRC_DIR}}/server/package-lock.json" | ||
- "{{.G_LOG_VIEWER_WEBUI_SRC_DIR}}/server/settings.json" | ||
- "{{.G_LOG_VIEWER_WEBUI_SRC_DIR}}/server/src/**/*.js" | ||
- "{{.TASKFILE}}" | ||
- "/etc/os-release" | ||
- "components/clp-package-utils/dist/*.whl" | ||
|
@@ -110,7 +106,7 @@ tasks: | |
- "clp-py-utils" | ||
- "init" | ||
- "job-orchestration" | ||
- "log-viewer-webui-clients" | ||
- "log-viewer-webui" | ||
- "nodejs-14" | ||
- "package-venv" | ||
- task: "utils:validate-checksum" | ||
|
@@ -159,16 +155,10 @@ tasks: | |
PATH="{{.G_NODEJS_14_BIN_DIR}}":$PATH npm install | ||
- >- | ||
rsync -a | ||
"{{.G_LOG_VIEWER_WEBUI_BUILD_DIR}}/client" | ||
"{{.G_LOG_VIEWER_WEBUI_BUILD_DIR}}/yscope-log-viewer" | ||
"{{.OUTPUT_DIR}}/var/www/log_viewer_webui/" | ||
"{{.G_LOG_VIEWER_WEBUI_BUILD_DIR}}/" | ||
"{{.OUTPUT_DIR}}/var/www/log-viewer-webui" | ||
- |- | ||
cd components/log-viewer-webui/server/ | ||
rsync -a \ | ||
package.json package-lock.json settings.json src \ | ||
"{{.OUTPUT_DIR}}/var/www/log_viewer_webui/server/" | ||
- |- | ||
cd "{{.OUTPUT_DIR}}/var/www/log_viewer_webui/server" | ||
cd "{{.OUTPUT_DIR}}/var/www/log-viewer-webui/server" | ||
PATH="{{.G_NODEJS_22_BIN_DIR}}":$PATH npm clean-install | ||
# This command must be last | ||
- task: "utils:compute-checksum" | ||
|
@@ -217,7 +207,7 @@ tasks: | |
vars: | ||
COMPONENT: "{{.TASK}}" | ||
|
||
log-viewer-webui-clients: | ||
log-viewer-webui: | ||
vars: | ||
CHECKSUM_FILE: "{{.G_BUILD_DIR}}/{{.TASK}}.md5" | ||
OUTPUT_DIR: "{{.G_LOG_VIEWER_WEBUI_BUILD_DIR}}" | ||
|
@@ -228,6 +218,11 @@ tasks: | |
- "client/src/**/*.css" | ||
- "client/src/**/*.jsx" | ||
- "client/src/webpack.config.js" | ||
- "server/package.json" | ||
- "server/package-lock.json" | ||
- "server/settings.json" | ||
- "server/src/**/*.ts" | ||
- "server/tsconfig.json" | ||
- "yscope-log-viewer/package.json" | ||
- "yscope-log-viewer/public/**/*" | ||
- "yscope-log-viewer/src/**/*" | ||
|
@@ -245,6 +240,14 @@ tasks: | |
DATA_DIR: "{{.OUTPUT_DIR}}" | ||
cmds: | ||
- "rm -rf '{{.OUTPUT_DIR}}'" | ||
- "mkdir -p '{{.OUTPUT_DIR}}'" | ||
- |- | ||
cd "server" | ||
rsync -a \ | ||
package.json package-lock.json \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. stupid question, don't we need to sync "src" as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not at all. How TypeScript compilation works is that the compiler performs type-checking then transpiles the TypeScript code into JavaScript code. After we run |
||
"{{.OUTPUT_DIR}}/server/" | ||
PATH="{{.G_NODEJS_22_BIN_DIR}}":$PATH npm run build -- \ | ||
--outDir "{{.OUTPUT_DIR}}/server/dist" | ||
- for: | ||
- "client" | ||
- "yscope-log-viewer" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -903,10 +903,10 @@ def start_log_viewer_webui( | |
if container_exists(container_name): | ||
return | ||
|
||
container_log_viewer_webui_dir = CONTAINER_CLP_HOME / "var" / "www" / "log_viewer_webui" | ||
container_log_viewer_webui_dir = CONTAINER_CLP_HOME / "var" / "www" / "log-viewer-webui" | ||
node_path = str(container_log_viewer_webui_dir / "server" / "node_modules") | ||
settings_json_path = ( | ||
get_clp_home() / "var" / "www" / "log_viewer_webui" / "server" / "settings.json" | ||
get_clp_home() / "var" / "www" / "log-viewer-webui" / "server" / "dist" / "settings.json" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
) | ||
|
||
validate_log_viewer_webui_config(clp_config, settings_json_path) | ||
|
@@ -959,7 +959,7 @@ def start_log_viewer_webui( | |
|
||
node_cmd = [ | ||
str(CONTAINER_CLP_HOME / "bin" / "node-22"), | ||
str(container_log_viewer_webui_dir / "server" / "src" / "main.js"), | ||
str(container_log_viewer_webui_dir / "server" / "dist" / "src" / "main.js"), | ||
] | ||
cmd = container_cmd + node_cmd | ||
subprocess.run(cmd, stdout=subprocess.DEVNULL, check=True) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
log_viewer_webui
is renamed aslog-viewer-webui
here.