@appxdigital/appx-core-cli 1.0.14 → 1.0.16

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/cli.js CHANGED
@@ -27,7 +27,7 @@ import packageJson from './package.json' with {type: 'json'};
27
27
  const __filename = fileURLToPath(import.meta.url);
28
28
  const __dirname = path.dirname(__filename);
29
29
 
30
- const CORE_VERSION = '0.1.116';
30
+ const CORE_VERSION = '0.1.117';
31
31
 
32
32
  const phaseDurations = {
33
33
  installDependencies: 30,
@@ -406,10 +406,15 @@ async function createProject(answers, fileUploadConfigData) {
406
406
  coreGenerate(answers?.showOutput);
407
407
  incrementProgress(answers?.showOutput, "generateCoreModels");
408
408
 
409
+ if (fileUploadConfigData.provider) {
410
+ await insertFileUploadConfiguration(fileUploadConfigData, projectPath);
411
+ incrementProgress(showOutput, "fileUploadSetup");
412
+ }
413
+
409
414
  // Format code
410
415
  executeCommand('npx --yes prettier --write .', answers?.showOutput);
411
416
 
412
- // Initialize git repo
417
+ // Create git repo and initial commit
413
418
  initializeGitRepo(projectPath, answers?.showOutput);
414
419
  incrementProgress(answers?.showOutput, "gitInit");
415
420
 
@@ -418,11 +423,6 @@ async function createProject(answers, fileUploadConfigData) {
418
423
 
419
424
  incrementProgress(answers?.showOutput, "migrateDatabase");
420
425
 
421
- if (fileUploadConfigData.provider) {
422
- await insertFileUploadConfiguration(fileUploadConfigData, projectPath);
423
- incrementProgress(showOutput, "fileUploadSetup");
424
- }
425
-
426
426
  if (!showOutput) {
427
427
  progressBar.stop();
428
428
  }
@@ -522,7 +522,7 @@ function initializeGitRepo(projectPath, showOutput = false) {
522
522
  }
523
523
 
524
524
  async function createGitignore(projectPath) {
525
- const envFilesToAdd = ['.env', '.env.production'];
525
+ const envFilesToAdd = ['.env', '.env.production', 'src/generated/**'];
526
526
 
527
527
  const {defaultGitIgnore} = await import(path.join(projectPath, 'node_modules', '@nestjs/cli/lib/configuration/defaults.js'));
528
528
  const existingLines = defaultGitIgnore.split('\n');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@appxdigital/appx-core-cli",
4
- "version": "1.0.14",
4
+ "version": "1.0.16",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "npm:publish": "npm publish --access public",
@@ -17,7 +17,7 @@ model User {
17
17
  email String @unique
18
18
  name String?
19
19
  password String? /// @Role(none)
20
- role Role @default(GUEST)
20
+ role Role @default(USER)
21
21
  refreshTokens UserRefreshToken[]
22
22
  }
23
23
 
@@ -43,5 +43,5 @@ model UserRefreshToken {
43
43
 
44
44
  enum Role {
45
45
  ADMIN
46
- GUEST
46
+ USER
47
47
  }
@@ -1,4 +1,4 @@
1
- import {PermissionPlaceholder, PermissionsConfigType,} from '@appxdigital/appx-core';
1
+ import {PermissionPlaceholder, PermissionsConfigType} from '@appxdigital/appx-core';
2
2
 
3
3
  export const PermissionsConfig: PermissionsConfigType = {
4
4
  User: {
@@ -9,9 +9,9 @@ export const PermissionsConfig: PermissionsConfigType = {
9
9
  updateMany: 'ALL',
10
10
  deleteMany: 'ALL',
11
11
  },
12
- CLIENT: {
12
+ USER: {
13
13
  findFirst: {
14
- conditions: {id: PermissionPlaceholder.USER_ID},
14
+ conditions: {id: PermissionPlaceholder.USER_ID}, // Can only see its own user
15
15
  },
16
16
  }
17
17
  },