Skip to content
Snippets Groups Projects
Commit 7cfb4f37 authored by Zdravko Iliev's avatar Zdravko Iliev
Browse files

feat: setup nx monorepo

parent 434f50ab
No related branches found
No related tags found
1 merge request!1feat: setup nx monorepo
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nx"],
"plugins": ["@nrwl/nx", "@typescript-eslint/eslint-plugin"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/enforce-module-boundaries": [
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
......@@ -23,12 +23,21 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
"extends": [
"plugin:@nrwl/nx/typescript",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-explicit-any": "error"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
},
{
......
......@@ -18,11 +18,7 @@ node_modules
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.vscode
# misc
/.sass-cache
......
{
"singleQuote": true
"singleQuote": false,
"trailingComma": "all"
}
{
"recommendations": [
"nrwl.angular-console",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"dbaeumer.vscode-eslint"
]
}
{
"$schema": "https://json.schemastore.org/swcrc",
"sourceMaps": true,
"module": {
"type": "commonjs"
},
"jsc": {
"target": "es2017",
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true
},
"keepClassNames": true,
"baseUrl": "./"
},
"minify": false
}
......@@ -5,18 +5,15 @@
"projectType": "application",
"targets": {
"build": {
"executor": "@nx/webpack:webpack",
"executor": "@nrwl/js:swc",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"target": "node",
"compiler": "tsc",
"outputPath": "dist/apps/agent",
"compiler": "swc",
"outputPath": "dist/apps/my-nest-app",
"main": "apps/agent/src/main.ts",
"tsConfig": "apps/agent/tsconfig.app.json",
"assets": ["apps/agent/src/assets"],
"isolatedConfig": true,
"webpackConfig": "apps/agent/webpack.config.js"
"tsConfig": "apps/agent/tsconfig.app.json"
},
"configurations": {
"development": {},
......@@ -55,7 +52,7 @@
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
"codeCoverage": false
}
}
}
......
......@@ -7,7 +7,7 @@ export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
getData() {
getData(): { message: string } {
return this.appService.getData();
}
}
......@@ -8,14 +8,14 @@ import { NestFactory } from "@nestjs/core";
import { AppModule } from "./app/app.module";
async function bootstrap() {
async function bootstrap(): Promise<void> {
const app = await NestFactory.create(AppModule);
const globalPrefix = "api";
app.setGlobalPrefix(globalPrefix);
const port = process.env.PORT || 3000;
await app.listen(port);
Logger.log(
`🚀 Application is running on: http://localhost:${port}/${globalPrefix}`
`🚀 Application is running on: http://localhost:${port}/${globalPrefix}`,
);
}
......
const { composePlugins, withNx } = require("@nx/webpack");
// Nx plugins for webpack.
module.exports = composePlugins(withNx(), (config) => {
// Update the webpack config as needed here.
// e.g. `config.plugins.push(new MyPlugin())`
return config;
});
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment