Skip to content

Commit e213fed

Browse files
authored
v1.21.0 (#91)
* chore: add vite dep * chore: add @vitejs/plugin-react dep * chore: add vite config * chore: add vite config * chore: upgrade proxy-uri-parser * chore(vite): config proxy-uri-parser alias * Revert "chore(vite): config proxy-uri-parser alias" This reverts commit 8bfd0b3. * chore(vite): replace process.env * chore: update eslint config * chore: remove unused files * chore: enable vite * chore: remove webpack deps * chore: upgrade deps * chore: upgrade deps * refactor: update logo asset path * chore: add @rolldown/plugin-babel dep * perf: enable react compiler * chore: add babel-plugin-react-compiler dep * chore: upgrade deps * chore: v1.20.1-beat.0 * ci: update * chore: v1.20.1-beat.1 * ci: update * chore: v1.20.1-beat.2 * Revert "ci: update" This reverts commit 5a98991. * chore: v1.21.0-beat.3 * ci: upgrade actions * chore: v1.21.0-beat.4 * chore: v1.21.0
1 parent f645131 commit e213fed

14 files changed

Lines changed: 735 additions & 2561 deletions

.github/workflows/deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
build-and-deploy:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v6
1717
- name: Get yarn cache directory path
1818
id: yarn-cache-dir-path
1919
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
2020

21-
- uses: actions/cache@v4
21+
- uses: actions/cache@v5
2222
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
2323
with:
2424
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -27,14 +27,14 @@ jobs:
2727
${{ runner.os }}-yarn-
2828
2929
- name: Use Node.js
30-
uses: actions/setup-node@v5
30+
uses: actions/setup-node@v6
3131
with:
32-
node-version: 22
32+
node-version: 24
3333
- run: yarn install
3434
- run: yarn build
3535

3636

37-
- run: cp -r dist/ui ./dist-ui
37+
- run: cp -r dist ./dist-ui
3838
- run: tar -cvzf dist-ui.tar.gz dist-ui
3939
- run: sha256sum dist-ui.tar.gz > dist-ui.tar.gz.sha256
4040

build/webpack.ui.config.js

Lines changed: 0 additions & 126 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import globals from "globals";
1+
import { FlatCompat } from "@eslint/eslintrc";
22
import pluginJs from "@eslint/js";
3-
import tseslint from "typescript-eslint";
3+
import eslintConfigPrettier from "eslint-config-prettier";
44
import pluginReact from "eslint-plugin-react";
5-
import { FlatCompat } from "@eslint/eslintrc";
5+
import globals from "globals";
66
import path from "path";
7+
import tseslint from "typescript-eslint";
78
import { fileURLToPath } from "url";
8-
import eslintConfigPrettier from "eslint-config-prettier";
99

1010
// mimic CommonJS variables -- not needed if using CommonJS
1111
const __filename = fileURLToPath(import.meta.url);
@@ -27,4 +27,10 @@ export default [
2727
},
2828
...compat.extends("plugin:react-hooks/recommended"),
2929
eslintConfigPrettier,
30+
{
31+
rules: {
32+
"react/jsx-uses-react": "off",
33+
"react/react-in-jsx-scope": "off",
34+
},
35+
},
3036
];

index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<meta name="theme-color" content="#000000" />
7+
<meta name="description" content="Web site created using react" />
8+
<link rel="icon" href="/logo.svg" />
9+
<title>Lux</title>
10+
<script>
11+
const params = new URL(window.location.href).searchParams;
12+
if (params.get('theme')==='dark') {
13+
const htmlElement = document.querySelector('html');
14+
// background color of dark mode
15+
htmlElement.style.backgroundColor = '#292929';
16+
}
17+
</script>
18+
</head>
19+
<body>
20+
<noscript>You need to enable JavaScript to run this app.</noscript>
21+
<div id="app"></div>
22+
<script type="module" src="/src/index.tsx"></script>
23+
</body>
24+
</html>

