Skip to content

Commit 6feec43

Browse files
authored
fix: media manager, error response schema parsings and other minor fixes (#28)
1 parent 533406d commit 6feec43

File tree

34 files changed

+425
-4968
lines changed

34 files changed

+425
-4968
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ errors.log
77
.eslintrc.js
88
packages/**
99
apps/**
10+
template/**
Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
name: Check Build
1+
name: Build and Lint
22

33
on:
44
push:
55
branches-ignore:
66
- "master"
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
9-
lint-and-build:
13+
build-and-lint:
1014
timeout-minutes: 10
1115
runs-on: ubuntu-latest
1216
steps:
@@ -26,6 +30,12 @@ jobs:
2630
- name: Install Dependencies
2731
run: pnpm install --frozen-lockfile
2832

33+
# need to build before lint check because packages is using interlinked workspace dependencies
34+
- name: Build the packages
35+
id: build
36+
if: ${{ success() && !failure() }}
37+
run: pnpm build
38+
2939
- name: Lint
3040
id: lint
3141
run: pnpm run lint
@@ -51,31 +61,3 @@ jobs:
5161
} else {
5262
throw new Error('Pull request data not found')
5363
}
54-
55-
- name: Build the packages
56-
id: build
57-
if: ${{ success() && !failure() }}
58-
run: pnpm build
59-
60-
- name: Build Failed
61-
if: ${{ failure() && !steps.lint.outcome == 'failure' }}
62-
uses: actions/github-script@v6
63-
with:
64-
script: |
65-
const { data: pullRequestData } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
66-
owner: context.repo.owner,
67-
repo: context.repo.repo,
68-
commit_sha: context.payload.after
69-
})
70-
71-
if(pullRequestData[0]){
72-
await github.rest.issues.createComment({
73-
issue_number: pullRequestData[0].number,
74-
owner: context.repo.owner,
75-
repo: context.repo.repo,
76-
body: `#### ❌ Build failed:
77-
`
78-
})
79-
} else {
80-
throw new Error('Pull request data not found')
81-
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ cache
1515
docs.json
1616
docs.api.json
1717
docs/**
18+
temp/**
1819
.DS_Store

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@
2828
#--------------------------------------------
2929

3030
# (Add your project-specific overrides here)
31-
!/template/**
31+
!/template/**
32+
node_modules

apps/.DS_Store

6 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
template/
2-
.eslintrc.js
2+
.eslintrc.json
33
dist/
44
build/
55
node_modules/

packages/create-wapi-app/.eslintrc.js

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@wapijs/eslint-config/config.node.js"]
3+
}

packages/create-wapi-app/src/create-bot.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ import {
1010
import path from "node:path";
1111
import process from "node:process";
1212
import { URL } from "node:url";
13-
import fastGlob from "fast-glob";
13+
import { glob } from "fast-glob";
1414
import chalk from "chalk";
1515
import { installPackages } from "./reusable-function.js";
1616
import { PackageManagerEnum } from "./type.js";
1717

18-
const glob = fastGlob.glob;
19-
2018
export async function createWhatsappBot(options: {
2119
directory: string;
2220
doInstallPackage: boolean;
Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
{
2-
"$schema": "https://json.schemastore.org/package.json",
3-
"name": "[REPLACE_ME]",
4-
"version": "0.1.0",
5-
"private": true,
6-
"type": "module",
7-
"scripts": {
8-
"lint": "prettier --check . && eslint --ext .js,.mjs,.cjs --format=pretty src",
9-
"format": "prettier --write . && eslint --ext .js,.mjs,.cjs --fix --format=pretty src",
10-
"start": "node --require dotenv/config src/index.js",
11-
"deploy": "node --require dotenv/config src/util/deploy.js"
12-
},
13-
"dependencies": {
14-
"@wapijs/wapi.js": "^0.0.2",
15-
"dotenv": "^16.3.1"
16-
},
17-
"devDependencies": {
18-
"eslint": "^8.53.0",
19-
"eslint-config-neon": "^0.1.57",
20-
"eslint-formatter-pretty": "^5.0.0",
21-
"prettier": "^3.1.0",
22-
"zod": "^3.22.4"
23-
}
2+
"$schema": "https://json.schemastore.org/package.json",
3+
"name": "my-whatsapp-bot",
4+
"version": "0.1.0",
5+
"private": true,
6+
"type": "module",
7+
"scripts": {
8+
"lint": "prettier --check . && eslint --ext .js,.mjs,.cjs --format=pretty src",
9+
"format": "prettier --write . && eslint --ext .js,.mjs,.cjs --fix --format=pretty src",
10+
"start": "pnpm build && node dist/index.js",
11+
"build": "tsc -p ./tsconfig.json"
12+
},
13+
"dependencies": {
14+
"@wapijs/wapi.js": "^0.0.7",
15+
"dotenv": "^16.3.1"
16+
},
17+
"devDependencies": {
18+
"@types/node": "^20.5.9",
19+
"eslint": "^8.53.0",
20+
"eslint-config-neon": "^0.1.57",
21+
"eslint-formatter-pretty": "^5.0.0",
22+
"prettier": "^3.1.0",
23+
"typescript": "5.4.5",
24+
"zod": "^3.22.4"
25+
}
2426
}

0 commit comments

Comments
 (0)