Skip to content

Commit 30ada3c

Browse files
committed
Use reusable frontend lint workflow from armada
Replace the inline frontend_lint_and_test.yml workflow with a caller to the new reusable lint_frontend_package.yml in armada. Align npm scripts (start->dev, serve->preview, add lint) and update all references in docs and Makefile.
1 parent 6efd6d9 commit 30ada3c

7 files changed

Lines changed: 31 additions & 88 deletions

File tree

.github/workflows/frontend_lint_and_test.yml

Lines changed: 0 additions & 80 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Frontend
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
lint-frontend-package:
14+
uses: equinor/armada/.github/workflows/lint_frontend_package.yml@main
15+
permissions:
16+
contents: read
17+
with:
18+
working-directory: frontend
19+
run-prettier: true
20+
run-eslint: true
21+
run-build: true
22+
run-unused-exports: true

frontend/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
run:
2-
npm start
2+
npm run dev
33

44
build:
55
npm run build

frontend/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ npm ci
3030
To start the app, run the following command in the root folder:
3131

3232
```
33-
npm start
33+
npm run dev
3434
```
3535

3636
This command runs the app in development mode. Open [http://localhost:3001/robotics-frontend](http://localhost:3001/robotics-frontend) to view it in the browser.

frontend/best_practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ npx prettier --write [path to source]
2929

3030
We also avoid any warnings or errors from ESLint before we merge in any code. These warnings appear
3131
when compiling the code using
32-
npm start
32+
npm run dev
3333
but can also be run with
3434
npx eslint [path to src]
3535

frontend/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
You can add webfonts, meta tags, or analytics to this file.
3636
The build step will place the bundled scripts into the <body> tag.
3737
38-
To begin the development, run `npm start` or `yarn start`.
39-
To create a production bundle, use `npm run build` or `yarn build`.
38+
To begin the development, run `npm run dev`.
39+
To create a production bundle, use `npm run build`.
4040
--></body>
4141
</html>

frontend/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
"vite-plugin-svgr": "^4.5.0"
3535
},
3636
"scripts": {
37-
"start": "vite",
38-
"build": "tsc && vite build",
39-
"serve": "vite preview",
37+
"dev": "vite",
38+
"build": "tsc -b && vite build",
39+
"preview": "vite preview",
4040
"test": "vitest",
41+
"lint": "eslint src",
4142
"prettier_check": "npx prettier --check src"
4243
},
4344
"browserslist": {

0 commit comments

Comments
 (0)