Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d3d8428
feat: add instant-start CLI command
jomifepe Jul 20, 2026
9a217be
refactor: simplify instant-start implementation
jomifepe Jul 20, 2026
2863720
Merge remote-tracking branch 'origin/main' into jp/instant-start
cursoragent Jul 21, 2026
70949f0
chore: improve Instant Start completion message
jomifepe Jul 21, 2026
df32846
refactor: limit instant-start to exports
jomifepe Jul 21, 2026
60352fa
feat: route instant start through init
jomifepe Jul 22, 2026
fac31ec
chore: refine instant init description
jomifepe Jul 22, 2026
9eb8dbf
feat: clean up instant start previews
jomifepe Jul 23, 2026
842a8a0
Merge remote-tracking branch 'origin/main' into jp/instant-start
jomifepe Jul 23, 2026
43b72a6
refactor(instant-start): download public starter
jomifepe Jul 23, 2026
a50e1df
refactor(cli): replace init instant with starter download
jomifepe Jul 24, 2026
3dd0d26
fix(starter-download): skip duplicate Development preview
jomifepe Jul 24, 2026
3378f5d
Merge main into jp/instant-start-github-starter
jomifepe Jul 28, 2026
ae38848
feat(starter): download archive from repository starter metadata
jomifepe Jul 30, 2026
31e452e
refactor(starter): trust repository starter provenance for archive URL
jomifepe Jul 30, 2026
88032e1
feat(starter): complete local handoff after download
jomifepe Jul 30, 2026
cf16d38
fix(starter): derive hosted preview from provenance
jomifepe Jul 31, 2026
2423c08
feat(init): replace starter download with degit handoff
jomifepe Jul 31, 2026
01dd3e2
Merge remote-tracking branch 'origin/main' into jp/instant-start-gith…
jomifepe Jul 31, 2026
6fd2b04
fix(core): restore preview URL helpers for starter handoff
jomifepe Jul 31, 2026
1db41c1
refactor(init): reorganize starter handoff per file organization conv…
angeloashmore Aug 3, 2026
8c7a99d
refactor(init): use adapter URLs for starter handoff and rename package
jomifepe Aug 3, 2026
46ce957
refactor: rename
jomifepe Aug 3, 2026
9afabfe
test(init): enable Instant Start handoff e2e tests
jomifepe Aug 3, 2026
47ea2db
merge(main): sync with origin/main and address Angelo PR comments
jomifepe Aug 4, 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
21 changes: 20 additions & 1 deletion src/adapters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ const TYPES_FILENAME = "prismicio-types.d.ts";
type CustomTypeMeta = { model: CustomType; modelPath: URL; directory: URL; library: URL };
type SharedSliceMeta = { model: SharedSlice; modelPath: URL; directory: URL; library: URL };

export type LocalDevelopmentPreview = {
name: string;
websiteURL: string;
resolverPath: string;
};

