Skip to content

Commit 3cf5b0e

Browse files
committed
feat: integrate docsifyKrokiPlugin and update DOM environment initialization
- Added the docsifyKrokiPlugin to the global $docsify plugins. - Replaced the happy-dom Window implementation with a DOMParser from deno-dom for better HTML parsing in the test environment. - Updated the init function to create a sample HTML document for testing. - Ensured the test setup is consistent by adding a beforeEach hook in the compress-stream tests. Signed-off-by: zuisong <com.me@foxmail.com>
1 parent edc2dc0 commit 3cf5b0e

File tree

8 files changed

+162
-136
lines changed

8 files changed

+162
-136
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "deno-devcontainer",
3-
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
3+
"image": "mcr.microsoft.com/devcontainers/base:alpine",
44
"features": {
5-
"ghcr.io/devcontainers-contrib/features/deno:1": {},
6-
"ghcr.io/meaningful-ooo/devcontainer-features/fish:1": {}
5+
"ghcr.io/devcontainers-community/features/deno:1": {},
6+
"ghcr.io/meaningful-ooo/devcontainer-features/fish:2": {}
77
},
88
"customizations": {
99
"vscode": {

biome.jsonc

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,57 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json",
3-
"organizeImports": {
4-
"enabled": true
2+
"$schema": "https://biomejs.dev/schemas/2.3.6/schema.json",
3+
"assist": {
4+
"actions": {
5+
"source": {
6+
"organizeImports": "on"
7+
}
8+
}
59
},
610
"linter": {
711
"enabled": false,
812
"rules": {
913
"recommended": true,
1014
"complexity": {
1115
"noForEach": "off"
16+
},
17+
"style": {
18+
"noParameterAssign": "error",
19+
"useAsConstAssertion": "error",
20+
"useDefaultParameterLast": "error",
21+
"useEnumInitializers": "error",
22+
"useSelfClosingElements": "error",
23+
"useSingleVarDeclarator": "error",
24+
"noUnusedTemplateLiteral": "error",
25+
"useNumberNamespace": "error",
26+
"noInferrableTypes": "error",
27+
"noUselessElse": "error"
1228
}
1329
}
1430
},
31+
"json": {
32+
"linter": {
33+
"enabled": true
34+
},
35+
"assist": {
36+
"enabled": true
37+
},
38+
"formatter": {
39+
"enabled": true,
40+
"indentWidth": 2,
41+
"indentStyle": "space",
42+
"trailingCommas": "none"
43+
},
44+
"parser": {
45+
"allowComments": true,
46+
"allowTrailingCommas": true
47+
}
48+
},
1549
"formatter": {
1650
"enabled": true,
1751
"indentWidth": 2,
1852
"indentStyle": "space"
1953
},
2054
"files": {
21-
"ignore": ["dist/", "coverage/"]
55+
"includes": ["**", "!dist/**", "!coverage"]
2256
}
2357
}

build.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
import * as esbuild from "npm:esbuild@0.25.5";
2-
import { denoPlugins } from "jsr:@luca/esbuild-deno-loader@^0.11";
3-
import { emptyDir } from "jsr:@std/fs/empty-dir";
4-
import { resolve, toFileUrl } from "jsr:@std/path";
1+
import { denoPlugin } from "jsr:@deno/esbuild-plugin@1.2.0";
2+
import { emptyDir } from "jsr:@std/fs@1";
3+
import * as esbuild from "npm:esbuild@0.25.8";
54
import packageJson from "./package.json" with { type: "json" };
65

76
await emptyDir("./dist");
87

9-
const result = await esbuild.build<esbuild.BuildOptions>({
10-
plugins: [
11-
...denoPlugins({
12-
loader: "portable",
13-
importMapURL: toFileUrl(resolve("./deno.jsonc")).toString(),
14-
}),
15-
],
8+
const _result = await esbuild.build<esbuild.BuildOptions>({
9+
plugins: [denoPlugin()],
1610
platform: "browser",
1711
entryPoints: { "docsify-kroki": "./src/index.ts" },
1812
outdir: "./dist/",

0 commit comments

Comments
 (0)