package.json

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "lux",
3-
"version": "1.20.0",
3+
"version": "1.21.0",
44
"description": "A system network proxy tool",
55
"main": "src/index.js",
66
"scripts": {
77
"lint-fix": "eslint --ext .ts,.tsx --fix src",
8-
"dev": "webpack serve -c build/webpack.ui.config.js --env NODE_ENV=development --mode development --hot --open",
9-
"build": "webpack -c build/webpack.ui.config.js --env NODE_ENV=production --mode production"
8+
"dev": "vite dev --host 127.0.0.1",
9+
"build": "vite build"
1010
},
1111
"keywords": [],
1212
"author": "igoogolx",
@@ -17,13 +17,13 @@
1717
"@fortawesome/fontawesome-free": "^7.0.0",
1818
"@reduxjs/toolkit": "^2.9.0",
1919
"@tailwindcss/postcss": "^4.1.16",
20-
"axios": "^1.12.2",
20+
"axios": "^1.15.0",
2121
"classnames": "^2.5.1",
2222
"dayjs": "^1.11.13",
2323
"formik": "^2.4.6",
2424
"i18next": "^25.4.0",
2525
"isomorphic-ws": "^5.0.0",
26-
"proxy-uri-parser": "https://github.com/igoogolx/proxy-uri-parser.git#v0.2.0",
26+
"proxy-uri-parser": "https://github.com/igoogolx/proxy-uri-parser.git#v0.2.1",
2727
"qrcode": "^1.5.4",
2828
"react": "^19.2.0",
2929
"react-dom": "^19.2.0",
@@ -36,12 +36,13 @@
3636
"semver": "^7.7.2",
3737
"shadowsocksconfig": "github:Jigsaw-Code/outline-shadowsocksconfig",
3838
"ws": "^8.18.3",
39-
"yaml": "^2.8.1",
39+
"yaml": "^2.8.3",
4040
"yup": "^1.7.0"
4141
},
4242
"devDependencies": {
43-
"@eslint/eslintrc": "^3.3.1",
44-
"@eslint/js": "^9.34.0",
43+
"@eslint/eslintrc": "^3.3.5",
44+
"@eslint/js": "^10.0.1",
45+
"@rolldown/plugin-babel": "^0.2.3",
4546
"@tailwindcss/typography": "^0.5.15",
4647
"@types/node": "^24.3.0",
4748
"@types/qrcode": "^1.5.5",
@@ -50,30 +51,22 @@
5051
"@types/react-highlight-words": "^0.20.0",
5152
"@types/semver": "^7.7.0",
5253
"@types/ws": "^8.18.1",
53-
"copy-webpack-plugin": "^13.0.0",
54-
"css-loader": "^7.1.2",
55-
"dotenv-webpack": "^8.1.0",
56-
"eslint": "^9.34.0",
57-
"eslint-config-prettier": "^10.1.1",
54+
"@vitejs/plugin-react": "^6.0.1",
55+
"babel-plugin-react-compiler": "^1.0.0",
56+
"eslint": "^10.2.0",
57+
"eslint-config-prettier": "^10.1.8",
5858
"eslint-plugin-react": "^7.37.5",
5959
"eslint-plugin-react-hooks": "^7.0.1",
6060
"globals": "^16.0.0",
61-
"html-webpack-plugin": "^5.5.0",
62-
"mini-css-extract-plugin": "^2.9.2",
63-
"postcss": "^8.5.6",
64-
"postcss-loader": "^8.2.0",
61+
"postcss": "^8.5.15",
6562
"postcss-preset-env": "^10.1.2",
6663
"prettier": "^3.4.2",
6764
"prettier-plugin-organize-imports": "^4.1.0",
6865
"prettier-plugin-tailwindcss": "^0.6.9",
6966
"tailwindcss": "^4.1.16",
70-
"ts-loader": "^9.5.1",
71-
"typescript": "^5.9.2",
72-
"typescript-eslint": "^8.40.0",
67+
"typescript": "^6.0.2",
68+
"typescript-eslint": "^8.58.1",
7369
"typescript-plugin-css-modules": "^5.2.0",
74-
"webpack": "^5.101.3",
75-
"webpack-bundle-analyzer": "^4.10.2",
76-
"webpack-cli": "^6.0.1",
77-
"webpack-dev-server": "^5.2.2"
70+
"vite": "^8.0.8"
7871
}
7972
}

src/i18n/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function getLang(value?: string) {
2323
export async function initLanguage(language?: string) {
2424
return await i18n.use(initReactI18next).init({
2525
lng: getLang(language),
26-
debug: process.env.NODE_ENV === "development",
26+
debug: !import.meta.env.PROD,
2727
returnObjects: true,
2828
resources: {
2929
[LANGUAGE_ENUM.EN_US]: {

src/index.html

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
webLightTheme,
88
} from "@fluentui/react-components";
99
import { init } from "lux-js-sdk";
10-
import * as React from "react";
1110
import { StrictMode, useMemo, useState } from "react";
1211
import { createRoot } from "react-dom/client";
1312
import { Provider } from "react-redux";

src/utils/hubAddress.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ export function stringAddress(address: HubAddress): string {
2828
const HUB_ADDRESS_KEY = "hubAddress";
2929

3030
export function getHubAddress(): HubAddress {
31-
const isDev = process.env.NODE_ENV === "development";
32-
const hubAddress = (isDev ? process.env.HUB_ADDRESS : getCoreAddress()) ?? "";
31+
const isDev = !import.meta.env.PROD;
32+
const hubAddress =
33+
(isDev ? import.meta.env.HUB_ADDRESS : getCoreAddress()) ?? "";
3334

3435
try {
3536
return parseAddress(hubAddress);

tsconfig.app.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"compilerOptions": {
3+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4+
"target": "ES2023",
5+
"useDefineForClassFields": true,
6+
"lib": ["ES2023", "DOM", "DOM.Iterable"],
7+
"module": "ESNext",
8+
"types": ["vite/client"],
9+
"skipLibCheck": true,
10+
"resolveJsonModule": true,
11+
"allowSyntheticDefaultImports": true,
12+
"allowJs": true,
13+
14+
"paths": {
15+
"@/*": ["src/*"],
16+
"lux-js-sdk": ["modules/lux-js-sdk"]
17+
},
18+
"baseUrl": ".",
19+
20+
/* Bundler mode */
21+
"moduleResolution": "bundler",
22+
"allowImportingTsExtensions": true,
23+
"verbatimModuleSyntax": true,
24+
"moduleDetection": "force",
25+
"noEmit": true,
26+
"jsx": "react-jsx",
27+
"plugins": [{ "name": "typescript-plugin-css-modules" }],
28+
29+
/* Linting */
30+
"strict": true,
31+
"noUnusedLocals": true,
32+
"noUnusedParameters": true,
33+
"noFallthroughCasesInSwitch": true,
34+
"noUncheckedSideEffectImports": true
35+
},
36+
"include": ["src"]
37+
}

0 commit comments

Comments
 (0)