зеркало из https://github.com/golang/pkgsite.git
all: run prettier on markdown files
./all.bash prettier now runs on files with a .md file extension. Several existing .md files are formatted. Change-Id: Id083a932cdd5db105ae7494b71bcad340b080132 Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/756682 Reviewed-by: Andrew Bonventre <andybons@google.com>
This commit is contained in:
Родитель
773ca32944
Коммит
23f4a4a759
|
@ -25,20 +25,19 @@ Issues that are suitable for contributors are additionally tagged with the
|
|||
|
||||
Before you begin working on an issue, please leave a comment that you are claiming it.
|
||||
|
||||
|
||||
## Getting started
|
||||
|
||||
1. Get the source code:
|
||||
|
||||
` $ git clone https://go.googlesource.com/pkgsite`
|
||||
`$ git clone https://go.googlesource.com/pkgsite`
|
||||
|
||||
- Our canonical Git repository is located at [https://go.googlesource.com/pkgsite](https://go.googlesource.com/pkgsite). [github.com/golang/pkgsite](https://github.com/golang/pkgsite) is a mirror of that repository.
|
||||
|
||||
2. Review the [design document](doc/design.md).
|
||||
|
||||
3. We deploy to the [Google Cloud Platform](https://cloud.google.com). If you
|
||||
wish to set up a similar environment, you will want to
|
||||
download and install the Google Cloud SDK at https://cloud.google.com/sdk/docs/.
|
||||
wish to set up a similar environment, you will want to
|
||||
download and install the Google Cloud SDK at https://cloud.google.com/sdk/docs/.
|
||||
|
||||
4. Depending on the feature you are working on, review the contributing guides for:
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ pkg.go.dev.
|
|||
|
||||
We encourage everyone to begin using pkg.go.dev today for all of their needs
|
||||
and [file feedback](https://golang.org/s/discovery-feedback)! You can redirect
|
||||
all of your requests from godoc.org to pkg.go.dev, by clicking `Always use
|
||||
pkg.go.dev` at the top of any page on godoc.org.
|
||||
all of your requests from godoc.org to pkg.go.dev, by clicking
|
||||
`Always use pkg.go.dev` at the top of any page on godoc.org.
|
||||
|
||||
If you are having issues with pkg.go.dev, please first check the known issues
|
||||
before following the troubleshooting guide. If that does not give you the
|
||||
|
|
1
all.bash
1
all.bash
|
@ -118,6 +118,7 @@ run_prettier() {
|
|||
fi
|
||||
runcmd prettier --write content/static/css/*.css
|
||||
runcmd prettier --write content/static/js/*.js
|
||||
runcmd prettier --write **/*.md
|
||||
}
|
||||
|
||||
standard_linters() {
|
||||
|
|
|
@ -9,7 +9,6 @@ Pkg.go.dev consists of two services backed by a common database.
|
|||
Both services are hosted on App Engine Standard and run Go 1.13. We use
|
||||
A Postgres database managed by [Google Cloud SQL](https://cloud.google.com/sql).
|
||||
|
||||
|
||||
## The Frontend
|
||||
|
||||
The frontend is a straightforward HTTP server that composes HTML pages by
|
||||
|
@ -43,6 +42,7 @@ Because it must be a stateless HTTP server, the worker cannot run background
|
|||
tasks. Instead, we use [Google Cloud
|
||||
Scheduler](https://cloud.google.com/scheduler) to run activities periodically.
|
||||
The activities, which typically run once a minute, are:
|
||||
|
||||
- Poll the index to enqueue new modules.
|
||||
- Re-enqueue transient module-processing failures.
|
||||
- Update the count of importers for each package.
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
# Frontend Development
|
||||
|
||||
|
||||
The main program lives in `cmd/frontend`.
|
||||
|
||||
You can run the frontend locally like so:
|
||||
|
||||
```
|
||||
go run cmd/frontend/main.go [-reload_templates] [-direct_proxy]
|
||||
```
|
||||
|
||||
- The `-reload_templates` flag reloads templates on each page load.
|
||||
|
||||
The frontend can use one of two datasources:
|
||||
|
@ -19,5 +20,4 @@ The `Datasource` interface implementation is available at internal/datasource.go
|
|||
The `-direct_proxy` flag can be used to run the frontend with its datasource as
|
||||
the proxy service.
|
||||
|
||||
|
||||
The bulk of the code lives in `internal/frontend`.
|
||||
|
|
|
@ -19,8 +19,7 @@ We use [PostgreSQL](https://www.postgresql.org).
|
|||
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=pick_a_secret -e LANG=C postgres
|
||||
```
|
||||
|
||||
(NOTE: If you have already installed postgres on a workstation using `sudo
|
||||
apt-get install postgres`, you may have a server already running, and the above
|
||||
(NOTE: If you have already installed postgres on a workstation using `sudo apt-get install postgres`, you may have a server already running, and the above
|
||||
docker command will fail because it can't bind the port. At that point you can
|
||||
set `GO_DISCOVERY_DATABASE_TEST_`XXX environment variables to use your installed
|
||||
server, or stop the server using `pg_ctl stop` and use docker. The following
|
||||
|
@ -34,7 +33,7 @@ We use [PostgreSQL](https://www.postgresql.org).
|
|||
2. Set the following environment variables:
|
||||
|
||||
- `GO_DISCOVERY_DATABASE_USER` (default: postgres)
|
||||
- `GO_DISCOVERY_DATABASE_PASSWORD` (default: '')
|
||||
- `GO_DISCOVERY_DATABASE_PASSWORD` (default: '')
|
||||
- `GO_DISCOVERY_DATABASE_HOST` (default: localhost)
|
||||
- `GO_DISCOVERY_DATABASE_NAME` (default: discovery-db)
|
||||
|
||||
|
@ -73,11 +72,9 @@ Run `./all.bash` to verify your setup.
|
|||
|
||||
## Migrations
|
||||
|
||||
Migrations are managed with the [golang-migrate/migrate][] [CLI tool][].
|
||||
|
||||
[golang-migrate/migrate]: https://github.com/golang-migrate/migrate
|
||||
[CLI tool]: https://github.com/golang-migrate/migrate/tree/master/cli
|
||||
|
||||
Migrations are managed using
|
||||
[github.com/golang-migrate/migrate](https://github.com/golang-migrate/migrate), with the
|
||||
[CLI tool](https://github.com/golang-migrate/migrate/tree/master/cli).
|
||||
|
||||
### Creating a migration
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ the pre-push hook is called with. Make this the contents of `.git/hooks/pre-push
|
|||
#!/bin/sh
|
||||
./all.bash
|
||||
```
|
||||
|
||||
and then
|
||||
|
||||
```
|
||||
|
@ -31,7 +32,7 @@ chmod +x .git/hooks/pre-push
|
|||
### Running Linters/Formatters/Tests
|
||||
|
||||
The `all.bash` script can be used to selectively run actions on the source (e.g.
|
||||
linters, code formatters, or tests). Run `./all.bash help` to see a list of
|
||||
linters, code formatters, or tests). Run `./all.bash help` to see a list of
|
||||
supported actions.
|
||||
|
||||
Some actions are not run by the default invocation of `./all.bash` that is
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
The main program lives in `cmd/worker`.
|
||||
|
||||
You can run the worker locally like so:
|
||||
|
||||
```
|
||||
go run cmd/worker/main.go
|
||||
```
|
||||
|
@ -15,5 +16,5 @@ automatically retry failures.
|
|||
|
||||
In order to populate local versions, you can either fetch the version explicitly
|
||||
(via `http://localhost:8000/fetch/path/to/package/@v/v1.2.3`), or you can visit the
|
||||
Worker dashboard, and click 'Enqueue from module index'. This will enqueue the
|
||||
Worker dashboard, and click 'Enqueue from module index'. This will enqueue the
|
||||
next N versions from the index for processing.
|
||||
|
|
Загрузка…
Ссылка в новой задаче