Skip to content

Commit

Permalink
Upgrade to FontAwesome 6.5.1
Browse files Browse the repository at this point in the history
 - Update config files to more consistent format.
 - Update dependencies.
 - Move to elm-tooling.
 - Update readme to fix broken shields.
 - Update workflows.
  • Loading branch information
Lattyware committed Feb 9, 2024
1 parent 4fe14d2 commit 1f27895
Show file tree
Hide file tree
Showing 15 changed files with 662 additions and 2,835 deletions.
22 changes: 0 additions & 22 deletions .eslintrc.json

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
tags:
- "*.*.*"

env:
GIT_TAG_NAME: ${{ github.ref_type == 'tag' && github.ref_name || '' }}

jobs:
build:
name: Build
Expand All @@ -17,26 +20,23 @@ jobs:

steps:
- name: Checkout elm-fontawesome-generator repository.
uses: actions/checkout@v3

- name: Get version from tag.
uses: little-core-labs/[email protected]
uses: actions/checkout@v4

- name: Setup buildx.
uses: docker/setup-buildx-action@v2

- name: Build library.
uses: docker/bake-action@v2
uses: docker/bake-action@v4
env:
ELM_FONTAWESOME_VERSION: ${{ env.GIT_TAG_NAME }}

- name: Ensure example builds.
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
targets: example

- name: Checkout elm-fontawesome repository.
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: "lattyware/elm-fontawesome"
ssh-key: ${{ secrets.LIB_DEPLOY_KEY }}
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
- 7.0.0

- Changed:
- Upgraded FontAwesome version.

- 6.0.0

- Changed:
Expand Down
18 changes: 7 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NODE_VERSION=18
ARG NODE_VERSION=21
ARG ELM_FONTAWESOME_VERSION


Expand All @@ -10,8 +10,8 @@ WORKDIR "/fa"
# Build the generator.
FROM base AS build

COPY ["./package.json", "./package-lock.json", "./"]
RUN ["npm", "ci"]
COPY ["./package.json", "./package-lock.json", "elm-tooling.json", "./"]
RUN ["npm", "ci", "--include=dev"]

COPY ["./tsconfig.json", "./"]
COPY ["./src", "./src"]
Expand All @@ -21,12 +21,8 @@ RUN ["npm", "run", "build"]
# Install only prod dependencies.
FROM base AS install

COPY ["./package.json", "./package-lock.json", "./"]
RUN ["npm", "ci", "--ommit=dev"]

# Fix https://github.com/FortAwesome/Font-Awesome/pull/19041 because FA don't ship ES6 modules correctly.
RUN for f in node_modules/@fortawesome/*/*.es.js; do mv "$f" "$(echo "$f" | sed s/\.es\.js/\.mjs/)"; done
RUN for f in node_modules/@fortawesome/*/package.json; do sed -i s/\.es\.js/\.mjs/ "$f"; done
COPY ["./package.json", "./package-lock.json", "elm-tooling.json", "./"]
RUN ["npm", "ci"]


# Image for the generator.
Expand All @@ -39,7 +35,7 @@ COPY ["./config.json", "./"]
COPY ["./base", "./base"]
COPY --from=build ["/fa/dist/generator", "./"]

CMD ["node", "./cli.js"]
CMD ["node", "--enable-source-maps", "./cli.js"]


# Actually execute the generator.
Expand All @@ -48,7 +44,7 @@ FROM generator AS generate
ARG ELM_FONTAWESOME_VERSION
ENV ELM_FONTAWESOME_VERSION=${ELM_FONTAWESOME_VERSION}

RUN ["node", "./cli.js"]
RUN ["node", "--enable-source-maps", "./cli.js"]


# Just keep the generated files.
Expand Down
26 changes: 10 additions & 16 deletions base/.github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- "*.*.*"

env:
GIT_TAG_NAME: ${{ github.ref_type == 'tag' && github.ref_name || '' }}

jobs:
publish-elm:
name: Publish elm package
Expand All @@ -14,16 +17,13 @@ jobs:
contents: read

steps:
- name: Get version from tag.
uses: little-core-labs/[email protected]

- name: Checkout elm-fontawesome repository.
uses: actions/checkout@v3
with:
ref: ${{ env.GIT_TAG_NAME }}

- name: Set up elm.
uses: jorelali/setup-elm@v3
uses: jorelali/setup-elm@v5
with:
elm-version: 0.19.1

Expand All @@ -40,16 +40,13 @@ jobs:

steps:
- name: Checkout elm-fontawesome repository.
uses: actions/checkout@v3

- name: Get version from tag.
uses: little-core-labs/[email protected]
uses: actions/checkout@v4

- name: Setup buildx.
uses: docker/setup-buildx-action@v2

- name: Set up elm.
uses: jorelali/setup-elm@v3
uses: jorelali/setup-elm@v5
with:
elm-version: 0.19.1

Expand All @@ -58,22 +55,19 @@ jobs:
echo Y | elm install "lattyware/elm-fontawesome"
- name: Build example.
uses: docker/bake-action@v3
uses: docker/bake-action@v4
with:
#working-directory: "example" # Not available yet, hack workaround.
files: "./example/docker-bake.hcl" # Workaround
set: "build.context=./example" # Workaround
workdir: "example"
env:
FONTAWESOME_SOURCE: "package"
FONTAWESOME_CONTEXT: "." # Workaround.

- name: Set up git to push.
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Checkout elm-fontawesome-example repository.
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: "lattyware/elm-fontawesome"
ssh-key: ${{ secrets.EXAMPLE_DEPLOY_KEY }}
Expand All @@ -99,7 +93,7 @@ jobs:
fi
- name: Checkout elm-fontawesome-example pages repository.
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: "lattyware/elm-fontawesome"
ssh-key: ${{ secrets.EXAMPLE_DEPLOY_KEY }}
Expand Down
4 changes: 2 additions & 2 deletions base/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# FontAwesome for Elm.

[![Generator Build Status](https://img.shields.io/github/workflow/status/lattyware/elm-fontawesome-generator/Build?label=generator%20build&logo=github)](https://github.com/Lattyware/elm-fontawesome-generator/actions/workflows/build.yml)
[![Package Publish Status](https://img.shields.io/github/workflow/status/lattyware/elm-fontawesome/Publish?label=package%20publish&logo=github)](https://github.com/Lattyware/elm-fontawesome/actions/workflows/publish.yml)
[![Generator Build Status](https://img.shields.io/github/actions/workflow/status/lattyware/elm-fontawesome-generator/build.yml?logo=github&label=generator%20build)](https://github.com/Lattyware/elm-fontawesome-generator/actions/workflows/build.yml)
[![Package Publish Status](https://img.shields.io/github/actions/workflow/status/lattyware/elm-fontawesome/publish.yml?logo=github&label=package%20publish)](https://github.com/Lattyware/elm-fontawesome/actions/workflows/publish.yml)
[![Elm package](https://img.shields.io/elm-package/v/lattyware/elm-fontawesome?logo=elm)](https://package.elm-lang.org/packages/lattyware/elm-fontawesome/latest/)
[![FontAwesome version](https://img.shields.io/github/package-json/dependency-version/lattyware/elm-fontawesome-generator/@fortawesome/fontawesome-svg-core?label=FontAwesome&logo=fontawesome)](https://github.com/Lattyware/elm-fontawesome-generator/blob/main/package.json)

Expand Down
1 change: 0 additions & 1 deletion base/example/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#syntax=docker/dockerfile-upstream:1.4.0-rc1
ARG ELM_VERSION=0.19.1
ARG ELM_FONTAWESOME_SOURCE=context
ARG ELM_FONTAWESOME_PACKAGE=lattyware/elm-fontawesome
Expand Down
4 changes: 2 additions & 2 deletions base/example/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# FontAwesome 5 for Elm Example.

[![Generator Build Status](https://img.shields.io/github/workflow/status/lattyware/elm-fontawesome-generator/Build?label=generator%20build&logo=github)](https://github.com/Lattyware/elm-fontawesome-generator/actions/workflows/build.yml)
[![Package Publish Status](https://img.shields.io/github/workflow/status/lattyware/elm-fontawesome/Publish?label=package%20publish&logo=github)](https://github.com/Lattyware/elm-fontawesome/actions/workflows/publish.yml)
[![Generator Build Status](https://img.shields.io/github/actions/workflow/status/lattyware/elm-fontawesome-generator/build.yml?logo=github&label=generator%20build)](https://github.com/Lattyware/elm-fontawesome-generator/actions/workflows/build.yml)
[![Package Publish Status](https://img.shields.io/github/actions/workflow/status/lattyware/elm-fontawesome/publish.yml?logo=github&label=package%20publish)](https://github.com/Lattyware/elm-fontawesome/actions/workflows/publish.yml)
[![Elm package](https://img.shields.io/elm-package/v/lattyware/elm-fontawesome?logo=elm)](https://package.elm-lang.org/packages/lattyware/elm-fontawesome/latest/)
[![FontAwesome version](https://img.shields.io/github/package-json/dependency-version/lattyware/elm-fontawesome-generator/@fortawesome/fontawesome-svg-core?label=FontAwesome&logo=fontawesome)](https://github.com/Lattyware/elm-fontawesome-generator/blob/main/package.json)

Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "6.0.0",
"version": "7.0.0",
"iconSources": [
{
"name": "Solid",
Expand Down
6 changes: 6 additions & 0 deletions elm-tooling.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tools": {
"elm":"0.19.1",
"elm-format": "0.8.7"
}
}
27 changes: 27 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export default [
{
"root": true,
"parser": "@typescript-eslint/parser",
parserOptions: {
project: ["tsconfig.json"],
},
"plugins": [
"@typescript-eslint",
"simple-import-sort",
"eslint-plugin-prettier"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"rules": {
"simple-import-sort/imports": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_", "destructuredArrayIgnorePattern": "^_" }
]
}
}
]
Loading

0 comments on commit 1f27895

Please sign in to comment.