feat: add genui-sdk submodule#66
Conversation
WalkthroughAdds genui-sdk as a Git submodule and integrates it into site navigation, routing, build (Vite alias/chunk), styling, dependency updates for home, and CI/CD workflows to initialize, install, and build the genui-sdk homepage. Changes
Sequence Diagram(s)sequenceDiagram
participant Actions as GitHub Actions
participant SSH as SSH Agent
participant Repo as Repository
participant Git as Git CLI
participant GenUI as genui-sdk
participant Home as Home build
Actions->>SSH: start agent (load key from secrets)
Actions->>Repo: checkout (fetch-depth:0, submodules:false)
Actions->>Git: set user.name / user.email
Actions->>Git: git submodule sync --recursive
Actions->>Git: git submodule update --init --recursive
Git->>Repo: populate `genui-sdk` submodule
Actions->>GenUI: cd genui-sdk && pnpm install
Actions->>GenUI: pnpm build:homepage
Actions->>Home: pnpm -F opentiny-design-home install && pnpm -F opentiny-design-home build
Actions->>Actions: collect & deploy artifacts
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/common/src/config/header.ts (1)
71-122: Header underline won’t activate for GenUI-SDK.
The underline logic doesn’t includegenui-sdk, so the ecosystem menu might not highlight on that page.💡 Proposed fix
- ['tiny-cli', 'tiny-charts', 'designtheme', 'pro', 'tiny-engine', 'tiny-ng', 'tiny-vue-mobile'].some((app) => + ['tiny-cli', 'tiny-charts', 'designtheme', 'pro', 'tiny-engine', 'tiny-ng', 'tiny-vue-mobile', 'genui-sdk'].some((app) => location.pathname.includes(app) )
🤖 Fix all issues with AI agents
In `@genui-sdk`:
- Line 1: The repository's git submodule reference points to a non-existent
commit ca4d369277d66eb071475519ec2cd84ba0e5833d in the genui-sdk submodule;
update the submodule entry to a valid commit by opening the submodule
(genui-sdk) and checking out a known-good commit or tag, then run git add on the
submodule and commit the updated gitlink (update .gitmodules/submodule entry if
needed) so the superproject references an existing commit in
https://github.com/opentiny/genui-sdk.git.
In `@packages/home/package.json`:
- Around line 20-55: The package.json lists "@opentiny/vue-renderless":
"~3.20.3" which is incompatible with the other "@opentiny/vue" packages at
3.25.x; update "@opentiny/vue-renderless" to "~3.25.0" to match the rest (or
alternatively downgrade all "@opentiny/vue*" entries to "3.20.3" if you must
keep renderless at 3.20.3), and verify the "@opentiny/genui-sdk-vue" entry
currently set to "workspace:*" actually exists as a local workspace package—if
not, replace "workspace:*" with the appropriate published version (e.g.,
"0.0.1-alpha.0" or later).
In `@packages/home/vite.config.js`:
- Around line 91-93: The vite alias '@/genui-sdk':
_resolve('../../genui-sdk/sites/homepage/web/dist') points to a missing git
submodule build output causing dev/build to fail when importing
'@/genui-sdk/index.js' and '@/genui-sdk/index.css' (see router.js imports); fix
by ensuring the genui-sdk submodule is initialized and its site is built before
Vite resolves the alias: add git submodule update --init --recursive to CI
job(s) and/or a root package.json postinstall script, and add a build step that
runs inside the genui-sdk (to produce sites/homepage/web/dist) before the home
site build step runs, or alternatively adjust the alias in vite.config.js to
point to the correct existing build output path.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/build-home.yml (1)
4-7: Missing path trigger for genui-sdk changes.The workflow builds
genui-sdkbut thepathsfilter only includespackages/home/**. Changes to thegenui-sdksubmodule won't trigger this workflow, potentially causing stale builds.🔧 Proposed fix
pull_request: types: [opened, reopened, synchronize, edited] paths: - 'packages/home/**' + - 'genui-sdk/**'
🧹 Nitpick comments (6)
.github/workflows/build-home.yml (3)
30-38: Git identity configuration is unnecessary; submodule steps are redundant.
- Git identity configuration (lines 30-33) is only needed for commits/pushes - this is a build-only workflow.
- The submodule sync/update steps (lines 34-38) are redundant since
submodules: recursivein the checkout action already initializes submodules.♻️ Suggested simplification
- - name: Configure Git identity - run: | - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - - name: Ensure submodules are up-to-date - run: | - git submodule sync --recursive - git submodule update --init --recursive - git submodule status --recursiveIf you want to keep submodule status verification for debugging purposes, retain only:
- name: Verify submodule status run: git submodule status --recursive
39-48: Using--no-frozen-lockfilereduces build reproducibility.Both install steps use
--no-frozen-lockfile, which allows dependency resolution to differ from the committed lockfile. This can lead to non-reproducible builds and potential "works on my machine" issues.Consider removing
--no-frozen-lockfileif possible, or document why lockfile bypass is necessary (e.g., submodule has its own lockfile management).
49-50: Build step lacks workspace filter for consistency.The install step uses
-F opentiny-design-homefilter, but the build step runs unfilteredpnpm build. This may build more packages than intended.♻️ Suggested fix for consistency
- name: Build home - run: pnpm build + run: pnpm -F opentiny-design-home build.github/workflows/build-common.yml (3)
30-33: Git identity configuration appears unnecessary.Git identity is only required for operations that create commits (merge, rebase, commit, etc.). The submodule sync/update operations don't require user identity. Consider removing this step unless there's a specific need.
34-38: Redundant submodule initialization.Since
actions/checkout@v4withsubmodules: recursivealready initializes and updates submodules, thegit submodule update --init --recursivecommand is redundant. Thesyncstep is only needed if submodule URLs might differ from.gitmodules.Consider simplifying to just the status check for debugging:
♻️ Suggested simplification
- name: Ensure submodules are up-to-date run: | - git submodule sync --recursive - git submodule update --init --recursive git submodule status --recursiveIf you need both as a safety net, that's acceptable but adds ~10-15 seconds to the build.
39-46:--no-frozen-lockfilemay cause non-reproducible builds.Using
--no-frozen-lockfileallows dependency resolution that may differ between runs, potentially causing inconsistent builds. If the lockfile in genui-sdk is out of sync, it's better to fix it at the source rather than bypass it in CI.Additionally, consider using
working-directoryfor cleaner syntax:♻️ Suggested improvements
- name: Install genui-sdk deps + working-directory: genui-sdk run: | - cd genui-sdk && pnpm install --no-frozen-lockfile + pnpm install --frozen-lockfile - name: Build genui-sdk homepage + working-directory: genui-sdk run: | - cd genui-sdk pnpm prebuild:homepage pnpm build:homepageIf the lockfile is intentionally not committed to genui-sdk, consider documenting this decision.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.github/workflows/build-common.yml:
- Around line 30-39: The CI step named "Ensure submodules are up-to-date"
currently runs "git submodule update --remote --merge" which advances submodules
to remote HEAD; change this step to only sync and update submodules to the
committed SHA by removing the "--remote --merge" invocation and keeping "git
submodule sync --recursive" and "git submodule update --init --recursive" (and
optionally "git submodule status --recursive") so the build uses the pinned
commits rather than fetching remote heads.
- Around line 19-25: The SSH agent step (webfactory/ssh-agent@v0.8.0) and the
recursive submodule checkout (actions/checkout@v4 with submodules: recursive)
must be guarded so secrets.SUBMODULE_SSH_KEY is not used for forked PRs; update
the workflow to add a conditional such as if: ${{ github.event.pull_request ==
null || github.repository == github.event.pull_request.head.repo.full_name }} on
the SSH step (and/or the Checkout repository step) so the SSH setup and
recursive submodule checkout run only for trusted contexts, or alternatively
change the genui-sdk submodule URL to HTTPS to avoid needing the SSH key.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/deploy-github.yml:
- Around line 37-42: The CI step "Ensure submodules are up-to-date" currently
uses git submodule update --remote --merge which fetches the latest remote
branch instead of the commit recorded in the superproject; remove or replace
that command so the workflow uses the pinned commit recorded in the superproject
(keep git submodule sync --recursive and git submodule update --init --recursive
and git submodule status --recursive) so CI checks out the committed submodule
revisions rather than pulling remotes — update the job step to no longer call
git submodule update --remote --merge.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @.github/workflows/build-common.yml:
- Around line 19-26: The SSH agent step using webfactory/ssh-agent@v0.8.0
currently runs unconditionally and fails on forked PRs due to missing
secrets.SUBMODULE_SSH_KEY; update the ssh-agent step (the step that specifies
ssh-private-key: ${{ secrets.SUBMODULE_SSH_KEY }}) to include a conditional
guard so it only runs for pushes or PRs originating from the same repo (use an
if like: github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository) to prevent
failures while keeping submodule SSH setup for trusted contexts.
In @.github/workflows/build-home.yml:
- Around line 35-40: The workflow currently runs "git submodule update --remote
--merge --recursive", which pulls the latest remote commits and breaks
reproducibility; update the workflow step to remove the --remote --merge flags
so it uses the pinned submodule commit (i.e., run "git submodule update --init
--recursive" or keep the existing "git submodule update --init --recursive" call
and delete the separate --remote --merge invocation) unless you explicitly want
CI to always track the latest submodule tip—if so, document that choice in the
job and accept the reproducibility trade-off.
- Around line 43-50: Update the CI workflow to enforce lockfile integrity and
ensure genui-sdk changes trigger rebuilds: in the "Install genui-sdk deps" and
main install steps (steps named "Install genui-sdk deps" and "Build genui-sdk
homepage") replace pnpm install --no-frozen-lockfile with pnpm install
--frozen-lockfile so CI fails on lockfile drift, and update the workflow "paths"
trigger to include genui-sdk/** (or remove the exclusion) so changes in the
genui-sdk submodule will trigger the pipeline.
🧹 Nitpick comments (4)
.github/workflows/build-home.yml (3)
31-34: Git identity configuration may be unnecessary.This workflow only builds artifacts and doesn't appear to make any commits. Git identity is typically only needed for
git commitoperations. If no commits are being made, these lines can be removed.Verify if Git identity is actually required
#!/bin/bash # Check if any git commit operations exist in this workflow or if submodule update --merge requires it rg -n "git commit|git push" .github/workflows/build-home.yml
41-42: Consider pinning tsx version for reproducibility.Installing
tsxwithout a version specifier may lead to inconsistent builds if a breaking change is released.Pin the tsx version
- name: Install tsx globally - run: pnpm add -g tsx + run: pnpm add -g tsx@4.7.0
46-50: Missing working-directory directive; consider using it for cleaner steps.Instead of
cd genui-sdk && ..., you can use theworking-directorydirective for cleaner YAML and better error handling if the directory doesn't exist.Suggested improvement
- name: Install genui-sdk deps - run: | - cd genui-sdk && pnpm install --no-frozen-lockfile + working-directory: genui-sdk + run: pnpm install --frozen-lockfile - name: Build genui-sdk homepage - run: | - cd genui-sdk - pnpm prebuild:homepage - pnpm build:homepage + working-directory: genui-sdk + run: | + pnpm prebuild:homepage + pnpm build:homepage.github/workflows/build-common.yml (1)
43-50: Consider using--frozen-lockfilefor reproducible CI builds.Using
--no-frozen-lockfile(line 45) allows pnpm to modify the lockfile during install, which can lead to inconsistent builds if dependencies have been updated. For CI reproducibility, prefer--frozen-lockfileand ensure the lockfile is committed and up-to-date.♻️ Suggested change
- name: Install genui-sdk deps run: | - cd genui-sdk && pnpm install --no-frozen-lockfile + cd genui-sdk && pnpm install --frozen-lockfile
9d2a2b0 to
6a46e85
Compare
6a46e85 to
cc531d1
Compare
…all` for submodules
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/deploy-obs.yml:
- Around line 40-41: Update the GitHub Actions step named "Checkout" to use the
newer checkout action version: replace the uses declaration referencing
"actions/checkout@v3" with "actions/checkout@v4" so the workflow matches other
workflows in the PR and benefits from v4 fixes and security updates.
🧹 Nitpick comments (3)
.github/workflows/build-common.yml (1)
31-34: Git identity configuration may no longer be needed.Since the
--remote --mergewas removed from the submodule update step, Git identity is no longer required (no merge commits are being created). Consider removing these lines to simplify the workflow.🔧 Suggested change
- name: Setup pnpm uses: pnpm/action-setup@v3 with: version: 9 - - name: Configure Git identity - run: | - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - name: Ensure submodules are up-to-date.github/workflows/deploy-obs.yml (1)
46-49: Git identity configuration may no longer be needed.Same as in
build-common.yml, since--remote --mergewas removed, Git identity is not required for the submodule update. Consider removing for cleaner workflow..github/workflows/deploy-github.yml (1)
33-36: Git identity configuration may no longer be needed.Consistent with other workflows, the Git identity step can be removed since no merge commits are being created after removing
--remote --merge.🔧 Suggested change
- name: Setup pnpm uses: pnpm/action-setup@v3 with: version: 9 - - name: Configure Git identity - run: | - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - name: Ensure submodules are up-to-date
* feat(genui-sdk): add genui submodule * feat(genui-sdk-home): complete genui sdk home develop * feat: genui sdk home page code migration * feat: delete genui assest resource * feat(genui-sdk-home): complete genui sdk home develop * feat: genui sdk home page code migration * feat: delete genui assest resource * feat: update genui-sdk icon * feat: modify the script to support building genui-sdk * feat: add build script key * fix: modify the submodule update method * fix: update build common * fix: modify git global config during build * fix: update build common submodule * fix: reset git global config during build * feat: update deploy script * feat: update import plugin config * feat: modify the script to globally install tsx before building * feat: workspace exclude genui-sdk output * feat: delete geui-sdk from workspace * feat: remove the prebuild process from the script * feat: modify env max_old_space_size * feat: modify genui-sdk submodule * fix: optimize the slow initial screen access of genui-sdk * feat: fix rabbit ai comment * feat: CI strictly uses the locked submodule versions in the repository * feat: delete NODE_OPTIONS * feat: optimize the building of the genui-sdk module * feat: modify genui-sdk homepage huawei obs deploy script * fix: remove the --no-frozen-lockfile option when executing `pnpm install` for submodules * feat: remove build script tsx install * feat: rename genui-sdk build step * feat: remove genui-sdk build step * feat: revert genui-sdk build step * feat: update genui-sdk commit * feat: update genui-sdk submodule commit
Summary by CodeRabbit
New Features
Improvements
Chores
✏️ Tip: You can customize this high-level summary in your review settings.