Replies: 4 comments 2 replies
-
@amplication/amplication what do you think? |
Beta Was this translation helpful? Give feedback.
-
I completely support the idea to keep the library as much framework-agnostic as possible to keep it light in dependencies. In terms of actual design, I would recommend to keep a consistent approach (OOP) with the rest of the monorepo trying to define a common interface with all the git providers we need to support. |
Beta Was this translation helpful? Give feedback.
-
First of all, I think this idea is great and necessary. it always better to use vanilla over framework when we're talking about utils or functionality. I support that... I would like to offer an alternative of creating libraries inside our code and introduce a util plugins. It will allow us to expend our utilities without having a mass of code. The utils plugins will be installed and added before the regular plugins and will expose functions related to the generated code or plugins. it will be loaded by categories or dependancies to user selection or use of plugins. When I think of the DSG, I see it as a multiple small and big services that can be combine together as Lego that can produce endless options of code. This methodology can be manufactured many flavors of node.js structures and also libraries (serverless, utils etc...). So... your idea of distributed version control system (git, bitbucket etc...) can be as part of this separation and the first step of segregation the DSG |
Beta Was this translation helpful? Give feedback.
-
@abrl91 thanks for raising this discussion. I think we should separate the efforts into two:
For the first one, I am in favor of doing it, but I think we should look at it separately. I agree with @overbit about the interface.
|
Beta Was this translation helpful? Give feedback.
-
Creating
libs/util/git
NodeJS library that holds all the functionality of git and git provider instead ofamplication-git-utils
.The
amplication-git-utils
package is written in NestJS for no reason:app.module.ts
I suggest creating all our git logic related in
libs/util/git
. This library will be written in NodeJS (and not NestJS) and expose utils functions.As for the provider implementation, we can hold a Map or a simple JS object that points to the relative provider set of functions.
We get the provider from the 'args' and then can trigger the function that we need from this Map by the provider that we got.
We that implementation each provider will be able to use it's own terminology, such as organization for GitHub and workspace for Bitbucket (the table name will remain the same, and the keys of the object should be the same)
The functions' parameters and the returned value are different between git providers. For example, GitHub uses
installationId
as it uses the GitHub app, and Bitbucket only has an OAuth app for installed applications, so it's actually token and notinstallationId
Beta Was this translation helpful? Give feedback.
All reactions