Skip to content
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!: Migrate from Webpack to Vite. #175

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
49ab69f
build: migrate from Webpack to Vite.
junhaoliao Feb 3, 2025
35aabf2
Add comment to explain why adding import/ignore to eslint settings.
junhaoliao Feb 3, 2025
b1a7f46
Add test folder to ESLint configuration.
junhaoliao Feb 3, 2025
44ddeb4
Add Jest config to TypeScript overrides in ESLint setup
junhaoliao Feb 3, 2025
98687b6
Add jest.config.ts to tsconfig.node.json include list
junhaoliao Feb 3, 2025
dcdc4b1
Refactor MainWorker imports to use renamed worker file
junhaoliao Feb 3, 2025
2d7b02a
Fix syntax for accessing environment variables
junhaoliao Feb 3, 2025
d5e189c
Refactor timestamp handling to use bigint type
junhaoliao Feb 3, 2025
221074d
Disable `noPropertyAccessFromIndexSignature` in tsconfig.
junhaoliao Feb 3, 2025
48aed37
Add `esModuleInterop` to `tsconfig.node.json` to improve module compa…
junhaoliao Feb 3, 2025
83c57c2
Update favicon path in index.html
junhaoliao Feb 3, 2025
a7269a8
Update viewport meta tag in index.html
junhaoliao Feb 3, 2025
ff935ad
Add back meta "keywords" in index.html
junhaoliao Feb 3, 2025
2097bbc
Update build doc for running the debug server.
junhaoliao Feb 12, 2025
7edd320
Merge remote-tracking branch 'yscope/main' into vite
junhaoliao Feb 12, 2025
cb37747
Refactor Monaco imports and remove obsolete Rollup externals.
junhaoliao Feb 12, 2025
9124e3d
Optimize build by splitting monaco-editor into a separate chunk.
junhaoliao Feb 12, 2025
da2ecd7
Set relative base path in Vite configuration.
junhaoliao Feb 12, 2025
a46a36b
Enable sourcemaps.
junhaoliao Feb 12, 2025
95df1e0
Add "type": "module" to package.json.
junhaoliao Feb 12, 2025
139d161
Remove standalone README for MonacoInstance and add bootstrap import.
junhaoliao Feb 14, 2025
c8184c8
Disable and re-enable ESLint rule for maximum line length.
junhaoliao Feb 14, 2025
4e7c916
Reorder.
junhaoliao Feb 14, 2025
bb7a380
Set assetsDir to empty string in Vite config.
junhaoliao Feb 14, 2025
1bae57d
Update Vite to version 6.1.0.
junhaoliao Feb 14, 2025
cd5c0bf
Add comment to explain purpose of the new bootstrap.ts.
junhaoliao Feb 14, 2025
ce20db7
Remove monaco bootstrap import in main.tsx.
junhaoliao Feb 14, 2025
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
2 changes: 1 addition & 1 deletion docs/src/dev-guide/building-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ variable `NODE_ENV=production` is set.
You can build and serve the viewer in debug mode using:

```shell
npm start
npm dev
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to follow conventions in the Vite templates.

```

The viewer should then be available at [http://localhost:3010](http://localhost:3010).
Expand Down
32 changes: 23 additions & 9 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import CommonConfig from "eslint-config-yscope/CommonConfig.mjs";
import JestConfig from "eslint-config-yscope/JestConfig.mjs";
import ReactConfigArray from "eslint-config-yscope/ReactConfigArray.mjs";
import StylisticConfigArray from "eslint-config-yscope/StylisticConfigArray.mjs";
import TsConfigArray from "eslint-config-yscope/TsConfigArray.mjs";
import Globals from "globals";
import TsConfigArray, {createTsConfigOverride} from "eslint-config-yscope/TsConfigArray.mjs";


const EslintConfig = [
Expand All @@ -14,7 +13,24 @@ const EslintConfig = [
],
},
CommonConfig,

...TsConfigArray,
createTsConfigOverride(
[
"src/**/*.ts",
"src/**/*.tsx",
"test/**/*.ts",
],
"tsconfig.app.json"
),
createTsConfigOverride(
[
"jest.config.ts",
"vite.config.ts",
],
"tsconfig.node.json"
),

...StylisticConfigArray,
...ReactConfigArray,
{
Expand All @@ -41,13 +57,11 @@ const EslintConfig = [
},
],
},
},
{
files: ["webpack.*.js"],
languageOptions: {
globals: {
...Globals.node,
},
settings: {
// Rule "import/default" complains on Vite's Web Worker import directives.
"import/ignore": [
"\\.worker",
],
},
},
{
Expand Down
8 changes: 5 additions & 3 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<title>Log Viewer</title>
<meta charset="utf-8">
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="description" content="YScope Log Viewer">
<meta name="keywords"
content="yscope clp debug debugging large log logs s3 scanner viewer vscode">
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, width=device-width" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" crossorigin href="https://fonts.gstatic.com">
<link rel="stylesheet"
Expand All @@ -16,5 +17,6 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os from "node:os";
import pathPosix from "node:path/posix";
import * as os from "node:os";
import * as pathPosix from "node:path/posix";

import type {Config} from "jest";

Expand Down
Loading