create-veap 0.1.2
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/README.md +3 -0
- package/bin/veap.js +7 -0
- package/dist/commands/docker.d.ts +1 -0
- package/dist/commands/docker.js +55 -0
- package/dist/commands/init.d.ts +5 -0
- package/dist/commands/init.js +111 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +16 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +1 -0
- package/dist/manifests.d.ts +22 -0
- package/dist/manifests.js +32 -0
- package/dist/mutate.d.ts +46 -0
- package/dist/mutate.js +127 -0
- package/dist/package-manager.d.ts +56 -0
- package/dist/package-manager.js +222 -0
- package/dist/project-name.d.ts +22 -0
- package/dist/project-name.js +107 -0
- package/dist/prompts.d.ts +20 -0
- package/dist/prompts.js +93 -0
- package/dist/scaffold.d.ts +26 -0
- package/dist/scaffold.js +62 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +29 -0
- package/package.json +45 -0
- package/stubs/docker/.dockerignore.stub +39 -0
- package/stubs/docker/Dockerfile.bun.stub +42 -0
- package/stubs/docker/Dockerfile.npm.stub +42 -0
- package/stubs/docker/Dockerfile.stub +49 -0
- package/stubs/docker/Dockerfile.yarn.stub +44 -0
- package/stubs/docker/compose.yml.stub +58 -0
- package/stubs/overlay-full/AGENTS.md.stub +63 -0
- package/stubs/overlay-full/app/[[...catchAll]]/page.tsx.stub +47 -0
- package/stubs/overlay-full/app/api/[...catchAll]/route.ts.stub +111 -0
- package/stubs/overlay-full/app/error.tsx.stub +34 -0
- package/stubs/overlay-full/app/globals.css.stub +124 -0
- package/stubs/overlay-full/app/layout.tsx.stub +71 -0
- package/stubs/overlay-full/app/not-found.tsx.stub +29 -0
- package/stubs/overlay-full/app/storage/[...path]/route.ts.stub +61 -0
- package/stubs/overlay-full/lib/plugins.gen.ts.stub +6 -0
- package/stubs/overlay-full/lib/veap.ts.stub +26 -0
- package/stubs/overlay-full/migrations/index.ts.stub +2 -0
- package/stubs/overlay-full/next.config.ts.stub +34 -0
- package/stubs/overlay-full/proxy.ts.stub +27 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
|
|
3
|
+
// The root layout boots Veap (`initializeSystem()`), reads cookies and renders
|
|
4
|
+
// plugin extension points - all request-time concerns. During `next build`,
|
|
5
|
+
// Next.js prerenders `/_not-found` with `NEXT_PHASE=phase-production-build`,
|
|
6
|
+
// in which `Application.bootstrap()` intentionally skips provider boot, so the
|
|
7
|
+
// context-bound helpers in the layout would throw. Marking this route
|
|
8
|
+
// force-dynamic keeps prerendering away and the framework off the 404 path.
|
|
9
|
+
export const dynamic = "force-dynamic";
|
|
10
|
+
|
|
11
|
+
export default function NotFound() {
|
|
12
|
+
return (
|
|
13
|
+
<div className="flex min-h-[60vh] flex-col items-center justify-center gap-4 px-4 text-center">
|
|
14
|
+
<p className="text-sm font-semibold tracking-widest uppercase opacity-60">
|
|
15
|
+
404
|
|
16
|
+
</p>
|
|
17
|
+
<h1 className="text-3xl font-bold">Page not found</h1>
|
|
18
|
+
<p className="max-w-md opacity-70">
|
|
19
|
+
The page you are looking for does not exist or has been moved.
|
|
20
|
+
</p>
|
|
21
|
+
<Link
|
|
22
|
+
href="/"
|
|
23
|
+
className="bg-primary text-primary-foreground hover:bg-primary/90 mt-2 inline-flex h-10 items-center justify-center rounded-md px-6 text-sm font-medium transition-colors"
|
|
24
|
+
>
|
|
25
|
+
Back to home
|
|
26
|
+
</Link>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { type NextRequest, NextResponse } from "next/server";
|
|
4
|
+
|
|
5
|
+
export const dynamic = "force-dynamic";
|
|
6
|
+
|
|
7
|
+
export async function GET(
|
|
8
|
+
request: NextRequest,
|
|
9
|
+
context: { params: Promise<{ path: string[] }> },
|
|
10
|
+
) {
|
|
11
|
+
const resolvedParams = await context.params;
|
|
12
|
+
const filePath = path.join(
|
|
13
|
+
/*turbopackIgnore: true*/ process.cwd(),
|
|
14
|
+
"public",
|
|
15
|
+
"storage",
|
|
16
|
+
...resolvedParams.path,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
// Prevent Directory Traversal Attacks!
|
|
20
|
+
const safePath = path.normalize(filePath);
|
|
21
|
+
const baseStoragePath = path.join(
|
|
22
|
+
/*turbopackIgnore: true*/ process.cwd(),
|
|
23
|
+
"public",
|
|
24
|
+
"storage",
|
|
25
|
+
);
|
|
26
|
+
if (!safePath.startsWith(baseStoragePath)) {
|
|
27
|
+
return new NextResponse("Forbidden", { status: 403 });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (
|
|
31
|
+
!fs.existsSync(/*turbopackIgnore: true*/ safePath) ||
|
|
32
|
+
fs.statSync(/*turbopackIgnore: true*/ safePath).isDirectory()
|
|
33
|
+
) {
|
|
34
|
+
return new NextResponse("Not Found", { status: 404 });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const fileBuffer = fs.readFileSync(/*turbopackIgnore: true*/ safePath);
|
|
38
|
+
|
|
39
|
+
// Determine Content-Type
|
|
40
|
+
const ext = path.extname(safePath).toLowerCase();
|
|
41
|
+
let contentType = "application/octet-stream";
|
|
42
|
+
if (ext === ".png") contentType = "image/png";
|
|
43
|
+
else if (ext === ".jpg" || ext === ".jpeg") contentType = "image/jpeg";
|
|
44
|
+
else if (ext === ".gif") contentType = "image/gif";
|
|
45
|
+
else if (ext === ".svg") contentType = "image/svg+xml";
|
|
46
|
+
else if (ext === ".webp") contentType = "image/webp";
|
|
47
|
+
else if (ext === ".md" || ext === ".mdx")
|
|
48
|
+
contentType = "text/markdown; charset=utf-8";
|
|
49
|
+
else if (ext === ".json") contentType = "application/json";
|
|
50
|
+
else if (ext === ".txt") contentType = "text/plain; charset=utf-8";
|
|
51
|
+
else if (ext === ".pdf") contentType = "application/pdf";
|
|
52
|
+
else if (ext === ".css") contentType = "text/css";
|
|
53
|
+
else if (ext === ".js") contentType = "application/javascript";
|
|
54
|
+
|
|
55
|
+
return new NextResponse(fileBuffer, {
|
|
56
|
+
headers: {
|
|
57
|
+
"Content-Type": contentType,
|
|
58
|
+
"Cache-Control": "public, max-age=31536000, immutable",
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cache } from "react";
|
|
2
|
+
import { Application } from "@veap/framework/core/server";
|
|
3
|
+
|
|
4
|
+
import { appMigrations } from "../migrations";
|
|
5
|
+
import { plugins } from "./plugins.gen";
|
|
6
|
+
|
|
7
|
+
export const app = Application.configure()
|
|
8
|
+
.withDatabase()
|
|
9
|
+
.withAuth()
|
|
10
|
+
.withStorage()
|
|
11
|
+
.withCommunication()
|
|
12
|
+
.withIntl()
|
|
13
|
+
.withRouter()
|
|
14
|
+
.withSettings()
|
|
15
|
+
.withMigrations(appMigrations)
|
|
16
|
+
.withPlugins(plugins)
|
|
17
|
+
.withTemplates([])
|
|
18
|
+
.create();
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Main system bootstrap function.
|
|
22
|
+
* Called automatically in root layout/pages.
|
|
23
|
+
*/
|
|
24
|
+
export const initializeSystem = cache(async () => {
|
|
25
|
+
return app.bootstrap();
|
|
26
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { NextConfig } from "next";
|
|
2
|
+
|
|
3
|
+
const nextConfig: NextConfig = {
|
|
4
|
+
serverExternalPackages: ["knex", "pg", "better-sqlite3"],
|
|
5
|
+
// Output for standalone build in docker (disabled on Vercel to avoid build crash)
|
|
6
|
+
output: process.env.VERCEL ? undefined : "standalone",
|
|
7
|
+
|
|
8
|
+
transpilePackages: ["@veap/framework", "@veap/ui"],
|
|
9
|
+
|
|
10
|
+
reactCompiler: true,
|
|
11
|
+
|
|
12
|
+
experimental: {
|
|
13
|
+
turbopackFileSystemCacheForBuild: true,
|
|
14
|
+
turbopackRustReactCompiler: true
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
outputFileTracingIncludes: {
|
|
18
|
+
"/**/*": ["veap.config.ts"],
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
typescript: {
|
|
22
|
+
// !! WARN !!
|
|
23
|
+
// Dangerously allow production builds to successfully complete even if
|
|
24
|
+
// your project has type errors.
|
|
25
|
+
// !! WARN !!
|
|
26
|
+
ignoreBuildErrors: true,
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
images: {
|
|
30
|
+
unoptimized: true,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default nextConfig;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { NextRequest } from "next/server";
|
|
2
|
+
import { NextResponse } from "next/server";
|
|
3
|
+
|
|
4
|
+
export function proxy(request: NextRequest) {
|
|
5
|
+
const url = new URL(request.url);
|
|
6
|
+
const requestHeaders = new Headers(request.headers);
|
|
7
|
+
requestHeaders.set("x-pathname", url.pathname);
|
|
8
|
+
|
|
9
|
+
return NextResponse.next({
|
|
10
|
+
request: {
|
|
11
|
+
headers: requestHeaders,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const config = {
|
|
17
|
+
matcher: [
|
|
18
|
+
/*
|
|
19
|
+
* Match all request paths except for the ones starting with:
|
|
20
|
+
* - api (API routes)
|
|
21
|
+
* - _next/static (static files)
|
|
22
|
+
* - _next/image (image optimization files)
|
|
23
|
+
* - favicon.ico (favicon file)
|
|
24
|
+
*/
|
|
25
|
+
"/((?!api|_next/static|_next/image|favicon.ico).*)",
|
|
26
|
+
],
|
|
27
|
+
};
|