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

setup VueJS UI code #29

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
######################################
# Prepare npm_builder
######################################
FROM node:16 as npm_builder
WORKDIR /app
ADD . .
RUN make build_ui

######################################
# Prepare go_builder
######################################
Expand All @@ -14,6 +22,7 @@ RUN mkdir /app
WORKDIR /app

COPY --from=go_builder /app/goliac ./goliac
COPY --from=npm_builder /app/browser/goliac-ui/dist ./browser/goliac-ui/dist

RUN useradd --uid 1000 --gid 0 goliac && \
chown goliac:root /app && \
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@

all: deps gen build
all: deps gen build build_ui

rebuild: gen build

build:
@GO111MODULE=on go build -o goliac ./cmd/goliac

build_ui:
@echo "Building Goliac UI ..."
@cd ./browser/goliac-ui/; npm install --legacy-peer-deps && npm run build

run_ui:
@cd ./browser/goliac-ui/; npm run serve

test: deps verifiers
@GO111MODULE=on go test -race -covermode=atomic -coverprofile=coverage.txt ./internal/...
@go tool cover -html coverage.txt -o cover.html
Expand Down
24 changes: 24 additions & 0 deletions browser/goliac-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# goliac-ui

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn serve
```

### Compiles and minifies for production
```
yarn build
```

### Lints and fixes files
```
yarn lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
5 changes: 5 additions & 0 deletions browser/goliac-ui/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
19 changes: 19 additions & 0 deletions browser/goliac-ui/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}
Loading