Skip to content

Commit

Permalink
Merge pull request #1407 from kiosion/design-rework-2
Browse files Browse the repository at this point in the history
Design rework
  • Loading branch information
kiosion authored Oct 14, 2024
2 parents e8331f7 + a083c52 commit 0ca470d
Show file tree
Hide file tree
Showing 126 changed files with 3,289 additions and 2,234 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/netlify-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
name: Install pnpm
id: pnpm-install
with:
version: 9.1.0
version: 9.8.0
run_install: false
- name: Use node_modules cache
uses: actions/cache@v4
id: nm-cache
with:
path: 'svelte-app/node_modules'
path: "svelte-app/node_modules"
key: ${{ runner.os }}-npm-${{ hashFiles('svelte-app/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-nm-16-
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: CI - Sanity

on:
push:
branches: [ "main" ]
branches: ["main"]
paths-ignore:
- '**/*.md'
- 'LICENSE'
- '**/.husky'
- 'svelte-app/**'
- 'express-api/**'
- 'elixir-api/**'
- "**/*.md"
- "LICENSE"
- "**/.husky"
- "svelte-app/**"
- "express-api/**"
- "elixir-api/**"

concurrency:
concurrency:
group: sanity
cancel-in-progress: true

Expand All @@ -30,13 +30,13 @@ jobs:
name: Install pnpm
id: pnpm-install
with:
version: 9.1.0
version: 9.8.0
run_install: false
- name: Use node_modules cache
uses: actions/cache@v4
id: nm-cache
with:
path: 'sanity-cms/node_modules'
path: "sanity-cms/node_modules"
key: ${{ runner.os }}-npm-${{ hashFiles('sanity-cms/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-npm-
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/svelte.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ name: CI

on:
push:
branches: [ "main" ]
branches: ["main"]
paths-ignore:
- '**/*.md'
- 'LICENSE'
- '**/.husky'
- 'sanity-cms/**'
- 'express-api/**'
- 'rust-api/**'
- 'elixir-api/**'
- "**/*.md"
- "LICENSE"
- "**/.husky"
- "sanity-cms/**"
- "express-api/**"
- "rust-api/**"
- "elixir-api/**"

concurrency:
concurrency:
group: ci
cancel-in-progress: true

Expand All @@ -31,13 +31,13 @@ jobs:
name: Install pnpm
id: pnpm-install
with:
version: 9.1.0
version: 9.8.0
run_install: false
- name: Use node_modules cache
uses: actions/cache@v4
id: nm-cache
with:
path: 'svelte-app/node_modules'
path: "svelte-app/node_modules"
key: ${{ runner.os }}-npm-${{ hashFiles('svelte-app/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-npm-
Expand All @@ -52,6 +52,6 @@ jobs:
secrets: inherit
deploy:
name: Deploy
needs: [ lint, tests ]
needs: [lint, tests]
uses: ./.github/workflows/netlify-deploy.yml
secrets: inherit
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Tests

on:
pull_request:
branches: [ "main" ]
branches: ["main"]
workflow_call:

concurrency:
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true

Expand All @@ -23,13 +23,13 @@ jobs:
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.1.0
version: 9.8.0
run_install: false
- name: Use node_modules cache
uses: actions/cache@v4
id: nm-cache
with:
path: 'svelte-app/node_modules'
path: "svelte-app/node_modules"
key: ${{ runner.os }}-npm-${{ hashFiles('svelte-app/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-npm-
Expand All @@ -52,13 +52,13 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.1.0
version: 9.8.0
run_install: false
- name: Use node_modules cache
uses: actions/cache@v4
id: nm-cache
with:
path: 'svelte-app/node_modules'
path: "svelte-app/node_modules"
key: ${{ runner.os }}-npm-${{ hashFiles('svelte-app/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-npm-
Expand Down
2 changes: 1 addition & 1 deletion elixir-api/lib/app/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ defmodule Hexerei.Application do
Hexerei.Cache.TranslateCache,
[
options: [
max_size: 512
max_size: 1024
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion elixir-api/lib/routes/api/v1/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule Router.Api.V1.Config do
with {:ok, params} <- validate_query_params(conn, %{"lang" => "en"}) do
query =
Query.new()
|> Query.filter([%{"_type" => "'siteSettings'"}])
|> Query.filter([%{"_id" => "'siteSettings'"}])
|> Query.qualify("[0]")
|> Query.build!()

Expand Down
10 changes: 0 additions & 10 deletions elixir-api/lib/routes/api/v1/tag.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,6 @@ defmodule Router.Api.V1.Tag do
}
)

# parsed_counts = Task.await(counts)

# {transformed_result, meta, code} =
# transform_result_document(query, result, :tag, params, %{
# "total" => parsed_counts["result"]["total"],
# "count" => parsed_counts["result"]["count"],
# "id" => id,
# "type" => params["type"]
# })

update_meta_and_send_response(conn, code, transformed_result, meta, duration)
end)
else
Expand Down
13 changes: 11 additions & 2 deletions elixir-api/lib/routes/cdn.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,20 @@ defmodule Router.Cdn do

with true <- is_binary(url_parts.filetype),
{:ok, url} <- Hexerei.SanityClient.urlFor(url_parts.asset, conn.query_string) do
with {:ok, %HTTPoison.Response{status_code: 200, body: body}} <-
with {:ok, %HTTPoison.Response{status_code: 200, body: body, headers: headers}} <-
Hexerei.Env.get(:http_client, Hexerei.HTTP.DefaultClient).get(url) do
content_type =
headers
|> Enum.find(fn {k, _} -> String.downcase(k) == "content-type" end)
|> case do
{k, v} -> String.downcase(v)
# fall back to filetype from ext, if present
_ -> "image/#{url_parts.filetype}"
end

conn
|> put_resp_header("Access-Control-Allow-Origin", "*")
|> put_resp_content_type("image/#{url_parts.filetype}")
|> put_resp_content_type(content_type)
|> send_resp(200, body)
else
{:ok, %HTTPoison.Response{status_code: 404}} ->
Expand Down
Loading

0 comments on commit 0ca470d

Please sign in to comment.