mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-21 13:09:16 +00:00
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
. "$(dirname -- "$0")/_/husky.sh"
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
npx --no-install commitlint --edit "$1"
|
npx --no -- commitlint --edit
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
. "$(dirname -- "$0")/_/husky.sh"
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
yarn run format:write && git add .
|
yarn run fmt.staged
|
||||||
|
|||||||
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"conventionalCommits.scopes": ["hook"]
|
||||||
|
}
|
||||||
@@ -1,3 +1,10 @@
|
|||||||
nodeLinker: node-modules
|
nodeLinker: node-modules
|
||||||
|
|
||||||
npmPublishRegistry: 'https://registry.npmjs.org'
|
npmPublishRegistry: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
- path: .yarn/plugins/@yarnpkg/plugin-postinstall.cjs
|
||||||
|
spec: 'https://raw.githubusercontent.com/gravitywelluk/yarn-plugin-postinstall/master/bundles/%40yarnpkg/plugin-postinstall.js'
|
||||||
|
|
||||||
yarnPath: .yarn/releases/yarn-3.3.0.cjs
|
yarnPath: .yarn/releases/yarn-3.3.0.cjs
|
||||||
|
postinstall: npx husky install
|
||||||
|
|||||||
21
CHANGELOG.md
21
CHANGELOG.md
@@ -2,6 +2,27 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
## 0.2.0-alpha.0 (2022-12-01)
|
||||||
|
|
||||||
|
|
||||||
|
### ⚠ BREAKING CHANGES
|
||||||
|
|
||||||
|
* 🧨 NO
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* (🎸) add onClick prop to component ([4ae3898](https://github.com/leifermendez/bot-whatsapp/commit/4ae389846d38c133f6bb2129ae373eed39d9d08d))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **ci:** ci ([f55cfae](https://github.com/leifermendez/bot-whatsapp/commit/f55cfae6e4ccc1df949212999406680020d27f9c))
|
||||||
|
* **ci:** ci ([671c5b3](https://github.com/leifermendez/bot-whatsapp/commit/671c5b37f33360e8cb754625b8dd6e83bce9014d))
|
||||||
|
* **linter:** update linter and commitlint ([70a94ab](https://github.com/leifermendez/bot-whatsapp/commit/70a94ab2c6f8e4122780c77bc3a621944883e621))
|
||||||
|
|
||||||
|
|
||||||
|
* (💍) Is justa test! ([37d04e9](https://github.com/leifermendez/bot-whatsapp/commit/37d04e9e89d3f01fdc367654ba60fb11ab2614c4))
|
||||||
|
|
||||||
## 0.1.0 (2022-11-29)
|
## 0.1.0 (2022-11-29)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
__Requerimientos:__
|
__Requerimientos:__
|
||||||
- Node v16 o superior __[descargar node](https://nodejs.org/es/download/)__
|
- Node v16 o superior __[descargar node](https://nodejs.org/es/download/)__
|
||||||
- __[Yarn](https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable)__ como gestor de paquetes. En el link conseguiras las intrucciones para instalar yarn.
|
- __[Yarn](https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable)__ como gestor de paquetes. En el link conseguiras las intrucciones para instalar yarn.
|
||||||
|
- __[VSCode](https://code.visualstudio.com/download)__ (recomendado): Editor de codigo con plugins
|
||||||
|
- __[Conventional Commits](https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits&ssr=false#overview)__ (plugin-vscode) este plugin te ayudara a crear commit semantico.
|
||||||
- Se usara la rama __dev__ *(https://github.com/leifermendez/bot-whatsapp/tree/dev)* como rama principal hasta que se haga oficialmente el lanzamiento de la V2
|
- Se usara la rama __dev__ *(https://github.com/leifermendez/bot-whatsapp/tree/dev)* como rama principal hasta que se haga oficialmente el lanzamiento de la V2
|
||||||
|
|
||||||
>💡 Se usa la version 3.3.0 o superior de Yarn para establecer esta version simplemente ejecuta el siguiente comando: `yarn set version 3.3.0`
|
### 🚀 Iniciando
|
||||||
|
|
||||||
__Clonar repo rama dev__
|
__Clonar repo rama dev__
|
||||||
```
|
```
|
||||||
@@ -14,14 +16,7 @@ git clone --branch dev https://github.com/leifermendez/bot-whatsapp
|
|||||||
__Instalar dependencias__
|
__Instalar dependencias__
|
||||||
```
|
```
|
||||||
cd bot-whatsapp
|
cd bot-whatsapp
|
||||||
yarn set version 3.3.0
|
|
||||||
yarn install
|
yarn install
|
||||||
npx husky install && npx prettier --write .
|
|
||||||
```
|
|
||||||
> __ATENCIÓN__ Si esta estas en ubuntu/linux ejecutar lo siguiente comandos adicionales.
|
|
||||||
|
|
||||||
```sheell
|
|
||||||
chmod ug+x .husky/*
|
|
||||||
```
|
```
|
||||||
|
|
||||||
__Compilar (build)__
|
__Compilar (build)__
|
||||||
@@ -30,7 +25,9 @@ Para compilar la aplicación es necesario ejecutar, eso te genera dentro de pack
|
|||||||
```
|
```
|
||||||
yarn build
|
yarn build
|
||||||
```
|
```
|
||||||
Luego de ejecutar el comando conseguiras algo como lo siguiente. Esas carpetas lib NO se suben al repo estan ignoradas.
|
|
||||||
|
> (Solo informativo) Luego de ejecutar el comando conseguiras algo como lo siguiente. Esas carpetas lib NO se suben al repo ya estan ignoradas.
|
||||||
|
|
||||||
```
|
```
|
||||||
packages/bot/lib
|
packages/bot/lib
|
||||||
packages/cli/lib
|
packages/cli/lib
|
||||||
@@ -39,16 +36,20 @@ packages/provider/lib
|
|||||||
```
|
```
|
||||||
|
|
||||||
__Linking__
|
__Linking__
|
||||||
|
|
||||||
|
Es el proceso que se realiza para poder hacer uso de los paquetes compilados en tu local.
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn link.dist
|
yarn link.dist
|
||||||
```
|
```
|
||||||
|
|
||||||
__Example-app__
|
__Example-app__
|
||||||
|
Se ejecuta el CLI (Command Line Interface) para ayudarte a crear un app-bot de ejemplo
|
||||||
```
|
```
|
||||||
yarn run cli
|
yarn run cli
|
||||||
```
|
```
|
||||||
|
|
||||||
Abrir carpeta example-app-base
|
Abrir carpeta __example-app-base__ y ejecutar
|
||||||
```
|
```
|
||||||
npm link @bot-whatsapp/bot -S
|
npm link @bot-whatsapp/bot -S
|
||||||
npm link @bot-whatsapp/provider -S
|
npm link @bot-whatsapp/provider -S
|
||||||
@@ -65,12 +66,7 @@ __commit:__ Los commit son semanticos esto quiere decir que deben cumplir un sta
|
|||||||
__push:__ Cada push ejecutar `yarn run test` el cual ejecuta los test internos que tienen que cumplir con __95% de cobertura__.
|
__push:__ Cada push ejecutar `yarn run test` el cual ejecuta los test internos que tienen que cumplir con __95% de cobertura__.
|
||||||
|
|
||||||
|
|
||||||
|
> Documento en constaten actualización....
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
------
|
------
|
||||||
- [Discord](https://link.codigoencasa.com/DISCORD)
|
- [Discord](https://link.codigoencasa.com/DISCORD)
|
||||||
|
|||||||
8
config/banner.rollup.json
Normal file
8
config/banner.rollup.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"banner.output": [
|
||||||
|
"/** \n",
|
||||||
|
"* NO TOCAR ESTE ARCHIVO: Es generado automaticamente, si sabes lo que haces adelante ;)\n",
|
||||||
|
"* de lo contrario mejor ir a la documentacion o al servidor de discord link.codigoencasa.com/DISCORD\n",
|
||||||
|
"*/"
|
||||||
|
]
|
||||||
|
}
|
||||||
16
package.json
16
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@bot-whatsapp/root",
|
"name": "@bot-whatsapp/root",
|
||||||
"version": "0.1.1",
|
"version": "0.2.0-alpha.0",
|
||||||
"description": "Bot de wahtsapp open source para MVP o pequeños negocios",
|
"description": "Bot de wahtsapp open source para MVP o pequeños negocios",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
"database:rollup": "rollup --config ./packages/database/rollup-database.config.js",
|
"database:rollup": "rollup --config ./packages/database/rollup-database.config.js",
|
||||||
"format:check": "prettier --check ./packages",
|
"format:check": "prettier --check ./packages",
|
||||||
"format:write": "prettier --write ./packages",
|
"format:write": "prettier --write ./packages",
|
||||||
|
"fmt.staged": "pretty-quick --staged",
|
||||||
"lint:check": "eslint ./packages",
|
"lint:check": "eslint ./packages",
|
||||||
"lint:fix": "eslint --fix ./packages",
|
"lint:fix": "eslint --fix ./packages",
|
||||||
"build": "yarn run cli:rollup && yarn run bot:rollup && yarn run provider:rollup && yarn run database:rollup",
|
"build": "yarn run cli:rollup && yarn run bot:rollup && yarn run provider:rollup && yarn run database:rollup",
|
||||||
@@ -61,16 +62,16 @@
|
|||||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
"@rollup/plugin-replace": "^5.0.1",
|
"@rollup/plugin-replace": "^5.0.1",
|
||||||
"c8": "^7.12.0",
|
"c8": "^7.12.0",
|
||||||
"commitizen": "^4.2.5",
|
"conventional-changelog": "^3.1.25",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"cz-conventional-changelog": "^3.3.0",
|
|
||||||
"eslint": "^8.26.0",
|
"eslint": "^8.26.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"fs-extra": "^11.1.0",
|
"fs-extra": "^11.1.0",
|
||||||
"git-cz": "^4.9.0",
|
"git-cz": "^4.9.0",
|
||||||
"husky": "^8.0.2",
|
"husky": "^8.0.2",
|
||||||
"only-allow": "^1.1.1",
|
"only-allow": "^1.1.1",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.8.0",
|
||||||
|
"pretty-quick": "^3.1.3",
|
||||||
"prompts": "^2.4.2",
|
"prompts": "^2.4.2",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rollup": "^3.2.3",
|
"rollup": "^3.2.3",
|
||||||
@@ -85,10 +86,5 @@
|
|||||||
"npm": "please-use-yarn",
|
"npm": "please-use-yarn",
|
||||||
"yarn": ">=3"
|
"yarn": ">=3"
|
||||||
},
|
},
|
||||||
"author": "Leifer Mendez <leifer33@gmail.com>",
|
"author": "Leifer Mendez <leifer33@gmail.com>"
|
||||||
"config": {
|
|
||||||
"commitizen": {
|
|
||||||
"path": "git-cz"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
const banner = require('../../config/banner.rollup.json')
|
||||||
const commonjs = require('@rollup/plugin-commonjs')
|
const commonjs = require('@rollup/plugin-commonjs')
|
||||||
const { nodeResolve } = require('@rollup/plugin-node-resolve')
|
const { nodeResolve } = require('@rollup/plugin-node-resolve')
|
||||||
const { join } = require('path')
|
const { join } = require('path')
|
||||||
@@ -7,6 +8,7 @@ const PATH = join(__dirname, 'lib', 'bundle.bot.cjs')
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
input: join(__dirname, 'index.js'),
|
input: join(__dirname, 'index.js'),
|
||||||
output: {
|
output: {
|
||||||
|
banner: banner['banner.output'].join(''),
|
||||||
file: PATH,
|
file: PATH,
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
const banner = require('../../config/banner.rollup.json')
|
||||||
const commonjs = require('@rollup/plugin-commonjs')
|
const commonjs = require('@rollup/plugin-commonjs')
|
||||||
const { nodeResolve } = require('@rollup/plugin-node-resolve')
|
const { nodeResolve } = require('@rollup/plugin-node-resolve')
|
||||||
const { join } = require('path')
|
const { join } = require('path')
|
||||||
@@ -7,6 +8,7 @@ const PATH = join(__dirname, 'lib', 'cli', 'bundle.cli.cjs')
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
input: join(__dirname, 'index.js'),
|
input: join(__dirname, 'index.js'),
|
||||||
output: {
|
output: {
|
||||||
|
banner: banner['banner.output'].join(''),
|
||||||
file: PATH,
|
file: PATH,
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
const banner = require('../../config/banner.rollup.json')
|
||||||
const commonjs = require('@rollup/plugin-commonjs')
|
const commonjs = require('@rollup/plugin-commonjs')
|
||||||
const { join } = require('path')
|
const { join } = require('path')
|
||||||
|
|
||||||
@@ -5,6 +6,7 @@ module.exports = [
|
|||||||
{
|
{
|
||||||
input: join(__dirname, 'src', 'mock', 'index.js'),
|
input: join(__dirname, 'src', 'mock', 'index.js'),
|
||||||
output: {
|
output: {
|
||||||
|
banner: banner['banner.output'].join(''),
|
||||||
file: join(__dirname, 'lib', 'mock', 'index.cjs'),
|
file: join(__dirname, 'lib', 'mock', 'index.cjs'),
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
},
|
},
|
||||||
@@ -13,6 +15,7 @@ module.exports = [
|
|||||||
{
|
{
|
||||||
input: join(__dirname, 'src', 'mongo', 'index.js'),
|
input: join(__dirname, 'src', 'mongo', 'index.js'),
|
||||||
output: {
|
output: {
|
||||||
|
banner: banner['banner.output'].join(''),
|
||||||
file: join(__dirname, 'lib', 'mongo', 'index.cjs'),
|
file: join(__dirname, 'lib', 'mongo', 'index.cjs'),
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
const banner = require('../../config/banner.rollup.json')
|
||||||
const { join } = require('path')
|
const { join } = require('path')
|
||||||
const commonjs = require('@rollup/plugin-commonjs')
|
const commonjs = require('@rollup/plugin-commonjs')
|
||||||
|
|
||||||
@@ -5,6 +6,7 @@ module.exports = [
|
|||||||
{
|
{
|
||||||
input: join(__dirname, 'src', 'web-whatsapp', 'index.js'),
|
input: join(__dirname, 'src', 'web-whatsapp', 'index.js'),
|
||||||
output: {
|
output: {
|
||||||
|
banner: banner['banner.output'].join(''),
|
||||||
file: join(__dirname, 'lib', 'web-whatsapp', 'index.cjs'),
|
file: join(__dirname, 'lib', 'web-whatsapp', 'index.cjs'),
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
},
|
},
|
||||||
@@ -13,6 +15,7 @@ module.exports = [
|
|||||||
{
|
{
|
||||||
input: join(__dirname, 'src', 'twilio', 'index.js'),
|
input: join(__dirname, 'src', 'twilio', 'index.js'),
|
||||||
output: {
|
output: {
|
||||||
|
banner: banner['banner.output'].join(''),
|
||||||
file: join(__dirname, 'lib', 'twilio', 'index.cjs'),
|
file: join(__dirname, 'lib', 'twilio', 'index.cjs'),
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
},
|
},
|
||||||
@@ -21,6 +24,7 @@ module.exports = [
|
|||||||
{
|
{
|
||||||
input: join(__dirname, 'src', 'mock', 'index.js'),
|
input: join(__dirname, 'src', 'mock', 'index.js'),
|
||||||
output: {
|
output: {
|
||||||
|
banner: banner['banner.output'].join(''),
|
||||||
file: join(__dirname, 'lib', 'mock', 'index.cjs'),
|
file: join(__dirname, 'lib', 'mock', 'index.cjs'),
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user