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

feat(build): --no-pack flag #695

Merged
merged 1 commit into from
May 30, 2023
Merged

feat(build): --no-pack flag #695

merged 1 commit into from
May 30, 2023

Conversation

ashleygwilliams
Copy link
Member

@ashleygwilliams ashleygwilliams commented Jul 25, 2019

fixes #691

adds a flag --no-pack which will skip 3 steps:

  • does not copy readme
  • does not copy licenses
  • does not generate package.json

@ashleygwilliams ashleygwilliams added the work in progress do not merge! label Jul 25, 2019
@ashleygwilliams ashleygwilliams added this to the 0.9.0 milestone Jul 25, 2019
@ashleygwilliams ashleygwilliams added needs review and removed work in progress do not merge! labels Jul 25, 2019
@ashleygwilliams ashleygwilliams changed the title [WIP] feat(build): --no-pack flag feat(build): --no-pack flag Jul 25, 2019
@ashleygwilliams ashleygwilliams added the needs docs please add docs to this PR label Jul 25, 2019
@ashleygwilliams
Copy link
Member Author

assuming folks approve this i'll write docs for it, and then should be ready to merge

@alexcrichton
Copy link
Contributor

The implementation here all looks good to me, although I might bikeshed a bit on the name. Perhaps something like --no-package-json or --no-npm-manifest or something like that? I feel like this is largely centered around the "don't do the extra steps necessary to create a package.json" part of things.

Also as a future-compatible note, this will probably want to generate a hard error if a Rust crate depends on an NPM package (e.g. when the npm dependencies implementation lands here if that is combined with --no-pack we'd want to give a first-class "this project isn't compatible with that" error)

@ashleygwilliams
Copy link
Member Author

@alexcrichton yeah i thought about a manifest related type name, i'm happy to do that

if i am understanding the ask, i actually imagine the end user would want a package.json... it'd be necessary. we could still skip the cargo.toml serialization and the readme and license steps.. this convo might be best on the npm feature tracking issue tho

@ashleygwilliams
Copy link
Member Author

tho.. if we would eventually with npm feature support make a packagejson for this no pack flag... that makes the name more confusing.

@ashleygwilliams
Copy link
Member Author

i am waiting to sync up with @Pauan but i think we should probably just close this. when considered with the npm feature, this feature does not really make sense.

  • copying readme + licenses: doesn't block and doesn't happen if they aren't there. --quiet can silence the warnings
  • serializing the cargo.toml: should not be expensive, if we are already making a partial package.json because the package depends on an npm package it feels weird to make a feature that just copies the wasm-bindgen one over and not just do the whole thing. if it is expensive, the feature request is perf related.. not a feature request.

@ashleygwilliams ashleygwilliams removed this from the 0.9.0 milestone Jul 25, 2019
@fitzgen
Copy link
Member

fitzgen commented Jul 26, 2019

+1 for --no-package-json

Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me; will let the naming and npm deps play out.

Copy link

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried and it works. I would like to suggest skipping .gitignore too.
Additionally generating TS could be disabled by default when passing --no-pack in my opinion, maybe additionally check for --target web to do that.

I can do the rebase to if it helps @ashleygwilliams.

Code looks good to me; will let the naming and npm deps play out.

Is this blocked on #691 or not?

@@ -239,7 +246,7 @@ impl Build {
Ok(())
}

fn get_process_steps(mode: InstallMode) -> Vec<(&'static str, BuildStep)> {
fn get_process_steps(mode: InstallMode, no_pack: bool) -> Vec<(&'static str, BuildStep)> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fn get_process_steps(mode: InstallMode, no_pack: bool) -> Vec<(&'static str, BuildStep)> {
fn get_process_steps(&self) -> Vec<(&'static str, BuildStep)> {

Would give it access to both without having to pass any parameters at all.

@BlackGlory
Copy link

Any progress?
I wouldn't even consider wasm-pack without this option.
In fact, it should be the default, the current wasm-pack build command makes it seem like the developers have bad taste.

@ranile ranile mentioned this pull request May 30, 2023
3 tasks
@drager drager closed this in #1291 May 30, 2023
@drager drager merged commit 72f16aa into master May 30, 2023
@drager drager deleted the no-pack branch June 17, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked needs docs please add docs to this PR needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mini-RFC: --no-pack flag
6 participants