buildx-cli 1.0.16 → 1.0.18
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 +2 -0
- package/dist/README.md +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/package.json +1 -1
- package/dist/templates/function-as-code-guide.md +45 -0
- package/dist/templates/schema-as-code-guide.md +46 -0
- package/package.json +2 -2
package/dist/package.json
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Buildx Function As-Code Quick Guide
|
|
2
|
+
|
|
3
|
+
Project: `{{PROJECT_ID}}`
|
|
4
|
+
|
|
5
|
+
## What this folder is
|
|
6
|
+
|
|
7
|
+
This pull creates local function artifacts so the target app can read/edit code safely before pushing back:
|
|
8
|
+
|
|
9
|
+
- `function-context.d.ts`: shared context/data types for authoring.
|
|
10
|
+
- `functions/*.ts`: one file per remote function.
|
|
11
|
+
- `functions/functions.manifest.json`: sync metadata + checksums for drift detection.
|
|
12
|
+
|
|
13
|
+
## Runtime shape (important)
|
|
14
|
+
|
|
15
|
+
Buildx function runtime expects wrapper function shape:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
async (data: FlowData, context: FlowContext) => {
|
|
19
|
+
// logic
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This wrapper is the source-of-truth shape in platform runtime. Keep it valid before push.
|
|
24
|
+
|
|
25
|
+
## Pull / Diff / Push flow
|
|
26
|
+
|
|
27
|
+
1. Pull from remote:
|
|
28
|
+
- `buildx-cli function:pull --project-id {{PROJECT_ID}}`
|
|
29
|
+
2. Edit local files in `functions/`
|
|
30
|
+
3. Validate changes:
|
|
31
|
+
- `buildx-cli function:diff --project-id {{PROJECT_ID}}`
|
|
32
|
+
4. Push back:
|
|
33
|
+
- `buildx-cli function:push --project-id {{PROJECT_ID}} --dry-run`
|
|
34
|
+
- remove `--dry-run` when ready.
|
|
35
|
+
|
|
36
|
+
## Safety checks
|
|
37
|
+
|
|
38
|
+
- `function:push` validates runtime wrapper compatibility by default.
|
|
39
|
+
- `function:push` runs basic lint/syntax checks by default.
|
|
40
|
+
- Use `--force` only when you intentionally override remote drift.
|
|
41
|
+
|
|
42
|
+
## SDK pointers
|
|
43
|
+
|
|
44
|
+
- Use `buildx-sdk` for app runtime/API integration.
|
|
45
|
+
- Use this CLI for as-code sync flow (pull/diff/push) and project-aligned artifacts.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Buildx As-Code Quick Guide
|
|
2
|
+
|
|
3
|
+
This folder is generated for project-level collaboration between developers and AI tools.
|
|
4
|
+
Project: `{{PROJECT_ID}}`
|
|
5
|
+
|
|
6
|
+
## Core Concepts
|
|
7
|
+
- `Bx*` types are platform base types used in generated TypeScript.
|
|
8
|
+
- `collections.json` is collections-as-code (deployable schema payload).
|
|
9
|
+
- `types.ts` is developer-facing contract (editing-friendly, annotation-friendly).
|
|
10
|
+
- `collections.manifest.json` is checksum metadata for drift/conflict checks.
|
|
11
|
+
|
|
12
|
+
## What `Bx*` Means
|
|
13
|
+
- `BxText`, `BxLongText`, `BxNumber`, `BxDate`, `BxDateTime`, `BxChoices`, etc. map to platform field types.
|
|
14
|
+
- `BxDataObject` / `BxDataObjects` represent cross-collection references.
|
|
15
|
+
- `BxUser` / `BxUsers` / `BxAuth` represent user/auth-oriented structures.
|
|
16
|
+
- `BxFiles` / `BxImages` are array-capable media types.
|
|
17
|
+
- Some aliases are normalized by CLI during pull for consistency.
|
|
18
|
+
|
|
19
|
+
## Collection As Code Rules
|
|
20
|
+
- `collection_id` is immutable identity. Do not rename or duplicate.
|
|
21
|
+
- System-managed fields are runtime-only in types and are excluded from sync payload:
|
|
22
|
+
- `createdAt`, `updatedAt`, `createdBy`, `updatedBy`
|
|
23
|
+
- `timestamps: true` => `types.ts` includes `createdAt`/`updatedAt`.
|
|
24
|
+
- `auditable: true` => `types.ts` includes `createdBy`/`updatedBy`.
|
|
25
|
+
- `createdBy`/`updatedBy` follow datastore auth shape (`BxAuth`).
|
|
26
|
+
- CLI normalizes schema for compatibility (children/ref/inherited flags/user-ref cleanup).
|
|
27
|
+
|
|
28
|
+
## Function As Code Rules
|
|
29
|
+
- Platform runtime expects function source as async wrapper form.
|
|
30
|
+
- Keep function files compatible with runtime wrapper constraints before push.
|
|
31
|
+
- Use `function:pull`, `function:diff`, `function:push` to control drift and updates.
|
|
32
|
+
|
|
33
|
+
## SDK Usage (buildx-sdk)
|
|
34
|
+
- `buildx.collections()` for schema/data collection operations.
|
|
35
|
+
- `buildx.functions()` for function source/log updates.
|
|
36
|
+
- Use SDK in app/runtime code; use CLI for as-code pull/convert/diff/push lifecycle.
|
|
37
|
+
|
|
38
|
+
## Where To Look Next
|
|
39
|
+
- CLI command details: `buildx-cli/README.md`
|
|
40
|
+
- SDK API surface: `buildx-sdk/README.md`
|
|
41
|
+
- Runtime behavior source: datastore collection/function services
|
|
42
|
+
|
|
43
|
+
## Practical Limits
|
|
44
|
+
- `types.ts` is a collaboration/editing artifact; `collections.json` is deployment payload.
|
|
45
|
+
- Not every TypeScript expression can map 1:1 to platform schema semantics.
|
|
46
|
+
- Always validate with `schema:diff` (and `--details`) before push.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buildx-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "CLI tool for BuildX API with authentication and schema synchronization",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.cjs",
|
|
@@ -83,4 +83,4 @@
|
|
|
83
83
|
"engines": {
|
|
84
84
|
"node": ">=16.0.0"
|
|
85
85
|
}
|
|
86
|
-
}
|
|
86
|
+
}
|