|
1 | | -# Getting started |
| 1 | +# @qavajs/html-formatter |
2 | 2 |
|
3 | | -## Recommended software: |
4 | | -- Node 8.12.0 or later (https://nodejs.org/en/) |
5 | | -- VSCode (https://code.visualstudio.com/), or other IDE with typescript support (like WebStorm) |
6 | | -- yarn package manager (https://yarnpkg.com/en/) |
7 | | -- Any GIT client (standalone, or embedded into your IDE) |
| 3 | +Single file HTML formatter for cucumber framework |
8 | 4 |
|
9 | | -## Running the project with template |
| 5 | +### Installation |
| 6 | +To install formatter run |
10 | 7 |
|
11 | | -Clone the repository. |
| 8 | +`npm install @qavajs/html-formatter` |
12 | 9 |
|
13 | | -To build and then start the project use: |
14 | | -``` |
15 | | -yarn |
16 | | -yarn start |
17 | | -``` |
18 | | -Then open your browser on http://localhost:3000/ |
19 | | - |
20 | | - |
21 | | -## Available Scripts |
22 | | - |
23 | | -In the project directory, you can run: |
24 | | - |
25 | | -### `npm start` |
26 | | - |
27 | | -Runs the app in the development mode.\ |
28 | | -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. |
29 | | - |
30 | | -The page will reload if you make edits.\ |
31 | | -You will also see any lint errors in the console. |
32 | | - |
33 | | -### `npm test` |
34 | | - |
35 | | -Launches the test runner in the interactive watch mode.\ |
36 | | -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. |
| 10 | +and add to formatter section in config file |
37 | 11 |
|
38 | | -### `npm run build` |
39 | | - |
40 | | -Builds the app for production to the `build` folder.\ |
41 | | -It correctly bundles React in production mode and optimizes the build for the best performance. |
42 | | - |
43 | | -The build is minified and the filenames include the hashes.\ |
44 | | -Your app is ready to be deployed! |
45 | | - |
46 | | -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. |
47 | | - |
48 | | -# Build configuration |
49 | | - |
50 | | -## CSS/SCSS Modules |
51 | | - |
52 | | -We build styles using SCSS in combination with CSS modules. |
53 | | - |
54 | | -If you have the following MyComponent.module.scss file: |
55 | | -``` |
56 | | -.my-header { |
57 | | - color: red; |
| 12 | +```javascript |
| 13 | +module.exports = { |
| 14 | + default: { |
| 15 | + format: ['@qavajs/html-formatter:report.html'] |
| 16 | + } |
58 | 17 | } |
59 | 18 | ``` |
60 | | -You can import and use selectors from it from your tsx file: |
61 | | -``` |
62 | | -import * as React from 'react'; |
63 | | -import * as css from './MainPage.module.scss'; |
64 | | -
|
65 | | -export const MyComponent = <div className={ css.mainPanel }> |
66 | | -``` |
67 | | -css.mainPanel will be equal to auto-generated class name, which is guaranteed to be unique across the project. In development mode, selector will contain the name of the file and hash, like "MainPage_mainPanel__140Pj". In production mode, selectors will be made short to reduce size. |
68 | | - |
69 | | -If you need an usual global selector, use: |
70 | | -``` |
71 | | -:global(.my-selector) |
72 | | -``` |
73 | | - |
74 | | -Read more on CSS Modules here: https://github.com/css-modules/css-modules |
75 | | - |
76 | | -Read more on SCSS here: https://sass-lang.com/ |
77 | | - |
78 | | -## SVG icons |
79 | | - |
80 | | -SVG files can be imported like this: |
81 | | -``` |
82 | | -import { ReactComponent as myIcon } from 'icons/myIcon.svg' |
83 | | -``` |
84 | | - |
85 | | -After this, myIcon.svg will be included in SVG sprite as a symbol, and myIcon variable will contain and object with meta-information about the SVG file, like { id, url, viewBox } or like React.SFC. |
86 | | - |
87 | | -[comment]: <> (## Working the .NET/Java server) |
88 | | - |
89 | | -[comment]: <> (By default, the project is configured to run without the server (like .NET/Java-based REST APIs).) |
90 | | - |
91 | | -[comment]: <> (Usually, back-end project serves static assets as well as it's REST APIs. Considering this, when you'll get back-end server running, you need to change some settings:) |
92 | | - |
93 | | -[comment]: <> (- make sure your server can serve static files from /built path.) |
94 | | - |
95 | | -[comment]: <> (- the app uses Single Page Application approach, so routing is done at client-side. To support this, you'll need to tweak your server-side routing so any unknown path (like /home) serves the /built/index.html file content) |
96 | | - |
97 | | -[comment]: <> (- on developers machines, setup the server to run on some spare port (like 44301)) |
98 | | - |
99 | | -[comment]: <> (- Back-end developers can use "yarn build" after getting the source, to get recent version of UI scripts) |
100 | | - |
101 | | -[comment]: <> (- On your build/CI script use "yarn prod" command to build the bundle.js.) |
102 | | - |
103 | | -# Learn More |
104 | 19 |
|
105 | | -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). |
| 20 | +or pass `--format @qavajs/html-formatter:report.html` in cli |
106 | 21 |
|
107 | | -To learn about UII, visit [UUI documentation website](https://uui.epam.com/) |
| 22 | +Kudos to https://github.com/epam/UUI for providing components |
108 | 23 |
|
109 | | -To learn React, check out the [React documentation](https://reactjs.org/). |
0 commit comments