Repository navigation
Install rule packs from the public games repo (RPG R7) - #76
Open
luoxin9510 wants to merge 3 commits into
Open
luoxin9510 wants to merge 3 commits into
luoxin9510 wants to merge 3 commits into
Conversation
…led packs (RPG R7) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015vdVgYTb9jm7MRdePSgs8B
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015vdVgYTb9jm7MRdePSgs8B
|
Review: I found no blocking bugs and would merge as is. Checked and fine:
Minor, non-blocking:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015vdVgYTb9jm7MRdePSgs8B
| const yes = await new Promise<boolean>((done) => new ConfirmModal(this.app, T().packInstallTitle(id), T().packInstallConfirm(`${source.replace(/\/?$/, "/")}${id}/`, dir, have), T().install, done).open()); | ||
| if (!yes) return { path: null }; | ||
| } | ||
| const got = await downloadPack(async (url) => (await requestUrl({ url })).text, source, id, (t) => splitNote(t, parseYaml).frontmatter); |
There was a problem hiding this comment.
Two things here:
api.installPack(id, { ask: false })skips the confirm dialog, so any agent or script can download and overwrite files from a remotemainbranch (includingrules.ink, which games INCLUDE) with no user consent. The API accepts an arbitrarysource, and the doc says nothing of its risk. Consider honoringask: falseonly for asourcethe caller passes explicitly, or always confirming for the default source.- The "nothing is written if a download fails" guarantee holds for downloads only. If
vault.createormodifythrows halfway through the write loop, the pack is left half-written and overwritten. The error Notice doesn't say so. Acceptable, but the doc comment should be honest, or the write should roll back.
|
Review summary: no blocking bugs found in 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RPG R7, plugin side.
api.availablePacks()andapi.installPack(id). Flow: readsystems/index.jsonfrom luoxin9510/ink-games → pick a pack (the installed version is shown) → a confirm dialog with the source URL, the target folder and an overwrite note → downloadsystem.mdand every file it lists → write into规则包/<id>/. Nothing is written if any download fails.src/templates/install.tsand is pure, tested with a fake fetch (tests/install.test.ts). Paths must be relative to the pack: no.., hidden files or odd characters.system.mdlists its files underfiles:; a test keeps that list in step with the folder, andlayerSystemdrops the field.art1/2/3 (from the Turn battle and narrative check rule packs (RPG R6) #75 review).export-webon the command line now layerssystem:and resolvesfrom:likecheck-ink. Before this, pages exported from pack-based games lost the pack's config.Tests: 604 pass, lint clean, the build is reproducible. Pair: the ink-games PR for
systems/; its CI checks thatsystems/matches this repo'spacks/, so merge this one first. Not yet checked in Obsidian: the plugin there is still the old build.🤖 Generated with Claude Code
https://claude.ai/code/session_015vdVgYTb9jm7MRdePSgs8B