Skip to content

Commit

Permalink
Fixed content for linting and monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinod Kumar authored and Vinod Kumar committed May 30, 2022
1 parent 162991a commit b6ee947
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 163 deletions.
4 changes: 2 additions & 2 deletions docs/adoption.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ Universal React accelerator has taken several steps to ensure the Adoption Readi

Universal React accelerator can be adopted into your projects in multiple ways.

1. **Out of the box Adoption**: You can use `npx create-universal-react`to setup your project, if you are completely aligned with [Technology choices](/universal-react-docs/docs/features/). You can make necessary tweaks and adjust these choices post initial setup.
2. **Clone The Generator**: You can clone the generator, customize it as per your organization needs.
1. **Out of the box adoption**: You can use `npx create-universal-react`to setup your project, if you are completely aligned with [Technology choices](/universal-react-docs/docs/features/). You can make necessary tweaks and adjust these choices post initial setup.
2. **Clone the Generator**: You can clone the generator, customize it as per your organization needs and publish it to artifactory.
40 changes: 0 additions & 40 deletions docs/consuming-web-component-in-react.md

This file was deleted.

9 changes: 8 additions & 1 deletion docs/monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ title: Monorepo
sidebar_label: Monorepo
---

# Setup Monorepo structure with Turborepo
## Monorepo structure with Turborepo

Monorepos are incredible for productivity, especially on the frontend, but the tooling can be a nightmare. [Turborepo](https://turborepo.org/) makes it easy.

Learn more here, on why use [Turborepo](https://turborepo.org/docs#why-turborepo)?

Read this for a [comparison of NX vs Turborepo](https://nx.dev/guides/turbo-and-nx)

## Project structure in Turborepo

![Project structure in Turborepo](/img/turborepo-structure.png)
122 changes: 3 additions & 119 deletions docs/quality-control.md
Original file line number Diff line number Diff line change
@@ -1,126 +1,10 @@
---
id: quality-control
title: Static Quality Control
sidebar_label: Quality Control
---

# XT Page Source Code Quality Config Package
## Linting

Package to unify code quality control configuration and rules across projects. No need to install those packages anymore in your projects and maintain them all separately.
Config packages to unify code linting and typescript configuration and rules across projects. No need to install those packages anymore in your each project and maintain them all separately, thanks to monorepo structure.

## Eslint Package

To Install package <@xt-pagesource/eslint-config>

```sh
npm install @xt-pagesource/eslint-config-react
```

#### Configure

Create the file .eslintrc in your app root folder and extend rules. you can also add additional rules as per your desire.

```
{
"extends":["@xt-pagesource/eslint-config-react"]
}
```

#### Note:
You can extend or modify this rules in your project as is described on the documentation of eslint, the same way as you will do when extending eslint recommended rules.

```
{
"extends":["@xt-pagesource/eslint-config-react"],
rules:{
your rules here
}
}
```

### Usage

Like you will do normally with eslint, this package is nothing else just a wrapper. - For just linting and to see the report, run:

```
eslint path/to/folder
```

For linting and autofix the problems, run:

```
eslint --fix path/to/folder
```

Recommended
Add in your package.json at the scripts section the two following scripts:

```
{
"scripts": {
"lint:js": "eslint path/to/folder",
"lint:fix": "eslint --fix path/to/folder"
}
}
```

---

## Stylint Package

To Install package <@xt-pagesource/stylelint-config>

```
npm install @xt-pagesource/stylelint-config-react
```

#### Configure

Create the file .stylelintrc in your app root folder and extend rules. you can also add additional rules as per your desire.

```
{
"extends":["@xt-pagesource/stylelint-config-react"]
}
```

#### Note:
You can extend or modify this rules in your project as is described on the documentation of eslint, the same way as you will do when extending eslint recommended rules.

```
{
"extends":["@xt-pagesource/stylelint-config-react"],
rules:{
your rules here
}
}
```

### Usage

Like you will do normally with stylelint, this package is a wrapper. - For just linting and to see the report, run:

```
stylelint path/to/folder
```

For linting and autofix the problems, run:

```
stylelint --fix path/to/folder
```

Recommended
Add in your package.json at the scripts section the two following scripts:

```
{
"scripts": {
"lint:css": "stylelint path/to/folder",
}
}
```
![Linting config in Turborepo](/img/linting-config.png)
2 changes: 1 addition & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
someSidebar: {
Introduction: ['intro', 'why', 'how', 'features', 'road-map', 'contribution', 'adoption', 'support'],
Features: ['quality-control', 'smart-context', 'unit-testing', 'design-system', 'loader', 'web-component', 'logger', 'generate-plop', 'module-federation', 'monorepo', 'storybook'],
Features: ['monorepo', 'smart-context', 'design-system', 'loader', 'logger', 'generate-plop', 'module-federation', 'storybook', 'quality-control', 'unit-testing' ],
},
};
Binary file added static/img/linting-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/turborepo-structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b6ee947

Please sign in to comment.