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

refact!: dockerization + federation/multi-node portal #13

Merged
merged 169 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
03cba0f
initial work on dockerizing
davidlougheed Nov 15, 2023
c44c7c2
chore: rm unused code in models/samples
davidlougheed Nov 27, 2023
6aa8cf2
chore: ignore excel tmp files
davidlougheed Nov 27, 2023
02895f9
chore: rm unused track / value fields
davidlougheed Nov 27, 2023
99d19d1
chore: add local script for generating gene lists
davidlougheed Nov 27, 2023
7f8f037
chore: rm unused bigWigInfo dependency + more unused code
davidlougheed Nov 28, 2023
2e6332d
refact: rm unused gene code + rename gene name normalize fn
davidlougheed Nov 29, 2023
9f6964c
refact: start moving instance-level configuration to env var only
davidlougheed Nov 29, 2023
92322fc
chore: add pre-generated assembly data + generation script
davidlougheed Nov 29, 2023
db9d9f2
lint
davidlougheed Dec 5, 2023
c3532bd
chore: simplify merge code in prep for switching to bw-merge-window
davidlougheed Dec 5, 2023
44da683
fix: correctly install pm2 in dockerfile
davidlougheed Dec 5, 2023
37ec61e
feat(client): add dataset dropdown (cosmetic for now)
davidlougheed Dec 5, 2023
e7ecbff
chore: rm unused IHEC source
davidlougheed Dec 13, 2023
7066328
chore: rm some unused track metadata fields
davidlougheed Dec 13, 2023
92ce583
refact: use predefined chromosome sizes, update calculate-top-peaks
davidlougheed Dec 13, 2023
a327f80
fix: use env-set tracks dir for metadata source
davidlougheed Dec 13, 2023
7b5329b
chore: replace bigWigMergePlus with bw-merge-window
davidlougheed Dec 14, 2023
09b1f54
chore(scripts): add liftover scripts
davidlougheed Dec 15, 2023
b242bdb
fix: runtime for bigwig liftover
davidlougheed Dec 15, 2023
b68b741
refact(client): reconfigure front end for multiple nodes
davidlougheed Dec 19, 2023
f480a8b
chore: set up cors for API server
davidlougheed Dec 19, 2023
1cc2bdc
chore: add prod config create script
davidlougheed Dec 19, 2023
a3504dc
lint(client): clean up commented out code
davidlougheed Dec 19, 2023
f7dca0b
fix(client): always use api prefix for servers
davidlougheed Dec 19, 2023
b8c9abb
chore(client): eject react-scripts
davidlougheed Dec 19, 2023
bb0d33b
chore: update lockfile dependencies
davidlougheed Dec 19, 2023
77b32fa
chore: simplify config file format + add dataset title
davidlougheed Dec 19, 2023
e618a66
lint: clean up tracks valueAt + merge
davidlougheed Dec 19, 2023
d5aac87
chore: switch tracks metadata file path to load from env var
davidlougheed Dec 19, 2023
9df37ee
docs: link to epivar preprint
davidlougheed Dec 19, 2023
ec03160
chore: rename sample name converter fn + move in config.js
davidlougheed Dec 21, 2023
da98da8
refact: serve assembly/condition/ethnicity data as 'dataset'
davidlougheed Dec 21, 2023
968e85a
chore(client): more generic disclaimer about pre-computation
davidlougheed Dec 21, 2023
835d3df
chore(client): make FAQ dataset-generic
davidlougheed Dec 21, 2023
8d40398
feat: dataset about page with provided markdown
davidlougheed Dec 21, 2023
d119a94
feat(client): multi-node dataset loading + config creation script
davidlougheed Jan 3, 2024
a127ee1
chore: replace GEMINI with on-the-fly VCF interrogation
davidlougheed Jan 3, 2024
2675cdc
chore(docker): add custom runner script for portal config creation
davidlougheed Jan 3, 2024
b08dca4
fix(client): copy issue with webpack
davidlougheed Jan 3, 2024
9dc8ffd
chore: rename gateway to portal + fix prod build issues
davidlougheed Jan 4, 2024
40e5ffa
fix(client): misc issues/styling to do with multi-node support
davidlougheed Jan 4, 2024
7570838
chore: replace filter in config with function for finding snps
davidlougheed Jan 4, 2024
678d779
chore: remove unused config section
davidlougheed Jan 4, 2024
d150551
chore: tweak server for dockerization
davidlougheed Jan 4, 2024
656d3f4
fix(portal): missing whitespace
davidlougheed Jan 4, 2024
cd978c7
ci: add docker build workflow
davidlougheed Jan 4, 2024
61be70c
chore(portal): update FAQ: replace GEMINI with VCF and add igv.js men…
davidlougheed Jan 4, 2024
2a62be5
chore: start working on production docker deployment
davidlougheed Jan 8, 2024
6c115c2
docs: start work on new docs for dockerized/federated epivar
davidlougheed Jan 8, 2024
5ccc2a7
chore: improve metadata-to-json script to not hard-code sheets
davidlougheed Jan 8, 2024
f5f8818
chore(client): comment out some unused code
davidlougheed Jan 8, 2024
09c8d4a
chore: more work on prod deployment + docs
davidlougheed Jan 9, 2024
72e4f66
chore: rework config structure + prod config
davidlougheed Jan 9, 2024
7efa88d
docs: update production node setup guide
davidlougheed Jan 9, 2024
b66178c
fix: move postgres connection env var to envConfig
davidlougheed Jan 9, 2024
ed1e23f
chore(prod): set up secrets loading for postgres
davidlougheed Jan 9, 2024
a62ea09
chore: configurable redis connection
davidlougheed Jan 9, 2024
911ebd8
docs: work on example compose
davidlougheed Jan 9, 2024
49498e9
chore(prod): custom postgres conf
davidlougheed Jan 9, 2024
1ffb425
docs: work on example compose + setup guide
davidlougheed Jan 9, 2024
1f6ddb8
chore: use mjs for calculate-peak-groups script
davidlougheed Jan 9, 2024
d6ebc06
ci: build for arm64 too
davidlougheed Jan 9, 2024
5cf5263
docs: update node setup guide
davidlougheed Jan 9, 2024
5e61581
chore: bump version to 0.18.0
davidlougheed Jan 9, 2024
d3a0339
chore: update lockfile dependencies
davidlougheed Jan 9, 2024
aecd4db
chore(scripts): add logging to metadata-to-json script
davidlougheed Jan 9, 2024
27f3719
chore(scripts): log argv in metadata-to-json
davidlougheed Jan 9, 2024
a12836e
docs: fix run command for generating metadata
davidlougheed Jan 9, 2024
c309cab
chore(prod): add node1 metadata
davidlougheed Jan 9, 2024
60008fe
chore(prod): bind metadata.json file for nodes
davidlougheed Jan 9, 2024
8a33806
chore: work on compose files + move other tracks to node1 only
davidlougheed Jan 9, 2024
9d3408b
chore: disable node 2 for now
davidlougheed Jan 9, 2024
ea5047b
docs: document volumes/binds required for setting up node
davidlougheed Jan 10, 2024
fa0e62a
docs: start documenting env vars for setting up node [skip ci]
davidlougheed Jan 10, 2024
096823d
docs: more work on node setup [skip ci]
davidlougheed Jan 10, 2024
7ab5c14
chore: move import-genes script to mjs
davidlougheed Jan 10, 2024
6eac529
docs: more documentation for peaks/gene-peaks files
davidlougheed Jan 10, 2024
fc62d5f
chore: set up paths for gene files by assembly
davidlougheed Jan 10, 2024
8edd533
chore: take gene-peaks file as stdin to allow custom files
davidlougheed Jan 10, 2024
df5fa43
chore: rm unused files [no ci]
davidlougheed Jan 10, 2024
549b370
chore: move nginx conf for portal into spec folder
davidlougheed Jan 10, 2024
6d749ca
chore(prod): create placeholder volume directories for node1/2
davidlougheed Jan 10, 2024
a30ba2b
fix(prod): docker compose volume mounts [no ci]
davidlougheed Jan 10, 2024
f7516e0
chore(prod): set tag to pr-13 for now for portal/server [no ci]
davidlougheed Jan 10, 2024
e1436c9
chore(prod): use existing tracks locations for node1
davidlougheed Jan 10, 2024
6d49857
chore(prod): don't bind 80 for now while setting up [no ci]
davidlougheed Jan 10, 2024
9e376d0
docs: split into multiple files [no ci]
davidlougheed Jan 11, 2024
e2877a4
docs: fix naming of epivar browser [no ci]
davidlougheed Jan 11, 2024
f6b5b72
chore(client): add new about page for portal
davidlougheed Jan 11, 2024
0f92f2e
chore(prod): use postgres 16 [no ci]
davidlougheed Jan 11, 2024
d580482
chore(client): update about page content
davidlougheed Jan 11, 2024
08b9c9f
fix(prod): use UID instead of USER [no ci]
davidlougheed Jan 11, 2024
aac55b0
fix(prod): mount /etc/passwd [no ci]
davidlougheed Jan 11, 2024
6544343
fix(prod): more of the same [no ci]
davidlougheed Jan 11, 2024
e4bac2a
chore(prod): add up/down scripts [no ci]
davidlougheed Jan 11, 2024
e02c346
chore(prod): use EPIVAR_UID env var [no ci]
davidlougheed Jan 11, 2024
83fd6ae
chore: try to fix running server as non-root
davidlougheed Jan 11, 2024
02b66d9
chore!: proper federate-able static hosting/URLs for merged files
davidlougheed Jan 11, 2024
1952c89
fix(prod): compose cycle [no ci]
davidlougheed Jan 11, 2024
1a51d1c
chore(prod): fix prod nginx conf [no ci]
davidlougheed Jan 11, 2024
53bc99e
fix(scripts): importing csv-parse
davidlougheed Jan 11, 2024
28ccd22
docs(prod): start document for production instance management [no ci]
davidlougheed Jan 11, 2024
eb338e5
fix: missing models copy to server docker img
davidlougheed Jan 11, 2024
681e42a
fix: __dirname undefined
davidlougheed Jan 11, 2024
a6c4c36
chore(schema): increase some field max sizes
davidlougheed Jan 11, 2024
0c0bf2b
chore: work on fixing server img + prod deployment
davidlougheed Jan 11, 2024
8ed3dbd
oops
davidlougheed Jan 11, 2024
3bec54c
chore: gene renaming
davidlougheed Jan 11, 2024
ec781d5
chore: use old gencode release for flu-infection compat
davidlougheed Jan 11, 2024
bcba068
perf(scripts): faster string join for peak copy
davidlougheed Jan 11, 2024
312b2ae
docs(prod): more steps for ingesting data in prod
davidlougheed Jan 12, 2024
a770077
chore(scripts): add done log to import-peaks
davidlougheed Jan 12, 2024
07f39b3
fix: old references to configs in server
davidlougheed Jan 12, 2024
e62ed16
fix: tabix import
davidlougheed Jan 12, 2024
79c9dfb
fix: try to fix VCF init
davidlougheed Jan 12, 2024
d8c7577
chore: use 8 instances in container
davidlougheed Jan 12, 2024
e230ffc
fix: proxy pass for node1
davidlougheed Jan 12, 2024
7aced1d
fix: proxy pass for node2 [no ci]
davidlougheed Jan 12, 2024
bc5075a
fix(prod): try to fix resolving [no ci]
davidlougheed Jan 12, 2024
ed0a183
fix(client): issue with dataset about page
davidlougheed Jan 12, 2024
839a591
chore(client): header debug logging
davidlougheed Jan 12, 2024
cabae76
chore: don't send samples field in dataset endpoint
davidlougheed Jan 12, 2024
f36a9b3
style(prod): fix about.md for node 1/2[ [no ci]
davidlougheed Jan 12, 2024
ecd1543
fix(client): rendering dataset options
davidlougheed Jan 12, 2024
cbdd3a9
fix(client): fix a spacing thing in about
davidlougheed Jan 12, 2024
848fa9e
fix(client): redirect for auth
davidlougheed Jan 12, 2024
5927b59
chore: return chromosome sizes in dataset endpoint
davidlougheed Jan 12, 2024
5b3ad26
style(prod): centre align dataset img [no ci]
davidlougheed Jan 12, 2024
013a4af
fix(client): correct peak img url
davidlougheed Jan 12, 2024
53c7999
fix(client): assembly ID fetching in mergeTracks
davidlougheed Jan 12, 2024
05b585b
debug logging
davidlougheed Jan 12, 2024
87edf1f
chore(prod): add pull script [no ci]
davidlougheed Jan 12, 2024
ed86133
chore: configurable vcf chr transform fn
davidlougheed Jan 14, 2024
ff282ec
chore(prod): auto-pull in pull script
davidlougheed Jan 14, 2024
e01dc2f
fix(prod): pull script [no ci]
davidlougheed Jan 16, 2024
8b591fc
fix: coordinates for vcf query
davidlougheed Jan 16, 2024
59ae989
chore: debugging tracks path
davidlougheed Jan 16, 2024
b0a3d61
fix: issue with running bigWigSummary
davidlougheed Jan 16, 2024
72b3983
docs(prod): add cache clearing commands [no ci]
davidlougheed Jan 16, 2024
602643a
chore: add missing libcurl to server img
davidlougheed Jan 16, 2024
895faa0
fix: don't reveal error message in plot png
davidlougheed Jan 16, 2024
d9407ad
chore(client): make precomputed plot text not specific to Aracena et al
davidlougheed Jan 16, 2024
61ee75c
fix(client): accessing assembly ID for merging tracks
davidlougheed Jan 16, 2024
350b605
fix(client): bad genome browser API URLs
davidlougheed Jan 16, 2024
fba1e33
fix(client): datasets page perma link to hub
davidlougheed Jan 16, 2024
e5c90ef
fix: correctly serve otherData directory
davidlougheed Jan 16, 2024
7b850bc
chore: logging updates
davidlougheed Jan 16, 2024
4e929be
chore: log bigWigMerge errors
davidlougheed Jan 16, 2024
100a82e
fix: inverted ternary in mergeFiles
davidlougheed Jan 16, 2024
94da0db
fix: inconsistent censorship behaviour between plots + tracks
davidlougheed Jan 16, 2024
16175f2
fix: allow linking headings in dataset about.md
davidlougheed Jan 16, 2024
6f19962
fix(client): properly show assembly and exp. conditions
davidlougheed Jan 16, 2024
02ddb25
refact(client): move onPointClick into a useCallback + use CSS styles
davidlougheed Jan 16, 2024
4c19e55
chore(client): debug logging for manhattan plot click
davidlougheed Jan 16, 2024
985b4e9
chore(client): only show node URI + IP if in dev mode
davidlougheed Jan 16, 2024
327d85a
fix(client): missing link to epivar preprint
davidlougheed Jan 16, 2024
ac36c89
chore(client): update lockfile
davidlougheed Jan 16, 2024
6040d89
fix(client): try to fix click handler in manhattan plot
davidlougheed Jan 16, 2024
9ee6619
ci: remove arm builds from server
davidlougheed Jan 16, 2024
f88468a
chore(client): more extensive click event logging
davidlougheed Jan 16, 2024
cf17a24
chore(scripts): try to parallelize calculate-top-peaks script
davidlougheed Jan 16, 2024
d03e782
fix(client): rm click check and log potential data point for manhatta…
davidlougheed Jan 16, 2024
0bd07d9
chore(scripts): calculate-top-peaks: increase chunk size + fix log st…
davidlougheed Jan 16, 2024
7cda472
fix(client): try to fix manhattan zoom
davidlougheed Jan 16, 2024
120b32b
chore(client): log mousedown/up events + rm cursor sync
davidlougheed Jan 16, 2024
5785717
fix(client): revert uplot to 1.6.27
davidlougheed Jan 16, 2024
d0db190
chore(client): rm unneeded manhattan plot mouse binds
davidlougheed Jan 16, 2024
a6c5c43
chore(prod): re-enable node 2 [no ci]
davidlougheed Jan 17, 2024
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
158 changes: 158 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
on:
release:
types: [ published ]
pull_request:
branches:
- master
push:
branches:
- master

jobs:
build-server:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log into the container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up edge/PR server image metadata
id: meta-edge
uses: docker/metadata-action@v5
if: ${{ github.event_name != 'release' }}
with:
images: |
ghcr.io/c3g/epivar-server
flavor: |
latest=false
tags: |
type=raw,value=edge,enable={{is_default_branch}}
type=ref,event=pr
type=sha,prefix=sha-

- name: Build and push edge/PR server image
uses: docker/build-push-action@v5
if: ${{ github.event_name != 'release' }}
with:
context: .
file: spec/server.Dockerfile
push: true
tags: ${{ steps.meta-edge.outputs.tags }}
labels: ${{ steps.meta-edge.outputs.labels }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Set up server release image metadata
id: meta
uses: docker/metadata-action@v5
if: ${{ github.event_name == 'release' }}
with:
images: |
ghcr.io/c3g/epivar-server
flavor: |
latest=true
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

- name: Build and push server release image
uses: docker/build-push-action@v5
if: ${{ github.event_name == 'release' }}
with:
context: .
file: spec/server.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max

build-portal:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log into the container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up edge/PR portal image metadata
id: meta-edge
uses: docker/metadata-action@v5
if: ${{ github.event_name != 'release' }}
with:
images: |
ghcr.io/c3g/epivar-portal
flavor: |
latest=false
tags: |
type=raw,value=edge,enable={{is_default_branch}}
type=ref,event=pr
type=sha,prefix=sha-

- name: Build and push edge/PR portal image
uses: docker/build-push-action@v5
if: ${{ github.event_name != 'release' }}
with:
context: .
file: spec/portal.Dockerfile
push: true
tags: ${{ steps.meta-edge.outputs.tags }}
labels: ${{ steps.meta-edge.outputs.labels }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Set up portal release image metadata
id: meta
uses: docker/metadata-action@v5
if: ${{ github.event_name == 'release' }}
with:
images: |
ghcr.io/c3g/epivar-portal
flavor: |
latest=true
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

- name: Build and push portal release image
uses: docker/build-push-action@v5
if: ${{ github.event_name == 'release' }}
with:
context: .
file: spec/portal.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
~$*
/.idea
/data/*
!/data/.gitkeep
!/data/otherData
!/data/ucsc.other-tracks.txt
/input-files/*.csv
!/input-files/flu-infection-gene-peaks.csv
/config.js
/public/*
node_modules
/.env
/*.gff3
/*.gff3.gz
46 changes: 30 additions & 16 deletions app.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = await import('path');
const path = await import('node:path');
import cors from "cors";
import express from 'express';
// const favicon = await import('serve-favicon');
import logger from 'morgan';
Expand All @@ -8,23 +9,29 @@ import passport from "passport";
import { fileURLToPath } from "url";
import { createClient } from "redis";

(await import('dotenv')).config();
import { REDIS_CONNECTION, MERGED_TRACKS_DIR, OTHER_DATA_PATH, SESSION_SECRET, PORTAL_ORIGIN } from "./envConfig.js";

const __dirname = path.dirname(fileURLToPath(import.meta.url));

const app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'pug')

app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'pug');

app.use(cors({
origin: PORTAL_ORIGIN,
methods: ["GET", "POST"],
credentials: true,
preflightContinue: true,
}));
// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')))
app.use(logger(':req[x-real-ip] [:date[clf]] :method :url :status :response-time ms - :res[content-length]'))
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: false }))
app.use(cookieParser())
app.use(express.static(path.join(__dirname, 'public')))
app.use(logger(':req[x-real-ip] [:date[clf]] :method :url :status :response-time ms - :res[content-length]'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

// Set up auth if it's enabled
if (!process.env.VARWIG_DISABLE_AUTH) {
Expand All @@ -36,11 +43,11 @@ if (!process.env.VARWIG_DISABLE_AUTH) {
const RedisStore = connectRedis(session);

// Legacy mode redis client for connect-redis
const redisClient = createClient({legacyMode: true});
const redisClient = createClient({ url: REDIS_CONNECTION, legacyMode: true });
redisClient.connect().catch(console.error);

app.use(session({
secret: process.env.VARWIG_SESSION_SECRET,
secret: SESSION_SECRET,
httpOnly: false,
resave: false,
saveUninitialized: false,
Expand All @@ -52,21 +59,28 @@ if (!process.env.VARWIG_DISABLE_AUTH) {
app.use(passport.authenticate("session"));
app.use("/api/auth", (await import("./routes/auth.mjs")).default);
}
// - utility routers
app.use('/api/messages', (await import('./routes/messages.mjs')).default);

// - common data
app.use('/api/assays', (await import('./routes/assays.mjs')).default);
// - dataset title, dataset, conditions, ethnicities:
app.use('/api/dataset', (await import('./routes/dataset.mjs')).default);
// - data access routers
app.use('/api/autocomplete', (await import('./routes/autocomplete.mjs')).default);
app.use('/api/messages', (await import('./routes/messages.mjs')).default);
app.use('/api/assembly', (await import('./routes/assembly.mjs')).default);
app.use('/api/overview', (await import('./routes/overview.mjs')).default);
app.use('/api/conditions', (await import('./routes/conditions.mjs')).default);
app.use('/api/ethnicities', (await import('./routes/ethnicities.mjs')).default);
app.use('/api/peaks', (await import('./routes/peaks.mjs')).default);
app.use('/api/sessions', (await import('./routes/sessions.mjs')).default);
app.use('/api/tracks', (await import('./routes/tracks.mjs')).default);
// - routers for genome browsers
app.use('/api/igvjs', (await import('./routes/igvjs.mjs')).default);
app.use('/api/ucsc', (await import('./routes/ucsc.mjs')).default);

// Data static file hosting
// - merged tracks
app.use('/api/merged', express.static(MERGED_TRACKS_DIR));
// - other data
app.use('/api/otherData', express.static(OTHER_DATA_PATH));

// catch 404 and forward to error handler
app.use((req, res, next) => {
Expand Down
18 changes: 18 additions & 0 deletions client/.babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
"presets": [
["@babel/preset-env", {
"modules": false
}],
["@babel/preset-react", {
runtime: "automatic",
development: process.env.NODE_ENV === "development"
}],
],
"plugins": [
"@babel/syntax-dynamic-import",
["import", {
"libraryName": "antd",
"style": true,
}],
],
};
11 changes: 11 additions & 0 deletions client/create_config_prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const siteConfig = {
NODES: (process.env.EPIVAR_NODES ?? "").split(/\s*;\s*/).filter((v) => !!v),
};

if (typeof require !== "undefined" && require.main === module) {
process.stdout.write(`EPIVAR_CONFIG = ${JSON.stringify(siteConfig, null, 2)};\n`);
}

module.exports = {
siteConfig,
};
Loading