Skip to content

Commit

Permalink
feat: Bun, Skeleton, Sveltekit 2, usability improvements (#145)
Browse files Browse the repository at this point in the history
* fix: more translations

* chore: format

* chore: address a11y warnings. not sure how to test thoroughly (#99)

* chore: match API arch->target changes (#121)

* chore: match API arch->target changes

* feat: match mod file validation to API's

* feat: validate SML version target uniqueness

* chore: include all typescript files in tsconfig

The svelte-kit tsconfig has *.ts, and *.svelte by default

* chore: restore pre-commit hook to pnpm check

* feat: make boostrap_version optional

* feat: link users to docs page for multi-target format packaging

* feat: clarify latest versions section, closes #75

* fix: move ModLatestVersion above ModInfo, closes #79

* feat: make LatestVersions buttons call install via SMM, closes #59

* feat: ctrl-click and Open Link in New Tab support for image element of mod cards, closes #44

* feat: release as default new version stability, closes #76

* chore: match tsconfig from staging a04c199 to fix merge conflicts

* chore(dedi): Bring in changes from Staging (#86)

* Assorted cleanup (#73)

* chore: consistently use tabs in tsconfig.json

* docs: suggest running graphql-codegen after changing branches

* chore: vscode suggested extensions, start on spellchecker dictionary

* chore: link contributing.md from readme since it has setup info
also fix indent level

* chore: suggest vscode postcss extension

* chore: suggest vscode postcss intellisense extension

* feat: additional compatibility info details, gray icons if absent (#74)

* fix: outdated banner reactivity (#66)

* Fixed doggo easter egg typo, #77 (#78)

---------

Co-authored-by: mircearoata <[email protected]>
Co-authored-by: porisius <[email protected]>

* chore: rename WindowsNoEditor to Windows

* fix: handle null in trimNonSchema

* feat: allow adding targets to SML versions when editing

* fix: display SML version target link validation errors

* chore: use GQL TargetName enum

* feat: target compatibility, mod dependency display (#81)

* User-friendly display of target compatibility

Changes to solve #68

* made linter happy

* Removed unused code, corrected position of pre-dedi comment

* Lockfile for iconify, also solved lockfile fail

* Fixed implicitly has an 'any' type,

* 2x2 Target Chart/Icon, formatting wip

* Display mod dependencies as well as link to mod page

* Display mod dependencies as well as link to mod page

Solves #67

* chore: concise checkTargets function

* fix: correct download icon vertical alignment

* chore: reduce code duplication in dependency mod links

* urlWrap for source and Tag movement/formatting

* moar Tag formatting

* Removed unused packages

* Multi-target/Mod Dependency formatting

* made linter happy

* Fixed :: on Tags

* reformatted target widths

* Moved compatibility info and converted it to a Grid

* removed Multi Compability, fixed formatting

* forgot to lint, sorry

* fix: overflowing OutdatedBanner (closes #82)

* feat: compatibility icons in grid header

* chore: bash script to launch with the right env vars for dev

* chore: fix typo
it's almost a year old now, I will not allow it to have a happy birthday

* feat: compatibility grid display for mods without compatibility info specified

* feat: center mod icon on the page when displayed as a full page

* feat: compatibility grid as a card

* feat: compatibility edit button text changed "Compatibility" -> "Edit Compatibility"

* feat: mention markdown support in compatibility edit popup

* feat: extra spacing in compatibility viewing popup for improved readability

* feat: tooltips for target compatibility icons

* feat: display "(No tags assigned)" on mod page tag display when none present instead of empty space

* feat: display "(No source URL provided by mod author)" when none present instead of empty space

* feat: version target support grid as a component, now also present on View Version page

* feat: version dependencies grid as a component, now also WIP present on View Version page
...except that api endpoint doesn't return dependencies yet

* Added Multiplayer Compatibility

* lint/prettier

* Style for Multiplayer Compatbility

* Word Wrap Fixes

* Version Dependencies Grid GraphQL Fix

* Fixed some imports per Mircea's request

* Revert "Style for Multiplayer Compatbility"

This reverts commit 70f1f8d.

* Revert "lint/prettier"

This reverts commit 82af767.

* Revert "Added Multiplayer Compatibility"

This reverts commit 70db911.

* Path formatting fixes per Mircea

* Fixed formatting paths

* Removed casts, replaced with reactive version target support

* Removed WindowsNoEditor

* break-all Style => Class, removed optional ? for mod on ModInfo

* chore: remove script from 7c4ced3 since it's in its own pr now

* chore: fixes from code review

* Added VersionTarget/VersionDependency to graphql keys config

* fixed alignment of icons and text

* feat: add sml engine version

* chore: format

---------

Co-authored-by: Robb <[email protected]>
Co-authored-by: Vilsol <[email protected]>

* chore: lint

* fix: check if state exists

* chore: temporarily allow only single-target mods

* chore: allow both single-target and multi-target

---------

Co-authored-by: mircearoata <[email protected]>
Co-authored-by: Robb <[email protected]>
Co-authored-by: porisius <[email protected]>

* fix: display 'Unknown' instead of nothing when compatibility state is missing (#123)

* Unknown compatibility state fixes (#124)

* fix: prevent compatibility editor dialog crash when server sends null compatibility state

* feat: display "no compatibility info yet" description for unknown compat info mods

* chore: helpers to start with correct env vars (#113)

* chore: bash script to launch with the right env vars for dev
(improved readme after cherry pick from dedis)

* chore: use dotenv-flow instead of bash script per linked comment
#81 (comment)

* chore: dev setup process improvements (#127)

* chore: add better error messages to download_translations.sh

* chore: setup directions that assume less and cover/avoid common error cases

* chore: improved dev sign in steps

* NodeJS -> Bun, SMUI -> Skeleton. Depdency updates. (#117)

* refactor: node -> bun
refactor: smui -> skeleton

* refactor: almost fully on skeleton

* chore: format
chore: fix ci
chore: fix docker image

* chore: run postinstall for lint

* chore: use bash

* chore: bump bun version

* fix: rewrite tag list to skeleton

* chore: bump bun workflow version

* chore: update docs to bun

* chore: fix run scripts, enable prerender

* chore: use bun for sequential scripts

* chore: bump deps

* fix: fit everything in ficsit card
fix: fit button in tables

* chore: remove package overrides

* feat: prettier 404 page
fix: remove old toasts

* chore: add devcontainer
chore: switch eslint to new config format

* chore: gitattributes file for line endings on windows/linux

* chore: devcontainer: git safe folder

* chore: custom feature, add env bash alias

* chore: lint

* fix: add required ticks
fix: propagate compatibility to dialog
fix: increase menu z-index

* fix: disable toast on login check

* fix: don't purge cookie consent css

* chore: formatting

* fix: add emoji font

* fix: always use emoji font last

* fix: convert compatibility to skeleton styles
chore: bump bun to 1.0.6

* chore: remove todo

* chore: make husky files executable

* chore: bump dependencies and bun

* fix: resolve graphql version

* fix: do not take up full screen with sidebar on mobile

---------

Co-authored-by: Rob B <[email protected]>

* fix: turn sml version satisfactory version field to number

* chore: bump bun to 1.0.11

* fix: stretch card image to full size. Fixes #122

* chore: make cookie consent translatable, but it seems to load before the user's language selection (#98)

* chore: make cookie consent translatable, but it seems to load before the user's language selection

* chore: delay cookieconsent appearance until tolgee load complete

* fix: fix ssr

* chore: remove debug

* fix: install correct packages

* feat: add italian, dutch, russian translations

* Update with setup directions for Windows (using cloned-in-volume devcontainer) (#133)

* fix: login and logout issues

* fix: search default to 0th page

* chore: update Windows setup directions + devcontainer extensions (#134)

* fix: make mobile-size sidebar close on interact (#135)

* chore: extract component sidebar item

* fix: make mobile-size sidebar close on interact

* chore: silence irrelevant tailwind warning

* feat: close compat editor upon saving and reload page to update displayed info (#136)

* feat: use Release as default new version stability (#137)

* fix: close #59 (#138)

* feat: visual indicator for if a mod is hidden (closes #130) (#139)

* feat: display warning on unapproved versions (#140)

* feat: additional tooltips for mod version navigation and download buttons (#141)

* feat: new version page enhancements (#142)

* feat: button to return from the New Version page

* feat: wip edit compat info on New Version page

* fix: new version compat edit incorrect modId

* feat: "launcher detected" button to "open mod manager"

* feat: pretty button icons, back buttons with confirm prompts

* chore: sveltekit 2 (#143)

* chore: sveltekit 2
chore: upgrade bun to v1.0.18
chore: bump dependencies
chore: lint

* fix: bun format erroring on unknown prettier rule file

* chore: update devcontainer extensions + suggestions

---------

Co-authored-by: Rob B <[email protected]>

* feat: display 'None provided' when no source code linked instead of blank (#144)

* feat: show target grid if more than one version is uploaded

* refactor: tailwind class sorting

* feat: simple tag search

* fix: align new mod button

* chore: remove debug

* feat: tag dropdown

* fix: show all tags in list

* feat: tag descriptions

* feat: tag display, search improvements, tag tooltips (#146)

* chore: extract component: TagDisplay

* chore: replace ambiguous tag-button with Filter button, more translation keys

* fix: size of Filter... button

* feat: tag description fancy tooltips, show tag description when adding tags to a mod

* fix: use correct tag description

* fix: fetch tag description on user page

* Tag patches (#148)

* fix: add spacing at the bottom of the tags collapse section to avoid paginator drawing over tooltips
(z index isn't helping for some reason)

* fix: remove forced period at end of tag descriptions

* chore: switch tag data binding to use tag id

* chore: fix hover-tags saying you should click on them in browser title-tooltip

* fix: tag popups, paginator position

---------

Co-authored-by: Vilsol <[email protected]>
Co-authored-by: mircearoata <[email protected]>
Co-authored-by: porisius <[email protected]>
  • Loading branch information
4 people authored Jan 6, 2024
1 parent 8d1081c commit 7b75d64
Show file tree
Hide file tree
Showing 137 changed files with 3,710 additions and 12,224 deletions.
13 changes: 13 additions & 0 deletions .devcontainer/create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

# Add as a safe git directory
git config --global --add safe.directory "/workspaces/smr_frontend"

# Install packages
bun install

# Source those environment variables for translation script
source .devcontainer/env.sh staging

# Download translations
bun run translations
47 changes: 47 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "Bun & SvelteKit",

"image": "mcr.microsoft.com/devcontainers/base:ubuntu",

"features": {
"ghcr.io/shyim/devcontainers-features/bun:0": {},
"./ficsit-feature": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000],

// Consistently name the folder so that it can be added as a git safe directory inside the container
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/smr_frontend,type=bind",
"workspaceFolder": "/workspaces/smr_frontend",

"onCreateCommand": "./.devcontainer/create.sh",

"customizations": {
"vscode": {
"extensions": [
"ms-vscode.vscode-typescript-next",
"svelte.svelte-vscode",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss",
"csstools.postcss",
"mquandalle.graphql",
"GraphQL.vscode-graphql-execution",
"GraphQL.vscode-graphql",
"GraphQL.vscode-graphql-syntax",
"streetsidesoftware.code-spell-checker",
"vunguyentuan.vscode-postcss",
"bbenoist.Nix",
"mikestead.dotenv",
"me-dutour-mathieu.vscode-github-actions",
"eamodio.gitlens",
"GitHub.copilot"
]
}
},

"remoteEnv": {
"NODE_ENV": "staging"
}
}
5 changes: 5 additions & 0 deletions .devcontainer/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

export NODE_ENV=$1

set -o allexport; source .env.$NODE_ENV; set +o allexport
5 changes: 5 additions & 0 deletions .devcontainer/ficsit-feature/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "ficsit",
"id": "ficsit",
"version": "0.0.1"
}
18 changes: 18 additions & 0 deletions .devcontainer/ficsit-feature/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# Install watchman
sudo apt-get update && sudo apt-get install -y watchman

# Append bashrc
echo "
alias fenv=\"source .devcontainer/env.sh\"
echo -e \"\e[1;32mWelcome to smr-frontend devcontainer\e[0m\"
echo
echo -e \"\e[31mPlease execute the following command to load the environment:\e[0m\"
echo -e \"\e[1m\$\e[0m fenv staging\"
echo
echo -e \"\e[31mTo start the dev server execute:\e[0m\"
echo -e \"\e[1m\$\e[0m bun run dev\"
echo
" >> $_REMOTE_USER_HOME/.bashrc
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
55 changes: 0 additions & 55 deletions .eslintrc.cjs

This file was deleted.

5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Auto detect text files and perform LF normalization
# This keeps unix/windows machines from wanting to change every file
# from the other because of the line ending (\r vs \r\n)
* text=auto
*.sh text eol=lf
95 changes: 22 additions & 73 deletions .github/workflows/push-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ on:
type: string

env:
NODE_VERSION: "18"
PNPM_VERSION: "8.6.1"
BUN_VERSION: "1.0.18"

jobs:
build:
Expand All @@ -20,69 +19,39 @@ jobs:
matrix:
action: [ "build:node", "build:static" ]
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup nodejs
uses: actions/setup-node@v1
- uses: oven-sh/setup-bun@v1
with:
node-version: ${{ env.NODE_VERSION }}

- name: Cache pnpm modules
uses: actions/cache@v2
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-
bun-version: ${{ env.BUN_VERSION }}

- name: Install dependencies
uses: pnpm/[email protected]
with:
version: ${{ env.PNPM_VERSION }}
run_install: true
run: bun install

- name: Build
run: |
set -o allexport; source .env.${{ inputs.env }}; set +o allexport
pnpm graphql-codegen && pnpm run translations && pnpm ${{ matrix.action }}
bun run graphql-codegen && bun run translations && bun run ${{ matrix.action }}
env:
NODE_ENV: ${{ inputs.env }}

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup nodejs
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/checkout@v3

- name: Cache pnpm modules
uses: actions/cache@v2
env:
cache-name: cache-pnpm-modules
- uses: oven-sh/setup-bun@v1
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-
bun-version: ${{ env.BUN_VERSION }}

- name: Install dependencies
uses: pnpm/[email protected]
with:
version: ${{ env.PNPM_VERSION }}
run_install: true
run: bun install

- name: Lint
run: |
set -o allexport; source .env.${{ inputs.env }}; set +o allexport
pnpm exec svelte-kit sync && pnpm graphql-codegen && pnpm check && pnpm lint
bun run postinstall && bun run graphql-codegen && bun run check && bun run lint
env:
NODE_ENV: ${{ inputs.env }}

Expand All @@ -94,37 +63,21 @@ jobs:
- lint
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup nodejs
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/checkout@v3

- name: Cache pnpm modules
uses: actions/cache@v2
env:
cache-name: cache-pnpm-modules
- uses: oven-sh/setup-bun@v1
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-
bun-version: ${{ env.BUN_VERSION }}

- name: Install dependencies
uses: pnpm/[email protected]
with:
version: ${{ env.PNPM_VERSION }}
run_install: true
run: bun install

- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- uses: rlespinasse/[email protected]

- name: Build
run: |
set -o allexport; source .env.${{ inputs.env }}; set +o allexport
pnpm graphql-codegen && pnpm run translations && pnpm build:static
bun run graphql-codegen && bun run translations && bun run build:static
env:
SVELTE_BASE_PATH: "/${{ env.GITHUB_REPOSITORY_NAME_PART_SLUG }}/${{ env.GITHUB_REF_SLUG }}"
NODE_ENV: ${{ inputs.env }}
Expand All @@ -143,26 +96,22 @@ jobs:
- build
- lint
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
- id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
flavor: |
latest=false
- name: Build and push
uses: docker/build-push-action@v2
- uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -304,5 +304,5 @@ $RECYCLE.BIN/
/schema.graphql
/graphql.schema.json
/.svelte-kit
/static/smui.css
/.pnpm-store
/.pnpm-store
.direnv
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm exec commitlint -e $1
bunx commitlint -e $1
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm lint && pnpm check
bun run lint && bun run check
5 changes: 3 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static
.env.production
.env.staging
.eslintignore
.eslintrc.cjs
eslint.config.js
.gitignore
.graphqlconfig
.prettierignore
Expand All @@ -31,4 +31,5 @@ svelte.config.js
tailwind.config.cjs
tsconfig.json
.pnpm-store
src/i18n
src/i18n
.devcontainer/devcontainer.json
6 changes: 2 additions & 4 deletions .prettierrc → .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"printWidth": 120,
"quoteProps": "as-needed",
"singleQuote": true,
"svelteAllowShorthand": true,
"svelteIndentScriptAndStyle": true,
"svelteStrictMode": false,
"trailingComma": "none",
"useTabs": false
"useTabs": false,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"]
}
4 changes: 3 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"streetsidesoftware.code-spell-checker",
"dbaeumer.vscode-eslint",
"csstools.postcss",
"vunguyentuan.vscode-postcss"
"vunguyentuan.vscode-postcss",
"github.copilot",
"eamodio.gitlens"
]
}
Loading

0 comments on commit 7b75d64

Please sign in to comment.