Skip to content

Commit

Permalink
chore:Update dependencies and migrate to broth (#12)
Browse files Browse the repository at this point in the history
* Adds baldrick-broth yaml file

* Normalize using scaffold norm

* Updates package.json

* Updates dependencies

* Adds commander dependency

* Adds peerDependency

* Delete old tests

* Generate code vocabulary and internal markdown

* Deletes some deprecated files

* Adds pest-sepc

* Adds snapshot

* Capture typedoc markdown snaphot

* Adds pest coverage for parse ngram

* Adds local json schema for broth

* Increment version

* After linting and refactoring

* github workflow do not rely on broth and have if condition

* generate package-json uses new variable format

* Uses bash if in run for githup action

* Create temp folder for maim workflow

* Uses broth in github action as the snaphots are slightly different otherwise

* Save internal for pest to temp

* Is cat of md file working

* Adds test for pest

* Run tests in ready  pr

* Adds not supported when tests do not exist

* Upgrades dependencies

* Adds task for PR and update dependency

* Use single quote for pr create
  • Loading branch information
olih authored Mar 29, 2023
1 parent 8e6679e commit d4da4f4
Show file tree
Hide file tree
Showing 62 changed files with 3,221 additions and 8,596 deletions.
3 changes: 0 additions & 3 deletions .aliases.zsh

This file was deleted.

3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ body:
label: On which platform(s) do you have the issue ?
multiple: true
options:
- Any
- Node.js
- Typescript node
- Firefox
Expand All @@ -47,5 +48,5 @@ body:
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be
automatically formatted into code, so no need for backticks.
automatically formatted into code, so no need for back ticks.
render: shell
13 changes: 8 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ Fixes: # (issue)

## Code check

- [ ] `yarn ready` does not show any concerning issues
- [ ] the project can be built
- [ ] the documentation has been updated
- [ ] the version has been updated in `package.json`
- [x] `npx baldrick-broth@latest release ready` does not show any
concerning issues

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)

- [ ] Safe refactoring (non-breaking change which improves the code or
documentation)

- [ ] New feature (non-breaking change which adds functionality)

