32
41
Fork
You've already forked website
53

Migrate to Astro v4 #449

Merged
oliverpool merged 6 commits from thefox/astro-v4 into main 2024年06月06日 11:18:33 +02:00 AGit

It does build and run. It was mostly guesswork though as my JS is not a thing.

It does build and run. It was mostly guesswork though as my JS is not a thing.
re-add compile check
Some checks failed
pr / preview (pull_request) Failing after 26s
dcd4891afe
downgrade marked
All checks were successful
pr / preview (pull_request) Successful in 1m21s
deb0bf162e
Collaborator
Copy link
Preview ready: https://forgejo.codeberg.page/@pull_449/ https://forgejo.codeberg.page/@pull_449/docs/v7.0/admin/command-line/ https://forgejo.codeberg.page/@pull_449/docs/next/admin/command-line/ https://forgejo.codeberg.page/@pull_449/docs/latest/admin/command-line/ https://forgejo.codeberg.page/@pull_449/docs/v1.21/admin/command-line/ https://forgejo.codeberg.page/@pull_449/docs/v7.0/admin/actions/

Downgrade to marked is because they added async which breaks rss:

src/pages/rss.xml.ts:23:26 - error TS2345: Argument of type 'string | Promise<string>' is not assignable to parameter of type 'string'.
 Type 'Promise<string>' is not assignable to type 'string'.
23 content: sanitizeHtml(marked.parse(post.body)),
 ~~~~~~~~~~~~~~~~~~~~~~~

No idea how to fix that and even if async gets disabled TS won't recognize that it's never a Promise.

