Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
75529be
docs(prd): PRD-904 tn login and tn deploy delegate to the store CLI's…
jonit-dev Nov 22, 2026
4aeea83
docs(create-threenative): drop the two-commands-ever rule; new comman…
jonit-dev Nov 22, 2026
02bada9
docs(prd): PRD-904 deploy matches Studio's Publish share link; login …
jonit-dev Nov 22, 2026
4d1bff0
docs(prd): PRD-904 folds in the Gemini review: logout revokes, terms …
jonit-dev Nov 22, 2026
f616c54
docs(prd): PRD-904 records the tokenAccount and terms-on-approve deci…
jonit-dev Nov 22, 2026
f86cb43
feat(create-threenative): threenative login, logout and deploy publis…
jonit-dev Nov 22, 2026
13af302
docs(prd): PRD-904 AC-1, AC-5 and AC-6 pass on the local site and Stu…
jonit-dev Nov 22, 2026
2812762
fix(create-threenative): logout keeps a token it could not revoke; at…
jonit-dev Nov 22, 2026
4a288db
fix(create-threenative): unique temp token file, accurate logout help…
jonit-dev Nov 22, 2026
1da3963
docs(prd): PRD-904 AC-6 reruns green after the Sol review fixes
jonit-dev Nov 22, 2026
2bcef2c
fix(create-threenative): share.json is written through a temp file an…
jonit-dev Nov 22, 2026
50d8d72
fix(create-threenative): two first deploys from one checkout claim on…
jonit-dev Nov 22, 2026
62862f1
fix(create-threenative): logout deletes the token file only while it …
jonit-dev Nov 22, 2026
f37d85d
fix(create-threenative): logout claims the token file with one rename…
jonit-dev Nov 22, 2026
1442360
fix(create-threenative): logout keeps an unrevoked or interrupted tok…
jonit-dev Nov 22, 2026
1a003cf
fix(create-threenative): logout revokes on the issuing site and keeps…
jonit-dev Nov 22, 2026
27af814
fix(create-threenative): a half-made share.json is waited for or remo…
jonit-dev Nov 22, 2026
118367b
fix(create-threenative): logout exits 4 when it cannot list the confi…
jonit-dev Nov 22, 2026
42995bc
docs(prd): PRD-904 records the Sol 6.2 approval and the final local e…
jonit-dev Nov 22, 2026
adee7ee
docs(create-threenative): the CLI surface paragraph fits the 100-line…
jonit-dev Nov 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions packages/create-threenative/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ builds locally can still fail there — check it before claiming the scaffold wo

## CLI surface

Two `threenative` commands, ever: `build` (`--target web|desktop|android|ios`) and `doctor`
(`--text` prints the person-readable report; it checks rather than builds, borrowed whole from
`npm doctor` and `flutter doctor`). `__tests__/cli.spec.ts` derives the advertised list from the
real executable and rejects anything else, so this document cannot outgrow the binary. A third
command needs the owner decision made again — v1 shipped 178 command forms and a 2,477-word root
help. The scaffolder itself takes a target directory plus `inspect <file.glb> [--json]`; its flags stay
The `threenative` commands are `build` (`--target web|desktop|android|ios`), `doctor` (`--text` for
the person-readable report; borrowed from `npm doctor`), `login` (device-code sign-in, token saved
owner-only, `--no-browser`), `logout` (revokes it on the site), and `deploy` (`build:web`, uploads
`dist/` to Studio, prints the share link last; `.threenative/share.json` keeps the link). `__tests__/cli.spec.ts`
derives the list from the real executable. A new command borrows an established CLI's name, never a new word.
The scaffolder itself takes a target directory plus `inspect <file.glb> [--json]`; its flags stay
boring: `--template`, `--no-install`, and the `--*-package` overrides CI uses to test against
local tarballs. `pnpm dev` inside a generated project is a package script, never a CLI command.

