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

[Feature] laf-cli support push/pull funcs in batch #1835

Open
1 of 2 tasks
aFlyBird0 opened this issue Feb 1, 2024 · 0 comments
Open
1 of 2 tasks

[Feature] laf-cli support push/pull funcs in batch #1835

aFlyBird0 opened this issue Feb 1, 2024 · 0 comments
Labels
feature New feature or request

Comments

@aFlyBird0
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar issues.

Feature Request

English Version

Currently, laf-cli only supports pushing/pulling all cloud functions or a specific cloud function. However, sometimes we want to pull a set of cloud functions that meet certain conditions.

We can add an additional option -r (regex) or --prefix to enable this feature.

There are several design options:

  • Prefix matching. For example, laf func pull --prefix auth, will pull all functions starting with auth (e.g., auth/login, auth/register). This feature will be very useful when developing by module.
  • Regular expression. For example, laf func push -r user, will push all functions containing user (e.g., getUserInfo, updateUser).

The former is easier to use and closer to real-world use cases (pulling by module/folder).
The latter is more powerful but more complex. (For example, we can also use laf func push -r "^user" to achieve the prefix matching effect.)

By the way, we can also introduce the --tags parameter to filter based on tags.

中文版本

目前laf-cli只能push/pull所有云函数或某个云函数,但我们有时希望拉取符合条件的一组云函数。

我们可以添加一个额外的选项 -r(regex) 或 --prefix 来开启这个特性。

有下面几种设计方案:

  • 前缀匹配。例如 laf func pull --prefix auth,将pull所有 auth 开头的函数,(例如 auth/login, auth/register)。当我们按模块开发的时候,这个功能将非常有用。
  • 正则。例如 laf func push -r user,将push所有包含user的函数,(例如 getUserInfo, updateUser)。

前者使用起来更简单,更贴近真实的需求场景(按模块/文件夹拉取)
后者更强大,但更复杂。(例如,我们也可以使用 laf func push -r "^user" 达到前缀匹配的效果)

顺便一提,我们还可以引入 --tags 参数,根据标签进行筛选。

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@aFlyBird0 aFlyBird0 added the feature New feature or request label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant