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 Local development #862

Merged
merged 13 commits into from
Jun 17, 2024
Merged

Conversation

Meldiron
Copy link
Contributor

@Meldiron Meldiron commented May 29, 2024

What does this PR do?

Implements local development in appwrite run function.

Test Plan

  • Manual QA

Related PRs and Issues

x

Have you read the Contributing Guidelines on issues?

Yes

@Meldiron Meldiron changed the base branch from feat-cli-g2 to feat-multiple-accounts-and-instances June 4, 2024 07:46
Base automatically changed from feat-multiple-accounts-and-instances to feat-console-flow June 11, 2024 20:24
Base automatically changed from feat-console-flow to feat-cli-g2 June 11, 2024 20:55
Comment on lines 796 to 800
type: "input",
name: "port",
message: 'Which port would you like function to listen on?',
default: async () => {
let port = 3000;
Copy link
Member

Choose a reason for hiding this comment

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

we should only show this prompt when the port 3000 is not available right?
you can use the when condition of inquirer to check this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well we could automatically also pick 3001 because its available. Should we not ask this question at all, and just tell them to use --port if they want to change it?

Copy link
Member

Choose a reason for hiding this comment

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

Yeap agreed 👍

.alias("functions")
.description("Run functions in the current directory.")
.option(`--functionId <functionId>`, `Function ID`)
.option(`--port <port>`, `Local port`)
Copy link
Member

Choose a reason for hiding this comment

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

lets fix a default port so user doesnt need to enter it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's optional param. If not provided ,question is asked (with default 3000 as placeholder)

if(!port) {
let portFound = fale;
port = 3000;
while(port < 3100) {
Copy link
Member

Choose a reason for hiding this comment

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

while very rare, why limit the search to 100 ports? Why not set it to something higher like 6000 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No idea how long that might take. And as you said, very rare. I wouldn' worry too much until we get some complains.

@christyjacob4 christyjacob4 merged commit 303cc6d into feat-cli-g2 Jun 17, 2024
34 of 35 checks passed
@christyjacob4 christyjacob4 deleted the feat-cli-local-development branch June 17, 2024 13:42
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.

2 participants