Skip to content

Commit b13a9bb

Browse files
committed
feat: 🎸 created basic daemon and gui
1 parent 31dd9a6 commit b13a9bb

File tree

103 files changed

+17132
-6686
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+17132
-6686
lines changed

‎.eslintrc.json

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nrwl/nx", "@typescript-eslint", "prettier", "import"],
5+
"extends": [
6+
"plugin:@typescript-eslint/recommended",
7+
"plugin:prettier/recommended"
8+
],
9+
"overrides": [
10+
{
11+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
12+
"rules": {
13+
"@nrwl/nx/enforce-module-boundaries": [
14+
"error",
15+
{
16+
"enforceBuildableLibDependency": true,
17+
"allow": [],
18+
"depConstraints": [
19+
{
20+
"sourceTag": "*",
21+
"onlyDependOnLibsWithTags": ["*"]
22+
}
23+
]
24+
}
25+
],
26+
"prettier/prettier": [
27+
"error",
28+
{
29+
"singleQuote": true,
30+
"trailingComma": "all",
31+
"arrowParens": "avoid",
32+
"printWidth": 120,
33+
"tabWidth": 2,
34+
"eslintIntegration": true,
35+
"bracketSpacing": true,
36+
"arrow-body-style": "off",
37+
"prefer-arrow-callback": "off"
38+
}
39+
],
40+
"import/order": [
41+
"error",
42+
{
43+
"alphabetize": {
44+
"order": "asc",
45+
"caseInsensitive": true
46+
},
47+
"groups": [
48+
[
49+
"builtin",
50+
"external"
51+
]
52+
],
53+
"newlines-between": "always"
54+
}
55+
]
56+
}
57+
},
58+
{
59+
"files": ["*.ts", "*.tsx"],
60+
"extends": ["plugin:@nrwl/nx/typescript"],
61+
"rules": {
62+
"@typescript-eslint/explicit-function-return-type": [
63+
"error",
64+
{
65+
"allowExpressions": true,
66+
"allowTypedFunctionExpressions": true,
67+
"allowConciseArrowFunctionExpressionsStartingWithVoid": true,
68+
"allowHigherOrderFunctions": false
69+
}
70+
],
71+
"@typescript-eslint/member-ordering": [
72+
"warn",
73+
{
74+
"default": {
75+
"memberTypes": ["private-field", "protected-field", "decorated-field", "public-field" ]
76+
}
77+
}
78+
],
79+
"@typescript-eslint/naming-convention": [
80+
"error",
81+
{
82+
"selector": "interface",
83+
"format": ["PascalCase"],
84+
"custom": {
85+
"regex": "^I[A-Z]",
86+
"match": false
87+
}
88+
},
89+
{
90+
"selector": "class",
91+
"format": ["PascalCase"]
92+
},
93+
{
94+
"selector": "enum",
95+
"format": ["PascalCase"]
96+
},
97+
{
98+
"selector": "variable",
99+
"format": ["camelCase", "UPPER_CASE"],
100+
"leadingUnderscore": "allow"
101+
},
102+
{
103+
"selector": "method",
104+
"format": ["camelCase"],
105+
"leadingUnderscore": "allow"
106+
}
107+
],
108+
"@typescript-eslint/no-shadow": ["warn"]
109+
}
110+
},
111+
{
112+
"files": ["*.js", "*.jsx"],
113+
"extends": ["plugin:@nrwl/nx/javascript"],
114+
"rules": {}
115+
},
116+
{
117+
"files": ["*.spec.ts", "*.mock.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
118+
"env": {
119+
"jest": true
120+
},
121+
"rules": {
122+
"max-lines-per-function": "off",
123+
"max-len": "off",
124+
"max-lines": "off",
125+
"@typescript-eslint/no-explicit-any": "off",
126+
"@typescript-eslint/no-empty-function": "off",
127+
"@typescript-eslint/no-unused-vars": "off",
128+
"@typescript-eslint/explicit-function-return-type": "off"
129+
}
130+
}
131+
]
132+
}

‎.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ testem.log
3737
# System Files
3838
.DS_Store
3939
Thumbs.db
40+
41+
.angular
42+
.env
43+
.dev.env

‎.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22

33
/dist
44
/coverage
5+
6+
index.html

‎.vscode/extensions.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"recommendations": [
3-
43
"nrwl.angular-console",
5-
"esbenp.prettier-vscode"
4+
"esbenp.prettier-vscode",
5+
"firsttris.vscode-jest-runner",
6+
"dbaeumer.vscode-eslint"
67
]
78
}
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+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'cli-daemon-e2e',
4+
preset: '../../jest.preset.js',
5+
globals: {
6+
'ts-jest': {
7+
tsconfig: '<rootDir>/tsconfig.spec.json',
8+
},
9+
},
10+
globalSetup: '<rootDir>/src/support/global-setup.ts',
11+
globalTeardown: '<rootDir>/src/support/global-teardown.ts',
12+
setupFiles: ['<rootDir>/src/support/test-setup.ts'],
13+
testEnvironment: 'node',
14+
transform: {
15+
'^.+\\.[tj]s$': 'ts-jest',
16+
},
17+
moduleFileExtensions: ['ts', 'js', 'html'],
18+
coverageDirectory: '../../coverage/cli-daemon-e2e',
19+
};

