@appxdigital/appx-core-cli 1.0.2 → 1.0.4
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/package.json +1 -1
- package/templates/adminjs/admin.template.js +1 -1
- package/templates/adminjs/adminjs-app.module.template.js +1 -1
- package/templates/app.module.template.js +1 -1
- package/templates/bootstrap.template.js +6 -2
- package/templates/permissions.config.template.js +1 -1
- package/templates/prisma.module.template.js +1 -1
- package/utils/dependency-versions.json +4 -2
- package/wizard.js +2 -2
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { addBasicFilters, createActions, createPermissionHandler, dynamicImport,
|
|
|
3
3
|
import { initializeComponents } from './component-loader';
|
|
4
4
|
import { readFileSync } from 'fs';
|
|
5
5
|
import { getDMMF } from '@prisma/sdk';
|
|
6
|
-
import {
|
|
6
|
+
import {PrismaService} from '@appxdigital/appx-core';
|
|
7
7
|
import { PrismaModule } from "../prisma/prisma.module";
|
|
8
8
|
|
|
9
9
|
const DEFAULT_ADMIN = {
|
|
@@ -8,7 +8,7 @@ import { ConfigModule } from '@nestjs/config';
|
|
|
8
8
|
import { APP_INTERCEPTOR } from '@nestjs/core';
|
|
9
9
|
import { AppController } from './app.controller';
|
|
10
10
|
import { AppService } from './app.service';
|
|
11
|
-
import {
|
|
11
|
+
import {AppxCoreModule, AuthModule, PrismaInterceptor} from '@appxdigital/appx-core';
|
|
12
12
|
import {
|
|
13
13
|
RequestContextModule,
|
|
14
14
|
RequestContextMiddleware,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import { AppController } from './app.controller';
|
|
5
5
|
import { AppService } from './app.service';
|
|
6
6
|
import { ConfigModule } from '@nestjs/config';
|
|
7
|
-
import {
|
|
7
|
+
import {AuthModule, PrismaInterceptor, AppxCoreModule} from '@appxdigital/appx-core';
|
|
8
8
|
import { APP_INTERCEPTOR } from '@nestjs/core';
|
|
9
9
|
import {
|
|
10
10
|
RequestContextModule, RequestContextMiddleware,
|
|
@@ -3,9 +3,10 @@ import { AppModule } from './app.module';
|
|
|
3
3
|
import { ConfigService } from '@nestjs/config';
|
|
4
4
|
import * as session from 'express-session';
|
|
5
5
|
import * as passport from 'passport';
|
|
6
|
-
import {
|
|
6
|
+
import {PrismaService} from '@appxdigital/appx-core';
|
|
7
7
|
import { ValidationPipe } from '@nestjs/common';
|
|
8
|
-
import {
|
|
8
|
+
import {CorePrismaSessionStore} from '@appxdigital/appx-core';
|
|
9
|
+
import * as morgan from 'morgan';
|
|
9
10
|
|
|
10
11
|
async function bootstrap() {
|
|
11
12
|
const app = await NestFactory.create(AppModule);
|
|
@@ -17,6 +18,9 @@ async function bootstrap() {
|
|
|
17
18
|
const cookiename = configService.get<string>('SESSION_COOKIE_NAME');
|
|
18
19
|
const isProduction = process.env.NODE_ENV === 'production';
|
|
19
20
|
|
|
21
|
+
// Application request logging
|
|
22
|
+
app.use(morgan('[:date[iso]] :remote-addr :method :url :status :response-time ms - :res[content-length]'));
|
|
23
|
+
|
|
20
24
|
app.use(
|
|
21
25
|
session({
|
|
22
26
|
cookie: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Global, Module } from '@nestjs/common';
|
|
2
2
|
import { PrismaClient } from '@prisma/client';
|
|
3
|
-
import {
|
|
3
|
+
import {PERMISSIONS_CONFIG_TOKEN, PermissionsConfigType, PrismaService} from '@appxdigital/appx-core';
|
|
4
4
|
import { PermissionsConfig } from '../config/permissions.config';
|
|
5
5
|
|
|
6
6
|
@Global()
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"express": "4.21.1",
|
|
13
13
|
"argon2": "0.41.1",
|
|
14
14
|
"rxjs": "7.8.1",
|
|
15
|
-
"reflect-metadata": "0.2.0"
|
|
15
|
+
"reflect-metadata": "0.2.0",
|
|
16
|
+
"morgan": "^1.10.1"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
18
19
|
"@types/express": "5.0.0",
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
"@types/inquirer": "9.0.7",
|
|
22
23
|
"@types/multer": "1.4.12",
|
|
23
24
|
"@types/passport-local": "1.0.38",
|
|
24
|
-
"typescript": "5.1.3"
|
|
25
|
+
"typescript": "5.1.3",
|
|
26
|
+
"@types/morgan": "^1.9.10"
|
|
25
27
|
}
|
|
26
28
|
}
|
package/wizard.js
CHANGED
|
@@ -70,7 +70,7 @@ program.command('generate')
|
|
|
70
70
|
.description('Updates Prisma client and generates the GraphQL schema')
|
|
71
71
|
.action(() => {
|
|
72
72
|
// run file inside node_modules/appx-core/dist/config/generate-all.js
|
|
73
|
-
const generatePath = path.join(process.cwd(), 'node_modules', 'appx-core', 'dist', 'config', 'generate-all.js');
|
|
73
|
+
const generatePath = path.join(process.cwd(), 'node_modules', '@appxdigital/appx-core', 'dist', 'config', 'generate-all.js');
|
|
74
74
|
if (!fsCore.existsSync(generatePath)) {
|
|
75
75
|
console.error('❌ Not inside a valid AppX Core project directory. Please run this command inside your project directory.');
|
|
76
76
|
process.exit(1);
|
|
@@ -89,7 +89,7 @@ program.command('setup:fileupload')
|
|
|
89
89
|
.description('Add file upload configuration to the project')
|
|
90
90
|
.action(() => {
|
|
91
91
|
// run file inside node_modules/appx-core/dist/config/setup-fileupload.js
|
|
92
|
-
const generatePath = path.join(process.cwd(), 'node_modules', 'appx-core', 'dist', 'config', 'setup-fileupload.js');
|
|
92
|
+
const generatePath = path.join(process.cwd(), 'node_modules', '@appxdigital/appx-core', 'dist', 'config', 'setup-fileupload.js');
|
|
93
93
|
if (!fsCore.existsSync(generatePath)) {
|
|
94
94
|
console.error('❌ Not inside a valid AppX Core project directory. Please run this command inside your project directory.');
|
|
95
95
|
process.exit(1);
|