generated from gherking/gpc-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented the precompiler with the new gherking API.
- Loading branch information
Showing
29 changed files
with
10,266 additions
and
2,346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | ||
|
||
name: Beta Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'beta/**' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
- run: npm ci | ||
- run: npm run build | ||
|
||
publish-npm: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Generate build number | ||
uses: einaregilsson/build-number@v3 | ||
with: | ||
token: ${{secrets.github_token}} | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setting up Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Install | ||
run: npm ci | ||
- name: Build | ||
run: npm run buildUpdate | ||
- name: Release | ||
run: | | ||
cv=$(cat package.json | grep version | cut -d '"' -f 4) | ||
echo "$cv-beta.$BUILD_NUMBER" | ||
npm --no-git-tag-version version "$cv-beta.$BUILD_NUMBER" | ||
npm publish --tag beta . | ||
working-directory: ./dist | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Changelog | ||
|
||
## 1.0.0 - 2022-01-28 | ||
|
||
Implemented precompiler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,65 @@ | ||
# gpc-template | ||
# gpc-remove-duplicates | ||
|
||
![Downloads](https://img.shields.io/npm/dw/gpc-template?style=flat-square) | ||
![Version@npm](https://img.shields.io/npm/v/gpc-template?label=version%40npm&style=flat-square) | ||
![Version@git](https://img.shields.io/github/package-json/v/gherking/gpc-template/master?label=version%40git&style=flat-square) | ||
![CI](https://img.shields.io/github/workflow/status/gherking/gpc-template/CI/master?label=ci&style=flat-square) | ||
![Docs](https://img.shields.io/github/workflow/status/gherking/gpc-template/Docs/master?label=docs&style=flat-square) | ||
|
||
This repository is a template to create precompilers for GherKing. | ||
![Downloads](https://img.shields.io/npm/dw/gpc-remove-duplicates?style=flat-square) ![Version@npm](https://img.shields.io/npm/v/gpc-remove-duplicates?label=version%40npm&style=flat-square) ![Version@git](https://img.shields.io/github/package-json/v/gherking/gpc-remove-duplicates/master?label=version%40git&style=flat-square) ![CI](https://img.shields.io/github/workflow/status/gherking/gpc-remove-duplicates/CI/master?label=ci&style=flat-square) ![Docs](https://img.shields.io/github/workflow/status/gherking/gpc-remove-duplicates/Docs/master?label=docs&style=flat-square) | ||
|
||
## Usage | ||
|
||
```javascript | ||
'use strict'; | ||
const compiler = require('gherking'); | ||
const {Template} = require('gpc-template'); | ||
const RemoveDuplicates = require('gpc-remove-duplicates'); | ||
|
||
let ast = compiler.load('./features/src/login.feature'); | ||
let ast = await compiler.load('./features/src/login.feature'); | ||
ast = compiler.process( | ||
ast, | ||
new Template({ | ||
new RemoveDuplicates({ | ||
// config | ||
}) | ||
); | ||
compiler.save('./features/dist/login.feature', ast, { | ||
await compiler.save('./features/dist/login.feature', ast, { | ||
lineBreak: '\r\n' | ||
}); | ||
``` | ||
|
||
```typescript | ||
'use strict'; | ||
import {load, process, save} from "gherking"; | ||
import {Template} from "gpc-template"; | ||
import RemoveDuplicates from "gpc-remove-duplicates"; | ||
|
||
let ast = load("./features/src/login.feature"); | ||
let ast = await load("./features/src/login.feature"); | ||
ast = process( | ||
ast, | ||
new Template({ | ||
new RemoveDuplicates({ | ||
// config | ||
}) | ||
); | ||
save('./features/dist/login.feature', ast, { | ||
await save('./featuresdist/login.feature', ast, { | ||
lineBreak: '\r\n' | ||
}); | ||
``` | ||
|
||
For detailed documentation see the [TypeDocs documentation](https://gherking.github.io/gpc-template/). | ||
The RemoveDuplicates precompiler is responsible for having only a reasonable amount of tags and/or rows in each feature file. | ||
|
||
It can proceed with the following actions: | ||
1. Removes tags from Rule/Scenario/ScenarioOutline/Examples which exists on parent (Feature/Rule/ScenarioOutline) too. | ||
1. Removes duplicate tags from Feature/Rule/Scenario/ScearioOutline/Examples. | ||
1. Removes duplicate rows from Examples and step DataTables. | ||
|
||
## Configuration | ||
|
||
RemoveDuplicateRows accepts the following configuration: | ||
|
||
| Option | Type | Description | Default | | ||
|:------:|:----:|:------------|:--------| | ||
| `processTags` | `boolean` | It indicates whether the 1st and 2nd options should be applied. | `true` | | ||
| `processRows` | `boolean` | It indicates whether the 3rd option should be applied. | `false` | | ||
|
||
## Other | ||
|
||
This package uses [debug](https://www.npmjs.com/package/debug) for logging, use `gpc:remove-duplicates` : | ||
|
||
```shell | ||
DEBUG=gpc:remove-duplicates* gherking ... | ||
``` | ||
|
||
This package uses [debug](https://www.npmjs.com/package/debug) for logging. | ||
For detailed documentation see the [TypeDocs documentation](https://gherking.github.io/gpc-remove-duplicates/). |
Oops, something went wrong.