Automate vendor/mieweb-ui.tgz Rebuild From the vendor/ui Submodule - #518
Open
Dharp02 wants to merge 1 commit into
Open
Automate vendor/mieweb-ui.tgz Rebuild From the vendor/ui Submodule#518Dharp02 wants to merge 1 commit into
Dharp02 wants to merge 1 commit into
Conversation
…dule Replaces the manual 'update vendor/ui, rebuild, repack, commit the tarball' workflow with scripts/build-ui-tarball.mjs, run via 'npm run setup:ui': - Compares vendor/ui's current commit against a marker file (vendor/.ui-tarball-commit) and only rebuilds when it has changed, so repeated runs are a fast no-op instead of always repacking. - Streams pnpm/tsup output live (stdio: inherit) instead of buffering it silently, which previously made multi-minute rebuilds look hung. - setup:ui no longer runs 'git submodule update --init' unconditionally — that was resetting vendor/ui back to the outer repo's stale pinned commit on every run, silently discarding any manual 'git pull' progress. The script's own init-only-if-missing check already covers first clone. Advances the vendor/ui submodule pointer a5887a2a -> fd22cb1b (mieweb/ui main, includes the Sparkline and KeyboardShortcutsOverlay components) and rebuilds vendor/mieweb-ui.tgz from it. Verified: typecheck, lint, 138/138 unit tests, and build all pass against the rebuilt tarball. Refs #517
🚀 Preview Deployment Ready
Preview auto-deletes when this PR is closed. |
4 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Automates rebuilding the vendored @mieweb/ui tarball from its submodule revision.
Changes:
- Adds commit-based rebuild detection and streaming output.
- Updates the UI submodule, tarball, marker, and dependency lock.
- Replaces the manual
setup:uicommand sequence with the script.
Reviewed changes
Copilot reviewed 2 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/build-ui-tarball.mjs |
Implements conditional tarball rebuilding. |
package.json |
Routes setup:ui through the new script. |
package-lock.json |
Locks dependencies from the updated tarball. |
vendor/.ui-tarball-commit |
Records the packaged submodule revision. |
vendor/ui |
Advances the UI submodule revision. |
vendor/mieweb-ui.tgz |
Supplies the rebuilt UI package. |
Suppressed comments (1)
scripts/build-ui-tarball.mjs:59
- Replacing the tarball alone leaves both
node_modules/@mieweb/uiand the tarball integrity/dependency graph inpackage-lock.jsonstale. The current lockfile diff shows that a rebuild requires lock updates; on the next submodule change,npm cican reject the new tarball while a current dev process still consumes the old installed package. Refresh the root installation and lockfile before recording the marker.
renameSync(join(UI_DIR, packedFile), TARBALL);
writeFileSync(MARKER, currentCommit + '\n');
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "test:watch": "vitest", | ||
| "prepare": "node scripts/prepare-husky.cjs", | ||
| "setup:ui": "git submodule update --init vendor/ui && cd vendor/ui && npm install && npm run build && npm pack && mv mieweb-ui-*.tgz ../mieweb-ui.tgz", | ||
| "setup:ui": "node scripts/build-ui-tarball.mjs", |
Comment on lines
+36
to
+43
| if (!existsSync(join(UI_DIR, '.git'))) { | ||
| if (existsSync(TARBALL)) { | ||
| console.log('[build-ui-tarball] vendor/ui submodule not checked out — using existing tarball'); | ||
| process.exit(0); | ||
| } | ||
| console.log('[build-ui-tarball] initializing vendor/ui submodule...'); | ||
| sh('git submodule update --init vendor/ui'); | ||
| } |
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.
Overview
Automates the
vendor/mieweb-ui.tgzrebuild from thevendor/uisubmodule, replacing the manual "pull submodule, rebuild, repack, commit the tarball by hand" workflow described in #517.Changes
scripts/build-ui-tarball.mjs(new) — comparesvendor/ui's current commit against a marker file (vendor/.ui-tarball-commit); only rebuilds (pnpm install && pnpm run build && npm pack) when it has changed, so repeat runs are a fast no-op.package.json:setup:uinow just calls the script. Dropped the unconditionalgit submodule update --init vendor/uifromsetup:ui— it was silently resettingvendor/uiback to the outer repo's stale pinned commit on every run, discarding any manualgit pullprogress inside the submodule. The script's own "init only if.gitis missing" check already covers a fresh clone.pnpm/tsupoutput live (stdio: 'inherit') instead of buffering it silently — a multi-minute rebuild with zero output looked exactly like a hung terminal.vendor/uisubmodule pointera5887a2→fd22cb1b(currentmieweb/uimain, includes theSparklineandKeyboardShortcutsOverlaycomponents) and rebuildsvendor/mieweb-ui.tgzfrom it.Why not switch straight to npm or a direct submodule link?
Both were tried and ruled out — see #517 for the full investigation:
nextprerelease tag, notlatest.file:vendor/uilink: breakstypecheck— without npm/pnpm workspaces, the submodule gets its own separatenode_modules/@types/reactcopy, so TypeScript treats every@mieweb/uicomponent's props as a distinct, incompatible type.Packing through a tarball is the one option proven to avoid the duplicate-types problem while still requiring only automation, not a workspace migration.
Verification
npm run typecheck— cleannpm run lint— cleannpm run test:unit— 138/138 passednpm run build— succeedspnpm install,pnpm run build,npm pack) directly in the terminal before trusting the script — confirmed identical output/behaviornpm run setup:uiwith no submodule change correctly logs "up to date — skipping rebuild"vendor/ui's commit is unchanged across repeatedsetup:uirunsOut of Scope (for Now)
scripts/ensure-ui-build.mjs,.gitignore,vite.config.ts) referencing the pre-tarballfile:vendor/uiarrangement — tracked separately in Tarball-Based @mieweb/ui Dependency: Root Cause and Path to Automated Submodule Sync #517Closes part of the automation gap described in #517 (does not fully resolve the issue — tarball-removal and workspace migration remain open).