@newt-app/templates 0.2.2 → 0.4.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/index.js +46 -37
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -177,7 +177,7 @@ Open [http://localhost:3000](http://localhost:3000).
|
|
|
177
177
|
|
|
178
178
|
// src/root/templates/env-example.ts
|
|
179
179
|
var env_example_default = {
|
|
180
|
-
filename: ".env
|
|
180
|
+
filename: ".env",
|
|
181
181
|
template: `DATABASE_URL=postgresql://user:password@localhost:5432/dbname
|
|
182
182
|
BETTER_AUTH_URL=http://localhost:3000
|
|
183
183
|
BETTER_AUTH_SECRET=your-secret-here`
|
|
@@ -218,6 +218,7 @@ var package_json_default2 = {
|
|
|
218
218
|
"@<%= projectName %>/auth": "workspace:*",
|
|
219
219
|
"@<%= projectName %>/ui": "workspace:*",
|
|
220
220
|
"@tailwindcss/postcss": "^4.2.1",
|
|
221
|
+
"dotenv": "^17.3.1",
|
|
221
222
|
"@tanstack/react-form": "^1.28.5",
|
|
222
223
|
"@tanstack/react-query": "^5.90.21",
|
|
223
224
|
"better-auth": "^1.2.8",
|
|
@@ -332,7 +333,14 @@ export default nextJsConfig;`
|
|
|
332
333
|
// src/web/templates/next-config.ts
|
|
333
334
|
var next_config_default = {
|
|
334
335
|
filename: "apps/web/next.config.js",
|
|
335
|
-
template:
|
|
336
|
+
template: `import dotenv from 'dotenv';
|
|
337
|
+
import { resolve } from 'path';
|
|
338
|
+
|
|
339
|
+
// Load root .env first, then local .env (local takes precedence)
|
|
340
|
+
dotenv.config({ path: resolve(process.cwd(), '../../.env') });
|
|
341
|
+
dotenv.config({ path: resolve(process.cwd(), '.env') });
|
|
342
|
+
|
|
343
|
+
/** @type {import('next').NextConfig} */
|
|
336
344
|
const nextConfig = {
|
|
337
345
|
output: "standalone",
|
|
338
346
|
async rewrites() {
|
|
@@ -446,44 +454,38 @@ export default function Home() {
|
|
|
446
454
|
});
|
|
447
455
|
|
|
448
456
|
return (
|
|
449
|
-
<main className="max-w-lg mx-auto
|
|
450
|
-
<div className="border-b
|
|
451
|
-
<p className="font-mono">apps/web/page.tsx</p>
|
|
452
|
-
<p className="text-gray-400">Delete me to get started!</p>
|
|
457
|
+
<main className="max-w-lg mx-auto min-h-full px-4 py-8 space-y-4">
|
|
458
|
+
<div className="pb-4 border-b">
|
|
459
|
+
<p className="font-mono text-sm text-gray-400">apps/web/page.tsx</p>
|
|
460
|
+
<p className="text-sm text-gray-400">Delete me to get started!</p>
|
|
453
461
|
</div>
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
462
|
+
|
|
463
|
+
<div className="flex items-center gap-3 py-2">
|
|
464
|
+
<Logo className="w-10 h-auto text-foreground" />
|
|
465
|
+
<div>
|
|
466
|
+
<h1 className="text-4xl font-black tracking-tight"><%= projectName %></h1>
|
|
467
|
+
<p className="text-sm text-gray-400 tracking-widest uppercase">
|
|
468
|
+
Next + Nest = Newt \u{1F49C}
|
|
469
|
+
</p>
|
|
460
470
|
</div>
|
|
461
|
-
<p className="mt-2 text-sm text-gray-400 tracking-widest uppercase">
|
|
462
|
-
Next + Nest = Newt \u{1F49C}
|
|
463
|
-
</p>
|
|
464
|
-
<p className="text-gray-400">The perfect TypeScript monorepo setup</p>
|
|
465
471
|
</div>
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
</
|
|
470
|
-
<p className="
|
|
471
|
-
<p className="text-gray-400">Next.js rendering</p>
|
|
472
|
+
|
|
473
|
+
<div className="rounded-xl border p-6 space-y-1">
|
|
474
|
+
<p className="text-xs font-mono uppercase tracking-widest text-gray-400">next.js</p>
|
|
475
|
+
<p className="font-mono text-sm text-gray-400">apps/web/layout.tsx</p>
|
|
476
|
+
<p className="text-sm text-gray-400">Next.js rendering</p>
|
|
472
477
|
</div>
|
|
473
478
|
|
|
474
|
-
<div className="
|
|
475
|
-
<
|
|
476
|
-
|
|
477
|
-
</div>
|
|
478
|
-
<p className="font-mono">GET /api/hello</p>
|
|
479
|
+
<div className="rounded-xl border p-6 space-y-1">
|
|
480
|
+
<p className="text-xs font-mono uppercase tracking-widest text-gray-400">nest.js</p>
|
|
481
|
+
<p className="font-mono text-sm text-gray-400">GET /api/hello</p>
|
|
479
482
|
<pre className="mt-2 border rounded-md p-3 text-sm bg-neutral-800">
|
|
480
483
|
<code>{JSON.stringify(hello, null, 2)}</code>
|
|
481
484
|
</pre>
|
|
482
485
|
</div>
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
</div>
|
|
486
|
+
|
|
487
|
+
<div className="rounded-xl border p-6">
|
|
488
|
+
<p className="text-xs font-mono uppercase tracking-widest text-gray-400 mb-4">better-auth</p>
|
|
487
489
|
{isPending ? (
|
|
488
490
|
<p className="text-sm text-gray-400">Loading\u2026</p>
|
|
489
491
|
) : session ? (
|
|
@@ -492,8 +494,9 @@ export default function Home() {
|
|
|
492
494
|
<AuthForm />
|
|
493
495
|
)}
|
|
494
496
|
</div>
|
|
495
|
-
|
|
496
|
-
|
|
497
|
+
|
|
498
|
+
<div className="px-2 py-4 text-sm">
|
|
499
|
+
<p className="mb-2 text-gray-400">Learn more</p>
|
|
497
500
|
<ul className="list-disc list-inside space-y-2 mt-2">
|
|
498
501
|
<li>
|
|
499
502
|
<Link href="https://github.com">GitHub</Link>
|
|
@@ -1065,7 +1068,13 @@ export class AppModule {}`
|
|
|
1065
1068
|
// src/api/templates/main.ts
|
|
1066
1069
|
var main_default = {
|
|
1067
1070
|
filename: "apps/api/src/main.ts",
|
|
1068
|
-
template: `import 'dotenv
|
|
1071
|
+
template: `import dotenv from 'dotenv';
|
|
1072
|
+
import { resolve } from 'path';
|
|
1073
|
+
|
|
1074
|
+
// Load root .env first, then local .env (local takes precedence)
|
|
1075
|
+
dotenv.config({ path: resolve(process.cwd(), '../../.env') });
|
|
1076
|
+
dotenv.config({ path: resolve(process.cwd(), '.env') });
|
|
1077
|
+
|
|
1069
1078
|
import { NestFactory } from '@nestjs/core';
|
|
1070
1079
|
import { AppModule } from './app.module';
|
|
1071
1080
|
|
|
@@ -1977,7 +1986,7 @@ export default function Home() {
|
|
|
1977
1986
|
return (
|
|
1978
1987
|
<main className="max-w-lg mx-auto min-h-full px-4 py-8 space-y-4">
|
|
1979
1988
|
<div className="pb-4 border-b">
|
|
1980
|
-
<p className="font-mono text-
|
|
1989
|
+
<p className="font-mono text-sm text-muted-foreground">apps/web/page.tsx</p>
|
|
1981
1990
|
<p className="text-sm text-muted-foreground">Delete me to get started!</p>
|
|
1982
1991
|
</div>
|
|
1983
1992
|
|
|
@@ -1998,7 +2007,7 @@ export default function Home() {
|
|
|
1998
2007
|
</CardTitle>
|
|
1999
2008
|
</CardHeader>
|
|
2000
2009
|
<CardContent>
|
|
2001
|
-
<p className="font-mono text-sm">apps/web/layout.tsx</p>
|
|
2010
|
+
<p className="font-mono text-sm text-muted-foreground">apps/web/layout.tsx</p>
|
|
2002
2011
|
<p className="text-sm text-muted-foreground">Next.js rendering</p>
|
|
2003
2012
|
</CardContent>
|
|
2004
2013
|
</Card>
|
|
@@ -2010,7 +2019,7 @@ export default function Home() {
|
|
|
2010
2019
|
</CardTitle>
|
|
2011
2020
|
</CardHeader>
|
|
2012
2021
|
<CardContent>
|
|
2013
|
-
<p className="font-mono text-sm">GET /api/hello</p>
|
|
2022
|
+
<p className="font-mono text-sm text-muted-foreground">GET /api/hello</p>
|
|
2014
2023
|
<pre className="mt-2 rounded-md border p-3 text-sm bg-muted/50">
|
|
2015
2024
|
<code>{JSON.stringify(hello, null, 2)}</code>
|
|
2016
2025
|
</pre>
|