commit faf34c100f87c1206065743a6cf8805d0eb362af Author: Gurkengewuerz Date: Thu Mar 16 23:15:43 2023 +0100 Initial commit diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6e87a00 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +node_modules diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..06cc47d --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,35 @@ +{ + "root": true, + "ignorePatterns": ["**/*"], + "plugins": ["@nrwl/nx"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": { + "@nrwl/nx/enforce-module-boundaries": [ + "error", + { + "enforceBuildableLibDependency": true, + "allow": [], + "depConstraints": [ + { + "sourceTag": "*", + "onlyDependOnLibsWithTags": ["*"] + } + ] + } + ] + } + }, + { + "files": ["*.ts", "*.tsx"], + "extends": ["plugin:@nrwl/nx/typescript"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "extends": ["plugin:@nrwl/nx/javascript"], + "rules": {} + } + ] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..51b9af5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +dist +tmp +/out-tsc + +# dependencies +node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings + +# System Files +.DS_Store +Thumbs.db diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..d0b804d --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +# Add files here to ignore them from prettier formatting + +/dist +/coverage diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..8db60ca --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "singleQuote": true +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..462e29b --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "nrwl.angular-console", + "esbenp.prettier-vscode", + "dbaeumer.vscode-eslint" + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..b3c216e --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Nitro + + + +✨ **This workspace has been generated by [Nx, a Smart, fast and extensible build system.](https://nx.dev)** ✨ + +## Development server + +Run `nx serve frontend` for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files. + +## Understand this workspace + +Run `nx graph` to see a diagram of the dependencies of the projects. + +## Remote caching + +Run `npx nx connect-to-nx-cloud` to enable [remote caching](https://nx.app) and make CI faster. + +## Further help + +Visit the [Nx Documentation](https://nx.dev) to learn more. diff --git a/apps/.gitkeep b/apps/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/frontend-e2e/.eslintrc.json b/apps/frontend-e2e/.eslintrc.json new file mode 100644 index 0000000..4c5989b --- /dev/null +++ b/apps/frontend-e2e/.eslintrc.json @@ -0,0 +1,17 @@ +{ + "extends": ["plugin:cypress/recommended", "../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["src/plugins/index.js"], + "rules": { + "@typescript-eslint/no-var-requires": "off", + "no-undef": "off" + } + } + ] +} diff --git a/apps/frontend-e2e/cypress.config.ts b/apps/frontend-e2e/cypress.config.ts new file mode 100644 index 0000000..60aecd5 --- /dev/null +++ b/apps/frontend-e2e/cypress.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from 'cypress'; +import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; + +export default defineConfig({ + e2e: nxE2EPreset(__dirname, { + bundler: 'vite', + }), +}); diff --git a/apps/frontend-e2e/project.json b/apps/frontend-e2e/project.json new file mode 100644 index 0000000..45a3245 --- /dev/null +++ b/apps/frontend-e2e/project.json @@ -0,0 +1,30 @@ +{ + "name": "frontend-e2e", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "apps/frontend-e2e/src", + "projectType": "application", + "targets": { + "e2e": { + "executor": "@nrwl/cypress:cypress", + "options": { + "cypressConfig": "apps/frontend-e2e/cypress.config.ts", + "devServerTarget": "frontend:serve:development", + "testingType": "e2e" + }, + "configurations": { + "production": { + "devServerTarget": "frontend:serve:production" + } + } + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["apps/frontend-e2e/**/*.{js,ts}"] + } + } + }, + "tags": [], + "implicitDependencies": ["frontend"] +} diff --git a/apps/frontend-e2e/src/e2e/app.cy.ts b/apps/frontend-e2e/src/e2e/app.cy.ts new file mode 100644 index 0000000..c37b7f7 --- /dev/null +++ b/apps/frontend-e2e/src/e2e/app.cy.ts @@ -0,0 +1,13 @@ +import { getGreeting } from '../support/app.po'; + +describe('frontend', () => { + beforeEach(() => cy.visit('/')); + + it('should display welcome message', () => { + // Custom command example, see `../support/commands.ts` file + cy.login('my-email@something.com', 'myPassword'); + + // Function helper example, see `../support/app.po.ts` file + getGreeting().contains('Welcome frontend'); + }); +}); diff --git a/apps/frontend-e2e/src/fixtures/example.json b/apps/frontend-e2e/src/fixtures/example.json new file mode 100644 index 0000000..294cbed --- /dev/null +++ b/apps/frontend-e2e/src/fixtures/example.json @@ -0,0 +1,4 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io" +} diff --git a/apps/frontend-e2e/src/support/app.po.ts b/apps/frontend-e2e/src/support/app.po.ts new file mode 100644 index 0000000..3293424 --- /dev/null +++ b/apps/frontend-e2e/src/support/app.po.ts @@ -0,0 +1 @@ +export const getGreeting = () => cy.get('h1'); diff --git a/apps/frontend-e2e/src/support/commands.ts b/apps/frontend-e2e/src/support/commands.ts new file mode 100644 index 0000000..310f1fa --- /dev/null +++ b/apps/frontend-e2e/src/support/commands.ts @@ -0,0 +1,33 @@ +// *********************************************** +// This example commands.js shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** + +// eslint-disable-next-line @typescript-eslint/no-namespace +declare namespace Cypress { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + interface Chainable { + login(email: string, password: string): void; + } +} +// +// -- This is a parent command -- +Cypress.Commands.add('login', (email, password) => { + console.log('Custom command example: Login', email, password); +}); +// +// -- This is a child command -- +// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- +// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) +// +// +// -- This will overwrite an existing command -- +// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) diff --git a/apps/frontend-e2e/src/support/e2e.ts b/apps/frontend-e2e/src/support/e2e.ts new file mode 100644 index 0000000..3d469a6 --- /dev/null +++ b/apps/frontend-e2e/src/support/e2e.ts @@ -0,0 +1,17 @@ +// *********************************************************** +// This example support/index.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands'; diff --git a/apps/frontend-e2e/tsconfig.json b/apps/frontend-e2e/tsconfig.json new file mode 100644 index 0000000..cc509a7 --- /dev/null +++ b/apps/frontend-e2e/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "sourceMap": false, + "outDir": "../../dist/out-tsc", + "allowJs": true, + "types": ["cypress", "node"] + }, + "include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"] +} diff --git a/apps/frontend/.eslintrc.json b/apps/frontend/.eslintrc.json new file mode 100644 index 0000000..734ddac --- /dev/null +++ b/apps/frontend/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/apps/frontend/index.html b/apps/frontend/index.html new file mode 100644 index 0000000..3ef900c --- /dev/null +++ b/apps/frontend/index.html @@ -0,0 +1,16 @@ + + + + + Frontend + + + + + + + +
+ + + diff --git a/apps/frontend/project.json b/apps/frontend/project.json new file mode 100644 index 0000000..c7a25ba --- /dev/null +++ b/apps/frontend/project.json @@ -0,0 +1,72 @@ +{ + "name": "frontend", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "apps/frontend/src", + "projectType": "application", + "targets": { + "build": { + "executor": "@nrwl/vite:build", + "outputs": ["{options.outputPath}"], + "defaultConfiguration": "production", + "options": { + "outputPath": "dist/apps/frontend" + }, + "configurations": { + "development": { + "mode": "development" + }, + "production": { + "mode": "production" + } + } + }, + "serve": { + "executor": "@nrwl/vite:dev-server", + "defaultConfiguration": "development", + "options": { + "buildTarget": "frontend:build" + }, + "configurations": { + "development": { + "buildTarget": "frontend:build:development", + "hmr": true + }, + "production": { + "buildTarget": "frontend:build:production", + "hmr": false + } + } + }, + "preview": { + "executor": "@nrwl/vite:preview-server", + "defaultConfiguration": "development", + "options": { + "buildTarget": "frontend:build" + }, + "configurations": { + "development": { + "buildTarget": "frontend:build:development" + }, + "production": { + "buildTarget": "frontend:build:production" + } + } + }, + "test": { + "executor": "@nrwl/vite:test", + "outputs": ["coverage/apps/frontend"], + "options": { + "passWithNoTests": true, + "reportsDirectory": "../../coverage/apps/frontend" + } + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["apps/frontend/**/*.{ts,tsx,js,jsx}"] + } + } + }, + "tags": [] +} diff --git a/apps/frontend/public/favicon.ico b/apps/frontend/public/favicon.ico new file mode 100644 index 0000000..317ebcb Binary files /dev/null and b/apps/frontend/public/favicon.ico differ diff --git a/apps/frontend/src/app/app.module.scss b/apps/frontend/src/app/app.module.scss new file mode 100644 index 0000000..7b88fba --- /dev/null +++ b/apps/frontend/src/app/app.module.scss @@ -0,0 +1 @@ +/* Your styles goes here. */ diff --git a/apps/frontend/src/app/app.spec.tsx b/apps/frontend/src/app/app.spec.tsx new file mode 100644 index 0000000..95caf44 --- /dev/null +++ b/apps/frontend/src/app/app.spec.tsx @@ -0,0 +1,15 @@ +import { render } from '@testing-library/react'; + +import App from './app'; + +describe('App', () => { + it('should render successfully', () => { + const { baseElement } = render(); + expect(baseElement).toBeTruthy(); + }); + + it('should have a greeting as the title', () => { + const { getByText } = render(); + expect(getByText(/Welcome frontend/gi)).toBeTruthy(); + }); +}); diff --git a/apps/frontend/src/app/app.tsx b/apps/frontend/src/app/app.tsx new file mode 100644 index 0000000..3247e9e --- /dev/null +++ b/apps/frontend/src/app/app.tsx @@ -0,0 +1,16 @@ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import styles from './app.module.scss'; + +import NxWelcome from './nx-welcome'; + +export function App() { + return ( + <> + + +
+ + ); +} + +export default App; diff --git a/apps/frontend/src/app/nx-welcome.tsx b/apps/frontend/src/app/nx-welcome.tsx new file mode 100644 index 0000000..761a47a --- /dev/null +++ b/apps/frontend/src/app/nx-welcome.tsx @@ -0,0 +1,820 @@ +/* + * * * * * * * * * * * * * * * * * * * * * * * * * * * * + This is a starter component and can be deleted. + * * * * * * * * * * * * * * * * * * * * * * * * * * * * + Delete this file and get started with your project! + * * * * * * * * * * * * * * * * * * * * * * * * * * * * + */ +export function NxWelcome({ title }: { title: string }) { + return ( + <> +