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

chore (repo): reorganize monorepo structure #1412

Closed
wants to merge 6 commits into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .buildkite/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ steps:
command:
- git fetch --tags
- export ELECTRIC_IMAGE_NAME="${DOCKER_REPO}/${IMAGE_NAME}"
- cd ./components/electric
- cd ./packages/electric
- export ELECTRIC_VERSION=$(make --silent print_version_from_git)
- export ELECTRIC_CANARY_IMAGE="${DOCKERHUB_REPO}/${IMAGE_NAME}:canary"
- make docker-build-ci
Expand All @@ -23,6 +23,6 @@ steps:
if: build.tag =~ /@core\/electric@/
command:
- export ELECTRIC_IMAGE_NAME="${DOCKERHUB_REPO}/${IMAGE_NAME}"
- cd ./components/electric
- cd ./packages/electric
- export ELECTRIC_VERSION=$(make --silent print_version_from_git)
- make docker-build-ci-crossplatform
6 changes: 3 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This `.dockerignore` file is used when building docker images from the repository root.
# In particular, we're building the `e2e/satellite_client` that way, because it relies on
# In particular, we're building the `packages/e2e/satellite_client` that way, because it relies on
# other packages within the monorepo. Without this, the context sent to docker build engine
# is over 5Gb due to all the dependencies we don't need anyway.

Expand All @@ -15,5 +15,5 @@
**/.npm
**/.cache

e2e/lux
e2e/lux_logs
packages/e2e/lux
packages/e2e/lux_logs
6 changes: 3 additions & 3 deletions .github/workflows/cli_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
pull_request:
paths:
- "pnpm-lock.yaml"
- "components/cli/**"
- "!components/cli/**.md"
- "packages/cli/**"
- "!packages/cli/**.md"

defaults:
run:
working-directory: components/cli
working-directory: packages/cli

concurrency:
group: cli-${{ github.ref }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
pull_request:
paths:
- "pnpm-lock.yaml"
- "clients/typescript/**"
- "!clients/typescript/**.md"
- "packages/client/**"
- "!packages/client/**.md"

defaults:
run:
working-directory: clients/typescript
working-directory: packages/client

concurrency:
group: clients-typescript-${{ github.ref }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/drivers_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
pull_request:
paths:
- "pnpm-lock.yaml"
- "components/drivers/**"
- "!components/drivers/**.md"
- "packages/drivers/**"
- "!packages/drivers/**.md"

defaults:
run:
working-directory: components/drivers
working-directory: packages/drivers

concurrency:
group: drivers-${{ github.ref }}
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
# Root files
- "*"
- "!pnpm-lock.yaml"
- "!clients/typescript/**" # Satellite tests run in a separate workflow
- "!packages/client/**" # Satellite tests run in a separate workflow
# CI files not related to GH actions
- ".buildkite/**"
- "**/README.md"
Expand All @@ -31,7 +31,7 @@ jobs:
write_to_pg_mode: [logical_replication, direct_writes]
defaults:
run:
working-directory: e2e
working-directory: packages/e2e
env:
BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_TEST_ANALYTICS_E2E }}
ELECTRIC_WRITE_TO_PG_MODE: ${{ matrix.write_to_pg_mode }}
Expand Down Expand Up @@ -61,23 +61,23 @@ jobs:

- run: |
echo "ELECTRIC_VERSION=$(make --silent print_version_from_git)" >> $GITHUB_ENV
working-directory: components/electric
working-directory: packages/electric
- run: make docker-build-ci
env:
ELECTRIC_IMAGE_NAME: electric-sql-ci/electric
working-directory: components/electric
working-directory: packages/electric
- run: make docker-build-ws-client
env:
ELECTRIC_CLIENT_IMAGE_NAME: electric-sql-ci/electric-ws-client
working-directory: components/electric
working-directory: packages/electric

- name: Cache built lux
uses: actions/cache@v4
with:
path: |
e2e/lux/bin
e2e/lux/ebin
e2e/lux/priv
packages/e2e/lux/bin
packages/e2e/lux/ebin
packages/e2e/lux/priv
key: ${{ runner.os }}-luxbuilt-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}

- run: make lux
Expand All @@ -94,10 +94,10 @@ jobs:
if: ${{ failure() && steps.tests.outcome == 'failure' }}
with:
name: lux_logs
path: e2e/**/lux_logs/run_*
path: packages/e2e/**/lux_logs/run_*
- name: Upload test results to Buildkite analytics
if: ${{ !cancelled() && steps.tests.outcome != 'skipped' && env.BUILDKITE_ANALYTICS_TOKEN != '' }}
working-directory: e2e/lux_logs/latest_run
working-directory: packages/e2e/lux_logs/latest_run
run: |
curl \
-X POST \
Expand All @@ -122,7 +122,7 @@ jobs:
name: E2E Satellite tests (Dialect ${{ matrix.dialect }} - uses DAL? ${{ matrix.dal }})
defaults:
run:
working-directory: e2e
working-directory: packages/e2e
env:
BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_TEST_ANALYTICS_E2E }}
DIALECT: ${{ matrix.dialect }}
Expand Down Expand Up @@ -152,23 +152,23 @@ jobs:

- run: |
echo "ELECTRIC_VERSION=$(make --silent print_version_from_git)" >> $GITHUB_ENV
working-directory: components/electric
working-directory: packages/electric
- run: make docker-build-ci
env:
ELECTRIC_IMAGE_NAME: electric-sql-ci/electric
working-directory: components/electric
working-directory: packages/electric
- run: make docker-build-ws-client
env:
ELECTRIC_CLIENT_IMAGE_NAME: electric-sql-ci/electric-ws-client
working-directory: components/electric
working-directory: packages/electric

- name: Cache built lux
uses: actions/cache@v4
with:
path: |
e2e/lux/bin
e2e/lux/ebin
e2e/lux/priv
packages/e2e/lux/bin
packages/e2e/lux/ebin
packages/e2e/lux/priv
key: ${{ runner.os }}-luxbuilt-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}

- run: make lux
Expand All @@ -185,10 +185,10 @@ jobs:
if: ${{ failure() && steps.tests.outcome == 'failure' }}
with:
name: lux_logs
path: e2e/**/lux_logs/run_*
path: packages/e2e/**/lux_logs/run_*
- name: Upload test results to Buildkite analytics
if: ${{ !cancelled() && steps.tests.outcome != 'skipped' && env.BUILDKITE_ANALYTICS_TOKEN != '' }}
working-directory: e2e/lux_logs/latest_run
working-directory: packages/e2e/lux_logs/latest_run
run: |
curl \
-X POST \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generator_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ on:
pull_request:
paths:
- "pnpm-lock.yaml"
- "generator/**"
- "packages/generator/**"

defaults:
run:
working-directory: generator
working-directory: packages/generator

jobs:
verify_formatting:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: Components / Electric / Tests
name: Packages / Electric / Tests

on:
push:
branches:
- main
pull_request:
paths:
- "components/electric/**"
- "!components/electric/**README.md"
- "packages/electric/**"
- "!packages/electric/**README.md"

env:
OTP_VERSION: "27.0"
ELIXIR_VERSION: "1.17.0-otp-27"

concurrency:
group: components-electric-${{ github.ref }}
group: packages-electric-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: components/electric
working-directory: packages/electric
env:
MIX_ENV: test
steps:
Expand All @@ -40,29 +40,29 @@ jobs:
- name: Restore dependencies
uses: actions/cache/restore@v4
with:
path: components/electric/deps
key: ${{ runner.os }}-mixdeps-${{ hashFiles('components/electric/**/mix.lock') }}
path: packages/electric/deps
key: ${{ runner.os }}-mixdeps-${{ hashFiles('packages/electric/**/mix.lock') }}
restore-keys: ${{ runner.os }}-mixdeps-
- name: Restore compiled code
uses: actions/cache/restore@v4
with:
path: |
components/electric/_build/*/lib
!components/electric/_build/*/lib/electric
key: ${{ runner.os }}-mixbuild-test-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('components/electric/**/mix.lock') }}
packages/electric/_build/*/lib
!packages/electric/_build/*/lib/electric
key: ${{ runner.os }}-mixbuild-test-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('packages/electric/**/mix.lock') }}
- run: mix deps.get && mix deps.compile
- name: Cache dependencies
uses: actions/cache/save@v4
with:
path: components/electric/deps
key: ${{ runner.os }}-mixdeps-${{ hashFiles('components/electric/**/mix.lock') }}
path: packages/electric/deps
key: ${{ runner.os }}-mixdeps-${{ hashFiles('packages/electric/**/mix.lock') }}
- name: Save compiled code
uses: actions/cache/save@v4
with:
path: |
components/electric/_build/*/lib
!components/electric/_build/*/lib/electric
key: ${{ runner.os }}-mixbuild-test-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('components/electric/**/mix.lock') }}
packages/electric/_build/*/lib
!packages/electric/_build/*/lib/electric
key: ${{ runner.os }}-mixbuild-test-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('packages/electric/**/mix.lock') }}

