-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from PlakarKorp/jcastets/rework-ui-v2-build
Jcastets/rework UI v2 build
- Loading branch information
Showing
58 changed files
with
826 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
**/.DS_Store | ||
/plakar | ||
/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Plakar UI | ||
|
||
Plakar UI is available at the private repository [plakar-ui](https://github.com/plakarkorp/plakar-ui). This repository only stores the compiled build version of the UI. | ||
|
||
To synchronize the build assets with this repository, use the provided `sync.sh` script. | ||
|
||
## Development | ||
|
||
To sync the Plakar UI build from your local filesystem, use the `--local` flag with `sync.sh`: | ||
|
||
```bash | ||
$ cd ~/dev/plakar/plakar-ui | ||
$ npm run build | ||
$ ./sync.sh --local ~/dev/plakar/plakar-ui | ||
$ cat ./frontend/VERSION | ||
version: local | ||
commit: 4e5613ea839beba564d57cdad97664bf24d9b582 | ||
date: 2024-11-12T14:41:26+0100 | ||
``` | ||
|
||
## Production build | ||
|
||
For syncing the UI build from the latest Plakar UI release on GitHub, use the `--release` flag. Optionally, specify a release version if needed: | ||
|
||
```bash | ||
$ ./sync.sh --release | ||
$ cat ./frontend/VERSION | ||
version: 0.1.0 | ||
commit: 4e5613ea839beba564d57cdad97664bf24d9b582 | ||
date: 2024-11-12T14:41:26+0100 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
version: local | ||
commit: e1eb6c4d93f7764ce78528dba5677ed948ef0686 | ||
date: 2024-11-12T17:04:05+0100 |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/png" href="/favicon.png" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Plakar UI</title> | ||
<script type="module" crossorigin src="/assets/index-BUmZTsSd.js"></script> | ||
<link rel="stylesheet" crossorigin href="/assets/index-DEagmxS9.css"> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
cd `dirname $0` | ||
|
||
usage() { | ||
echo "Usage: $0 --release [RELEASE_NUMBER] | --local PLAKAR_UI_PATH" | ||
exit 1 | ||
} | ||
|
||
if [ "$#" -lt 1 ]; then | ||
usage | ||
fi | ||
|
||
# Initialize variables | ||
mode="" | ||
path="" | ||
release_number="latest" | ||
|
||
while [ "$#" -gt 0 ]; do | ||
case "$1" in | ||
--release) | ||
if [ -n "$mode" ]; then | ||
echo "Error: Only one of --release or --local can be specified." | ||
usage | ||
fi | ||
mode="release" | ||
if [ -n "$2" ] && [ "${2#-}" = "$2" ]; then | ||
release_number="$2" | ||
shift | ||
fi | ||
;; | ||
--local) | ||
if [ -n "$mode" ]; then | ||
echo "Error: Only one of --release or --local can be specified." | ||
usage | ||
fi | ||
mode="local" | ||
if [ -z "$2" ] || [ "${2#-}" != "$2" ]; then | ||
echo "Error: --local requires a path argument." | ||
usage | ||
fi | ||
path="$2" | ||
shift | ||
;; | ||
*) | ||
echo "Error: Invalid argument '$1'" | ||
usage | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
if [ "$mode" = "release" ]; then | ||
echo "Downloading release: $release_number" | ||
# TODO | ||
|
||
elif [ "$mode" = "local" ]; then | ||
if [ ! -d "$path" ]; then | ||
echo "Error: Path '$path' does not exist." | ||
exit 1 | ||
fi | ||
|
||
if [ ! -d "$path/dist" ]; then | ||
echo "Error: before syncing, please build the UI using 'npm run build' in the UI directory." | ||
exit 1 | ||
fi | ||
|
||
rm -rf -- ./frontend/ | ||
cp -r ${path}/dist ./frontend | ||
|
||
cat<<EOF > ./frontend/VERSION | ||
version: local | ||
commit: $(git -C ${path} log -1 --format="%H") | ||
date: $(date +"%Y-%m-%dT%H:%M:%S%z") | ||
EOF | ||
|
||
else | ||
usage | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters