Add HTML To Link deployment rule#335
Conversation
Add HTML To Link to Hosting and Deployments
📝 WalkthroughWalkthroughAdds an HTML To Link deployment rule covering project packaging, authenticated and anonymous deployment, credential handling, persisted configuration, and MCP usage. The README now lists the rule under Hosting and Deployments. ChangesHTML To Link deployment
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
rules/html-to-link-deploy.mdc (1)
96-102: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winPin the MCP package version.
npx -y htmltolink-mcpdownloads and executes an unpinned release, reducing reproducibility and increasing supply-chain risk. Pin a reviewed version and, where possible, verify its integrity.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@rules/html-to-link-deploy.mdc` around lines 96 - 102, Update the htmltolink MCP server configuration under mcpServers.htmltolink so the npx argument references a specific reviewed htmltolink-mcp version instead of an unpinned package; preserve the existing -y behavior and verify the package integrity if the configuration supports it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Line 238: Update the HTML To Link entry in the README rule checklist to
replace the relative rules/html-to-link-deploy.mdc link with the canonical
GitHub URL for that rule, preserving the existing link text and description.
In `@rules/html-to-link-deploy.mdc`:
- Around line 1-4: Update the frontmatter for the HTML deployment rule by
replacing the empty globs value with the repository-supported non-empty HTML
pattern, such as **/*.html, while preserving alwaysApply: false and the existing
description.
- Around line 21-24: Update the existing-page reuse logic for shareUrl and
updateToken to validate expiresAt before reusing an anonymous deployment. When
expiresAt is reached or passed, create a new deployment instead and replace the
stale configuration; preserve reuse only for unexpired deployments.
- Around line 60-82: Update the deployment flow so the `.gitignore` entry for
`.htmltolink.json` is created or verified before writing that file, and remove
any previously tracked copy from Git’s index while preserving it locally. Apply
this ordering to the anonymous-mode `updateToken` persistence without exposing
the token in user output.
- Around line 35-37: Update the deployment request examples to pass the resolved
or selected entry HTML file in the entry_file form field instead of hard-coding
index.html. Preserve the existing project-name and zip-file placeholders, and
use a clearly fillable entry-file placeholder where the value is determined
interactively.
---
Nitpick comments:
In `@rules/html-to-link-deploy.mdc`:
- Around line 96-102: Update the htmltolink MCP server configuration under
mcpServers.htmltolink so the npx argument references a specific reviewed
htmltolink-mcp version instead of an unpinned package; preserve the existing -y
behavior and verify the package integrity if the configuration supports it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2161d6d1-1179-4670-9ccc-6eef036de548
📒 Files selected for processing (2)
README.mdrules/html-to-link-deploy.mdc
| - [Cloudflare Email to Telegram](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/cloudflare-email-telegram-cursorrules-prompt-file.mdc) - Setting up email-to-Telegram forwarding via Cloudflare Email Routing and Workers using the mail2tg CLI. | ||
| - [Netlify](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/netlify-official-cursorrules-prompt-file.mdc) - Official deployment platform integration. | ||
| - [Vercel](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/vercel-deployment-cursorrules-prompt-file.mdc) - Deployment with serverless functions, Edge Runtime, middleware, caching, CI/CD, and production-ready configuration. | ||
| - [HTML To Link](rules/html-to-link-deploy.mdc) - Deploy HTML projects to a live public URL without server setup. Supports anonymous temporary pages and authenticated managed deployments. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use the canonical GitHub URL for the rule link.
The repository checklist requires README rule links to use canonical GitHub URLs. Replace the relative path with the full github.com/PatrickJS/awesome-cursorrules/blob/main/rules/html-to-link-deploy.mdc URL.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@README.md` at line 238, Update the HTML To Link entry in the README rule
checklist to replace the relative rules/html-to-link-deploy.mdc link with the
canonical GitHub URL for that rule, preserving the existing link text and
description.
| --- | ||
| description: Deploy HTML projects to a live public URL via htmlto.link - packages, uploads, and returns a shareable link without server setup | ||
| globs: | ||
| alwaysApply: false |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Populate globs with a non-empty HTML pattern.
With alwaysApply: false and an empty globs value, this rule may not be selected for HTML projects. Add the repository-supported HTML glob pattern, such as **/*.html.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@rules/html-to-link-deploy.mdc` around lines 1 - 4, Update the frontmatter for
the HTML deployment rule by replacing the empty globs value with the
repository-supported non-empty HTML pattern, such as **/*.html, while preserving
alwaysApply: false and the existing description.
| 1. Read `.htmltolink.json` from the project root if it exists. | ||
| - If it contains `shareUrl` + `updateToken`: update that existing page. | ||
| - If it contains `shareUrl` + `versionNo` (authenticated): update that managed page. | ||
| - Otherwise: create a new deployment. |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Do not reuse expired anonymous deployments.
The configuration stores expiresAt, but this branch reuses any shareUrl plus updateToken without checking expiry. After 24 hours, it should fall back to a new deployment and replace the stale configuration.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@rules/html-to-link-deploy.mdc` around lines 21 - 24, Update the existing-page
reuse logic for shareUrl and updateToken to validate expiresAt before reusing an
anonymous deployment. When expiresAt is reached or passed, create a new
deployment instead and replace the stale configuration; preserve reuse only for
unexpired deployments.
| -F "file=@<zip-file-path>" \ | ||
| -F "entry_file=index.html" \ | ||
| -F "title=<project-name>" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Map the file and inspect the relevant range.
wc -l rules/html-to-link-deploy.mdc
cat -n rules/html-to-link-deploy.mdc | sed -n '1,140p'Repository: PatrickJS/awesome-cursorrules
Length of output: 3988
Use the resolved entry file instead of hard-coding index.html. The rule says to ask when the entry HTML file is ambiguous, but all deploy examples still send entry_file=index.html, which will misdeploy projects whose entry file has a different name. Update these requests to use the selected entry file (or a placeholder that must be filled in).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@rules/html-to-link-deploy.mdc` around lines 35 - 37, Update the deployment
request examples to pass the resolved or selected entry HTML file in the
entry_file form field instead of hard-coding index.html. Preserve the existing
project-name and zip-file placeholders, and use a clearly fillable entry-file
placeholder where the value is determined interactively.
| 4. After success, create or update `.htmltolink.json` in the project root: | ||
|
|
||
| Anonymous mode: | ||
| ```json | ||
| { | ||
| "shareUrl": "https://htmlto.link/xxxxxxxx", | ||
| "updateToken": "<from API response>", | ||
| "temporary": true, | ||
| "expiresAt": "<from API response>" | ||
| } | ||
| ``` | ||
|
|
||
| Authenticated mode: | ||
| ```json | ||
| { | ||
| "shareUrl": "https://htmlto.link/xxxxxxxx", | ||
| "versionNo": "<from API response>" | ||
| } | ||
| ``` | ||
|
|
||
| 5. Ensure `.gitignore` contains `.htmltolink.json`. | ||
|
|
||
| 6. Return **only** the final share URL to the user. Never expose `updateToken`. |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Protect the deployment token before persisting it.
.htmltolink.json contains updateToken, yet .gitignore is updated only afterward. Ensure the ignore rule exists before writing the file, and handle any previously tracked copy because adding a pattern does not remove it from Git’s index.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@rules/html-to-link-deploy.mdc` around lines 60 - 82, Update the deployment
flow so the `.gitignore` entry for `.htmltolink.json` is created or verified
before writing that file, and remove any previously tracked copy from Git’s
index while preserving it locally. Apply this ordering to the anonymous-mode
`updateToken` persistence without exposing the token in user output.
Value To Cursor Users
Adds a deployment rule that lets Cursor agents publish HTML projects to a live public URL in one step — no server, no DNS, no build pipeline. Useful for AI-generated pages, client demos, and quick previews.
Added Or Changed Files
rules/html-to-link-deploy.mdc— New rule: deploy workflow with anonymous and authenticated modesREADME.md— Added entry under Hosting and Deployments sectionQuality Checklist
Summary by CodeRabbit
New Features
Documentation