diff --git a/apps/users-application-e2e/eslint.config.js b/apps/users-e2e/eslint.config.js similarity index 100% rename from apps/users-application-e2e/eslint.config.js rename to apps/users-e2e/eslint.config.js diff --git a/apps/users-application-e2e/jest.config.ts b/apps/users-e2e/jest.config.ts similarity index 81% rename from apps/users-application-e2e/jest.config.ts rename to apps/users-e2e/jest.config.ts index 249ec84..efb2667 100644 --- a/apps/users-application-e2e/jest.config.ts +++ b/apps/users-e2e/jest.config.ts @@ -1,5 +1,5 @@ export default { - displayName: 'users-application-e2e', + displayName: 'users-e2e', preset: '../../jest.preset.js', globalSetup: '/src/support/global-setup.ts', globalTeardown: '/src/support/global-teardown.ts', @@ -14,5 +14,5 @@ export default { ], }, moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/users-application-e2e', + coverageDirectory: '../../coverage/users-e2e', }; diff --git a/apps/users-application-e2e/project.json b/apps/users-e2e/project.json similarity index 60% rename from apps/users-application-e2e/project.json rename to apps/users-e2e/project.json index 2a8ec04..99e3c57 100644 --- a/apps/users-application-e2e/project.json +++ b/apps/users-e2e/project.json @@ -1,17 +1,17 @@ { - "name": "users-application-e2e", + "name": "users-e2e", "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", - "implicitDependencies": ["users-application"], + "implicitDependencies": ["users"], "targets": { "e2e": { "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/{e2eProjectRoot}"], "options": { - "jestConfig": "apps/users-application-e2e/jest.config.ts", + "jestConfig": "apps/users-e2e/jest.config.ts", "passWithNoTests": true }, - "dependsOn": ["users-application:build"] + "dependsOn": ["users:build"] } } } diff --git a/apps/users-application-e2e/src/support/global-setup.ts b/apps/users-e2e/src/support/global-setup.ts similarity index 100% rename from apps/users-application-e2e/src/support/global-setup.ts rename to apps/users-e2e/src/support/global-setup.ts diff --git a/apps/users-application-e2e/src/support/global-teardown.ts b/apps/users-e2e/src/support/global-teardown.ts similarity index 100% rename from apps/users-application-e2e/src/support/global-teardown.ts rename to apps/users-e2e/src/support/global-teardown.ts diff --git a/apps/users-application-e2e/src/support/test-setup.ts b/apps/users-e2e/src/support/test-setup.ts similarity index 100% rename from apps/users-application-e2e/src/support/test-setup.ts rename to apps/users-e2e/src/support/test-setup.ts diff --git a/apps/users-application-e2e/src/users-application/users-application.spec.ts b/apps/users-e2e/src/users/users.spec.ts similarity index 100% rename from apps/users-application-e2e/src/users-application/users-application.spec.ts rename to apps/users-e2e/src/users/users.spec.ts diff --git a/apps/users-application-e2e/tsconfig.json b/apps/users-e2e/tsconfig.json similarity index 100% rename from apps/users-application-e2e/tsconfig.json rename to apps/users-e2e/tsconfig.json diff --git a/apps/users-application-e2e/tsconfig.spec.json b/apps/users-e2e/tsconfig.spec.json similarity index 100% rename from apps/users-application-e2e/tsconfig.spec.json rename to apps/users-e2e/tsconfig.spec.json diff --git a/apps/users-application/eslint.config.js b/apps/users/eslint.config.js similarity index 100% rename from apps/users-application/eslint.config.js rename to apps/users/eslint.config.js diff --git a/apps/users-application/jest.config.ts b/apps/users/jest.config.ts similarity index 69% rename from apps/users-application/jest.config.ts rename to apps/users/jest.config.ts index 33405c6..534c5f1 100644 --- a/apps/users-application/jest.config.ts +++ b/apps/users/jest.config.ts @@ -1,10 +1,10 @@ export default { - displayName: 'users-application', + displayName: 'users', preset: '../../jest.preset.js', testEnvironment: 'node', transform: { '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], }, moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/apps/users-application', + coverageDirectory: '../../coverage/apps/users', }; diff --git a/apps/users-application/project.json b/apps/users/project.json similarity index 63% rename from apps/users-application/project.json rename to apps/users/project.json index 44b3f1c..fc5da0e 100644 --- a/apps/users-application/project.json +++ b/apps/users/project.json @@ -1,7 +1,7 @@ { - "name": "users-application", + "name": "users", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/users-application/src", + "sourceRoot": "apps/users/src", "projectType": "application", "tags": [], "targets": { @@ -10,15 +10,15 @@ "defaultConfiguration": "development", "dependsOn": ["build"], "options": { - "buildTarget": "users-application:build", + "buildTarget": "users:build", "runBuildTargetDependencies": false }, "configurations": { "development": { - "buildTarget": "users-application:build:development" + "buildTarget": "users:build:development" }, "production": { - "buildTarget": "users-application:build:production" + "buildTarget": "users:build:production" } } } diff --git a/apps/users-application/src/app/app.controller.spec.ts b/apps/users/src/app/app.controller.spec.ts similarity index 84% rename from apps/users-application/src/app/app.controller.spec.ts rename to apps/users/src/app/app.controller.spec.ts index e089b7a..b37ff64 100644 --- a/apps/users-application/src/app/app.controller.spec.ts +++ b/apps/users/src/app/app.controller.spec.ts @@ -16,7 +16,9 @@ describe('AppController', () => { describe('getData', () => { it('should return "Hello User Service"', () => { const appController = app.get(AppController); - expect(appController.getData()).toEqual({ message: 'Hello User Service' }); + expect(appController.getData()).toEqual({ + message: 'Hello User Service', + }); }); }); }); diff --git a/apps/users-application/src/app/app.controller.ts b/apps/users/src/app/app.controller.ts similarity index 100% rename from apps/users-application/src/app/app.controller.ts rename to apps/users/src/app/app.controller.ts diff --git a/apps/users-application/src/app/app.module.ts b/apps/users/src/app/app.module.ts similarity index 100% rename from apps/users-application/src/app/app.module.ts rename to apps/users/src/app/app.module.ts diff --git a/apps/users-application/src/app/app.service.spec.ts b/apps/users/src/app/app.service.spec.ts similarity index 100% rename from apps/users-application/src/app/app.service.spec.ts rename to apps/users/src/app/app.service.spec.ts diff --git a/apps/users-application/src/app/app.service.ts b/apps/users/src/app/app.service.ts similarity index 100% rename from apps/users-application/src/app/app.service.ts rename to apps/users/src/app/app.service.ts diff --git a/apps/users-application/src/assets/.gitkeep b/apps/users/src/assets/.gitkeep similarity index 100% rename from apps/users-application/src/assets/.gitkeep rename to apps/users/src/assets/.gitkeep diff --git a/apps/users-application/src/main.ts b/apps/users/src/main.ts similarity index 100% rename from apps/users-application/src/main.ts rename to apps/users/src/main.ts diff --git a/apps/users-application/src/users/users.module.ts b/apps/users/src/users/users.module.ts similarity index 100% rename from apps/users-application/src/users/users.module.ts rename to apps/users/src/users/users.module.ts diff --git a/apps/users-application/src/users/users.resolver.spec.ts b/apps/users/src/users/users.resolver.spec.ts similarity index 89% rename from apps/users-application/src/users/users.resolver.spec.ts rename to apps/users/src/users/users.resolver.spec.ts index 26fcae9..ec16452 100644 --- a/apps/users-application/src/users/users.resolver.spec.ts +++ b/apps/users/src/users/users.resolver.spec.ts @@ -50,15 +50,19 @@ describe('UsersResolver', () => { const user: User = { id: '1', name: 'John Doe' }; jest.spyOn(service, 'findById').mockReturnValue(user); - expect(resolver.resolveReference({ __typename: 'User', id: '1' })).toEqual(user); + expect( + resolver.resolveReference({ __typename: 'User', id: '1' }), + ).toEqual(user); expect(service.findById).toHaveBeenCalledWith('1'); }); it('should return undefined if user not found by reference id', () => { jest.spyOn(service, 'findById').mockReturnValue(undefined); - expect(resolver.resolveReference({ __typename: 'User', id: '2' })).toBeUndefined(); + expect( + resolver.resolveReference({ __typename: 'User', id: '2' }), + ).toBeUndefined(); expect(service.findById).toHaveBeenCalledWith('2'); }); }); -}); \ No newline at end of file +}); diff --git a/apps/users-application/src/users/users.resolver.ts b/apps/users/src/users/users.resolver.ts similarity index 100% rename from apps/users-application/src/users/users.resolver.ts rename to apps/users/src/users/users.resolver.ts diff --git a/apps/users-application/src/users/users.service.spec.ts b/apps/users/src/users/users.service.spec.ts similarity index 99% rename from apps/users-application/src/users/users.service.spec.ts rename to apps/users/src/users/users.service.spec.ts index 17af965..4d80ec3 100644 --- a/apps/users-application/src/users/users.service.spec.ts +++ b/apps/users/src/users/users.service.spec.ts @@ -27,4 +27,4 @@ describe('UsersService', () => { const user: User = service.findById('3'); expect(user).toBeUndefined(); }); -}); \ No newline at end of file +}); diff --git a/apps/users-application/src/users/users.service.ts b/apps/users/src/users/users.service.ts similarity index 100% rename from apps/users-application/src/users/users.service.ts rename to apps/users/src/users/users.service.ts diff --git a/apps/users-application/tsconfig.app.json b/apps/users/tsconfig.app.json similarity index 100% rename from apps/users-application/tsconfig.app.json rename to apps/users/tsconfig.app.json diff --git a/apps/users-application/tsconfig.json b/apps/users/tsconfig.json similarity index 100% rename from apps/users-application/tsconfig.json rename to apps/users/tsconfig.json diff --git a/apps/users-application/tsconfig.spec.json b/apps/users/tsconfig.spec.json similarity index 100% rename from apps/users-application/tsconfig.spec.json rename to apps/users/tsconfig.spec.json diff --git a/apps/users-application/webpack.config.js b/apps/users/webpack.config.js similarity index 87% rename from apps/users-application/webpack.config.js rename to apps/users/webpack.config.js index b32cd8a..3b8b2af 100644 --- a/apps/users-application/webpack.config.js +++ b/apps/users/webpack.config.js @@ -3,7 +3,7 @@ const { join } = require('path'); module.exports = { output: { - path: join(__dirname, '../../dist/apps/users-application'), + path: join(__dirname, '../../dist/apps/users'), }, plugins: [ new NxAppWebpackPlugin({ diff --git a/nx.json b/nx.json index 99714f2..bf210ee 100644 --- a/nx.json +++ b/nx.json @@ -34,7 +34,7 @@ "options": { "targetName": "test" }, - "exclude": ["apps/gateway-e2e/**/*", "apps/users-application-e2e/**/*"] + "exclude": ["apps/gateway-e2e/**/*", "apps/users-e2e/**/*"] } ] }