feat: added react pages lib

feature/auth-configure
Artem-Darius Weber 1 year ago
parent f25c3d5d47
commit 05b9705be9

@ -126,6 +126,10 @@ Just run `nx build demoapp` to build the application. The build artifacts will b
```bash ```bash
nx g @nx/react:component NAME --project site-layouts nx g @nx/react:component NAME --project site-layouts
``` ```
## Create a new Page
```bash
nx g @nx/react:component NAME --project site-pages
```
# Стиль кода # Стиль кода
## Коммиты ## Коммиты

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

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

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

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

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

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

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

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

@ -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-pages',
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-pages',
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'],
},
},
});

@ -19,6 +19,7 @@
"@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/prisma-generator": ["libs/prisma-generator/src/index.ts"],
"@platform/site-layouts": ["libs/site-layouts/src/index.ts"], "@platform/site-layouts": ["libs/site-layouts/src/index.ts"],
"@platform/site-pages": ["libs/site-pages/src/index.ts"],
"@platform/ui": ["libs/ui/src/index.ts"] "@platform/ui": ["libs/ui/src/index.ts"]
} }
}, },

Loading…
Cancel
Save