@ebay-dt/bonfire-cli 0.1.0 → 0.2.0-alpha.10
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/dist/branch-prepare.d.ts +1 -0
- package/dist/branch-prepare.d.ts.map +1 -1
- package/dist/branch-prepare.js +24 -1
- package/dist/branch-prepare.js.map +1 -1
- package/dist/convert.d.ts.map +1 -1
- package/dist/convert.js +2 -3
- package/dist/convert.js.map +1 -1
- package/dist/release-versions.d.ts +3 -0
- package/dist/release-versions.d.ts.map +1 -0
- package/dist/release-versions.js +4 -0
- package/dist/release-versions.js.map +1 -0
- package/package.json +5 -5
- package/templates/instance/context/PROTOTYPE.md +2 -2
- package/templates/instance/context/skills/color-scheme/SKILL.md +4 -4
- package/templates/instance/context/skills/item-data/SKILL.md +21 -21
- package/templates/instance/context/skills/setup-evomcp/SKILL.md +1 -1
- package/templates/instance/next.config.ts +4 -4
- package/templates/instance/src/actions/agents.ts +5 -5
- package/templates/instance/src/actions/prototypes.ts +14 -10
- package/templates/instance/src/actions/repository.ts +33 -0
- package/templates/instance/src/app/(prototypes)/layout.tsx +11 -11
- package/templates/instance/src/app/(system)/api/prototype-dirty/route.ts +3 -3
- package/templates/instance/src/app/(system)/api/repository/check/route.ts +3 -0
- package/templates/instance/src/app/(system)/api/repository/retry/route.ts +3 -0
- package/templates/instance/src/app/(system)/api/repository/summary/route.ts +3 -0
- package/templates/instance/src/app/(system)/api/repository/update/route.ts +3 -0
- package/templates/instance/src/app/(system)/auth/login/route.ts +3 -3
- package/templates/instance/src/app/(system)/auth/logout/route.ts +3 -3
- package/templates/instance/src/app/(system)/auth/status/route.ts +3 -3
- package/templates/instance/src/app/(system)/layout.tsx +6 -6
- package/templates/instance/src/app/(system)/login/page.tsx +8 -8
- package/templates/instance/src/app/(system)/page.tsx +9 -9
- package/templates/instance/src/app/api/items/[itemId]/route.ts +7 -7
- package/templates/instance/src/app/api/items/route.ts +4 -4
- package/templates/instance/src/app/layout.tsx +38 -16
- package/templates/instance/src/bonfire.ts +11 -11
- package/templates/instance/src/lib/items/gateway-schemas.ts +12 -12
- package/templates/instance/src/lib/items/server.ts +52 -52
- package/templates/instance/src/proxy.ts +4 -4
|
@@ -8,12 +8,12 @@ description: Implement visitor-facing Light and Dark color-scheme controls in De
|
|
|
8
8
|
Use the published Bonfire hook for prototype-authored controls that let visitors switch between Light and Dark:
|
|
9
9
|
|
|
10
10
|
```tsx
|
|
11
|
-
|
|
11
|
+
"use client";
|
|
12
12
|
|
|
13
|
-
import { useColorSchemeToggle } from
|
|
13
|
+
import { useColorSchemeToggle } from "@ebay-dt/bonfire-react";
|
|
14
14
|
|
|
15
15
|
export function ColorSchemeToggle() {
|
|
16
|
-
const { canToggle, toggle } = useColorSchemeToggle()
|
|
16
|
+
const { canToggle, toggle } = useColorSchemeToggle();
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
<button
|
|
@@ -24,7 +24,7 @@ export function ColorSchemeToggle() {
|
|
|
24
24
|
>
|
|
25
25
|
Toggle color scheme
|
|
26
26
|
</button>
|
|
27
|
-
)
|
|
27
|
+
);
|
|
28
28
|
}
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -26,15 +26,15 @@ Normalized types such as `SearchItem`, `ItemSearchPage`, and `ItemDetail` are ex
|
|
|
26
26
|
The application root does not supply a React Query provider. Mount the preset's `QueryProvider` around the prototype's item UI, normally in its `page.tsx`:
|
|
27
27
|
|
|
28
28
|
```tsx
|
|
29
|
-
import { QueryProvider } from
|
|
30
|
-
import App from
|
|
29
|
+
import { QueryProvider } from "@ebay-dt/bonfire-preset-ebay/data/items/react";
|
|
30
|
+
import App from "./app";
|
|
31
31
|
|
|
32
32
|
export default function Page() {
|
|
33
33
|
return (
|
|
34
34
|
<QueryProvider>
|
|
35
35
|
<App />
|
|
36
36
|
</QueryProvider>
|
|
37
|
-
)
|
|
37
|
+
);
|
|
38
38
|
}
|
|
39
39
|
```
|
|
40
40
|
|
|
@@ -55,19 +55,19 @@ Gateway endpoints, GraphQL documents, credentials, wire schemas, and normalizati
|
|
|
55
55
|
## Numbered pagination
|
|
56
56
|
|
|
57
57
|
```tsx
|
|
58
|
-
|
|
58
|
+
"use client";
|
|
59
59
|
|
|
60
|
-
import { useItemsSearch } from
|
|
60
|
+
import { useItemsSearch } from "@ebay-dt/bonfire-preset-ebay/data/items/react";
|
|
61
61
|
|
|
62
62
|
export function Results({ query, page }: { query: string; page: number }) {
|
|
63
|
-
const search = useItemsSearch(query, { page, pageSize: 20 })
|
|
64
|
-
const items = search.data ?? []
|
|
65
|
-
const isCurrentResult = search.resultQuery === search.debouncedQuery
|
|
63
|
+
const search = useItemsSearch(query, { page, pageSize: 20 });
|
|
64
|
+
const items = search.data ?? [];
|
|
65
|
+
const isCurrentResult = search.resultQuery === search.debouncedQuery;
|
|
66
66
|
|
|
67
67
|
// Render search.isIdle, search.isPending, search.isError, and items here.
|
|
68
68
|
// Use search.hasPreviousPage, search.hasNextPage, and search.totalPages
|
|
69
69
|
// for controls. Disable or label controls while !isCurrentResult.
|
|
70
|
-
return null
|
|
70
|
+
return null;
|
|
71
71
|
}
|
|
72
72
|
```
|
|
73
73
|
|
|
@@ -83,17 +83,17 @@ Keep page state in the component or URL. Reset it to page 1 when a current query
|
|
|
83
83
|
## Infinite results
|
|
84
84
|
|
|
85
85
|
```tsx
|
|
86
|
-
|
|
86
|
+
"use client";
|
|
87
87
|
|
|
88
|
-
import { useInfiniteItemsSearch } from
|
|
88
|
+
import { useInfiniteItemsSearch } from "@ebay-dt/bonfire-preset-ebay/data/items/react";
|
|
89
89
|
|
|
90
90
|
export function Results({ query }: { query: string }) {
|
|
91
|
-
const search = useInfiniteItemsSearch(query, { pageSize: 20 })
|
|
92
|
-
const items = search.data ?? []
|
|
91
|
+
const search = useInfiniteItemsSearch(query, { pageSize: 20 });
|
|
92
|
+
const items = search.data ?? [];
|
|
93
93
|
|
|
94
94
|
// Render items, then call search.loadMore() from a button or observer.
|
|
95
95
|
// Disable the trigger while search.isLoadingMore or when !search.hasMore.
|
|
96
|
-
return null
|
|
96
|
+
return null;
|
|
97
97
|
}
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -104,15 +104,15 @@ Prefer an explicit, accessible “Load more” button unless the prototype speci
|
|
|
104
104
|
## Item details
|
|
105
105
|
|
|
106
106
|
```tsx
|
|
107
|
-
|
|
107
|
+
"use client";
|
|
108
108
|
|
|
109
|
-
import { useItemById } from
|
|
109
|
+
import { useItemById } from "@ebay-dt/bonfire-preset-ebay/data/items/react";
|
|
110
110
|
|
|
111
111
|
export function ItemDetails({ itemId }: { itemId: string | null }) {
|
|
112
|
-
const detail = useItemById(itemId)
|
|
112
|
+
const detail = useItemById(itemId);
|
|
113
113
|
|
|
114
|
-
if (!itemId) return null
|
|
115
|
-
if (detail.isPending) return <p role="status">Loading item details…</p
|
|
114
|
+
if (!itemId) return null;
|
|
115
|
+
if (detail.isPending) return <p role="status">Loading item details…</p>;
|
|
116
116
|
if (detail.isError) {
|
|
117
117
|
return (
|
|
118
118
|
<div role="alert">
|
|
@@ -121,10 +121,10 @@ export function ItemDetails({ itemId }: { itemId: string | null }) {
|
|
|
121
121
|
Try again
|
|
122
122
|
</button>
|
|
123
123
|
</div>
|
|
124
|
-
)
|
|
124
|
+
);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
return detail.data ? <h2>{detail.data.title}</h2> : null
|
|
127
|
+
return detail.data ? <h2>{detail.data.title}</h2> : null;
|
|
128
128
|
}
|
|
129
129
|
```
|
|
130
130
|
|
|
@@ -70,4 +70,4 @@ the Cursor window and check MCP settings again.
|
|
|
70
70
|
failure.
|
|
71
71
|
- No Evo-specific login is required. Do not add authorization headers or ask
|
|
72
72
|
the user to generate a token.
|
|
73
|
-
- If the host cannot be reached, check eBay
|
|
73
|
+
- If the host cannot be reached, check eBay VPN connectivity and retry.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { NextConfig } from
|
|
1
|
+
import type { NextConfig } from "next";
|
|
2
2
|
|
|
3
3
|
const nextConfig: NextConfig = {
|
|
4
4
|
/* Bonfire discovers prototype metadata from the filesystem at request time. */
|
|
5
5
|
outputFileTracingIncludes: {
|
|
6
|
-
|
|
6
|
+
"/*": ["./src/app/(prototypes)/**/metadata.json"],
|
|
7
7
|
},
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
export default nextConfig
|
|
10
|
+
export default nextConfig;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
"use server";
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
4
|
OpenInAgentInput,
|
|
5
5
|
OpenInClaudeCodeInput,
|
|
6
|
-
} from
|
|
7
|
-
import { bonfire } from
|
|
6
|
+
} from "@ebay-dt/bonfire-core";
|
|
7
|
+
import { bonfire } from "@/bonfire";
|
|
8
8
|
|
|
9
9
|
export async function openInCursor(input: OpenInAgentInput) {
|
|
10
|
-
return bonfire.prototypes.agents.openInCursor(input)
|
|
10
|
+
return bonfire.prototypes.agents.openInCursor(input);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export async function openInClaudeCode(input: OpenInClaudeCodeInput) {
|
|
14
|
-
return bonfire.prototypes.agents.openInClaudeCode(input)
|
|
14
|
+
return bonfire.prototypes.agents.openInClaudeCode(input);
|
|
15
15
|
}
|
|
@@ -1,37 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
"use server";
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
4
|
CreatePrototypeInput,
|
|
5
5
|
DuplicatePrototypeInput,
|
|
6
6
|
EditPrototypeInput,
|
|
7
7
|
PrototypeCommandInput,
|
|
8
|
-
} from
|
|
9
|
-
import { bonfire } from
|
|
8
|
+
} from "@ebay-dt/bonfire-core";
|
|
9
|
+
import { bonfire } from "@/bonfire";
|
|
10
10
|
|
|
11
11
|
export async function createPrototype(input: CreatePrototypeInput) {
|
|
12
|
-
return bonfire.prototypes.actions.create(input)
|
|
12
|
+
return bonfire.prototypes.actions.create(input);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export async function duplicatePrototype(input: DuplicatePrototypeInput) {
|
|
16
|
-
return bonfire.prototypes.actions.duplicate(input)
|
|
16
|
+
return bonfire.prototypes.actions.duplicate(input);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export async function editPrototype(input: EditPrototypeInput) {
|
|
20
|
-
return bonfire.prototypes.actions.edit(input)
|
|
20
|
+
return bonfire.prototypes.actions.edit(input);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export async function deletePrototype(input: PrototypeCommandInput) {
|
|
24
|
-
return bonfire.prototypes.actions.delete(input)
|
|
24
|
+
return bonfire.prototypes.actions.delete(input);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export async function savePrototype(input: PrototypeCommandInput) {
|
|
28
|
-
return bonfire.prototypes.actions.save(input)
|
|
28
|
+
return bonfire.prototypes.actions.save(input);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export async function discardPrototype(input: PrototypeCommandInput) {
|
|
32
|
-
return bonfire.prototypes.actions.discard(input)
|
|
32
|
+
return bonfire.prototypes.actions.discard(input);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export async function deployPrototype(input: PrototypeCommandInput) {
|
|
36
|
-
return bonfire.prototypes.actions.deploy(input)
|
|
36
|
+
return bonfire.prototypes.actions.deploy(input);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export async function retryPublishPrototype(input: PrototypeCommandInput) {
|
|
40
|
+
return bonfire.prototypes.actions.retryPublish!(input);
|
|
37
41
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
|
|
3
|
+
import { bonfire } from "@/bonfire";
|
|
4
|
+
|
|
5
|
+
export async function getRepositorySummary() {
|
|
6
|
+
return bonfire.prototypes.repository.getSummary();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export async function checkRepository() {
|
|
10
|
+
return bonfire.prototypes.repository.check();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function applyRepositoryUpdates() {
|
|
14
|
+
return bonfire.prototypes.repository.applyUpdates();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function retryRepositoryUpdate() {
|
|
18
|
+
return bonfire.prototypes.repository.retry();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function saveRepositoryPrototype(ref: {
|
|
22
|
+
login: string;
|
|
23
|
+
slug: string;
|
|
24
|
+
}) {
|
|
25
|
+
return bonfire.prototypes.repository.save!({ ref });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function discardRepositoryPrototype(ref: {
|
|
29
|
+
login: string;
|
|
30
|
+
slug: string;
|
|
31
|
+
}) {
|
|
32
|
+
return bonfire.prototypes.repository.discard!({ ref });
|
|
33
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ReactNode } from
|
|
2
|
-
import { notFound } from
|
|
3
|
-
import { AppHeader, PrototypeEnvironment } from
|
|
4
|
-
import { bonfire } from
|
|
5
|
-
import { openInClaudeCode, openInCursor } from
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { notFound } from "next/navigation";
|
|
3
|
+
import { AppHeader, PrototypeEnvironment } from "@ebay-dt/bonfire-react";
|
|
4
|
+
import { bonfire } from "@/bonfire";
|
|
5
|
+
import { openInClaudeCode, openInCursor } from "@/actions/agents";
|
|
6
6
|
|
|
7
7
|
export default async function PrototypesLayout({
|
|
8
8
|
children,
|
|
@@ -10,12 +10,12 @@ export default async function PrototypesLayout({
|
|
|
10
10
|
const [{ headerProps }, prototype] = await Promise.all([
|
|
11
11
|
bonfire.auth.getAppLayoutModel(),
|
|
12
12
|
bonfire.prototypes.getCurrentRouteModel(),
|
|
13
|
-
])
|
|
13
|
+
]);
|
|
14
14
|
|
|
15
|
-
if (prototype === null) notFound()
|
|
15
|
+
if (prototype === null) notFound();
|
|
16
16
|
|
|
17
|
-
const agentActions = { openInClaudeCode, openInCursor }
|
|
18
|
-
const header = <AppHeader {...headerProps} agentActions={agentActions}
|
|
17
|
+
const agentActions = { openInClaudeCode, openInCursor };
|
|
18
|
+
const header = <AppHeader {...headerProps} agentActions={agentActions} />;
|
|
19
19
|
|
|
20
20
|
if (prototype.theme === undefined) {
|
|
21
21
|
return (
|
|
@@ -23,7 +23,7 @@ export default async function PrototypesLayout({
|
|
|
23
23
|
{header}
|
|
24
24
|
{children}
|
|
25
25
|
</>
|
|
26
|
-
)
|
|
26
|
+
);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
return (
|
|
@@ -36,5 +36,5 @@ export default async function PrototypesLayout({
|
|
|
36
36
|
{header}
|
|
37
37
|
{children}
|
|
38
38
|
</PrototypeEnvironment>
|
|
39
|
-
)
|
|
39
|
+
);
|
|
40
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bonfire } from
|
|
1
|
+
import { bonfire } from "@/bonfire";
|
|
2
2
|
|
|
3
|
-
export const runtime =
|
|
4
|
-
export const GET = bonfire.prototypes.routes.dirty
|
|
3
|
+
export const runtime = "nodejs";
|
|
4
|
+
export const GET = bonfire.prototypes.routes.dirty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bonfire } from
|
|
1
|
+
import { bonfire } from "@/bonfire";
|
|
2
2
|
|
|
3
|
-
export const runtime =
|
|
4
|
-
export const GET = bonfire.auth.routes.login
|
|
3
|
+
export const runtime = "nodejs";
|
|
4
|
+
export const GET = bonfire.auth.routes.login;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bonfire } from
|
|
1
|
+
import { bonfire } from "@/bonfire";
|
|
2
2
|
|
|
3
|
-
export const runtime =
|
|
4
|
-
export const POST = bonfire.auth.routes.logout
|
|
3
|
+
export const runtime = "nodejs";
|
|
4
|
+
export const POST = bonfire.auth.routes.logout;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bonfire } from
|
|
1
|
+
import { bonfire } from "@/bonfire";
|
|
2
2
|
|
|
3
|
-
export const runtime =
|
|
4
|
-
export const GET = bonfire.auth.routes.status
|
|
3
|
+
export const runtime = "nodejs";
|
|
4
|
+
export const GET = bonfire.auth.routes.status;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { ReactNode } from
|
|
2
|
-
import { AppHeader } from
|
|
3
|
-
import { bonfire } from
|
|
4
|
-
import { openInClaudeCode, openInCursor } from
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { AppHeader } from "@ebay-dt/bonfire-react";
|
|
3
|
+
import { bonfire } from "@/bonfire";
|
|
4
|
+
import { openInClaudeCode, openInCursor } from "@/actions/agents";
|
|
5
5
|
|
|
6
6
|
export default async function SystemLayout({
|
|
7
7
|
children,
|
|
8
8
|
}: Readonly<{ children: ReactNode }>) {
|
|
9
|
-
const { headerProps } = await bonfire.auth.getAppLayoutModel()
|
|
9
|
+
const { headerProps } = await bonfire.auth.getAppLayoutModel();
|
|
10
10
|
|
|
11
11
|
return (
|
|
12
12
|
<>
|
|
@@ -16,5 +16,5 @@ export default async function SystemLayout({
|
|
|
16
16
|
/>
|
|
17
17
|
{children}
|
|
18
18
|
</>
|
|
19
|
-
)
|
|
19
|
+
);
|
|
20
20
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { GitHubCliLoginPage } from
|
|
2
|
-
import { bonfire } from
|
|
3
|
-
import type { Metadata } from
|
|
1
|
+
import { GitHubCliLoginPage } from "@ebay-dt/bonfire-react";
|
|
2
|
+
import { bonfire } from "@/bonfire";
|
|
3
|
+
import type { Metadata } from "next";
|
|
4
4
|
|
|
5
|
-
export const metadata: Metadata = { title:
|
|
5
|
+
export const metadata: Metadata = { title: "Sign in — Design Sandbox" };
|
|
6
6
|
|
|
7
7
|
type LoginPageProps = {
|
|
8
|
-
searchParams?: Promise<Record<string, string | string[] | undefined
|
|
9
|
-
}
|
|
8
|
+
searchParams?: Promise<Record<string, string | string[] | undefined>>;
|
|
9
|
+
};
|
|
10
10
|
|
|
11
11
|
export default async function LoginPage({ searchParams }: LoginPageProps) {
|
|
12
|
-
const model = await bonfire.auth.getLoginPageModel(searchParams)
|
|
13
|
-
return <GitHubCliLoginPage {...model}
|
|
12
|
+
const model = await bonfire.auth.getLoginPageModel(searchParams);
|
|
13
|
+
return <GitHubCliLoginPage {...model} />;
|
|
14
14
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { PrototypeDashboard } from
|
|
2
|
-
import { bonfire } from
|
|
3
|
-
import { openInClaudeCode, openInCursor } from
|
|
4
|
-
import type { Metadata } from
|
|
1
|
+
import { PrototypeDashboard } from "@ebay-dt/bonfire-react";
|
|
2
|
+
import { bonfire } from "@/bonfire";
|
|
3
|
+
import { openInClaudeCode, openInCursor } from "@/actions/agents";
|
|
4
|
+
import type { Metadata } from "next";
|
|
5
5
|
|
|
6
6
|
interface PageProps {
|
|
7
|
-
searchParams: Promise<Record<string, string | string[] | undefined
|
|
7
|
+
searchParams: Promise<Record<string, string | string[] | undefined>>;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const metadata: Metadata = { title:
|
|
10
|
+
export const metadata: Metadata = { title: "Dashboard — Design Sandbox" };
|
|
11
11
|
|
|
12
12
|
export default async function DashboardPage({ searchParams }: PageProps) {
|
|
13
13
|
const [dashboard, user] = await Promise.all([
|
|
14
14
|
bonfire.prototypes.getDashboardModel(searchParams),
|
|
15
15
|
bonfire.auth.getCurrentUser(),
|
|
16
|
-
])
|
|
17
|
-
const lifecycleEnabled = process.env.NODE_ENV !==
|
|
16
|
+
]);
|
|
17
|
+
const lifecycleEnabled = process.env.NODE_ENV !== "production";
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
<PrototypeDashboard
|
|
@@ -29,5 +29,5 @@ export default async function DashboardPage({ searchParams }: PageProps) {
|
|
|
29
29
|
}
|
|
30
30
|
: {})}
|
|
31
31
|
/>
|
|
32
|
-
)
|
|
32
|
+
);
|
|
33
33
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createItemDetailRoute,
|
|
3
3
|
type ItemRouteDiagnostic,
|
|
4
|
-
} from
|
|
5
|
-
import { getItemById } from
|
|
4
|
+
} from "@ebay-dt/bonfire-preset-ebay/data/items/server";
|
|
5
|
+
import { getItemById } from "@/lib/items/server";
|
|
6
6
|
|
|
7
7
|
function onDiagnostic({ operation, code }: ItemRouteDiagnostic) {
|
|
8
|
-
console.error(`Item ${operation} failed (${code}).`)
|
|
8
|
+
console.error(`Item ${operation} failed (${code}).`);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const handleItemDetail = createItemDetailRoute(
|
|
12
12
|
{ getItemById },
|
|
13
|
-
{ onDiagnostic }
|
|
14
|
-
)
|
|
13
|
+
{ onDiagnostic },
|
|
14
|
+
);
|
|
15
15
|
|
|
16
16
|
export async function GET(
|
|
17
17
|
request: Request,
|
|
18
|
-
context: RouteContext<
|
|
18
|
+
context: RouteContext<"/api/items/[itemId]">,
|
|
19
19
|
) {
|
|
20
|
-
return handleItemDetail(request, context)
|
|
20
|
+
return handleItemDetail(request, context);
|
|
21
21
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createItemSearchRoute,
|
|
3
3
|
type ItemRouteDiagnostic,
|
|
4
|
-
} from
|
|
5
|
-
import { searchItems } from
|
|
4
|
+
} from "@ebay-dt/bonfire-preset-ebay/data/items/server";
|
|
5
|
+
import { searchItems } from "@/lib/items/server";
|
|
6
6
|
|
|
7
7
|
function onDiagnostic({ operation, code }: ItemRouteDiagnostic) {
|
|
8
|
-
console.error(`Item ${operation} failed (${code}).`)
|
|
8
|
+
console.error(`Item ${operation} failed (${code}).`);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const GET = createItemSearchRoute({ searchItems }, { onDiagnostic })
|
|
11
|
+
export const GET = createItemSearchRoute({ searchItems }, { onDiagnostic });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Metadata } from
|
|
2
|
-
import { NextLifecycleProvider } from
|
|
3
|
-
import { EbayDesignSystemProvider } from
|
|
4
|
-
import { bonfire } from
|
|
1
|
+
import type { Metadata } from "next";
|
|
2
|
+
import { NextLifecycleProvider } from "@ebay-dt/bonfire-next/client";
|
|
3
|
+
import { EbayDesignSystemProvider } from "@ebay-dt/bonfire-preset-ebay";
|
|
4
|
+
import { bonfire } from "@/bonfire";
|
|
5
5
|
import {
|
|
6
6
|
createPrototype,
|
|
7
7
|
deletePrototype,
|
|
@@ -9,24 +9,33 @@ import {
|
|
|
9
9
|
duplicatePrototype,
|
|
10
10
|
editPrototype,
|
|
11
11
|
deployPrototype,
|
|
12
|
+
retryPublishPrototype,
|
|
12
13
|
savePrototype,
|
|
13
|
-
} from
|
|
14
|
-
import
|
|
15
|
-
|
|
14
|
+
} from "@/actions/prototypes";
|
|
15
|
+
import {
|
|
16
|
+
applyRepositoryUpdates,
|
|
17
|
+
checkRepository,
|
|
18
|
+
getRepositorySummary,
|
|
19
|
+
retryRepositoryUpdate,
|
|
20
|
+
saveRepositoryPrototype,
|
|
21
|
+
discardRepositoryPrototype,
|
|
22
|
+
} from "@/actions/repository";
|
|
23
|
+
import "@ebay-dt/bonfire-react/styles/defaults.css";
|
|
24
|
+
import "@ebay-dt/bonfire-preset-ebay/styles.css";
|
|
16
25
|
|
|
17
26
|
export const metadata: Metadata = {
|
|
18
|
-
title:
|
|
19
|
-
description:
|
|
20
|
-
icons: { icon:
|
|
21
|
-
}
|
|
27
|
+
title: "Design Sandbox",
|
|
28
|
+
description: "eBay Design Technology prototype sandbox",
|
|
29
|
+
icons: { icon: "https://fav.farm/🤙" },
|
|
30
|
+
};
|
|
22
31
|
|
|
23
32
|
export default async function RootLayout({
|
|
24
33
|
children,
|
|
25
34
|
}: Readonly<{
|
|
26
|
-
children: React.ReactNode
|
|
35
|
+
children: React.ReactNode;
|
|
27
36
|
}>) {
|
|
28
|
-
const lifecycleEnabled = process.env.NODE_ENV !==
|
|
29
|
-
const { htmlProps, headerProps } = await bonfire.auth.getAppLayoutModel()
|
|
37
|
+
const lifecycleEnabled = process.env.NODE_ENV !== "production";
|
|
38
|
+
const { htmlProps, headerProps } = await bonfire.auth.getAppLayoutModel();
|
|
30
39
|
|
|
31
40
|
return (
|
|
32
41
|
<html lang="en" {...htmlProps}>
|
|
@@ -37,6 +46,14 @@ export default async function RootLayout({
|
|
|
37
46
|
deploymentAvailable={bonfire.prototypes.capabilities.deployment}
|
|
38
47
|
user={headerProps.user}
|
|
39
48
|
dirtyEndpoint="/api/prototype-dirty"
|
|
49
|
+
repositoryActions={{
|
|
50
|
+
getSummary: getRepositorySummary,
|
|
51
|
+
check: checkRepository,
|
|
52
|
+
applyUpdates: applyRepositoryUpdates,
|
|
53
|
+
retry: retryRepositoryUpdate,
|
|
54
|
+
save: saveRepositoryPrototype,
|
|
55
|
+
discard: discardRepositoryPrototype,
|
|
56
|
+
}}
|
|
40
57
|
actions={{
|
|
41
58
|
create: createPrototype,
|
|
42
59
|
duplicate: duplicatePrototype,
|
|
@@ -44,7 +61,12 @@ export default async function RootLayout({
|
|
|
44
61
|
delete: deletePrototype,
|
|
45
62
|
save: savePrototype,
|
|
46
63
|
discard: discardPrototype,
|
|
47
|
-
...(lifecycleEnabled
|
|
64
|
+
...(lifecycleEnabled
|
|
65
|
+
? {
|
|
66
|
+
deploy: deployPrototype,
|
|
67
|
+
retryPublish: retryPublishPrototype,
|
|
68
|
+
}
|
|
69
|
+
: {}),
|
|
48
70
|
}}
|
|
49
71
|
>
|
|
50
72
|
{children}
|
|
@@ -52,5 +74,5 @@ export default async function RootLayout({
|
|
|
52
74
|
</EbayDesignSystemProvider>
|
|
53
75
|
</body>
|
|
54
76
|
</html>
|
|
55
|
-
)
|
|
77
|
+
);
|
|
56
78
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { themes } from
|
|
3
|
-
import { projectPrototypeContext } from
|
|
1
|
+
import "server-only";
|
|
2
|
+
import { themes } from "@ebay-dt/bonfire-preset-ebay";
|
|
3
|
+
import { projectPrototypeContext } from "@ebay-dt/bonfire-context";
|
|
4
4
|
import {
|
|
5
5
|
createBonfireNext,
|
|
6
6
|
createDeploymentProvider,
|
|
7
|
-
} from
|
|
7
|
+
} from "@ebay-dt/bonfire-next/server";
|
|
8
8
|
const deploymentProvider = createDeploymentProvider({
|
|
9
|
-
endpoint:
|
|
10
|
-
})
|
|
9
|
+
endpoint: "https://dtsvc.vip.qa.ebay.com/dt/v1/bonfire-deploy",
|
|
10
|
+
});
|
|
11
11
|
|
|
12
12
|
export const bonfire = createBonfireNext({
|
|
13
|
-
appId:
|
|
14
|
-
name:
|
|
15
|
-
auth: { github: { hostname:
|
|
13
|
+
appId: "design-sandbox-next",
|
|
14
|
+
name: "Design Sandbox",
|
|
15
|
+
auth: { github: { hostname: "github.corp.ebay.com" } },
|
|
16
16
|
themes,
|
|
17
17
|
repositoryRoot: process.cwd(),
|
|
18
18
|
primaryBranch: process.env.BF_PROTOTYPE_BASE_BRANCH,
|
|
@@ -20,6 +20,6 @@ export const bonfire = createBonfireNext({
|
|
|
20
20
|
disableAutoBranchSwitch: process.env.BF_DISABLE_AUTO_BRANCH_SWITCH,
|
|
21
21
|
deploymentProvider,
|
|
22
22
|
preparePrototypeFiles: async ({ prototypePath, repositoryRoot }) => {
|
|
23
|
-
await projectPrototypeContext({ repositoryRoot, prototypePath })
|
|
23
|
+
await projectPrototypeContext({ repositoryRoot, prototypePath });
|
|
24
24
|
},
|
|
25
|
-
})
|
|
25
|
+
});
|