feat: apps support multi dev modes#1175
Conversation
* feat: accept fullstack app-type and require --message for it * feat: inject message into fullstack create request body * refactor: align fullstack message injection with existing body-build style * docs: document fullstack app-type and --message for apps +create * docs: keep scene numbering consistent in lark-apps-create reference * docs: add HTML/fullstack intent routing to lark-apps SKILL.md * docs: cover fullstack in lark-apps skill description and clarify HTML flow step * test: assert fullstack in allow-list error and reject wrong-cased fullstack
📝 WalkthroughWalkthroughThis PR extends the Lark CLI app creation workflow to support fullstack applications alongside existing HTML apps. A new ChangesFullstack App Type Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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.
🧹 Nitpick comments (1)
shortcuts/apps/apps_create.go (1)
41-41: 💤 Low valueAllowed-values list is duplicated across three sites and can drift.
The supported types now appear in the flag help text (Line 27:
"HTML or fullstack"), the validation error (Line 41:"allowed: HTML, fullstack"), and thevalidAppTypesmap (Lines 67-70). Adding a future type means editing all three, and a missed edit produces a misleading user-facing error. Consider deriving the allowed-values string from the map (sorted for deterministic output).♻️ Example: derive the list from
validAppTypesfunc allowedAppTypes() string { keys := make([]string, 0, len(validAppTypes)) for k := range validAppTypes { keys = append(keys, k) } sort.Strings(keys) return strings.Join(keys, ", ") }- return output.ErrValidation(fmt.Sprintf("--app-type %q is not supported (allowed: HTML, fullstack)", appType)) + return output.ErrValidation(fmt.Sprintf("--app-type %q is not supported (allowed: %s)", appType, allowedAppTypes()))🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shortcuts/apps/apps_create.go` at line 41, The error message and flag help duplicate the allowed app types; derive the user-facing list from the canonical validAppTypes map instead of hardcoding: add a helper (e.g., allowedAppTypes()) that collects keys from validAppTypes, sorts them deterministically, and returns a comma-separated string, then use that helper in the flag help text and in the validation error inside the code that returns output.ErrValidation(fmt.Sprintf("--app-type %q is not supported (allowed: %s)", appType, allowedAppTypes())). Ensure you reference validAppTypes when building the list so future type additions only require updating that map.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@shortcuts/apps/apps_create.go`:
- Line 41: The error message and flag help duplicate the allowed app types;
derive the user-facing list from the canonical validAppTypes map instead of
hardcoding: add a helper (e.g., allowedAppTypes()) that collects keys from
validAppTypes, sorts them deterministically, and returns a comma-separated
string, then use that helper in the flag help text and in the validation error
inside the code that returns output.ErrValidation(fmt.Sprintf("--app-type %q is
not supported (allowed: %s)", appType, allowedAppTypes())). Ensure you reference
validAppTypes when building the list so future type additions only require
updating that map.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 392d9f38-c111-4570-b3f0-3cd6e06760f6
📒 Files selected for processing (4)
shortcuts/apps/apps_create.goshortcuts/apps/apps_create_test.goskills/lark-apps/SKILL.mdskills/lark-apps/references/lark-apps-create.md
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1175 +/- ##
==========================================
+ Coverage 68.78% 68.92% +0.14%
==========================================
Files 628 629 +1
Lines 58680 58767 +87
==========================================
+ Hits 40363 40508 +145
+ Misses 15021 14952 -69
- Partials 3296 3307 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@06a77dcc68ef9222fd06c6783cd24d0b586d43fc🧩 Skill updatenpx skills add raistlin042/cli#feat/lark-apps-dev -y -g |
Summary
Add a
fullstackapp type toapps +createalongside the existingHTML. When--app-type fullstack, a new--messageflag is required and forwarded verbatim in the create request body so the server can generate the app from the user's description. ForHTML,--messageis silently ignored. The lark-apps skill now routes between HTML and fullstack based on the user's intent.Changes
fullstackto the app-type allow-list and a new--messageflag inshortcuts/apps/apps_create.go; conditional validation (fullstack requires non-blank message) and request-body injection ofmessageonly for fullstack.shortcuts/apps/apps_create_test.go: fullstack success, required/blank message rejection, HTML message-ignore, dry-run, and case-sensitive rejection.--message, the fullstack scenario, and skill description trigger words inskills/lark-apps/SKILL.mdandskills/lark-apps/references/lark-apps-create.md.Test Plan
make unit-testpassed (./shortcuts/apps/green)lark-cli apps +create --name "团队任务看板" --app-type fullstack --message "带登录和数据库的任务看板" --dry-run --as user— request body carriesapp_type: fullstackandmessage; missing message exits 2message) is tentative; real create verification is deferred until the backend shipsRelated Issues
N/A
Summary by CodeRabbit
New Features
--messageflag (required for fullstack apps) to specify app detailsTests
Documentation