creght-cli 0.3.1 → 0.4.1
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
|
@@ -121,25 +121,21 @@ The command writes a file-based workspace:
|
|
|
121
121
|
```text
|
|
122
122
|
mysite/
|
|
123
123
|
AGENTS.md
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
talizen.config.ts
|
|
124
|
+
page/...
|
|
125
|
+
component/...
|
|
126
|
+
talizen.config.ts
|
|
128
127
|
backend/
|
|
129
128
|
func/
|
|
130
129
|
booking.ts
|
|
131
130
|
profile/settings.ts
|
|
132
131
|
```
|
|
133
132
|
|
|
134
|
-
|
|
133
|
+
Local paths mirror remote site paths exactly: `page/Index.tsx` maps to
|
|
134
|
+
`/page/Index.tsx` and `backend/func/booking.ts` maps to
|
|
135
|
+
`/backend/func/booking.ts`.
|
|
135
136
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
- `backend/<p>` <-> remote `/backend/<p>`: the `backend/` prefix is kept, so
|
|
139
|
-
`backend/func/booking.ts` maps to `/backend/func/booking.ts`.
|
|
140
|
-
|
|
141
|
-
Everything under `frontend/` and `backend/` is an ordinary site file. Func
|
|
142
|
-
backend code is simply the set of site files under `backend/func/`; for example
|
|
137
|
+
Every file in the workspace is an ordinary site file. Func backend code is
|
|
138
|
+
simply the set of site files under `backend/func/`; for example
|
|
143
139
|
`backend/func/booking.ts` is the Func with key `booking`, and
|
|
144
140
|
`backend/func/profile/settings.ts` is `profile/settings`.
|
|
145
141
|
|
|
@@ -149,9 +145,9 @@ Creght projects pulled by the CLI usually do not have their own `package.json`
|
|
|
149
145
|
or `node_modules`. The local preview plugin therefore uses Vite only for local
|
|
150
146
|
file serving and TSX transpilation; third-party packages continue to resolve
|
|
151
147
|
through the Creght import map, matching the Web editor preview model. In
|
|
152
|
-
`creght dev`, the CLI serves the
|
|
153
|
-
|
|
154
|
-
|
|
148
|
+
`creght dev`, the CLI serves the workspace directory, loads the platform import
|
|
149
|
+
map from server system info, and passes it to the Vite plugin; the plugin's
|
|
150
|
+
local map is only a fallback.
|
|
155
151
|
|
|
156
152
|
Install Vite in the local project folder:
|
|
157
153
|
|
|
@@ -205,14 +201,11 @@ For local development:
|
|
|
205
201
|
CREGHT_API_HOST=http://localhost:8433 creght push --site_id=<project_id>/<site_id> --dir=./mysite
|
|
206
202
|
```
|
|
207
203
|
|
|
208
|
-
The CLI scans the local workspace and diffs every file
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
- `frontend/**` is synced to Creght site files with the `frontend/` root stripped.
|
|
212
|
-
- `backend/**` is synced to Creght site files keeping the `backend/` prefix, so
|
|
213
|
-
`backend/func/**/*.ts` becomes `/backend/func/**/*.ts`.
|
|
204
|
+
The CLI scans the local workspace and diffs every file against the remote site
|
|
205
|
+
files. Local paths map to remote paths as-is, so `page/Index.tsx` becomes
|
|
206
|
+
`/page/Index.tsx` and `backend/func/**/*.ts` becomes `/backend/func/**/*.ts`.
|
|
214
207
|
|
|
215
|
-
|
|
208
|
+
All files flow through the same site file mechanism (`file_list` /
|
|
216
209
|
`site_action`). Func code is not a separate resource; creating, editing,
|
|
217
210
|
renaming, or deleting a file under `backend/func/` creates, updates, renames, or
|
|
218
211
|
deletes the corresponding site file, and Func code is versioned and published
|
|
@@ -233,10 +226,10 @@ CREGHT_API_HOST=http://localhost:8433 creght sync --site_id=<project_id>/<site_i
|
|
|
233
226
|
```
|
|
234
227
|
|
|
235
228
|
`sync` first pushes the current local snapshot, then keeps running and
|
|
236
|
-
automatically listens for local file changes. When any file
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
229
|
+
automatically listens for local file changes. When any workspace file
|
|
230
|
+
(including Func code under `backend/func/`) changes locally, the CLI updates
|
|
231
|
+
the corresponding remote site file in realtime. The command also prints the
|
|
232
|
+
remote preview URL when available.
|
|
240
233
|
|
|
241
234
|
## Local Web Editor Bidirectional Sync
|
|
242
235
|
|
|
@@ -487,6 +480,10 @@ to self-test a Func method with sample input:
|
|
|
487
480
|
creght func run --site_id=<project_id>/<site_id> --key=booking.create --input=./input.json
|
|
488
481
|
```
|
|
489
482
|
|
|
483
|
+
The output matches the Func HTTP response protocol: successful runs print
|
|
484
|
+
`{"result": ...}` and thrown Func errors print `{"error": "..."}`. There is no
|
|
485
|
+
top-level `ok` execution wrapper.
|
|
486
|
+
|
|
490
487
|
There are no `creght func list/get/create/update/delete` commands. Manage Func
|
|
491
488
|
code by editing `backend/func` files and syncing them with pull/push/sync/dev
|
|
492
489
|
like any other site file; `func run` only runs sample input.
|
|
@@ -575,7 +572,7 @@ Command meanings:
|
|
|
575
572
|
- `login`: Authenticate this machine with Creght and save a CLI token for the current API host.
|
|
576
573
|
- `logout`: Remove the saved CLI login for the current API host.
|
|
577
574
|
- `project`: List available projects and sites. Use `project_id/site_id` with site commands. Also supports `project create`.
|
|
578
|
-
- `pull`: Download site files (
|
|
575
|
+
- `pull`: Download site files (including Func code under `backend/func/`) into a local workspace.
|
|
579
576
|
- `push`: Push the current local workspace snapshot to the remote site/project.
|
|
580
577
|
- `sync`: Watch mode; push the current snapshot, then keep listening for local changes.
|
|
581
578
|
- `dev`: Bidirectionally sync local files with cloud realtime files and the online Web editor.
|
package/package.json
CHANGED
|
Binary file
|
package/vendor/darwin-x64/creght
CHANGED
|
Binary file
|
|
Binary file
|
package/vendor/linux-x64/creght
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|