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

Astro #112

Draft
wants to merge 52 commits into
base: main
Choose a base branch
from
Draft

Astro #112

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6cf6f96
feat: initial work on astro migration
darbyjack Aug 7, 2024
31c2cd0
chore: import alias
kashike Aug 8, 2024
23802e9
fix: don't always show dropdown
powercasgamer Aug 8, 2024
46f6d4f
chore: sort
kashike Aug 8, 2024
f845e2b
fix: lowercase
powercasgamer Aug 8, 2024
769a91a
feat: migrate to unocss
MiniDigger Aug 8, 2024
813cc09
feat: start working on team page (refer to todo.md)
darbyjack Aug 8, 2024
72ef337
feat: start working on sponsor page (refer to todo.md)
darbyjack Aug 8, 2024
4700eb3
feat: add in guidelines and community pages
darbyjack Aug 8, 2024
a7bf13a
biome
kashike Aug 8, 2024
411094e
feat: implement a hacky remote image wrapper
darbyjack Aug 8, 2024
547309c
feat: main download page + compile fixups
darbyjack Aug 8, 2024
0db1d95
fix: avatar fallbacks, abstract out user images
MiniDigger Aug 8, 2024
6906732
feat: initial pass at adding in software pages with todos
darbyjack Aug 8, 2024
e2eb477
feat: add in cloudflare adapter
darbyjack Aug 8, 2024
9b6d018
feat: javadoc page + javadoc link on project pages
darbyjack Aug 8, 2024
adeaa7a
feat: started working on build explorer
darbyjack Aug 8, 2024
3e33bef
fix: include og:url as required by spec
kashike Aug 8, 2024
a628006
chore: format
kashike Aug 9, 2024
1b72abf
chore(deps): upgrade deps
darbyjack Aug 9, 2024
2040cac
feat: readme and renovate
darbyjack Aug 9, 2024
3da21a0
feat: add in hangar project counts on software pages
darbyjack Aug 10, 2024
057e8ac
chore(deps): upgrade astro
darbyjack Aug 10, 2024
8b07c19
feat: speed up javadoc page loading
darbyjack Aug 10, 2024
b174bbf
work
notTamion Sep 4, 2024
bbd7809
Merge pull request #113 from notTamion/work-astro
darbyjack Sep 4, 2024
4d31383
chore(deps): upgrade deps
darbyjack Sep 4, 2024
d99140a
chore(todo): clean up todo formatting
darbyjack Sep 4, 2024
65e4c07
feat: remove react, rewrite nav bar, start with software download
MiniDigger Oct 3, 2024
bb7f0a5
feat: add prettier, update deps, remove more react stuff
MiniDigger Oct 3, 2024
5eab330
chore: add more empty alt tags
MiniDigger Oct 3, 2024
42b72ba
chore(deps): upgrade deps
darbyjack Oct 20, 2024
1e9b8bb
fix: social icons, navbar default extended mobile, icon colors
darbyjack Oct 20, 2024
522c4ff
feat(downloads): initial work, left a few todos
darbyjack Oct 21, 2024
1598da9
chore(biome): please biome and a few more todos for click handlers
darbyjack Oct 21, 2024
a0b3342
feat: added in non-reactive builds explorer, see todos.
darbyjack Oct 21, 2024
1bb3962
chore: add some comments to todo
darbyjack Oct 21, 2024
add296d
chore: couple more items for the todo
darbyjack Oct 21, 2024
9e19b0c
feat: add in commit hash to footer
darbyjack Oct 21, 2024
161991b
fix: cc by sa icons
darbyjack Oct 21, 2024
55f030c
fix: team social icon colors
powercasgamer Oct 21, 2024
45b3738
fix extra spaces
powercasgamer Oct 21, 2024
1bade54
remove github ratelimit thing
powercasgamer Oct 21, 2024
7bacaa0
footer git commit fix
powercasgamer Oct 21, 2024
83137c8
sitemap
powercasgamer Oct 21, 2024
6c40862
t o d o
powercasgamer Oct 21, 2024
40ff795
disallow indexing for robots
powercasgamer Oct 21, 2024
aa2fc61
change domain to dev
powercasgamer Oct 21, 2024
ef151c9
update pnpm to 9.12.2
powercasgamer Oct 21, 2024
d5d5a38
change domain in robots too
powercasgamer Oct 21, 2024
fb1c3dc
Merge pull request #116 from powercasgamer/foot/astro
darbyjack Oct 21, 2024
27f11b3
implement interactivity for SoftwareDownloadButton
MiniDigger Nov 1, 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
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = off
trim_trailing_whitespace = true
30 changes: 0 additions & 30 deletions .eslintrc.json

This file was deleted.

43 changes: 17 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# IntelliJ IDEA
/.idea/

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage
# macOS
.DS_Store

# next.js
/.next/
/out/
# Node.js
/node_modules/

# production
/build
# build output
dist/

# misc
.DS_Store
*.pem
# generated types
.astro/

# debug
# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local
pnpm-debug.log*

# typescript
*.tsbuildinfo
# environment variables
.env
.env.production

# intellij
/.idea
*.iml
# auto downloaded fonts
public/assets/fonts/
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

18 changes: 18 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/** @type {import("prettier").Config} */
export default {
plugins: ["prettier-plugin-astro"],
overrides: [
{
files: "*.astro",
options: {
parser: "astro",
},
},
],
tabWidth: 2,
semi: true,
singleQuote: false,
printWidth: 160,
arrowParens: "always",
trailingComma: "es5",
};
4 changes: 4 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ Then, run the development server:
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
Open [http://localhost:4321](http://localhost:4321) with your browser to see the result.

### Learn More

To learn more about technologies used in this project, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [Tailwind CSS Documentation](https://tailwindui.com/documentation) - learn about Tailwind CSS utilities.
- [Astro Documentation](https://docs.astro.build/en/getting-started/) - learn about Astro features and API.
- [Tailwind CSS Documentation](https://tailwindui.com/documentation) - learn about Tailwind CSS utilities.
48 changes: 48 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# TODO List

### Navbar Overhaul

- ~~menu should be default to closed on mobile~~ | (should be fixed - Glare)
- Consider better approaches for icons (added astro-icon for footer). their colors are wrong
- ~~fix social icons not loading~~ | (should be fixed - Glare)
- nav dropdown transition?

### Misc

- Verify if `windicss/plugin/aspect-ratio` is necessary for anything.
- ~~Auto-generate a `sitemap.xml`.~~
- Determine which pages should be marked as `prerendered = false`
- Investigate if there's some way we can introduce the SWR 10 minute cache on the server-side since the `prerendered = false` pages will render on-demand.
- Allow indexing in robots.txt (Disallow: / => Allow: /)
- Verify if the sitemap urls are correct.
- Change domain in astro.config.mjs

### Team Page & Sponsor Page

- Double-check that the contributor fetching logic is correct.
- Integrate logic for `onError`/`onLoad` for images.
- Fix CSS styling for images (currently looks off).

### Guidelines Page

- ~~Fix the alignment of the CC BY SA icons at the bottom. (kinda fixed, just icons in general are ugly)~~

### RemoteImageWrapper

- Make any necessary adjustments.

### Software Pages

- Integrate proper prop fetching for version groups and other relevant data.

### Software Header

- Utilize named slots since Waterfall takes in a component for the header and description.

### Software Download

- ~~project icons~~ (should be fixed - Glare)
- waterfall eol message (similar problem as the software header)
- actual logic, download button, etc
- fix the added spaces before and after parentheses in the build changes
- fix "16 hours ago" turning into "16 hours (newline) ago"
41 changes: 41 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import icon from "astro-icon";
import { defineConfig } from "astro/config";
import UnoCSS from "unocss/astro";

import cloudflare from "@astrojs/cloudflare";
import { execSync } from "node:child_process";
import sitemap from "@astrojs/sitemap";

process.env.GIT_COMMIT_HASH = (process.env.GITHUB_SHA || "").trim().substring(0, 7) || fetchGitCommitHash();

function fetchGitCommitHash() {
return execSync("git rev-parse --short HEAD").toString().trim();
}

// https://astro.build/config
export default defineConfig({
site: "https://papermc.dev",
integrations: [
icon({
iconDir: "src/assets",
}),
UnoCSS({
injectReset: true,
}),
sitemap(),
],
image: {
remotePatterns: [
{
protocol: "https",
hostname: "**.githubusercontent.com",
},
{
protocol: "https",
hostname: "**.opencollective.com",
},
],
},
output: "hybrid",
adapter: cloudflare(),
});
29 changes: 29 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"files": {
"ignore": [".astro/**", ".idea/**", ".vscode/**", "dist/**"]
},
"formatter": {
"indentStyle": "space",
"indentWidth": 2
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"overrides": [
{
"include": ["tsconfig.json"],
"json": {
"parser": {
"allowComments": true
}
}
}
]
}
5 changes: 0 additions & 5 deletions next-env.d.ts

This file was deleted.

9 changes: 0 additions & 9 deletions next-sitemap.config.js

This file was deleted.

22 changes: 0 additions & 22 deletions next.config.js

This file was deleted.

54 changes: 23 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,31 @@
},
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"postbuild": "next-sitemap",
"start": "next start",
"lint": "next lint"
"dev": "astro dev",
"start": "astro dev",
"build": "pnpm run format:check && astro check && astro build",
"preview": "astro preview",
"astro": "astro",
"format:write": "prettier --write \"**/*.{css,js,mjs,ts,md,astro}\"",
"format:check": "prettier --check \"**/*.{css,js,mjs,ts,md,astro}\""
},
"packageManager": "[email protected]+sha512.22721b3a11f81661ae1ec68ce1a7b879425a1ca5b991c975b074ac220b187ce56c708fe5db69f4c962c989452eee76c82877f4ee80f474cebd61ee13461b6228",
"dependencies": {
"@fontsource/poppins": "5.0.14",
"@headlessui/react": "2.1.2",
"clsx": "2.1.1",
"next": "13.5.4",
"next-sitemap": "^4.2.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"sharp": "^0.33.4",
"swr": "2.2.5"
"@astrojs/check": "^0.9.4",
"@astrojs/cloudflare": "^11.1.0",
"@astrojs/sitemap": "^3.2.1",
"astro": "^4.16.6",
"astro-icon": "^1.1.1",
"clsx": "^2.1.1",
"sharp": "^0.33.5"
},
"devDependencies": {
"@svgr/webpack": "8.1.0",
"@types/node": "20.14.11",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@typescript-eslint/eslint-plugin": "6.12.0",
"@typescript-eslint/parser": "6.12.0",
"eslint": "8.54.0",
"eslint-config-next": "13.5.4",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"prettier": "3.3.3",
"typescript": "5.5.3",
"windicss": "3.5.6",
"windicss-webpack-plugin": "1.8.0"
},
"sideEffects": false,
"packageManager": "[email protected]+sha512.98a80fd11c2e7096747762304106432b3ddc67dcf54b5a8c01c93f68a2cd5e05e6821849522a06fb76284d41a2660d5e334f2ee3bbf29183bf2e739b1dafa771"
"@biomejs/biome": "1.9.4",
"@unocss/preset-web-fonts": "^0.63.4",
"@unocss/reset": "^0.63.4",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"typescript": "^5.6.3",
"unocss": "^0.63.4"
}
}
Loading