-
-
Notifications
You must be signed in to change notification settings - Fork 98
Fixed errors occurring when using certain web framework integration packages and MySQL options simultaneously in @fedify/init
#656
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
Open
2chanhaeng
wants to merge
13
commits into
fedify-dev:main
Choose a base branch
from
2chanhaeng:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5605344
Run `mise prepare` before `mise test:init`
2chanhaeng 3727deb
Add `env` attr to `WebFrameworkInitializer`
2chanhaeng edccf78
Add `@std/dotenv` if have env
2chanhaeng 3c9d73e
Organize tasks
2chanhaeng 58acd6e
Fix typo in comments
2chanhaeng f83759d
Add `lint` task for bare-bones
2chanhaeng 2376b89
Add `dotenvx` for `start` task of init Elysia
2chanhaeng 46c5278
Revert "Add `dotenvx` for `start` task of init Elysia"
2chanhaeng 619a7eb
Add `dotenvx` for `start` task of init Elysia
2chanhaeng cf4e5f1
Refactor adding `@std/dotenv` dependency logic
2chanhaeng ec2889c
Add `dotenvx` dependency for solidstart
2chanhaeng 79e1310
Fix `concat` argument type
2chanhaeng 5a83698
Fix JSDocs
2chanhaeng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
envproperty should be typed asRecord<string, string>instead ofobjectto provide better type safety and ensure that environment variables are always key-value pairs of strings.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The properties for this option can vary depending on other conditions. Using a
Record<string, string>type could cause type errors and confuse contributors, so I usedobjectinstead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of types are these properties filled with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the
HOSTproperty is used innitroDescriptionwhen in test mode. It is set astestMode ? { HOST: "127.0.0.1" } : {}. If that property type is defined asRecord<string, string>, a type error occurs on the entire result of theinitmethod. This requires unnecessary type assertions. It could also cause confusion for contributors. I left a mention about a similar issue in another comment.2026-04-05.17.53.55.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, could you show the whole type error message? I guess we could solve this somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about passing
undefinedinstead of{}?Or using type assertion?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered the future use of this property in deinitions of
WebFrameworkDescriptionobject of other framework. Since usingundefinedcan be only used in cases exist or not, using type assertion would be appropriate. However, when the required properties differ, the type must be explicitly specified asas Record<string, string>every time. Doing this unnecessary type definition is a very tedious task.For
env, since it is not widely used yet, one might think it's fine to specify it manually each time. However, fortasks, this explicit specification is required every time. Fortasksin a framework that supports both Deno and Node.js, at least the following properties are needed:pm === "deno" ? { dev: "deno task" } : { dev: "node script", lint: "eslint ." }Deno does not requirelinttask cause it has its own lint command. However, Node.js requireslintscript definition. Therefore, since the properties of the two objects are different, specifyingas Record<string, string>is always necessary.If
envalso gets used in manyWebFrameworkDescriptionobject definitions liketasks,as Record<string, string>will be required every time. There is no need to confuse contributors by forcing such unnecessary type specifications. For this reason, I defined the types of the two properties asobjectinstead ofRecord<string, string>.