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 1 commit intomainfrom
Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.45-pr.370.7a9aac7Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.45-pr.370.7a9aac7"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.45-pr.370.7a9aac7"
}
}
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?
README.md
Outdated
| "outputDirectory": "dist" | ||
| } | ||
| } | ||
| ``` |
There was a problem hiding this comment.
We don't need to update the readme
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
| 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
Note
Description
Adds a
visibilityfield ("public"|"private") to the project config schema, allowing users to control app access directly frombase44/config.jsonc. Duringdeploy, ifvisibilityis set, the CLI sends aPATCHrequest to update the app'spublic_settingson the server. New projects are now created asprivateby default instead ofpublic_without_login.Related Issue
None
Type of Change
Changes Made
VisibilitySchema("public"|"private") andVisibilitytype tocore/project/schema.tsvisibilityfield toProjectConfigSchemaupdateProjectVisibility()API function incore/project/api.tsthat PATCHespublic_settingson the app endpointdeployAll()incore/project/deploy.ts— runs after resources are pushed, before site deploypublic_settingsfor new projects from"public_without_login"to"private"mockUpdateAppVisibility/mockUpdateAppVisibilityErrorhelpers andPATCHmethod support toTestAPIServertests/fixtures/with-visibility/fixture project withvisibility: "public"configdeploy.spec.tscovering: visibility sync success, API error propagation, and no-op when field is omittedproject-schema.spec.tsforvisibilityfield validationTesting
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
The
visibilityfield is optional — omitting it from config is a no-op (no PATCH is sent), so existing projects are unaffected. The mapping between the user-facing"public"/"private"values and the API'spublic_settingsstring is encapsulated inVISIBILITY_TO_PUBLIC_SETTINGSinapi.ts.🤖 Generated by Claude | 2026-03-17 08:17 UTC