mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
78e652a268
This refactors the front-end collateral to all live within `site` - so no `package.json` at the root. The reason we had this initially is that the jest test run and NextJS actually require having _two_ different `tsconfig`s - Next needs `jsx:"preserve"`, while jest needs `jsx:"react"` - we were using `tsconfig`s at different levels at the hierarchy to manage this. I changed this behavior to still use two different `tsconfig.json`s, which is mandatory - but just side-by-side in `site`. Once that's fixed, it was easy to move everything into `site` Follow up from: https://github.com/coder/coder/pull/118#discussion_r796244577
79 lines
2.0 KiB
Makefile
79 lines
2.0 KiB
Makefile
bin/coderd:
|
|
mkdir -p bin
|
|
go build -o bin/coderd cmd/coderd/main.go
|
|
.PHONY: bin/coderd
|
|
|
|
bin/provisionerd:
|
|
mkdir -p bin
|
|
go build -o bin/provisionerd cmd/provisionerd/main.go
|
|
.PHONY: bin/provisionerd
|
|
|
|
build: site/out bin/coderd bin/provisionerd
|
|
.PHONY: build
|
|
|
|
# Runs migrations to output a dump of the database.
|
|
database/dump.sql: $(wildcard database/migrations/*.sql)
|
|
go run database/dump/main.go
|
|
|
|
# Generates Go code for querying the database.
|
|
database/generate: fmt/sql database/dump.sql database/query.sql
|
|
cd database && sqlc generate && rm db_tmp.go
|
|
cd database && gofmt -w -r 'Querier -> querier' *.go
|
|
cd database && gofmt -w -r 'Queries -> sqlQuerier' *.go
|
|
.PHONY: database/generate
|
|
|
|
fmt/prettier:
|
|
@echo "--- prettier"
|
|
# Avoid writing files in CI to reduce file write activity
|
|
ifdef CI
|
|
cd site && yarn run format:check
|
|
else
|
|
cd site && yarn run format:write
|
|
endif
|
|
.PHONY: fmt/prettier
|
|
|
|
fmt/sql: ./database/query.sql
|
|
npx sql-formatter \
|
|
--language postgresql \
|
|
--lines-between-queries 2 \
|
|
./database/query.sql \
|
|
--output ./database/query.sql
|
|
sed -i 's/@ /@/g' ./database/query.sql
|
|
|
|
fmt: fmt/prettier fmt/sql
|
|
.PHONY: fmt
|
|
|
|
gen: database/generate peerbroker/proto provisionersdk/proto provisionerd/proto
|
|
.PHONY: gen
|
|
|
|
peerbroker/proto: peerbroker/proto/peerbroker.proto
|
|
protoc \
|
|
--go_out=. \
|
|
--go_opt=paths=source_relative \
|
|
--go-drpc_out=. \
|
|
--go-drpc_opt=paths=source_relative \
|
|
./peerbroker/proto/peerbroker.proto
|
|
.PHONY: peerbroker/proto
|
|
|
|
provisionerd/proto: provisionerd/proto/provisionerd.proto
|
|
protoc \
|
|
--go_out=. \
|
|
--go_opt=paths=source_relative \
|
|
--go-drpc_out=. \
|
|
--go-drpc_opt=paths=source_relative \
|
|
./provisionerd/proto/provisionerd.proto
|
|
.PHONY: provisionerd/proto
|
|
|
|
provisionersdk/proto: provisionersdk/proto/provisioner.proto
|
|
protoc \
|
|
--go_out=. \
|
|
--go_opt=paths=source_relative \
|
|
--go-drpc_out=. \
|
|
--go-drpc_opt=paths=source_relative \
|
|
./provisionersdk/proto/provisioner.proto
|
|
.PHONY: provisionersdk/proto
|
|
|
|
site/out:
|
|
cd site && yarn build
|
|
cd site && yarn export
|
|
.PHONY: site/out |