feat: add visibility config field (public/private) to CLI#370
feat: add visibility config field (public/private) to CLI#370base44-os-gremlins[bot] wants to merge 6 commits intomainfrom
Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.47-pr.370.d2e964fPrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.47-pr.370.d2e964f"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.47-pr.370.d2e964f"
}
}
Preview published to npm registry — try new features instantly! |
kfirstri
left a comment
There was a problem hiding this comment.
Small change for the api.ts,
And I want to also think and take into consideration the link / create commands from a template.. can we have templates that are private by default and not public as default?
src/core/project/api.ts
Outdated
| visibility: Visibility, | ||
| ): Promise<void> { | ||
| try { | ||
| await base44Client.patch(`api/apps/${projectId}`, { |
There was a problem hiding this comment.
Use 'getAppClient' to get an app scoped http client, no need to pass the appid arg
There was a problem hiding this comment.
Investigated this — getAppClient().put("") doesn't work because getAppClient() sets prefixUrl to /api/apps/{id}/ (with trailing slash), but the server's PUT route is /api/apps/{item_id} (no trailing slash). The trailing slash causes a 404. Using base44Client.put(\api/apps/${id}`)with the explicit path works correctly. Also fixed the HTTP method from PATCH to PUT and theprivatemapping toprivate_with_login` (which is what the server validates against).
| export async function updateProjectVisibility( | ||
| projectId: string, | ||
| visibility: Visibility, | ||
| ): Promise<void> { |
There was a problem hiding this comment.
Maybe we also want to support this somewhere son the create / link commands?
Do we want to support this config in our templates?
|
Thanks for the review! Changes pushed in 2c6c99b: Addressed:
On templates/create/link: The |
|
This needs to be rebased after the monorepo change |
|
@netanelgilad you own this? |
|
yes |
|
@claude merge the main branch in and resolve conflicts after the monorepo change |
|
Claude finished @netanelgilad's task in 7m 37s —— View job Merged main into feat/visibility-config ✓The monorepo restructure on What changed:
Files updated:
Typecheck passes. Force-pushed to |
- Add VisibilitySchema and Visibility type to packages/cli/src/core/project/schema.ts - Add updateProjectVisibility() API function in packages/cli/src/core/project/api.ts - Change default public_settings for new projects from public_without_login to private - Integrate visibility sync into deployAll() in packages/cli/src/core/project/deploy.ts - Add PATCH support and mockUpdateAppVisibility helpers to TestAPIServer - Add project-schema unit tests and with-visibility fixture - Add integration tests for visibility sync in deploy.spec.ts Rebased onto monorepo structure (packages/cli/). Co-authored-by: Netanel Gilad <netanelgilad@users.noreply.github.com>
fffe95b to
899d5c8
Compare
… mapping The platform exposes PUT (not PATCH) for app updates, and expects "private_with_login" rather than "private" for the public_settings field. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep Visibility type import from feature branch alongside new functions (getAppUserToken, getSiteUrl) from main. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds "workspace" as a valid visibility value mapping to `workspace_with_login` (apps visible only to workspace members). This completes coverage of the platform's 4 visibility levels: public, private, and workspace. Adds a unit test for the new enum value.
|
Pushed an update to add Why: The platform has 4 visibility levels — the PR originally only covered 2. Workspace visibility is a real, commonly-used setting for teams on Business plans (visible to all workspace members, not the public). Changes:
Note: |
Add `visibility` field ("public" | "private" | "workspace") to the
base44-cli skill documentation — config example and property table.
This corresponds to the CLI change in base44/cli#370.
Goal: https://github.com/base44-dev/gremlins/issues/797
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Note
Description
Adds a
visibilityfield toProjectConfigSchemathat lets users declare app visibility (public,private, orworkspace) in theirbase44/config.jsonc. Duringdeploy, if the field is present, aPUT /api/apps/{id}call syncs the visibility to the API. Also changes the default visibility for newly created projects frompublic_without_logintoprivate_with_login.Related Issue
None
Type of Change
Changes Made
VisibilitySchema(Zod enum:"public" | "private" | "workspace") and exportedVisibilitytype fromcore/project/schema.tsvisibilityfield toProjectConfigSchemaupdateProjectVisibility()API function that mapsVisibilityvalues topublic_settingsstrings and callsPUT /api/apps/{id}updateProjectVisibility()intodeployAll()— called whenproject.visibilityis definedpublic_settingsforcreateProject()from"public_without_login"to"private_with_login"with-visibilitytest fixture with a config declaringvisibility: "public"mockUpdateAppVisibility/mockUpdateAppVisibilityErrorhelpers toTestAPIServerProjectConfigSchemavisibility field validationTesting
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
The
visibilityfield is optional and backward-compatible — projects without it are unaffected during deploy. The mapping from friendly names to API values (public_settings) is encapsulated inVISIBILITY_TO_PUBLIC_SETTINGSinapi.ts.🤖 Generated by Claude | 2026-03-22 16:33 UTC