Skip to content

Commit c4d6572

Browse files
authored
feat: [ZN-567] replace react router with tanstack router (#161)
* feat: replace react router with tanstack router * chore: add changeset file * fix: fix playwright tests * refactor: cleanup router setup in test environment * fix: fix users list logic * chore: update docs for tanstack router * feat: adjust plop to new routes directory * feat: delete cypress e2e tests & configs * fix: update gitlab ci pipelines
1 parent 7eee65b commit c4d6572

File tree

77 files changed

+2945
-13086
lines changed

Some content is hidden

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

77 files changed

+2945
-13086
lines changed

.changeset/clever-pots-collect.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-starter-boilerplate": minor
3+
---
4+
5+
replace react router with tanstack router

.github/workflows/e2e.yml

Lines changed: 66 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,29 @@ jobs:
2828
image: mcr.microsoft.com/playwright:v1.43.0-focal
2929
defaults:
3030
run:
31-
working-directory: e2e-playwright
31+
working-directory: e2e
3232
steps:
33-
- uses: actions/checkout@master
34-
- name: Download build
35-
uses: actions/download-artifact@v3
36-
with:
37-
name: build
38-
path: build
39-
- name: Copy e2e envs
40-
run: cp .env.dist .env
41-
- name: Install e2e dependencies
42-
run: npm install
43-
- name: Run build and tests
44-
run: npm run test:chrome
45-
- name: Upload test results
46-
uses: actions/upload-artifact@v3
47-
if: always()
48-
with:
49-
name: e2e-chrome-artifacts
50-
path: |
51-
e2e-playwright/test-report/
52-
e2e-playwright/test-results/
53-
retention-days: 30
33+
- uses: actions/checkout@master
34+
- name: Download build
35+
uses: actions/download-artifact@v3
36+
with:
37+
name: build
38+
path: build
39+
- name: Copy e2e envs
40+
run: cp .env.dist .env
41+
- name: Install e2e dependencies
42+
run: npm install
43+
- name: Run build and tests
44+
run: npm run test:chrome
45+
- name: Upload test results
46+
uses: actions/upload-artifact@v3
47+
if: always()
48+
with:
49+
name: e2e-chrome-artifacts
50+
path: |
51+
e2e/test-report/
52+
e2e/test-results/
53+
retention-days: 30
5454

5555
e2e_firefox:
5656
needs: prepare_app
@@ -60,29 +60,29 @@ jobs:
6060
options: --user 1001
6161
defaults:
6262
run:
63-
working-directory: e2e-playwright
63+
working-directory: e2e
6464
steps:
65-
- uses: actions/checkout@master
66-
- name: Download build
67-
uses: actions/download-artifact@v3
68-
with:
69-
name: build
70-
path: build
71-
- name: Copy e2e envs
72-
run: cp .env.dist .env
73-
- name: Install e2e dependencies
74-
run: npm install
75-
- name: Run build and tests
76-
run: npm run test:firefox
77-
- name: Upload test results
78-
uses: actions/upload-artifact@v3
79-
if: always()
80-
with:
81-
name: e2e-firefox-artifacts
82-
path: |
83-
e2e-playwright/test-report/
84-
e2e-playwright/test-results/
85-
retention-days: 30
65+
- uses: actions/checkout@master
66+
- name: Download build
67+
uses: actions/download-artifact@v3
68+
with:
69+
name: build
70+
path: build
71+
- name: Copy e2e envs
72+
run: cp .env.dist .env
73+
- name: Install e2e dependencies
74+
run: npm install
75+
- name: Run build and tests
76+
run: npm run test:firefox
77+
- name: Upload test results
78+
uses: actions/upload-artifact@v3
79+
if: always()
80+
with:
81+
name: e2e-firefox-artifacts
82+
path: |
83+
e2e/test-report/
84+
e2e/test-results/
85+
retention-days: 30
8686

8787
e2e_safari:
8888
needs: prepare_app
@@ -91,90 +91,27 @@ jobs:
9191
image: mcr.microsoft.com/playwright:v1.43.0-focal
9292
defaults:
9393
run:
94-
working-directory: e2e-playwright
94+
working-directory: e2e
9595
steps:
96-
- uses: actions/checkout@master
97-
- name: Download build
98-
uses: actions/download-artifact@v3
99-
with:
100-
name: build
101-
path: build
102-
- name: Copy e2e envs
103-
run: cp .env.dist .env
104-
- name: Install e2e dependencies
105-
run: npm install
106-
- name: Run build and tests
107-
run: npm run test:safari
108-
- name: Upload test results
109-
uses: actions/upload-artifact@v3
110-
if: always()
111-
with:
112-
name: e2e-safari-artifacts
113-
path: |
114-
e2e-playwright/test-report/
115-
e2e-playwright/test-results/
116-
retention-days: 30
96+
- uses: actions/checkout@master
97+
- name: Download build
98+
uses: actions/download-artifact@v3
99+
with:
100+
name: build
101+
path: build
102+
- name: Copy e2e envs
103+
run: cp .env.dist .env
104+
- name: Install e2e dependencies
105+
run: npm install
106+
- name: Run build and tests
107+
run: npm run test:safari
108+
- name: Upload test results
109+
uses: actions/upload-artifact@v3
110+
if: always()
111+
with:
112+
name: e2e-safari-artifacts
113+
path: |
114+
e2e/test-report/
115+
e2e/test-results/
116+
retention-days: 30
117117
# END PLAYWRIGHT SPECIFIC CONFIG
118-
119-
120-
# START CYPRESS SPECIFIC CONFIG
121-
# jobs:
122-
# prepare_app:
123-
# runs-on: ubuntu-latest
124-
# container:
125-
# image: cypress/included:10.11.0
126-
# options: --user 1001
127-
# steps:
128-
# - uses: actions/checkout@master
129-
# - name: Copy envs
130-
# run: cp .env.dist .env
131-
# - name: Install root dependencies
132-
# uses: bahmutov/npm-install@v1
133-
# - name: Build ci
134-
# run: npm run build:ci
135-
# - name: Upload build
136-
# uses: actions/upload-artifact@v1
137-
# with:
138-
# name: build
139-
# path: build
140-
141-
# cypress_chrome:
142-
# needs: prepare_app
143-
# runs-on: ubuntu-latest
144-
# steps:
145-
# - uses: actions/checkout@master
146-
# - name: Copy e2e envs
147-
# run: cp .env.e2e.dist ./e2e/.env
148-
# - name: Download build
149-
# uses: actions/download-artifact@v1
150-
# with:
151-
# name: build
152-
# - name: Install npm
153-
# run: npm install
154-
# - name: Install Cypress and run tests
155-
# uses: cypress-io/github-action@v4
156-
# with:
157-
# working-directory: e2e
158-
# start: npx http-server ../build --port 1337
159-
# wait-on: 'http://localhost:1337'
160-
# browser: chrome
161-
162-
# cypress_firefox:
163-
# needs: prepare_app
164-
# runs-on: ubuntu-latest
165-
# steps:
166-
# - uses: actions/checkout@master
167-
# - name: Copy e2e envs
168-
# run: cp .env.e2e.dist ./e2e/.env
169-
# - name: Download build
170-
# uses: actions/download-artifact@v1
171-
# with:
172-
# name: build
173-
# - name: Install Cypress and run tests
174-
# uses: cypress-io/github-action@v4
175-
# with:
176-
# working-directory: e2e
177-
# start: npx http-server ../build --port 1337
178-
# wait-on: 'http://localhost:1337'
179-
# browser: firefox
180-
# END CYPRESS SPECIFIC CONFIG

.gitlab-ci.yml

Lines changed: 17 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# START PLAYWRIGHT SPECIFIC CONFIG
22
default:
3-
image: mcr.microsoft.com/playwright:v1.31.2-focal
3+
image: mcr.microsoft.com/playwright:v1.43.0-focal
44

55
stages:
66
- build
@@ -17,7 +17,7 @@ cache:
1717
paths:
1818
- .npm
1919
- node_modules
20-
- e2e-playwright/node_modules
20+
- e2e/node_modules
2121

2222
spa_test:
2323
stage: test
@@ -33,136 +33,66 @@ e2e_build:
3333
- cp .env.dist .env
3434
- npm ci
3535
- npm run build:ci
36-
- cd e2e-playwright && npm install && cd ..
36+
- cd e2e && npm install && cd ..
3737
artifacts:
3838
paths:
3939
- build/**
40-
- e2e-playwright/node_modules/**
40+
- e2e/node_modules/**
4141
only:
4242
- merge_requests
4343

4444
e2e_chrome:
4545
stage: test
4646
before_script:
47-
- cp ./e2e-playwright/.env.dist ./e2e-playwright/.env
48-
- cd e2e-playwright
47+
- cp ./e2e/.env.dist ./e2e/.env
48+
- cd e2e
4949
script:
5050
- npm run test:chrome
5151
artifacts:
5252
when: always
5353
paths:
54-
- e2e-playwright/test-report/
55-
- e2e-playwright/test-results/
54+
- e2e/test-report/
55+
- e2e/test-results/
5656
only:
5757
- merge_requests
5858

5959
e2e_firefox:
6060
stage: test
6161
before_script:
62-
- cp ./e2e-playwright/.env.dist ./e2e-playwright/.env
63-
- cd e2e-playwright
62+
- cp ./e2e/.env.dist ./e2e/.env
63+
- cd e2e
6464
script:
6565
- npm run test:firefox
6666
artifacts:
6767
when: always
6868
paths:
69-
- e2e-playwright/test-report/
70-
- e2e-playwright/test-results/
69+
- e2e/test-report/
70+
- e2e/test-results/
7171
only:
7272
- merge_requests
7373

7474
e2e_safari:
7575
stage: test
7676
before_script:
77-
- cp ./e2e-playwright/.env.dist ./e2e-playwright/.env
78-
- cd e2e-playwright
77+
- cp ./e2e/.env.dist ./e2e/.env
78+
- cd e2e
7979
script:
8080
- npm run test:safari
8181
artifacts:
8282
when: always
8383
paths:
84-
- e2e-playwright/test-report/
85-
- e2e-playwright/test-results/
84+
- e2e/test-report/
85+
- e2e/test-results/
8686
only:
8787
- merge_requests
8888
# END PLAYWRIGHT SPECIFIC CONFIG
8989

9090

91-
# START CYPRESS SPECIFIC CONFIG
92-
# default:
93-
# image: cypress/base:14.16.0
94-
95-
# stages:
96-
# - build
97-
# - test
98-
# - deploy
99-
100-
# variables:
101-
# npm_config_cache: "$CI_PROJECT_DIR/.npm"
102-
# CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress"
103-
104-
# # cache using branch name
105-
# # https://gitlab.com/help/ci/caching/index.md
106-
# cache:
107-
# key: ${CI_COMMIT_REF_SLUG}
108-
# paths:
109-
# - .npm
110-
# - cache/Cypress
111-
# - node_modules
112-
# - e2e/node_modules
113-
114-
# spa_test:
115-
# stage: test
116-
# script:
117-
# - cp .env.dist .env
118-
# - npm install
119-
# - npm run lint
120-
# - npm run coverage
121-
122-
# e2e_build:
123-
# stage: build
124-
# script:
125-
# - cp .env.dist .env
126-
# - npm install
127-
# - npm run build:ci
128-
# - cd e2e && npm install && cd ..
129-
# artifacts:
130-
# paths:
131-
# - build/**
132-
# - e2e/node_modules/**
133-
# only:
134-
# - merge_requests
135-
136-
# e2e_chrome:
137-
# stage: test
138-
# image:
139-
# name: cypress/included:8.7.0
140-
# entrypoint: ['']
141-
# script:
142-
# - cp .env.e2e.dist ./e2e/.env
143-
# - npm install
144-
# - npm run e2e:ci:chrome
145-
# only:
146-
# - merge_requests
147-
148-
# e2e_firefox:
149-
# stage: test
150-
# image:
151-
# name: cypress/included:8.7.0
152-
# entrypoint: ['']
153-
# script:
154-
# - cp .env.e2e.dist ./e2e/.env
155-
# - npm install
156-
# - npm run e2e:ci:firefox
157-
# only:
158-
# - merge_requests
159-
# END CYPRESS SPECIFIC CONFIG
160-
16191
deploy_to_staging:
16292
stage: deploy
16393
environment: staging
16494
image:
165-
name: tshio/awscli-docker-compose-pipelines:0.0.6
95+
name: tshio/awscli-docker-compose-pipelines:0.0.7
16696
entrypoint: ['']
16797
script:
16898
- npm ci

0 commit comments

Comments
 (0)