@vincentt-xr/cli 0.9.0 → 0.10.0
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 +40 -13
- package/dist/cli/args.d.ts +12 -0
- package/dist/cli/args.js +40 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +296 -95
- package/dist/cli/usage-text.d.ts +1 -0
- package/dist/cli/usage-text.js +97 -0
- package/dist/cli/verb-surface.d.ts +24 -0
- package/dist/cli/verb-surface.js +49 -0
- package/dist/dx/clusters.d.ts +0 -17
- package/dist/dx/clusters.js +50 -1
- package/dist/lib/backend.d.ts +11 -0
- package/dist/lib/backend.js +23 -0
- package/dist/lib/classifyTarget.d.ts +42 -0
- package/dist/lib/classifyTarget.js +83 -0
- package/dist/lib/feedback.d.ts +46 -5
- package/dist/lib/feedback.js +76 -19
- package/dist/lib/feedbackCopy.d.ts +70 -0
- package/dist/lib/feedbackCopy.js +163 -0
- package/dist/lib/initFrom.d.ts +26 -4
- package/dist/lib/initFrom.js +65 -41
- package/dist/lib/lifecycle.d.ts +28 -3
- package/dist/lib/lifecycle.js +99 -7
- package/dist/lib/listProjects.d.ts +41 -0
- package/dist/lib/listProjects.js +77 -0
- package/dist/lib/projects.d.ts +64 -8
- package/dist/lib/projects.js +316 -24
- package/dist/lib/sourceRefCopy.d.ts +19 -0
- package/dist/lib/sourceRefCopy.js +36 -0
- package/dist/preview/command.d.ts +11 -0
- package/dist/preview/command.js +19 -1
- package/dist/preview/copy.d.ts +7 -0
- package/dist/preview/copy.js +8 -1
- package/dist/preview/runner.d.ts +6 -0
- package/dist/preview/runner.js +1 -0
- package/dist/preview/stream.d.ts +11 -0
- package/dist/preview/stream.js +13 -0
- package/dist/relay/annotations.d.ts +28 -4
- package/dist/relay/annotations.js +23 -7
- package/dist/relay/qa.f12.fixtures.d.ts +154 -0
- package/dist/relay/qa.f12.fixtures.js +358 -0
- package/dist/relay/server.d.ts +41 -3
- package/dist/relay/server.js +90 -32
- package/package.json +2 -2
- package/dist/library/qa.f5-b32.spec.d.ts +0 -1
- package/dist/library/qa.f5-b32.spec.js +0 -202
- package/dist/library/qa.f5-cli.spec.d.ts +0 -1
- package/dist/library/qa.f5-cli.spec.js +0 -433
- package/dist/library/qa.f5-contract.spec.d.ts +0 -1
- package/dist/library/qa.f5-contract.spec.js +0 -206
- package/dist/relay/injectors.d.ts +0 -29
- package/dist/relay/injectors.js +0 -72
package/README.md
CHANGED
|
@@ -17,16 +17,20 @@ order. It matters:
|
|
|
17
17
|
not run `create` until you have it. The name becomes the live subdomain
|
|
18
18
|
(`<slug>.vincentt.app`), so it is worth one question.
|
|
19
19
|
|
|
20
|
-
2. **
|
|
20
|
+
2. **Create the project:**
|
|
21
21
|
|
|
22
22
|
```
|
|
23
|
-
npx -y @vincentt-xr/cli@latest create --name "<name>"
|
|
23
|
+
npx -y @vincentt-xr/cli@latest create <name> --name "<name>"
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
In an **empty** folder this writes a complete, runnable starter (an AR app that
|
|
27
|
+
previews as-is), installs its dependencies, and then registers the project and
|
|
28
|
+
reserves its address. In a folder that is already a Vincentt app it only
|
|
29
|
+
registers. In any other non-empty folder it refuses and says what to run.
|
|
30
|
+
|
|
31
|
+
The scaffolding half needs no account. The registering half does: if you are
|
|
32
|
+
not signed in yet, the command opens a browser for the developer to approve
|
|
33
|
+
once, then continues. That is the only human step.
|
|
30
34
|
|
|
31
35
|
3. **Read `AGENTS.md` in the new project, then stop.** The scaffold is already a
|
|
32
36
|
working starter. **Do not invent an app or start building a scene.** Tell the
|
|
@@ -37,25 +41,39 @@ order. It matters:
|
|
|
37
41
|
project root) are the authoritative guides for the dev loop and the SDK API.
|
|
38
42
|
Read the SDK reference at the point you write a scene, not before.
|
|
39
43
|
|
|
40
|
-
The short version: **ask for a name,
|
|
44
|
+
The short version: **ask for a name, create, confirm it is ready, wait for the
|
|
41
45
|
idea.** Everything after first contact is driven from the project's own
|
|
42
46
|
`AGENTS.md`.
|
|
43
47
|
|
|
44
48
|
## Commands
|
|
45
49
|
|
|
50
|
+
`init` needs no account, ever — the template is yours to scaffold and run locally
|
|
51
|
+
whether or not you sign in. `create` also scaffolds an empty folder, and then
|
|
52
|
+
registers the project, which is what needs an account.
|
|
53
|
+
|
|
46
54
|
```
|
|
47
55
|
Auth
|
|
48
56
|
login Sign in; save an access token to ~/.vincentt/config.json
|
|
49
57
|
logout Remove the saved access token
|
|
50
58
|
whoami Show the signed-in account
|
|
51
59
|
|
|
60
|
+
Project
|
|
61
|
+
init [dir] Scaffold a Vincentt XR app — no account needed, ever
|
|
62
|
+
[--no-install] [--template <version>]
|
|
63
|
+
[--from <owner>/<repo>@<tag>]
|
|
64
|
+
create [name] Register a project and reserve its address; scaffolds first
|
|
65
|
+
if the folder is empty
|
|
66
|
+
[--name <s>] [--slug <s>] [--org <s>] [--preview]
|
|
67
|
+
[--force] [--no-install]
|
|
68
|
+
link <project-id> Link this directory to an existing project
|
|
69
|
+
unlink Detach this directory from its project
|
|
70
|
+
projects List the workspace's projects and their ids
|
|
71
|
+
[--json] [--org <s>]
|
|
72
|
+
|
|
52
73
|
Dev loop
|
|
53
|
-
create Scaffold + bind a project (empty dir -> full starter)
|
|
54
|
-
[--name <s>] [--slug <s>] [--preview] [--force]
|
|
55
74
|
publish Upload the built dist; go live at <slug>.vincentt.app
|
|
56
75
|
preview Serve + tunnel the app for on-device preview
|
|
57
76
|
(prints a desktop QR page to scan) [--stop]
|
|
58
|
-
unbind Detach this directory from its project
|
|
59
77
|
|
|
60
78
|
Diagnostics (need a running preview)
|
|
61
79
|
logs [--errors] Console logs from the device [--json]
|
|
@@ -75,9 +93,10 @@ Meta
|
|
|
75
93
|
Common options: --dir <path> (project dir, default cwd)
|
|
76
94
|
```
|
|
77
95
|
|
|
78
|
-
Auth-needing verbs (`create
|
|
79
|
-
run: with no saved token they open the browser to
|
|
80
|
-
token lives in `~/.vincentt/config.json` and
|
|
96
|
+
Auth-needing verbs (`create`'s registering half, `preview`, `publish`) fold
|
|
97
|
+
sign-in into the first run: with no saved token they open the browser to
|
|
98
|
+
authorize this device, then the token lives in `~/.vincentt/config.json` and
|
|
99
|
+
later verbs run without prompting. `init` never reaches that gate at all.
|
|
81
100
|
|
|
82
101
|
## The loop, once a project exists
|
|
83
102
|
|
|
@@ -89,8 +108,16 @@ token lives in `~/.vincentt/config.json` and later verbs run without prompting.
|
|
|
89
108
|
preview relay. Debug on-device misbehavior instead of guessing.
|
|
90
109
|
- `npx vincentt feedback --wait` — block for the next annotation the developer
|
|
91
110
|
draws on the phone preview, print it as JSON, and exit.
|
|
111
|
+
- `npx vincentt preview --stop` — stop a preview started from another terminal.
|
|
112
|
+
When the relay can still be reached it reports how many connections are
|
|
113
|
+
attached first, so nobody blanks four phones without seeing that they are
|
|
114
|
+
there. A count that cannot be read prints no line rather than a guess.
|
|
92
115
|
- `npx vincentt publish` — build (`pnpm build`), then upload the built `dist/` and
|
|
93
116
|
return the live `<slug>.vincentt.app` URL. Nothing builds server-side.
|
|
94
117
|
|
|
118
|
+
In a directory that is not linked to anything, `npx vincentt projects` lists the
|
|
119
|
+
workspace's projects with their ids, which is what `vincentt link <project-id>`
|
|
120
|
+
needs. `--json` prints the same rows for a program to read.
|
|
121
|
+
|
|
95
122
|
`vincentt` is a project devDependency in the scaffold, so invoke it as
|
|
96
123
|
`npx vincentt <verb>` and it resolves to the local copy — no global install.
|
package/dist/cli/args.d.ts
CHANGED
|
@@ -32,6 +32,18 @@ export interface ArgConflict {
|
|
|
32
32
|
* work begins. Returns the conflict to report, or undefined.
|
|
33
33
|
*/
|
|
34
34
|
export declare function fromFlagConflict(args: string[]): ArgConflict | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* The offending flag on a `create` invocation, or undefined.
|
|
37
|
+
*
|
|
38
|
+
* The `.split("=")[0]` is load-bearing and is NOT what `flag()` does. `flag()` is a
|
|
39
|
+
* bare `argv.indexOf(name)`, which cannot see `--template=1.0.0` at all — copying
|
|
40
|
+
* its idiom here would let the equals spelling through in silence, which is the
|
|
41
|
+
* whole of the control. Case-SENSITIVE, deliberately: case-folding would turn
|
|
42
|
+
* `--TEMPLATE` into a flag that this refusal recognises and the rest of the CLI
|
|
43
|
+
* does not, i.e. a refusal for an input that was never going to work anyway, while
|
|
44
|
+
* teaching a reader that the two spellings are equivalent.
|
|
45
|
+
*/
|
|
46
|
+
export declare function createSourceFlagRefusal(args: string[]): string | undefined;
|
|
35
47
|
export declare function refusedFlag(args: string[]): string | undefined;
|
|
36
48
|
/**
|
|
37
49
|
* The bare arguments, with flag VALUES removed. Without this, `vincentt link --dir
|
package/dist/cli/args.js
CHANGED
|
@@ -75,6 +75,46 @@ export function fromFlagConflict(args) {
|
|
|
75
75
|
}
|
|
76
76
|
return undefined;
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Source-selecting flags `create` must never honor.
|
|
80
|
+
*
|
|
81
|
+
* `create` clones TEMPLATE_REPO at `latest` and nothing else, and the decision to
|
|
82
|
+
* INSTALL dependencies on the unauthenticated scaffold path rests entirely on that
|
|
83
|
+
* being structurally true (f6's S-1 refuses an install only for a repo WE DO NOT
|
|
84
|
+
* CONTROL; scoping it, rather than overriding it, requires that `create` cannot be
|
|
85
|
+
* pointed anywhere else).
|
|
86
|
+
*
|
|
87
|
+
* Refused HERE rather than by not reading the flag, for the same reason
|
|
88
|
+
* INSTALL_ENABLING_FLAGS is: `flag()` is a global argv scan with no per-verb gate,
|
|
89
|
+
* so honoring one is a one-line accident, while defeating this refusal means
|
|
90
|
+
* deleting it, which is a reviewable act.
|
|
91
|
+
*
|
|
92
|
+
* Same flag, same code, different blast radius: on `init` the scaffold IS the
|
|
93
|
+
* command and a creator typed the ref; on `create` the scaffold is a side effect on
|
|
94
|
+
* a path an agent drives. Do not "harmonize" these.
|
|
95
|
+
*/
|
|
96
|
+
const CREATE_REFUSED_SOURCE_FLAGS = new Set(["--from", "--template"]);
|
|
97
|
+
/**
|
|
98
|
+
* The offending flag on a `create` invocation, or undefined.
|
|
99
|
+
*
|
|
100
|
+
* The `.split("=")[0]` is load-bearing and is NOT what `flag()` does. `flag()` is a
|
|
101
|
+
* bare `argv.indexOf(name)`, which cannot see `--template=1.0.0` at all — copying
|
|
102
|
+
* its idiom here would let the equals spelling through in silence, which is the
|
|
103
|
+
* whole of the control. Case-SENSITIVE, deliberately: case-folding would turn
|
|
104
|
+
* `--TEMPLATE` into a flag that this refusal recognises and the rest of the CLI
|
|
105
|
+
* does not, i.e. a refusal for an input that was never going to work anyway, while
|
|
106
|
+
* teaching a reader that the two spellings are equivalent.
|
|
107
|
+
*/
|
|
108
|
+
export function createSourceFlagRefusal(args) {
|
|
109
|
+
for (const a of args) {
|
|
110
|
+
if (!a.startsWith("-"))
|
|
111
|
+
continue;
|
|
112
|
+
const name = a.split("=")[0];
|
|
113
|
+
if (CREATE_REFUSED_SOURCE_FLAGS.has(name))
|
|
114
|
+
return name;
|
|
115
|
+
}
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
78
118
|
/**
|
|
79
119
|
* Flags the CLI deliberately does NOT have. The checklist reports and never
|
|
80
120
|
* writes: a suggested value is one keystroke from a tool that writes it, and
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export
|
|
2
|
+
export declare function usage(): string;
|