Skip to content

Commit

Permalink
chore: Rename frontend folder to skore-ui (#439)
Browse files Browse the repository at this point in the history
part of #345
  • Loading branch information
rouk1 authored Oct 3, 2024
1 parent a837307 commit 529008a
Show file tree
Hide file tree
Showing 104 changed files with 66 additions and 66 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ name: Reusable backend workflow
on: [workflow_call]

jobs:
build-frontend:
build-skore-ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
cache-dependency-path: skore-ui/package-lock.json
- shell: bash
run: |
cd frontend
cd skore-ui
npm install
npm run build
npm run build:lib -- --emptyOutDir false
- uses: actions/upload-artifact@v4
with:
name: frontend-package-distributions
path: frontend/dist
name: skore-ui-package-distributions
path: skore-ui/dist

test-backend:
runs-on: ubuntu-latest
needs: build-frontend
needs: build-skore-ui
strategy:
fail-fast: true
matrix:
Expand All @@ -48,7 +48,7 @@ jobs:
- name: Download package distributions
uses: actions/download-artifact@v4
with:
name: frontend-package-distributions
name: skore-ui-package-distributions
path: src/skore/ui/static

- name: Build
Expand All @@ -72,4 +72,4 @@ jobs:
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: frontend-package-distributions
name: skore-ui-package-distributions
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
backend: ${{ steps.filter.outputs.backend }}
frontend: ${{ steps.filter.outputs.frontend }}
skore-ui: ${{ steps.filter.outputs.skore-ui }}
permissions:
pull-requests: read
steps:
Expand All @@ -21,9 +21,9 @@ jobs:
- 'pyproject.toml'
- 'requirements*.txt'
- '.github/workflows/backend.yml'
frontend:
- 'frontend/**'
- '.github/workflows/frontend.yml'
skore-ui:
- 'skore-ui/**'
- '.github/workflows/skore-ui.yml'
lint-all-files:
uses: ./.github/workflows/lint.yml
Expand All @@ -37,10 +37,10 @@ jobs:
permissions:
contents: read

lint-and-test-frontend:
lint-and-test-skore-ui:
needs: [lint-all-files, changes]
if: ${{ needs.changes.outputs.frontend == 'true' }}
uses: ./.github/workflows/frontend.yml
if: ${{ needs.changes.outputs.skore-ui == 'true' }}
uses: ./.github/workflows/skore-ui.yml
permissions:
contents: read
pull-requests: write
Expand All @@ -49,7 +49,7 @@ jobs:
needs:
- lint-all-files
- lint-and-test-backend
- lint-and-test-frontend
- lint-and-test-skore-ui
if: ${{ always() }}
runs-on: Ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
with:
node-version: 20

- name: Build frontend and share library
- name: Build skore-ui and share library
shell: bash
run: make build-frontend
run: make build-skore-ui

- name: Override VERSION.txt with tag
run: echo "${GITHUB_REF_NAME}" > VERSION.txt
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/frontend.yml → .github/workflows/skore-ui.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
name: Reusable frontend workflow
name: Reusable skore-ui workflow

on: [workflow_call]

jobs:
lint-frontend:
lint-skore-ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Lint frontend
cache-dependency-path: skore-ui/package-lock.json
- name: Lint skore-ui
run: |
cd frontend
cd skore-ui
npm install
npm run type-check
npm run lint
npm run format
npm run style-lint
test-frontend:
test-skore-ui:
runs-on: ubuntu-latest
needs: lint-frontend
needs: lint-skore-ui
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Test frontend
cache-dependency-path: skore-ui/package-lock.json
- name: Test skore-ui
run: |
cd frontend
cd skore-ui
npm install
npm run test:unit:coverage
- name: Report coverage
if: always()
uses: davelosert/vitest-coverage-report-action@v2
with:
working-directory: ./frontend
working-directory: ./skore-ui
pr-number: ${{ github.event.number }}

build-frontend:
build-skore-ui:
runs-on: ubuntu-latest
needs: test-frontend
needs: test-skore-ui
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Build frontend
cache-dependency-path: skore-ui/package-lock.json
- name: Build skore-ui
shell: bash
run: |
cd frontend
cd skore-ui
npm install
npm run build
Expand Down
22 changes: 11 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ repos:
hooks:
- id: tsc
language: node
name: Use vue-tsc to typecheck frontend code.
entry: bash -c "cd frontend && npm run type-check"
files: ^frontend/
name: Use vue-tsc to typecheck skore-ui code.
entry: bash -c "cd skore-ui && npm run type-check"
files: ^skore-ui/
- id: eslint
language: node
name: Use eslint to lint frontend code.
entry: bash -c "cd frontend && npm run lint"
files: ^frontend/
name: Use eslint to lint skore-ui code.
entry: bash -c "cd skore-ui && npm run lint"
files: ^skore-ui/
- id: prettier
language: node
name: Use prettier to format frontend code.
entry: bash -c "cd frontend && npm run format"
files: ^frontend/
name: Use prettier to format skore-ui code.
entry: bash -c "cd skore-ui && npm run format"
files: ^skore-ui/
- id: stylelint
language: node
name: Use stylelint to lint CSS.
entry: bash -c "cd frontend && npm run style-lint"
files: ^frontend/
entry: bash -c "cd skore-ui && npm run style-lint"
files: ^skore-ui/

exclude: fixtures/
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Bug reports are welcome, especially those reported with [short, self-contained,

### Quick start

You'll need Python>=3.12 to build the backend and Node>=20 to build the frontend. Then, you can install dependencies and run the UI with:
You'll need Python>=3.12 to build the backend and Node>=20 to build the skore-ui. Then, you can install dependencies and run the UI with:
```sh
make install
make build-frontend
make build-skore-ui
make serve-ui
```

Expand All @@ -37,24 +37,24 @@ When dependencies are changed in `pyproject.toml` the lockfiles should be update
make pip-compile
```

### Frontend
### skore-ui

Install frontend dependencies with
Install skore-ui dependencies with
```sh
npm install
```
in the `frontend` directory.
in the `skore-ui` directory.

Run the frontend in dev mode (for hot-reloading) with
Run the skore-ui in dev mode (for hot-reloading) with
```sh
npm run dev
```
in the `frontend` directory
in the `skore-ui` directory


Then, to use the frontend
Then, to use the skore-ui
```sh
make build-frontend
make build-skore-ui
make serve-ui
```

Expand Down Expand Up @@ -91,6 +91,6 @@ When writing documentation, whether it be online, docstrings or help messages in

## Help for common issues

### `make build-frontend` doesn't work!
### `make build-skore-ui` doesn't work!

Please check that your version of node is at least 20 using the following command: `node -v`
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ serve-ui:
--port 22140 \
--timeout-graceful-shutdown 0

build-frontend:
build-skore-ui:
# cleanup
rm -rf frontend/dist
rm -rf skore-ui/dist
rm -rf src/skore/ui/static
# build
(\
cd frontend;\
cd skore-ui;\
npm install;\
npm run build;\
npm run build:lib -- --emptyOutDir false;\
)
# move
mv frontend/dist/ src/skore/ui/static
mv skore-ui/dist/ src/skore/ui/static
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![lint](https://github.com/probabl-ai/skore/actions/workflows/lint.yml/badge.svg)
![tests](https://github.com/probabl-ai/skore/actions/workflows/backend.yml/badge.svg)
![UI tests](https://github.com/probabl-ai/skore/actions/workflows/frontend.yml/badge.svg)
![UI tests](https://github.com/probabl-ai/skore/actions/workflows/skore-ui.yml/badge.svg)

## Installation

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions frontend/package-lock.json → skore-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json → skore-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "skore-frontend",
"name": "skore-ui",
"version": "0.0.0",
"private": true,
"type": "module",
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/skore/ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def create_app(
# Include all sub routers.
app.include_router(router)

# Mount frontend from the static directory.
# Mount skore-ui from the static directory.
# Should be after the API routes to avoid shadowing previous routes.
static_path = get_static_path()
if static_path.exists():
Expand Down
2 changes: 1 addition & 1 deletion src/skore/ui/project_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SerializedItem:

@dataclass
class SerializedProject:
"""Serialized project, to be sent to the frontend."""
"""Serialized project, to be sent to the skore-ui."""

items: dict[str, SerializedItem]
views: dict[str, Layout]
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/ui/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_app_state(client):
assert client.app.state.project is not None


def test_frontend_index(client):
def test_skore_ui_index(client):
response = client.get("/")

assert response.status_code == 200
Expand Down

0 comments on commit 529008a

Please sign in to comment.