Skip to content

Commit 440916e

Browse files
authored
Merge pull request #68 from NYULibraries/implement-proposed-statuspageembed-changes
Implement proposed StatusPageEmbed changes
2 parents d7c5f01 + 878bd07 commit 440916e

97 files changed

Lines changed: 10863 additions & 8493 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ docker_build: &docker_build
77
run:
88
name: Docker build
99
command: |
10-
docker compose build test compile
10+
docker compose build unit-tests compile
1111
1212
test: &test
1313
run:
1414
name: Test
1515
command: |
16-
docker compose run test
16+
docker compose run unit-tests
1717
18-
webpack_copy: &webpack_copy
18+
copy_build: &copy_build
1919
run:
20-
name: Copy Webpack build
20+
name: Copy vite build
2121
command: |
2222
docker cp $(docker ps -a -q --filter name=compile):/app/dist ./
2323
24-
webpack_test: &webpack_test
24+
test_build: &test_build
2525
run:
26-
name: Test that webpack built correct files
26+
name: Test that vite built correct files
2727
command: |
2828
test -e dist/index.min.css
2929
test -e dist/index.min.js
@@ -56,11 +56,11 @@ jobs:
5656
- *docker_build
5757
- *test
5858
- run:
59-
name: Webpack compile stage
59+
name: Vite build
6060
command: |
61-
docker compose run compile build:stage
62-
- *webpack_copy
63-
- *webpack_test
61+
docker compose run compile
62+
- *copy_build
63+
- *test_build
6464
- *aws_env
6565
- *aws-sync-s3
6666

@@ -71,11 +71,11 @@ jobs:
7171
- *docker_build
7272
- *test
7373
- run:
74-
name: Webpack compile prod
74+
name: Vite build
7575
command: |
76-
docker compose run compile build:prod
77-
- *webpack_copy
78-
- *webpack_test
76+
docker compose run compile
77+
- *copy_build
78+
- *test_build
7979
- *aws_env
8080
- *aws-sync-s3
8181

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node_modules/
22
npm-debug.log
3-
yarn-error.log
43

.env

Whitespace-only changes.

.eslintrc.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
dist/
12
node_modules/
3+
4+
.env
5+
.node-version
6+
27
npm-debug.log
38
yarn-error.log
4-
.node-version
5-
dist/
6-
package-lock.json
9+

Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
FROM node:20-alpine
1+
FROM node:24.15.0-trixie
22

33
ENV INSTALL_PATH /app
44
ENV PATH $INSTALL_PATH/node_modules/.bin:$PATH
55

6-
COPY package.json yarn.lock /tmp/
6+
COPY package.json package-lock.json /tmp/
7+
# Keep this here for the convenience of developers who are using Hadolint
8+
# in their local development environments.
9+
# DL3003 is "Use absolute paths, or use WORKDIR to switch to a directory."
710
# hadolint ignore=DL3003
8-
RUN cd /tmp && yarn install --frozen-lockfile \
9-
&& yarn cache clean \
11+
RUN cd /tmp && npm install \
1012
&& mkdir -p $INSTALL_PATH && cp -a /tmp/node_modules $INSTALL_PATH
1113

1214
COPY . $INSTALL_PATH
1315

1416
WORKDIR $INSTALL_PATH
1517

16-
CMD ["NODE_ENV=production", "yarn", "build:prod"]
18+
CMD ["npm", "run", "build"]

Dockerfile.development

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM node:24.15.0-trixie
2+
3+
WORKDIR /app
4+
5+
COPY public/ ./public
6+
COPY src/ ./src
7+
COPY index.html .
8+
COPY package.json .
9+
COPY package-lock.json .
10+
COPY vite.config.js .
11+
12+
RUN npm install
13+
14+
EXPOSE 5173
15+
16+
CMD ["npm", "run", "dev"]

Dockerfile.e2e-tests

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM mcr.microsoft.com/playwright:v1.58.2-jammy AS builder
2+
3+
WORKDIR /e2e
4+
5+
COPY test/e2e/package.json test/e2e/package-lock.json ./
6+
7+
# Install dependencies
8+
RUN npm install \
9+
# Install only the Chromium browser, as it is the only browser needed for the project. \
10+
&& npx playwright install chromium
11+
12+
# Copy over remaining e2e files
13+
COPY test/e2e/ .
14+
15+
FROM node:26-bookworm
16+
17+
ENV INSTALL_PATH /app
18+
19+
COPY src/js/config.mjs $INSTALL_PATH/src/js/
20+
21+
RUN apt-get update -y && apt-get install -y curl
22+
23+
WORKDIR $INSTALL_PATH/test/e2e
24+
25+
# Install Chromium dependencies using the Playwright CLI
26+
# Separation of concerns: The build stage is primarily focused on building and preparing the application,
27+
# including installing dependencies required for the application to run.
28+
# Installing Chromium dependencies in the production stage ensures that only the necessary dependencies
29+
# for running the application are included in the final image, reducing the overall image size
30+
RUN npx playwright install-deps chromium
31+
32+
# Copy dependencies and the app
33+
COPY --from=builder /e2e .
34+
35+
# Copy the browser binaries
36+
# https://github.com/microsoft/playwright/blob/1f209204cd18bce7d1bfae50f5af105dec752df8/utils/docker/Dockerfile.focal#L33
37+
COPY --from=builder /ms-playwright /ms-playwright
38+
39+
ENV CONTAINER_MODE true
40+
# Set the PLAYWRIGHT_BROWSERS_PATH environment variable to tell Playwright where to look for the browser binaries
41+
# https://github.com/microsoft/playwright/blob/1f209204cd18bce7d1bfae50f5af105dec752df8/utils/docker/Dockerfile.focal#L24
42+
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
43+
44+
# Entrypoint ensures $PLAYWRIGHT_BASE_URL has started
45+
ENTRYPOINT [ "./scripts/docker-entrypoint.sh" ]
46+
47+
# Run playwright tests
48+
CMD ["npm", "run", "test"]

Dockerfile.statuspage-proxy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:24.15.0-trixie
2+
3+
WORKDIR /app
4+
5+
COPY package.json .
6+
COPY src ./src
7+
COPY tools ./tools
8+
9+
CMD ["npm", "run", "statuspage-proxy"]
10+

Dockerfile.unit-tests

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:24.15.0-trixie
2+
3+
ENV APP_INSTALL_PATH /app
4+
ENV UNIT_TESTS_INSTALL_PATH ${APP_INSTALL_PATH}/test/unit
5+
6+
COPY src $APP_INSTALL_PATH/src
7+
8+
COPY test/unit/package.json test/unit/package-lock.json /tmp/
9+
10+
RUN cd /tmp && npm install \
11+
&& mkdir -p ${UNIT_TESTS_INSTALL_PATH} \
12+
&& cd ${UNIT_TESTS_INSTALL_PATH} \
13+
&& cp -R /tmp/node_modules ${UNIT_TESTS_INSTALL_PATH} \
14+
&& rm -r /tmp/*
15+
16+
COPY test/unit ${UNIT_TESTS_INSTALL_PATH}
17+
18+
WORKDIR ${UNIT_TESTS_INSTALL_PATH}
19+
20+
# Run playwright tests
21+
CMD [ "npm", "run", "test" ]
22+

0 commit comments

Comments
 (0)