@newt-app/templates 0.7.0 → 0.8.1
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 +143 -102
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -183,6 +183,22 @@ BETTER_AUTH_URL=http://localhost:3000
|
|
|
183
183
|
BETTER_AUTH_SECRET=your-secret-here`
|
|
184
184
|
};
|
|
185
185
|
|
|
186
|
+
// src/root/templates/agents-md.ts
|
|
187
|
+
var agents_md_default = {
|
|
188
|
+
filename: "AGENTS.md",
|
|
189
|
+
template: `<!-- BEGIN:nextjs-agent-rules -->
|
|
190
|
+
# This is NOT the Next.js you know
|
|
191
|
+
|
|
192
|
+
This version has breaking changes \u2014 APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in \`node_modules/next/dist/docs/\` before writing any code. Heed deprecation notices.
|
|
193
|
+
<!-- END:nextjs-agent-rules -->`
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
// src/root/templates/claude-md.ts
|
|
197
|
+
var claude_md_default = {
|
|
198
|
+
filename: "CLAUDE.md",
|
|
199
|
+
template: `@AGENTS.md`
|
|
200
|
+
};
|
|
201
|
+
|
|
186
202
|
// src/root/index.ts
|
|
187
203
|
var root = {
|
|
188
204
|
templates: [
|
|
@@ -194,7 +210,9 @@ var root = {
|
|
|
194
210
|
turbo_json_default,
|
|
195
211
|
pnpm_workspace_default,
|
|
196
212
|
readme_default,
|
|
197
|
-
env_example_default
|
|
213
|
+
env_example_default,
|
|
214
|
+
agents_md_default,
|
|
215
|
+
claude_md_default
|
|
198
216
|
]
|
|
199
217
|
};
|
|
200
218
|
var root_default = root;
|
|
@@ -211,7 +229,8 @@ var package_json_default2 = {
|
|
|
211
229
|
"dev": "next dev --port 3000",
|
|
212
230
|
"build": "next build",
|
|
213
231
|
"start": "next start",
|
|
214
|
-
"lint": "eslint --
|
|
232
|
+
"lint": "eslint --fix && next typegen && tsc --noEmit",
|
|
233
|
+
"lint:check": "eslint --max-warnings 0 && next typegen && tsc --noEmit",
|
|
215
234
|
"db:migrate": "better-auth migrate"
|
|
216
235
|
},
|
|
217
236
|
"dependencies": {
|
|
@@ -342,7 +361,6 @@ dotenv.config({ path: resolve(process.cwd(), '.env') });
|
|
|
342
361
|
|
|
343
362
|
/** @type {import('next').NextConfig} */
|
|
344
363
|
const nextConfig = {
|
|
345
|
-
output: "standalone",
|
|
346
364
|
async rewrites() {
|
|
347
365
|
return [
|
|
348
366
|
{
|
|
@@ -898,7 +916,8 @@ var package_json_default3 = {
|
|
|
898
916
|
"start:dev": "nest start --watch",
|
|
899
917
|
"start:debug": "nest start --debug --watch",
|
|
900
918
|
"start:prod": "node dist/main",
|
|
901
|
-
"lint": "eslint \\"{src,apps,libs,test}/**/*.ts\\" --fix"
|
|
919
|
+
"lint": "eslint \\"{src,apps,libs,test}/**/*.ts\\" --fix",
|
|
920
|
+
"lint:check": "eslint \\"{src,apps,libs,test}/**/*.ts\\""
|
|
902
921
|
},
|
|
903
922
|
"dependencies": {
|
|
904
923
|
"@nestjs/common": "^11.0.1",
|
|
@@ -1185,6 +1204,29 @@ export class TodosService {
|
|
|
1185
1204
|
}`
|
|
1186
1205
|
};
|
|
1187
1206
|
|
|
1207
|
+
// src/api/templates/todos-service-spec.ts
|
|
1208
|
+
var todos_service_spec_default = {
|
|
1209
|
+
filename: "apps/api/src/todos/todos.service.spec.ts",
|
|
1210
|
+
template: `import { Test, TestingModule } from '@nestjs/testing';
|
|
1211
|
+
import { TodosService } from './todos.service';
|
|
1212
|
+
|
|
1213
|
+
describe('TodosService', () => {
|
|
1214
|
+
let service: TodosService;
|
|
1215
|
+
|
|
1216
|
+
beforeEach(async () => {
|
|
1217
|
+
const module: TestingModule = await Test.createTestingModule({
|
|
1218
|
+
providers: [TodosService],
|
|
1219
|
+
}).compile();
|
|
1220
|
+
|
|
1221
|
+
service = module.get<TodosService>(TodosService);
|
|
1222
|
+
});
|
|
1223
|
+
|
|
1224
|
+
it('should be defined', () => {
|
|
1225
|
+
expect(service).toBeDefined();
|
|
1226
|
+
});
|
|
1227
|
+
});`
|
|
1228
|
+
};
|
|
1229
|
+
|
|
1188
1230
|
// src/api/templates/readme.ts
|
|
1189
1231
|
var readme_default3 = {
|
|
1190
1232
|
filename: "apps/api/README.md",
|
|
@@ -1216,6 +1258,7 @@ var api = {
|
|
|
1216
1258
|
todos_controller_default,
|
|
1217
1259
|
todos_module_default,
|
|
1218
1260
|
todos_service_default,
|
|
1261
|
+
todos_service_spec_default,
|
|
1219
1262
|
readme_default3
|
|
1220
1263
|
]
|
|
1221
1264
|
};
|
|
@@ -1312,7 +1355,8 @@ var package_json_default5 = {
|
|
|
1312
1355
|
"./*": "./src/*.tsx"
|
|
1313
1356
|
},
|
|
1314
1357
|
"scripts": {
|
|
1315
|
-
"lint": "eslint . --
|
|
1358
|
+
"lint": "eslint . --fix",
|
|
1359
|
+
"lint:check": "eslint . --max-warnings 0",
|
|
1316
1360
|
"check-types": "tsc --noEmit"
|
|
1317
1361
|
},
|
|
1318
1362
|
"devDependencies": {
|
|
@@ -1585,7 +1629,8 @@ var package_json_default6 = {
|
|
|
1585
1629
|
"./*": "./src/components/*.tsx"
|
|
1586
1630
|
},
|
|
1587
1631
|
"scripts": {
|
|
1588
|
-
"lint": "eslint . --
|
|
1632
|
+
"lint": "eslint . --fix",
|
|
1633
|
+
"lint:check": "eslint . --max-warnings 0"
|
|
1589
1634
|
},
|
|
1590
1635
|
"dependencies": {
|
|
1591
1636
|
"@hookform/resolvers": "^5.2.1",
|
|
@@ -8088,6 +8133,7 @@ export const nextJsConfig = [
|
|
|
8088
8133
|
...pluginReact.configs.flat.recommended.languageOptions,
|
|
8089
8134
|
globals: {
|
|
8090
8135
|
...globals.serviceworker,
|
|
8136
|
+
...globals.node,
|
|
8091
8137
|
},
|
|
8092
8138
|
},
|
|
8093
8139
|
},
|
|
@@ -8666,7 +8712,8 @@ var api_package_json_default = {
|
|
|
8666
8712
|
"start:dev": "nest start --watch",
|
|
8667
8713
|
"start:debug": "nest start --debug --watch",
|
|
8668
8714
|
"start:prod": "node dist/main",
|
|
8669
|
-
"lint": "eslint \\"{src,apps,libs,test}/**/*.ts\\" --fix"
|
|
8715
|
+
"lint": "eslint \\"{src,apps,libs,test}/**/*.ts\\" --fix",
|
|
8716
|
+
"lint:check": "eslint \\"{src,apps,libs,test}/**/*.ts\\""
|
|
8670
8717
|
},
|
|
8671
8718
|
"dependencies": {
|
|
8672
8719
|
"@nestjs/common": "^11.0.1",
|
|
@@ -8765,7 +8812,8 @@ var web_package_json_default = {
|
|
|
8765
8812
|
"dev": "tsx watch --tsconfig tsconfig.server.json server.ts",
|
|
8766
8813
|
"build": "next build",
|
|
8767
8814
|
"start": "next start",
|
|
8768
|
-
"lint": "eslint --
|
|
8815
|
+
"lint": "eslint --fix && next typegen && tsc --noEmit",
|
|
8816
|
+
"lint:check": "eslint --max-warnings 0 && next typegen && tsc --noEmit",
|
|
8769
8817
|
"db:migrate": "better-auth migrate"
|
|
8770
8818
|
},
|
|
8771
8819
|
"dependencies": {
|
|
@@ -8891,7 +8939,8 @@ var api_package_json_default2 = {
|
|
|
8891
8939
|
"start:dev": "nest start --watch",
|
|
8892
8940
|
"start:debug": "nest start --debug --watch",
|
|
8893
8941
|
"start:prod": "node dist/main",
|
|
8894
|
-
"lint": "eslint \\"{src,apps,libs,test}/**/*.ts\\" --fix"
|
|
8942
|
+
"lint": "eslint \\"{src,apps,libs,test}/**/*.ts\\" --fix",
|
|
8943
|
+
"lint:check": "eslint \\"{src,apps,libs,test}/**/*.ts\\""
|
|
8895
8944
|
},
|
|
8896
8945
|
"dependencies": {
|
|
8897
8946
|
"@nestjs/common": "^11.0.1",
|
|
@@ -8985,7 +9034,8 @@ var api_package_json_default3 = {
|
|
|
8985
9034
|
"start:dev": "nest start --watch",
|
|
8986
9035
|
"start:debug": "nest start --debug --watch",
|
|
8987
9036
|
"start:prod": "node dist/main",
|
|
8988
|
-
"lint": "eslint \\"{src,apps,libs,test}/**/*.ts\\" --fix"
|
|
9037
|
+
"lint": "eslint \\"{src,apps,libs,test}/**/*.ts\\" --fix",
|
|
9038
|
+
"lint:check": "eslint \\"{src,apps,libs,test}/**/*.ts\\""
|
|
8989
9039
|
},
|
|
8990
9040
|
"dependencies": {
|
|
8991
9041
|
"@nestjs/common": "^11.0.1",
|
|
@@ -9073,7 +9123,8 @@ var web_package_json_default2 = {
|
|
|
9073
9123
|
"dev": "next dev --port 3000",
|
|
9074
9124
|
"build": "next build",
|
|
9075
9125
|
"start": "next start",
|
|
9076
|
-
"lint": "eslint --
|
|
9126
|
+
"lint": "eslint --fix && next typegen && tsc --noEmit",
|
|
9127
|
+
"lint:check": "eslint --max-warnings 0 && next typegen && tsc --noEmit",
|
|
9077
9128
|
"db:migrate": "better-auth migrate"
|
|
9078
9129
|
},
|
|
9079
9130
|
"dependencies": {
|
|
@@ -9134,131 +9185,89 @@ var single_process_pages_default = singleProcessPages;
|
|
|
9134
9185
|
|
|
9135
9186
|
// src/nest-di-only/templates/api-package-json.ts
|
|
9136
9187
|
var api_package_json_default4 = {
|
|
9137
|
-
filename: "
|
|
9188
|
+
filename: "apps/api/package.json",
|
|
9138
9189
|
template: `{
|
|
9139
9190
|
"name": "@<%= projectName %>/api",
|
|
9140
9191
|
"version": "0.0.1",
|
|
9192
|
+
"description": "",
|
|
9193
|
+
"author": "",
|
|
9141
9194
|
"private": true,
|
|
9195
|
+
"license": "UNLICENSED",
|
|
9142
9196
|
"exports": {
|
|
9143
|
-
".":
|
|
9144
|
-
"default": "./dist/index.js",
|
|
9145
|
-
"types": "./dist/index.d.ts"
|
|
9146
|
-
}
|
|
9197
|
+
".": "./src/index.ts"
|
|
9147
9198
|
},
|
|
9148
9199
|
"scripts": {
|
|
9149
|
-
"build": "
|
|
9150
|
-
"
|
|
9200
|
+
"build": "nest build",
|
|
9201
|
+
"lint": "eslint \\"src/**/*.ts\\" --fix",
|
|
9202
|
+
"lint:check": "eslint \\"src/**/*.ts\\""
|
|
9151
9203
|
},
|
|
9152
9204
|
"dependencies": {
|
|
9153
|
-
"@<%= projectName %>/auth": "workspace:*",
|
|
9154
9205
|
"@nestjs/common": "^11.0.1",
|
|
9155
9206
|
"@nestjs/core": "^11.0.1",
|
|
9207
|
+
"@<%= projectName %>/auth": "workspace:*",
|
|
9208
|
+
"@thallesp/nestjs-better-auth": "^2.5.1",
|
|
9209
|
+
"dotenv": "^17.3.1",
|
|
9156
9210
|
"reflect-metadata": "^0.2.2",
|
|
9157
9211
|
"rxjs": "^7.8.1"
|
|
9158
9212
|
},
|
|
9159
9213
|
"devDependencies": {
|
|
9160
|
-
"
|
|
9161
|
-
"@
|
|
9162
|
-
"
|
|
9214
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
9215
|
+
"@eslint/js": "^9.18.0",
|
|
9216
|
+
"@nestjs/cli": "^11.0.0",
|
|
9217
|
+
"@nestjs/schematics": "^11.0.0",
|
|
9218
|
+
"@nestjs/testing": "^11.0.1",
|
|
9219
|
+
"@types/node": "^22.10.7",
|
|
9220
|
+
"eslint": "^9.18.0",
|
|
9221
|
+
"eslint-config-prettier": "^10.0.1",
|
|
9222
|
+
"globals": "^16.0.0",
|
|
9223
|
+
"ts-node": "^10.9.2",
|
|
9224
|
+
"tsconfig-paths": "^4.2.0",
|
|
9225
|
+
"typescript": "6.0.2",
|
|
9226
|
+
"typescript-eslint": "^8.20.0"
|
|
9163
9227
|
}
|
|
9164
9228
|
}`
|
|
9165
9229
|
};
|
|
9166
9230
|
|
|
9167
9231
|
// src/nest-di-only/templates/api-tsconfig.ts
|
|
9168
9232
|
var api_tsconfig_default = {
|
|
9169
|
-
filename: "
|
|
9233
|
+
filename: "apps/api/tsconfig.json",
|
|
9170
9234
|
template: `{
|
|
9171
9235
|
"compilerOptions": {
|
|
9236
|
+
"module": "nodenext",
|
|
9237
|
+
"moduleResolution": "nodenext",
|
|
9238
|
+
"resolvePackageJsonExports": true,
|
|
9239
|
+
"esModuleInterop": true,
|
|
9240
|
+
"isolatedModules": true,
|
|
9172
9241
|
"declaration": true,
|
|
9173
|
-
"
|
|
9242
|
+
"removeComments": true,
|
|
9174
9243
|
"emitDecoratorMetadata": true,
|
|
9175
9244
|
"experimentalDecorators": true,
|
|
9176
|
-
"
|
|
9177
|
-
"
|
|
9178
|
-
"
|
|
9245
|
+
"allowSyntheticDefaultImports": true,
|
|
9246
|
+
"target": "ES2023",
|
|
9247
|
+
"sourceMap": true,
|
|
9248
|
+
"outDir": "./dist",
|
|
9249
|
+
"rootDir": "./src",
|
|
9179
9250
|
"skipLibCheck": true,
|
|
9180
|
-
"
|
|
9181
|
-
"
|
|
9251
|
+
"strictNullChecks": true,
|
|
9252
|
+
"forceConsistentCasingInFileNames": true,
|
|
9253
|
+
"noImplicitAny": false,
|
|
9254
|
+
"strictBindCallApply": false,
|
|
9255
|
+
"noFallthroughCasesInSwitch": false,
|
|
9256
|
+
"types": [<% if (testing === 'jest') { %>"jest", <% } %>"node"]
|
|
9182
9257
|
},
|
|
9183
|
-
"include": ["src"],
|
|
9258
|
+
"include": ["src/**/*"],
|
|
9184
9259
|
"exclude": ["node_modules", "dist"]
|
|
9185
9260
|
}`
|
|
9186
9261
|
};
|
|
9187
9262
|
|
|
9188
9263
|
// src/nest-di-only/templates/api-index.ts
|
|
9189
9264
|
var api_index_default = {
|
|
9190
|
-
filename: "
|
|
9265
|
+
filename: "apps/api/src/index.ts",
|
|
9191
9266
|
template: `export { AppModule } from './app.module';
|
|
9192
9267
|
export { TodosService } from './todos/todos.service';
|
|
9193
9268
|
export type { Todo } from './todos/todos.service';`
|
|
9194
9269
|
};
|
|
9195
9270
|
|
|
9196
|
-
// src/nest-di-only/templates/api-app-module.ts
|
|
9197
|
-
var api_app_module_default2 = {
|
|
9198
|
-
filename: "packages/api/src/app.module.ts",
|
|
9199
|
-
template: `import { Module } from '@nestjs/common';
|
|
9200
|
-
import { TodosModule } from './todos/todos.module';
|
|
9201
|
-
|
|
9202
|
-
@Module({
|
|
9203
|
-
imports: [TodosModule],
|
|
9204
|
-
})
|
|
9205
|
-
export class AppModule {}`
|
|
9206
|
-
};
|
|
9207
|
-
|
|
9208
|
-
// src/nest-di-only/templates/api-todos-service.ts
|
|
9209
|
-
var api_todos_service_default = {
|
|
9210
|
-
filename: "packages/api/src/todos/todos.service.ts",
|
|
9211
|
-
template: `import { Injectable, NotFoundException } from '@nestjs/common';
|
|
9212
|
-
|
|
9213
|
-
export interface Todo {
|
|
9214
|
-
id: number;
|
|
9215
|
-
title: string;
|
|
9216
|
-
done: boolean;
|
|
9217
|
-
}
|
|
9218
|
-
|
|
9219
|
-
@Injectable()
|
|
9220
|
-
export class TodosService {
|
|
9221
|
-
private todos: Todo[] = [];
|
|
9222
|
-
private nextId = 1;
|
|
9223
|
-
|
|
9224
|
-
findAll(): Todo[] {
|
|
9225
|
-
return this.todos;
|
|
9226
|
-
}
|
|
9227
|
-
|
|
9228
|
-
create(title: string): Todo {
|
|
9229
|
-
const todo: Todo = { id: this.nextId++, title, done: false };
|
|
9230
|
-
this.todos.push(todo);
|
|
9231
|
-
return todo;
|
|
9232
|
-
}
|
|
9233
|
-
|
|
9234
|
-
toggle(id: number): Todo {
|
|
9235
|
-
const todo = this.todos.find((t) => t.id === id);
|
|
9236
|
-
if (!todo) throw new NotFoundException(\`Todo \${id} not found\`);
|
|
9237
|
-
todo.done = !todo.done;
|
|
9238
|
-
return todo;
|
|
9239
|
-
}
|
|
9240
|
-
|
|
9241
|
-
remove(id: number): void {
|
|
9242
|
-
const index = this.todos.findIndex((t) => t.id === id);
|
|
9243
|
-
if (index === -1) throw new NotFoundException(\`Todo \${id} not found\`);
|
|
9244
|
-
this.todos.splice(index, 1);
|
|
9245
|
-
}
|
|
9246
|
-
}`
|
|
9247
|
-
};
|
|
9248
|
-
|
|
9249
|
-
// src/nest-di-only/templates/api-todos-module.ts
|
|
9250
|
-
var api_todos_module_default = {
|
|
9251
|
-
filename: "packages/api/src/todos/todos.module.ts",
|
|
9252
|
-
template: `import { Module } from '@nestjs/common';
|
|
9253
|
-
import { TodosService } from './todos.service';
|
|
9254
|
-
|
|
9255
|
-
@Module({
|
|
9256
|
-
providers: [TodosService],
|
|
9257
|
-
exports: [TodosService],
|
|
9258
|
-
})
|
|
9259
|
-
export class TodosModule {}`
|
|
9260
|
-
};
|
|
9261
|
-
|
|
9262
9271
|
// src/nest-di-only/templates/web-nest-context.ts
|
|
9263
9272
|
var web_nest_context_default = {
|
|
9264
9273
|
filename: "apps/web/lib/nest.ts",
|
|
@@ -9343,7 +9352,8 @@ var web_package_json_default3 = {
|
|
|
9343
9352
|
"dev": "next dev --port 3000",
|
|
9344
9353
|
"build": "next build",
|
|
9345
9354
|
"start": "next start",
|
|
9346
|
-
"lint": "eslint --
|
|
9355
|
+
"lint": "eslint --fix && next typegen && tsc --noEmit",
|
|
9356
|
+
"lint:check": "eslint --max-warnings 0 && next typegen && tsc --noEmit",
|
|
9347
9357
|
"db:migrate": "better-auth migrate"
|
|
9348
9358
|
},
|
|
9349
9359
|
"dependencies": {
|
|
@@ -9390,28 +9400,59 @@ const nextConfig = {
|
|
|
9390
9400
|
'@<%= projectName %>/api',
|
|
9391
9401
|
'@nestjs/core',
|
|
9392
9402
|
'@nestjs/common',
|
|
9403
|
+
'@nestjs/microservices',
|
|
9404
|
+
'@nestjs/websockets',
|
|
9405
|
+
'@thallesp/nestjs-better-auth',
|
|
9393
9406
|
'reflect-metadata',
|
|
9407
|
+
'express',
|
|
9394
9408
|
],
|
|
9395
9409
|
};
|
|
9396
9410
|
|
|
9397
9411
|
export default nextConfig;`
|
|
9398
9412
|
};
|
|
9399
9413
|
|
|
9414
|
+
// src/nest-di-only/templates/web-tsconfig.ts
|
|
9415
|
+
var web_tsconfig_default = {
|
|
9416
|
+
filename: "apps/web/tsconfig.json",
|
|
9417
|
+
template: `{
|
|
9418
|
+
"extends": "@<%= projectName %>/typescript-config/nextjs.json",
|
|
9419
|
+
"compilerOptions": {
|
|
9420
|
+
"plugins": [
|
|
9421
|
+
{
|
|
9422
|
+
"name": "next"
|
|
9423
|
+
}
|
|
9424
|
+
],
|
|
9425
|
+
"strictNullChecks": true,
|
|
9426
|
+
"experimentalDecorators": true,
|
|
9427
|
+
"emitDecoratorMetadata": true,
|
|
9428
|
+
"paths": {
|
|
9429
|
+
"@/*": ["./*"]
|
|
9430
|
+
}
|
|
9431
|
+
},
|
|
9432
|
+
"include": [
|
|
9433
|
+
"**/*.ts",
|
|
9434
|
+
"**/*.tsx",
|
|
9435
|
+
"next-env.d.ts",
|
|
9436
|
+
"next.config.js",
|
|
9437
|
+
".next/types/**/*.ts"
|
|
9438
|
+
],
|
|
9439
|
+
"exclude": ["node_modules"]
|
|
9440
|
+
}`
|
|
9441
|
+
};
|
|
9442
|
+
|
|
9400
9443
|
// src/nest-di-only/index.ts
|
|
9401
9444
|
var nestDiOnly = {
|
|
9402
9445
|
templates: [
|
|
9403
9446
|
api_package_json_default4,
|
|
9404
9447
|
api_tsconfig_default,
|
|
9405
9448
|
api_index_default,
|
|
9406
|
-
api_app_module_default2,
|
|
9407
|
-
api_todos_service_default,
|
|
9408
|
-
api_todos_module_default,
|
|
9409
9449
|
web_nest_context_default,
|
|
9410
9450
|
web_todos_route_default,
|
|
9411
9451
|
web_todos_id_route_default,
|
|
9412
9452
|
web_todos_toggle_route_default,
|
|
9413
9453
|
web_package_json_default3,
|
|
9414
|
-
web_next_config_default4
|
|
9454
|
+
web_next_config_default4,
|
|
9455
|
+
web_tsconfig_default
|
|
9415
9456
|
]
|
|
9416
9457
|
};
|
|
9417
9458
|
var nest_di_only_default = nestDiOnly;
|