From 15b415ff2ef9681cb21f532b909ca04fdccd08b8 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Tue, 21 Jul 2026 16:23:08 +0800 Subject: [PATCH] docs(encrypt): update Go implementation status to Available Also fix shell command injection in bench.ts and simplify build script. --- layouts/_partials/init/index.html | 2 +- package.json | 2 +- packages/encrypt/README.md | 14 ++++++++------ packages/encrypt/src/test/bench.ts | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/layouts/_partials/init/index.html b/layouts/_partials/init/index.html index 9c770578..30786c19 100644 --- a/layouts/_partials/init/index.html +++ b/layouts/_partials/init/index.html @@ -1,4 +1,4 @@ -{{- hugo.Store.Set "version" "v1.0.0-mrti3b6h" -}} +{{- hugo.Store.Set "version" "v1.0.0-mrudz3q9" -}} {{- .Store.Set "this" dict -}} {{- partial "init/detection-env.html" . -}} diff --git a/package.json b/package.json index 17ac736e..b576d14f 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "dev:docs": "hugo server --source=../fixit-docs -D --disableFastRender --navigateToChanged --ignoreCache -O", "build:demo": "pnpm -F demo build", "build:test": "pnpm -F test build", - "build": "concurrently 'pnpm build:demo' 'pnpm build:test' && pnpm -F integration start && pnpm encrypt && pnpm encrypt --verify", + "build": "concurrently 'pnpm build:demo' 'pnpm build:test' && pnpm -F integration start && pnpm encrypt", "encrypt": "pnpm -F encrypt start", "clean": "rm -rf public resources/_gen apps/*/public apps/*/resources/_gen", "preview": "serve public", diff --git a/packages/encrypt/README.md b/packages/encrypt/README.md index d00d3afc..b0295c10 100644 --- a/packages/encrypt/README.md +++ b/packages/encrypt/README.md @@ -99,12 +99,14 @@ The per-template cost is constant regardless of file count or content size, as P The current implementation is in **Node.js (TypeScript)**. For environments where Node.js performance is a bottleneck, community-maintained implementations in other languages are welcome: -| Language | Status | Repository | -| -------- | --------- | ---------------- | -| Node.js | Available | hugo-fixit/FixIt | -| Python | Planned | — | -| Go | Planned | — | -| Rust | Planned | — | +| Language | Status | Repository | +| -------- | --------- | ------------------ | +| Node.js | Available | hugo-fixit/FixIt | +| Go | Available | [fixit-encrypt.go] | +| Python | Planned | — | +| Rust | Planned | — | + +[fixit-encrypt.go]: https://github.com/hugo-fixit/fixit-encrypt.go If you have implemented `fixit-encrypt` in another language, please open a PR to add it to this list. diff --git a/packages/encrypt/src/test/bench.ts b/packages/encrypt/src/test/bench.ts index 72d135c6..ac0f5fcf 100644 --- a/packages/encrypt/src/test/bench.ts +++ b/packages/encrypt/src/test/bench.ts @@ -1,4 +1,4 @@ -import { execSync } from 'node:child_process' +import { execFileSync, execSync } from 'node:child_process' import { writeFileSync } from 'node:fs' import { dirname } from 'node:path' import { performance } from 'node:perf_hooks' @@ -35,7 +35,7 @@ function setup(fileCount: number, templatesPerFile: number, templateSize: string function run(): number { const start = performance.now() - execSync(`npx tsx ${__dirname}/../index.ts --input ${BENCH_DIR}`, { + execFileSync('npx', ['tsx', `${__dirname}/../index.ts`, '--input', BENCH_DIR], { encoding: 'utf8', cwd: __dirname, })