create-githat-app 1.6.0 → 1.7.0
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/cli.js +2 -2
- package/package.json +1 -1
- package/templates/agent/app/api/githat/[...path]/route.ts.hbs +21 -0
- package/templates/agent/app/layout.tsx.hbs +1 -0
- package/templates/base/githat/config.ts.hbs +8 -1
- package/templates/classroom/app/api/githat/[...path]/route.ts.hbs +21 -0
- package/templates/classroom/app/layout.tsx.hbs +1 -0
- package/templates/content/app/api/githat/[...path]/route.ts.hbs +21 -0
- package/templates/content/app/layout.tsx.hbs +1 -0
- package/templates/dashboard/app/api/githat/[...path]/route.ts.hbs +21 -0
- package/templates/dashboard/app/layout.tsx.hbs +1 -0
- package/templates/fullstack/apps-web-nextjs/app/api/githat/[...path]/route.ts.hbs +21 -0
- package/templates/fullstack/apps-web-nextjs/app/layout.tsx.hbs +1 -0
- package/templates/marketplace/app/api/githat/[...path]/route.ts.hbs +21 -0
- package/templates/marketplace/app/layout.tsx.hbs +1 -0
- package/templates/nextjs/app/api/githat/[...path]/route.ts.hbs +21 -0
- package/templates/nextjs/app/layout.tsx.hbs +1 -0
- package/templates/plain/app/api/githat/[...path]/route.ts.hbs +21 -0
- package/templates/plain/app/layout.tsx.hbs +1 -0
- package/templates/portfolio/app/api/githat/[...path]/route.ts.hbs +21 -0
- package/templates/portfolio/app/layout.tsx.hbs +1 -0
- package/templates/saas/app/api/githat/[...path]/route.ts.hbs +21 -0
- package/templates/saas/app/layout.tsx.hbs +1 -0
package/dist/cli.js
CHANGED
|
@@ -21,7 +21,7 @@ var DEPS = {
|
|
|
21
21
|
next: "^16.0.0",
|
|
22
22
|
react: "^19.0.0",
|
|
23
23
|
"react-dom": "^19.0.0",
|
|
24
|
-
"@githat/nextjs": "^0.
|
|
24
|
+
"@githat/nextjs": "^0.12.0",
|
|
25
25
|
"@githat/ui": "^1.0.0"
|
|
26
26
|
},
|
|
27
27
|
devDependencies: {
|
|
@@ -36,7 +36,7 @@ var DEPS = {
|
|
|
36
36
|
react: "^19.0.0",
|
|
37
37
|
"react-dom": "^19.0.0",
|
|
38
38
|
"react-router-dom": "^7.0.0",
|
|
39
|
-
"@githat/nextjs": "^0.
|
|
39
|
+
"@githat/nextjs": "^0.12.0",
|
|
40
40
|
"@githat/ui": "^1.0.0"
|
|
41
41
|
},
|
|
42
42
|
devDependencies: {
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-origin GitHat API proxy.
|
|
3
|
+
*
|
|
4
|
+
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
+
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
+
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
+
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
+
*
|
|
9
|
+
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
+
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
+
* on this app's domain.
|
|
12
|
+
*
|
|
13
|
+
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
+
*/
|
|
15
|
+
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
+
|
|
17
|
+
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
+
|
|
19
|
+
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
+
export const dynamic = "force-dynamic";
|
|
21
|
+
export const revalidate = 0;
|
|
@@ -19,6 +19,7 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
|
|
|
19
19
|
*/}
|
|
20
20
|
<GitHatProvider config=\{{
|
|
21
21
|
publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
|
|
22
|
+
apiUrl: '/api/githat',
|
|
22
23
|
signInUrl: '/sign-in',
|
|
23
24
|
signUpUrl: '/sign-up',
|
|
24
25
|
afterSignInUrl: '/',
|
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
export const githatConfig = {
|
|
3
3
|
appName: '{{businessName}}',
|
|
4
4
|
publishableKey: {{#ifEquals framework "nextjs"}}process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY{{else}}import.meta.env.VITE_GITHAT_PUBLISHABLE_KEY{{/ifEquals}} || '',
|
|
5
|
-
|
|
5
|
+
// For nextjs we point at the same-origin proxy mounted at
|
|
6
|
+
// src/app/api/githat/[...path]/route.ts — that proxy forwards to the
|
|
7
|
+
// real api.githat.io upstream and re-emits Set-Cookie on this app's
|
|
8
|
+
// domain so cookies are visible to proxy.ts and getAuth(). For
|
|
9
|
+
// react-vite (no Next.js API routes) we hit api.githat.io directly,
|
|
10
|
+
// which only works for browser-token auth flows that don't depend on
|
|
11
|
+
// cookies.
|
|
12
|
+
apiUrl: {{#ifEquals framework "nextjs"}}process.env.NEXT_PUBLIC_GITHAT_API_URL || '/api/githat'{{else}}import.meta.env.VITE_GITHAT_API_URL || '{{apiUrl}}'{{/ifEquals}},
|
|
6
13
|
signInUrl: '/sign-in',
|
|
7
14
|
signUpUrl: '/sign-up',
|
|
8
15
|
afterSignInUrl: '/dashboard',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-origin GitHat API proxy.
|
|
3
|
+
*
|
|
4
|
+
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
+
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
+
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
+
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
+
*
|
|
9
|
+
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
+
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
+
* on this app's domain.
|
|
12
|
+
*
|
|
13
|
+
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
+
*/
|
|
15
|
+
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
+
|
|
17
|
+
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
+
|
|
19
|
+
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
+
export const dynamic = "force-dynamic";
|
|
21
|
+
export const revalidate = 0;
|
|
@@ -19,6 +19,7 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
|
|
|
19
19
|
*/}
|
|
20
20
|
<GitHatProvider config=\{{
|
|
21
21
|
publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
|
|
22
|
+
apiUrl: '/api/githat',
|
|
22
23
|
signInUrl: '/sign-in',
|
|
23
24
|
signUpUrl: '/sign-up',
|
|
24
25
|
afterSignInUrl: '/',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-origin GitHat API proxy.
|
|
3
|
+
*
|
|
4
|
+
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
+
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
+
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
+
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
+
*
|
|
9
|
+
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
+
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
+
* on this app's domain.
|
|
12
|
+
*
|
|
13
|
+
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
+
*/
|
|
15
|
+
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
+
|
|
17
|
+
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
+
|
|
19
|
+
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
+
export const dynamic = "force-dynamic";
|
|
21
|
+
export const revalidate = 0;
|
|
@@ -19,6 +19,7 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
|
|
|
19
19
|
*/}
|
|
20
20
|
<GitHatProvider config=\{{
|
|
21
21
|
publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
|
|
22
|
+
apiUrl: '/api/githat',
|
|
22
23
|
signInUrl: '/sign-in',
|
|
23
24
|
signUpUrl: '/sign-up',
|
|
24
25
|
afterSignInUrl: '/',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-origin GitHat API proxy.
|
|
3
|
+
*
|
|
4
|
+
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
+
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
+
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
+
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
+
*
|
|
9
|
+
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
+
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
+
* on this app's domain.
|
|
12
|
+
*
|
|
13
|
+
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
+
*/
|
|
15
|
+
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
+
|
|
17
|
+
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
+
|
|
19
|
+
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
+
export const dynamic = "force-dynamic";
|
|
21
|
+
export const revalidate = 0;
|
|
@@ -19,6 +19,7 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
|
|
|
19
19
|
*/}
|
|
20
20
|
<GitHatProvider config=\{{
|
|
21
21
|
publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
|
|
22
|
+
apiUrl: '/api/githat',
|
|
22
23
|
signInUrl: '/sign-in',
|
|
23
24
|
signUpUrl: '/sign-up',
|
|
24
25
|
afterSignInUrl: '/',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-origin GitHat API proxy.
|
|
3
|
+
*
|
|
4
|
+
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
+
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
+
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
+
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
+
*
|
|
9
|
+
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
+
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
+
* on this app's domain.
|
|
12
|
+
*
|
|
13
|
+
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
+
*/
|
|
15
|
+
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
+
|
|
17
|
+
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
+
|
|
19
|
+
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
+
export const dynamic = "force-dynamic";
|
|
21
|
+
export const revalidate = 0;
|
|
@@ -14,6 +14,7 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
|
|
|
14
14
|
<body>
|
|
15
15
|
<GitHatProvider config=\{{
|
|
16
16
|
publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
|
|
17
|
+
apiUrl: '/api/githat',
|
|
17
18
|
signInUrl: '/sign-in',
|
|
18
19
|
signUpUrl: '/sign-up',
|
|
19
20
|
afterSignInUrl: '/dashboard',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-origin GitHat API proxy.
|
|
3
|
+
*
|
|
4
|
+
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
+
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
+
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
+
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
+
*
|
|
9
|
+
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
+
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
+
* on this app's domain.
|
|
12
|
+
*
|
|
13
|
+
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
+
*/
|
|
15
|
+
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
+
|
|
17
|
+
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
+
|
|
19
|
+
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
+
export const dynamic = "force-dynamic";
|
|
21
|
+
export const revalidate = 0;
|
|
@@ -25,6 +25,7 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
|
|
|
25
25
|
<body>
|
|
26
26
|
<GitHatProvider config=\{{
|
|
27
27
|
publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
|
|
28
|
+
apiUrl: '/api/githat',
|
|
28
29
|
signInUrl: '/sign-in',
|
|
29
30
|
signUpUrl: '/sign-up',
|
|
30
31
|
afterSignInUrl: '/',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-origin GitHat API proxy.
|
|
3
|
+
*
|
|
4
|
+
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
+
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
+
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
+
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
+
*
|
|
9
|
+
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
+
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
+
* on this app's domain.
|
|
12
|
+
*
|
|
13
|
+
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
+
*/
|
|
15
|
+
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
+
|
|
17
|
+
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
+
|
|
19
|
+
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
+
export const dynamic = "force-dynamic";
|
|
21
|
+
export const revalidate = 0;
|
|
@@ -20,6 +20,7 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
|
|
|
20
20
|
...githatConfig,
|
|
21
21
|
{{else}}
|
|
22
22
|
publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
|
|
23
|
+
apiUrl: '/api/githat',
|
|
23
24
|
signInUrl: '/sign-in',
|
|
24
25
|
signUpUrl: '/sign-up',
|
|
25
26
|
afterSignInUrl: '/dashboard',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-origin GitHat API proxy.
|
|
3
|
+
*
|
|
4
|
+
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
+
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
+
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
+
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
+
*
|
|
9
|
+
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
+
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
+
* on this app's domain.
|
|
12
|
+
*
|
|
13
|
+
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
+
*/
|
|
15
|
+
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
+
|
|
17
|
+
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
+
|
|
19
|
+
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
+
export const dynamic = "force-dynamic";
|
|
21
|
+
export const revalidate = 0;
|
|
@@ -19,6 +19,7 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
|
|
|
19
19
|
*/}
|
|
20
20
|
<GitHatProvider config=\{{
|
|
21
21
|
publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
|
|
22
|
+
apiUrl: '/api/githat',
|
|
22
23
|
signInUrl: '/sign-in',
|
|
23
24
|
signUpUrl: '/sign-up',
|
|
24
25
|
afterSignInUrl: '/',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-origin GitHat API proxy.
|
|
3
|
+
*
|
|
4
|
+
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
+
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
+
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
+
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
+
*
|
|
9
|
+
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
+
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
+
* on this app's domain.
|
|
12
|
+
*
|
|
13
|
+
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
+
*/
|
|
15
|
+
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
+
|
|
17
|
+
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
+
|
|
19
|
+
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
+
export const dynamic = "force-dynamic";
|
|
21
|
+
export const revalidate = 0;
|
|
@@ -19,6 +19,7 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
|
|
|
19
19
|
*/}
|
|
20
20
|
<GitHatProvider config=\{{
|
|
21
21
|
publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
|
|
22
|
+
apiUrl: '/api/githat',
|
|
22
23
|
signInUrl: '/sign-in',
|
|
23
24
|
signUpUrl: '/sign-up',
|
|
24
25
|
afterSignInUrl: '/',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-origin GitHat API proxy.
|
|
3
|
+
*
|
|
4
|
+
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
+
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
+
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
+
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
+
*
|
|
9
|
+
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
+
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
+
* on this app's domain.
|
|
12
|
+
*
|
|
13
|
+
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
+
*/
|
|
15
|
+
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
+
|
|
17
|
+
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
+
|
|
19
|
+
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
+
export const dynamic = "force-dynamic";
|
|
21
|
+
export const revalidate = 0;
|
|
@@ -19,6 +19,7 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
|
|
|
19
19
|
*/}
|
|
20
20
|
<GitHatProvider config=\{{
|
|
21
21
|
publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
|
|
22
|
+
apiUrl: '/api/githat',
|
|
22
23
|
signInUrl: '/sign-in',
|
|
23
24
|
signUpUrl: '/sign-up',
|
|
24
25
|
afterSignInUrl: '/',
|