Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sarthakjdev/wapi.js into feat/gui…
Browse files Browse the repository at this point in the history
…de-website

Signed-off-by: sarthakjdev <[email protected]>
  • Loading branch information
sarthakjdev committed May 29, 2024
2 parents 9fd8c67 + 0f50da7 commit 00eb02f
Show file tree
Hide file tree
Showing 75 changed files with 658 additions and 5,016 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ errors.log
.eslintrc.js
packages/**
apps/**
template/**
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text eol=lf
*.mp4

# Text files to be normalized and converted to native line endings on checkout.
*.ts text
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Extract package and semantic version from release tag
if: ${{ github.ref_type == 'tag' }}
id: extract-tag
uses: ./format-tag/action.yaml
uses: ./.github/workflows/format-tag
with:
tag: ${{ github.ref_name }}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
42 changes: 12 additions & 30 deletions .github/workflows/lint-and-build.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: Check Build
name: Build and Lint

on:
push:
branches-ignore:
- "master"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint-and-build:
build-and-lint:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
Expand All @@ -26,6 +30,12 @@ jobs:
- name: Install Dependencies
run: pnpm install --frozen-lockfile

# need to build before lint check because packages is using interlinked workspace dependencies
- name: Build the packages
id: build
if: ${{ success() && !failure() }}
run: pnpm build

- name: Lint
id: lint
run: pnpm run lint
Expand All @@ -51,31 +61,3 @@ jobs:
} else {
throw new Error('Pull request data not found')
}
- name: Build the packages
id: build
if: ${{ success() && !failure() }}
run: pnpm build

- name: Build Failed
if: ${{ failure() && !steps.lint.outcome == 'failure' }}
uses: actions/github-script@v6
with:
script: |
const { data: pullRequestData } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.payload.after
})
if(pullRequestData[0]){
await github.rest.issues.createComment({
issue_number: pullRequestData[0].number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `#### ❌ Build failed:
`
})
} else {
throw new Error('Pull request data not found')
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ cache
docs.json
docs.api.json
docs/**
temp/**
.DS_Store
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@
#--------------------------------------------

# (Add your project-specific overrides here)
!/template/**
!/template/**
node_modules
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Wapi.js is a JavaScript module, written in TypeScript, designed to interact with
### Packages:

- [**@wapijs/wapi.js**]('/packages/wapi.js'): Interact with WhatsApp cloud API with simple and easy-to-manage code.
- [**@wapijs/create-wapi-bot**]('/packages/create-wapi-bot): Start with the development of your WhatsApp bot using this starter template utility.
- [**@wapijs/create-wapi-app**]('/packages/create-wapi-app): Start with the development of your WhatsApp bot using this starter template utility.

## ✨ Features

Expand Down Expand Up @@ -52,7 +52,7 @@ pnpm install @wapijs/wapi.js
- You can get started with the development of your bot with this starter template utility.

```sh
pnpm create-wapi-bot
pnpm create-wapi-app
```

## 🔗 References
Expand Down
Binary file added apps/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions apps/wapijs.co/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ yarn-error.log*

# local env files
.env*.local
.env

# vercel
.vercel
Expand Down
18 changes: 16 additions & 2 deletions apps/wapijs.co/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,23 @@ const nextConfig = withBundleAnalyzer(
withContentlayer({
reactStrictMode: true,
compiler: {
removeConsole: process.env.NODE_ENV === 'production'
removeConsole: process.env.NODE_ENV === 'production',
},
poweredByHeader: false
images: {
dangerouslyAllowSVG: true,
remotePatterns: [
{
hostname: 'res.cloudinary.com'
},
{
hostname: 'www.producthunt.com'
},
{
hostname: 'api.producthunt.com'
}
]
},
poweredByHeader: false,
})
)

Expand Down
1 change: 1 addition & 0 deletions apps/wapijs.co/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@microsoft/tsdoc": "^0.14.2",
"@microsoft/tsdoc-config": "^0.16.2",
"@next/bundle-analyzer": "^14.2.3",
"@next/third-parties": "^14.2.3",
"@react-icons/all-files": "^4.1.0",
"@shikijs/rehype": "^1.4.0",
"@tailwindcss/typography": "^0.5.10",
Expand Down
40 changes: 40 additions & 0 deletions apps/wapijs.co/public/assets/peerlist-launch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/wapijs.co/public/doc-og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/wapijs.co/public/og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions apps/wapijs.co/src/app/docs/[version]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,69 @@ import { ApiModel } from '@microsoft/api-extractor-model'
import { resolveItemUri } from '~/reusable-function'
import { notFound } from 'next/navigation'
import { addPackageToModel, fetchDocumentationJsonDataFromSlug } from '~/utils/api-extractor'
import type { Metadata } from 'next'
import {
MetaTitle,
CANONICAL_SITE_DOMAIN,
META_CATEGORY,
ProductDescription,
META_KEYWORDS,
META_CLASSIFICATION
} from '~/constant'

export const revalidate = 60 * 60 * 24 * 30
export const dynamicParams = true

export const metadata: Metadata = {
title: `Docs | ${MetaTitle}`,
description: ProductDescription,
applicationName: 'Wapijs',
authors: [{ name: 'Sarthak Jain', url: `https://github.com/sarthakjdev` }],
generator: 'Next.js',
referrer: 'origin-when-cross-origin',
keywords: META_KEYWORDS,
publisher: 'Softlancer - Ideate. Innovate. Elevate',
robots: 'index, follow',
creator: 'Softlancer',
manifest: `${CANONICAL_SITE_DOMAIN}/manifest.json`,
openGraph: {
type: 'website',
url: CANONICAL_SITE_DOMAIN,
title: MetaTitle,
description: ProductDescription,
images: [{ url: `${CANONICAL_SITE_DOMAIN}/doc-og.png` }],
siteName: 'Wapijs'
},
twitter: {
card: 'summary_large_image',
site: '@sarthakjdev',
description: ProductDescription,
title: MetaTitle,
creator: '@sarthakjdev',
images: `${CANONICAL_SITE_DOMAIN}/doc-og.png`
},
verification: {
google: 'mrOKVGMry1NOe6Hrn1lXqy0dYcuAqNVbiDr5HeSfRWo'
},
formatDetection: { telephone: false },
appleWebApp: true,
assets: `${CANONICAL_SITE_DOMAIN}/assets`,
category: META_CATEGORY.join(', '),
classification: META_CLASSIFICATION.join(', '),
other: {
'X-UA-Compatible': 'IE=edge,chrome=1',
'mobile-web-app-capable': 'yes'
},
metadataBase: new URL(CANONICAL_SITE_DOMAIN),
alternates: {
canonical: new URL(CANONICAL_SITE_DOMAIN)
},
icons: [
{ rel: 'icon', url: `${CANONICAL_SITE_DOMAIN}/favicon.ico` },
{ rel: 'apple-touch-icon', url: `${CANONICAL_SITE_DOMAIN}/apple-icon.png` }
]
}

export default async function VersionHomeLayout({
children,
params
Expand Down
74 changes: 72 additions & 2 deletions apps/wapijs.co/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,78 @@
import type { Metadata } from 'next'
import type { Metadata, Viewport } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'
import 'overlayscrollbars/overlayscrollbars.css'
import { clsx } from 'clsx'
import { GoogleTagManager } from '@next/third-parties/google'
import {
CANONICAL_SITE_DOMAIN,
IS_PRODUCTION,
META_CATEGORY,
META_CLASSIFICATION,
META_KEYWORDS,
MetaTitle,
ProductDescription
} from '~/constant'

const inter = Inter({ subsets: ['latin'] })

export const viewport: Viewport = {
themeColor: {
color: '#25D366'
},
colorScheme: 'light',
width: 'device-width',
initialScale: 1
}

export const metadata: Metadata = {
title: 'Build whatsapp chat bot with ease - Wapi.js'
title: MetaTitle,
description: ProductDescription,
applicationName: 'Wapijs',
authors: [{ name: 'Sarthak Jain', url: `https://github.com/sarthakjdev` }],
generator: 'Next.js',
referrer: 'origin-when-cross-origin',
keywords: META_KEYWORDS,
publisher: 'Softlancer - Ideate. Innovate. Elevate',
robots: 'index, follow',
creator: 'Softlancer',
manifest: `${CANONICAL_SITE_DOMAIN}/manifest.json`,
openGraph: {
type: 'website',
url: CANONICAL_SITE_DOMAIN,
title: MetaTitle,
description: ProductDescription,
images: [{ url: `${CANONICAL_SITE_DOMAIN}/og.png` }],
siteName: 'Wapijs'
},
twitter: {
card: 'summary_large_image',
site: '@sarthakjdev',
description: ProductDescription,
title: MetaTitle,
creator: '@sarthakjdev',
images: `${CANONICAL_SITE_DOMAIN}/og.png`
},
verification: {
google: 'G7K6qtaRxHsmA5TSwlNyM4iOi9J3J4WeqdPCFoqKAY4'
},
formatDetection: { telephone: false },
appleWebApp: true,
assets: `${CANONICAL_SITE_DOMAIN}/assets`,
category: META_CATEGORY.join(', '),
classification: META_CLASSIFICATION.join(', '),
other: {
'X-UA-Compatible': 'IE=edge,chrome=1',
'mobile-web-app-capable': 'yes'
},
metadataBase: new URL(CANONICAL_SITE_DOMAIN),
alternates: {
canonical: new URL(CANONICAL_SITE_DOMAIN)
},
icons: [
{ rel: 'icon', url: `${CANONICAL_SITE_DOMAIN}/favicon.ico` },
{ rel: 'apple-touch-icon', url: `${CANONICAL_SITE_DOMAIN}/apple-icon.png` }
]
}

export default function RootLayout({
Expand All @@ -17,6 +82,11 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
{IS_PRODUCTION ? (
<>
<GoogleTagManager gtmId={'GTM-PSX33PK2'} />
</>
) : null}
<body className={clsx(inter.className, 'min-h-screen bg-[#121212]')}>{children}</body>
</html>
)
Expand Down
6 changes: 3 additions & 3 deletions apps/wapijs.co/src/app/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { metaDescription } from '~/constant'

export default function manifest(): MetadataRoute.Manifest {
return {
name: 'Softlancer',
short_name: 'Softlancer',
name: 'Wapi.js',
short_name: 'Wapi',
description: metaDescription,
start_url: '/',
display: 'standalone',
background_color: '#fff',
theme_color: '#f16232',
theme_color: '#25D366',
icons: [
{
src: '/favicon.ico',
Expand Down
34 changes: 33 additions & 1 deletion apps/wapijs.co/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,43 @@
import { Button, ClipboardCopy } from '@wapijs/ui'
import Link from 'next/link'
import { ArrowTopRightOnSquareIcon } from '@heroicons/react/24/solid'
import Image from 'next/image'

export default function Home() {
return (
<main className="my-auto flex min-h-screen flex-row items-center justify-center gap-5 pl-10">
<div className="flex flex-1 flex-col gap-6">
<div
className="mx-auto flex w-fit flex-row items-center justify-center gap-5 py-4"
id="launch-banners"
>
<div className="flex-1">
<Link
href={'https://peerlist.io/sarthakjdev/project/wapijs'}
target="_blank"
>
<Image
src={'/assets/peerlist-launch.svg'}
height={48}
width={160}
alt="peerlist-laucnh-batch"
/>
</Link>
</div>
<div className="flex-1">
<Link
href="https://www.producthunt.com/posts/wapi-js?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-wapi&#0045;js"
target="_blank"
>
<Image
src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=458125&theme=light"
alt="Wapi&#0046;js - build&#0032;WhatsApp&#0032;business&#0032;apps&#0032;easily&#0032;and&#0032;faster | Product Hunt"
width="180"
height="39"
/>
</Link>
</div>
</div>
<div className="mx-auto">
<ClipboardCopy textToBeCopied="pnpm i @wapijs/wapi.js" />
</div>
Expand Down Expand Up @@ -39,7 +71,7 @@ export default function Home() {

<div className="flex h-screen max-w-4xl flex-1 items-center bg-secondary-950 px-4">
<video autoPlay={true} loop={true} muted className="rounded-xl">
<source src="/assets/library-usage-flow.mp4" />
<source src="https://res.cloudinary.com/dm4zlrwhs/video/upload/v1716021568/library-usage-flow_qvvig8.mp4" />
</video>
</div>
</main>
Expand Down
Loading

0 comments on commit 00eb02f

Please sign in to comment.