Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): add new serve command for Botonic 1.0 under flag --preview #1721

Merged
merged 1 commit into from Jul 28, 2021

Conversation

ericmarcos
Copy link
Contributor

Description

Updated botonic serve command for Botonic 1.0. The new functionality can be activated with the flag --preview or -p:

botonic serve --preview

It launches 3 servers concurrently:

  • Webchat (frontend React app)
  • API REST (backend Node/Express app)
  • Websocket Server

In the future it will launch another server for the webviews.

One of the main features is the linking of the local dev server (API) directly with messaging apps like Whatsapp or Telegram. In order to do that, we generate a local tunnel and send its public URL to the new Botonic Playground API, which manages the direct connection with messaging apps.

Context

With this new command, developers can now try their local botonic projects on Whatsapp and other platforms without the hassle of creating any accounts. This allows them to learn Botonic much faster and be more productive when building their projects.

To document / Usage example

botonic serve --preview

Testing

The pull request...

  • doesn't need tests because it's still an experimental feature. Still a lot of stuff missing and subject to changes.

@github-actions
Copy link

github-actions bot commented Jul 14, 2021

Unit Test Results

  1 files  ±0    7 suites  ±0   3m 17s ⏱️ ±0s
32 tests ±0  32 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 7d68125. ± Comparison against base commit 7d68125.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@asastre asastre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to have this preview of Botonic 1.0!! 🥳
Some things to be reviewed/changed though 😉

packages/botonic-cli/src/botonic-playground-service.ts Outdated Show resolved Hide resolved
packages/botonic-cli/src/botonic-playground-service.ts Outdated Show resolved Hide resolved
packages/botonic-cli/src/botonic-playground-service.ts Outdated Show resolved Hide resolved
packages/botonic-cli/src/botonic-playground-service.ts Outdated Show resolved Hide resolved
packages/botonic-cli/src/botonic-playground-service.ts Outdated Show resolved Hide resolved
packages/botonic-cli/src/botonic-playground-service.ts Outdated Show resolved Hide resolved
packages/botonic-cli/src/botonic-playground-service.ts Outdated Show resolved Hide resolved
packages/botonic-cli/src/botonic-playground-service.ts Outdated Show resolved Hide resolved
packages/botonic-cli/src/commands/serve.ts Outdated Show resolved Hide resolved
packages/botonic-cli/src/commands/serve.ts Show resolved Hide resolved
@ericmarcos ericmarcos force-pushed the feat/add-serve-preview branch 3 times, most recently from e1cb658 to 7c80110 Compare July 15, 2021 10:27
@ericmarcos ericmarcos requested a review from asastre July 15, 2021 10:35
Copy link
Contributor

@asastre asastre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one last comment, the rest LGTM! 🚀

Comment on lines +45 to +49
try {
await pgs.start()
} catch (e) {
console.log("Couldn't start the Playground service: ", e)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to add here the try/catch since the start method has already one inside and does not rethrow the exception if it fails.

@ericmarcos ericmarcos merged commit 7d68125 into master Jul 28, 2021
@ericmarcos ericmarcos deleted the feat/add-serve-preview branch July 28, 2021 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants