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

feat!: Rewrite in Svelte 5 #251

Merged
merged 60 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
b086852
feat!: started rewrite in Svelte 5 from scratch
aleksasiriski May 6, 2024
4f7267b
feat: opensearch.xml route (instead of static asset)
aleksasiriski May 6, 2024
82f2da2
fix: lockfile
aleksasiriski May 6, 2024
c9d9e4d
feat(opensearch.xml): added POST
aleksasiriski May 6, 2024
3f2dd6d
feat(search): almost done
aleksasiriski May 8, 2024
696faff
chore: readme and sec
aleksasiriski May 8, 2024
d066a97
feat(search): timing
aleksasiriski May 8, 2024
18a5e15
feat: error pages
aleksasiriski May 8, 2024
e295265
fix(searchbox): reset form alignment on firefox
aleksasiriski May 8, 2024
fe30f7a
fix(error,zero): responsiveness
aleksasiriski May 8, 2024
f69d6d0
fix(searchbox): maintain selected category
aleksasiriski May 8, 2024
9a1d6b8
fix(searchbox): undefined category
aleksasiriski May 8, 2024
5b57e2f
fix(preview): close on espace key only
aleksasiriski May 8, 2024
1c1276c
fix(paginator): remove TODO since it needs JS
aleksasiriski May 8, 2024
07df750
fix(infiniteloading): preload results
aleksasiriski May 8, 2024
80a7808
fix(infiniteloading): remove unused import
aleksasiriski May 8, 2024
996a751
chore: force runes
aleksasiriski May 8, 2024
4b27141
fix(css): switch gray to neutral
aleksasiriski May 8, 2024
eb9343c
fix(api): always sort params and remove unused before fetch
aleksasiriski May 8, 2024
1b4b219
chore: Makefile, testing CI, prettier formatting
aleksasiriski May 9, 2024
956b9d0
chore: linting
aleksasiriski May 9, 2024
3ff154d
chore: updated deps
aleksasiriski May 9, 2024
bb4b713
fix(general): long description button
aleksasiriski May 9, 2024
fbeef82
feat(homepage): loading on form submit
aleksasiriski May 9, 2024
2078341
fix(searchbox): prevent submitting when query is empty
aleksasiriski May 9, 2024
2de128f
fix: searchbox affecting infinite loading
aleksasiriski May 9, 2024
ea409f5
fix: mandatory query param and lint error
aleksasiriski May 9, 2024
14ed4ea
revert: mandatory query param
aleksasiriski May 9, 2024
1401b34
ci: disable Docker for PRs
aleksasiriski May 9, 2024
adcc58d
fix(fetchResults): fetcher param
aleksasiriski May 9, 2024
da8d5b6
fix(infiniteloading): query not updating (thanks Gale!)
aleksasiriski May 9, 2024
38ee0fe
fix(fetchresults): optional fetcher
aleksasiriski May 10, 2024
f87270e
fix(search): pages param validation
aleksasiriski May 10, 2024
3682f5e
feat(searchssr): added route for SSR testing (should be removed)
aleksasiriski May 10, 2024
fcc5fb9
fix(opensearch.xml): formatting
aleksasiriski May 10, 2024
7d3e124
fix(search): make search work and searchbad not
aleksasiriski May 10, 2024
0ca6bb1
fix(search): propagate server load to universal load
aleksasiriski May 10, 2024
2656b79
fix(opensearch.xml): favicon
aleksasiriski May 10, 2024
d2b28cf
chore: disable playwright testing
aleksasiriski May 10, 2024
be92b96
fix(searchbox): focus on reset
aleksasiriski May 10, 2024
894001a
fix(searchbox): responsiveness
aleksasiriski May 10, 2024
d304944
feat: added simple JS theme toggle
aleksasiriski May 10, 2024
8ee3508
fix(themetoggle): lint
aleksasiriski May 10, 2024
97b9d50
fix(categories)!: sync to latest backend changes
aleksasiriski May 11, 2024
208dba1
fix(categories): working switch case
aleksasiriski May 11, 2024
f18aa58
fix: better category extraction and API error message
aleksasiriski May 12, 2024
31e35ae
fix(homepage): css padding and footer
aleksasiriski May 13, 2024
07a40fd
fix(searchbox): better pading and categories
aleksasiriski May 13, 2024
8e4398d
fix(results): css divide and better padding
aleksasiriski May 13, 2024
4d98510
fix: searchbox logo and more screens
aleksasiriski May 13, 2024
61e929b
fix(general): lint
aleksasiriski May 13, 2024
109afef
fix(general): break words instead of overflow hidden
aleksasiriski May 14, 2024
dc9a3df
fix(preview): dark background and padding
aleksasiriski May 14, 2024
00883e3
fix(preview): better check when to show button for longer desc
aleksasiriski May 14, 2024
afe67b8
fix(stats): add a separate timing for measuring SSR time and latency …
aleksasiriski May 14, 2024
64b98cd
fix(searchbad): stats
aleksasiriski May 14, 2024
d32382c
Revert "fix(searchbad): stats"
aleksasiriski May 14, 2024
fa84f4b
Revert "fix(stats): add a separate timing for measuring SSR time and …
aleksasiriski May 14, 2024
0f445eb
fix(searchbox): query not returning to previous on page back
aleksasiriski May 14, 2024
e766ade
fix(infiniteloading): less work for preload
aleksasiriski May 14, 2024
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: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
PUBLIC_URI=http://localhost:5173
# use local frontend with local backend
API_URI=http://localhost:3030 # server reachable
PUBLIC_API_URI=http://localhost:3030 # client reachable
# use local frontend with official backend (CORS is enabled for http://localhost:5173)
Expand Down
21 changes: 3 additions & 18 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
/** @type { import("eslint").Linter.Config } */
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:svelte/recommended', 'prettier'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
Expand All @@ -17,14 +11,5 @@ module.exports = {
browser: true,
es2017: true,
node: true
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
]
}
};
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_search_engine.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Feature request
about: Ask for adding a new feature
title: "[FEAT]"
labels: "enhancement"
assignees: ""
title: '[FEAT]'
labels: 'enhancement'
assignees: ''
---

**Describe your feature request**
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/dockercicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches: ['main']
tags: ['v*.*.*']
pull_request:
branches: ['main']

env:
REGISTRY: ghcr.io
Expand All @@ -21,22 +19,28 @@ jobs:
steps:
- uses: actions/checkout@v4

# switch svelte.config.js to node
- run: make node

# install deps (using pnpm until bun fixes bug for static assets)
- uses: pnpm/action-setup@v3
- uses: pnpm/action-setup@v4
with:
version: 8
run_install: false

- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'pnpm'
- run: make install
cache: 'pnpm' # must be preinstalled

# build project
# switch svelte.config.js to use node adapter
- run: make node

# install dependencies and build
- run: make install
- run: make compile

# run tests
- run: make check
- run: make lint
- run: make test

# setup docker (arm64)
- uses: docker/setup-qemu-action@v3
with:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/testingci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ jobs:
steps:
- uses: actions/checkout@v4

# install deps (using pnpm until bun fixes bug for static assets)
- uses: pnpm/action-setup@v3
- uses: pnpm/action-setup@v4
with:
version: 8
run_install: false

- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'pnpm'
- run: make install
cache: 'pnpm' # must be preinstalled

- run: make install
- run: make compile
- run: make check
- run: make lint
- run: make test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ node_modules
.env.*
!.env.example
vite.config.js.timestamp-*
.vercel/
vite.config.ts.timestamp-*
1 change: 0 additions & 1 deletion .node-version

This file was deleted.

9 changes: 0 additions & 9 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
Expand Down
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ compile:
preview:
pnpm run preview

check:
pnpm run check

test:
pnpm run test:unit

lint:
pnpm run lint

format:
pnpm run format

aws:
cp svelte.config.aws.js svelte.config.js

Expand Down
16 changes: 0 additions & 16 deletions devbox.json

This file was deleted.

39 changes: 0 additions & 39 deletions devbox.lock

This file was deleted.

4 changes: 3 additions & 1 deletion tsconfig.json → jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true
"strict": true,
"moduleResolution": "bundler"
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
// except $lib which is handled by https://kit.svelte.dev/docs/configuration#files
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
Expand Down
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,37 @@
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node ./build/index.js",
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write ."
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
"test": "npm run test:integration && npm run test:unit",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"test:integration": "playwright test",
"test:unit": "vitest"
},
"devDependencies": {
"@playwright/test": "^1.44.0",
"@hearchco/sveltekit-adapter-aws": "github:hearchco/sveltekit-adapter-aws#v0.1.0",
"@sveltejs/adapter-node": "^5.0.1",
"@sveltejs/kit": "^2.5.7",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@types/eslint": "^8.56.10",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.38.0",
"mode-watcher": "^0.3.0",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.3",
"svelte": "^4.2.15",
"svelte-check": "^3.7.0",
"svelte": "^5.0.0-next.125",
"svelte-check": "^3.7.1",
"tailwindcss": "^3.4.3",
"tslib": "^2.6.2",
"typescript": "^5.4.5",
"vite": "^5.2.11"
"vite": "^5.2.11",
"vitest": "^1.6.0"
},
"type": "module"
}
11 changes: 11 additions & 0 deletions playwright.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/** @type {import('@playwright/test').PlaywrightTestConfig} */
const config = {
webServer: {
command: 'npm run build && npm run preview',
port: 4173
},
testDir: 'tests',
testMatch: /(.+\.)?(test|spec)\.[jt]s/
};

export default config;
Loading
Loading