migrate to yarn workspaces

This commit is contained in:
Karol Wypchlo 2020-07-30 14:23:49 +02:00
parent 714c183797
commit 30dbb8ced5
117 changed files with 1269 additions and 1322 deletions

View File

@ -1,7 +1,23 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
directory: "/packages/handshake-api"
schedule:
interval: weekly
time: "10:00"
open-pull-requests-limit: 10
assignees:
- kwypchlo
- package-ecosystem: npm
directory: "/packages/health-check"
schedule:
interval: weekly
time: "10:00"
open-pull-requests-limit: 10
assignees:
- kwypchlo
- package-ecosystem: npm
directory: "/packages/webapp"
schedule:
interval: weekly
time: "10:00"

View File

@ -11,16 +11,22 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x
- name: Install dependencies
run: yarn
- name: Static code analysis
run: yarn prettier --check .
- name: "Static code analysis: handshake-api"
run: yarn workspace handshake-api prettier --check .
- name: Build production bundle
run: yarn build
- name: "Static code analysis: health-check"
run: yarn workspace health-check prettier --check .
- name: "Static code analysis: webapp"
run: yarn workspace webapp prettier --check .
- name: "Build webapp"
run: yarn workspace webapp build
env:
GATSBY_API_URL: "https://siasky.net"

View File

@ -4,6 +4,9 @@ networks:
shared:
driver: bridge
volumes:
webapp:
services:
sia:
build:
@ -25,7 +28,7 @@ services:
- 9980
sia-upload-legacy:
image: nebulouslabs/sia:alpine-latest
image: nebulouslabs/sia:dev
container_name: sia-upload-legacy
restart: unless-stopped
environment:
@ -58,9 +61,7 @@ services:
- nginx
nginx:
build:
context: .
dockerfile: ./docker/nginx/Dockerfile
image: openresty/openresty:1.15.8.3-2-xenial
container_name: nginx
restart: unless-stopped
env_file:
@ -70,6 +71,7 @@ services:
- ./docker/data/nginx/cache:/data/nginx/cache
- ./docker/data/nginx/logs:/usr/local/openresty/nginx/logs
- ./docker/data/sia/apipassword:/data/sia/apipassword:ro
- webapp:/var/www/webportal:ro
networks:
- shared
expose:
@ -79,6 +81,16 @@ services:
- health-check
- handshake-api
webapp:
build:
context: ./packages/webapp
dockerfile: Dockerfile
container_name: webapp
restart: unless-stopped
tty: true
volumes:
- webapp:/usr/app/public
handshake:
build:
context: ./docker/handshake
@ -101,7 +113,7 @@ services:
handshake-api:
build:
context: ./docker/handshake-api
context: ./packages/handshake-api
dockerfile: Dockerfile
container_name: handshake-api
restart: unless-stopped
@ -120,12 +132,11 @@ services:
health-check:
build:
context: ./docker/health-check
context: ./packages/health-check
dockerfile: Dockerfile
container_name: health-check
restart: unless-stopped
volumes:
- ./health-check:/usr/app/health-check
- ./docker/data/health-check/state:/usr/app/state
networks:
- shared

View File

@ -1,9 +1,10 @@
# we can't use alpine image since it fails on node-gyp
FROM node:14.6.0
WORKDIR /opt/hsd
RUN git clone https://github.com/handshake-org/hsd.git /opt/hsd && \
npm install --production
RUN git clone https://github.com/handshake-org/hsd.git /opt/hsd
RUN npm install --production
ENV PATH="${PATH}:/opt/hsd/bin:/opt/hsd/node_modules/.bin"

View File

@ -1,12 +0,0 @@
FROM node:14.6.0
WORKDIR /usr/app
RUN yarn init -y
RUN yarn add express body-parser lowdb node-schedule superagent lodash http-status-codes
COPY *.js ./
EXPOSE 3100
ENV NODE_ENV production
CMD [ "node", "index.js" ]

