Skip to content

Commit bede50a

Browse files
committed
Build for 3fdfd68 feat: combine add-repo.sh and CI generator from #434 and #505
Replaces the script work of two prior PRs that independently solved "add an existing scratchfoundation repo to the monorepo": scripts/add-repo.sh — collapses add-to-monorepo.sh (#434) and add-repo.sh (#505) into a single canonical entry point. Takes the CLI shape and auto-CI-regen from #505 and the source-branch auto-detect (develop -> main -> master), normalization (sort-package-json), and clean-tree pre-flight from #434. scripts/update-gha-workflows.ts — replaces the CircleCI-era build-gha-workflows.ts and workspace-template.yml. Regenerates .github/path-filters.yml and incrementally updates publish.yml. Open review comments on #505 are addressed: - sed -i portability bug: rewrites now use perl -pi -e (works on macOS, NixOS, Ubuntu/Debian/Arch, WSL). Perl is added to the explicit prereq check next to git-filter-repo, sponge, and jq. - Arg parser now rejects flag-stealing: --source-branch --org foo errors instead of silently using --org as the branch name. - npm-install failures hard-fail by default. --continue-on-error opts into the prior soft-fail behavior; failures are still logged to add-repo.errors.log when continuing. Scoped to per-dep package.json rewrite failures in the rewire step; the final lockfile install always hard-fails by design. - The submodules-aware branch in move_repository_subdirectory keeps a TODO comment marking that it has never been exercised against a real submodules-bearing repo and should be run carefully when one lands. Cross-workspace dep handling: rewires both bare-name and already-prefixed @scratch/<name> deps in the new package to exact-pinned current monorepo versions. Matches the existing convention in scratch-gui/scratch-vm/ scratch-render. npm's workspace: protocol would be the ideal here but npm does not actually support it (npm/cli#8845 - EUNSUPPORTEDPROTOCOL at install time). Workspaces array ordering: the new package is inserted just after the latest existing workspace it depends on, so 'npm run --workspaces build' builds its deps first. Falls back to position 0 (prepend) when the new package has no monorepo deps. This is a "last dep wins" heuristic, not a full topological sort; it relies on the existing workspaces array already being in valid build order. A real topo sort can be added later (e.g. by extending update-gha-workflows.ts) if it ever becomes necessary. bash 3.2 compatibility: macOS ships bash 3.2 at /bin/bash, which lacks the 'mapfile' builtin. The find/grep output is collected via a 'while IFS= read -r' loop so the script runs on macOS as well as Linux. Bare-clone alternates path: bare clones store the alternates file at objects/info/alternates, not .git/objects/info/alternates. The previous path was a no-op; the working disconnection comes from --dissociate in the clone command. Path corrected so the line is defensive belt-and- braces rather than dead code. update-gha-workflows.ts: throws with a clear error if npm query returns a workspace not present in the root "workspaces" array (previously would silently misorder via indexOf returning -1). The comment in resolveWorkspaces is corrected to reflect that the function returns Map insertion order, with the caller re-sorting into declared order. The npm query exec call now requests a 64 MiB maxBuffer; Node's default 1 MiB is fine for the current repo size but would silently truncate as the monorepo grows. Path anchoring: BUILD_TMP, BUILD_CACHE, and any user-supplied --cache-dir value are resolved to absolute paths up front. A CWD-relative default would have put add-repo.tmp outside the repo (and outside the .gitignore pattern) if the script were run from a subdirectory of the monorepo. No repo additions are included; this PR is script-tooling only.
1 parent b040636 commit bede50a

9 files changed

Lines changed: 75 additions & 75 deletions

File tree

feat_canonical-add-repo-script/scratch-gui/blocksonly.js

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

feat_canonical-add-repo-script/scratch-gui/compatibilitytesting.js

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

feat_canonical-add-repo-script/scratch-gui/gui.js

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

feat_canonical-add-repo-script/scratch-gui/guistandalone.js

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

feat_canonical-add-repo-script/scratch-gui/player.js

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

feat_canonical-add-repo-script/scratch-render/docs/classes/export_.html

Lines changed: 67 additions & 67 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>idFilterFunc | @scratch/scratch-render</title><meta name="description" content="Documentation for @scratch/scratch-render"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@scratch/scratch-render</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">idFilterFunc</a></li></ul><h1>Type Alias idFilterFunc</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">idFilterFunc</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">drawableID</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-type-declaration"><h4>Type Declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="__type"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">drawableID</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">drawableID</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The ID to filter.</p>
2-
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></li></ul></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/scratchfoundation/scratch-editor/blob/d8ec81f19fbed36bb9f429bc5d8c32fbc2fbc81e/packages/scratch-render/src/RenderWebGL.js#L28">packages/scratch-render/src/RenderWebGL.js:28</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@scratch/scratch-render</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
2+
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></li></ul></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/scratchfoundation/scratch-editor/blob/3fdfd6876f38d4e0d9c51cd570bfb2858527add2/packages/scratch-render/src/RenderWebGL.js#L28">packages/scratch-render/src/RenderWebGL.js:28</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@scratch/scratch-render</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>

0 commit comments

Comments
 (0)