Skip to content

feat(simply-static): add static site export and publishing plugin - #44

Open
lizheming wants to merge 1 commit into
mainfrom
codex/simply-static
Open

lizheming wants to merge 1 commit into
mainfrom
codex/simply-static

Conversation

@lizheming

Copy link
Copy Markdown
Contributor

Summary

Firekylin can now generate and publish a static snapshot through a standalone plugin, without core changes. Admin requests enqueue durable jobs; a separate worker handles crawling, ZIP creation and publication so long exports do not depend on an HTTP request staying open.

  • Export anonymous rendered HTML and linked theme assets, feeds, sitemap and explicitly seeded routes; rewrite absolute/relative URLs and support Unicode filenames, robots references and an optional 404 page.
  • Add full exports, ETag reuse, checkpoint recovery, single-page baseline updates, scheduling, request logs and cancellation.
  • Include static search, external POST form mappings, Waline comment integration, minification and optional image optimization.
  • Publish to managed local directories, Git/GitHub, Netlify, Cloudflare Pages, S3-compatible storage, Bunny Storage or SFTP. Keep provider credentials in the worker environment.
  • Document the Simply Static feature mapping and deployment-specific behavior.

Validation

  • Repository pnpm test with FIREKYLIN_CORE_PATH and STATIC_LIVE_TEST=1: 564 tests passed, including all 52 new plugin tests.
  • Real isolated SQLite Firekylin/default-theme export verifies that private, draft, future and password-protected content stays out of generated artifacts.
  • Real HTTP/CLI worker tests, real local publication and a local bare Git remote; search UI executes in jsdom.
  • Package tarball generated and installed independently; packaged CLI export smoke test.
  • git diff --check passed.

Operational boundaries

Admin jobs require a shared persistent filesystem and a separate worker. Single-page updates reuse unrelated HTML; global theme, navigation or visibility changes require full generation. Remote adapters use mocked API/process tests, not real hosting accounts. S3/Bunny sync is non-atomic; SFTP uses a staged two-rename switch. JavaScript-dependent runtime APIs still need external services. No npm release or production deployment is included.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T19:20:53.347866Z adf6804 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: adf6804b37

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +158 to +161
} else if (record.css) {
body = Buffer.from(transformCss(body.toString('utf8'), rewrite));
}
body = await optimize(body, record.contentType, config.minify);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update integrity hashes when modifying exported assets

When a source page uses integrity on a stylesheet, CSS URL rewriting changes the stylesheet bytes while transformHtml preserves the original integrity attribute. Enabling minify can cause the same mismatch for scripts. Browsers consequently reject these exported resources, breaking styling or functionality even though the export completes successfully. Recompute integrity metadata from the final exported bytes, or preserve the original bytes for integrity-protected resources.

Useful? React with 👍 / 👎.

} catch {
return value;
}
if (!policy.allowed(resolved, asset)) return value;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve resolved URLs for references outside the export scope

For a page containing <base href="https://cdn.example.com/"> and a relative asset such as src="image.png", leaving that CDN outside assetOrigins returns the original relative value here. However, transformHtml unconditionally removes the base element, so the exported page requests the image from the static site's directory instead of the CDN. This breaks remote resources that are supposed to remain external. During the final rewrite, preserve the resolved absolute URL for out-of-scope relative references, including their fragments.

Useful? React with 👍 / 👎.

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