export async function getAdapter(): Promise<Adapter> {
const { dependencies, devDependencies, peerDependencies } = await readPackageJson();
const allDependencies = { ...dependencies, ...devDependencies, ...peerDependencies };
Expand Down Expand Up @@ -60,6 +66,19 @@ export abstract class Adapter {

abstract readonly environmentEnvVarName: string;

abstract readonly localPreviewConfig: LocalDevelopmentPreview;

get localPreviewUrl(): string {
return new URL(
this.localPreviewConfig.resolverPath,
this.localPreviewConfig.websiteURL,
).href;
}

get localSimulatorUrl(): string {
return new URL("slice-simulator", this.localPreviewConfig.websiteURL).href;
}

abstract onProjectInitialized(): Promise<void> | void;
abstract onSliceCreated(model: SharedSlice, library: URL): Promise<void> | void;
abstract onSliceUpdated(model: SharedSlice): Promise<void> | void;
Expand All @@ -83,7 +102,7 @@ export abstract class Adapter {
}

async getSliceLibraries(): Promise<URL[]> {
let libraries = await getLibraries();
const libraries = await getLibraries();
if (libraries) return libraries;
const defaultSliceLibrary = await this.getDefaultSliceLibrary();
return [defaultSliceLibrary];
Expand Down
13 changes: 8 additions & 5 deletions src/adapters/nextjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export class NextJsAdapter extends Adapter {

readonly environmentEnvVarName = "NEXT_PUBLIC_PRISMIC_ENVIRONMENT";

readonly localPreviewConfig = {
name: "Development",
websiteURL: "http://localhost:3000",
resolverPath: "/api/preview",
};

async setupProject(): Promise<void> {
await addDependencies({
"@prismicio/client": `^${await getNpmPackageVersion("@prismicio/client")}`,
Expand All @@ -53,15 +59,12 @@ export class NextJsAdapter extends Adapter {

const simulatorUrl = await getSimulatorUrl({ repo, token, host });
if (!simulatorUrl) {
await setSimulatorUrl("http://localhost:3000/slice-simulator", { repo, token, host });
await setSimulatorUrl(this.localSimulatorUrl, { repo, token, host });
}

const previews = await getPreviews({ repo, token, host });
if (previews.length === 0) {
await addPreview(
{ name: "Development", websiteURL: "http://localhost:3000", resolverPath: "/api/preview" },
{ repo, token, host },
);
await addPreview(this.localPreviewConfig, { repo, token, host });
}
}

Expand Down
13 changes: 8 additions & 5 deletions src/adapters/nuxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export class NuxtAdapter extends Adapter {

readonly environmentEnvVarName = "NUXT_PUBLIC_PRISMIC_ENVIRONMENT";

readonly localPreviewConfig = {
name: "Development",
websiteURL: "http://localhost:3000",
resolverPath: "/preview",
};

async setupProject(): Promise<void> {
await addDependencies({
"@prismicio/client": `^${await getNpmPackageVersion("@prismicio/client")}`,
Expand All @@ -46,15 +52,12 @@ export class NuxtAdapter extends Adapter {

const simulatorUrl = await getSimulatorUrl({ repo, token, host });
if (!simulatorUrl) {
await setSimulatorUrl("http://localhost:3000/slice-simulator", { repo, token, host });
await setSimulatorUrl(this.localSimulatorUrl, { repo, token, host });
}

const previews = await getPreviews({ repo, token, host });
if (previews.length === 0) {
await addPreview(
{ name: "Development", websiteURL: "http://localhost:3000", resolverPath: "/preview" },
{ repo, token, host },
);
await addPreview(this.localPreviewConfig, { repo, token, host });
}
}

Expand Down
18 changes: 12 additions & 6 deletions src/adapters/sveltekit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { CustomType, SharedSlice } from "@prismicio/types-internal/lib/customtypes";
import type {
CustomType,
SharedSlice,
} from "@prismicio/types-internal/lib/customtypes";

import { pascalCase } from "change-case";
import { loadFile } from "magicast";
Expand Down Expand Up @@ -36,6 +39,12 @@ export class SvelteKitAdapter extends Adapter {

readonly environmentEnvVarName = "PUBLIC_PRISMIC_ENVIRONMENT";

readonly localPreviewConfig = {
name: "Development",
websiteURL: "http://localhost:5173",
resolverPath: "/api/preview",
};

async setupProject(): Promise<void> {
await addDependencies({
"@prismicio/client": `^${await getNpmPackageVersion("@prismicio/client")}`,
Expand All @@ -57,15 +66,12 @@ export class SvelteKitAdapter extends Adapter {

const simulatorUrl = await getSimulatorUrl({ repo, token, host });
if (!simulatorUrl) {
await setSimulatorUrl("http://localhost:5173/slice-simulator", { repo, token, host });
await setSimulatorUrl(this.localSimulatorUrl, { repo, token, host });
}

const previews = await getPreviews({ repo, token, host });
if (previews.length === 0) {
await addPreview(
{ name: "Development", websiteURL: "http://localhost:5173", resolverPath: "/api/preview" },
{ repo, token, host },
);
await addPreview(this.localPreviewConfig, { repo, token, host });
}
}

Expand Down
Loading
Loading