-
Notifications
You must be signed in to change notification settings - Fork 72
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-client): Switch from Webpack to Vite for bundling; Convert the codebase to TypeScript. #645
base: main
Are you sure you want to change the base?
Changes from 4 commits
bb3f508
ad34028
3444981
8b03576
4976d95
ff5da99
7ac39ee
d0c1443
a7998e1
d6a224b
2c6e393
b222fc6
c3b26e2
0a3de9e
a85679c
ca86be9
2767de1
c345e00
8a29872
e434b64
1116797
05a51e4
580b215
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 | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -224,10 +224,12 @@ tasks: | |||||||||||||||||||||||||||||||||
sources: | ||||||||||||||||||||||||||||||||||
- "{{.G_BUILD_DIR}}/log-viewer-webui-node-modules.md5" | ||||||||||||||||||||||||||||||||||
- "{{.TASKFILE}}" | ||||||||||||||||||||||||||||||||||
- "client/index.html" | ||||||||||||||||||||||||||||||||||
- "client/tsconfig.*.json" | ||||||||||||||||||||||||||||||||||
- "client/package.json" | ||||||||||||||||||||||||||||||||||
- "client/src/**/*.css" | ||||||||||||||||||||||||||||||||||
- "client/src/**/*.jsx" | ||||||||||||||||||||||||||||||||||
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. It looks like in the past the linter doesn't run on *.js file, and no it will run on all *.ts file (which I believe to be the replacement for *.js) This looks perfectly expected, but just want to double check. 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. Right, in the past it was a mistake not to include *.js files here. |
||||||||||||||||||||||||||||||||||
- "client/src/webpack.config.js" | ||||||||||||||||||||||||||||||||||
- "client/src/**/*.ts" | ||||||||||||||||||||||||||||||||||
- "client/src/**/*.tsx" | ||||||||||||||||||||||||||||||||||
- "yscope-log-viewer/package.json" | ||||||||||||||||||||||||||||||||||
- "yscope-log-viewer/public/**/*" | ||||||||||||||||||||||||||||||||||
- "yscope-log-viewer/src/**/*" | ||||||||||||||||||||||||||||||||||
|
@@ -245,13 +247,14 @@ tasks: | |||||||||||||||||||||||||||||||||
DATA_DIR: "{{.OUTPUT_DIR}}" | ||||||||||||||||||||||||||||||||||
cmds: | ||||||||||||||||||||||||||||||||||
- "rm -rf '{{.OUTPUT_DIR}}'" | ||||||||||||||||||||||||||||||||||
- for: | ||||||||||||||||||||||||||||||||||
- "client" | ||||||||||||||||||||||||||||||||||
- "yscope-log-viewer" | ||||||||||||||||||||||||||||||||||
cmd: |- | ||||||||||||||||||||||||||||||||||
cd "{{.ITEM}}" | ||||||||||||||||||||||||||||||||||
PATH="{{.G_NODEJS_22_BIN_DIR}}":$PATH npm run build -- \ | ||||||||||||||||||||||||||||||||||
--output-path "{{.OUTPUT_DIR}}/{{.ITEM}}" | ||||||||||||||||||||||||||||||||||
- |- | ||||||||||||||||||||||||||||||||||
cd "client" | ||||||||||||||||||||||||||||||||||
PATH="{{.G_NODEJS_22_BIN_DIR}}":$PATH npm run build -- \ | ||||||||||||||||||||||||||||||||||
--outDir "{{.OUTPUT_DIR}}/client" | ||||||||||||||||||||||||||||||||||
- |- | ||||||||||||||||||||||||||||||||||
cd "yscope-log-viewer" | ||||||||||||||||||||||||||||||||||
PATH="{{.G_NODEJS_22_BIN_DIR}}":$PATH npm run build -- \ | ||||||||||||||||||||||||||||||||||
--output-path "{{.OUTPUT_DIR}}/yscope-log-viewer" | ||||||||||||||||||||||||||||||||||
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. Fix indentation in build commands The build commands have inconsistent indentation which could cause YAML parsing issues. Apply this diff to fix the indentation: - |-
cd "client"
PATH="{{.G_NODEJS_22_BIN_DIR}}":$PATH npm run build -- \
- --outDir "{{.OUTPUT_DIR}}/client"
+ --outDir "{{.OUTPUT_DIR}}/client"
- |-
cd "yscope-log-viewer"
PATH="{{.G_NODEJS_22_BIN_DIR}}":$PATH npm run build -- \
- --output-path "{{.OUTPUT_DIR}}/yscope-log-viewer"
+ --output-path "{{.OUTPUT_DIR}}/yscope-log-viewer" 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||
- task: "utils:compute-checksum" | ||||||||||||||||||||||||||||||||||
vars: | ||||||||||||||||||||||||||||||||||
DATA_DIR: "{{.OUTPUT_DIR}}" | ||||||||||||||||||||||||||||||||||
|
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. You should format this file, so indented. In VSCode, I used there default formatter and fixed it. 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. This was already formatted with PyCharm's formatter, where they don't indent the first-level children in the In the future, we can also add Prettier / HTML-lint to Lint the html files 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. kk sounds good. Ignore |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<title>Log Viewer</title> | ||
<meta charset="utf-8"/> | ||
<meta name="description" content="YScope Log Viewer"> | ||
<meta name="viewport" content="initial-scale=1, maximum-scale=1"> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"/> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/> | ||
<link rel="stylesheet" | ||
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" | ||
/> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
</body> | ||
</html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<title>Log Viewer Web UI</title> | ||
<meta charset="utf-8"/> | ||
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. Added " Web UI" |
||
<meta name="description" content="YScope Log Viewer Web UI"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
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. Added " Web UI" |
||
<link rel="preconnect" href="https://fonts.googleapis.com"/> | ||
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. This is copied from the Vite |
||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/> | ||
<link rel="stylesheet" | ||
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" | ||
/> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
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. This is copied from the Vite |
||
</html> |
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.
this would skip tsconfig.json. is it expected?
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.
It was intended as the
tsconfig.json
file was only meant to point references to thetsconfig.app.json
andtsconfig.node.json
files, but now I think about it again, we should add the common options intotsconfig.json
so that we don't necessarily repeat in the other two files. Then we should be trackingclient/tsconfig*.json
instead.