Merge pull request #2 from IT-Lab-KubSU/feature/front-base-layout

Feature/front base layout
main
Artem-Darius Weber 1 year ago committed by GitHub
commit 1979d5dfda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,12 @@
{
"name": "frontend",
"version": "1.0.0",
"description": "",
"main": "webpack.config.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}

@ -0,0 +1,10 @@
{
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
}
]
}

@ -0,0 +1,6 @@
import { defineConfig } from 'cypress';
import { nxE2EStorybookPreset } from '@nx/storybook/presets/cypress';
export default defineConfig({
e2e: nxE2EStorybookPreset(__dirname),
});

@ -0,0 +1,30 @@
{
"name": "ui-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/ui-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/ui-e2e/cypress.config.ts",
"devServerTarget": "ui:storybook",
"testingType": "e2e"
},
"configurations": {
"ci": {
"devServerTarget": "ui:static-storybook:ci"
}
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/ui-e2e/**/*.{js,ts}"]
}
}
},
"tags": [],
"implicitDependencies": ["ui"]
}

@ -0,0 +1,7 @@
describe('ui: Ui component', () => {
beforeEach(() => cy.visit('/iframe.html?id=ui--primary'));
it('should render the component', () => {
cy.get('h1').should('contain', 'Welcome to Ui!');
});
});

@ -0,0 +1,4 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io"
}

@ -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<Subject> {
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) => { ... })

@ -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';

@ -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"]
}

@ -0,0 +1,25 @@
# Nx Commands
### This command will generate a new React library (React Component) in the libs folder and it will also add all the required script targets in your project.json
```bash
nx g @nrwl/react:lib ui
```
### This command will configure library to be a Storybook library
```bash
nx g @nrwl/react:storybook-configuration --name=ui
```
### This command will generate a new React Story in selected library (component)
```bash
nx g @nrwl/react:stories --project=ui
```
### This command will build Storybook
```bash
nx run ui:build-storybook
```
### This command will run Styorybook
```bash
nx run ui:storybook
```
### This command will generate Storybook Stories
```bash
nx g @nrwl/react:component button --project=ui --export
```

@ -0,0 +1,20 @@
{
"presets": [
[
"@nx/react/babel",
{
"runtime": "automatic",
"useBuiltIns": "usage"
}
]
],
"plugins": [
[
"styled-components",
{
"pure": true,
"ssr": true
}
]
]
}

@ -0,0 +1,18 @@
{
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}

@ -0,0 +1,18 @@
const config = {
stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
addons: ['@storybook/addon-essentials'],
framework: {
name: '@storybook/react-vite',
options: {
builder: {
viteConfigPath: '',
},
},
},
};
export default config;
// To customize your Vite configuration you can use the viteFinal field.
// Check https://storybook.js.org/docs/react/builders/vite#configuration
// and https://nx.dev/packages/storybook/documents/custom-builder-configs

@ -0,0 +1,26 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"../**/*.spec.ts",
"../**/*.spec.js",
"../**/*.spec.tsx",
"../**/*.spec.jsx"
],
"include": [
"../src/**/*.stories.ts",
"../src/**/*.stories.js",
"../src/**/*.stories.jsx",
"../src/**/*.stories.tsx",
"../src/**/*.stories.mdx",
"*.js"
]
}

@ -0,0 +1,7 @@
# ui
This library was generated with [Nx](https://nx.dev).
## Running unit tests
Run `nx test ui` to execute the unit tests via [Jest](https://jestjs.io).

@ -0,0 +1,11 @@
/* eslint-disable */
export default {
displayName: 'ui',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/ui',
};

@ -0,0 +1,67 @@
{
"name": "ui",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/ui/src",
"projectType": "library",
"tags": [],
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/ui/**/*.{ts,tsx,js,jsx}"]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/ui/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"storybook": {
"executor": "@nx/storybook:storybook",
"options": {
"port": 4400,
"configDir": "libs/ui/.storybook"
},
"configurations": {
"ci": {
"quiet": true
}
}
},
"build-storybook": {
"executor": "@nx/storybook:build",
"outputs": ["{options.outputDir}"],
"options": {
"outputDir": "dist/storybook/ui",
"configDir": "libs/ui/.storybook"
},
"configurations": {
"ci": {
"quiet": true
}
}
},
"static-storybook": {
"executor": "@nx/web:file-server",
"options": {
"buildTarget": "ui:build-storybook",
"staticFilePath": "dist/storybook/ui"
},
"configurations": {
"ci": {
"buildTarget": "ui:build-storybook:ci"
}
}
}
}
}

@ -0,0 +1 @@
export * from './lib/ui';

@ -0,0 +1,10 @@
import { render } from '@testing-library/react';
import Ui from './ui';
describe('Ui', () => {
it('should render successfully', () => {
const { baseElement } = render(<Ui />);
expect(baseElement).toBeTruthy();
});
});

