feat: added react layout lib

feature/auth-configure
Artem-Darius Weber 1 year ago
parent 3355b9bf25
commit f25c3d5d47

@ -121,6 +121,12 @@ Have a look at the [Nx Console extensions](https://nx.dev/nx-console). It provid
Just run `nx build demoapp` to build the application. The build artifacts will be stored in the `dist/` directory, ready to be deployed. Just run `nx build demoapp` to build the application. The build artifacts will be stored in the `dist/` directory, ready to be deployed.
# Frontend
## Create a new Layout
```bash
nx g @nx/react:component NAME --project site-layouts
```
# Стиль кода # Стиль кода
## Коммиты ## Коммиты
Используемые префиксы: Используемые префиксы:

@ -0,0 +1,12 @@
{
"presets": [
[
"@nx/react/babel",
{
"runtime": "automatic",
"useBuiltIns": "usage"
}
]
],
"plugins": []
}

@ -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,7 @@
# site-layouts
This library was generated with [Nx](https://nx.dev).
## Running unit tests
Run `nx test site-layouts` to execute the unit tests via [Vitest](https://vitest.dev/).

@ -0,0 +1,11 @@
/* eslint-disable */
export default {
displayName: 'site-layouts',
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/site-layouts',
};

@ -0,0 +1,12 @@
{
"name": "@platform/site-layouts",
"version": "0.0.1",
"main": "./index.js",
"types": "./index.d.ts",
"exports": {
".": {
"import": "./index.mjs",
"require": "./index.js"
}
}
}

@ -0,0 +1,46 @@
{
"name": "site-layouts",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/site-layouts/src",
"projectType": "library",
"tags": [],
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/site-layouts/**/*.{ts,tsx,js,jsx}"]
}
},
"build": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/libs/site-layouts"
},
"configurations": {
"development": {
"mode": "development"
},
"production": {
"mode": "production"
}
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/site-layouts/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
}
}

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

@ -0,0 +1,7 @@
/*
* Replace this with your own classes
*
* e.g.
* .container {
* }
*/

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

@ -0,0 +1,14 @@
import styles from './site-layouts.module.scss';
/* eslint-disable-next-line */
export interface SiteLayoutsProps {}
export function SiteLayouts(props: SiteLayoutsProps) {
return (
<div className={styles['container']}>
<h1>Welcome to SiteLayouts!</h1>
</div>
);
}
export default SiteLayouts;

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

@ -0,0 +1,22 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node", "vite/client"]
},
"files": [
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",
"**/*.test.tsx",
"**/*.spec.js",
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.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"
]
}

@ -0,0 +1,49 @@
/// <reference types="vitest" />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import viteTsConfigPaths from 'vite-tsconfig-paths';
import dts from 'vite-plugin-dts';
import * as path from 'path';
export default defineConfig({
cacheDir: '../../node_modules/.vite/site-layouts',
plugins: [
dts({
entryRoot: 'src',
tsConfigFilePath: path.join(__dirname, 'tsconfig.lib.json'),
skipDiagnostics: true,
}),
react(),
viteTsConfigPaths({
root: '../../',
}),
],
// Uncomment this if you are using workers.
// worker: {
// plugins: [
// viteTsConfigPaths({
// root: '../../',
// }),
// ],
// },
// Configuration for building your library.
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
lib: {
// Could also be a dictionary or array of multiple entry points.
entry: 'src/index.ts',
name: 'site-layouts',
fileName: 'index',
// Change this to the formats you want to support.
// Don't forget to update your package.json as well.
formats: ['es', 'cjs'],
},
rollupOptions: {
// External packages that should not be bundled into your library.
external: ['react', 'react-dom', 'react/jsx-runtime'],
},
},
});

@ -45,6 +45,7 @@
"@nx/node": "16.4.0", "@nx/node": "16.4.0",
"@nx/react": "16.4.0", "@nx/react": "16.4.0",
"@nx/storybook": "16.4.1", "@nx/storybook": "16.4.1",
"@nx/vite": "16.4.0",
"@nx/web": "16.4.1", "@nx/web": "16.4.1",
"@nx/webpack": "16.4.0", "@nx/webpack": "16.4.0",
"@nx/workspace": "16.4.0", "@nx/workspace": "16.4.0",
@ -65,6 +66,8 @@
"@types/styled-components": "5.1.26", "@types/styled-components": "5.1.26",
"@typescript-eslint/eslint-plugin": "^5.58.0", "@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0", "@typescript-eslint/parser": "^5.58.0",
"@vitejs/plugin-react": "^4.0.0",
"@vitest/ui": "^0.32.0",
"babel-jest": "^29.4.1", "babel-jest": "^29.4.1",
"babel-plugin-styled-components": "1.10.7", "babel-plugin-styled-components": "1.10.7",
"cypress": "^12.11.0", "cypress": "^12.11.0",
@ -78,15 +81,20 @@
"jest": "^29.4.1", "jest": "^29.4.1",
"jest-environment-jsdom": "^29.4.1", "jest-environment-jsdom": "^29.4.1",
"jest-environment-node": "^29.4.1", "jest-environment-node": "^29.4.1",
"jsdom": "~22.1.0",
"nx": "16.4.0", "nx": "16.4.0",
"nx-cloud": "latest", "nx-cloud": "latest",
"prettier": "^2.6.2", "prettier": "^2.6.2",
"prisma": "^4.16.1", "prisma": "^4.16.1",
"react-refresh": "^0.10.0", "react-refresh": "^0.10.0",
"sass": "^1.55.0",
"ts-jest": "^29.1.0", "ts-jest": "^29.1.0",
"ts-node": "10.9.1", "ts-node": "10.9.1",
"typescript": "~5.1.3", "typescript": "~5.1.3",
"url-loader": "^4.1.1", "url-loader": "^4.1.1",
"vite": "^4.3.4" "vite": "^4.3.9",
"vite-plugin-dts": "~2.3.0",
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^0.32.0"
} }
} }

@ -16,8 +16,9 @@
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@pconfig": ["config/index.ts"], "@pconfig": ["config/index.ts"],
"@platform/prisma-generator": ["libs/prisma-generator/src/index.ts"],
"@platform/prisma-clients": ["libs/prisma-clients/index.ts"], "@platform/prisma-clients": ["libs/prisma-clients/index.ts"],
"@platform/prisma-generator": ["libs/prisma-generator/src/index.ts"],
"@platform/site-layouts": ["libs/site-layouts/src/index.ts"],
"@platform/ui": ["libs/ui/src/index.ts"] "@platform/ui": ["libs/ui/src/index.ts"]
} }
}, },

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