View File

@ -1,15 +0,0 @@
FROM node:14.6.0 AS webportal-builder
COPY src ./src
COPY static ./static
COPY gatsby-config.js .
COPY package.json .
COPY yarn.lock .
ENV CYPRESS_INSTALL_BINARY 0
RUN yarn --frozen-lockfile
RUN yarn build
FROM openresty/openresty:1.15.8.3-2-xenial
COPY --from=webportal-builder /public /var/www/webportal

View File

@ -1,86 +1,6 @@
{
"name": "skynet-webportal",
"description": "Sia Skynet",
"version": "1.0.0",
"author": "Nebulous",
"dependencies": {
"axios": "^0.19.2",
"bytes": "^3.1.0",
"classnames": "^2.2.6",
"gatsby": "^2.24.5",
"gatsby-image": "^2.4.13",
"gatsby-plugin-manifest": "^2.4.18",
"gatsby-plugin-matomo": "^0.8.3",
"gatsby-plugin-react-helmet": "^3.3.10",
"gatsby-plugin-remove-serviceworker": "^1.0.0",
"gatsby-plugin-robots-txt": "^1.5.1",
"gatsby-plugin-sass": "^2.3.12",
"gatsby-plugin-sharp": "^2.6.20",
"gatsby-source-filesystem": "^2.3.20",
"gatsby-transformer-sharp": "^2.5.11",
"http-status-codes": "^1.4.0",
"jsonp": "^0.2.1",
"node-sass": "^4.14.0",
"path-browserify": "^1.0.1",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-countup": "^4.3.3",
"react-dom": "^16.13.1",
"react-dropzone": "^11.0.2",
"react-helmet": "^6.1.0",
"react-mailchimp-form": "^1.0.2",
"react-mailchimp-subscribe": "^2.1.0",
"react-reveal": "^1.2.2",
"react-syntax-highlighter": "^12.2.1",
"react-visibility-sensor": "^5.1.1",
"skynet-js": "0.0.8",
"typeface-metropolis": "^0.0.74"
},
"devDependencies": {
"cypress": "^4.10.0",
"cypress-file-upload": "^4.0.7",
"eslint": "^7.5.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-cypress": "^2.11.1",
"eslint-plugin-react": "^7.20.3",
"husky": "^4.2.5",
"lint-staged": "^10.2.11",
"prettier": "^2.0.5"
},
"keywords": [
"sia",
"skynet",
"nebulous",
"blockchain",
"decentralized",
"cloud storage"
],
"license": "MIT",
"scripts": {
"build": "gatsby build",
"start": "gatsby develop",
"serve": "gatsby serve",
"clean": "gatsby clean"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"*.{md,html,css,scss}": [
"prettier --write"
"private": true,
"workspaces": [
"packages/*"
]
},
"repository": {
"type": "git",
"url": "https://github.com/NebulousLabs/skynet-webportal"
},
"bugs": {
"url": "https://github.com/NebulousLabs/skynet-webportal/issues"
}
}

View File

@ -0,0 +1 @@
/package.json

View File

@ -1,11 +1,10 @@
FROM node:14.6.0
FROM node:14.6.0-alpine
WORKDIR /usr/app
RUN yarn init -y
RUN yarn add express express-http-proxy hs-client
COPY *.js ./
COPY package.json .
RUN yarn --no-lockfile
COPY src/* src/
ENV HSD_NETWORK="main"
ENV HSD_HOST="0.0.0.0"
@ -14,4 +13,4 @@ ENV HSD_API_KEY="foo"
EXPOSE 3100
ENV NODE_ENV production
CMD [ "node", "index.js" ]
CMD [ "node", "src/index.js" ]

View File

@ -0,0 +1,14 @@
{
"name": "handshake-api",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"express": "^4.17.1",
"express-http-proxy": "^1.6.2",
"hs-client": "^0.0.8"
},
"devDependencies": {
"prettier": "^2.0.5"
}
}

View File

@ -0,0 +1 @@
/package.json

View File

@ -0,0 +1,3 @@
{
"printWidth": 120
}

View File

@ -0,0 +1,11 @@
FROM node:14.6.0-alpine
WORKDIR /usr/app
COPY package.json .
RUN yarn --no-lockfile
COPY src/* src/
EXPOSE 3100
ENV NODE_ENV production
CMD [ "node", "src/index.js" ]

View File

@ -0,0 +1,18 @@
{
"name": "health-check",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"body-parser": "^1.19.0",
"express": "^4.17.1",
"http-status-codes": "^1.4.0",
"lodash": "^4.17.19",
"lowdb": "^1.0.0",
"node-schedule": "^1.3.2",
"superagent": "^5.3.1"
},
"devDependencies": {
"prettier": "^2.0.5"
}
}

View File

@ -0,0 +1,3 @@
{
"printWidth": 120
}

View File

@ -0,0 +1,13 @@
FROM node:14.6.0-alpine
WORKDIR /usr/app
COPY src ./src
COPY static ./static
COPY gatsby-config.js .
COPY package.json .
ENV CYPRESS_INSTALL_BINARY 0
ENV GATSBY_TELEMETRY_DISABLED 1
RUN yarn --no-lockfile
RUN yarn build

View File

@ -0,0 +1,86 @@
{
"name": "webapp",
"description": "Sia Skynet",
"version": "1.0.0",
"author": "Nebulous",
"dependencies": {
"axios": "^0.19.2",
"bytes": "^3.1.0",
"classnames": "^2.2.6",
"gatsby": "^2.24.5",
"gatsby-image": "^2.4.13",
"gatsby-plugin-manifest": "^2.4.18",
"gatsby-plugin-matomo": "^0.8.3",
"gatsby-plugin-react-helmet": "^3.3.10",
"gatsby-plugin-remove-serviceworker": "^1.0.0",
"gatsby-plugin-robots-txt": "^1.5.1",
"gatsby-plugin-sass": "^2.3.12",
"gatsby-plugin-sharp": "^2.6.20",
"gatsby-source-filesystem": "^2.3.20",
"gatsby-transformer-sharp": "^2.5.11",
"http-status-codes": "^1.4.0",
"jsonp": "^0.2.1",
"node-sass": "^4.14.0",
"path-browserify": "^1.0.1",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-countup": "^4.3.3",
"react-dom": "^16.13.1",
"react-dropzone": "^11.0.2",
"react-helmet": "^6.1.0",
"react-mailchimp-form": "^1.0.2",
"react-mailchimp-subscribe": "^2.1.0",
"react-reveal": "^1.2.2",
"react-syntax-highlighter": "^12.2.1",
"react-visibility-sensor": "^5.1.1",
"skynet-js": "0.0.8",
"typeface-metropolis": "^0.0.74"
},
"devDependencies": {
"cypress": "^4.10.0",
"cypress-file-upload": "^4.0.7",
"eslint": "^7.5.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-cypress": "^2.11.1",
"eslint-plugin-react": "^7.20.3",
"husky": "^4.2.5",
"lint-staged": "^10.2.11",
"prettier": "^2.0.5"
},
"keywords": [
"sia",
"skynet",
"nebulous",
"blockchain",
"decentralized",
"cloud storage"
],
"license": "MIT",
"scripts": {
"build": "gatsby build",
"start": "gatsby develop",
"serve": "gatsby serve",
"clean": "gatsby clean"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"*.{md,html,css,scss}": [
"prettier --write"
]
},
"repository": {
"type": "git",
"url": "https://github.com/NebulousLabs/skynet-webportal"
},
"bugs": {
"url": "https://github.com/NebulousLabs/skynet-webportal/issues"
}
}

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Some files were not shown because too many files have changed in this diff Show More