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

Simplify front-end build process with esbuild #336

Merged
merged 10 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: Install Dependencies
run: npm ci
- name: Run ESLint
run: npm run lint-js
run: npm run lint:js
2 changes: 1 addition & 1 deletion .github/workflows/htmlhint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: Install Dependencies
run: npm ci
- name: Run HTMLHint
run: npm run lint-html
run: npm run lint:html
2 changes: 1 addition & 1 deletion .github/workflows/markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: Install Dependencies
run: npm ci
- name: Run markdownlint
run: npm run lint-md
run: npm run lint:md
2 changes: 1 addition & 1 deletion .github/workflows/stylelint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: Install Dependencies
run: npm ci
- name: Run Stylelint
run: npm run lint-css
run: npm run lint:css
4 changes: 2 additions & 2 deletions .run/npm/lint-js.run.xml → .run/npm/build.run.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="lint-js" type="js.build_tools.npm" nameIsGenerated="true">
<configuration default="false" name="build" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="lint-js" />
<script value="build" />
</scripts>
<node-interpreter value="project" />
<envs />
Expand Down
12 changes: 0 additions & 12 deletions .run/npm/lint-css.run.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .run/npm/lint-html.run.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .run/npm/lint-md.run.xml

This file was deleted.

34 changes: 6 additions & 28 deletions docker/website/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,15 @@
FROM node:lts-alpine AS build

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
COPY html /html/
COPY package.json \
package-lock.json \
/

RUN apk update --quiet && \
apk add --no-cache \
--quiet \
moreutils~=0.68

RUN npm install -g --silent --no-progress \
[email protected] \
[email protected] \
[email protected]

WORKDIR /
COPY html html/

RUN html-minifier-terser --collapse-whitespace \
--remove-comments \
--process-scripts='["text/html","text/x-handlebars-template"]' \
html/index.html \
| sponge html/index.html

RUN for file in html/css/*.css; \
do cleancss "$file" | sponge "$file"; \
done

RUN for file in html/js/*.js; \
do uglifyjs --compress --mangle --webkit -- "$file" | sponge "$file"; \
done
RUN npm ci --silent --no-progress && npm run build

FROM nginx:1.25.4-alpine-slim
LABEL maintainer="Ozren Dabić ([email protected])"

COPY --from=build html /usr/share/nginx/html
COPY --from=build dist /usr/share/nginx/html

ENTRYPOINT ["nginx", "-g", "daemon off;"]
5 changes: 1 addition & 4 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,7 @@ <h6>Number of Forks</h6>
<h5 class="my-3">
Size of codebase
<i data-bs-toggle="tooltip"
data-bs-title="
These filters are codebase-specific and are language-restricted.
When specifying the target programming language, they apply exclusively to that language,
otherwise affecting cumulative metrics across all languages in the repository."
data-bs-title="These filters are codebase-specific and are language-restricted. When specifying the target programming language, they apply exclusively to that language, otherwise affecting cumulative metrics across all languages in the repository."
data-bs-placement="right"
class="bi bi-info-circle"
></i>
Expand Down
Loading