-
Notifications
You must be signed in to change notification settings - Fork 409
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
build command with --out-name that contains dots, .
, generates incorrect files
#697
Comments
So I thought about it, so what I could do, do hack around this is:
But then we'll have to make sure to coordinate this with wasm-bindgen when it is fixed, because then we'd still have the same issues with adding the extra |
Thanks for the report! I think I may be a bit confused though, can you clarify what the expected behavior you're thinking we should do is? For example with |
You are welcome! 😄 Well, the behavior can really go two ways. For this example, let's pretend we have the flags
Generated files
package.json {
"//": "Other stuff here",
"files": [
"package.json"
"README.md"
".gitignore"
"index.cjs.d.ts"
"index.cjs.ts"
"index_bg.cjs.js"
"index_bg.cjs.wasm"
]
} Please note here, that
Generated files
package.json {
"//": "Other stuff here",
"files": [
"package.json"
"README.md"
".gitignore"
"index.cjs.js.d.ts"
"index.cjs.js.js"
"index_bg.cjs.js.js"
"index_bg.cjs.js.wasm"
]
}
Generated files
package.json {
"//": "Other stuff here",
"files": [
"package.json"
"README.md"
".gitignore"
"index.cjs.js.d.ts"
"index.cjs.js.js"
"index_bg.cjs.js.js"
"index_bg.cjs.js.wasm"
]
} Let me know what you think! Thanks! 😄 |
I think I'd find it a little odd if we stripped off I'm also curious what following these conventions would enable? I'm assuming that the underlying tools consuming these files don't really care about the names, but I may be missing some other tools which interoperate with these conventions. |
Sorry for the late reply! Been super busy with work, and a Jazz festival over the weekend 😂
I agree here 👍 So in the case of
Personally I try to follow conventions where I can. As, it tends to make things more maintainable, and healthier for the ecosystem. If we are trying to meet JavaScript / node developers where they are, than I think conventions are important. Otherwise, I'd be open to do
From my understanding, most tools do not rely on file naming for their bundling and things. So yes, we should be fine not following conventions in terms of using the tools themselves 😄 |
Yeah so I think we'll definitely want to avoid just unconditionally stripping |
@alexcrichton Sounds good, I'll go forward with this for now! 🎉 But I'll keep the issue open as the problem will probably still need to be adressed down the line for people other than me 😄 |
🐛 Bug description
When creating a PR for #313, and is a bit of a blocker if we want to follow the
.
semantic of how JS is usually output for libraries 😞 , I noticed that the--out-name
flag does not work properly if it contains a.
character. I assume this is also an issue with wasm-bindgen, but it would also affect what we do here.I think this is better done by showing in examples. I'll use the
node
target since it requires the_bg.js
shim, which also doesn't generate correctly.Examples:
Happy Case:
Expected output
Case where name contains
*.js
:Case where name contains
*.somerandomextension
:Case where name contains
*.*.js
:🤔 Expected Behavior
Whenever there is a
.
in the--out-name
, it should respect the additional extensions, and then build off of them. There probably is some discussion points of:_bg
be handled?.js
or.wasm
be ignored?wasm-pack
layer?👟 Steps to reproduce
Please see the examples screenshots 😄
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: current master
rustc version: 1.34.1
pop_OS! is a derivative of Ubuntu 😄
Thank you! 😄
cc @ashleygwilliams @alexcrichton @ibaryshnikov (since @ibaryshnikov opened #599 , and I see ya'll in the rust/wasm WG meetings 😄 )
The text was updated successfully, but these errors were encountered: