npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kubohiroya/turbowarp-plus-editor-git

v0.37.2

Published

Read-only local Git panel for TurboWarp Plus Editor

Readme

TurboWarp Plus Editor Git

Select changes for a commit

In Commit, use the checkbox at the left of each changed item. Selected items show Include in commit and update the selected file count. Enter a message and press Run commit to record only the selected files.

Selection is by file: code and settings stored in the same project.source.json stay synchronized. An item spanning several files shows a mixed state when only some are selected. Selecting checkboxes does not itself change the Git index.

日本語

Local Git adds a panel to the TurboWarp Plus Editor. Select the repository root once; its root is the sb3-toolchain v1 project folder. Project editing and saving are supplied by the Editor's project-folder integration.

The panel opens from a branch button in the Editor's menu bar. mountGitPanel({vm, document, host}) mounts the panel and returns {open(locale), refresh(), selectRepository(root, project), clearRepository(), getCommitRepository(), dispose()}; renderBranchButton(createElement, {vm, locale}) renders the button for the panel mounted for vm, and renders nothing while there is none (such as when the host does not offer local Git). It renders nothing until a repository is bound, since Git is set up in the history view below; after that the button shows a branch icon, the current branch and ▾. A detached HEAD shows its short commit ID, and a branch without records yet says so. Its menu (role="menu"; arrow keys, Home and End, Enter, Escape back to the button) lists the local branches with the current one checked, then Create and switch to … for origin branches without a local one, New Branch… (a small form that creates a branch at HEAD, switching to it by default) and Open Local Git. The button and the panel share one repository and the same operations, so switching from the menu asks and refuses exactly as the panel's own buttons do. The result shows in a snackbar at the bottom of the window instead of opening the panel: Switched branches. with Reload Project when a project folder is selected in the panel, Created the branch., or the panel's reason for a refusal (as an alert) with Open Local Git. A declined confirmation shows nothing. The snackbar hides after six seconds unless it is hovered or focused, Escape or its close button dismisses it, a new one replaces the old, and focus is not moved into it (Tab reaches its buttons). Without localWrite the menu lists the branches only. The button follows branch changes made in the panel or by other tools: while the panel is out of view, the panel's checks below read only HEAD and the branch refs. BranchButton is the button on its own, for hosts that keep the state themselves; before a repository is chosen it reads Git and offers Choose Repository….

One repository holds one project, at its root: project.source.json and sb3-source.json are at the top of the repository, and Repository.defaultProject returns '' when they are there and null otherwise. Breaking: a project/ folder is no longer used; a repository that keeps its project in project/ has no default project until its files move to the root. A host that opens folders through its own File menu passes openFolder(locale) (its Open Folder… command) and, when it keeps folders in the browser's origin private file system (OPFS), openBrowserFolder(locale) (its Open Folder Saved in This Browser… command). With openFolder the panel no longer chooses a repository itself: when the folder the host opened has .git, the host binds the panel to it by calling selectRepository(root, project) of the mount result, and when it has none, the host calls clearRepository(), which unbinds the repository, hides the branch button and disconnects the GitHub session as a change of repository does. Such a host needs neither the folder picker nor chooseRoot. deviceFolders: false tells the panel that openFolder cannot pick folders on the device (Safari, Firefox); the setup then shows Open Folder… as unavailable, with the reason, beside Open Folder Saved in This Browser….

For hosts without folder commands (other hosts and tests), the panel falls back to Choose Repository…, which calls the browser's folder picker. A host can pass chooseRoot() to choose the repository folder itself instead, such as a folder kept in the browser's origin private file system (OPFS) where the browser has no folder picker, as in Safari and Firefox; it returns the folder, or null when the choice is cancelled. mountGitPanel returns null when there is neither the folder picker, chooseRoot nor openFolder. The panel reads, stages and commits in an OPFS folder the same way as in a picked folder.

For a side panel of the host, renderHistoryView(createElement, {vm, locale}) draws the history graph of the same repository. It reads the history again whenever the branches move, offers the graph's branch actions when the host allows writes and tells their results in the same snackbar; it renders nothing while no panel is mounted for vm. Before a repository is bound it is the one place where Git is set up: Set up Git lists Connection Mode… (the default GitHub connection mode, when the host offers a GitHub connection), then Open Folder… and, with openBrowserFolder, Open Folder Saved in This Browser…, explained as "Open the folder of a project kept in Git.". When the host has an open project folder (projectDirectory() returns one) that is not bound to a repository, it says The open folder is not a Git repository. above the steps. A host without openFolder gets Choose Repository… in place of the folder commands. Once a repository is bound, Connect to GitHub… above the graph opens the repository's GitHub connection, as the panel's own button does. GitFileMenu offers Releases… only; folders are opened from the host's own File menu. followChangeMarks(vm, directory, listener) calls listener with the Git status of the files under directory (added, modified, deleted or untracked, by path relative to directory) as the panel last read them, for a folder explorer, and returns the function that stops it. changeMarks(changes, folder) is the mapping on its own.