- [ ] Breaking change (fix or feature that would cause existing
Expand All @@ -24,10 +25,12 @@ Fixes: # (issue)
- [ ] improve consistency
- [ ] improve security
- [ ] improve documentation
- [ ] improve code
- [ ] reduce risk for unfamiliar tasks
- [ ] automate repetitive tasks

## How Has This Been Tested

- [ ] Unit tests
- [x] Unit tests
- [ ] Automated browser tests
- [ ] Manual tests
38 changes: 27 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,41 @@ jobs:
strategy:
matrix:
node:
- 14.x
- 16.x
- 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
- name: Version
run: yarn release:check
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Pest
path: report/*.pest.mocha.json
reporter: mocha-json
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
node_modules/
dist/
report/
.message
temp/
.message
.todo.yaml
6 changes: 6 additions & 0 deletions .remarkrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
settings:
bullet: "*"
plugins:
- remark-preset-lint-consistent
- remark-preset-lint-recommended
- remark-preset-lint-markdown-style-guide
58 changes: 56 additions & 2 deletions .vscode/baldrick.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"scope": "javascript,typescript",
"prefix": "jest-regression-inline",
"body": [
"import { $1 } from '../src/$TM_FILENAME_BASE';",
"import { $1 } from '../src/${TM_FILENAME_BASE/.test//}';",
"",
"describe('$TM_FILENAME_BASE', () => {",
"describe('${TM_FILENAME_BASE/.test//}', () => {",
" it('should provide', () => {",
" const opts = {};",
" const actual = $1(opts);",
Expand All @@ -48,5 +48,59 @@
" JSON.stringify(value, null, 2);"
],
"description": "stringify an object"
},
"error-message-id": {
"scope": "javascript,typescript",
"prefix": "error-message-id",
"body": [
"($RANDOM)"
],
"description": "Generate an error message id"
},
"add decision": {
"scope": "markdown,md",
"prefix": "add decision",
"body": [
"## Title Fixme",
"",
"* MUST-HAVE.",
"* Created: ${CURRENT_MONTH_NAME} ${CURRENT_YEAR}",
"",
"### Context and Problem Statement",
"",
"> Fixme",
"",
"### Decision Drivers",
"",
"* Fixme",
"",
"### Considered Options",
"",
"* Fixme",
"",
"### Decision Outcome",
"",
"Chosen option: Fixme",
"",
"#### Positive Consequences",
"",
"* Fixme",
"",
"#### Negative Consequences",
"",
"* Fixme",
"",
"### Pros and Cons of the Options",
"",
"#### Option title fixme",
"",
"Description fixme",
"",
"* Pros: ",
" * Fixme",
"* Cons:",
" * Fixme"
],
"description": "Adds architecture decision record"
}
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"makefile.extensionOutputFolder": "./.vscode",
"yaml.schemas": {
"./script/schema/project.schema.json": "script/data/project.yaml",
"https://raw.githubusercontent.com/flarebyte/baldrick-reserve/main/reserve-schema/ts-broth.schema.json": "baldrick-broth.yaml"
}
}
12 changes: 6 additions & 6 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ project may be further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at
[Flarebyte.com](https://github.com/flarebyte). The project team will review
and investigate all complaints, and will respond in a way that it deems
appropriate to the circumstances. The project team is obligated to maintain
confidentiality with regard to the reporter of an incident. Further details
of specific enforcement policies may be posted separately.
reported by contacting the project team at [](https://github.com/). The
project team will review and investigate all complaints, and will respond in
a way that it deems appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an
incident. Further details of specific enforcement policies may be posted
separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
Expand Down
17 changes: 7 additions & 10 deletions CODE_VOCABULARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

> Overview of the code base vocabulary for baldrick-doc-ts
This document has been generated automatically by
[baldrick-doc-ts](https://github.com/flarebyte/baldrick-doc-ts)
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 |
| --------------------------------- | ---------- | ---------------------- |
| run client | 2 | client.ts |
Expand Down Expand Up @@ -66,6 +64,7 @@ Table of vocabulary found in the code base
| parse markdown | 2 | markdown.ts |
| section to string | 3 | markdown.ts |
| markdown to string | 3 | markdown.ts |
| supported feature | 2 | model.ts |
| generate typedoc action opts | 4 | model.ts |
| parse action opts | 3 | model.ts |
| generate typedoc raw opts | 4 | model.ts |
Expand All @@ -75,14 +74,13 @@ Table of vocabulary found in the code base
| md section | 2 | model.ts |
| md document | 2 | model.ts |
| cmd option | 2 | model.ts |
| term formatter params | 3 | model.ts |
| err term formatter params | 4 | model.ts |
| runner context | 2 | model.ts |
| supported feature | 2 | model.ts |
| term formatter kind | 3 | model.ts |
| term formatter format | 3 | model.ts |
| term formatter params | 3 | model.ts |
| err term formatter params | 4 | model.ts |
| term formatter | 2 | model.ts |
| err term formatter | 3 | model.ts |
| runner context | 2 | model.ts |
| generate typedoc action | 3 | model.ts |
| parse action | 2 | model.ts |
| create doc dir | 3 | parse-action.ts |
Expand All @@ -101,7 +99,7 @@ Table of vocabulary found in the code base
| project vocabulary | 2 | parser-model.ts |
| vocabulary ngram | 2 | parser-model.ts |
| project ngram | 2 | parser-model.ts |
| simplify obj | 2 | term-formatter.ts |
| simplify object | 2 | term-formatter.ts |
| simplify json | 2 | term-formatter.ts |
| to jsonish | 2 | term-formatter.ts |
| basic formatter | 2 | term-formatter.ts |
Expand Down Expand Up @@ -131,7 +129,6 @@ Table of vocabulary found in the code base
## Popularity of sequence of words

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

| n-gram | Frequency |
| ------------ | --------- |
| to | 30 |
Expand Down Expand Up @@ -230,4 +227,4 @@ Table showing the popularity of some n-gram in the code base
| count | 2 |
| commander | 2 |
| camel | 2 |
| alias | 2 |
| alias | 2 |
44 changes: 30 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,58 @@ 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
yarn test
```

A list of [most used commands](MAINTENANCE.md) is available:
Run the `zest` unit tests:

```bash
yarn h
broth test spec
```

Please keep an eye on test coverage, bundle size and documentation.
When you are ready for a pull request:
Run the `pest` CLI integration tests:

```bash
broth test pest
```

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

```bash
yarn ready
broth
```

And please check that building is still working:
Please keep an eye on test coverage, bundle size and documentation.
When you are ready for a pull request:

```bash
yarn build
broth release ready
```

You can also simulate [Github actions](https://docs.github.com/en/actions)
locally with [act](https://github.com/nektos/act).
You will need to setup `.actrc` with the node.js docker image `-P
ubuntu-latest=node:14-buster`
ubuntu-latest=node:16-buster`

To run the pipeline:

```bash
act
broth github act
```

## Pull Request Process
Expand All @@ -62,9 +81,6 @@ act
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.

Assuming you have zsh installed, you can just do:

```bash
source .aliases.zsh
bpub
broth release publish
```
11 changes: 11 additions & 0 deletions DECISIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Architecture decision records

An [architecture
decision](https://cloud.google.com/architecture/architecture-decision-records)
is a software design choice that evaluates:

- a functional requirement (features).
- a non-functional requirement (technologies, methodologies, libraries).

The purpose is to understand the reasons behind the current architecture, so
they can be carried-on or re-visited in the future.
Loading

0 comments on commit d4da4f4

Please sign in to comment.