Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
tchoutri committed Mar 21, 2023
2 parents fa89925 + e5ce2cf commit 11d3aff
Show file tree
Hide file tree
Showing 136 changed files with 4,705 additions and 2,745 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,27 @@ on:
branches: ["main", "development"]

jobs:
generateMatrix:
name: "Generate matrix from cabal"
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout base repo
uses: actions/checkout@v3
- name: Extract the tested GHC versions
id: set-matrix
run: |
wget https://github.com/Kleidukos/get-tested/releases/download/v0.1.3.0/get-tested-0.1.3.0-linux-amd64 -O get-tested
chmod +x get-tested
./get-tested --ubuntu *.cabal >> $GITHUB_OUTPUT
tests:
runs-on: ubuntu-latest
name: ${{ matrix.ghc }} on ${{ matrix.os }}
needs: generateMatrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJSON(needs.generateMatrix.outputs.matrix) }}
# Service containers to run with `container-job`
services:
# Label used to access the service container
Expand Down Expand Up @@ -59,7 +78,7 @@ jobs:
- name: Cache
uses: actions/cache@v3.2.2
uses: actions/cache@v3.3.1
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ghc-9.2.4-${{ hashFiles('cabal.project.freeze') }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/check-flora-tickets-in-prs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ jobs:
- name: Checkout Code
uses: "actions/checkout@v3"
with:
ref: "${{ github.head_ref }}"
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Make sure there is one proper commit or PR title
env:
PULL_REQUEST_TITLE: "${{ github.event.pull_request.title }}"
Expand All @@ -14,7 +15,7 @@ jobs:
PULL_REQUEST_AUTHOR: "${{ github.event.pull_request.user.login }}"
run: |
./.github/workflows/check-ticket-in-prs.sh
name: Make sure PR has FLORA issue in title or has one commit with FLORA issue
name: Make sure PR has FLORA or NO-ISSUE issue in title or has one commit with FLORA/NO-ISSUE issue
on:
pull_request:
types:
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/flakes.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cabal.project.local
cbits/*.cpp
dist-newstyle
environment.local.sh
environment.test.local.sh
environment.prod.sh
ghcid.text
logs/*
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

## 1.0.10 -- 2023-03-21
* Add buttons to the main page for ghcup and cabal guides ([#341](https://github.com/flora-pm/flora-server/pull/341))
* Split the project into internal libraries ([#337](https://github.com/flora-pm/flora-server/pull/337))
* Fetch and store deprecation information about packages ([#342](https://github.com/flora-pm/flora-server/pull/342))
* Only index versionless package pages ([#343](https://github.com/flora-pm/flora-server/pull/343))
* Display deprecation information on the package page ([#344](https://github.com/flora-pm/flora-server/pull/344))
* Display deprecation information for releases ([#347](https://github.com/flora-pm/flora-server/pull/347))
* Make package listings denser ([#355](https://github.com/flora-pm/flora-server/pull/355))

## 1.0.9 -- 2023-01-06
* Fix package title size in smaller screens ([#297](https://github.com/flora-pm/flora-server/pull/297))
* Enqueue package import jobs ([#300](https://github.com/flora-pm/flora-server/pull/300))
Expand Down
9 changes: 6 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ but we need you to read this document when you open your PR or your issue:

We need you to read and acknowledge our [Code of Conduct][CoC] document.

The compiler version used is GHC 9.2.5. We encourage to use cabal-install 3.8.
The compiler version used is described in the `cabal.project` file.
`cabal-install` version 3.8 or higher is needed.

The following Haskell command-line tools will have to be installed:

Expand All @@ -23,7 +24,7 @@ The following Haskell command-line tools will have to be installed:

### Nix Setup

Nix Flakes are used to build the application. It is recommended your version of the `nix` tool
Nix Flakes are a very experimental way to build the application. It is recommended your version of the `nix` tool
is at least 2.11. Please do not forget to add the appropriate configuration line in order to use flakes, as
described in the [NixOS Wiki][nix-flakes] page.

Expand All @@ -33,6 +34,8 @@ After that, it should be straightforward to run:
$ make nix-shell
```

Contributions on that front are always appreciated. They however need to support the workflow of both Linux and macOS users.

### Pull Requests

You need to
Expand Down Expand Up @@ -81,7 +84,7 @@ Here are the steps:
2. `$ cabal run -- flora-server +RTS -l -hT -i0.5 -RTS`
3. `$ eventlog2html flora-server.eventlog`

[CoC]: https://github.com/flora-pm/flora-server/blob/master/CODE_OF_CONDUCT.md
[CoC]: https://github.com/flora-pm/flora-server/blob/development/CODE_OF_CONDUCT.md
[Feature Request board]: https://github.com/flora-pm/flora-server/discussions/new?category=feature-requests
[Questions board]: https://github.com/flora-pm/flora-server/discussions/categories/questions
[Ticket]: https://github.com/flora-pm/flora-server/issues/new
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ db-create: ## Create the database
db-drop: ## Drop the database
@dropdb -f --if-exists -h $(FLORA_DB_HOST) -p $(FLORA_DB_PORT) -U $(FLORA_DB_USER) $(FLORA_DB_DATABASE)

db-setup: db-create ## Setup the dev database
db-setup: db-create db-init db-migrate ## Setup the dev database

db-init: ## Create the database schema
@migrate init "$(FLORA_DB_CONNSTRING)"

db-migrate: ## Apply database migrations
@migrate migrate "$(FLORA_DB_CONNSTRING)" migrations

db-reset: db-drop db-setup db-provision ## Reset the dev database (uses Cabal)
db-reset: db-drop db-setup db-provision ## Reset the dev database

db-provision: build ## Load the development data in the database
@cabal run -- flora-cli create-user --username "hackage-user" --email "[email protected]" --password "foobar2000"
Expand Down Expand Up @@ -64,7 +68,7 @@ lint: ## Run the code linter (HLint)
@find app test src -name "*.hs" | xargs -P $(PROCS) -I {} hlint --refactor-options="-i" --refactor {}

style: ## Run the code formatters (stylish-haskell, cabal-fmt, nixfmt, prettier, stylelint)
@find app test src -name '*.hs' -exec fourmolu -i {} +
@find app test src -name '*.hs' | xargs -P $(PROCS) -I {} fourmolu -q -i {}
@cabal-fmt -i flora.cabal
@nixfmt *.nix
@cd assets ; yarn prettier --write css
Expand Down
6 changes: 4 additions & 2 deletions app/cli/DesignSystem.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ import Data.Text.Lazy qualified as TL
import Data.UUID qualified as UUID
import Data.Vector (Vector)
import Data.Vector qualified as Vector
import Distribution.Version
import Effectful
import Effectful.Fail
import Env
import Lucid
import PyF (fmt)

import Distribution.SPDX
import Flora.Environment.Config
import Flora.Model.Category
import Flora.Model.Category qualified as Category
Expand Down Expand Up @@ -93,8 +95,8 @@ packageListItemExample =
( namespaceExample
, packageNameExample
, "Basic libraries"
, read "4.16.0.0"
, read "BSD-3-Clause"
, mkVersion [4, 16, 0, 0]
, License (simpleLicenseExpression BSD_3_Clause)
)

categoryCardExample :: FloraHTML
Expand Down
9 changes: 9 additions & 0 deletions assets/css/package.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
width: 100%;
}

.package-alternatives {
list-style-type: disc;
list-style-position: inside;
}

.package-title {
.version {
font-size: medium;
Expand Down Expand Up @@ -47,6 +52,10 @@
margin-bottom: 0.75rem;
}

.release-deprecated {
color: var(--deprecated-version);
}

.package-right-column {
order: 3;
}
Expand Down
91 changes: 85 additions & 6 deletions assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ body {
color: var(--text-color);
}

summary.package-component {
cursor: pointer;
font-size: 1.25rem;
line-height: 1.25rem;
margin-top: 1rem;
margin-bottom: 1rem;
padding-left: 1rem;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}

summary.package-component > * {
display: inline;
}

summary.package-component:hover {
background-color: var(--package-list-item-background-hover-color);
border-radius: 6px;
}

.larger-container {
margin-left: auto;
margin-right: auto;
Expand Down Expand Up @@ -102,17 +122,15 @@ a {
}

.package-list-item {
font-size: 1.25rem;
line-height: 1.75rem;
list-style: none;

a {
display: block;
margin-top: 1.5rem;
margin-bottom: 1.5rem;
margin-top: 1rem;
margin-bottom: 1rem;
padding-left: 1rem;
padding-top: 0.75rem;
padding-bottom: 0.75rem;
padding-top: 0.25rem;
padding-bottom: 0.25rem;
font-size: 1.25rem;
line-height: 1.75rem;
}
Expand Down Expand Up @@ -417,6 +435,58 @@ a {
}
}

section#main-page-buttons {
max-width: 28rem;
border-top: 1px solid var(--text-color);
border-color: var(--navbar-background-color);
display: flex;
flex-wrap: wrap;
gap: 16px;
justify-content: center;
padding-top: 3rem;
margin-top: 3rem;
margin-left: auto;
margin-right: auto;

.button {
color: var(--text-color);
font-weight: bolder;
background-color: var(--main-page-button-background);
border-color: var(--text-color);
padding-top: 1rem;
padding-bottom: 1rem;
padding-left: 2rem;
padding-right: 2rem;
margin-left: 9px;
margin-right: 9px;
border-radius: 50rem;

/*
}
width: 400px;
height: 112px;
*/
}

.button:hover {
border-color: var(--main-page-button-focus-border-color);
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 200ms;

/* offset-x | offset-y | blur-radius | spread-radius | color */
box-shadow: 0 0 4px 2px var(--main-page-button-focus-border-color);
}

.button:active {
border-color: var(--main-page-button-focus-border-color);
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 200ms;

/* offset-x | offset-y | blur-radius | spread-radius | color */
box-shadow: 0 0 4px 2px var(--main-page-button-focus-border-color);
}
}

.about-page {
margin-left: auto;
margin-right: auto;
Expand Down Expand Up @@ -552,6 +622,15 @@ a {
}
}

.main-search {
margin-left: 10px;
margin-right: 10px;

input.search-bar {
padding-left: 5rem;
}
}

.about-page {
margin-left: auto;
margin-right: auto;
Expand Down
8 changes: 8 additions & 0 deletions assets/css/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
--changelog-code-background-color: hsl(225 13% 87%);
--install-string-border: hsl(215 28% 17%);
--compiler-badge-background: hsl(218 12% 84%);
--main-page-button-background: hsl(218 12% 84%);
--main-page-button-focus-border-color: hsl(294 40% 30%);
--main-page-button-divider: hsl(294 40% 20%);
--deprecated-version: hsl(358 80% 60%);
}

html[data-theme="dark"] {
Expand Down Expand Up @@ -75,4 +79,8 @@ html[data-theme="dark"] {
--changelog-code-background-color: hsl(218 29% 30%);
--install-string-border: hsl(215 28% 17%);
--compiler-badge-background: hsl(218 30% 30%);
--main-page-button-background: hsl(218 29% 30%);
--main-page-button-focus-border-color: hsl(294 40% 30%);
--main-page-button-divider: hsl(218 30% 15%);
--deprecated-version: hsl(358 80% 60%);
}
2 changes: 1 addition & 1 deletion assets/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const defaultTheme = require("tailwindcss/defaultTheme");

module.exports = {
mode: "jit",
content: ["./js/**/*.js", "../src/FloraWeb/**/*.*hs"],
content: ["./js/**/*.js", "../src/web/FloraWeb//**/*.*hs"],
darkMode: "class",
theme: {
extend: {
Expand Down
13 changes: 10 additions & 3 deletions cabal.prof.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
packages: ./

with-compiler: ghc-9.2.5
with-compiler: ghc-9.4.4

tests: True

Expand Down Expand Up @@ -54,7 +54,7 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/flora-pm/wai-middleware-heartbeat
tag: b92eca1
tag: 336523a

-- need to use jappeace until this is merged
-- (provides resource-pool 3 support)
Expand All @@ -77,4 +77,11 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/haskell-effectful/time-effectful
tag: 7bf8c48
tag: 705ac67

source-repository-package
type: git
location: https://github.com/composewell/streamly
tag: 81bfdec
subdir: ./
core/
Loading

0 comments on commit 11d3aff

Please sign in to comment.