Skip to content

Automate vendor/mieweb-ui.tgz Rebuild From the vendor/ui Submodule - #518

Open
Dharp02 wants to merge 1 commit into
mainfrom
fix/automate-ui-tarball-rebuild
Open

Automate vendor/mieweb-ui.tgz Rebuild From the vendor/ui Submodule#518
Dharp02 wants to merge 1 commit into
mainfrom
fix/automate-ui-tarball-rebuild

Conversation

@Dharp02

@Dharp02 Dharp02 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Overview

Automates the vendor/mieweb-ui.tgz rebuild from the vendor/ui submodule, replacing the manual "pull submodule, rebuild, repack, commit the tarball by hand" workflow described in #517.

Changes

  1. scripts/build-ui-tarball.mjs (new) — compares vendor/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.
  2. package.json: setup:ui now just calls the script. Dropped the unconditional git submodule update --init vendor/ui from setup:ui — it was silently resetting vendor/ui back to the outer repo's stale pinned commit on every run, discarding any manual git pull progress inside the submodule. The script's own "init only if .git is missing" check already covers a fresh clone.
  3. Streams pnpm/tsup output live (stdio: 'inherit') instead of buffering it silently — a multi-minute rebuild with zero output looked exactly like a hung terminal.
  4. Advances the vendor/ui submodule pointer a5887a2fd22cb1b (current mieweb/ui main, includes the Sparkline and KeyboardShortcutsOverlay components) and rebuilds vendor/mieweb-ui.tgz from it.

Why not switch straight to npm or a direct submodule link?

Both were tried and ruled out — see #517 for the full investigation:

  • npm registry: works, but the exact commit we want is only on the next prerelease tag, not latest.
  • Direct file:vendor/ui link: breaks typecheck — without npm/pnpm workspaces, the submodule gets its own separate node_modules/@types/react copy, so TypeScript treats every @mieweb/ui component'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 — clean
  • npm run lint — clean
  • npm run test:unit — 138/138 passed
  • npm run build — succeeds
  • Manually reproduced each step of the script (pnpm install, pnpm run build, npm pack) directly in the terminal before trusting the script — confirmed identical output/behavior
  • Verified idempotency: re-running npm run setup:ui with no submodule change correctly logs "up to date — skipping rebuild"
  • Verified the submodule-reset bug is fixed: vendor/ui's commit is unchanged across repeated setup:ui runs

Out of Scope (for Now)

Closes part of the automation gap described in #517 (does not fully resolve the issue — tarball-removal and workspace migration remain open).

…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
Copilot AI balanced review requested due to automatic review settings September 3, 2026 22:39
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

🚀 Preview Deployment Ready

Service URL
App https://mieweb-timehuddle-fix-automate-ui-tarball-rebuild.os.mieweb.org
API (Meteor) https://mieweb-timehuddle-fix-automate-ui-tarball-rebuild-api.os.mieweb.org

Preview auto-deletes when this PR is closed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:ui command 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/ui and the tarball integrity/dependency graph in package-lock.json stale. The current lockfile diff shows that a rebuild requires lock updates; on the next submodule change, npm ci can 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.

Comment thread package.json
"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');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants