Skip to content

Commit 716d43a

Browse files
jrmijonadelinebram2wcezary-baserowpaljort
authored
Nuxt 3 migration (baserow#4342)
Update the nuxt3 version. Co-authored-by: Jonathan Adeline <jonathan@baserow.io> Co-authored-by: Bram Wiepjes <bramw@protonmail.com> Co-authored-by: Cezary <cezary@baserow.io> Co-authored-by: Tsering Paljor <tsering@baserow.io> Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io> Co-authored-by: Bram <bram2w@users.noreply.github.com>
1 parent 840718e commit 716d43a

File tree

1,444 files changed

+52873
-56424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,444 files changed

+52873
-56424
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ insert_final_newline = true
1111
[Makefile]
1212
indent_style = tab
1313

14-
[*.{js,yml,scss,eslintrc,stylelintrc,vue,html,json,ts}]
14+
[*.{js,mjs,yml,scss,eslintrc,stylelintrc,vue,html,json,ts,prettierrc}]
1515
indent_size = 2
1616

1717
[*.md]

.github/workflows/ci.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
workflow_dispatch:
1010
inputs:
1111
clear_cache:
12-
description: 'Clear Docker build cache before building'
12+
description: "Clear Docker build cache before building"
1313
required: false
1414
default: false
1515
type: boolean
@@ -459,7 +459,7 @@ jobs:
459459
strategy:
460460
fail-fast: false
461461
matrix:
462-
shard: [1, 2, 3, 4]
462+
shard: [1, 2, 3]
463463
steps:
464464
- name: Log in to GitHub Container Registry
465465
uses: docker/login-action@v3
@@ -469,15 +469,18 @@ jobs:
469469
password: ${{ secrets.GITHUB_TOKEN }}
470470

471471
- name: Run web-frontend tests for shard ${{ matrix.shard }}
472+
env:
473+
CI: "true"
474+
EXTRA_VITEST_PARAMS: --shard=${{ matrix.shard }}/3 --reporter=junit --outputFile=./reports/junit.xml
472475
run: |
473476
mkdir -p reports
474477
docker run \
475478
--name=webfrontend_test \
476-
-e JEST_SHARD_INDEX=${{ matrix.shard }} \
477-
-e JEST_SHARD_TOTAL=4 \
479+
-e EXTRA_VITEST_PARAMS="$EXTRA_VITEST_PARAMS" \
478480
${{ needs.build-frontend.outputs.image }} ci-test | tee reports/stdout.txt
479-
docker cp webfrontend_test:/baserow/reports/. ./reports
481+
docker cp webfrontend_test:/baserow/web-frontend/reports/junit.xml ./reports
480482
docker rm webfrontend_test
483+
ls ./reports
481484
482485
- name: Upload test reports
483486
uses: actions/upload-artifact@v4
@@ -611,7 +614,7 @@ jobs:
611614
- name: Setup Node.js
612615
uses: actions/setup-node@v4
613616
with:
614-
node-version: "18"
617+
node-version: "24"
615618
cache: "yarn"
616619
cache-dependency-path: "e2e-tests/yarn.lock"
617620

@@ -733,6 +736,7 @@ jobs:
733736
PUBLIC_BACKEND_URL: http://localhost:8000
734737
PUBLIC_WEB_FRONTEND_URL: http://localhost:3000
735738
PRIVATE_BACKEND_URL: http://backend:8000
739+
CI: 1
736740
run: |
737741
cd e2e-tests
738742
CI=1 npx playwright test --timeout=30000 --grep-invert=@slow --shard=${{ matrix.shard }}/2 --project=firefox
@@ -778,7 +782,7 @@ jobs:
778782
- name: Setup Node.js
779783
uses: actions/setup-node@v4
780784
with:
781-
node-version: "18"
785+
node-version: "24"
782786

783787
- name: Download all E2E test results
784788
uses: actions/download-artifact@v4
@@ -919,8 +923,8 @@ jobs:
919923
if: needs.check-build-and-publish.outputs.should_build_and_publish == 'true' && (github.ref_name == 'develop' || github.ref_name == 'master' || github.event_name == 'workflow_dispatch')
920924
needs:
921925
- test-frontend
922-
- test-e2e
923926
- frontend-lint
927+
- test-e2e
924928
- check-build-and-publish
925929
permissions:
926930
contents: read

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,10 @@ field-diagrams/
159159

160160
*.http
161161

162-
# Intellij needs this package.json to allow running tests from the IDE but this isn't
163-
# actually a node module and so we ignore it.
164-
premium/web-frontend/package.json
165162
.local/
166163

167164
# Storybook
168165
web-frontend/.nuxt-storybook/
169166
web-frontend/storybook-static
167+
168+
.agent
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"type": "refactor",
3+
"message": "refactor $children",
4+
"domain": "core",
5+
"issue_number": null,
6+
"bullet_points": [],
7+
"created_at": "2025-03-21"
8+
}

