@newt-app/templates 0.3.0 → 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 +23 -9
- 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() {
|
|
@@ -448,7 +456,7 @@ export default function Home() {
|
|
|
448
456
|
return (
|
|
449
457
|
<main className="max-w-lg mx-auto min-h-full px-4 py-8 space-y-4">
|
|
450
458
|
<div className="pb-4 border-b">
|
|
451
|
-
<p className="font-mono text-
|
|
459
|
+
<p className="font-mono text-sm text-gray-400">apps/web/page.tsx</p>
|
|
452
460
|
<p className="text-sm text-gray-400">Delete me to get started!</p>
|
|
453
461
|
</div>
|
|
454
462
|
|
|
@@ -464,13 +472,13 @@ export default function Home() {
|
|
|
464
472
|
|
|
465
473
|
<div className="rounded-xl border p-6 space-y-1">
|
|
466
474
|
<p className="text-xs font-mono uppercase tracking-widest text-gray-400">next.js</p>
|
|
467
|
-
<p className="font-mono text-sm">apps/web/layout.tsx</p>
|
|
475
|
+
<p className="font-mono text-sm text-gray-400">apps/web/layout.tsx</p>
|
|
468
476
|
<p className="text-sm text-gray-400">Next.js rendering</p>
|
|
469
477
|
</div>
|
|
470
478
|
|
|
471
479
|
<div className="rounded-xl border p-6 space-y-1">
|
|
472
480
|
<p className="text-xs font-mono uppercase tracking-widest text-gray-400">nest.js</p>
|
|
473
|
-
<p className="font-mono text-sm">GET /api/hello</p>
|
|
481
|
+
<p className="font-mono text-sm text-gray-400">GET /api/hello</p>
|
|
474
482
|
<pre className="mt-2 border rounded-md p-3 text-sm bg-neutral-800">
|
|
475
483
|
<code>{JSON.stringify(hello, null, 2)}</code>
|
|
476
484
|
</pre>
|
|
@@ -1060,7 +1068,13 @@ export class AppModule {}`
|
|
|
1060
1068
|
// src/api/templates/main.ts
|
|
1061
1069
|
var main_default = {
|
|
1062
1070
|
filename: "apps/api/src/main.ts",
|
|
1063
|
-
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
|
+
|
|
1064
1078
|
import { NestFactory } from '@nestjs/core';
|
|
1065
1079
|
import { AppModule } from './app.module';
|
|
1066
1080
|
|
|
@@ -1972,7 +1986,7 @@ export default function Home() {
|
|
|
1972
1986
|
return (
|
|
1973
1987
|
<main className="max-w-lg mx-auto min-h-full px-4 py-8 space-y-4">
|
|
1974
1988
|
<div className="pb-4 border-b">
|
|
1975
|
-
<p className="font-mono text-
|
|
1989
|
+
<p className="font-mono text-sm text-muted-foreground">apps/web/page.tsx</p>
|
|
1976
1990
|
<p className="text-sm text-muted-foreground">Delete me to get started!</p>
|
|
1977
1991
|
</div>
|
|
1978
1992
|
|
|
@@ -1993,7 +2007,7 @@ export default function Home() {
|
|
|
1993
2007
|
</CardTitle>
|
|
1994
2008
|
</CardHeader>
|
|
1995
2009
|
<CardContent>
|
|
1996
|
-
<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>
|
|
1997
2011
|
<p className="text-sm text-muted-foreground">Next.js rendering</p>
|
|
1998
2012
|
</CardContent>
|
|
1999
2013
|
</Card>
|
|
@@ -2005,7 +2019,7 @@ export default function Home() {
|
|
|
2005
2019
|
</CardTitle>
|
|
2006
2020
|
</CardHeader>
|
|
2007
2021
|
<CardContent>
|
|
2008
|
-
<p className="font-mono text-sm">GET /api/hello</p>
|
|
2022
|
+
<p className="font-mono text-sm text-muted-foreground">GET /api/hello</p>
|
|
2009
2023
|
<pre className="mt-2 rounded-md border p-3 text-sm bg-muted/50">
|
|
2010
2024
|
<code>{JSON.stringify(hello, null, 2)}</code>
|
|
2011
2025
|
</pre>
|