Expand Down
12 changes: 6 additions & 6 deletions packages/create-threenative/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ builds locally can still fail there — check it before claiming the scaffold wo

## CLI surface

Two `threenative` commands, ever: `build` (`--target web|desktop|android|ios`) and `doctor`
(`--text` prints the person-readable report; it checks rather than builds, borrowed whole from
`npm doctor` and `flutter doctor`). `__tests__/cli.spec.ts` derives the advertised list from the
real executable and rejects anything else, so this document cannot outgrow the binary. A third
command needs the owner decision made again — v1 shipped 178 command forms and a 2,477-word root
help. The scaffolder itself takes a target directory plus `inspect <file.glb> [--json]`; its flags stay
The `threenative` commands are `build` (`--target web|desktop|android|ios`), `doctor` (`--text` for
the person-readable report; borrowed from `npm doctor`), `login` (device-code sign-in, token saved
owner-only, `--no-browser`), `logout` (revokes it on the site), and `deploy` (`build:web`, uploads
`dist/` to Studio, prints the share link last; `.threenative/share.json` keeps the link). `__tests__/cli.spec.ts`
derives the list from the real executable. A new command borrows an established CLI's name, never a new word.
The scaffolder itself takes a target directory plus `inspect <file.glb> [--json]`; its flags stay
boring: `--template`, `--no-install`, and the `--*-package` overrides CI uses to test against
local tarballs. `pnpm dev` inside a generated project is a package script, never a CLI command.

Expand Down
2 changes: 1 addition & 1 deletion packages/create-threenative/__tests__/cli.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe("create-threenative CLI", () => {
expect(commandHelp.stderr, command).toBe("");
expect(commandHelp.stdout, command).toContain(`Usage: threenative ${command}`);
}
expect(advertised).toEqual(["build", "doctor"]);
expect(advertised).toEqual(["build", "doctor", "deploy", "login", "logout"]);

for (const command of ["dev", "test", "ship"]) {
await expect(
Expand Down
46 changes: 46 additions & 0 deletions packages/create-threenative/__tests__/deploy-nolink.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { mkdir, readFile, writeFile } from "node:fs/promises";
import path from "node:path";
import { describe, expect, it, vi } from "vitest";
import { makeTempDir } from "../../../test-support/temp-dir.js";
import { CliExit } from "../src/account.js";
import { deploy } from "../src/deploy.js";

// A volume with no hard links (some network and FAT mounts): `link` fails with ENOTSUP.
vi.mock("node:fs/promises", async (original) => ({
...(await original<typeof import("node:fs/promises")>()),
link: async () => {
throw Object.assign(new Error("operation not supported"), { code: "ENOTSUP" });
},
}));

describe("threenative deploy on a volume with no hard links", () => {
it("still claims one deploy key for two first deploys started together", async () => {
const cwd = await makeTempDir("tn-deploy-nolink-");
await writeFile(
path.join(cwd, "package.json"),
JSON.stringify({ name: "game", scripts: { "build:web": "vite build" } }),
);
const options = {
cwd,
out: () => {},
runBuild: async (root: string) => {
await mkdir(path.join(root, "dist"), { recursive: true });
await writeFile(path.join(root, "dist", "index.html"), "<p>hi</p>");
},
// Nothing listens here: each deploy claims its key, then fails to upload with exit 5.
studio: "http://127.0.0.1:9",
token: "tok-1",
};

const results = await Promise.allSettled([deploy(options), deploy(options)]);

for (const result of results) {
expect(result.status).toBe("rejected");
const reason = (result as PromiseRejectedResult).reason as unknown;
expect(reason).toBeInstanceOf(CliExit);
expect((reason as CliExit).code).toBe(5);
}
const share = JSON.parse(await readFile(path.join(cwd, ".threenative", "share.json"), "utf8"));
expect(share.deployKey).toMatch(/^[\da-f-]{36}$/u);
});
});
Loading
Loading