From 8b573a5f0d6143859ee169d44cc48a778df1009c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 23:40:38 +0000 Subject: [PATCH] feat(init): mark the project as connected after init The Prismic dashboard waits for the `connectPrismic` onboarding step to know that a project is connected. Only `prismic pull` and `prismic sync` completed this step. A developer who ran only `prismic init` stayed on the setup screen. `prismic init` now completes the step after it syncs the models. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01L1dGD83ArFyyY1WATHG3zW --- src/commands/init.ts | 1 + test/init.test.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/commands/init.ts b/src/commands/init.ts index 9dd377c4..4b5ed217 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -300,6 +300,7 @@ export default createCommand(config, async ({ values }) => { } await adapter.generateTypes(); + await completeOnboardingSteps(["connectPrismic"], { repo, token, host }).catch(() => {}); if (getLegacySlices(remote.customTypes).length > 0) { console.info("\nRun `prismic slice list --legacy` to find legacy slices to upgrade."); diff --git a/test/init.test.ts b/test/init.test.ts index b9e1de7c..fe52e54b 100644 --- a/test/init.test.ts +++ b/test/init.test.ts @@ -143,6 +143,8 @@ it("initializes a project with --repo when logged in", async ({ project, prismic, repo, + token, + host, }) => { await rm(new URL("prismic.config.json", project)); @@ -153,6 +155,9 @@ it("initializes a project with --repo when logged in", async ({ const configRaw = await readFile(new URL("prismic.config.json", project), "utf-8"); const config = JSON.parse(configRaw); expect(config.repositoryName).toBe(repo); + + const completedSteps = await getOnboardingCompletedSteps({ repo, token, host }); + expect(completedSteps).toContain("connectPrismic"); }, 60_000); it("reconnects an existing project with --repo", async ({ expect, project, prismic, repo }) => {