@palettelab/cli 0.3.10 → 0.3.12
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 +3 -0
- package/lib/commands/init.js +1 -0
- package/lib/commands/publish.js +4 -0
- package/lib/commands/status.js +1 -0
- package/lib/commands/test.js +18 -6
- package/package.json +1 -1
- package/template-fallback/pyproject.toml +1 -1
- package/template-fallback/templates/agent-tool/pyproject.toml +1 -1
- package/template-fallback/templates/dashboard/pyproject.toml +1 -1
- package/template-fallback/templates/database/pyproject.toml +1 -1
- package/template-fallback/templates/external-service/pyproject.toml +1 -1
package/README.md
CHANGED
|
@@ -123,10 +123,13 @@ pltt publish --env staging
|
|
|
123
123
|
pltt publish --env production
|
|
124
124
|
pltt publish --env production -y
|
|
125
125
|
pltt publish --env staging --json
|
|
126
|
+
pltt publish --env staging --ttl-hours 24
|
|
126
127
|
```
|
|
127
128
|
|
|
128
129
|
Publishing first runs the same contract checks as `pltt test`. If preflight passes, it bundles frontend/backend artifacts, uploads them, creates a `pending_review` publish record, and prints review/preview URLs when the platform returns them.
|
|
129
130
|
|
|
131
|
+
`--ttl-hours` sets an expiration on the preview URL. It is mainly used by `pltt dev --cloud`, which defaults previews to 24 hours.
|
|
132
|
+
|
|
130
133
|
Environment config is read from `./palette.config.json`, `~/.palette/config.json`, or `PALETTE_<ENV>_URL` plus `PALETTE_<ENV>_TOKEN` / `PALETTE_PUBLISH_TOKEN`.
|
|
131
134
|
|
|
132
135
|
### `pltt status <publish-id>`
|
package/lib/commands/init.js
CHANGED
|
@@ -116,6 +116,7 @@ async function run(args, { cwd }) {
|
|
|
116
116
|
console.log(`[pltt] created ${destDir}`)
|
|
117
117
|
console.log("[pltt] next steps:")
|
|
118
118
|
console.log(` cd ${slug}`)
|
|
119
|
+
console.log(" npm install")
|
|
119
120
|
console.log(` npx @palettelab/cli dev`)
|
|
120
121
|
console.log(` # or, after global install: pltt dev`)
|
|
121
122
|
}
|
package/lib/commands/publish.js
CHANGED
|
@@ -191,6 +191,7 @@ async function run(argv, { cwd }) {
|
|
|
191
191
|
env: env.name,
|
|
192
192
|
url: env.url,
|
|
193
193
|
preview_url: record.preview_url,
|
|
194
|
+
preview_expires_at: record.preview_expires_at,
|
|
194
195
|
published_at: new Date().toISOString(),
|
|
195
196
|
},
|
|
196
197
|
null,
|
|
@@ -216,6 +217,9 @@ async function run(argv, { cwd }) {
|
|
|
216
217
|
if (record.preview_url) {
|
|
217
218
|
console.log(`[pltt] preview: ${record.preview_url}`)
|
|
218
219
|
}
|
|
220
|
+
if (record.preview_expires_at) {
|
|
221
|
+
console.log(`[pltt] preview expires: ${record.preview_expires_at}`)
|
|
222
|
+
}
|
|
219
223
|
console.log(`[pltt] once approved, live at ${env.url}${record.catalog_url}`)
|
|
220
224
|
return record
|
|
221
225
|
}
|
package/lib/commands/status.js
CHANGED
|
@@ -67,6 +67,7 @@ async function run(argv, { cwd }) {
|
|
|
67
67
|
if (data.review_decision) console.log(` decision: ${data.review_decision}`)
|
|
68
68
|
if (data.review_reason) console.log(` reason: ${data.review_reason}`)
|
|
69
69
|
if (data.preview_url) console.log(` preview: ${data.preview_url}`)
|
|
70
|
+
if (data.preview_expires_at) console.log(` expires: ${data.preview_expires_at}`)
|
|
70
71
|
console.log(` published: ${data.published_at}`)
|
|
71
72
|
if (data.report) {
|
|
72
73
|
console.log(` risk: ${data.report.risk_score.toUpperCase()}`)
|
package/lib/commands/test.js
CHANGED
|
@@ -35,20 +35,27 @@ function reporter(json, results) {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
function localBackendSdkPath() {
|
|
39
|
+
const candidate = path.resolve(__dirname, "..", "..", "..", "backend")
|
|
40
|
+
return fs.existsSync(path.join(candidate, "palette_sdk")) ? candidate : null
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function localBackendSdkPython() {
|
|
44
|
+
const sdkPath = localBackendSdkPath()
|
|
45
|
+
if (!sdkPath) return null
|
|
46
|
+
const candidate = path.join(sdkPath, ".venv", "bin", "python")
|
|
47
|
+
return fs.existsSync(candidate) ? candidate : null
|
|
48
|
+
}
|
|
49
|
+
|
|
38
50
|
function backendPython(cwd) {
|
|
39
51
|
return (
|
|
40
52
|
process.env.PALETTE_PYTHON ||
|
|
41
53
|
(fs.existsSync(path.join(cwd, ".venv", "bin", "python"))
|
|
42
54
|
? path.join(cwd, ".venv", "bin", "python")
|
|
43
|
-
: "python3")
|
|
55
|
+
: localBackendSdkPython() || "python3")
|
|
44
56
|
)
|
|
45
57
|
}
|
|
46
58
|
|
|
47
|
-
function localBackendSdkPath() {
|
|
48
|
-
const candidate = path.resolve(__dirname, "..", "..", "..", "backend")
|
|
49
|
-
return fs.existsSync(path.join(candidate, "palette_sdk")) ? candidate : null
|
|
50
|
-
}
|
|
51
|
-
|
|
52
59
|
function pythonEnv(extra = {}) {
|
|
53
60
|
const paths = []
|
|
54
61
|
if (extra.PYTHONPATH) paths.push(extra.PYTHONPATH)
|
|
@@ -76,6 +83,11 @@ function installPythonDependencies(cwd, out) {
|
|
|
76
83
|
}
|
|
77
84
|
|
|
78
85
|
const hostPython = backendPython(cwd)
|
|
86
|
+
if (hostPython === localBackendSdkPython()) {
|
|
87
|
+
out.ok("using local backend SDK virtualenv for backend import checks", { dependencies: deps })
|
|
88
|
+
return { python: hostPython, env: pythonEnv(), failures: 0, dependencies: deps }
|
|
89
|
+
}
|
|
90
|
+
|
|
79
91
|
const venvDir = path.join(cwd, ".palette", "test-venv")
|
|
80
92
|
const venvPython = path.join(venvDir, "bin", "python")
|
|
81
93
|
const lockPath = path.join(venvDir, ".palette-deps-lock")
|
package/package.json
CHANGED
|
@@ -14,5 +14,5 @@ requires-python = ">=3.12"
|
|
|
14
14
|
dependencies = [
|
|
15
15
|
"fastapi>=0.129.0",
|
|
16
16
|
"sqlalchemy>=2.0.47",
|
|
17
|
-
|
|
17
|
+
"palette-sdk @ https://github.com/palette-lab/palette-virtual-organization-backend/releases/download/sdk-backend-v0.1.0/palette_sdk-0.1.0-py3-none-any.whl",
|
|
18
18
|
]
|
|
@@ -5,5 +5,5 @@ requires-python = ">=3.12"
|
|
|
5
5
|
dependencies = [
|
|
6
6
|
"fastapi>=0.129.0",
|
|
7
7
|
"pydantic>=2.12.0",
|
|
8
|
-
|
|
8
|
+
"palette-sdk @ https://github.com/palette-lab/palette-virtual-organization-backend/releases/download/sdk-backend-v0.1.0/palette_sdk-0.1.0-py3-none-any.whl",
|
|
9
9
|
]
|
|
@@ -4,5 +4,5 @@ version = "1.0.0"
|
|
|
4
4
|
requires-python = ">=3.12"
|
|
5
5
|
dependencies = [
|
|
6
6
|
"fastapi>=0.129.0",
|
|
7
|
-
|
|
7
|
+
"palette-sdk @ https://github.com/palette-lab/palette-virtual-organization-backend/releases/download/sdk-backend-v0.1.0/palette_sdk-0.1.0-py3-none-any.whl",
|
|
8
8
|
]
|
|
@@ -6,5 +6,5 @@ dependencies = [
|
|
|
6
6
|
"fastapi>=0.129.0",
|
|
7
7
|
"sqlalchemy>=2.0.47",
|
|
8
8
|
"alembic>=1.17.0",
|
|
9
|
-
|
|
9
|
+
"palette-sdk @ https://github.com/palette-lab/palette-virtual-organization-backend/releases/download/sdk-backend-v0.1.0/palette_sdk-0.1.0-py3-none-any.whl",
|
|
10
10
|
]
|
|
@@ -5,5 +5,5 @@ requires-python = ">=3.12"
|
|
|
5
5
|
dependencies = [
|
|
6
6
|
"fastapi>=0.129.0",
|
|
7
7
|
"httpx>=0.28.0",
|
|
8
|
-
|
|
8
|
+
"palette-sdk @ https://github.com/palette-lab/palette-virtual-organization-backend/releases/download/sdk-backend-v0.1.0/palette_sdk-0.1.0-py3-none-any.whl",
|
|
9
9
|
]
|