Skip to content

fix: default value of the singleFile is changed#757

Merged
asyncapi-bot merged 2 commits intoasyncapi:masterfrom
batchu5:fix-missing-css-and-js-files
Jan 23, 2026
Merged

fix: default value of the singleFile is changed#757
asyncapi-bot merged 2 commits intoasyncapi:masterfrom
batchu5:fix-missing-css-and-js-files

Conversation

@batchu5
Copy link
Contributor

@batchu5 batchu5 commented Nov 27, 2025

Description
In generator if we give the params as -p single=false eventually, it is converting into single = 'false' , that is changed into singleFile='false', so changing the default value from false to 'false' in package.json results in string and css and js files are generated

Fixes #744

@sonarqubecloud
Copy link

@lightning-sagar
Copy link
Contributor

lightning-sagar commented Nov 27, 2025

Hey, you did an great job, but what i think is -> changing the default to a string ("false") isn’t the right fix.
The default should stay as a real boolean:

"default": false

The issue is in the generator not handling false defaults, not the template.
For the template, you can support both with:

 "const": false 

Check these lines and update to "const": "false" -> "const": false

Just sharing so the PR stays correct.
feedback or suggestions from maintainers are welcome!!!🙌

@batchu5
Copy link
Contributor Author

batchu5 commented Nov 27, 2025

okay, can you explain me where the generator is not handling the default false,
I tried to debug and found the error, same as where you raised the PR (in loader.js), you mentioned it is only handling singleFile="false".

and also i think params should be false not "false". there is no need to handle for both cases but let's see what maintainers say

@lightning-sagar
Copy link
Contributor

Yeah, that makes sense, ideally singleFile should always be a boolean...
But if you look at the template code, they already handle both cases for true:

const singleFile = (params?.singleFile === true || params?.singleFile == 'true');

So boolean true and string "true" are both supported....
to stay consistent, we should treat false the same way (boolean false and string "false"), at least until maintainers confirm the intended behavior

let’s wait and see what the maintainers say, they might want to standardize this one way or the other

@derberg
Copy link
Member

derberg commented Dec 2, 2025

folks did you see my comment in issue you linked?

derberg
derberg previously approved these changes Jan 23, 2026
@derberg
Copy link
Member

derberg commented Jan 23, 2026

@batchu5 for some reason this PR is hanging in infinite loop. I'll see if closing and reopening will fix it.

Screenshot 2026-01-23 at 09 32 44

@sonarqubecloud
Copy link

@derberg
Copy link
Member

derberg commented Jan 23, 2026

/rtm

@asyncapi-bot asyncapi-bot merged commit f104c36 into asyncapi:master Jan 23, 2026
19 checks passed
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 3.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Missing CSS/JS when generating without singleFile

5 participants