Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move frontend/ to frontend/console #2582

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
/.vscode
!.vscode/tasks.json
**/*.sw*
frontend/dist
frontend/console/dist
**/.DS_Store
**/target
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/frontend/src/protos/**/* linguist-generated=true
/frontend/console/src/protos/**/* linguist-generated=true
go.sum linguist-generated=true
go.work.sum linguist-generated=true
4 changes: 2 additions & 2 deletions .go-arch-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ components:
rust-runtime: { in: rust-runtime/** }
runner: { in: backend/runner/** }
ftl-runner-cmd: { in: cmd/ftl-runner/** }
frontend: { in: frontend/** }
frontend: { in: frontend/console/** }
ftl-gen-lsp-cmd: { in: cmd/ftl-gen-lsp/** }
ftl-initdb-cmd: { in: cmd/ftl-initdb/** }
ftl-schema-cmd: { in: cmd/ftl-schema/** }
Expand Down Expand Up @@ -104,4 +104,4 @@ deps:
encoding:
mayDependOn:
- common
- internal
- internal
17 changes: 11 additions & 6 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ RUNNER_TEMPLATE_ZIP := "backend/controller/scaling/localscaling/template.zip"
TIMESTAMP := `date +%s`
SCHEMA_OUT := "backend/protos/xyz/block/ftl/v1/schema/schema.proto"
ZIP_DIRS := "go-runtime/compile/build-template go-runtime/compile/external-module-template go-runtime/compile/main-work-template internal/projectinit/scaffolding go-runtime/scaffolding jvm-runtime/java/scaffolding jvm-runtime/kotlin/scaffolding"
FRONTEND_OUT := "frontend/dist/index.html"
CONSOLE_ROOT := "frontend/console"
FRONTEND_OUT := "{{CONSOLE_ROOT}}/dist/index.html"
EXTENSION_OUT := "extensions/vscode/dist/extension.js"
PROTOS_IN := "backend/protos/xyz/block/ftl/v1/schema/schema.proto backend/protos/xyz/block/ftl/v1/console/console.proto backend/protos/xyz/block/ftl/v1/ftl.proto backend/protos/xyz/block/ftl/v1/schema/runtime.proto"
PROTOS_OUT := "backend/protos/xyz/block/ftl/v1/console/console.pb.go backend/protos/xyz/block/ftl/v1/ftl.pb.go backend/protos/xyz/block/ftl/v1/schema/runtime.pb.go backend/protos/xyz/block/ftl/v1/schema/schema.pb.go frontend/src/protos/xyz/block/ftl/v1/console/console_pb.ts frontend/src/protos/xyz/block/ftl/v1/ftl_pb.ts frontend/src/protos/xyz/block/ftl/v1/schema/runtime_pb.ts frontend/src/protos/xyz/block/ftl/v1/schema/schema_pb.ts"
PROTOS_OUT := "backend/protos/xyz/block/ftl/v1/console/console.pb.go backend/protos/xyz/block/ftl/v1/ftl.pb.go backend/protos/xyz/block/ftl/v1/schema/runtime.pb.go backend/protos/xyz/block/ftl/v1/schema/schema.pb.go {{CONSOLE_ROOT}}/src/protos/xyz/block/ftl/v1/console/console_pb.ts {{CONSOLE_ROOT}}/src/protos/xyz/block/ftl/v1/ftl_pb.ts {{CONSOLE_ROOT}}/src/protos/xyz/block/ftl/v1/schema/runtime_pb.ts {{CONSOLE_ROOT}}/src/protos/xyz/block/ftl/v1/schema/schema_pb.ts"

_help:
@just -l
Expand Down Expand Up @@ -83,7 +84,7 @@ build-zips: build-kt-runtime

# Rebuild frontend
build-frontend: pnpm-install
@mk {{FRONTEND_OUT}} : frontend/src -- "cd frontend && pnpm run build"
@mk {{FRONTEND_OUT}} : {{CONSOLE_ROOT}}/src -- "cd {{CONSOLE_ROOT}} && pnpm run build"

# Rebuild VSCode extension
build-extension: pnpm-install
Expand All @@ -110,6 +111,10 @@ build-kt-runtime:
@mkdir -p build/template/ftl && touch build/template/ftl/temp.txt
@cd build/template && zip -q --symlinks -r ../../{{RUNNER_TEMPLATE_ZIP}} .

# Format console code.
format-frontend:
cd {{CONSOLE_ROOT}} && pnpm run lint:fix

# Install Node dependencies using pnpm
# Retry a few times in case of network issues
pnpm-install:
Expand Down Expand Up @@ -156,14 +161,14 @@ test-scripts:
scripts/tests/test-ensure-frozen-migrations.sh

test-frontend: build-frontend
@cd frontend && pnpm run test
@cd {{CONSOLE_ROOT}} && pnpm run test

e2e-frontend: build-frontend
@cd frontend && npx playwright install --with-deps && pnpm run e2e
@cd {{CONSOLE_ROOT}} && npx playwright install --with-deps && pnpm run e2e

# Lint the frontend
lint-frontend: build-frontend
@cd frontend && pnpm run lint && tsc
@cd {{CONSOLE_ROOT}} && pnpm run lint && tsc

# Lint the backend
lint-backend:
Expand Down
2 changes: 1 addition & 1 deletion backend/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import (
"github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1/ftlv1connect"
schemapb "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1/schema"
"github.com/TBD54566975/ftl/backend/schema"
"github.com/TBD54566975/ftl/frontend"
frontend "github.com/TBD54566975/ftl/frontend/console"
cf "github.com/TBD54566975/ftl/internal/configuration/manager"
"github.com/TBD54566975/ftl/internal/cors"
"github.com/TBD54566975/ftl/internal/encryption"
Expand Down
4 changes: 2 additions & 2 deletions backend/protos/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins:
out: .
opt: paths=source_relative
- plugin: es
out: ../../frontend/src/protos
out: ../../frontend/console/src/protos
opt: target=ts
- plugin: connect-es
out: ../../frontend/src/protos
out: ../../frontend/console/src/protos
opt: target=ts
2 changes: 1 addition & 1 deletion bin/hermit.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ env = {
"OTEL_GRPC_PORT": "4317",
"OTEL_HTTP_PORT": "4318",
"OTEL_METRIC_EXPORT_INTERVAL": "5000",
"PATH": "${HERMIT_ENV}/scripts:${HERMIT_ENV}/frontend/node_modules/.bin:${HERMIT_ENV}/extensions/vscode/node_modules/.bin:${PATH}",
"PATH": "${HERMIT_ENV}/scripts:${HERMIT_ENV}/frontend/console/node_modules/.bin:${HERMIT_ENV}/extensions/vscode/node_modules/.bin:${PATH}",
}
sources = ["env:///bin/packages", "https://github.com/cashapp/hermit-packages.git"]
2 changes: 1 addition & 1 deletion frontend/biome.json → frontend/console/biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["../biome.json"],
"extends": ["../../biome.json"],
"linter": {
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx", "src/**/*.cjs", "src/**/*.mjs", "tests/**/*.ts", "e2e/**/*.ts"],
"ignore": ["./node_modules", "./dist", "./src/protos"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions frontend/local.go → frontend/console/local.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build !release

package frontend
package console

import (
"context"
Expand Down Expand Up @@ -46,7 +46,7 @@ func Server(ctx context.Context, timestamp time.Time, publicURL *url.URL, allowO
return nil, err
}

err = exec.Command(ctx, log.Debug, path.Join(gitRoot, "frontend"), "pnpm", "run", "dev").Start()
err = exec.Command(ctx, log.Debug, path.Join(gitRoot, "frontend", "console"), "pnpm", "run", "dev").Start()
if err != nil {
return nil, err
}
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion frontend/release.go → frontend/console/release.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build release

package frontend
package console

import (
"context"
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ pre-push:
lint-backend:
run: just lint-backend
build-frontend:
root: frontend/
root: frontend/console/
run: just build-frontend
lint-frontend:
root: frontend/
root: frontend/console/
run: just lint-frontend
ensure-frozen-migrations:
run: just ensure-frozen-migrations
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
packages:
- 'frontend'
- 'extensions/vscode'
- "frontend/console"
- "extensions/vscode"
4 changes: 2 additions & 2 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
{
matchPackageNames: [
"@bufbuild/protobuf", // We can't update this until we update buf
"codemirror",
"codemirror",
"codemirror-json-schema",
],
enabled: false,
matchFileNames: ["frontend/**", "extensions/**"],
matchFileNames: ["frontend/console/**", "extensions/**"],
},
{
matchPackageNames: ["connectrpc.com/connect"],
Expand Down
2 changes: 1 addition & 1 deletion scripts/autofmt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ just pnpm-install
(cd backend/protos && buf generate)

echo "Formatting TypeScript..."
(cd frontend && pnpm run lint:fix)
just format-frontend

git diff
Loading