docker-compose.dev.yml

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -64,35 +64,9 @@ services:
6464
# reducing the chance the containers screw up the bind mounted folders.
6565
UID: $UID
6666
GID: $GID
67+
command: "nuxt-dev-with-storybook"
6768
ports:
6869
- "${HOST_PUBLISH_IP:-127.0.0.1}:3000:3000"
69-
volumes:
70-
- ./web-frontend:/baserow/web-frontend
71-
- ./premium/web-frontend/:/baserow/premium/web-frontend
72-
- ./enterprise/web-frontend/:/baserow/enterprise/web-frontend
73-
- ./tests/:/baserow/tests
74-
- ./deploy/plugins:/baserow/plugins
75-
# dev volumes to avoid polluting your local filesystem with build files or
76-
# overwriting existing node_modules.
77-
- node_modules:/baserow/web-frontend/node_modules
78-
- nuxt:/baserow/web-frontend/.nuxt/
79-
- cache:/baserow/web-frontend/.cache/
80-
# Open stdin and tty so when attaching key input works as expected.
81-
stdin_open: true
82-
tty: true
83-
84-
web-frontend-storybook:
85-
image: baserow_web-frontend:dev
86-
profiles: ["optional"]
87-
restart: unless-stopped
88-
environment:
89-
FEATURE_FLAGS:
90-
networks:
91-
local:
92-
command: "storybook-dev"
93-
healthcheck:
94-
disable: true
95-
ports:
9670
- "${HOST_PUBLISH_IP:-127.0.0.1}:6006:6006"
9771
volumes:
9872
- ./web-frontend:/baserow/web-frontend
@@ -250,4 +224,4 @@ volumes:
250224
node_modules:
251225
nuxt:
252226
storybook:
253-
cache:
227+
cache:

docs/installation/configuration-files/supervisor.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ stderr_logfile=/var/log/baserow/exportworker.error
3535

3636
[program:nuxt]
3737
directory=/baserow/baserow/web-frontend
38-
command=node ./node_modules/.bin/nuxt start --hostname 127.0.0.1 --config-file ./config/nuxt.config.local.js
38+
command=node ./node_modules/.bin/nuxt start --hostname 127.0.0.1 --config-file ./config/nuxt.config.local.ts
3939
stdout_logfile=/var/log/baserow/frontend.log
4040
stderr_logfile=/var/log/baserow/frontend.error
4141