‎apps/cli-daemon-e2e/project.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "cli-daemon-e2e",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"implicitDependencies": ["cli-daemon"],
5+
"targets": {
6+
"e2e": {
7+
"executor": "@nrwl/jest:jest",
8+
"outputs": ["{workspaceRoot}/coverage/{e2eProjectRoot}"],
9+
"options": {
10+
"jestConfig": "apps/cli-daemon-e2e/jest.config.ts",
11+
"passWithNoTests": true
12+
}
13+
},
14+
"lint": {
15+
"executor": "@nrwl/linter:eslint",
16+
"outputs": ["{options.outputFile}"],
17+
"options": {
18+
"lintFilePatterns": ["apps/cli-daemon-e2e/**/*.{js,ts}"]
19+
}
20+
}
21+
}
22+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import axios from 'axios';
2+
3+
describe('GET /', () => {
4+
it('should return a message', async () => {
5+
const res = await axios.get(`/`);
6+
7+
expect(res.status).toBe(200);
8+
expect(res.data).toEqual({ message: 'Hello API' });
9+
});
10+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable */
2+
var __TEARDOWN_MESSAGE__: string;
3+
4+
module.exports = async function () {
5+
// Start services that that the app needs to run (e.g. database, docker-compose, etc.).
6+
console.log('\nSetting up...\n');
7+
8+
// Hint: Use `globalThis` to pass variables to global teardown.
9+
globalThis.__TEARDOWN_MESSAGE__ = '\nTearing down...\n';
10+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* eslint-disable */
2+
3+
module.exports = async function () {
4+
// Put clean up logic here (e.g. stopping services, docker-compose, etc.).
5+
// Hint: `globalThis` is shared between setup and teardown.
6+
console.log(globalThis.__TEARDOWN_MESSAGE__);
7+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable */
2+
3+
import axios from 'axios';
4+
5+
module.exports = async function () {
6+
// Configure axios for tests to use.
7+
const host = process.env.HOST ?? 'localhost';
8+
const port = process.env.PORT ?? '3000';
9+
axios.defaults.baseURL = `http://${host}:${port}`;
10+
};

‎apps/cli-daemon-e2e/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.spec.json"
8+
}
9+
],
10+
"compilerOptions": {
11+
"esModuleInterop": true
12+
}
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"module": "commonjs",
6+
"types": ["jest", "node"]
7+
},
8+
"include": ["jest.config.ts", "src/**/*.ts"]
9+
}

‎apps/cli-daemon/.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/cli-daemon/jest.config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'cli-daemon',
4+
preset: '../../jest.preset.js',
5+
globals: {
6+
'ts-jest': {
7+
tsconfig: '<rootDir>/tsconfig.spec.json',
8+
},
9+
},
10+
testEnvironment: 'node',
11+
transform: {
12+
'^.+\\.[tj]s$': 'ts-jest',
13+
},
14+
moduleFileExtensions: ['ts', 'js', 'html'],
15+
coverageDirectory: '../../coverage/apps/cli-daemon',
16+
};

‎apps/cli-daemon/project.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"name": "cli-daemon",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "apps/cli-daemon/src",
5+
"projectType": "application",
6+
"targets": {
7+
"build": {
8+
"executor": "@nrwl/webpack:webpack",
9+
"outputs": ["{options.outputPath}"],
10+
"options": {
11+
"target": "node",
12+
"compiler": "tsc",
13+
"outputPath": "dist/apps/cli-daemon",
14+
"main": "apps/cli-daemon/src/main.ts",
15+
"tsConfig": "apps/cli-daemon/tsconfig.app.json",
16+
"assets": ["apps/cli-daemon/src/assets"],
17+
"webpackConfig": "apps/cli-daemon/webpack.config.js"
18+
},
19+
"configurations": {
20+
"production": {
21+
"optimization": true,
22+
"extractLicenses": true,
23+
"inspect": false
24+
}
25+
}
26+
},
27+
"serve": {
28+
"executor": "@nrwl/js:node",
29+
"options": {
30+
"buildTarget": "cli-daemon:build"
31+
},
32+
"configurations": {
33+
"production": {
34+
"buildTarget": "cli-daemon:build:production"
35+
}
36+
}
37+
},
38+
"lint": {
39+
"executor": "@nrwl/linter:eslint",
40+
"outputs": ["{options.outputFile}"],
41+
"options": {
42+
"lintFilePatterns": ["apps/cli-daemon/**/*.ts"]
43+
}
44+
},
45+
"test": {
46+
"executor": "@nrwl/jest:jest",
47+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
48+
"options": {
49+
"jestConfig": "apps/cli-daemon/jest.config.ts",
50+
"passWithNoTests": true
51+
},
52+
"configurations": {
53+
"ci": {
54+
"ci": true,
55+
"codeCoverage": true
56+
}
57+
}
58+
}
59+
},
60+
"tags": []
61+
}

0 commit comments

Comments
 (0)