Skip to content

Commit

Permalink
Merge pull request #2 from herbsjs/master
Browse files Browse the repository at this point in the history
Update fork
  • Loading branch information
m7vicente authored Feb 15, 2022
2 parents 4e31280 + 3d7190c commit 14565c6
Show file tree
Hide file tree
Showing 22 changed files with 5,978 additions and 1,298 deletions.
5 changes: 3 additions & 2 deletions .github/linters/.eslintrc.json → .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 2018
"ecmaVersion": 2018,
"requireConfigFile": false
},
"rules": {
"semi": ["error", "never"],
Expand Down
17 changes: 17 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ We're thrilled that you'd like to contribute to this project. Your help is essen
1. Push to your fork and [submit a pull request][pr]
1. Pat your self on the back and wait for your pull request to be reviewed and merged.

**Commit Structure**
All the Herbs organization libraries uses seemantic release and commitizen to :

- Generate changelog
- Control version
- Publish to npm via github actions
Please use this format for commit messages (https://semver.org/).

To help with this task we have implemented the commitizen to all libraries, just follow those steps:

- `npm install -g commitizen`
- Write a lot of good code to contribute to herbs 🌿
- `git add yourChanges`
- `git cz` or `npm run commit` or `npx cz` instead `git commit`
- `git push`


Here are a few things you can do that will increase the likelihood of your pull request being accepted:

- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CD Build

on:
push:
branches: [ master ]

jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-18.04

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install Packages
run: npm ci

- name: Installing dependencies
run: npm i --ignore-scripts

- name: Build Step
env:
CI: ""
run: npm run build --if-present

- name: Running Linter - ESLint
run: npm run lint

- name: Run Semantic Release
run: npx semantic-release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI build

on:
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Installing dependencies
run: npm i --ignore-scripts
- name: Running tests
run: |
npm test
npx nyc --reporter=lcov npm test && npx codecov
env:
CI: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2

- name: Running Linter - ESLint
run: npm run lint

62 changes: 0 additions & 62 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/on_pull_request.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/on_push.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,4 @@ dist
.yarn/build-state.yml
.pnp.*
.editorconfig
/.eslintrc.json
.prettierrc
24 changes: 24 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"branches": "master",
"repositoryUrl": "https://github.com/herbsjs/suma2text",
"debug": "true",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"python.pythonPath": "C:\\Python38\\python.exe"
"python.pythonPath": "C:\\Python38\\python.exe",
"workbench.colorCustomizations": {
"editorRuler.foreground": "#4e2d38",
"activityBar.background": "#312F0E",
"titleBar.activeBackground": "#444113",
"titleBar.activeForeground": "#FBFBF3"
}
}
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## [1.1.1](https://github.com/herbsjs/suma2text/compare/v1.1.0...v1.1.1) (2022-02-15)


### Bug Fixes

* **suma2text.js:** adding an `if` to check if process exists to emit a warning ([e51fb5c](https://github.com/herbsjs/suma2text/commit/e51fb5cbe1dbea47b2a0f86c8caf5b00068db71e)), closes [#28](https://github.com/herbsjs/suma2text/issues/28)

# [1.1.0](https://github.com/herbsjs/suma2text/compare/v1.0.0...v1.1.0) (2022-01-15)


### Bug Fixes

* **languagepackage:** fix a bug in language package, that was happening when calls suma text ([f3e141a](https://github.com/herbsjs/suma2text/commit/f3e141ab9e51f900dff03a715458f294ebe166bc)), closes [#5](https://github.com/herbsjs/suma2text/issues/5)


### Features

* **es-es language:** add es-ES language ([8c95e4e](https://github.com/herbsjs/suma2text/commit/8c95e4e540ad551386721a61cfe05777c9514135))

# 1.0.0 (2021-06-23)


### Features

* change library to herbs organization ([2cb1ccd](https://github.com/herbsjs/suma2text/commit/2cb1ccdf91f9942363d8146e0edd979258b74092))
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ suma2text it's a tool to parse error codes to string, you can use in all your so
Suma and suma2text native, you can translate all suma error codes, one by one or all entity error array.

### Installing

$ npm install suma2text
```
$ npm install @herbsjs/suma2text
```

### Using

If your use is simple, you can just require suma2text, and execute this configure function, by default the language will be English from the united states (ISO CODE en-US).

```javascript
const suma2text = require('suma2text')()
const suma2text = require('@herbsjs/suma2text')()

const suma2text.toText({ notDefined: true })
/*
Expand All @@ -28,7 +29,7 @@ const suma2text.toText({ notDefined: true })
You also can add a different language or customize the existing, just pass the following parameters on require function.

```javascript
const suma2text = require('suma2text')({
const suma2text = require('@herbsjs/suma2text')({
useDefault: 'ts-ME',
languages: [{
name: 'ts-ME',
Expand Down Expand Up @@ -80,7 +81,7 @@ const suma2text.toText({ notGreaterThan: 10 }, 'en-US')
*/

```
But, the perfect choice is to use whit herbs.js, all suma codes are integrated into here, and we made for it, you can pass all your validation in a suma2text class, validate, and just show the results in your presentation layer, let's see how.
But, the perfect choice is to use with herbs.js, all suma codes are integrated into here, and we made for it, you can pass all your validation in a suma2text class, validate, and just show the results in your presentation layer, let's see how.
```javascript
const User =
entity('User', {
Expand All @@ -94,7 +95,7 @@ user.plan.monthlyCost = true
user.validate()
user.errors // { name: [ {wrongType: 'String'} ], plan: { monthlyCost: [ {wrongType: 'Number'} } }

const suma2text = require('suma2text')()
const suma2text = require('@herbsjs/suma2text')()

const englishUserErrors = suma2text.errorsToText(user.errors)
/*
Expand All @@ -108,9 +109,9 @@ const englishUserErrors = suma2text.errorsToText(user.errors)
const portugueseUserErrors = suma2text.errorsToText(user.errors, 'pt-BR')
/*
{
name: ['Foi definido um tipo incorreto, o valor esperado era Texto']
name: ['Tipo incorreto, o valor esperado era Texto']
plan: {
monthlyCost: ['Foi definido um tipo incorreto, o valor esperado era Plan']
monthlyCost: ['Tipo incorreto, o valor esperado era Plan']
}
}
*/
Expand All @@ -129,7 +130,7 @@ Language localisation:
- [ ] Italian
- [ ] Korean
- [X] Portuguese ('pt-BR')
- [ ] Spanish
- [X] Spanish
- [ ] Swedish
- [ ] Tamil

Expand Down
Loading

0 comments on commit 14565c6

Please sign in to comment.