Skip to content

Commit

Permalink
feat:escape space and write-to-file (#17)
Browse files Browse the repository at this point in the history
* Get latest broth workflow

* Generate doc

* Adds schema to md

* Adds icone

* Adds type to md

* Try to read oneOf

* Code for anyOf

* Generate schema

* Adds better description

* Adds description for onShellCommandFinishEnum

* Increment version, improve zod model, add tests

* Escape spaces and adds write to File

* Uses write-to-file in broth

* Updates dependencies version to latest

* Update doc

* Updates using scaffold norm
  • Loading branch information
olih authored Apr 15, 2023
1 parent f63a0d4 commit 6b2b28a
Show file tree
Hide file tree
Showing 22 changed files with 2,711 additions and 762 deletions.
35 changes: 27 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,39 @@ jobs:
node:
- 18.x
os:
- ubuntu-latest
- macOS-latest
- ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Installation
run: yarn install
- name: Static code analysis
run: yarn lint:ci
- name: Test
run: yarn test:ci
- name: Create temp folder
run: mkdir temp
- name: Run zest unit tests
run: |
if [ -d "spec" ]; then
npx npx baldrick-broth@latest test spec
else
echo "No zest files. Skipping"
fi
- name: Run pest integration tests
run: |
if [ -d "pest-spec" ]; then
npx npx baldrick-broth@latest test pest
else
echo "No pest files. Skipping"
fi
- name: Build
run: yarn build:ci
run: yarn build
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Pest
path: report/*.pest.mocha.json
reporter: mocha-json
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ dist/
report/
temp/
.message
.todo.yaml
.github/PULL_REQUEST_TEMPLATE/pull_request_relevant.md
.todo.yaml
3 changes: 3 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# API of baldrick-broth

> List of functions and variables for `baldrick-broth`
237 changes: 237 additions & 0 deletions CODE_VOCABULARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
# Code base vocabulary

> Overview of the code base vocabulary for baldrick-broth
This document has been generated automatically by
[baldrick-doc-ts](https://github.com/flarebyte/baldrick-doc-ts)

## Code base vocabulary

Table of vocabulary found in the code base

| Identifier | Word count | Filename |
| ------------------------------------ | ---------- | --------------------- |
| get property list | 3 | basic-execution.ts |
| as string or blank | 4 | basic-execution.ts |
| as any array | 3 | basic-execution.ts |
| range | 1 | basic-execution.ts |
| basic command execution | 3 | basic-execution.ts |
| basic commands execution | 3 | basic-execution.ts |
| basic execution | 2 | basic-execution.ts |
| describe enum | 2 | build-model.ts |
| as enum keys | 3 | build-model.ts |
| jsonish schema | 2 | build-model.ts |
| safe parse build | 3 | build-model.ts |
| get schema | 2 | build-model.ts |
| unsafe parse | 2 | build-model.ts |
| literal | 1 | build-model.ts |
| json | 1 | build-model.ts |
| build model | 2 | build-model.ts |
| task model | 2 | build-model.ts |
| batch step model | 3 | build-model.ts |
| any command | 2 | build-model.ts |
| on command success | 3 | build-model.ts |
| on command failure | 3 | build-model.ts |
| ctx | 1 | build-model.ts |
| runtime context | 2 | build-model.ts |
| any data value | 3 | build-model.ts |
| on shell command finish | 4 | build-model.ts |
| build model validation | 3 | build-model.ts |
| run client | 2 | client.ts |
| delete log | 2 | client.ts |
| unsafe run client | 3 | client.ts |
| exit with error | 3 | client.ts |
| run client failure | 3 | client.ts |
| create task description | 3 | commands-creator.ts |
| create commands | 2 | commands-creator.ts |
| sleep | 1 | create-task-action.ts |
| interactive prompt | 2 | create-task-action.ts |
| log task statistics | 3 | create-task-action.ts |
| to on result flags | 4 | create-task-action.ts |
| as jsonlog | 2 | create-task-action.ts |
| debug context | 2 | create-task-action.ts |
| to command line action | 4 | create-task-action.ts |
| capitalize word | 2 | create-task-action.ts |
| to batch step action | 4 | create-task-action.ts |
| make message | 2 | create-task-action.ts |
| create task action | 3 | create-task-action.ts |
| batch step action | 3 | create-task-action.ts |
| on result flags | 3 | create-task-action.ts |
| build ctx | 2 | create-task-action.ts |
| create data id | 3 | data-value-utils.ts |
| set data value | 3 | data-value-utils.ts |
| with memory prefix | 3 | data-value-utils.ts |
| split data key | 3 | data-value-utils.ts |
| get specific data property | 4 | data-value-utils.ts |
| get data property | 3 | data-value-utils.ts |
| get supported property | 3 | data-value-utils.ts |
| is falsy | 2 | data-value-utils.ts |
| is truthy | 2 | data-value-utils.ts |
| get error message | 3 | execution.ts |
| to status | 2 | execution.ts |
| parse json | 2 | execution.ts |
| parse yaml | 2 | execution.ts |
| prepare csv | 2 | execution.ts |
| parse csv | 2 | execution.ts |
| force string | 2 | execution.ts |
| execute shell command line | 4 | execution.ts |
| append var to file | 4 | execution.ts |
| write var to file | 4 | execution.ts |
| execute command line | 3 | execution.ts |
| execute command line failed category | 5 | execution.ts |
| command line input | 3 | execution.ts |
| execute command line failure | 4 | execution.ts |
| execute command line success | 4 | execution.ts |
| execute command line result | 4 | execution.ts |
| json parsing result | 3 | execution.ts |
| csv parsing result | 3 | execution.ts |
| get array | 2 | expand-batch.ts |
| expand command | 2 | expand-batch.ts |
| merge expanded command line inputs | 5 | expand-batch.ts |
| expand batch0 | 2 | expand-batch.ts |
| expand batch1 | 2 | expand-batch.ts |
| expand batch2 | 2 | expand-batch.ts |
| expand batch step | 3 | expand-batch.ts |
| expanded command line inputs | 4 | expand-batch.ts |
| command local vars | 3 | expand-batch.ts |
| is single line | 3 | field-validation.ts |
| safe parse field | 3 | field-validation.ts |
| read yaml | 2 | file-io.ts |
| loading status | 2 | file-io.ts |
| format message | 2 | format-message.ts |
| validation error | 2 | format-message.ts |
| id generator | 2 | id-generator.ts |
| json\_mask | 1 | json-mask.d.ts |
| log message | 2 | log-model.ts |
| console like format | 3 | logging.ts |
| current task warn | 3 | logging.ts |
| replay log to console | 4 | logging.ts |
| succeed | 1 | railway.ts |
| will fail | 2 | railway.ts |
| with default | 2 | railway.ts |
| map1 | 1 | railway.ts |
| and then | 2 | railway.ts |
| success | 1 | railway.ts |
| failure | 1 | railway.ts |
| result | 1 | railway.ts |
| keep alpha numeric | 3 | string-utils.ts |
| dasherize title | 2 | string-utils.ts |
| is string array | 3 | string-utils.ts |
| escape space | 2 | templating.ts |
| create template | 2 | templating.ts |
| get expanded name | 3 | templating.ts |
| get string from template | 4 | templating.ts |
| get command lines | 3 | templating.ts |
| get single command line | 4 | templating.ts |
| force json | 2 | templating.ts |
| get template data | 3 | templating.ts |
| merge extra data | 3 | templating.ts |
| merge template context | 3 | templating.ts |

## Popularity of sequence of words

Table showing the popularity of some n-gram in the code base

| n-gram | Frequency |
| ----------- | --------- |
| command | 36 |
| get | 24 |
| line | 20 |
| data | 14 |
| expand | 10 |
| create | 10 |
| task | 10 |
| to | 8 |
| is | 8 |
| as | 8 |
| result | 8 |
| execute | 8 |
| batch | 8 |
| string | 7 |
| step | 7 |
| build | 7 |
| parse | 6 |
| merge | 6 |
| to | 6 |
| template | 6 |
| on | 6 |
| expanded | 6 |
| any | 6 |
| property | 5 |
| parse | 5 |
| model | 5 |
| log | 5 |
| json | 5 |
| with | 4 |
| unsafe | 4 |
| safe | 4 |
| on | 4 |
| force | 4 |
| execute | 4 |
| basic | 4 |
| var | 4 |
| single | 4 |
| shell | 4 |
| run | 4 |
| parsing | 4 |
| message | 4 |
| failure | 4 |
| error | 4 |
| csv | 4 |
| client | 4 |
| action | 4 |
| validation | 3 |
| success | 3 |
| id | 3 |
| execution | 3 |
| enum | 3 |
| context | 3 |
| commands | 3 |
| array | 3 |
| write | 2 |
| will | 2 |
| split | 2 |
| set | 2 |
| run | 2 |
| replay | 2 |
| read | 2 |
| prepare | 2 |
| make | 2 |
| log | 2 |
| keep | 2 |
| jsonish | 2 |
| interactive | 2 |
| format | 2 |
| exit | 2 |
| escape | 2 |
| describe | 2 |
| delete | 2 |
| debug | 2 |
| dasherize | 2 |
| current | 2 |
| console | 2 |
| capitalize | 2 |
| append | 2 |
| and | 2 |
| yaml | 2 |
| with | 2 |
| value | 2 |
| supported | 2 |
| status | 2 |
| specific | 2 |
| schema | 2 |
| runtime | 2 |
| or | 2 |
| memory | 2 |
| local | 2 |
| loading | 2 |
| like | 2 |
| inputs | 2 |
| from | 2 |
| flags | 2 |
| file | 2 |
| failed | 2 |
| extra | 2 |
| ctx | 2 |
| basic | 2 |
| alpha | 2 |
35 changes: 30 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,47 @@ in all your interactions with the project.

The following commands should get you started:

Setup an alias:

```
alias broth='npx baldrick-broth'
```

or if you prefer to always use the latest version:

```
alias broth='npx baldrick-broth@latest'
```

Install the `npm` dependencies:

```bash
yarn install
npx baldrick-broth@latest test zest
```

Run the `zest` unit tests:

```bash
broth test spec
```

Run the `pest` CLI integration tests:

```bash
broth test pest
```

A list of [most used commands](MAINTENANCE.md) is available:

```bash
npx baldrick-broth@latest
broth
```

Please keep an eye on test coverage, bundle size and documentation.
When you are ready for a pull request:

```bash
npx baldrick-broth@latest release ready
broth release ready
```

You can also simulate [Github actions](https://docs.github.com/en/actions)
Expand All @@ -43,7 +68,7 @@ ubuntu-latest=node:16-buster`
To run the pipeline:

```bash
npx baldrick-broth@latest github act
broth github act
```

## Pull Request Process
Expand All @@ -57,5 +82,5 @@ This would be done by the main maintainers of the project. Locally for now as
updates are pretty infrequent, and some of tests have to be done manually.

```bash
npx baldrick-broth@latest release publish
broth release publish
```
Loading

0 comments on commit 6b2b28a

Please sign in to comment.