@palettelab/cli 0.3.10 → 0.3.11

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 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>`
@@ -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
  }
@@ -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()}`)
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@palettelab/cli",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
4
4
  "description": "Developer CLI for building Palette platform plugins — no platform source access required.",
5
5
  "bin": {
6
6
  "pltt": "bin/pltt.js"