Skip to content

Commit 3b7dcfd

Browse files
committed
feat: add hello api app
1 parent f928c44 commit 3b7dcfd

23 files changed

+280
-4
lines changed

apps/books-api/tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
"references": [
66
{
77
"path": "./tsconfig.app.json"
8-
},
9-
{
10-
"path": "./tsconfig.spec.json"
118
}
129
],
1310
"compilerOptions": {

apps/hello-api/.eslintrc.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
}
17+
]
18+
}

apps/hello-api/project.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "hello-api",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "apps/hello-api/src",
5+
"projectType": "application",
6+
"tags": [],
7+
"targets": {
8+
"build": {
9+
"executor": "nx:run-commands",
10+
"options": {
11+
"command": "webpack-cli build",
12+
"args": ["node-env=production"]
13+
},
14+
"configurations": {
15+
"development": {
16+
"args": ["node-env=development"]
17+
}
18+
}
19+
},
20+
"serve": {
21+
"executor": "@nx/js:node",
22+
"defaultConfiguration": "development",
23+
"dependsOn": ["build"],
24+
"options": {
25+
"buildTarget": "hello-api:build",
26+
"runBuildTargetDependencies": false
27+
},
28+
"configurations": {
29+
"development": {
30+
"buildTarget": "hello-api:build:development"
31+
},
32+
"production": {
33+
"buildTarget": "hello-api:build:production"
34+
}
35+
}
36+
},
37+
"test": {
38+
"options": {
39+
"passWithNoTests": true
40+
}
41+
}
42+
}
43+
}

apps/hello-api/src/assets/.gitkeep

Whitespace-only changes.

apps/hello-api/src/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { bootstrap } from '@nx-demo/nest-bootstrap';
2+
import { AppModule } from '@nx-demo/hello-api-lib';
3+
bootstrap(AppModule);

apps/hello-api/tsconfig.app.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"types": ["node"],
6+
"emitDecoratorMetadata": true,
7+
"target": "es2021"
8+
},
9+
"include": ["src/**/*.ts"],
10+
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
11+
}

apps/hello-api/tsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"files": [],
4+
"include": [],
5+
"references": [
6+
{
7+
"path": "./tsconfig.app.json"
8+
}
9+
],
10+
"compilerOptions": {
11+
"esModuleInterop": true
12+
}
13+
}

apps/hello-api/webpack.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin');
2+
const { join } = require('path');
3+
4+
module.exports = {
5+
output: {
6+
path: join(__dirname, '../../dist/apps/hello-api'),
7+
},
8+
plugins: [
9+
new NxAppWebpackPlugin({
10+
target: 'node',
11+
compiler: 'tsc',
12+
main: './src/main.ts',
13+
tsConfig: './tsconfig.app.json',
14+
assets: ['./src/assets'],
15+
optimization: false,
16+
outputHashing: 'none',
17+
generatePackageJson: true,
18+
}),
19+
],
20+
};

libs/hello-api-lib/.eslintrc.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
}
17+
]
18+
}

libs/hello-api-lib/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# hello-api-lib
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Running unit tests
6+
7+
Run `nx test hello-api-lib` to execute the unit tests via [Jest](https://jestjs.io).

0 commit comments

Comments
 (0)