fix(cli): add --dir names the exact init command for a missing folder (#7615)

This commit is contained in:
Miguel Ángel
2026-11-12 17:37:28 +00:00
committed by GitHub
parent 54bcdc616f
commit bfd3fe644b
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ before merge, listed at the end.
1. Create `registry/<blocks|components>/<name>/registry-item.json` following the [schema](packages/core/schemas/registry-item.json)
2. For components: include a `demo.html`
3. Run `npx hyperframes lint` and `npx hyperframes validate` on your HTML
4. Test the install flow: `hyperframes add <name> --dir /tmp/test-project`
4. Test the install flow: `hyperframes init /tmp/test-project`, then `hyperframes add <name> --dir /tmp/test-project`
5. Generate and validate the catalog: `bun run check:catalog-drift`
### Generated catalog files
+3 -1
View File
@@ -606,7 +606,9 @@ describe("add command run() — several names", () => {
const out = JSON.parse(String(log.mock.calls[0]?.[0]));
expect(out.error.message).toContain(`Project folder not found: ${missing}`);
expect(out.error.message).toContain("--dir is the project root");
expect(out.error.message).toContain("hyperframes init");
expect(out.error.message).toContain(
`Create one with \`hyperframes init ${JSON.stringify(missing)}\``,
);
expect(existsSync(missing)).toBe(false);
});
+1 -1
View File
@@ -566,7 +566,7 @@ export default defineCommand({
if (!existsSync(projectDir)) {
failCaught(
new Error(
`Project folder not found: ${projectDir}. --dir is the project root, not where the block lands (that is its compositions/ folder), and it must already exist. Create one with \`hyperframes init <dir>\`.`,
`Project folder not found: ${projectDir}. --dir is the project root, not where the block lands (that is its compositions/ folder), and it must already exist. Create one with \`hyperframes init ${JSON.stringify(args.dir)}\`.`,
),
json,
c.error,