@newt-app/templates 0.4.1 → 0.6.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.d.ts +3 -0
- package/dist/index.js +527 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -42,6 +42,9 @@ declare const templates: {
|
|
|
42
42
|
typescriptConfig: Module;
|
|
43
43
|
testingJest: Module;
|
|
44
44
|
testingVitest: Module;
|
|
45
|
+
deploymentCustomServer: Module;
|
|
46
|
+
deploymentSpa: Module;
|
|
47
|
+
deploymentVercel: Module;
|
|
45
48
|
};
|
|
46
49
|
|
|
47
50
|
export { type File, type Module, type Package, type Script, type Template, type TemplateData, getStaticFilePath, staticDir, staticDirPath, templates };
|
package/dist/index.js
CHANGED
|
@@ -178,7 +178,7 @@ Open [http://localhost:3000](http://localhost:3000).
|
|
|
178
178
|
// src/root/templates/env-example.ts
|
|
179
179
|
var env_example_default = {
|
|
180
180
|
filename: ".env",
|
|
181
|
-
template: `DATABASE_URL=postgresql://
|
|
181
|
+
template: `DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres
|
|
182
182
|
BETTER_AUTH_URL=http://localhost:3000
|
|
183
183
|
BETTER_AUTH_SECRET=your-secret-here`
|
|
184
184
|
};
|
|
@@ -1976,6 +1976,7 @@ import { AuthForm } from '@/app/auth-form';
|
|
|
1976
1976
|
import { Link } from '@<%= projectName %>/ui/link';
|
|
1977
1977
|
import { Logo } from '@<%= projectName %>/ui/logo';
|
|
1978
1978
|
import { TodoList } from '@/app/todo-list';
|
|
1979
|
+
import { ModeToggle } from '@<%= projectName %>/ui/mode-toggle';
|
|
1979
1980
|
import { Card, CardContent, CardHeader, CardTitle } from '@<%= projectName %>/ui/card';
|
|
1980
1981
|
|
|
1981
1982
|
export default function Home() {
|
|
@@ -1988,9 +1989,12 @@ export default function Home() {
|
|
|
1988
1989
|
|
|
1989
1990
|
return (
|
|
1990
1991
|
<main className="max-w-lg mx-auto min-h-full px-4 py-8 space-y-4">
|
|
1991
|
-
<div className="pb-4 border-b">
|
|
1992
|
-
<
|
|
1993
|
-
|
|
1992
|
+
<div className="pb-4 border-b flex items-start justify-between">
|
|
1993
|
+
<div>
|
|
1994
|
+
<p className="font-mono text-sm text-muted-foreground">apps/web/page.tsx</p>
|
|
1995
|
+
<p className="text-sm text-muted-foreground">Delete me to get started!</p>
|
|
1996
|
+
</div>
|
|
1997
|
+
<ModeToggle />
|
|
1994
1998
|
</div>
|
|
1995
1999
|
|
|
1996
2000
|
<div className="flex items-center gap-3 py-2">
|
|
@@ -7872,6 +7876,33 @@ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
|
7872
7876
|
`
|
|
7873
7877
|
};
|
|
7874
7878
|
|
|
7879
|
+
// src/shadcn-ui/templates/mode-toggle.ts
|
|
7880
|
+
var mode_toggle_default = {
|
|
7881
|
+
filename: "packages/ui/src/components/mode-toggle.tsx",
|
|
7882
|
+
template: `'use client';
|
|
7883
|
+
|
|
7884
|
+
import { Moon, Sun } from 'lucide-react';
|
|
7885
|
+
import { useTheme } from 'next-themes';
|
|
7886
|
+
import { Button } from '@<%= projectName %>/ui/button';
|
|
7887
|
+
|
|
7888
|
+
export function ModeToggle() {
|
|
7889
|
+
const { resolvedTheme, setTheme } = useTheme();
|
|
7890
|
+
|
|
7891
|
+
return (
|
|
7892
|
+
<Button
|
|
7893
|
+
variant="ghost"
|
|
7894
|
+
size="icon"
|
|
7895
|
+
onClick={() => setTheme(resolvedTheme === 'dark' ? 'light' : 'dark')}
|
|
7896
|
+
>
|
|
7897
|
+
<Sun className="hidden dark:block" />
|
|
7898
|
+
<Moon className="block dark:hidden" />
|
|
7899
|
+
<span className="sr-only">Toggle theme</span>
|
|
7900
|
+
</Button>
|
|
7901
|
+
);
|
|
7902
|
+
}
|
|
7903
|
+
`
|
|
7904
|
+
};
|
|
7905
|
+
|
|
7875
7906
|
// src/shadcn-ui/index.ts
|
|
7876
7907
|
var shadcnUi = {
|
|
7877
7908
|
templates: [
|
|
@@ -7934,7 +7965,8 @@ var shadcnUi = {
|
|
|
7934
7965
|
textarea_default,
|
|
7935
7966
|
toggle_group_default,
|
|
7936
7967
|
toggle_default,
|
|
7937
|
-
tooltip_default
|
|
7968
|
+
tooltip_default,
|
|
7969
|
+
mode_toggle_default
|
|
7938
7970
|
],
|
|
7939
7971
|
packages: [
|
|
7940
7972
|
{ package: "next-themes", module: "apps/web", version: "^0.4.6" }
|
|
@@ -8426,6 +8458,492 @@ var testingVitest = {
|
|
|
8426
8458
|
};
|
|
8427
8459
|
var testing_vitest_default = testingVitest;
|
|
8428
8460
|
|
|
8461
|
+
// src/single-process-custom-server/templates/api-package-json.ts
|
|
8462
|
+
var api_package_json_default = {
|
|
8463
|
+
filename: "apps/api/package.json",
|
|
8464
|
+
template: `{
|
|
8465
|
+
"name": "@<%= projectName %>/api",
|
|
8466
|
+
"version": "0.0.1",
|
|
8467
|
+
"description": "",
|
|
8468
|
+
"author": "",
|
|
8469
|
+
"private": true,
|
|
8470
|
+
"license": "UNLICENSED",
|
|
8471
|
+
"exports": {
|
|
8472
|
+
".": "./src/index.ts"
|
|
8473
|
+
},
|
|
8474
|
+
"scripts": {
|
|
8475
|
+
"build": "nest build",
|
|
8476
|
+
"start": "nest start",
|
|
8477
|
+
"dev": "nest start --watch",
|
|
8478
|
+
"start:dev": "nest start --watch",
|
|
8479
|
+
"start:debug": "nest start --debug --watch",
|
|
8480
|
+
"start:prod": "node dist/main",
|
|
8481
|
+
"lint": "eslint \\"{src,apps,libs,test}/**/*.ts\\" --fix"
|
|
8482
|
+
},
|
|
8483
|
+
"dependencies": {
|
|
8484
|
+
"@nestjs/common": "^11.0.1",
|
|
8485
|
+
"@nestjs/core": "^11.0.1",
|
|
8486
|
+
"@nestjs/platform-express": "^11.0.1",
|
|
8487
|
+
"@<%= projectName %>/auth": "workspace:*",
|
|
8488
|
+
"@thallesp/nestjs-better-auth": "^2.5.1",
|
|
8489
|
+
"dotenv": "^17.3.1",
|
|
8490
|
+
"reflect-metadata": "^0.2.2",
|
|
8491
|
+
"rxjs": "^7.8.1"
|
|
8492
|
+
},
|
|
8493
|
+
"devDependencies": {
|
|
8494
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
8495
|
+
"@eslint/js": "^9.18.0",
|
|
8496
|
+
"@nestjs/cli": "^11.0.0",
|
|
8497
|
+
"@nestjs/schematics": "^11.0.0",
|
|
8498
|
+
"@nestjs/testing": "^11.0.1",
|
|
8499
|
+
"@types/express": "^5.0.0",
|
|
8500
|
+
"@types/node": "^22.10.7",
|
|
8501
|
+
"@types/supertest": "^6.0.2",
|
|
8502
|
+
"eslint": "^9.18.0",
|
|
8503
|
+
"eslint-config-prettier": "^10.0.1",
|
|
8504
|
+
"globals": "^16.0.0",
|
|
8505
|
+
"supertest": "^7.0.0",
|
|
8506
|
+
"ts-node": "^10.9.2",
|
|
8507
|
+
"tsconfig-paths": "^4.2.0",
|
|
8508
|
+
"typescript": "6.0.2",
|
|
8509
|
+
"typescript-eslint": "^8.20.0"
|
|
8510
|
+
}
|
|
8511
|
+
}`
|
|
8512
|
+
};
|
|
8513
|
+
|
|
8514
|
+
// src/single-process-custom-server/templates/api-src-index.ts
|
|
8515
|
+
var api_src_index_default = {
|
|
8516
|
+
filename: "apps/api/src/index.ts",
|
|
8517
|
+
template: `export { AppModule } from './app.module';`
|
|
8518
|
+
};
|
|
8519
|
+
|
|
8520
|
+
// src/single-process-custom-server/templates/web-server.ts
|
|
8521
|
+
var web_server_default = {
|
|
8522
|
+
filename: "apps/web/server.ts",
|
|
8523
|
+
template: `import 'reflect-metadata';
|
|
8524
|
+
import dotenv from 'dotenv';
|
|
8525
|
+
import { resolve } from 'path';
|
|
8526
|
+
|
|
8527
|
+
// Load root .env first, then local .env (local takes precedence)
|
|
8528
|
+
dotenv.config({ path: resolve(process.cwd(), '../../.env') });
|
|
8529
|
+
dotenv.config({ path: resolve(process.cwd(), '.env') });
|
|
8530
|
+
|
|
8531
|
+
import { NestFactory } from '@nestjs/core';
|
|
8532
|
+
import { AppModule } from '@<%= projectName %>/api';
|
|
8533
|
+
import next from 'next';
|
|
8534
|
+
import { createServer } from 'node:http';
|
|
8535
|
+
|
|
8536
|
+
const dev = process.env.NODE_ENV !== 'production';
|
|
8537
|
+
const port = parseInt(process.env.PORT ?? '3000', 10);
|
|
8538
|
+
|
|
8539
|
+
async function main() {
|
|
8540
|
+
const nextApp = next({ dev, port });
|
|
8541
|
+
const handle = nextApp.getRequestHandler();
|
|
8542
|
+
|
|
8543
|
+
await nextApp.prepare();
|
|
8544
|
+
|
|
8545
|
+
const nestApp = await NestFactory.create(AppModule);
|
|
8546
|
+
await nestApp.init();
|
|
8547
|
+
|
|
8548
|
+
const nestListener = nestApp
|
|
8549
|
+
.getHttpServer()
|
|
8550
|
+
.listeners('request')[0] as (req: any, res: any) => void;
|
|
8551
|
+
|
|
8552
|
+
const server = createServer((req, res) => {
|
|
8553
|
+
if (req.url?.startsWith('/api/')) {
|
|
8554
|
+
nestListener(req, res);
|
|
8555
|
+
} else {
|
|
8556
|
+
handle(req, res);
|
|
8557
|
+
}
|
|
8558
|
+
});
|
|
8559
|
+
|
|
8560
|
+
server.listen(port, () => {
|
|
8561
|
+
console.log(\`> Server ready on http://localhost:\${port}\`);
|
|
8562
|
+
});
|
|
8563
|
+
}
|
|
8564
|
+
|
|
8565
|
+
main().catch(console.error);`
|
|
8566
|
+
};
|
|
8567
|
+
|
|
8568
|
+
// src/single-process-custom-server/templates/web-package-json.ts
|
|
8569
|
+
var web_package_json_default = {
|
|
8570
|
+
filename: "apps/web/package.json",
|
|
8571
|
+
template: `{
|
|
8572
|
+
"name": "web",
|
|
8573
|
+
"version": "0.1.0",
|
|
8574
|
+
"type": "module",
|
|
8575
|
+
"private": true,
|
|
8576
|
+
"scripts": {
|
|
8577
|
+
"dev": "tsx watch --tsconfig tsconfig.server.json server.ts",
|
|
8578
|
+
"build": "next build",
|
|
8579
|
+
"start": "next start",
|
|
8580
|
+
"lint": "eslint --max-warnings 0 && next typegen && tsc --noEmit",
|
|
8581
|
+
"db:migrate": "better-auth migrate"
|
|
8582
|
+
},
|
|
8583
|
+
"dependencies": {
|
|
8584
|
+
"@<%= projectName %>/api": "workspace:*",
|
|
8585
|
+
"@<%= projectName %>/auth": "workspace:*",
|
|
8586
|
+
"@<%= projectName %>/ui": "workspace:*",
|
|
8587
|
+
"@tailwindcss/postcss": "^4.2.1",
|
|
8588
|
+
"dotenv": "^17.3.1",
|
|
8589
|
+
"@tanstack/react-form": "^1.28.5",
|
|
8590
|
+
"@tanstack/react-query": "^5.90.21",
|
|
8591
|
+
"better-auth": "^1.2.8",
|
|
8592
|
+
"next": "16.2.1",
|
|
8593
|
+
"react": "^19.2.4",
|
|
8594
|
+
"react-dom": "^19.2.4",
|
|
8595
|
+
"tailwindcss": "^4.2.1"
|
|
8596
|
+
},
|
|
8597
|
+
"devDependencies": {
|
|
8598
|
+
"@<%= projectName %>/eslint-config": "workspace:*",
|
|
8599
|
+
"@<%= projectName %>/typescript-config": "workspace:*",
|
|
8600
|
+
"@types/node": "^22.15.3",
|
|
8601
|
+
"@types/react": "19.2.14",
|
|
8602
|
+
"@types/react-dom": "19.2.3",
|
|
8603
|
+
"eslint": "^9.39.1",
|
|
8604
|
+
"tsx": "^4.19.4",
|
|
8605
|
+
"typescript": "6.0.2"
|
|
8606
|
+
}
|
|
8607
|
+
}`
|
|
8608
|
+
};
|
|
8609
|
+
|
|
8610
|
+
// src/single-process-custom-server/templates/web-next-config.ts
|
|
8611
|
+
var web_next_config_default = {
|
|
8612
|
+
filename: "apps/web/next.config.js",
|
|
8613
|
+
template: `import dotenv from 'dotenv';
|
|
8614
|
+
import { resolve } from 'path';
|
|
8615
|
+
|
|
8616
|
+
// Load root .env first, then local .env (local takes precedence)
|
|
8617
|
+
dotenv.config({ path: resolve(process.cwd(), '../../.env') });
|
|
8618
|
+
dotenv.config({ path: resolve(process.cwd(), '.env') });
|
|
8619
|
+
|
|
8620
|
+
/** @type {import('next').NextConfig} */
|
|
8621
|
+
const nextConfig = {
|
|
8622
|
+
output: "standalone",
|
|
8623
|
+
};
|
|
8624
|
+
|
|
8625
|
+
export default nextConfig;`
|
|
8626
|
+
};
|
|
8627
|
+
|
|
8628
|
+
// src/single-process-custom-server/templates/web-tsconfig-server.ts
|
|
8629
|
+
var web_tsconfig_server_default = {
|
|
8630
|
+
filename: "apps/web/tsconfig.server.json",
|
|
8631
|
+
template: `{
|
|
8632
|
+
"compilerOptions": {
|
|
8633
|
+
"module": "nodenext",
|
|
8634
|
+
"moduleResolution": "nodenext",
|
|
8635
|
+
"target": "ES2023",
|
|
8636
|
+
"esModuleInterop": true,
|
|
8637
|
+
"emitDecoratorMetadata": true,
|
|
8638
|
+
"experimentalDecorators": true,
|
|
8639
|
+
"allowSyntheticDefaultImports": true,
|
|
8640
|
+
"skipLibCheck": true,
|
|
8641
|
+
"strictNullChecks": true,
|
|
8642
|
+
"noImplicitAny": false
|
|
8643
|
+
},
|
|
8644
|
+
"include": ["server.ts"],
|
|
8645
|
+
"exclude": ["node_modules"]
|
|
8646
|
+
}`
|
|
8647
|
+
};
|
|
8648
|
+
|
|
8649
|
+
// src/single-process-custom-server/index.ts
|
|
8650
|
+
var singleProcessCustomServer = {
|
|
8651
|
+
templates: [
|
|
8652
|
+
api_package_json_default,
|
|
8653
|
+
api_src_index_default,
|
|
8654
|
+
web_server_default,
|
|
8655
|
+
web_package_json_default,
|
|
8656
|
+
web_next_config_default,
|
|
8657
|
+
web_tsconfig_server_default
|
|
8658
|
+
]
|
|
8659
|
+
};
|
|
8660
|
+
var single_process_custom_server_default = singleProcessCustomServer;
|
|
8661
|
+
|
|
8662
|
+
// src/single-process-static-export/templates/api-app-module.ts
|
|
8663
|
+
var api_app_module_default = {
|
|
8664
|
+
filename: "apps/api/src/app.module.ts",
|
|
8665
|
+
template: `import { join } from 'path';
|
|
8666
|
+
import { Module } from '@nestjs/common';
|
|
8667
|
+
import { APP_GUARD } from '@nestjs/core';
|
|
8668
|
+
import { ServeStaticModule } from '@nestjs/serve-static';
|
|
8669
|
+
import { AuthGuard, AuthModule } from '@thallesp/nestjs-better-auth';
|
|
8670
|
+
import { auth } from '@<%= projectName %>/auth';
|
|
8671
|
+
import { AppController } from './app.controller';
|
|
8672
|
+
import { TodosModule } from './todos/todos.module';
|
|
8673
|
+
|
|
8674
|
+
@Module({
|
|
8675
|
+
imports: [
|
|
8676
|
+
ServeStaticModule.forRoot({
|
|
8677
|
+
rootPath: join(process.cwd(), '../web/out'),
|
|
8678
|
+
exclude: ['/api/(.*)'],
|
|
8679
|
+
}),
|
|
8680
|
+
AuthModule.forRoot({ auth }),
|
|
8681
|
+
TodosModule,
|
|
8682
|
+
],
|
|
8683
|
+
controllers: [AppController],
|
|
8684
|
+
providers: [{ provide: APP_GUARD, useClass: AuthGuard }],
|
|
8685
|
+
})
|
|
8686
|
+
export class AppModule {}`
|
|
8687
|
+
};
|
|
8688
|
+
|
|
8689
|
+
// src/single-process-static-export/templates/api-package-json.ts
|
|
8690
|
+
var api_package_json_default2 = {
|
|
8691
|
+
filename: "apps/api/package.json",
|
|
8692
|
+
template: `{
|
|
8693
|
+
"name": "api",
|
|
8694
|
+
"version": "0.0.1",
|
|
8695
|
+
"description": "",
|
|
8696
|
+
"author": "",
|
|
8697
|
+
"private": true,
|
|
8698
|
+
"license": "UNLICENSED",
|
|
8699
|
+
"scripts": {
|
|
8700
|
+
"build": "nest build",
|
|
8701
|
+
"start": "nest start",
|
|
8702
|
+
"dev": "nest start --watch",
|
|
8703
|
+
"start:dev": "nest start --watch",
|
|
8704
|
+
"start:debug": "nest start --debug --watch",
|
|
8705
|
+
"start:prod": "node dist/main",
|
|
8706
|
+
"lint": "eslint \\"{src,apps,libs,test}/**/*.ts\\" --fix"
|
|
8707
|
+
},
|
|
8708
|
+
"dependencies": {
|
|
8709
|
+
"@nestjs/common": "^11.0.1",
|
|
8710
|
+
"@nestjs/core": "^11.0.1",
|
|
8711
|
+
"@nestjs/platform-express": "^11.0.1",
|
|
8712
|
+
"@nestjs/serve-static": "^5.0.0",
|
|
8713
|
+
"@<%= projectName %>/auth": "workspace:*",
|
|
8714
|
+
"@thallesp/nestjs-better-auth": "^2.5.1",
|
|
8715
|
+
"dotenv": "^17.3.1",
|
|
8716
|
+
"reflect-metadata": "^0.2.2",
|
|
8717
|
+
"rxjs": "^7.8.1"
|
|
8718
|
+
},
|
|
8719
|
+
"devDependencies": {
|
|
8720
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
8721
|
+
"@eslint/js": "^9.18.0",
|
|
8722
|
+
"@nestjs/cli": "^11.0.0",
|
|
8723
|
+
"@nestjs/schematics": "^11.0.0",
|
|
8724
|
+
"@nestjs/testing": "^11.0.1",
|
|
8725
|
+
"@types/express": "^5.0.0",
|
|
8726
|
+
"@types/node": "^22.10.7",
|
|
8727
|
+
"@types/supertest": "^6.0.2",
|
|
8728
|
+
"eslint": "^9.18.0",
|
|
8729
|
+
"eslint-config-prettier": "^10.0.1",
|
|
8730
|
+
"globals": "^16.0.0",
|
|
8731
|
+
"supertest": "^7.0.0",
|
|
8732
|
+
"ts-node": "^10.9.2",
|
|
8733
|
+
"tsconfig-paths": "^4.2.0",
|
|
8734
|
+
"typescript": "6.0.2",
|
|
8735
|
+
"typescript-eslint": "^8.20.0"
|
|
8736
|
+
}
|
|
8737
|
+
}`
|
|
8738
|
+
};
|
|
8739
|
+
|
|
8740
|
+
// src/single-process-static-export/templates/web-next-config.ts
|
|
8741
|
+
var web_next_config_default2 = {
|
|
8742
|
+
filename: "apps/web/next.config.js",
|
|
8743
|
+
template: `import dotenv from 'dotenv';
|
|
8744
|
+
import { resolve } from 'path';
|
|
8745
|
+
|
|
8746
|
+
// Load root .env first, then local .env (local takes precedence)
|
|
8747
|
+
dotenv.config({ path: resolve(process.cwd(), '../../.env') });
|
|
8748
|
+
dotenv.config({ path: resolve(process.cwd(), '.env') });
|
|
8749
|
+
|
|
8750
|
+
const isProduction = process.env.NODE_ENV === 'production';
|
|
8751
|
+
|
|
8752
|
+
/** @type {import('next').NextConfig} */
|
|
8753
|
+
const nextConfig = {
|
|
8754
|
+
// Static export in production \u2014 served by NestJS via ServeStaticModule.
|
|
8755
|
+
// rewrites() is incompatible with output: "export", so dev uses the proxy
|
|
8756
|
+
// and production uses the static files.
|
|
8757
|
+
...(isProduction
|
|
8758
|
+
? { output: 'export' }
|
|
8759
|
+
: {
|
|
8760
|
+
async rewrites() {
|
|
8761
|
+
return [
|
|
8762
|
+
{
|
|
8763
|
+
source: '/api/:path*',
|
|
8764
|
+
destination: 'http://localhost:3001/api/:path*',
|
|
8765
|
+
},
|
|
8766
|
+
];
|
|
8767
|
+
},
|
|
8768
|
+
}),
|
|
8769
|
+
};
|
|
8770
|
+
|
|
8771
|
+
export default nextConfig;`
|
|
8772
|
+
};
|
|
8773
|
+
|
|
8774
|
+
// src/single-process-static-export/index.ts
|
|
8775
|
+
var singleProcessStaticExport = {
|
|
8776
|
+
templates: [api_app_module_default, api_package_json_default2, web_next_config_default2]
|
|
8777
|
+
};
|
|
8778
|
+
var single_process_static_export_default = singleProcessStaticExport;
|
|
8779
|
+
|
|
8780
|
+
// src/single-process-pages/templates/api-package-json.ts
|
|
8781
|
+
var api_package_json_default3 = {
|
|
8782
|
+
filename: "apps/api/package.json",
|
|
8783
|
+
template: `{
|
|
8784
|
+
"name": "@<%= projectName %>/api",
|
|
8785
|
+
"version": "0.0.1",
|
|
8786
|
+
"description": "",
|
|
8787
|
+
"author": "",
|
|
8788
|
+
"private": true,
|
|
8789
|
+
"license": "UNLICENSED",
|
|
8790
|
+
"exports": {
|
|
8791
|
+
".": "./src/index.ts"
|
|
8792
|
+
},
|
|
8793
|
+
"scripts": {
|
|
8794
|
+
"build": "nest build",
|
|
8795
|
+
"start": "nest start",
|
|
8796
|
+
"dev": "nest start --watch",
|
|
8797
|
+
"start:dev": "nest start --watch",
|
|
8798
|
+
"start:debug": "nest start --debug --watch",
|
|
8799
|
+
"start:prod": "node dist/main",
|
|
8800
|
+
"lint": "eslint \\"{src,apps,libs,test}/**/*.ts\\" --fix"
|
|
8801
|
+
},
|
|
8802
|
+
"dependencies": {
|
|
8803
|
+
"@nestjs/common": "^11.0.1",
|
|
8804
|
+
"@nestjs/core": "^11.0.1",
|
|
8805
|
+
"@nestjs/platform-express": "^11.0.1",
|
|
8806
|
+
"@<%= projectName %>/auth": "workspace:*",
|
|
8807
|
+
"@thallesp/nestjs-better-auth": "^2.5.1",
|
|
8808
|
+
"dotenv": "^17.3.1",
|
|
8809
|
+
"reflect-metadata": "^0.2.2",
|
|
8810
|
+
"rxjs": "^7.8.1"
|
|
8811
|
+
},
|
|
8812
|
+
"devDependencies": {
|
|
8813
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
8814
|
+
"@eslint/js": "^9.18.0",
|
|
8815
|
+
"@nestjs/cli": "^11.0.0",
|
|
8816
|
+
"@nestjs/schematics": "^11.0.0",
|
|
8817
|
+
"@nestjs/testing": "^11.0.1",
|
|
8818
|
+
"@types/express": "^5.0.0",
|
|
8819
|
+
"@types/node": "^22.10.7",
|
|
8820
|
+
"@types/supertest": "^6.0.2",
|
|
8821
|
+
"eslint": "^9.18.0",
|
|
8822
|
+
"eslint-config-prettier": "^10.0.1",
|
|
8823
|
+
"globals": "^16.0.0",
|
|
8824
|
+
"supertest": "^7.0.0",
|
|
8825
|
+
"ts-node": "^10.9.2",
|
|
8826
|
+
"tsconfig-paths": "^4.2.0",
|
|
8827
|
+
"typescript": "6.0.2",
|
|
8828
|
+
"typescript-eslint": "^8.20.0"
|
|
8829
|
+
}
|
|
8830
|
+
}`
|
|
8831
|
+
};
|
|
8832
|
+
|
|
8833
|
+
// src/single-process-pages/templates/api-src-index.ts
|
|
8834
|
+
var api_src_index_default2 = {
|
|
8835
|
+
filename: "apps/api/src/index.ts",
|
|
8836
|
+
template: `export { AppModule } from './app.module';`
|
|
8837
|
+
};
|
|
8838
|
+
|
|
8839
|
+
// src/single-process-pages/templates/web-api-catchall.ts
|
|
8840
|
+
var web_api_catchall_default = {
|
|
8841
|
+
filename: "apps/web/pages/api/[...path].ts",
|
|
8842
|
+
template: `import 'reflect-metadata';
|
|
8843
|
+
import type { NextApiRequest, NextApiResponse } from 'next';
|
|
8844
|
+
import type { INestApplication } from '@nestjs/common';
|
|
8845
|
+
|
|
8846
|
+
export const config = {
|
|
8847
|
+
api: {
|
|
8848
|
+
bodyParser: false,
|
|
8849
|
+
externalResolver: true,
|
|
8850
|
+
},
|
|
8851
|
+
};
|
|
8852
|
+
|
|
8853
|
+
let app: INestApplication | null = null;
|
|
8854
|
+
|
|
8855
|
+
async function getApp(): Promise<INestApplication> {
|
|
8856
|
+
if (!app) {
|
|
8857
|
+
const { NestFactory } = await import('@nestjs/core');
|
|
8858
|
+
const { AppModule } = await import('@<%= projectName %>/api');
|
|
8859
|
+
app = await NestFactory.create(AppModule, { bodyParser: false });
|
|
8860
|
+
app.setGlobalPrefix('api');
|
|
8861
|
+
await app.init();
|
|
8862
|
+
}
|
|
8863
|
+
return app;
|
|
8864
|
+
}
|
|
8865
|
+
|
|
8866
|
+
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
8867
|
+
const nestApp = await getApp();
|
|
8868
|
+
const express = nestApp.getHttpAdapter().getInstance() as (
|
|
8869
|
+
req: NextApiRequest,
|
|
8870
|
+
res: NextApiResponse
|
|
8871
|
+
) => void;
|
|
8872
|
+
express(req, res);
|
|
8873
|
+
}`
|
|
8874
|
+
};
|
|
8875
|
+
|
|
8876
|
+
// src/single-process-pages/templates/web-package-json.ts
|
|
8877
|
+
var web_package_json_default2 = {
|
|
8878
|
+
filename: "apps/web/package.json",
|
|
8879
|
+
template: `{
|
|
8880
|
+
"name": "web",
|
|
8881
|
+
"version": "0.1.0",
|
|
8882
|
+
"type": "module",
|
|
8883
|
+
"private": true,
|
|
8884
|
+
"scripts": {
|
|
8885
|
+
"dev": "next dev --port 3000",
|
|
8886
|
+
"build": "next build",
|
|
8887
|
+
"start": "next start",
|
|
8888
|
+
"lint": "eslint --max-warnings 0 && next typegen && tsc --noEmit",
|
|
8889
|
+
"db:migrate": "better-auth migrate"
|
|
8890
|
+
},
|
|
8891
|
+
"dependencies": {
|
|
8892
|
+
"@<%= projectName %>/api": "workspace:*",
|
|
8893
|
+
"@<%= projectName %>/auth": "workspace:*",
|
|
8894
|
+
"@<%= projectName %>/ui": "workspace:*",
|
|
8895
|
+
"@tailwindcss/postcss": "^4.2.1",
|
|
8896
|
+
"dotenv": "^17.3.1",
|
|
8897
|
+
"@tanstack/react-form": "^1.28.5",
|
|
8898
|
+
"@tanstack/react-query": "^5.90.21",
|
|
8899
|
+
"better-auth": "^1.2.8",
|
|
8900
|
+
"next": "16.2.1",
|
|
8901
|
+
"react": "^19.2.4",
|
|
8902
|
+
"react-dom": "^19.2.4",
|
|
8903
|
+
"tailwindcss": "^4.2.1"
|
|
8904
|
+
},
|
|
8905
|
+
"devDependencies": {
|
|
8906
|
+
"@<%= projectName %>/eslint-config": "workspace:*",
|
|
8907
|
+
"@<%= projectName %>/typescript-config": "workspace:*",
|
|
8908
|
+
"@types/node": "^22.15.3",
|
|
8909
|
+
"@types/react": "19.2.14",
|
|
8910
|
+
"@types/react-dom": "19.2.3",
|
|
8911
|
+
"eslint": "^9.39.1",
|
|
8912
|
+
"typescript": "6.0.2"
|
|
8913
|
+
}
|
|
8914
|
+
}`
|
|
8915
|
+
};
|
|
8916
|
+
|
|
8917
|
+
// src/single-process-pages/templates/web-next-config.ts
|
|
8918
|
+
var web_next_config_default3 = {
|
|
8919
|
+
filename: "apps/web/next.config.js",
|
|
8920
|
+
template: `import dotenv from 'dotenv';
|
|
8921
|
+
import { resolve } from 'path';
|
|
8922
|
+
|
|
8923
|
+
// Load root .env first, then local .env (local takes precedence)
|
|
8924
|
+
dotenv.config({ path: resolve(process.cwd(), '../../.env') });
|
|
8925
|
+
dotenv.config({ path: resolve(process.cwd(), '.env') });
|
|
8926
|
+
|
|
8927
|
+
/** @type {import('next').NextConfig} */
|
|
8928
|
+
const nextConfig = {
|
|
8929
|
+
output: "standalone",
|
|
8930
|
+
};
|
|
8931
|
+
|
|
8932
|
+
export default nextConfig;`
|
|
8933
|
+
};
|
|
8934
|
+
|
|
8935
|
+
// src/single-process-pages/index.ts
|
|
8936
|
+
var singleProcessPages = {
|
|
8937
|
+
templates: [
|
|
8938
|
+
api_package_json_default3,
|
|
8939
|
+
api_src_index_default2,
|
|
8940
|
+
web_api_catchall_default,
|
|
8941
|
+
web_package_json_default2,
|
|
8942
|
+
web_next_config_default3
|
|
8943
|
+
]
|
|
8944
|
+
};
|
|
8945
|
+
var single_process_pages_default = singleProcessPages;
|
|
8946
|
+
|
|
8429
8947
|
// src/index.ts
|
|
8430
8948
|
var staticDir = new URL("./static/", import.meta.url);
|
|
8431
8949
|
var staticDirPath = fileURLToPath(staticDir);
|
|
@@ -8442,7 +8960,10 @@ var templates = {
|
|
|
8442
8960
|
eslintConfig: eslint_config_default5,
|
|
8443
8961
|
typescriptConfig: typescript_config_default,
|
|
8444
8962
|
testingJest: testing_jest_default,
|
|
8445
|
-
testingVitest: testing_vitest_default
|
|
8963
|
+
testingVitest: testing_vitest_default,
|
|
8964
|
+
deploymentCustomServer: single_process_custom_server_default,
|
|
8965
|
+
deploymentSpa: single_process_static_export_default,
|
|
8966
|
+
deploymentVercel: single_process_pages_default
|
|
8446
8967
|
};
|
|
8447
8968
|
export {
|
|
8448
8969
|
getStaticFilePath,
|