-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release script #9
Conversation
…ny@0.0.2, @lift-html/cli@0.0.3
WalkthroughThis pull request focuses on version updates for multiple packages within the Lift HTML project. The changes involve incrementing version numbers in Changes
Sequence DiagramsequenceDiagram
participant User
participant BumpScript as bump-version.ts
participant Packages as Package deno.jsonc files
User->>BumpScript: Run version bump script
BumpScript->>User: Prompt package selection
User-->>BumpScript: Select packages
BumpScript->>Packages: Update version numbers
BumpScript->>BumpScript: Stage changes
BumpScript->>BumpScript: Commit with version info
BumpScript->>BumpScript: Create Git tags
Possibly related PRs
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (4)
scripts/bump-version.ts (4)
1-1
: Ensure adequate permissions for script operations
The script uses --allow-env, --allow-read, and --allow-run. If the bump command modifies files (like version updates in deno.jsonc), consider adding --allow-write to guard against potential permission errors.
17-17
: Validate file existence before bumping
If a package folder is missing or deno.jsonc doesn't exist, the script may fail with an unhelpful error. Validating the file's existence before calling bump can improve user experience.for (const name of selected) { + if (!(await $.exists(`packages/${name}/deno.jsonc`))) { + console.log(`File packages/${name}/deno.jsonc not found. Skipping...`); + continue; + } const filename = `packages/${name}/deno.jsonc`; await $`deno run -A jsr:@kellnerd/bump --file ${filename}`; ... }
29-33
: Refine commit message for clarity
The current commit message includes package names and bumped versions. Consider adding a prefix or referencing the PR number/branch for better traceability in larger projects.
38-44
: Graceful error handling
Catching Deno.errors.Interrupted is good. For broader errors, consider providing suggestions to the user (e.g., verifying dependencies). Logging only the error may not be enough in complex bumping workflows.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
deno.lock
is excluded by!**/*.lock
📒 Files selected for processing (5)
packages/cli/deno.jsonc
(1 hunks)packages/core/deno.jsonc
(1 hunks)packages/solid/deno.jsonc
(1 hunks)packages/tiny/deno.jsonc
(1 hunks)scripts/bump-version.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (4)
- packages/cli/deno.jsonc
- packages/core/deno.jsonc
- packages/solid/deno.jsonc
- packages/tiny/deno.jsonc
await $`git tag @lift-html/${name}@${versions.get(name) ?? ""}`; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Git tag creation needs error handling
The script currently creates tags without checking for existing ones or handling potential errors. This could lead to failed releases if tags already exist. Consider:
- Adding
-f
flag to overwrite existing tags or - Adding error handling around the tag creation
- Adding a pre-check for existing tags before attempting creation
Example fix:
for (const name of selected) {
const tagName = `@lift-html/${name}@${versions.get(name) ?? ""}`;
try {
await $`git tag ${tagName}`;
} catch (error) {
console.error(`Failed to create tag ${tagName}:`, error);
// Either exit or prompt user to force
}
}
🔗 Analysis chain
Consider confirming successful tags creation
Tagging errors (e.g., if a tag already exists) will throw an error. You could confirm success or handle collisions (e.g., prompt or overwrite).
Let me check the implementation of the bump-version script to see how it handles tag creation and potential conflicts.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Verify that all newly created tags do not clash with existing tags
git fetch --tags
for tag in $(git tag); do
echo "Found tag: $tag"
done
Length of output: 1938
Script:
#!/bin/bash
# Check the implementation of bump-version.ts
cat scripts/bump-version.ts
Length of output: 1412
Summary by CodeRabbit
New Features
@lift-html/cli
to0.0.3
@lift-html/core
to0.0.4
@lift-html/solid
to0.0.6
@lift-html/tiny
to0.0.2
Style
exclude
array in the linting rules for better readability.