@ -0,0 +1,12 @@
import type { Meta } from '@storybook/react';
import { Ui } from './ui';
const Story: Meta<typeof Ui> = {
component: Ui,
title: 'Ui',
};
export default Story;
export const Primary = {
args: {},
};

@ -0,0 +1,18 @@
import styled from 'styled-components';
/* eslint-disable-next-line */
export interface UiProps {}
const StyledUi = styled.div`
color: pink;
`;
export function Ui(props: UiProps) {
return (
<StyledUi>
<h1>Welcome to Ui!</h1>
</StyledUi>
);
}
export default Ui;

@ -0,0 +1,23 @@
{
"compilerOptions": {
"jsx": "react-jsx",
"allowJs": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
},
{
"path": "./.storybook/tsconfig.json"
}
],
"extends": "../../tsconfig.base.json"
}

@ -0,0 +1,27 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"]
},
"files": [
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
"src/**/*.spec.ts",
"src/**/*.test.ts",
"src/**/*.spec.tsx",
"src/**/*.test.tsx",
"src/**/*.spec.js",
"src/**/*.test.js",
"src/**/*.spec.jsx",
"src/**/*.test.jsx",
"**/*.stories.ts",
"**/*.stories.js",
"**/*.stories.jsx",
"**/*.stories.tsx"
],
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
}

@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"jest.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
"src/**/*.spec.tsx",
"src/**/*.test.js",
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx",
"src/**/*.d.ts"
]
}

@ -8,7 +8,8 @@
"build",
"lint",
"test",
"e2e"
"e2e",
"build-storybook"
],
"accessToken": "MjRlZTEyMmItZThlMS00MjBlLWI2MjctZDIxMzg2ZDJmOTkyfHJlYWQtd3JpdGU="
}
@ -16,19 +17,11 @@
},
"targetDefaults": {
"build": {
"dependsOn": [
"^build"
],
"inputs": [
"production",
"^production"
]
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"e2e": {
"inputs": [
"default",
"^production"
]
"inputs": ["default", "^production"]
},
"lint": {
"inputs": [
@ -38,24 +31,22 @@
]
},
"test": {
"inputs": [
"default",
"^production",
"{workspaceRoot}/jest.preset.js"
]
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
},
"build-storybook": {
"inputs": ["default", "^production", "!{projectRoot}/.storybook/**/*"]
}
},
"namedInputs": {
"default": [
"{projectRoot}/**/*",
"sharedGlobals"
],
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"production": [
"default",
"!{projectRoot}/.eslintrc.json",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s"
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/**/*.stories.@(js|jsx|ts|tsx|mdx)",
"!{projectRoot}/.storybook/**/*"
],
"sharedGlobals": []
},
@ -72,7 +63,8 @@
},
"library": {
"style": "scss",
"linter": "eslint"
"linter": "eslint",
"unitTestRunner": "jest"
}
}
}

@ -17,8 +17,10 @@
"graphql": "^16.7.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-is": "18.2.0",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.0",
"styled-components": "5.3.6",
"tslib": "^2.3.0"
},
"devDependencies": {
@ -26,17 +28,23 @@
"@nestjs/schematics": "^10.0.1",
"@nestjs/testing": "^10.0.2",
"@nrwl/nest": "^16.4.0",
"@nrwl/storybook": "^16.4.1",
"@nx/cypress": "16.4.0",
"@nx/eslint-plugin": "16.4.0",
"@nx/jest": "16.4.0",
"@nx/js": "16.4.0",
"@nx/js": "16.4.1",
"@nx/linter": "16.4.0",
"@nx/nest": "16.4.0",
"@nx/node": "16.4.0",
"@nx/react": "16.4.0",
"@nx/storybook": "16.4.1",
"@nx/web": "16.4.1",
"@nx/webpack": "16.4.0",
"@nx/workspace": "16.4.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"@storybook/addon-essentials": "^7.0.24",
"@storybook/core-server": "^7.0.24",
"@storybook/react-vite": "^7.0.24",
"@svgr/webpack": "^8.0.1",
"@swc/cli": "~0.1.62",
"@swc/core": "~1.3.51",
@ -45,9 +53,12 @@
"@types/node": "18.14.2",
"@types/react": "18.2.13",
"@types/react-dom": "18.2.6",
"@types/react-is": "18.2.1",
"@types/styled-components": "5.1.26",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"babel-jest": "^29.4.1",
"babel-plugin-styled-components": "1.10.7",
"cypress": "^12.11.0",
"eslint": "~8.15.0",
"eslint-config-prettier": "8.1.0",
@ -66,6 +77,7 @@
"ts-jest": "^29.1.0",
"ts-node": "10.9.1",
"typescript": "~5.1.3",
"url-loader": "^4.1.1"
"url-loader": "^4.1.1",
"vite": "^4.3.4"
}
}

@ -14,7 +14,9 @@
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"baseUrl": ".",
"paths": {}
"paths": {
"@platform/ui": ["libs/ui/src/index.ts"]
}
},
"exclude": ["node_modules", "tmp"]
}

12625
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save