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: default to TS for file extension and support ext flag in more scenarios #25472

Merged
merged 17 commits into from
Sep 18, 2024

Conversation

crowlKats
Copy link
Member

@crowlKats crowlKats commented Sep 5, 2024

Closes #11220
Currently does lint, fmt, and repl

@bartlomieju bartlomieju added this to the 2.0.0-rc.3 milestone Sep 10, 2024
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

This looks good to me, but I want @dsherret to take a look as well before we merge

# Conflicts:
#	Cargo.lock
#	cli/Cargo.toml
#	cli/graph_container.rs
#	cli/module_loader.rs
#	cli/tools/fmt.rs
#	cli/tools/registry/pm/cache_deps.rs
# Conflicts:
#	cli/lsp/testing/execution.rs
#	cli/tools/test/mod.rs
Comment on lines +142 to +149
let headers = if local.extension().is_none() {
Some(HashMap::from([(
"content-type".to_string(),
"application/typescript".to_string(),
)]))
} else {
None
};
Copy link
Member

Choose a reason for hiding this comment

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

I think what you want is MediaType::from_specifier(specifier) != MediaType::Unknown

Copy link
Member Author

Choose a reason for hiding this comment

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

no, as per what you have said in #11220 (comment)

extensionless files default to TS everywhere (entrypoint and imported)

Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

We should really lift this up into deno_graph after 2.0 is out the door...

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, let's land it and if Luca has concerns we can fix them tomorrow.

@bartlomieju bartlomieju merged commit a1d0a42 into denoland:main Sep 18, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default file extension inconsistency in the deno run cli
3 participants