From 6fc8c0c094e871b22cf01956d46dd5fa24224844 Mon Sep 17 00:00:00 2001 From: SurbhiAgarwal1 Date: Mon, 15 Jun 2026 02:23:41 +0530 Subject: [PATCH] Move files out of root directory to highlight README (#571) --- CODE_OF_CONDUCT.md => .github/CODE_OF_CONDUCT.md | 0 .github/workflows/linter.yml | 5 ++++- Dockerfile | 4 ++-- Dockerfile-dev | 4 ++-- Makefile | 10 +++++----- .babelrc => application/frontend/.babelrc | 0 .eslintrc.js => application/frontend/.eslintrc.js | 0 .../frontend/.prettierignore | 0 .prettierrc => application/frontend/.prettierrc | 0 cypress.json => application/frontend/cypress.json | 0 .../frontend/enzyme-setup.js | 0 package.json => application/frontend/package.json | 0 tsconfig.json => application/frontend/tsconfig.json | 0 .../frontend/webpack.config.js | 0 .../frontend/webpack.prod.js | 0 yarn.lock => application/frontend/yarn.lock | 0 pytest.ini => application/pytest.ini | 0 requirements.txt => application/requirements.txt | 0 AGENTS.md => docs/AGENTS.md | 0 19 files changed, 13 insertions(+), 10 deletions(-) rename CODE_OF_CONDUCT.md => .github/CODE_OF_CONDUCT.md (100%) rename .babelrc => application/frontend/.babelrc (100%) rename .eslintrc.js => application/frontend/.eslintrc.js (100%) rename .prettierignore => application/frontend/.prettierignore (100%) rename .prettierrc => application/frontend/.prettierrc (100%) rename cypress.json => application/frontend/cypress.json (100%) rename enzyme-setup.js => application/frontend/enzyme-setup.js (100%) rename package.json => application/frontend/package.json (100%) rename tsconfig.json => application/frontend/tsconfig.json (100%) rename webpack.config.js => application/frontend/webpack.config.js (100%) rename webpack.prod.js => application/frontend/webpack.prod.js (100%) rename yarn.lock => application/frontend/yarn.lock (100%) rename pytest.ini => application/pytest.ini (100%) rename requirements.txt => application/requirements.txt (100%) rename AGENTS.md => docs/AGENTS.md (100%) diff --git a/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 7d56f8b94..37b42e864 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -16,6 +16,7 @@ jobs: cache: 'yarn' - name: Install frontend dependencies run: | + cd application/frontend for i in 1 2 3; do yarn install --frozen-lockfile --network-timeout 120000 && exit 0 echo "yarn install failed (attempt $i/3), retrying..." @@ -24,7 +25,9 @@ jobs: echo "yarn install failed after 3 attempts" exit 1 - name: Check frontend formatting - run: yarn prettier --check "application/frontend/src/**/*.{ts,tsx,js}" + run: | + cd application/frontend + yarn prettier --check "src/**/*.{ts,tsx,js}" build: name: Lint Code Base diff --git a/Dockerfile b/Dockerfile index 68395887a..5ef0fe4b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,14 +2,14 @@ FROM node:lts as build LABEL org.opencontainers.image.source = "https://github.com/OWASP/OpenCRE" WORKDIR /code COPY . /code -RUN yarn install && yarn build +RUN cd application/frontend && yarn install && yarn build FROM python:3.11 as run COPY --from=build /code /code WORKDIR /code COPY ./scripts/prod-docker-entrypoint.sh /code -RUN pip install -r requirements.txt gunicorn +RUN pip install -r application/requirements.txt gunicorn ENV INSECURE_REQUESTS=1 ENV FLASK_CONFIG="production" diff --git a/Dockerfile-dev b/Dockerfile-dev index d45486fe0..273a0bef2 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -2,8 +2,8 @@ FROM node:lts AS build WORKDIR /code RUN apt-get update && apt-get install -y chromium -COPY package.json yarn.lock ./ -RUN yarn install +COPY application/frontend/package.json application/frontend/yarn.lock application/frontend/ +RUN cd application/frontend && yarn install COPY . . diff --git a/Makefile b/Makefile index 075f99cce..075dc078a 100644 --- a/Makefile +++ b/Makefile @@ -46,14 +46,14 @@ dev-flask-docker: . ./venv/bin/activate && INSECURE_REQUESTS=1 FLASK_APP=`pwd`/cre.py FLASK_CONFIG=development flask run --host=0.0.0.0 --port $(PORT) e2e: - yarn build + (cd application/frontend && yarn build) [ -d "./venv" ] && . ./venv/bin/activate &&\ export FLASK_APP="$(CURDIR)/cre.py" &&\ export FLASK_CONFIG=development &&\ export INSECURE_REQUESTS=1 &&\ flask run & sleep 5 - yarn test:e2e + (cd application/frontend && yarn test:e2e) sleep 20 killall yarn killall flask @@ -69,7 +69,7 @@ cover: install-deps-python: [ -d "./venv" ] && . ./venv/bin/activate &&\ pip install --upgrade pip setuptools &&\ - pip install -r requirements.txt + pip install -r application/requirements.txt install-deps-typescript: (cd application/frontend && yarn install) @@ -100,13 +100,13 @@ docker-prod-run: docker run -it -p $(PORT):$(PORT) opencre:$(shell git rev-parse HEAD) lint: - [ -d "./venv" ] && . ./venv/bin/activate && black . && yarn lint + [ -d "./venv" ] && . ./venv/bin/activate && black . && (cd application/frontend && yarn lint) mypy: [ -d "./venv" ] && . ./venv/bin/activate && mypy --ignore-missing-imports --implicit-reexport --no-strict-optional --strict application frontend: - yarn build + (cd application/frontend && yarn build) clean: find . -type f -name '*.pyc' -delete diff --git a/.babelrc b/application/frontend/.babelrc similarity index 100% rename from .babelrc rename to application/frontend/.babelrc diff --git a/.eslintrc.js b/application/frontend/.eslintrc.js similarity index 100% rename from .eslintrc.js rename to application/frontend/.eslintrc.js diff --git a/.prettierignore b/application/frontend/.prettierignore similarity index 100% rename from .prettierignore rename to application/frontend/.prettierignore diff --git a/.prettierrc b/application/frontend/.prettierrc similarity index 100% rename from .prettierrc rename to application/frontend/.prettierrc diff --git a/cypress.json b/application/frontend/cypress.json similarity index 100% rename from cypress.json rename to application/frontend/cypress.json diff --git a/enzyme-setup.js b/application/frontend/enzyme-setup.js similarity index 100% rename from enzyme-setup.js rename to application/frontend/enzyme-setup.js diff --git a/package.json b/application/frontend/package.json similarity index 100% rename from package.json rename to application/frontend/package.json diff --git a/tsconfig.json b/application/frontend/tsconfig.json similarity index 100% rename from tsconfig.json rename to application/frontend/tsconfig.json diff --git a/webpack.config.js b/application/frontend/webpack.config.js similarity index 100% rename from webpack.config.js rename to application/frontend/webpack.config.js diff --git a/webpack.prod.js b/application/frontend/webpack.prod.js similarity index 100% rename from webpack.prod.js rename to application/frontend/webpack.prod.js diff --git a/yarn.lock b/application/frontend/yarn.lock similarity index 100% rename from yarn.lock rename to application/frontend/yarn.lock diff --git a/pytest.ini b/application/pytest.ini similarity index 100% rename from pytest.ini rename to application/pytest.ini diff --git a/requirements.txt b/application/requirements.txt similarity index 100% rename from requirements.txt rename to application/requirements.txt diff --git a/AGENTS.md b/docs/AGENTS.md similarity index 100% rename from AGENTS.md rename to docs/AGENTS.md