Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild web client using npm, ts and vuejs #1

Merged
merged 80 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from 73 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
940ffb6
Add gitignore for web client
maximilianruesch Nov 25, 2022
9b72bfa
Add vite and initial dependencies for web client
maximilianruesch Nov 25, 2022
da5745f
Add ts and vite config with initial vue setup
maximilianruesch Nov 25, 2022
f04cd45
Move components
maximilianruesch Nov 25, 2022
f8e97c7
Refresh index.html
maximilianruesch Nov 25, 2022
678d2c1
Correct script location
maximilianruesch Nov 25, 2022
dee4a6c
Fix vuejs named export
maximilianruesch Nov 25, 2022
d25f476
Correct icon loading for vite-dev server
maximilianruesch Nov 25, 2022
83bfc85
Swap location of template and script
maximilianruesch Nov 25, 2022
f224a36
Fix too late document instantiation
maximilianruesch Nov 25, 2022
7b1608f
Remove unused d3 dep
maximilianruesch Nov 25, 2022
468d9bb
huge vue convert
maximilianruesch Nov 26, 2022
ee9ffbd
Proxy infrastructure and timetable requests for now in vite
maximilianruesch Nov 26, 2022
53fb563
Add vuex as dependency
maximilianruesch Nov 26, 2022
fbaf184
Refactor infrastructure manager to store
maximilianruesch Nov 26, 2022
d67c62c
Refactor timetable manager to store
maximilianruesch Nov 26, 2022
5f75cdd
Refactor disruption to vue component
maximilianruesch Nov 26, 2022
f7efb63
Refactor horrible App.vue code
maximilianruesch Nov 26, 2022
4cb1604
Remove unused helpers and add readme reminder
maximilianruesch Nov 26, 2022
ea8bbbb
Fix style and fonts
maximilianruesch Nov 26, 2022
a6728de
This stinky
maximilianruesch Nov 26, 2022
69c1375
renew golden layout
maximilianruesch Nov 26, 2022
54a3097
Working GL NICE
maximilianruesch Nov 26, 2022
e453437
Simplify GL
maximilianruesch Nov 27, 2022
329bbf4
Reset initial layout
maximilianruesch Nov 27, 2022
38b772d
Fix selectors
maximilianruesch Nov 27, 2022
c2c4671
Adapt container handling for vue GL components
maximilianruesch Nov 27, 2022
2a1ab49
Display map properly
maximilianruesch Nov 27, 2022
32350b5
Remove define expose import
maximilianruesch Nov 27, 2022
1fa5e0d
Install maplibre with npm and fixup map
maximilianruesch Nov 27, 2022
b0aa4c2
Refactor stores to ts
maximilianruesch Nov 27, 2022
ce519b3
Employ eslint
maximilianruesch Nov 27, 2022
40baccc
Apply simple eslint changes
maximilianruesch Nov 27, 2022
e71c095
Remove simulation from default view
maximilianruesch Nov 27, 2022
08e44ee
Fix styling of vite config
maximilianruesch Dec 3, 2022
63f2d0f
Refactor main part of infrastructure-map into component
maximilianruesch Dec 3, 2022
c307fea
Re-add tooltip usage
maximilianruesch Dec 3, 2022
b58f94e
Add rules for general vue3, object shorthand and html-indent
maximilianruesch Dec 4, 2022
9646ddd
Refactor (unused) station-detail to vue component
maximilianruesch Dec 4, 2022
46921b2
Add preliminary readme
maximilianruesch Dec 4, 2022
a1cf6f6
Add todo for station detail
maximilianruesch Dec 6, 2022
eb23435
Update gitignore
maximilianruesch Dec 6, 2022
c20d37e
Add eslint for typescript
maximilianruesch Dec 6, 2022
d94b2dd
Enable production build
maximilianruesch Dec 6, 2022
a5f08a3
Fit dist path in soro-server-client target
maximilianruesch Dec 6, 2022
c488d97
Add custom target for production deployment
maximilianruesch Dec 7, 2022
799dde2
Refactor disruption-detail to vue component
maximilianruesch Dec 13, 2022
4f5f63b
Fix disruption detail in app.vue
maximilianruesch Dec 13, 2022
a49e106
Better styling
maximilianruesch Dec 13, 2022
8a41159
Disable dev-tools as non-working
maximilianruesch Dec 13, 2022
0a0de41
Use npm in linux ci
maximilianruesch Dec 13, 2022
17d3239
Fix linux CI
maximilianruesch Dec 13, 2022
43005f4
Refactor map a bit
maximilianruesch Dec 13, 2022
402afa4
Refactor most used to ts
maximilianruesch Dec 14, 2022
25e95af
Refactor buttons into soro-button.vue
maximilianruesch Dec 14, 2022
72a3348
Move styling around
maximilianruesch Dec 14, 2022
b90b435
Refactor into soro-overlay component
maximilianruesch Dec 14, 2022
d4c7a44
Type the map more
maximilianruesch Dec 14, 2022
a1c0c28
Suppress timetable store
maximilianruesch Dec 14, 2022
b092026
Do some smaller todos
maximilianruesch Dec 18, 2022
e782546
Fix global module resolution
maximilianruesch Dec 18, 2022
5ff2652
Refactor collapsible
maximilianruesch Dec 18, 2022
3f36ab2
use collapsible in overlay
maximilianruesch Dec 18, 2022
43510eb
Make add icons awaitable
maximilianruesch Dec 18, 2022
fcceb20
Beautify and disable eslint for unused files
maximilianruesch Dec 18, 2022
dcf24d2
Run eslint on CI
maximilianruesch Dec 18, 2022
df11ba5
Fix eslint on ci with checkout
maximilianruesch Dec 18, 2022
320f08c
Use npm run instead of npx
maximilianruesch Dec 18, 2022
339066b
Execute npm run in correct directory
maximilianruesch Dec 18, 2022
a4f8933
Trial and error
maximilianruesch Jan 3, 2023
ac48d5e
Trial and error #2
maximilianruesch Jan 3, 2023
2e022c2
Big style changes
maximilianruesch Jan 3, 2023
21b2572
Remove todos
maximilianruesch Jan 3, 2023
e4b4cd6
Big style changes number 2
maximilianruesch Jan 7, 2023
262198b
Correct flex-flowing
maximilianruesch Jan 7, 2023
e597d03
Merge branch 'master' into refactor/rebuild-web-client
maximilianruesch Jan 11, 2023
af3b4d1
Refactor ordering graph component into vue component
maximilianruesch Jan 11, 2023
2bc7385
Rework cmakelists
maximilianruesch Jan 11, 2023
dad1176
Move styles (and ignore most)
maximilianruesch Jan 11, 2023
2209ce8
Fix styles
maximilianruesch Jan 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,19 @@ jobs:
run: |
git status --porcelain
git diff
git status --porcelain | xargs -I {} -0 test -z \"{}\"
git status --porcelain | xargs -I {} -0 test -z \"{}\"

