-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Add --info flag to display file info (compiled code/source map) #1647
Conversation
kevinkassimo
commented
Feb 1, 2019
•
edited
Loading
edited
src/flags.rs
Outdated
@@ -147,6 +151,7 @@ pub fn set_flags( | |||
opts.optflag("", "v8-options", "Print V8 command line options."); | |||
opts.optflag("", "types", "Print runtime TypeScript declarations."); | |||
opts.optflag("", "prefetch", "Prefetch the dependencies."); | |||
opts.optflag("I", "info", "Show source file related info"); |
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.
Don't add a short string version - only --info
src/main.rs
Outdated
} | ||
let out = maybe_out.unwrap(); | ||
|
||
println!("local filename: {}", &(out.filename)); |
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.
Let's try to make these labels (text before colon) into single words without qualifiers
filename:
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.
Other ones looks okay to me, but “filename” sounds confusing here since it also works for remote resources (which shows the location of their their local cached version)
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 just "local:" ? I think filename works...
we can change it later if it's confusing
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.
@ry I would go with local
src/main.rs
Outdated
let out = maybe_out.unwrap(); | ||
|
||
println!("local filename: {}", &(out.filename)); | ||
println!("media type: {}", msg::enum_name_media_type(out.media_type)); |
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.
type:
src/main.rs
Outdated
println!("media type: {}", msg::enum_name_media_type(out.media_type)); | ||
if out.maybe_output_code_filename.is_some() { | ||
println!( | ||
"compiled javascript: {}", |
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.
javascript:
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 compiled:
?
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.
sure
src/main.rs
Outdated
} | ||
if out.maybe_source_map_filename.is_some() { | ||
println!( | ||
"source map: {}", |
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.
map:
src/main.rs
Outdated
"source map: {}", | ||
out.maybe_source_map_filename.as_ref().unwrap() | ||
); | ||
} |
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.
Add // TODO print deps.
src/main.rs
Outdated
@@ -60,6 +60,30 @@ fn print_err_and_exit(err: js_errors::JSError) { | |||
std::process::exit(1); | |||
} | |||
|
|||
fn display_file_info(filename: String, dir: &deno_dir::DenoDir) { |
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.
print_file_info
consider making this a method of DenoDir
8decede
to
b2b3092
Compare
b2b3092
to
5f5ef6a
Compare
@@ -0,0 +1,2 @@ | |||
args: --info https://127.0.0.1:4545/tests/003_relative_import.ts |
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.
If this test file supports comments, I would add something like
# The output assumes 003_relative_import.ts has already been run earlier and its output is cached to $DENO_DIR.
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.
It errored out last time I tried. Let me see if there is a way I can allow comments in .test files
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.
Added support for comments in ".test" files
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.
Thanks
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.
LGTM - this is a nice feature!