- run: mix compile --force --all-warnings --warnings-as-errors
- name: Prepare auxiliary services
Expand All @@ -74,7 +74,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: components/electric
working-directory: packages/electric
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -88,8 +88,8 @@ jobs:
id: cache-deps
uses: actions/cache@v4
with:
path: components/electric/deps
key: ${{ runner.os }}-mixdeps-${{ hashFiles('components/electric/**/mix.lock') }}
path: packages/electric/deps
key: ${{ runner.os }}-mixdeps-${{ hashFiles('packages/electric/**/mix.lock') }}
- run: mix deps.get
- run: make check-format

Expand All @@ -98,7 +98,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: components/electric
working-directory: packages/electric
env:
MIX_ENV: dev
steps:
Expand All @@ -115,28 +115,28 @@ jobs:
id: cache-deps
uses: actions/cache@v4
with:
path: components/electric/deps
key: ${{ runner.os }}-mixdeps-${{ hashFiles('components/electric/**/mix.lock') }}
path: packages/electric/deps
key: ${{ runner.os }}-mixdeps-${{ hashFiles('packages/electric/**/mix.lock') }}
- name: Restore compiled code
uses: actions/cache/restore@v4
with:
path: |
components/electric/_build/*/lib
!components/electric/_build/*/lib/electric
key: ${{ runner.os }}-mixbuild-dev-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('components/electric/**/mix.lock') }}
packages/electric/_build/*/lib
!packages/electric/_build/*/lib/electric
key: ${{ runner.os }}-mixbuild-dev-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('packages/electric/**/mix.lock') }}
- run: mix deps.get && mix deps.compile
- name: Save compiled code
uses: actions/cache/save@v4
with:
path: |
components/electric/_build/*/lib
!components/electric/_build/*/lib/electric
key: ${{ runner.os }}-mixbuild-dev-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('components/electric/**/mix.lock') }}
packages/electric/_build/*/lib
!packages/electric/_build/*/lib/electric
key: ${{ runner.os }}-mixbuild-dev-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('packages/electric/**/mix.lock') }}
- run: mix compile --force --all-warnings --warnings-as-errors
- name: Cache PLT
uses: actions/cache/restore@v4
with:
path: components/electric/_build/*/*.plt
path: packages/electric/_build/*/*.plt
key: ${{ runner.os }}-plt-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ github.ref_name }}
restore-keys: ${{ runner.os }}-plt-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-

Expand All @@ -147,5 +147,5 @@ jobs:
if: ${{ always() && steps.dialyzer.outcome != 'cancelled' }}
uses: actions/cache/save@v4
with:
path: components/electric/_build/*/*.plt
path: packages/electric/_build/*/*.plt
key: ${{ runner.os }}-plt-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ github.ref_name }}
4 changes: 2 additions & 2 deletions .github/workflows/toolbar_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ on:
pull_request:
paths:
- "pnpm-lock.yaml"
- "components/toolbar/**"
- "packages/toolbar/**"

defaults:
run:
working-directory: components/toolbar
working-directory: packages/toolbar

jobs:
verify_formatting:
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
build_all:
make -C components/electric docker-build
make -C packages/electric docker-build

test_all:
make -C components/electric deps tests
make -C clients/typescript deps tests
make -C generator deps tests
make -C e2e test
make -C packages/electric deps tests
make -C packages/client deps tests
make -C packages/generator deps tests
make -C packages/e2e test

update_protobuf:
make -C components/electric update_protobuf
make -C clients/typescript update_protobuf
make -C packages/electric update_protobuf
make -C packages/client update_protobuf
Loading