Downgrade to `marked` is because they added async which breaks rss: ``` src/pages/rss.xml.ts:23:26 - error TS2345: Argument of type 'string | Promise<string>' is not assignable to parameter of type 'string'. Type 'Promise<string>' is not assignable to type 'string'. 23 content: sanitizeHtml(marked.parse(post.body)), ~~~~~~~~~~~~~~~~~~~~~~~ ``` No idea how to fix that and even if async gets disabled [TS won't recognize](https://github.com/markedjs/marked/issues/3101) that it's never a Promise.
Ghost changed title from (削除) WIP: Migrate to Astro v4 (削除ここまで) to Migrate to Astro v4 2024年05月12日 23:56:45 +02:00

I THINK it works, only bugged thing is rss part which hasn't displayed anything. Not sure why though.

Edit:
Changed back to wip so it won't get merged by accident before a proper review

I **THINK** it works, only bugged thing is rss part which hasn't displayed anything. Not sure why though. Edit: Changed back to wip so it won't get merged by accident before a proper review
Ghost changed title from (削除) Migrate to Astro v4 (削除ここまで) to WIP: Migrate to Astro v4 2024年05月13日 00:20:57 +02:00
changed hook to go through bash per https://github.com/lint-staged/lint-staged/issues/825#issuecomment-674575655 
add caddyfile syntax highlighting
All checks were successful
pr / preview (pull_request) Successful in 1m22s
60d2deebd2
Ghost changed title from (削除) WIP: Migrate to Astro v4 (削除ここまで) to Migrate to Astro v4 2024年05月13日 18:14:08 +02:00

this also solves pnpm lock migration

this also solves pnpm lock migration
Owner
Copy link

I browsed preview for a few minutes and it seems to work fine, I could not find any new bugs. I'm not competent to approve this.

I browsed preview for a few minutes and it seems to work fine, I could not find any new bugs. I'm not competent to approve this.
oliverpool left a comment
Copy link

Looks good, thank for the hard work! I only found one regression.

Once fixed, I would recommend not waiting too long and merging it (and fixing other bugs afterwards).

Looks good, thank for the hard work! I only found one regression. Once fixed, I would recommend not waiting too long and merging it (and fixing other bugs afterwards).
@ -50,1 +54,4 @@
rehypePlugins: [rehypeSlug, [rehypeAutolinkHeadings, autolinkOptions]],
shikiConfig: {
langs: [caddyFileLang],
},

(削除) The syntax coloration does not work https://forgejo.codeberg.page/@pull_449/docs/latest/admin/reverse-proxy/ (削除ここまで)

This is because this PR is not on the top of origin/main, never mind.

~~The syntax coloration does not work https://forgejo.codeberg.page/@pull_449/docs/latest/admin/reverse-proxy/~~ This is because this PR is not on the top of origin/main, never mind.
Ghost marked this conversation as resolved
@ -12,3 +12,3 @@
<button type="button" class={className} aria-label={label} data-aw-toggle-menu>
<Icon name={iconName} class={iconClass} optimize={false} />
<Icon name={iconName} class={iconClass} />

The icon doesn't toggle anymore between bars and a cross:
image

image

The icon doesn't toggle anymore between bars and a cross: ![image](/attachments/a791b657-6883-4edf-b9e4-e1dd4c08688c) ![image](/attachments/3ef847ae-b51d-4b2b-b10f-7e753f145067)

Fix:

---
const {
	label = 'Toggle Menu',
	class:
		className = 'ml-1.5 text-zinc-500 dark:text-zinc-400 hover:bg-steel-100 dark:hover:bg-steel-800 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 inline-flex items-center transition',
} = Astro.props;
// manual copy/paste of the tabler:menu icon to allow edition via CSS [data-aw-toggle-menu] when toggled
---
<button type="button" class={className} aria-label={label} data-aw-toggle-menu>
	<svg
		xmlns="http://www.w3.org/2000/svg"
		xmlns:xlink="http://www.w3.org/1999/xlink"
		preserveAspectRatio="xMidYMid meet"
		viewBox="0 0 24 24"
		class="w-6 h-6"
		astro-icon="tabler:menu"
		><g
			class="icon-tabler"
			fill="none"
			stroke="currentColor"
			stroke-width="2"
			stroke-linecap="round"
			stroke-linejoin="round"><path d="M4 8h16"></path><path d="M4 16h16"></path></g
		></svg>
</button>
Fix: ```md --- const { label = 'Toggle Menu', class: className = 'ml-1.5 text-zinc-500 dark:text-zinc-400 hover:bg-steel-100 dark:hover:bg-steel-800 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 inline-flex items-center transition', } = Astro.props; // manual copy/paste of the tabler:menu icon to allow edition via CSS [data-aw-toggle-menu] when toggled --- <button type="button" class={className} aria-label={label} data-aw-toggle-menu> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" class="w-6 h-6" astro-icon="tabler:menu" ><g class="icon-tabler" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 8h16"></path><path d="M4 16h16"></path></g ></svg> </button> ```
Ghost marked this conversation as resolved
fix icon transformation
All checks were successful
pr / preview (pull_request) Successful in 1m28s
e25da36d8d
rename style to match newer syntax
Contributor
Copy link

I advise to merge this pull request only after making sure at least one person has plenty of time in the days that follow to deal with the unexpected consequences.

I advise to merge this pull request only after making sure at least one person has **plenty of time in the days that follow** to deal with the unexpected consequences.

@thefox do you have some time in the coming days/weeks?

I can make myself available to help with this risky transition.

@thefox do you have some time in the coming days/weeks? I can make myself available to help with this risky transition.

Sure, I have time.
Backup would be very much appreciated :)

Sure, I have time. Backup would be very much appreciated :)
Contributor
Copy link

The website is luckily not that complex. What about making a checklist of all that should be manually tested? I would go over it on the preview to help with that. I don't understand how to fix issues but I can report a broken item in the checklist 😁. Such a checklist should also take into account the fact that the docs are included as a submodule, in case that matters.

The website is luckily not that complex. What about making a checklist of all that should be manually tested? I would go over it on the preview to help with that. I don't understand how to fix issues but I can report a broken item in the checklist 😁. Such a checklist should also take into account the fact that the docs are included as a submodule, in case that matters.

Checklist draft (should ideally be put into a md file into the repo):

  • Note that ideally both the mobile (narrow) and desktop (wide) versions should be tested
  • visit the homepage
  • visit the rss.xml feed (⚠️the menu button points to the main version: put the URL manually)
  • switch the theme (light/dark)
  • visit the FAQ
  • visit the Releases page (there should be one Stable and one Old Stable tag)
  • visit the News page
  • visit the News page for a given tag (report for instance)
  • visit the first News
  • visit the docs /latest
  • visit the docs /next
  • visit the docs > Admin > Reverse proxy and check that all blocks except 2 have syntax coloring (currently not the case here, because the PR is not up-to-date)
  • visit the docs > Admin > Configuration Cheat Sheet and check that the internal page navigation (on the right) behaves correctly (independently scrollable / click on item goes to the right place) only available on desktop for now