The panel separates staged, unstaged, and untracked changes. It shows the current branch, HEAD, local branches, and the history. Select a file to inspect its text diff or binary size. When the host supplies a block renderer, project data (project.source.json) is compared as blocks by stage, sprite and code, and Text switches to the line diff. Costume and backdrop comparisons read assets from the compared versions: HEAD and the index for staged changes, the index and the working tree for unstaged changes, the working tree for untracked files, and the first parent and the commit for history. The assets folder is the assetsDirectory of that version's sb3-source.json (assets by default). Pull request reviews read assets from raw.githubusercontent.com at the merge base and head, without using the GitHub API rate limit. A review's Reviewed marks are kept in browser storage per repository and pull request, together with each script's content: they survive closing the panel and reloading the Editor, and only the marks of scripts whose content changed are cleared when the pull request head moves. They are never written to project files or Git. Select a commit to compare its files with its first parent. The selected project limits the file list and diffs to that folder.

While the panel is open, it checks the repository every two seconds, when the window regains focus, and on FileSystemObserver notifications where available. It compares the sizes and modification times of HEAD, the index, packed-refs, config, the current branch ref, and the files in the selected project folder (the whole work tree when no project is selected, up to 5,000 files). When something changed and no diff or commit is open, the panel reads the repository again. While a diff, a commit or a pull request review is open, it keeps the view and asks you to Refresh instead. Checks wait while Git holds a lock on its metadata. Reload Project opens the selected project again using the Editor's unsaved-edit confirmation. Git inspection uses a read-only adapter and isomorphic-git with index refresh disabled. If the repository changes during a read, refresh after the other operation completes.

When the host passes localWrite, the panel can also add files to the next record (stage), remove them from it (unstage) and record the staged changes (commit) on the current branch. Like pull, these operations collect Git's writes first and apply them only after the files they replace are checked again; a failure part way puts back what was applied. They write only .git/index, objects and the current branch ref; the work tree and .git/config are never written. Commits use the repository's user.name and user.email; localWrite.author() fills in only what the config lacks, and is never written to it. Staging waits until the Editor's edits are saved. The browser cannot see executable bits or symbolic links, so files that Git records with another mode than 100644 cannot be staged here. Operations stop while another tool holds index.lock or is in the middle of a merge, cherry-pick, revert or rebase. With localWrite, the side list also shows the local branches with Switch, a form to create a branch at HEAD (optionally switching to it), and Create and Switch for branches fetched from origin that have no local branch yet. Switching rewrites HEAD, the index and the work tree through the same checked path, so it needs a stopped project, no unsaved edits and no changes in the work tree, and refuses branches whose files are not regular 100644 files. A branch made from origin/<name> gets no tracking settings, since .git/config is never written; fetch, pull and push then use the remote branch of the same name. When the open project folder is not on the target branch, the panel asks first. After switching, Reload Project opens the branch's files. Without localWrite, the panel only reads.