e2e-tests/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
"test-builder": "playwright test --project=chrome --grep builder",
1414
"test-automation": "playwright test --project=chrome --grep automation",
1515
"test-headed": "playwright test --project=chrome --headed",
16-
"test-ci": "playwright test --grep-invert=@slow",
16+
"test-ci": "CI=1 playwright test --grep-invert=@slow",
1717
"codegen": "playwright codegen"
1818
},
1919
"dependencies": {
2020
"@faker-js/faker": "7.6.0",
21+
"@nuxt/test-utils": "^3.21.0",
2122
"@playwright/test": "^1.48.0",
2223
"axios": "1.2.3",
2324
"dotenv": "16.0.3"

e2e-tests/pages/automation/automationWorkflowPage.ts

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
import { Page } from "@playwright/test"
2-
import { BaserowPage } from "../baserowPage"
3-
import { Automation } from "../../fixtures/automation/automation"
4-
import { AutomationWorkflow } from "../../fixtures/automation/automationWorkflow"
5-
import { Workspace } from "../../fixtures/workspace"
6-
1+
import { Page } from "@playwright/test";
2+
import { BaserowPage, PageConfig } from "../baserowPage";
3+
import { Automation } from "../../fixtures/automation/automation";
4+
import { AutomationWorkflow } from "../../fixtures/automation/automationWorkflow";
5+
import { Workspace } from "../../fixtures/workspace";
76

87
export class AutomationWorkflowPage extends BaserowPage {
9-
automationWorkflow: AutomationWorkflow
10-
automation: Automation
11-
readonly workspace: Workspace
8+
automationWorkflow: AutomationWorkflow;
9+
automation: Automation;
10+
readonly workspace: Workspace;
1211

13-
constructor(page: Page, automation: Automation, automationWorkflow: AutomationWorkflow) {
14-
super(page)
15-
this.automation = automation
16-
this.automationWorkflow = automationWorkflow
12+
constructor(
13+
pageConfig: PageConfig,
14+
automation: Automation,
15+
automationWorkflow: AutomationWorkflow
16+
) {
17+
super(pageConfig);
18+
this.automation = automation;
19+
this.automationWorkflow = automationWorkflow;
1720
}
1821

1922
async removeAll() {}

e2e-tests/pages/baserowPage.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,32 @@ import { Locator, Page, expect } from "@playwright/test";
22
import { baserowConfig } from "../playwright.config";
33
import { User } from "../fixtures/user";
44

5+
import { GotoOptions } from "@nuxt/test-utils/e2e";
6+
7+
type GotoFn = (url: string, options?: GotoOptions) => Promise<Response | null>;
8+
9+
export type PageConfig = { page: Page; goto: GotoFn };
10+
511
export class BaserowPage {
612
readonly page: Page;
13+
readonly _goto: any;
714
readonly baseUrl = baserowConfig.PUBLIC_WEB_FRONTEND_URL;
815
pageUrl: string;
916

10-
constructor(page: Page) {
17+
constructor({ page, goto }: PageConfig) {
1118
this.page = page;
19+
this._goto = goto;
1220
}
1321

1422
async authenticate(user: User) {
1523
await this.page.goto(`${this.baseUrl}?token=${user.refreshToken}`);
1624
}
1725

18-
async goto() {
19-
await this.page.goto(this.getFullUrl());
26+
async goto(params = {}) {
27+
await this._goto(this.getFullUrl(), {
28+
waitUntil: "hydration",
29+
...params,
30+
});
2031
}
2132

2233
async checkOnPage() {

e2e-tests/pages/builder/builderPagePage.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Locator, Page } from "@playwright/test";
2-
import { BaserowPage } from "../baserowPage";
2+
import { BaserowPage, PageConfig } from "../baserowPage";
33
import { Builder } from "../../fixtures/builder/builder";
44
import { BuilderPage } from "../../fixtures/builder/builderPage";
55
import { Workspace } from "../../fixtures/workspace";
@@ -12,8 +12,12 @@ export class BuilderPagePage extends BaserowPage {
1212
builder: Builder;
1313
readonly workspace: Workspace;
1414

15-
constructor(page: Page, builder: Builder, builderPage: BuilderPage) {
16-
super(page);
15+
constructor(
16+
pageConfig: PageConfig,
17+
builder: Builder,
18+
builderPage: BuilderPage
19+
) {
20+
super(pageConfig);
1721
this.builder = builder;
1822
this.builderPage = builderPage;
1923
}
@@ -24,10 +28,10 @@ export class BuilderPagePage extends BaserowPage {
2428
.locator(".elements-context")
2529
.getByText("Element", { exact: true })
2630
.click();
27-
return new BuilderElementModal(this.page);
31+
return new BuilderElementModal({ page: this.page, goto: this._goto });
2832
}
2933

30-
async selectHeadingByName(name) {
34+
async selectHeadingByName(name: string) {
3135
const heading = await this.page
3236
.locator(".ab-heading")
3337
.getByText(name, { exact: true });
@@ -42,7 +46,7 @@ export class BuilderPagePage extends BaserowPage {
4246
).toBeVisible();
4347
}
4448

45-
async selectButtonByName(name) {
49+
async selectButtonByName(name: string) {
4650
const button = await this.page
4751
.locator(".ab-button")
4852
.getByText(name, { exact: true });

0 commit comments

Comments
 (0)