mirror of
https://github.com/ent/ent.git
synced 2026-04-28 05:30:56 +03:00
contributing: initial doc for contribution guidance (#68)
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/68 Closes #62 Reviewed By: alexsn Differential Revision: D17782435 fbshipit-source-id: c2995dbf2c1cbdb032cf4c2865769ffa7a3214ad
This commit is contained in:
committed by
Facebook Github Bot
parent
54d0d7fe53
commit
b0e889a997
@@ -2,6 +2,50 @@
|
||||
We want to make contributing to this project as easy and transparent as
|
||||
possible.
|
||||
|
||||
# Project structure
|
||||
|
||||
- `dialect` - Contains SQL and Gremlin code used by the generated code.
|
||||
- `dialect/sql/schema` - Auto migration logic resides there.
|
||||
|
||||
- `schema` - User schema API.
|
||||
- `schema/{field, edge, index}` - provides schema builders API.
|
||||
- `schema/field/gen` - Templates and codegen for numeric builders.
|
||||
|
||||
- `entc` - Codegen of `ent`.
|
||||
- `entc/load` - `entc` loader API for loading user schemas into a Go objects at runtime.
|
||||
- `entc/gen` - The actual code generation logic resides in this package (and its `templates` package).
|
||||
- `integration` - Integration tests for `entc`.
|
||||
|
||||
- `doc` - Documentation code for `entgo.io` (uses [Docusaurus](https://docusaurus.io)).
|
||||
- `doc/md` - Markdown files for documentation.
|
||||
- `doc/website` - Website code and assets.
|
||||
|
||||
# Working on `entc`
|
||||
|
||||
If you work on one of the template files (`gen/templates`, `load/templates`, `load/schema.go`), you should
|
||||
run `go-bindata`, in order to embedded these files in `entc` binary. Please install it by running the following
|
||||
command in your `$HOME` directory.
|
||||
|
||||
```
|
||||
go get -u github.com/go-bindata/go-bindata
|
||||
```
|
||||
|
||||
# Run integration tests
|
||||
If you touch any file in `entc`, run the following command in `entc/integration`:
|
||||
|
||||
```
|
||||
go generate ./...
|
||||
```
|
||||
|
||||
Then, run `docker-compose` in order to spin-up all database containers:
|
||||
|
||||
```
|
||||
docker-compose -f compose/docker-compose.yaml up -d --scale test=0
|
||||
```
|
||||
|
||||
Then, run `go test ./...` to run all integration tests.
|
||||
|
||||
|
||||
## Pull Requests
|
||||
We actively welcome your pull requests.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user