Skip to content

Commit b3216da

Browse files
committed
fix: restructure headless browser app to its own folder
1 parent cffbef3 commit b3216da

33 files changed

+909
-214
lines changed

.dockerignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/node_modules
2+
**/.git
3+
**/.vscode
4+
**/dist
5+
**/build
6+
**/.DS_Store
7+
**/.env*
8+
**/*.log
9+
10+
# Exclude all packages except browser-tests and browser-container
11+
packages/discovery/
12+
packages/tests/
13+
packages/utils/
14+
packages/sds/
15+
packages/sdk/
16+
packages/relay/
17+
packages/rln/
18+
packages/message-hash/
19+
packages/proto/
20+
packages/enr/
21+
packages/interfaces/
22+
packages/message-encryption/
23+
packages/core/
24+
packages/react-native-polyfills/
25+
packages/build-utils/

.eslintrc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
"project": ["./tsconfig.json"]
66
},
77
"env": { "es6": true },
8-
"ignorePatterns": ["node_modules", "build", "coverage", "proto"],
8+
"ignorePatterns": [
9+
"node_modules",
10+
"build",
11+
"coverage",
12+
"proto",
13+
"**/webpack.config.js"
14+
],
915
"plugins": ["import", "eslint-comments", "functional"],
1016
"extends": [
1117
"eslint:recommended",

.github/workflows/ci.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ jobs:
2929
with:
3030
node-version: ${{ env.NODE_JS }}
3131
- uses: ./.github/actions/npm
32-
- name: Install headless dependencies
33-
run: cd packages/browser-tests/headless && npm install
3432
- run: npm run build
3533
- run: npm run check
3634
- run: npm run doc
@@ -45,8 +43,6 @@ jobs:
4543
with:
4644
node-version: ${{ env.NODE_JS }}
4745
- uses: ./.github/actions/npm
48-
- name: Install headless dependencies
49-
run: cd packages/browser-tests/headless && npm install
5046
- name: Generate protobuf code
5147
run: |
5248
npm run proto
@@ -72,8 +68,6 @@ jobs:
7268
with:
7369
node-version: ${{ env.NODE_JS }}
7470
- uses: ./.github/actions/npm
75-
- name: Install headless dependencies
76-
run: cd packages/browser-tests/headless && npm install
7771
- run: npm run build:esm
7872
- run: npm run test:browser
7973

.github/workflows/playwright.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929

3030
- uses: ./.github/actions/npm
3131

32-
- name: Install headless dependencies
33-
run: cd packages/browser-tests/headless && npm install
32+
- name: Build browser container
33+
run: npm run build --workspace=@waku/browser-container
3434

3535
- name: Build browser test environment
3636
run: npm run build --workspace=@waku/browser-tests

packages/browser-tests/Dockerfile renamed to Dockerfile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,33 +27,36 @@ RUN apt-get update && apt-get install -y \
2727
# Set working directory
2828
WORKDIR /app
2929

30-
# Copy package.json files
31-
COPY package.json ./
32-
COPY tsconfig.json ./
33-
COPY headless/package.json ./headless/
34-
COPY types/ ./types/
30+
# Copy package.json and install dependencies
31+
COPY package.json package-lock.json ./
32+
COPY packages/browser-tests/package.json ./packages/browser-tests/
33+
COPY packages/headless-tests/package.json ./packages/headless-tests/
3534

3635
# Install dependencies
3736
RUN npm install
38-
RUN cd headless && npm install
37+
RUN cd packages/browser-tests && npm install
38+
RUN cd packages/headless-tests && npm install
3939

40-
# Make sure serve is installed globally to avoid import issues
40+
# Install serve globally
4141
RUN npm install -g serve
4242

43-
# Copy project files
44-
COPY . .
43+
# Copy source files
44+
COPY tsconfig.json ./
45+
COPY packages/browser-tests/tsconfig.json ./packages/browser-tests/
46+
COPY packages/headless-tests/ ./packages/headless-tests/
47+
COPY packages/browser-tests/src/ ./packages/browser-tests/src/
4548

46-
# Build headless package
47-
RUN cd headless && npm run build
49+
# Build headless-tests package
50+
RUN cd packages/headless-tests && npm run build
4851

4952
# Install Playwright browsers
5053
RUN npx playwright install chromium
5154

5255
# Build TypeScript server
53-
RUN npm run build:server
56+
RUN cd packages/browser-tests && npm run build:server
5457

5558
# Expose port for the API server
5659
EXPOSE 3000
5760

5861
# Start the API server
59-
CMD ["npm", "run", "start:server"]
62+
CMD ["sh", "-c", "cd packages/browser-tests && npm run start:server"]

0 commit comments

Comments
 (0)