Commit 628deb8
authored
Deploy to void (#13)
* Migrate blog to Void (Vite + Cloudflare Workers + Vue 3)
Replace legacy Node.js build (build.js + mdit) with Void framework.
Blog markdown files become first-class page routes via @void-x/md.
Static assets moved to public/ for Void's static file serving.
- Add vite.config.ts with voidPlugin, voidVue, voidMarkdown
- Create pages/layout.vue (shared) and pages/blog/layout.vue (blog chrome + Disqus)
- Create pages/index.vue homepage with all curated content
- Move 111 blog .md files to pages/blog/
- Add middleware/html-compat.ts for .html → clean URL redirects
- Copy static assets (css, js, images, ppt, collections, etc.) to public/
- Remove scaffolded artifacts (migrations, routes/api, src/demo.ts)
- Update package.json deps, tsconfig.json, deploy.yml branch
* Replace GitHub ribbon with Deploy on V___ ribbon
- Update layout.vue: diagonal ribbon style replacing fork-me image
- Remove original blog/ directory (content moved to pages/blog/ and public/blog/)
- Remove root index.html (replaced by pages/index.vue)
- Remove shadow HTML files from public/blog/ that have .md page equivalents
* Fix deploy: move legacy files, fix SSR CSS and Disqus scripts
- Move legacy root-level directories to legacy.bak/ to reduce deploy
size and prevent Vite from bundling them into SSR
- Fix CSS causing worker deploy failure by moving @import to <link>
tags and using <component is="style"> for custom styles
- Fix Disqus comments not loading by using <component is="script">
instead of onMounted (no client hydration in SSR pages)
- Change image src to dynamic :src bindings to avoid Vite asset
processing
- Restore hangjs-family-photo2.jpg resized to 2000px (179KB vs 5.6MB)
* Fix ppt deck.js paths to use relative URLs
Replace absolute https://fengmk2.com:9443/ references with relative
paths so slides work on any domain.
* Return 404 for unknown paths and add sitemap generator
Remove middleware/html-compat.ts which unconditionally stripped .html
from any request path and issued a 301 without checking that the
resource existed. Crawlers hitting garbage concatenated paths like
/ppt/.../README.html were getting 301s that search engines then
cached. Without the middleware, real .html files in public/ still
serve 200 via env.ASSETS, and non-existent paths fall through to 404.
Add public/sitemap.xml + public/robots.txt so crawlers can discover
the canonical URL set instead of guessing. scripts/generate-sitemap.mjs
walks pages/blog/**/*.md and regenerates the sitemap; wired into
package.json as prebuild so every vite build refreshes it.
* Switch void packages to @void-sdk GitHub Packages aliases
Replace local file: paths with the official npm aliases documented in
the void-sdk/void README:
- void@npm:@void-sdk/void@^0.5.0
- @void/vue@npm:@void-sdk/vue@^0.4.0
- @void/md@npm:@void-sdk/md@^0.5.0
Rename imports in vite.config.ts from @void-x/* to @void/* and drop
the resolve.alias shim that mapped between the two scopes. Switch
packageManager to pnpm@10.33.0 per the README's recommended tooling
and add pnpm-lock.yaml.
* update deps
* Add PR staging deploy workflow, switch deploy to pnpm
Add .github/workflows/ci.yml adapted from voidzero-dev/setup.viteplus.dev:
- test job on every push to master and every PR (pnpm install + build)
- staging-deploy job on PRs only, deploys to VOID_PROJECT=fengmk2-staging
and posts/updates a sticky comment with the preview URL
Update .github/workflows/deploy.yml to use pnpm instead of npm ci,
matching the packageManager switch to pnpm@10.33.0. Production deploy
continues to read the projectId from .void/project.json.
Both workflows use the latest action versions: actions/checkout@v6,
actions/setup-node@v6, actions/github-script@v9, pnpm/action-setup@v5.
Installation auths against npm.pkg.github.com via NODE_AUTH_TOKEN so
@void-sdk/* packages resolve.
* ignore .void
* Switch CI/deploy workflows to voidzero-dev/setup-vp
Replace the pnpm/action-setup + actions/setup-node pair with the
official setup-vp action, matching the voidzero-dev/setup.viteplus.dev
reference. setup-vp handles Node install via 'vp env use',
auto-detects pnpm from the lockfile, and caches the pnpm store.
Replace 'pnpm build' with 'vp run build' and 'pnpm exec void deploy'
with 'vpx void deploy' so the workflow is package-manager-agnostic
and relies on Vite+'s own script runner.
Install auth against npm.pkg.github.com still flows through
NODE_AUTH_TOKEN; setup-vp's default run-install uses that env to pull
@void-sdk/* packages. Production and staging projects resolved
exactly as before.
* Migrate project to Vite+ (vp)
Run 'vp migrate --no-interactive' to adopt Vite+ as the unified
toolchain (runtime, package manager, dev/build, lint, format).
- vite.config.ts now imports from 'vite-plus'; drops the Vite-only
shape for Vite+'s defineConfig with 'staged', 'fmt', 'lint' blocks
- package.json scripts use 'vp dev / vp build / vp preview'; add
'prepare: vp config' for the pre-commit hook setup
- pnpm-workspace.yaml added with catalog routing 'vite' to
'@voidzero-dev/vite-plus-core' and 'vitest' to 'vite-plus-test';
peerDependencyRules relax matching so void plugins keep resolving
- env.d.ts adds the '*.vue' TypeScript shim
- AGENTS.md captures the Vite+ workflow for coding agents
- .vite-hooks/pre-commit wires staged-file checks via 'vp staged'
Follow-up tweaks on top of the auto-migration:
- Legacy content at the repo root (blog.bak, legacy.bak, MOVE,
movement.js, max_new_space_size, libuv, scattered *.md/*.js/*.html)
is added to 'fmt.ignorePatterns' and 'lint.ignorePatterns' in
vite.config.ts so 'vp check' only looks at the active source tree.
- Format-only touch-ups on CLAUDE.md, env.d.ts, tsconfig.json,
package.json, scripts/generate-sitemap.mjs, pages/*.vue,
pnpm-workspace.yaml, vite.config.ts, and .void/entry.ts produced
by 'vp fmt --write'.
- CI: add 'vp check' as a pipeline gate before 'vp run build'.
'vp build' skips npm lifecycle hooks, so both CI and deploy
workflows now run 'vp run sitemap' before 'vpx void deploy' to
keep public/sitemap.xml fresh on every deploy.
Verification:
- vp install: ok
- vp check: ok (18 files formatted, 5 files lint/typecheck clean)
- vp build: ok (162 modules, ~750ms)
- vp test: fails at config resolution because
'@cloudflare/vite-plugin' rejects the SSR environment's
'resolve.external' set by voidPlugin() when vitest loads the
config. No tests exist, so this is non-blocking; revisit when
tests are added (likely needs a vitest-scoped config variant).
* fmt
* Pin setup-vp to voidzero-dev/setup-vp#52
Use the commit SHA at the head of PR #52 ("fix: surface vp install
errors outside collapsed log group") so install failures on CI/deploy
show up outside the collapsed setup-vp log group. Revert to @v1 once
the PR merges.
* Bump setup-vp PR #52 pin to latest head
21f6c6e -> 697e70a (new commit pushed to fix/surface-vp-install-errors).
* Refactor setup-vp usage to PR #54 latest behavior
Bump setup-vp pin from e79fc32 to af4ffd9 (new head of PR #54) and
drop the repo .npmrc auth-line dance. The updated PR now auto-
generates _authToken entries at \$RUNNER_TEMP/.npmrc for every
registry declared in the repo .npmrc when NODE_AUTH_TOKEN is set,
so the committed .npmrc can stay as just the registry mapping.
Also update CLAUDE.md guidance to match the new pattern.
* Bump setup-vp PR #54 pin to latest head (af4ffd9 -> 42d342a)
* Pin setup-vp to the merged commit of PR #54
42d342a (PR branch head) -> 4f5aa3e (squash-merge on main). PR #54
is now merged into voidzero-dev/setup-vp main with title
"feat: respect project .npmrc and auto-generate _authToken".
* Use voidzero-dev/setup-vp@v1 floating tag
* Fixup
* Serve a real 404 page for unknown URLs
Void's default notFound handler renders the index component with status
404, so unknown URLs looked like the homepage. Add a catch-all
pages/[...slug] that renders a dedicated Not Found page, and a global
middleware that rewrites the response status to 404 because Void's
renderedResponse builds a fresh Response without honoring c.status() set
inside a loader.
* Give every page a <title>
Void only auto-derives a head title from YAML frontmatter (not from the
first H1), and Vue pages need an explicit head() export. Add titles for
the home page and the 404 page, and inject title: frontmatter into all
markdown blog posts that lacked it (derived from each post's first H1).
The new scripts/inject-md-titles.mjs is the one-off generator.
* Log user-agent and client IP on 404 hits
Helps spot scanners and broken inbound links from runtime logs. IP
prefers cf-connecting-ip on Cloudflare and falls back to forwarded
headers in other environments.1 parent 219266e commit 628deb8
1,903 files changed
Lines changed: 74466 additions & 12 deletions
File tree
- .claude
- skills
- .github/workflows
- .vite-hooks
- .void
- blog.bak
- 2009
- 0322
- 2010
- 03
- 04
- 0624
- 0822
- 0916
- 0921
- 0927
- 1023
- 10
- 1103
- 1119
- 1227
- 2011
- 03
- 10
- 16
- 17
- 25
- waitfor_callback_source
- public
- 26
- 30
- 04
- 10
- 11
- 23
- 27
- 9
- js-template-benchmarks
- lib
- ejs
- hamljs
- jade
- jqtpl
- jst
- 05
- 25
- 8
- 06
- 07
- 08
- 09
- 10
- 11
- 1214
- 1219
- 1230
- fibonacci
- hac-benchmark
- large_request
- 2012
- 0115
- 01
- 02
- 03
- 05
- 06
- foo_cov_utf8
- foo_cov
- foo
- 07
- mk2
- src
- 09
- 12
- helloworld
- 2013
- 02
- 03
- 05
- 2014
- 03
- 04
- 05
- 06
- 07
- 10
- iconv-lite
- 2015
- cluster-coverage
- coverage
- cluster-coverage
- lcov-report
- cluster-coverage
- test
- co-leak
- 2016
- redux-todo
- app
- components
- containers
- 2017
- 2025
- job-queue-on-postgres
- c
- icache
- lib
- legacy.bak
- adc2013
- js
- chinaMap
- bash
- bb
- pics
- benchmark
- cluster
- connect
- http_load-12mar2006
- crypto
- domain
- ejs
- protobuf
- collections
- css
- c
- d2/affine
- egg/benchmark
- hello
- passport
- view
- emoji
- flame-graph-on-nodejs
- git
- images
- mx-2013
- js
- deck.js
- core
- extensions
- goto
- hash
- scale
- status
- introduction
- test
- fixtures
- lib
- themes
- style
- transition
- lottery
- openwrt
- performance
- phantomjs
- ppt
- deck.js
- core
- extensions
- goto
- hash
- scale
- status
- introduction
- test
- fixtures
- lib
- themes
- style
- transition
- hangjs/images
- hujs2012
- mk2_2012_1212
- qcon2011
- netty-helloworld
- lib
- logs
- taobao-labs
- those-things-using-nodejs
- watermark
- wintercg
- middleware
- pages
- blog
- 2009/0322
- 2010
- 03
- 04
- 0624
- 0822
- 0916
- 0921
- 0927
- 1023
- 10
- 1103
- 1119
- 1227
- 2011
- 03
- 10
- 16
- 17
- 25
- 26
- 30
- 04
- 10
- 11
- 23
- 27
- 9
- js-template-benchmarks
- 05
- 25
- 06
- 07
- 08
- 10
- 11
- 1214
- 1219
- 1230
- fibonacci
- 2012
- 0115
- 01
- 02
- 03
- 05
- 06
- 07
- 09
- 12
- 2013
- 02
- 03
- 05
- 2014
- 03
- 06
- 07
- 10
- iconv-lite
- 2015
- cluster-coverage
- 2016
- 2017
- 2025
- job-queue-on-postgres
- 2026
- public
- benchmark
- cluster
- connect
- http_load-12mar2006
- crypto
- domain
- ejs
- protobuf
- blog
- 2009
- 0322
- 2010
- 03
- 04
- 0624
- 0822
- 0916
- 0921
- 0927
- 1023
- 10
- 1103
- 1119
- 1227
- 2011
- 03
- 10
- 16
- 17
- 25
- waitfor_callback_source
- public
- 26
- 30
- 04
- 10
- 11
- 23
- 27
- 9
- js-template-benchmarks
- lib
- ejs
- hamljs
- jade
- jqtpl
- jst
- 05
- 25
- 8
- 06
- 07
- 08
- 09
- 10
- 11
- 1214
- 1219
- 1230
- fibonacci
- hac-benchmark
- large_request
- 2012
- 0115
- 01
- 02
- 03
- 05
- 06
- foo_cov_utf8
- foo_cov
- foo
- 07
- mk2
- src
- 09
- 12
- helloworld
- 2013
- 02
- 03
- 05
- 2014
- 03
- 04
- 05
- 06
- 07
- 10
- iconv-lite
- 2015
- cluster-coverage
- coverage
- cluster-coverage
- lcov-report
- cluster-coverage
- test
- co-leak
- 2016
- redux-todo
- app
- components
- containers
- 2017
- 2025
- job-queue-on-postgres
- c
- icache
- lib
- collections
- css
- c
- egg/benchmark
- hello
- passport
- view
- emoji
- git
- images
- mx-2013
- js
- deck.js
- core
- extensions
- goto
- hash
- scale
- status
- introduction
- test
- fixtures
- lib
- themes
- style
- transition
- lottery
- performance
- ppt
- deck.js
- core
- extensions
- goto
- hash
- scale
- status
- introduction
- test
- fixtures
- lib
- themes
- style
- transition
- hangjs/images
- hujs2012
- mk2_2012_1212
- qcon2011
- netty-helloworld
- lib
- logs
- taobao-labs
- those-things-using-nodejs
- watermark
- rust/learning
- hello-path
- src
- hello-ref-cast
- src
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
0 commit comments