forked from encoredev/encore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f9529f3
Showing
220 changed files
with
38,288 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Go | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: encr.dev | ||
|
||
- name: Set up Node | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
|
||
- name: Install encore-go | ||
run: curl -o encore-go.tar.gz https://d2f391esomvqpi.cloudfront.net/encore-go-0.9.4-linux_amd64.tar.gz && tar -C . -xzf ./encore-go.tar.gz | ||
|
||
- name: Build dashapp | ||
run: cd encr.dev/cli/daemon/dash/dashapp && npm install && npm run build | ||
|
||
- name: Build | ||
run: cd encr.dev && go build ./... | ||
|
||
- name: Test | ||
run: cd encr.dev && go test -short ./... | ||
env: | ||
ENCORE_GOROOT: ${{ github.workspace }}/encore-go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version to build ("1.2.3")' | ||
required: true | ||
encorego_version: | ||
description: 'Encore-Go version to use ("1.2.3")' | ||
required: true | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
include: | ||
- builder: ubuntu-latest | ||
goos: linux | ||
goarch: amd64 | ||
- builder: macos-latest | ||
goos: darwin | ||
goarch: amd64 | ||
- builder: macos-latest | ||
goos: darwin | ||
goarch: arm64 | ||
- builder: windows-latest | ||
goos: windows | ||
goarch: amd64 | ||
|
||
runs-on: ${{ matrix.builder }} | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v2 | ||
with: | ||
path: encr.dev | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
|
||
- name: Install encore-go | ||
run: curl -o encore-go.tar.gz https://d2f391esomvqpi.cloudfront.net/encore-go-${{ github.event.inputs.encorego_version }}-${{ matrix.goos }}_${{ matrix.goarch }}.tar.gz && tar -C ${{ github.workspace }} -xzf ./encore-go.tar.gz | ||
|
||
- name: Build | ||
run: cd encr.dev && go run ./pkg/make-release/make-release.go -v="${{ github.event.inputs.version }}" -dst=dist -goos=${{ matrix.goos }} -goarch=${{ matrix.goarch }} -encore-go="../encore-go" | ||
env: | ||
GO111MODULE: "on" | ||
- name: 'Tar artifacts' | ||
run: tar -czvf encore-${{ github.event.inputs.version }}-${{ matrix.goos }}_${{ matrix.goarch }}.tar.gz -C encr.dev/dist/${{ matrix.goos }}_${{ matrix.goarch }} . | ||
- name: Publish artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: encore-${{ github.event.inputs.version }}-${{ matrix.goos }}_${{ matrix.goarch }} | ||
path: encore-${{ github.event.inputs.version }}-${{ matrix.goos }}_${{ matrix.goarch }}.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Windows Test | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version to build ("1.2.3")' | ||
required: true | ||
encorego_version: | ||
description: 'Encore-Go version to use ("1.2.3")' | ||
required: true | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v2 | ||
with: | ||
path: encr.dev | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
|
||
- name: Install encore-go | ||
run: curl -o encore-go.tar.gz https://d2f391esomvqpi.cloudfront.net/encore-go-${{ github.event.inputs.encorego_version }}-windows_amd64.tar.gz && tar -C ${{ github.workspace }} -xzf ./encore-go.tar.gz | ||
|
||
- name: Build | ||
run: cd encr.dev && go run ./pkg/make-release/make-release.go -v="${{ github.event.inputs.version }}" -dst=dist -goos=windows -goarch=amd64 -encore-go="../encore-go" | ||
env: | ||
GO111MODULE: "on" | ||
- name: 'Tar artifacts' | ||
run: tar -czvf encore-${{ github.event.inputs.version }}-windows_amd64.tar.gz -C encr.dev/dist/windows_amd64 . | ||
- name: Publish artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: encore-${{ github.event.inputs.version }}-windows_amd64 | ||
path: encore-${{ github.event.inputs.version }}-windows_amd64.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Prevent built binaries from being checked in accidentally. | ||
/dist | ||
/encore | ||
/git-remote-encore | ||
|
||
# Don't commit dotfiles | ||
/.encore | ||
/.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Hacking on Encore | ||
|
||
Building an Encore application requires | ||
access to both the Encore runtime (the | ||
`encore.dev` package) as well as a custom-built | ||
Go runtime ([encore-go](https://github.com/encoredev/encore-go)) to implement Encore's request semantics and implement automated instrumentation. | ||
|
||
As a result the Encore Daemon must know where these two things exist on the filesystem in order to | ||
properly compile the Encore application. | ||
|
||
This must be done in one of two ways: embedding the | ||
installation path at compile time (similar to `GOROOT`) or by setting an environment variable | ||
at runtime. | ||
|
||
The environment variables are: | ||
- `ENCORE_GOROOT` – the path to encore-go on disk | ||
- `ENCORE_RUNTIME_PATH` – the path to the `encore.dev` runtime implementation. | ||
|
||
`ENCORE_RUNTIME_PATH` can be set to location of the `compiler/runtime` package in this repository, | ||
while `ENCORE_GOROOT` must be pointed to where | ||
`encore-go` was built. | ||
|
||
These settings can also be set at build-time. | ||
For more information on this see | ||
[cli/internal/env/env.go](cli/internal/env/env.go). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Encore | ||
https://encore.dev | ||
|
||
The Go backend framework that understands what you're creating. | ||
|
||
## Overview | ||
|
||
Encore is a framework for building Go backends. | ||
Unlike traditional frameworks Encore uses static analysis to understand what you're creating and helps you along the way. | ||
|
||
**Read the documentation at [encore.dev/docs](https://encore.dev/docs).** | ||
|
||
Features include: | ||
|
||
- A state of the art developer experience with unmatched productivity | ||
- Makes it super-easy to define services and APIs | ||
- Adds compile time type-checking and auto-completion of your APIs | ||
- Generates API docs and API clients for your app | ||
- Instruments your app with distributed tracing, logs, and metrics – automatically | ||
- Runs serverlessly on Encore's cloud, or deploys to your own favorite cloud | ||
- Sets up a dedicated Preview Environments for your pull requests | ||
- Supports flexible authentication | ||
- Manages your databases and migrates them automatically | ||
- Provides an extremely simple yet secure secrets management. | ||
|
||
### Installing | ||
|
||
The easiest way to run Encore is to install the pre-built binaries. | ||
|
||
#### macOS | ||
`brew install encoredev/tap/encore` | ||
|
||
#### Windows | ||
Coming soon | ||
|
||
#### Linux | ||
Coming soon | ||
|
||
### Building from source | ||
|
||
See [HACKING.md](HACKING.md). | ||
|
||
## Architecture | ||
|
||
The code base is divided into several parts: | ||
|
||
### cli | ||
The `encore` command line interface. The encore background daemon | ||
is located at `cli/daemon` and is responsible for managing processes, | ||
setting up databases and talking with the Encore servers for operations like | ||
fetching production logs. | ||
|
||
### parser | ||
The Encore Parser statically analyzes Encore apps to build up a model | ||
of the application dubbed the Encore Syntax Tree (EST) that lives in | ||
`parser/est`. | ||
|
||
For speed the parser does not perform traditional type-checking; it does | ||
limited type-checking for enforcing Encore-specific rules but otherwise | ||
relies on the underlying Go compiler to perform type-checking as part of | ||
building the application. | ||
|
||
### compiler | ||
The Encore Compiler rewrites the source code based on the parsed | ||
Encore Syntax Tree to create a fully functioning application. | ||
It rewrites API calls & API handlers, injects instrumentation | ||
and secret values, and more. |
Oops, something went wrong.