chore: developing structure file
This commit is contained in:
76
.gitea/DEVELOPING.md
Normal file
76
.gitea/DEVELOPING.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# DepGraph
|
||||
|
||||
DepGraph is a utility for querying information about project dependencies
|
||||
count and their licenses.
|
||||
|
||||
## Developing
|
||||
|
||||
### Tech Stack
|
||||
|
||||
- Language: [Go](https://go.dev);
|
||||
- Tools:
|
||||
- Linting: [`golangci-lint`, version 2](https://golangci-lint.run/);
|
||||
- Formatting: [`gofumpt`](https://github.com/mvdan/gofumpt) and
|
||||
[`goimports`](https://pkg.go.dev/golang.org/x/tools/cmd/goimports),
|
||||
both already provided by `golangci-lint`;
|
||||
|
||||
### Design
|
||||
|
||||
The project design should be language/ecosystem-agnostic, so any sort of
|
||||
module system of any language can be developed for the project. However,
|
||||
the main focus will be primarily Go and JavaScript.
|
||||
|
||||
```
|
||||
DepGraph
|
||||
|- repository # Retrievers to get data from Gitea, GitLab, etc
|
||||
|- service # Transform the data from repositories into a fs.FS
|
||||
| filesystem that adapters can use
|
||||
|- adapter # Adapters are who does the magic, they get the
|
||||
| filesystem and detect files such as go.mod,
|
||||
| package.json, etc to know what adapter to use
|
||||
|- adapter/go # Adapter for Go's module system
|
||||
|- adapter/npm # Adapter for NodeJS/NPM/JavaScript module system
|
||||
|- cmd # CLI interface of the project
|
||||
|- depgraph.go # API interface of the project
|
||||
```
|
||||
|
||||
For now, the project will focus on providing a Go API and CLI interface to fetch
|
||||
and process dependencies. When the interfaces are mature, we will build on
|
||||
top of it a website that consumes the returned list of dependencies and shows
|
||||
it on a graph and other more visual features.
|
||||
|
||||
#### Adapters
|
||||
|
||||
The core workflow of the adapters/dependencies parsing is defined below:
|
||||
|
||||

|
||||
|
||||
This from were the final list of dependencies will be created and from were
|
||||
specific language adapters are called from.
|
||||
|
||||
##### Go Adapter
|
||||
|
||||

|
||||
|
||||
Since Go doesn't have a unified package repository, the adapter has a lot
|
||||
of different options and paths it can work with. But thankfully, Go does
|
||||
provide a proxy that caches the source code of public packages, which
|
||||
we can use to retrieve the source code if we need it very easily for most
|
||||
packages.
|
||||
|
||||
Useful resources to read and use:
|
||||
- [Go Modules Reference](https://go.dev/ref/mod)
|
||||
- [`go.mod` files](https://go.dev/ref/mod#go-mod-file)
|
||||
- [`go.sum` files](https://go.dev/ref/mod#go-sum-files)
|
||||
- [GOPROXY protocol](https://go.dev/ref/mod#goproxy-protocol)
|
||||
- [proxy.golang.org](https://proxy.golang.org/)
|
||||
- [Module Cache](https://go.dev/ref/mod#module-cache)
|
||||
- [Module zip files](https://go.dev/ref/mod#zip-files)
|
||||
- Packages to handle modules
|
||||
- [golang.org/x/mod/sumdb/dirhash](https://pkg.go.dev/golang.org/x/mod/sumdb/dirhash)
|
||||
- [golang.org/x/mod/mofile](https://pkg.go.dev/golang.org/x/mod/modfile)
|
||||
- [golang.org/x/mod/zip](https://pkg.go.dev/golang.org/x/mod@v0.32.0/zip)
|
||||
- [golang.org/x/mod/module](https://pkg.go.dev/golang.org/x/mod/module)
|
||||
- The [golang.org/x/tools/go/packages](https://pkg.go.dev/golang.org/x/tools@v0.41.0/go/packages)
|
||||
package may also be useful to parse packages, specially from source code,
|
||||
but the current design/spec illustrated above does not take it into account.
|
||||
2
.gitea/depgraph-design-core.svg
Normal file
2
.gitea/depgraph-design-core.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 166 KiB |
2
.gitea/depgraph-spec-golang.svg
Normal file
2
.gitea/depgraph-spec-golang.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 204 KiB |
@@ -1,5 +1,8 @@
|
||||
# Contribuiting
|
||||
|
||||
[See the development guide](./.gitea/DEVELOPING.md) to know what is the structure of
|
||||
these initial states of development.
|
||||
|
||||
## Style Guide
|
||||
|
||||
### Code
|
||||
|
||||
Reference in New Issue
Block a user