@palettelab/cli 0.3.39 → 0.3.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/lib/commands/doctor.js +3 -3
- package/lib/environments.js +1 -1
- package/lib/ports.js +14 -3
- package/package.json +1 -1
- package/platform-dev/docker-compose.yml +5 -5
package/README.md
CHANGED
|
@@ -467,8 +467,8 @@ pltt dev --platform
|
|
|
467
467
|
|
|
468
468
|
By default this starts:
|
|
469
469
|
|
|
470
|
-
- A small local app shell on the first available port starting at http://localhost:
|
|
471
|
-
- A local FastAPI backend runner on the first available port starting at http://localhost:
|
|
470
|
+
- A small local app shell on the first available port starting at http://localhost:7321
|
|
471
|
+
- A local FastAPI backend runner on the first available port starting at http://localhost:8732
|
|
472
472
|
- A mock Palette platform context for `usePlatform()`, OS language, toasts, org/user data, and authenticated API calls
|
|
473
473
|
- A plugin-local SQLite database under `.palette/dev/` when `capabilities.database` or `database` is enabled
|
|
474
474
|
|
|
@@ -487,7 +487,7 @@ local dev. The simulator imports `backend/api/models.py` when present and create
|
|
|
487
487
|
tables from `palette_sdk.db.PluginBase.metadata`. Production installs still use
|
|
488
488
|
the declared Alembic migrations and platform-managed Postgres/RLS.
|
|
489
489
|
|
|
490
|
-
`
|
|
490
|
+
`7321` and `8732` are preferred defaults, not hard requirements. If either port is already in use, `pltt dev` automatically picks the next free port and prints the actual URLs.
|
|
491
491
|
|
|
492
492
|
`pltt dev --sandbox` skips Docker and publishes a reviewable preview to a configured Palette sandbox. This is the payment-gateway-style flow: your app uses local SDKs, while real platform services such as login, Data Room, storage, database policies, logs, review, and publish lifecycle run in the hosted sandbox. It defaults to `--env staging` unless `--env` or `PALETTE_ENV` is set, adds a 24-hour preview TTL by default, and prints the preview/status/log commands returned by the platform.
|
|
493
493
|
|
|
@@ -508,8 +508,8 @@ Environment variables:
|
|
|
508
508
|
| Name | Default | Purpose |
|
|
509
509
|
|---|---|---|
|
|
510
510
|
| `PALETTE_DEV_IMAGE` | `ghcr.io/palette-lab/platform-dev:latest` | Override the platform image for `--platform` |
|
|
511
|
-
| `PALETTE_FRONTEND_PORT` | `
|
|
512
|
-
| `PALETTE_BACKEND_PORT` | `
|
|
511
|
+
| `PALETTE_FRONTEND_PORT` | `7321` | Preferred starting host port for the frontend |
|
|
512
|
+
| `PALETTE_BACKEND_PORT` | `8732` | Preferred starting host port for the backend |
|
|
513
513
|
| `PALETTE_DEV_DATABASE_URL` | `.palette/dev/<plugin-id>.sqlite3` | Override the local dev database URL |
|
|
514
514
|
| `APPSTORE_AUTO_APPROVE_SANDBOX_PREVIEWS` | `false` | Backend setting for hosted sandboxes; auto-approve passing preview publishes so developers can test full OS behavior without manual review |
|
|
515
515
|
|
package/lib/commands/doctor.js
CHANGED
|
@@ -5,13 +5,13 @@ const path = require("path")
|
|
|
5
5
|
const { spawnSync } = require("child_process")
|
|
6
6
|
const { loadManifest, validateManifest } = require("../manifest")
|
|
7
7
|
const { bundleFrontend } = require("../bundler")
|
|
8
|
-
const { resolveDevPorts } = require("../ports")
|
|
8
|
+
const { DEFAULT_BACKEND_DEV_PORT, DEFAULT_FRONTEND_DEV_PORT, resolveDevPorts } = require("../ports")
|
|
9
9
|
const { declaredSecrets, loadLocalEnv } = require("../secrets")
|
|
10
10
|
|
|
11
11
|
const DEFAULT_IMAGE =
|
|
12
12
|
process.env.PALETTE_DEV_IMAGE || "ghcr.io/palette-lab/platform-dev:latest"
|
|
13
|
-
const FRONTEND_PORT = Number(process.env.PALETTE_FRONTEND_PORT ||
|
|
14
|
-
const BACKEND_PORT = Number(process.env.PALETTE_BACKEND_PORT ||
|
|
13
|
+
const FRONTEND_PORT = Number(process.env.PALETTE_FRONTEND_PORT || DEFAULT_FRONTEND_DEV_PORT)
|
|
14
|
+
const BACKEND_PORT = Number(process.env.PALETTE_BACKEND_PORT || DEFAULT_BACKEND_DEV_PORT)
|
|
15
15
|
|
|
16
16
|
function ok(message) {
|
|
17
17
|
console.log(`OK ${message}`)
|
package/lib/environments.js
CHANGED
package/lib/ports.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
const net = require("net")
|
|
4
4
|
|
|
5
|
+
const DEFAULT_FRONTEND_DEV_PORT = 7321
|
|
6
|
+
const DEFAULT_BACKEND_DEV_PORT = 8732
|
|
7
|
+
|
|
5
8
|
function canBindPort(port, host = "0.0.0.0") {
|
|
6
9
|
return new Promise((resolve) => {
|
|
7
10
|
const server = net.createServer()
|
|
@@ -50,8 +53,8 @@ async function findFreePort(preferred, { host = "0.0.0.0", maxAttempts = 100 } =
|
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
async function resolveDevPorts({
|
|
53
|
-
frontend = process.env.PALETTE_FRONTEND_PORT ||
|
|
54
|
-
backend = process.env.PALETTE_BACKEND_PORT ||
|
|
56
|
+
frontend = process.env.PALETTE_FRONTEND_PORT || DEFAULT_FRONTEND_DEV_PORT,
|
|
57
|
+
backend = process.env.PALETTE_BACKEND_PORT || DEFAULT_BACKEND_DEV_PORT,
|
|
55
58
|
host = "0.0.0.0",
|
|
56
59
|
} = {}) {
|
|
57
60
|
const frontendPort = await findFreePort(frontend, { host })
|
|
@@ -65,4 +68,12 @@ async function resolveDevPorts({
|
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
70
|
|
|
68
|
-
module.exports = {
|
|
71
|
+
module.exports = {
|
|
72
|
+
DEFAULT_FRONTEND_DEV_PORT,
|
|
73
|
+
DEFAULT_BACKEND_DEV_PORT,
|
|
74
|
+
canBindPort,
|
|
75
|
+
canConnectPort,
|
|
76
|
+
isPortAvailable,
|
|
77
|
+
findFreePort,
|
|
78
|
+
resolveDevPorts,
|
|
79
|
+
}
|
package/package.json
CHANGED
|
@@ -10,8 +10,8 @@ services:
|
|
|
10
10
|
platform:
|
|
11
11
|
image: ${PALETTE_DEV_IMAGE:-ghcr.io/palette-lab/platform-dev:latest}
|
|
12
12
|
ports:
|
|
13
|
-
- "${PALETTE_FRONTEND_PORT:-
|
|
14
|
-
- "${PALETTE_BACKEND_PORT:-
|
|
13
|
+
- "${PALETTE_FRONTEND_PORT:-7321}:3000"
|
|
14
|
+
- "${PALETTE_BACKEND_PORT:-8732}:8000"
|
|
15
15
|
environment:
|
|
16
16
|
PALETTE_DEV_MODE: "1"
|
|
17
17
|
NEXT_PUBLIC_PALETTE_DEV_MODE: "1"
|
|
@@ -19,9 +19,9 @@ services:
|
|
|
19
19
|
DATABASE_URL: "postgresql+asyncpg://postgres:postgres@postgres:5432/app"
|
|
20
20
|
REDIS_URL: "redis://redis:6379/0"
|
|
21
21
|
JWT_SECRET: "dev-secret-do-not-use-in-prod"
|
|
22
|
-
FRONTEND_URL: "http://localhost:${PALETTE_FRONTEND_PORT:-
|
|
23
|
-
BACKEND_BASE_URL: "http://localhost:${PALETTE_BACKEND_PORT:-
|
|
24
|
-
NEXT_PUBLIC_API_URL: "http://localhost:${PALETTE_BACKEND_PORT:-
|
|
22
|
+
FRONTEND_URL: "http://localhost:${PALETTE_FRONTEND_PORT:-7321}"
|
|
23
|
+
BACKEND_BASE_URL: "http://localhost:${PALETTE_BACKEND_PORT:-8732}"
|
|
24
|
+
NEXT_PUBLIC_API_URL: "http://localhost:${PALETTE_BACKEND_PORT:-8732}"
|
|
25
25
|
STORAGE_BACKEND: "local"
|
|
26
26
|
LOCAL_STORAGE_DIR: "/srv/storage"
|
|
27
27
|
# Disable optional features that need real credentials
|