Checklist draft (should ideally be put into a md file into the repo): - Note that ideally both the mobile (narrow) and desktop (wide) versions should be tested - [ ] visit the homepage - [ ] visit the `rss.xml` feed (⚠️the menu button points to the `main` version: put the URL manually) - [ ] switch the theme (light/dark) - [ ] visit the FAQ - [ ] visit the Releases page (there should be one `Stable` and one `Old Stable` tag) - [ ] visit the News page - [ ] visit the News page for a given tag (`report` for instance) - [ ] visit the first News - [ ] visit the docs `/latest` - [ ] visit the docs `/next` - [ ] visit the docs > Admin > Reverse proxy and check that all blocks except 2 have syntax coloring (currently not the case here, because the PR is not up-to-date) - [ ] visit the docs > Admin > Configuration Cheat Sheet and check that the internal page navigation (on the right) behaves correctly (independently scrollable / click on item goes to the right place) _only available on desktop for now_
Contributor
Copy link

Checklist draft (should ideally be put into a md file into the repo):

  • Note that ideally both the mobile (narrow) and desktop (wide) versions should be tested
  • visit the homepage
  • visit the rss.xml feed (⚠️the menu button points to the main version: put the URL manually)
  • switch the theme (light/dark)
  • visit the FAQ
  • visit the Releases page (there should be one Stable and one Old Stable tag)
  • visit the News page
  • visit the News page for a given tag (report for instance)
  • visit the first News
  • visit the docs /latest
  • visit the docs /next
  • visit the docs > Admin > Reverse proxy and check that all blocks except 2 have syntax coloring (currently not the case here, because the PR is not up-to-date)
  • visit the docs > Admin > Configuration Cheat Sheet and check that the internal page navigation (on the right) behaves correctly (independently scrollable / click on item goes to the right place) only available on desktop for now
> Checklist draft (should ideally be put into a md file into the repo): > - Note that ideally both the mobile (narrow) and desktop (wide) versions should be tested > - [x] visit the homepage > - [x] visit the `rss.xml` feed (⚠️the menu button points to the `main` version: put the URL manually) > - [x] switch the theme (light/dark) > - [x] visit the FAQ > - [x] visit the Releases page (there should be one `Stable` and one `Old Stable` tag) > - [x] visit the News page > - [x] visit the News page for a given tag (`report` for instance) > - [x] visit the first News > - [x] visit the docs `/latest` > - [x] visit the docs `/next` > - [ ] visit the docs > Admin > Reverse proxy and check that all blocks except 2 have syntax coloring (currently not the case here, because the PR is not up-to-date) > - [x] visit the docs > Admin > Configuration Cheat Sheet and check that the internal page navigation (on the right) behaves correctly (independently scrollable / click on item goes to the right place) _only available on desktop for now_ > >
Sign in to join this conversation.
Labels
Clear labels
404
Broken links or missing content
Accessibility
Accessibility
Blog post
Documentation
Forgejo Documentation
Internationalisation
i18n and l10n
User research - Accessibility
Requires input about accessibility features, likely involves user testing.
User research - Blocked
Do not pick as-is! We are happy if you can help, but please coordinate with ongoing redesign in this area.
User research - Community
Community features, such as discovering other people's work or otherwise feeling welcome on a Forgejo instance.
User research - Config (instance)
Instance-wide configuration, authentication and other admin-only needs.
User research - Errors
How to deal with errors in the application and write helpful error messages.
User research - Filters
How filter and search is being worked with.
User research - Future backlog
The issue might be inspiring for future design work.
User research - Git workflow
AGit, fork-based and new Git workflow, PR creation etc
User research - Labels
Active research about Labels
User research - Moderation
Moderation Featuers for Admins are undergoing active User Research
User research - Needs input
Use this label to let the User Research team know their input is requested.
User research - Notifications/Dashboard
Research on how users should know what to do next.
User research - Rendering
Text rendering, markup languages etc
User research - Repo creation
Active research about the New Repo dialog.
User research - Repo units
The repo sections, disabling them and the "Add more" button.
User research - Security
User research - Settings (in-app)
How to structure in-app settings in the future?
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/website!449
Reference in a new issue
forgejo/website
No description provided.
Delete branch "thefox/astro-v4"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?