summaryrefslogtreecommitdiff
path: root/cli/tools/registry/tar.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-02-29 11:54:57 +0000
committerGitHub <noreply@github.com>2024-02-29 12:54:57 +0100
commit211b3ff244c33908f0e8c633e773a098bfee8eaf (patch)
treef6d7e773062d4940d6d87db5fcc30c7ad4b5a111 /cli/tools/registry/tar.rs
parent1dad7bec17d1c4780abe944b991435e5c20ab270 (diff)
fix(publish): print a warning when .jsx or .tsx is imported (#22631)
This commit adds a warning when .jsx or .tsx is encountered during publishing. This is a stop-gap solution before we fix it proper.
Diffstat (limited to 'cli/tools/registry/tar.rs')
-rw-r--r--cli/tools/registry/tar.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/tools/registry/tar.rs b/cli/tools/registry/tar.rs
index 2dd160a0a..d24d8abaa 100644
--- a/cli/tools/registry/tar.rs
+++ b/cli/tools/registry/tar.rs
@@ -154,6 +154,14 @@ pub fn create_gzipped_tarball(
source_parser,
diagnostics_collector,
)?;
+
+ let media_type = MediaType::from_specifier(&specifier);
+ if matches!(media_type, MediaType::Jsx | MediaType::Tsx) {
+ diagnostics_collector.push(PublishDiagnostic::UnsupportedJsxTsx {
+ specifier: specifier.clone(),
+ });
+ }
+
files.push(PublishableTarballFile {
path_str: path_str.clone(),
specifier: specifier.clone(),