Skip to content

Commit

Permalink
Merge pull request #133 from Concordium/upgrade-deps
Browse files Browse the repository at this point in the history
[front-end-tools] Upgrade deps
  • Loading branch information
soerenbf authored Nov 15, 2023
2 parents 0d601b2 + 10099ca commit 2afe042
Show file tree
Hide file tree
Showing 27 changed files with 4,879 additions and 5,417 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/ci-dapps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Checks the frontend apps for build, lint, and formatting errors
name: Check

on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main, release**, feature** ]
pull_request:
branches: [ main, release**, feature** ]
# Don't run on draft PR's, see: https://github.com/orgs/community/discussions/25722#discussioncomment-3248917
types: [ opened, synchronize, reopened, ready_for_review ]
paths:
- front-end-tools/**/*
# Allows us to run the workflow manually from the Actions tab
workflow_dispatch:


env:
DUMMY: 0 # For cache busting.
NODE_VERSION: 18.16.0

jobs:
deps:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./front-end-tools
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache-dependency-path: "./front-end-tools/yarn.lock"

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: |
./front-end-tools/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('./front-end-tools/yarn.lock') }}-${{ env.DUMMY }}
restore-keys: |
${{ runner.os }}-yarn
- name: Get dependencies
run: yarn install --immutable
lint:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
needs: deps
defaults:
run:
working-directory: ./front-end-tools
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache-dependency-path: "./front-end-tools/yarn.lock"

- name: Restore dependencies
uses: actions/cache/restore@v3
with:
path: |
./front-end-tools/node_modules
key: ${{ runner.os }}-yarn

- name: Lint
run: yarn lint && yarn fmt-check
build:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
needs: deps
defaults:
run:
working-directory: ./front-end-tools
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache-dependency-path: "./front-end-tools/yarn.lock"

- name: Restore dependencies
uses: actions/cache/restore@v3
with:
path: |
./front-end-tools/node_modules
key: ${{ runner.os }}-yarn

- name: Build
run: yarn build
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*.csv

node_modules
.yarn
dist
.eslintcache

Expand Down
13 changes: 2 additions & 11 deletions front-end-tools/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: ['airbnb', 'airbnb-typescript', 'plugin:prettier/recommended', 'plugin:@typescript-eslint/recommended'],
extends: ['airbnb', 'airbnb-typescript', 'plugin:@typescript-eslint/recommended', 'prettier'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
project: 'tsconfig.json',
project: 'tsconfig.node.json',
createDefaultProgram: true,
},
env: {
Expand Down Expand Up @@ -44,14 +44,5 @@ module.exports = {
},
},
],
'prettier/prettier': [
'error',
{
trailingComma: 'es5',
singleQuote: true,
printWidth: 120,
tabWidth: 4,
},
],
},
};
14 changes: 14 additions & 0 deletions front-end-tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# output
dist

# dependencies
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
node_modules

# misc
.eslintcache
2 changes: 2 additions & 0 deletions front-end-tools/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.md
*.yml
6 changes: 6 additions & 0 deletions front-end-tools/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 4
}
893 changes: 893 additions & 0 deletions front-end-tools/.yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions front-end-tools/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs
4 changes: 4 additions & 0 deletions front-end-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased changes

## 3.0.1

- Upgrade dependencies @concordium/web-sdk and @concordium/react-components

## 3.0.0

- Add reading from smart contract and writing to smart contract feature
Expand Down
16 changes: 11 additions & 5 deletions front-end-tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
ARG build_image=node:16-slim
ARG build_image=node:18-slim

FROM ${build_image} AS build

WORKDIR /app
COPY ./package.json ./package.json
COPY ./tsconfig.json ./tsconfig.json
COPY ./esbuild.config.ts ./
COPY ./.yarn ./.yarn
COPY ./.yarnrc.yml ./
COPY ./yarn.lock ./
COPY ./package.json ./
COPY ./tsconfig.json ./
COPY ./vite.config.ts ./
COPY ./public ./public
COPY ./src ./src
COPY ./index.html ./

RUN yarn && yarn cache clean && yarn build
RUN yarn install --immutable && yarn cache clean && yarn build


FROM nginx
COPY --from=build ./app/dist ./usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
63 changes: 0 additions & 63 deletions front-end-tools/esbuild.config.ts

This file was deleted.

18 changes: 18 additions & 0 deletions front-end-tools/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<html>
<head>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT"
crossorigin="anonymous"
/>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<meta charset="utf-8" />
</head>

<body>
<div id="root"></div>
<script src="/src/index.tsx" type="module"></script>
</body>
</html>
43 changes: 43 additions & 0 deletions front-end-tools/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Enable Gzip
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_proxied any;
gzip_types
text/css
text/javascript
text/xml
text/plain
text/x-component
application/javascript
application/json
application/xml
application/wasm
application/rss+xml
font/truetype
font/opentype
application/vnd.ms-fontobject
image/svg+xml
image/jpeg;

gzip_static on;

gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.";
gzip_vary on;

server {
listen 80 default;
server_name _;
root /usr/share/nginx/html;

# Set expires max on static file types
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot|mp4|ogg|ogv|webm|wasm)$ {
expires max;
root /usr/share/nginx/html;
access_log off;
}
}

Loading

0 comments on commit 2afe042

Please sign in to comment.