The history is a graph of the commits reachable from the local branches, origin/* and a detached HEAD (not from tags), newest committer time first with every child above its parents, 50 at a time with Show more. Lanes are laid out in the panel after DoltHub's commit graph and drawn in SVG; each commit is a button showing its branches (main, origin/main, the current one marked), author and date. Tab enters the list, ArrowUp and ArrowDown (Home, End) move between commits, Enter or Space selects one to compare it with its first parent. Each commit's ⋯ button (or the context menu key, or Shift+F10) opens its actions: Copy commit ID, and with localWrite Create branch here… (a name, optionally switching to it), Switch to a local branch at that commit, and Create and switch to an origin/<name> there without a local branch. They take the same checked path, guards and confirmations as the branch list. Repository.history({limit, after}) reads the pages and HistoryGraph draws them, for hosts that show the history elsewhere; layoutHistory is the layout alone.

A Chromium-based browser with File System Access support is required. The first version supports ordinary .git directories and content changes. Linked worktrees, submodules, and symbolic links are outside this scope. The browser cannot detect working-tree executable-bit changes. Recorded index and tree modes remain visible. Binary assets show sizes, and text diff generation is bounded.

Use Node.js 26, run npm ci, then npm test. Vite builds the library and stylesheet, and TypeScript emits declarations. npm pack prepares the artifact used by the Editor build. npm run test:browser runs the branch button's menu and keyboard (also beside the panel on a real repository), the history graph's keyboard and actions, and the comparison dialog's block drawing and the remote repository dialog (against the local Smart HTTP fixture), in Chromium on the minimal editor runtime (@kubohiroya/turbowarp-plus-editor-test-runtime), with the Editor's pinned VM and Scratch Blocks and without building the Editor. The Editor enables the panel by default. Start it with twPlusLocalGit=0 in its URL to disable the integration; the branch button is then not shown.

The panel structure and local Git approach were informed by duff. The implementation uses isomorphic-git and react-diff-view. Bundled licenses are listed in the build's third-party notices.

Smart HTTP adapter

test/smart-http-fixture.js runs git-http-backend on the IPv4 loopback for tests. It uses only Node.js built-in modules and ships in the package so browser tests of a host use the fixture of the same version.

Import createGitSmartHttp from @kubohiroya/turbowarp-plus-editor-git/smart-http. Pass the selected GitHub HTTPS remote from Git config, a trusted connection (mode and proxyOrigin), and a function that returns the current proxy session or null. A GitAuthProvider from the auth package satisfies this contract. The Git package takes these types from the auth package, which is an optional peer: only TypeScript users need it installed, and the read-only panel and the adapter run without it.

const transport = createGitSmartHttp({
    remote: configuredRemoteUrl,
    connection: provider.connection,
    getSession: () => provider.getSession()
});
await git.fetch({fs, dir, remote: remoteName, ...transport});

Pass the same transport options to git.fastForward for fast-forward-only pulls and to git.push with force: false for explicit pushes. Keep the existing worktree safety checks in the caller. The adapter writes no Git configuration and sends only proxy credentials to the fixed proxy. It maps Git discovery and RPC requests to /v1/git/<owner>/<repo>.git/. Requests have a 32 MiB cap, which the caller can lower, and successful responses stream back to isomorphic-git. A PUSH_OUTCOME_UNKNOWN error means the remote ref must be checked before another push.

Each receive-pack POST carries a new UUID v4 in Git-Push-Id. A browser replay carries the same ID. The proxy's 409 PUSH_DUPLICATE is exposed as PUSH_OUTCOME_UNKNOWN so the caller can reconcile the remote ref with a fetch.

npm test runs the local Git tests and a headless Smart HTTP fixture on IPv4 loopback using git-http-backend. The fixture uses disposable repositories and test credentials. Proxy, authentication and CORS contract.

When the Editor host supplies connection settings, the Local Git panel offers fetch, fast-forward pull and push for the current branch and its existing GitHub HTTPS origin. Authorize push when connecting to enable the explicit push action. Fetch updates Git metadata. Pull requires a stopped project, a clean worktree, and regular non-executable files. Pull stages the changes, rechecks the local state, and then applies them. Reopen the project from the panel after a successful pull.

Pull requests over the connection

While the connection is connected, the pull request review reads a pull request's contents over the same Git Smart HTTP route instead of the GitHub API, so private repositories work and the API rate limit is not used for contents. repository.fetchPullRequest(number, getSession, guard, signal) fetches GitHub's refs/pull/<number>/head, which the base repository also exposes for pull requests from forks, together with every branch (two requests: one advertisement and one pack). The branches update refs/remotes/origin/* as fetch does. repository.readPullRequest(head, {sha, branch}) then compares the head with its merge base against the base, from local Git objects: the changed paths (with exact renames paired), each project.source.json as a block diff, and thumbnails from the same commits. The proxy routes and the GitHub App permissions are unchanged.

The fetched head is kept at refs/pull/origin/<number>/head, replaced on each fetch of that pull request (heads can be force-pushed). Outside refs/heads, refs/remotes and refs/tags, Git CLI shows it in git for-each-ref refs/pull and git log --all but not in git branch -a or git tag; git fetch --prune does not remove it, unlike a ref under refs/remotes/origin/, which would also read as a branch on GitHub; and git gc keeps its objects, which a fetch without a ref would leave unreachable. Remove the refs with git update-ref -d refs/pull/origin/<number>/head when they are no longer needed. The fetch writes only objects and refs through the same staging and lock (tw-plus-git-mutation) as fetch and pull, never the work tree, the index, HEAD or .git/config.

Select a pull request directly from the list. Each row shows an icon, a colored number and a status label. The public API supplies the list, title, description and base for public repositories. If the public list is unavailable and a GitHub connection is active, the panel tries the connection proxy. If neither API is available, the panel lists the PR numbers advertised over Git. It compares with the recorded base commit or branch when available. Otherwise it starts with the default branch and lets you choose another base. A pull request already merged into the chosen branch shows no changes unless the API supplied its base commit.

Running a pull request locally

With localWrite, a pull request read over the connection offers Open here as pr/<number>. It creates the local branch pr/<number> at the fetched head (pullRequestBranch(number); refs/pull/origin/<number>/head stays as it is), switches to it through the same checked path as the branch list, and opens the selected project folder again from it, so the pull request's version can be run in the Editor. It is refused, and nothing is written, while the project runs, while the Editor has unsaved edits, or while the work tree has changes (staged, unstaged or untracked). It asks first when the open project folder is not in the pull request. If pr/<number> already exists at the same commit, the panel switches to it; if it points at another commit (you recorded on it, or the pull request moved), the panel refuses and leaves the branch unchanged. Switch to it from Record locally, or rename or delete it with Git (git branch -m pr/<number> <name>, git branch -D pr/<number>), and open the pull request again. The button is not shown for pull requests read from the public API, which brings no Git objects, nor without localWrite.

Sending a review

When the connection was made with Allow sending reviews (the auth package's optional review grant, separate from push), a pull request read over the connection offers a comment field under each code change and a Send a review box: an overall comment and Comment, Approve or Request changes. The host's connection passes reviewGranted(). The review goes through the proxy's GitHub API routes (/v1/github/<owner>/<repo>/, createGitHubReviewApi), which keep the GitHub token and node IDs; the client sends the Bearer of the proxy session, a Review-Submit-Id, the pull request number, the fetched head and the words. With the GraphQL routes, one review is sent in steps one at a time: a pending review on the fetched head, one file-level thread on the project.source.json per code comment (up to 50), then the submission. Comments on files outside the pull request's changes, beyond 50, or on a file GitHub refused go in the review body under their file and script; the box shows how many go where before sending. When the proxy answers 404 GITHUB_API_UNAVAILABLE for the GraphQL routes, the whole review goes in the body of one REST review instead; when neither route is available, sending is not offered.

A failure before the submission discards the pending review, so nothing is published. If that fails, the box says a pending review remains on GitHub and offers to discard it. A refused submission keeps the pending review with its threads, to change and send again or discard. When the outcome is unknown (a lost answer, a duplicate, 502/504), nothing is sent again on its own: Check Whether It Was Sent reads the proxy's record. A rate limit shows its wait and disables the buttons for it. The draft (words, result, and an in-progress submission ID) is kept in browser storage under turbowarp-plus-git:review-draft:<owner/repo#number> until GitHub has the review, through failures and reloads; it never holds tokens, the proxy address or GitHub IDs. sendReview, checkReview, discardReview, planReview and the draft functions are exported from ./project-source-diff apart from React.

The branch you were on stays as it was. To go back, switch to it under Record locally (the panel names it after opening). pr/<number> is an ordinary local branch without tracking settings: the panel does not delete it, and pull and push treat it like any other branch, so do not push it unless you mean to. Delete it with git branch -D pr/<number> when it is no longer needed.

Comparing before choosing

openProjectComparison(document, options) lays several titled comparisons of project.source.json texts in one modal and asks the user to choose an action. Each of sections takes the same before and after as ProjectSourceComparison. The promise resolves with the chosen action's id, or with null when the dialog is closed or Escape is pressed. The first action receives focus, so list the one that loses the least first. The project folder uses it to show "Your unsaved edits" next to "Changes in the folder" before replacing unsaved edits.

const choice = await openProjectComparison(document, {
    title: 'External changes and your unsaved edits',
    sections: [{title: 'Your unsaved edits', before: base, after: edited}, {title: 'Changes in the folder', before: base, after: disk}],
    actions: [{id: 'keep', label: 'Keep My Edits'}, {id: 'discard', label: 'Discard Edits and Load from Folder'}],
    renderBlock
});

Publishing and repository creation for the Editor

The Editor's commit, publication and repository creation flows live here too.

| Export | Role | | --- | --- | | ./project-publication | createProjectPublication takes the host's PublicationBridge (Desktop or Cloudflare) with the inspect and push steps, and returns a PreparedPublication. A running job stays with the host when the dialog closes. PublicationBridge includes the same PullRequestMergePort as the Git panel, and the panel's PullRequestPublication.prepare returns this PreparedPublication | | ./cloudflare-publication | The PublicationBridge over a Cloudflare connection (createCloudflarePublicationBridge). It pins the push session to the job | | ./project-commit-dialog and ./project-publication-dialog | The dialogs that choose commits and send them as a pull request (renderProjectCommitDialog, renderProjectPublicationDialog) | | ./project-repository-creation | Creates a GitHub repository and carries it through the first push (createProjectRepositoryWorkflow). Progress is kept in an IndexedDB journal (repositoryCreationJournal), so a lost answer resumes without creating a second repository. The seed is laid out with the project at the root, and the finished repository's root is passed to openProject(root, root). The GitHubCreationAccount and GitHubRepositoryDraft types are here too | | ./project-repository-host | Binds that workflow to a window: the device-code flow on Desktop, the Cloudflare BFF in the browser, an empty folder (picked or in the browser's storage), the seed and the initial push (bindProjectRepositoryCreation). What the host's build supplies — the repository client, the Cloudflare authorizations, the seed composer, the initial commit and push, the sb3-toolchain version and the licenses — is passed in as services (ProjectRepositoryHostServices); without all of them it returns undefined | | ./project-version-preview | Shows a past version of the project in a player dialog (openProjectVersionPreview). packProjectVersion(files, {validate, zip}) builds that version's SB3 from its sb3-toolchain source files with each extension embedded as a data URL; the host supplies the source validator and its JSZip. receiveProjectVersionPreview(window, player) is the player page's side of the handshake: it accepts only the parent's archive on its own origin and reports a failure in the page's language |

Every dialog opens in the shared frame of @kubohiroya/turbowarp-plus-editor-windows 0.3 (a peer dependency): createPlusDialog, PlusDialogFrame and confirmDialog, with dialogActions for the buttons, so the host loads the windows styles.css. The × in the header bar is the only close control and Esc does the same; a click on the backdrop does nothing. Questions that used window.confirm ask in confirmDialog. The dialog drawn inside the host's own shell (save and commit, pull request) leaves closing to that shell.

These moved here from packages/editor-ui in turbowarp-plus-editor. The same author wrote them, and they changed from GPL-3.0 to MPL-2.0 in the move. The provenance audit is in the "由来の監査(7b)" section of the migration plan in turbowarp-plus-packages.

Opening a remote repository

./remote-repository (also exported from the main entry) opens a project kept on GitHub. Only a repository whose default branch has project.source.json and sb3-source.json at its root is opened; anything else is refused before a file is written.

  • cloneRemoteProject({remote, getSession, signal?, onProgress?, fetch?}): Promise<CloneRemoteProjectResult> clones in memory over the connection's Smart HTTP (the adapter above): init, origin with +refs/heads/*:refs/remotes/origin/*, the full history of the branch the remote's HEAD names (no tags), origin/HEAD, and branch.<name>.remote/merge. remote is https://github.com/<owner>/<repo> with or without .git; getSession is called as getSession(remote, false) with the normalised .git URL, as GitConnectionSettings.getSession. The result is {ok: true, snapshot} or {ok: false, reason, path?} with reason one of 'invalid-remote', 'not-project' (also an empty repository; nothing is checked out), 'unsupported' (a symbolic link, an executable file, a submodule or a name a folder cannot hold, at path), 'auth', 'forbidden', 'network' or 'failed'. Aborting signal rejects with its reason. The snapshot (ClonedProject: remote, branch, head, entries) holds the whole repository in memory, packfile and work tree included.
  • writeClonedProject(folder, snapshot, {signal?}): Promise<{branch, head}> writes the snapshot into an empty FileSystemDirectoryHandle under the Git write lock, objects, the index and the work tree before HEAD and the refs, and checks the folder's HEAD afterwards. A folder with any entry is refused with GitPanelError('notEmpty') before anything is written. An interrupted write leaves the files written so far.
  • openRemoteRepositoryDialog({document, locale, connectionSettings, deviceFolders?, pickDeviceFolder?, createBrowserFolder?, removeBrowserFolder?, openProject}): Promise<boolean> is the Open Remote Git Repository… dialog. It asks for the repository URL and where to save it: A folder on this device (unavailable, with the reason, when deviceFolders is false) or In this browser (when createBrowserFolder is given). Open connects with read access (connect(remote, false); for Cloudflare it opens GitHub's authorization window during the click, and for Desktop it shows the link and the device code), waits for the session (every 1.5 seconds, up to 10 minutes or until the window closes), then clones with a progress bar and Cancel. A repository without a root project shows This folder is not a project folder., and OK closes both dialogs without writing. Otherwise a device folder is picked with Choose a Folder… (a second click, since the browser lets a folder picker open only during a click; pickDeviceFolder() returns an empty folder or null), or createBrowserFolder(name) makes a new folder named after the repository. The snapshot is written there and openProject(root) is awaited before the dialog closes with true. When writing into a browser folder fails, removeBrowserFolder(folder) removes it. Other errors show in the dialog with Retry. Opening a repository changes the panel's repository, which disconnects the GitHub session: to push, connect again with write access from Connect to GitHub….

Three-way merge of project folders

./project-merge merges three versions of a project folder (the merge base, the current branch and the incoming branch) into a result to start from and a list of conflicts. It is made of pure functions with no user interface or Git access: the caller reads and writes the files and runs Git. (Stage 1 of Editor #773; the panel does not use it yet.)

  • mergeProjectFolder(versions) takes {base, current, incoming} for each path (relative to the folder, separated by /) as Uint8Array, or null where the file does not exist, and returns {files, conflicts, problems}. Each file's content includes changes made by only one side or by both sides in the same way, and keeps the base where the sides conflict. It never writes conflict markers.
  • resolveProjectFolder(result, choices) applies the side chosen for each conflict ID ('base', 'current' or 'incoming') and returns the final files (null removes one), the remaining problems and the conflicts without a choice.

Each kind of file merges as follows.

  • project.source.json: targets pair by name; a sprite renamed on one side pairs with its base sprite by shared block IDs. Blocks merge per script. A script changed on only one side takes that side. A script changed on both sides merges block by block, with inputs and fields separately, when the result keeps its links intact; otherwise it is a script conflict. Variables, lists, broadcasts and comments merge by ID, costumes and sounds by name; variable and list names merge separately from their values, and the current costume merges by name rather than index. A variable or list removed on one side but still used by the merged scripts is kept and reported as a reference conflict. The result is written as JSON.stringify(value, null, 2) plus a newline, in the current side's key and element order.
  • Other JSON files (sb3-source.json, embedded-extensions.json and so on) merge key by key. archiveEntries in sb3-source.json is rebuilt from the final asset files instead, because a project folder opens only when it lists project.json and exactly the asset files.
  • Asset files (assets/) stay exactly when the final project uses them.
  • Text merges line by line (diff3); clean merges match git merge-file.
  • Binary files, and files removed on one side and changed on the other, are whole-file conflicts.

checkProject(project) checks block links, variable and list references, block comments and the current costume index. Do not commit a project with problems.

Renaming the repository

./repository-rename renames a project's GitHub repository when the project is renamed (Editor #681). renameRemoteRepository({remote, name, getSession}) sends only the new name to the connection's proxy (POST /v1/github/<owner>/<repo>/name on the keybroker Worker or the Desktop loopback proxy) with the write session, and returns the new remote. Errors are RepositoryRenameError codes from the proxy: REPOSITORY_NAME_UNAVAILABLE (the name is in use), ADMINISTRATION_PERMISSION_REQUIRED (the GitHub App installation has not approved Administration: Read and write), FORBIDDEN (not an admin of the repository, or a read-only login) and GITHUB_API_UNAVAILABLE (the proxy has no rename route). unknown marks an outcome that may have renamed the repository; retrying with the same name completes it. isRepositoryName checks GitHub's rule, which the project's save name follows.

readOriginUrl(root) reads the origin as Git config holds it, the value the panel connects with. writeOriginUrl(root, {from, to}) then rewrites remote.origin.url, under the Git mutation lock, only when the current origin is still from. It is the panel's only write to .git/config; every other key is kept. The host moves the connection with the auth package's renameRemote(from, to), so no new login is needed.

Release

.github/workflows/release.yml publishes to npm. Push a v<version> tag that names the package.json version on a main commit: the workflow runs the tests, packs the archive, attaches it to the GitHub Release, publishes it to npm and points latest and next at it. It authenticates with npm Trusted Publishing (OIDC), not a token, and publishes with provenance. The npm settings name this workflow file, so rename both together.