Skip to content

Commit

Permalink
Add support for Vite
Browse files Browse the repository at this point in the history
  • Loading branch information
punmechanic committed Feb 22, 2024
2 parents 14540c4 + 0c84c01 commit fe87642
Show file tree
Hide file tree
Showing 31 changed files with 5,915 additions and 28,973 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dev.env
prod.env
shared.env
build/
frontend/build/**
frontend/dist/**
**/builds/**
api/lambdas/get_aws_creds/get_aws_creds
api/lambdas/get_user_data/get_user_data
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.17.0
20.2.0
18 changes: 6 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ all: build

clean:
rm -rf cli/keyconjurer*
rm -r frontend/build
rm -r frontend/dist

test: frontend_test go_test

CLI_TARGETS = cli/keyconjurer-darwin cli/keyconjurer-darwin-amd64 cli/keyconjurer-darwin-arm64 cli/keyconjurer-linux cli/keyconjurer-linux-amd64 cli/keyconjurer-linux-arm64 cli/keyconjurer-windows.exe
build: api_build frontend/build/index.html $(CLI_TARGETS)
build: api_build frontend/dist/index.html $(CLI_TARGETS)

go_test:
go test ./...
Expand All @@ -28,14 +28,8 @@ frontend_test:
frontend/node_modules:
cd frontend && npm install

frontend/build/index.html: frontend/node_modules
mkdir -p build/frontend/
@test $${FRONTEND_URL?is not set}
@test $${API_URL?is not set}
cd frontend && \
REACT_APP_VERSION='$(shell git rev-parse --short HEAD)-$(RELEASE)' \
REACT_APP_API_URL=${API_URL} \
npm run-script build
frontend/dist/index.html: frontend/node_modules
VITE_APP_VERSION='$(shell git rev-parse --short HEAD)-$(RELEASE)' cd frontend && npm run-script build

### CLI Build Targets
cli/keyconjurer-linux-arm64 cli/keyconjurer-linux:
Expand Down Expand Up @@ -92,10 +86,10 @@ cli_upload: $(CLI_TARGETS)
cd cli/ && \
aws s3 cp . s3://$(S3_FRONTEND_BUCKET_NAME)-$(RELEASE) --exclude "*" --include "keyconjurer*" --recursive

frontend_upload: frontend/build/index.html
frontend_upload: frontend/dist/index.html
@test $${S3_FRONTEND_BUCKET_NAME?is not set}
@test $${RELEASE?is not set}
cd frontend/build && \
cd frontend/dist && \
aws s3 cp . s3://$(S3_FRONTEND_BUCKET_NAME)-$(RELEASE) --include "*" --recursive

api_upload: build/list_applications.zip
Expand Down
1 change: 0 additions & 1 deletion example.env
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export API_DOMAIN='api.keyconjurer.example.com'
export API_URL="https://${API_DOMAIN}"

export FRONTEND_DOMAIN='keyconjurer.example.com'
export FRONTEND_URL='https://${FRONTEND_DOMAIN}'

export TF_VAR_api_domain=$API_DOMAIN
export TF_VAR_frontend_domain=$FRONTEND_DOMAIN
Expand Down
104 changes: 0 additions & 104 deletions frontend/config/env.js

This file was deleted.

66 changes: 0 additions & 66 deletions frontend/config/getHttpsConfig.js

This file was deleted.

29 changes: 0 additions & 29 deletions frontend/config/jest/babelTransform.js

This file was deleted.

14 changes: 0 additions & 14 deletions frontend/config/jest/cssTransform.js

This file was deleted.

40 changes: 0 additions & 40 deletions frontend/config/jest/fileTransform.js

This file was deleted.

Loading

0 comments on commit fe87642

Please sign in to comment.