Skip to content

Commit 4397cb1

Browse files
author
Oleksandr_Halichenko
committed
added readme, license, changelog, github actions
1 parent 1f8ba3f commit 4397cb1

File tree

24 files changed

+8662
-1378
lines changed

24 files changed

+8662
-1378
lines changed

.github/workflows/npm-publish.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Node.js Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish-npm:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 16
15+
registry-url: https://registry.npmjs.org/
16+
- run: npm ci
17+
- run: npm run build
18+
- run: npm publish --access public
19+
env:
20+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.github/workflows/pull-request.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: browser-actions/setup-chrome@latest
13+
- run: chrome --version
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v2
16+
with:
17+
node-version: 16
18+
- run: npm ci
19+
- run: npm run build

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
2424

25-
.idea
25+
.idea
26+
27+
test/report/

.npmignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
build/
3+
config/
4+
public/
5+
scripts/
6+
src/
7+
test/

CHANGELOG.MD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# 0.0.1
2+
initial implementation

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 qavajs
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 13 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,23 @@
1-
# Getting started
1+
# @qavajs/html-formatter
22

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
84

9-
## Running the project with template
5+
### Installation
6+
To install formatter run
107

11-
Clone the repository.
8+
`npm install @qavajs/html-formatter`
129

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
3711

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+
}
5817
}
5918
```
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 &#40;like .NET/Java-based REST APIs&#41;.)
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 &#40;like /home&#41; serves the /built/index.html file content)
96-
97-
[comment]: <> (- on developers machines, setup the server to run on some spare port &#40;like 44301&#41;)
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
10419

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
10621

107-
To learn about UII, visit [UUI documentation website](https://uui.epam.com/)
22+
Kudos to https://github.com/epam/UUI for providing components
10823

109-
To learn React, check out the [React documentation](https://reactjs.org/).

config/webpack.config.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -633,30 +633,6 @@ module.exports = function (webpackEnv) {
633633
filename: 'static/css/[name].[contenthash:8].css',
634634
chunkFilename: 'static/css/[name].[contenthash:8].chunk.css',
635635
}),
636-
// Generate an asset manifest file with the following content:
637-
// - "files" key: Mapping of all asset filenames to their corresponding
638-
// output file so that tools can pick it up without having to parse
639-
// `index.html`
640-
// - "entrypoints" key: Array of files which are included in `index.html`,
641-
// can be used to reconstruct the HTML if necessary
642-
new ManifestPlugin({
643-
fileName: 'asset-manifest.json',
644-
publicPath: paths.publicUrlOrPath,
645-
generate: (seed, files, entrypoints) => {
646-
const manifestFiles = files.reduce((manifest, file) => {
647-
manifest[file.name] = file.path;
648-
return manifest;
649-
}, seed);
650-
const entrypointFiles = entrypoints.main.filter(
651-
fileName => !fileName.endsWith('.map')
652-
);
653-
654-
return {
655-
files: manifestFiles,
656-
entrypoints: entrypointFiles,
657-
};
658-
},
659-
}),
660636
// Moment.js is an extremely popular library that bundles large locale files
661637
// by default due to how webpack interprets its code. This is a practical
662638
// solution that requires the user to opt into importing specific locales.

formatter/formatter.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const { JsonFormatter } = require('@cucumber/cucumber');
2+
const fs = require('fs');
3+
const path = require('path');
4+
class HTMLFormatter extends JsonFormatter {
5+
6+
constructor(options) {
7+
super(options);
8+
const log = this.log.bind(this);
9+
this.log = function(json) {
10+
const htmlTemplate = fs.readFileSync(path.resolve(__dirname, './index.html'), 'utf-8');
11+
log(htmlTemplate.replace('SOURCE_DATA', json));
12+
}
13+
}
14+
15+
}
16+
17+
module.exports = HTMLFormatter;

0 commit comments

Comments
 (0)