Skip to content

Commit 808e06a

Browse files
committed
feat: semi
1 parent a587609 commit 808e06a

134 files changed

Lines changed: 330 additions & 341 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"indexeddb",
3131
"Kanban",
3232
"knip",
33+
"Markline",
3334
"MKCOL",
3435
"newtab",
3536
"otpauth",

examples/gist/mock-server.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { randomUUID } from "crypto"
2-
import { createServer, type IncomingMessage, type ServerResponse } from "http"
1+
import { randomUUID } from "node:crypto"
2+
import { createServer, type IncomingMessage, type ServerResponse } from "node:http"
33

44
type GistFormFile = {
55
filename: string
@@ -146,7 +146,8 @@ class Handler {
146146
constructor(req: IncomingMessage, res: ServerResponse) {
147147
this.req = req
148148
this.res = res
149-
this.origin = `http://${req.headers.host ?? `localhost:${PORT}`}`
149+
const host = req.headers.host ?? `localhost:${PORT}`
150+
this.origin = `http://${host}`
150151
this.url = new URL(req.url ?? "/", this.origin)
151152
}
152153

@@ -162,7 +163,7 @@ class Handler {
162163
if (method === "GET" && pathname === "/gists") return this.listGists()
163164
if (method === "POST" && pathname === "/gists") return this.createGist()
164165

165-
const gistMatch = pathname.match(/^\/gists\/([^/]+)$/)
166+
const gistMatch = new RegExp(/^\/gists\/([^/]+)$/).exec(pathname)
166167
if (gistMatch?.[1]) {
167168
const gistId = gistMatch[1]
168169
if (method === "GET") return this.getGist(gistId)
@@ -171,7 +172,7 @@ class Handler {
171172
if (method === "DELETE") return this.deleteGist(gistId)
172173
}
173174

174-
const rawMatch = pathname.match(/^\/raw\/([^/]+)\/(.+)$/)
175+
const rawMatch = new RegExp(/^\/raw\/([^/]+)\/(.+)$/).exec(pathname)
175176
if (method === "GET" && rawMatch?.[1] && rawMatch?.[2]) {
176177
const gistId = rawMatch[1]
177178
const filename = decodeURIComponent(rawMatch[2])

examples/host/home/index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
3+
4+
<head>
5+
<title>Home test</title>
6+
</head>
37

48
<body>
59
<div>Time Tracker test page — home</div>
610
</body>
711

8-
</html>
12+
</html>

examples/host/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
3+
4+
<head>
5+
<title>TT4b-Test-Page</title>
6+
</head>
37

48
<body>
59
<div>Time Tracker test page</div>

examples/notification/demo-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import hash from "hash.js"
2-
import { createServer } from "http"
2+
import { createServer } from "node:http"
33

44
const AUTH: string | undefined = process.env.AUTH
55

rspack/constant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { join } from "path"
1+
import { join } from "node:path"
22

33
export const E2E_OUTPUT_PATH = join(__dirname, '..', 'dist_e2e')

rspack/plugins/file-manager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Compiler, RspackPluginInstance } from '@rspack/core'
2-
import fs from 'fs'
32
import JSZip from 'jszip'
4-
import path from 'path'
3+
import fs from 'node:fs'
4+
import path from 'node:path'
55

66
type PosOpt = {
77
source: string
@@ -25,7 +25,7 @@ interface FileManagerOptions {
2525

2626
export class FileManagerPlugin implements RspackPluginInstance {
2727
private static readonly NAME = 'FileManagerPlugin'
28-
private options: FileManagerOptions
28+
private readonly options: FileManagerOptions
2929
private outputPath: string
3030

3131
constructor(options: FileManagerOptions) {
@@ -142,7 +142,7 @@ export class FileManagerPlugin implements RspackPluginInstance {
142142
private resolvePath(target: string) {
143143
return path.resolve(
144144
this.options.context!,
145-
target.replace(/\$\{outputPath\}/g, this.outputPath)
145+
target.replaceAll('${outputPath}', this.outputPath)
146146
)
147147
}
148148
}

rspack/plugins/generate-json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Compilation, type Compiler, type RspackPluginInstance, sources } from '
33
export class GenerateJsonPlugin implements RspackPluginInstance {
44
private static readonly NAME = 'GenerateJsonPlugin'
55

6-
constructor(private outputPath: string, private data: unknown) {
6+
constructor(private readonly outputPath: string, private readonly data: unknown) {
77
if (!data || typeof data !== 'object') {
88
throw new Error('Invalid data option')
99
}

rspack/plugins/import-checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function moduleFilesystemPath(mod: Module): string | undefined {
7676
}
7777

7878
function normalizePath(p: string): string {
79-
return p.replace(/\\/g, '/')
79+
return p.replaceAll('\\', '/')
8080
}
8181

8282
export function isBgPath(path: string): boolean {

rspack/rspack.common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {
22
CopyRspackPlugin, CssExtractRspackPlugin, DefinePlugin, HtmlRspackPlugin,
33
type Chunk, type Configuration, type Module, type RspackPluginInstance, type RuleSetRule
44
} from "@rspack/core"
5-
import { default as VueBabelPluginJsx } from "@vue/babel-plugin-jsx"
6-
import path, { join } from "path"
5+
import VueBabelPluginJsx from "@vue/babel-plugin-jsx"
6+
import path, { join } from "node:path"
77
import postcssRTLCSS from 'postcss-rtlcss'
88
import { TsCheckerRspackPlugin } from "ts-checker-rspack-plugin"
99
import ElementPlus from 'unplugin-element-plus/rspack'

0 commit comments

Comments
 (0)