eslint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 19.1

# ==== WEB LINT ====
- name: Install deps
run: npm clean-install --prefix web/client

- name: Run ESLint
run: npm run lint:eslint --prefix web/client
4 changes: 4 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 19.1

- name: Get deps
run: ln -s /deps deps
Expand All @@ -59,6 +62,7 @@ jobs:
- name: Build
run: |
buildcache -z
npm clean-install --prefix web/client
cmake --build build/${{ matrix.config.preset }} --target soro-server-client
buildcache -s

Expand Down
13 changes: 6 additions & 7 deletions cmake/soro-server-client.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ else ()
set(SORO_SERVER_DIR ${CMAKE_CURRENT_BINARY_DIR})
file(MAKE_DIRECTORY ${SORO_SERVER_DIR})

add_custom_target(soro-client-production COMMAND npm run build WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/web/client/)
add_custom_command(TARGET soro-client-production POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/web/client/dist
${SORO_SERVER_DIR}/server_resources)

add_subdirectory(web/server/)
add_dependencies(soro-server-client soro-server)

file(GLOB_RECURSE soro-client-files web/client/ *.html *.css *.js *.ico *.png *.svg *.map)
foreach (file ${soro-client-files})
set(path ${file})
cmake_path(RELATIVE_PATH path BASE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/web/client OUTPUT_VARIABLE relative-path)
configure_file(${file} ${SORO_SERVER_DIR}/server_resources/${relative-path} COPYONLY)
endforeach ()
add_dependencies(soro-server-client soro-client-production)
endif ()
74 changes: 74 additions & 0 deletions web/client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
module.exports = {
root: true,
env: {
maximilianruesch marked this conversation as resolved.
Show resolved Hide resolved
browser: true,
es2021: true
},
extends: [
'eslint:recommended',
'plugin:vue/vue3-essential',
'plugin:vue/vue3-recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-typescript/recommended',
],
overrides: [],
parser: "vue-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: [
'vue',
'@typescript-eslint'
],
rules: {
'indent': [
'error',
4
],
'curly': [
'error',
'all'
],
'brace-style': [
'error',
'1tbs'
],
'function-paren-newline': [
'error',
'multiline'
],
'linebreak-style': [
'error',
'unix'
],
'quotes': [
'error',
'single'
],
'semi': [
'error',
'always'
],
'comma-dangle': [
'error',
'only-multiline',
],
'object-curly-spacing': [
'error',
'always',
],
'object-shorthand': [
'error',
'properties',
{ avoidQuotes: true }
],
'vue/html-indent': [
'error',
4,
],
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/ban-ts-comment': 0,
}
};
2 changes: 2 additions & 0 deletions web/client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
32 changes: 32 additions & 0 deletions web/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## SORO-S Webclient

### Tools:
- Node.js (preferably install via [nvm](https://github.com/nvm-sh/nvm))

### Setup:

Have nodejs installed with npm available globally (enabled by default). Execute the following in this directory:

```shell
npm install
```

### Development

```shell
npm run dev
```
You can access the client with hmr now on the port shown in the console (usually [5173](http://localhost:5173)).

### Building the web interface for production

If you never ran ninja before, run it now in your `build/{clang,gcc}-release` directory.
```shell
ninja
```

Then simply execute
```shell
ninja soro-client-production
```
This target has also been added to the `soro-server-client` target for convenience.
21 changes: 0 additions & 21 deletions web/client/components/disruption/disruption.css

This file was deleted.

9 changes: 0 additions & 9 deletions web/client/components/disruption/disruption.html

This file was deleted.

59 changes: 0 additions & 59 deletions web/client/components/disruption/disruption.js

This file was deleted.

53 changes: 0 additions & 53 deletions web/client/components/infrastructure/InfrastructureComponent.js

This file was deleted.

1 change: 0 additions & 1 deletion web/client/components/infrastructure/deps/maplibre-gl.css

This file was deleted.

42 changes: 0 additions & 42 deletions web/client/components/infrastructure/deps/maplibre-gl.js

This file was deleted.

This file was deleted.

49 changes: 0 additions & 49 deletions web/client/components/infrastructure/infrastructure.css

This file was deleted.

26 changes: 0 additions & 26 deletions web/client/components/infrastructure/infrastructure_component.html

This file was deleted.

Loading