Skip to content

Deploy to void#13

Merged
fengmk2 merged 22 commits intomasterfrom
deploy-to-void
Apr 22, 2026
Merged

Deploy to void#13
fengmk2 merged 22 commits intomasterfrom
deploy-to-void

Conversation

@fengmk2
Copy link
Copy Markdown
Owner

@fengmk2 fengmk2 commented Apr 22, 2026

No description provided.

fengmk2 added 7 commits March 1, 2026 23:21
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
- 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
- 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)
Replace absolute https://fengmk2.com:9443/ references with relative
paths so slides work on any domain.
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.
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.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 22, 2026

Deploying fengmk2-github-com with  Cloudflare Pages  Cloudflare Pages

Latest commit: d676ce4
Status:🚫  Build failed.

View logs

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request initializes a project using the Void framework, adding various configuration files, type definitions, and a Cloudflare Workers entry point. Critical issues were identified: .void/entry.ts contains a hardcoded local file path for an import that will break builds in other environments, and .node-version specifies a non-existent Node.js version (24.14.0).

Comment thread .void/entry.ts Outdated
Comment thread .node-version
@@ -0,0 +1 @@
24.14.0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Node.js version 24.14.0 is not a valid or released version. This is likely a typo for a current version like 22.14.0 or 20.14.0. Using a non-existent version will cause environment setup tools to fail.

22.14.0

fengmk2 added 12 commits April 22, 2026 11:12
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.
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.
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).
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.
21f6c6e -> 697e70a (new commit pushed to fix/surface-vp-install-errors).
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.
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".
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

✅ Staging deployment successful!

Preview: https://fengmk2-staging.void.app/
Commit: 25b7964

fengmk2 added 3 commits April 22, 2026 21:40
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.
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.
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.
@fengmk2 fengmk2 marked this pull request as ready for review April 22, 2026 15:11
@fengmk2 fengmk2 merged commit 628deb8 into master Apr 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant