1use std::path::{Path, PathBuf};
9
10use fallow_config::{
11 AutoImportRule, EntryPointRole, JsxImportSourceRule, PackageJson, UsedClassMemberRule,
12};
13use fallow_types::semantic::SemanticFrameworkContract;
14use regex::Regex;
15
16use entry_point_roles::builtin_entry_point_role;
17#[cfg(test)]
18use entry_point_roles::{
19 RUNTIME_ENTRY_POINT_PLUGINS, SUPPORT_ENTRY_POINT_PLUGINS, TEST_ENTRY_POINT_PLUGINS,
20};
21
22#[cfg(test)]
25fn entry_rules_match(result: &PluginResult, path: &str) -> bool {
26 result
27 .entry_patterns
28 .iter()
29 .filter_map(|rule| CompiledPathRule::for_entry_rule(rule, "entry pattern"))
30 .any(|rule| rule.matches(path))
31}
32
33#[derive(Debug, Clone, Copy, PartialEq, Eq)]
35pub enum PluginConfigEffect {
36 Unreadable,
39 NotModeled,
42}
43
44#[derive(Debug, Clone, PartialEq, Eq)]
55pub struct PluginConfigDiagnostic {
56 pub config_path: PathBuf,
58 pub plugin: String,
62 pub key: String,
65 pub reason: String,
67 pub effect: PluginConfigEffect,
69}
70
71impl PluginConfigDiagnostic {
72 pub(super) fn unreadable(
74 config_path: &Path,
75 plugin: &str,
76 key: &str,
77 reason: &'static str,
78 ) -> Self {
79 Self {
80 config_path: config_path.to_path_buf(),
81 plugin: plugin.to_owned(),
82 key: key.to_owned(),
83 reason: reason.to_owned(),
84 effect: PluginConfigEffect::Unreadable,
85 }
86 }
87
88 pub(crate) fn not_modeled(
90 config_path: &Path,
91 plugin: &str,
92 key: &str,
93 reason: &'static str,
94 ) -> Self {
95 Self {
96 config_path: config_path.to_path_buf(),
97 plugin: plugin.to_owned(),
98 key: key.to_owned(),
99 reason: reason.to_owned(),
100 effect: PluginConfigEffect::NotModeled,
101 }
102 }
103
104 #[must_use]
107 pub fn into_workspace_diagnostic(self, root: &Path) -> fallow_config::WorkspaceDiagnostic {
108 let Self {
109 config_path,
110 plugin,
111 key,
112 reason,
113 effect,
114 } = self;
115 let kind = match effect {
116 PluginConfigEffect::Unreadable => {
117 fallow_config::WorkspaceDiagnosticKind::PluginConfigUnreadable {
118 plugin,
119 key,
120 reason,
121 }
122 }
123 PluginConfigEffect::NotModeled => {
124 fallow_config::WorkspaceDiagnosticKind::PluginEffectNotModeled {
125 plugin,
126 key,
127 reason,
128 }
129 }
130 };
131 fallow_config::WorkspaceDiagnostic::new(root, config_path, kind)
132 }
133}
134
135#[derive(Debug, Default)]
137pub struct PluginResult {
138 entry_patterns: Vec<PathRule>,
140 replace_entry_patterns: bool,
145 accumulate_config_entry_patterns: bool,
149 replace_used_export_rules: bool,
152 used_exports: Vec<UsedExportRule>,
154 entry_export_credits: Vec<UsedExportRule>,
159 used_class_members: Vec<UsedClassMemberRule>,
164 referenced_dependencies: Vec<String>,
166 package_referenced_dependencies: Vec<(PathBuf, String)>,
169 required_dependencies: Vec<RequiredDependency>,
171 always_used_files: Vec<String>,
173 path_aliases: Vec<(String, String)>,
175 checked_alias_prefixes: Vec<String>,
179 setup_files: Vec<PathBuf>,
181 fixture_patterns: Vec<String>,
183 scss_include_paths: Vec<PathBuf>,
191 static_dir_mappings: Vec<(PathBuf, String)>,
194 framework_static_dir_mappings: Vec<(PathBuf, String)>,
195 provided_dependencies: Vec<ProvidedDependencyRule>,
198 config_diagnostics: Vec<PluginConfigDiagnostic>,
202 federation_sources: Vec<FederationSource>,
205 jsx_import_sources: Vec<JsxImportSourceRule>,
209 jsx_package_credits: Vec<JsxImportSourceRule>,
214 tsconfig_jsx_dirs: Vec<registry::TsconfigJsxDir>,
219}
220
221#[must_use]
229fn federation_trace_provenance(
230 root: &Path,
231 files: &[crate::discover::DiscoveredFile],
232 sources: &[FederationSource],
233 modules: &[crate::extract::ModuleInfo],
234) -> fallow_types::trace::TraceProvenance {
235 let mut provenance = fallow_types::trace::TraceProvenance::default();
236 push_runtime_remote_sources(&mut provenance, root, files, modules);
237 if sources.is_empty() {
238 return provenance;
239 }
240 let mut exposed = Vec::new();
241 for source in sources {
242 let config = source
243 .config_path
244 .strip_prefix(root)
245 .unwrap_or(&source.config_path)
246 .to_path_buf();
247 let trace_source = fallow_types::trace::TraceSource {
248 kind: "module-federation".to_owned(),
249 plugin: source.plugin.clone(),
250 config,
251 key: source.key.to_owned(),
252 };
253 match &source.target {
254 FederationSourceTarget::Exposed(rule) => {
255 if let Some(compiled) =
256 CompiledPathRule::for_entry_rule(rule, "Module Federation exposes target")
257 {
258 exposed.push((compiled, trace_source));
259 }
260 }
261 FederationSourceTarget::Remote(alias) => {
262 provenance.push_dependency(alias.clone(), trace_source);
263 }
264 }
265 }
266 if exposed.is_empty() {
267 return provenance;
268 }
269 for file in files {
270 let Ok(relative) = file.path.strip_prefix(root) else {
271 continue;
272 };
273 let relative_str = relative.to_string_lossy().replace('\\', "/");
274 for (rule, source) in &exposed {
275 if rule.matches(&relative_str) {
276 provenance.push_file(relative.to_path_buf(), source.clone());
277 }
278 }
279 }
280 provenance
281}
282
283const CONFIG_ONLY_EXPORT_NAMES: &[&str] = &[
292 "dynamic",
293 "dynamicParams",
294 "revalidate",
295 "fetchCache",
296 "runtime",
297 "preferredRegion",
298 "maxDuration",
299 "prerender",
300 "config",
301 "metadata",
302 "viewport",
303];
304
305fn push_tooling_trace_credits(
309 provenance: &mut fallow_types::trace::TraceProvenance,
310 root: &Path,
311 workspaces: &[fallow_config::WorkspaceInfo],
312 plugin_result: &AggregatedPluginResult,
313) {
314 for entry in &plugin_result.plugin_tooling {
315 let Some(evidence) = entry.evidence(&plugin_result.script_used_packages) else {
316 continue;
317 };
318 let credit = match evidence {
319 PluginToolingEvidence::OwnConfig(config) => fallow_types::trace::ToolingCredit {
320 reason: "plugin-config".to_owned(),
321 plugin: Some(entry.plugin.clone()),
322 config: Some(config.strip_prefix(root).unwrap_or(config).to_path_buf()),
323 reference: None,
324 },
325 PluginToolingEvidence::Reference(name) => fallow_types::trace::ToolingCredit {
326 reason: "plugin-reference".to_owned(),
327 plugin: Some(entry.plugin.clone()),
328 config: None,
329 reference: Some(name.to_owned()),
330 },
331 };
332 for dependency in &entry.dependencies {
333 provenance.push_tooling_credit(dependency.clone(), credit.clone());
334 }
335 }
336 push_types_trace_credits(provenance, plugin_result);
337 push_catalogue_trace_credits(provenance, root, workspaces, plugin_result);
338}
339
340fn push_catalogue_trace_credits(
350 provenance: &mut fallow_types::trace::TraceProvenance,
351 root: &Path,
352 workspaces: &[fallow_config::WorkspaceInfo],
353 plugin_result: &AggregatedPluginResult,
354) {
355 let manifests = read_trace_manifests(root, workspaces);
356 let mut names: Vec<&String> = plugin_result.dev_dependency_names.iter().collect();
357 names.sort_unstable();
358 for name in names {
359 let declaring: Vec<&(PathBuf, serde_json::Value)> = manifests
360 .iter()
361 .filter(|(_, manifest)| manifest_lists(manifest, "devDependencies", name))
362 .collect();
363 if let Some(credit) = catalogue_credit(name, root, &declaring) {
364 provenance.push_tooling_credit(name.clone(), credit);
365 }
366 if let Some((path, _)) = declaring
367 .iter()
368 .find(|(_, manifest)| manifest_lists(manifest, "peerDependencies", name))
369 {
370 provenance.push_tooling_credit(
371 name.clone(),
372 fallow_types::trace::ToolingCredit {
373 reason: "own-peer".to_owned(),
374 plugin: None,
375 config: Some(path.strip_prefix(root).unwrap_or(path).to_path_buf()),
376 reference: None,
377 },
378 );
379 }
380 }
381}
382
383fn read_trace_manifests(
385 root: &Path,
386 workspaces: &[fallow_config::WorkspaceInfo],
387) -> Vec<(PathBuf, serde_json::Value)> {
388 std::iter::once(root)
389 .chain(
390 workspaces
391 .iter()
392 .map(|ws| ws.root.as_path())
393 .filter(|ws_root| *ws_root != root),
394 )
395 .filter_map(|package_root| {
396 let path = package_root.join("package.json");
397 let content = std::fs::read_to_string(&path).ok()?;
398 serde_json::from_str(&content)
399 .ok()
400 .map(|value| (path, value))
401 })
402 .collect()
403}
404
405fn manifest_lists(manifest: &serde_json::Value, section: &str, name: &str) -> bool {
406 manifest
407 .get(section)
408 .and_then(serde_json::Value::as_object)
409 .is_some_and(|deps| deps.contains_key(name))
410}
411
412fn catalogue_credit(
415 name: &str,
416 root: &Path,
417 declaring: &[&(PathBuf, serde_json::Value)],
418) -> Option<fallow_types::trace::ToolingCredit> {
419 if is_ambient_types_package(name) || types_package_target(name).is_some() {
420 return None;
421 }
422 let Some(patterns) = cli_tooling_config_patterns(name) else {
423 return is_known_tooling_dependency(name).then(|| fallow_types::trace::ToolingCredit {
424 reason: "known-tooling".to_owned(),
425 plugin: None,
426 config: None,
427 reference: None,
428 });
429 };
430 let config = declaring.iter().find_map(|(path, manifest)| {
431 crate::analyze::cli_tool_own_config(name, patterns, root, path, Some(manifest))
432 })?;
433 Some(fallow_types::trace::ToolingCredit {
434 reason: "known-tooling-config".to_owned(),
435 plugin: None,
436 config: Some(config.strip_prefix(root).unwrap_or(&config).to_path_buf()),
437 reference: None,
438 })
439}
440
441fn push_types_trace_credits(
446 provenance: &mut fallow_types::trace::TraceProvenance,
447 plugin_result: &AggregatedPluginResult,
448) {
449 let declared = plugin_result.dependency_binaries.declared_packages();
450 let mut names: Vec<&String> = plugin_result.dev_dependency_names.iter().collect();
451 names.sort_unstable();
452 for name in names {
453 let credit = if is_ambient_types_package(name) {
454 fallow_types::trace::ToolingCredit {
455 reason: "ambient-types".to_owned(),
456 plugin: None,
457 config: None,
458 reference: None,
459 }
460 } else if let Some(target) = types_package_target(name) {
461 if declared.contains(&target) {
462 fallow_types::trace::ToolingCredit {
463 reason: "types-target".to_owned(),
464 plugin: None,
465 config: None,
466 reference: Some(target),
467 }
468 } else if plugin_result.referenced_dependencies.contains(name) {
469 fallow_types::trace::ToolingCredit {
470 reason: "types-config".to_owned(),
471 plugin: None,
472 config: None,
473 reference: None,
474 }
475 } else {
476 continue;
477 }
478 } else {
479 continue;
480 };
481 provenance.push_tooling_credit(name.clone(), credit);
482 }
483}
484
485fn push_runtime_remote_sources(
487 provenance: &mut fallow_types::trace::TraceProvenance,
488 root: &Path,
489 files: &[crate::discover::DiscoveredFile],
490 modules: &[crate::extract::ModuleInfo],
491) {
492 for module in modules {
493 let mut file = None;
494 for fact in module.semantic_facts.iter() {
495 let fallow_types::extract::SemanticFact::FederationRuntimeRemote(fact) = fact else {
496 continue;
497 };
498 let Some(remote) = &fact.remote else {
499 continue;
500 };
501 let Some(path) = file.get_or_insert_with(|| {
502 files.get(module.file_id.0 as usize).map(|file| {
503 file.path
504 .strip_prefix(root)
505 .unwrap_or(&file.path)
506 .to_path_buf()
507 })
508 }) else {
509 break;
510 };
511 provenance.push_dependency(
512 remote.clone(),
513 fallow_types::trace::TraceSource {
514 kind: "module-federation".to_owned(),
515 plugin: "module-federation".to_owned(),
516 config: path.clone(),
517 key: fact.call.name().to_owned(),
518 },
519 );
520 }
521 }
522}
523
524impl PluginResult {
525 fn extend_config_dir_entry_patterns(
530 &mut self,
531 values: Vec<String>,
532 config_path: &Path,
533 root: &Path,
534 ) {
535 let (negated, positive): (Vec<String>, Vec<String>) =
536 values.into_iter().partition(|value| value.starts_with('!'));
537 let excluded: Vec<String> = negated
538 .iter()
539 .filter_map(|value| value.strip_prefix('!'))
540 .filter_map(|value| config_parser::normalize_config_path(value, config_path, root))
541 .collect();
542 self.entry_patterns.extend(
543 positive
544 .iter()
545 .filter_map(|value| config_parser::normalize_config_path(value, config_path, root))
546 .map(|pattern| {
547 PathRule::new(pattern).with_excluded_globs(excluded.iter().cloned())
548 }),
549 );
550 }
551
552 fn push_parent_relative_entry_pattern(&mut self, pattern: String) {
555 let mut rule = PathRule::new(pattern);
556 rule.parent_relative = true;
557 self.entry_patterns.push(rule);
558 }
559
560 fn push_entry_pattern(&mut self, pattern: impl Into<String>) {
561 self.entry_patterns
562 .push(PathRule::new(normalize_entry_pattern(pattern.into())));
563 }
564
565 fn extend_entry_patterns<I, S>(&mut self, patterns: I)
566 where
567 I: IntoIterator<Item = S>,
568 S: Into<String>,
569 {
570 self.entry_patterns.extend(
571 patterns
572 .into_iter()
573 .map(|pat| PathRule::new(normalize_entry_pattern(pat.into()))),
574 );
575 }
576
577 fn extend_entry_patterns_or_dependencies<I, S>(
592 &mut self,
593 values: I,
594 resolve_path: impl Fn(String) -> String,
595 ) where
596 I: IntoIterator<Item = S>,
597 S: Into<String>,
598 {
599 for value in values {
600 let value = value.into();
601 if let Some(request) = module_request(&value) {
602 self.referenced_dependencies
603 .push(crate::resolve::extract_package_name(request));
604 continue;
605 }
606 self.push_entry_path(resolve_path(value));
607 }
608 }
609
610 fn extend_entry_patterns_and_dependencies<I, S>(&mut self, values: I, root: &Path)
622 where
623 I: IntoIterator<Item = S>,
624 S: Into<String>,
625 {
626 for value in values {
627 let value = value.into();
628 if let Some(request) = module_request(&value)
629 && !names_project_file(root, request)
630 {
631 self.referenced_dependencies
632 .push(crate::resolve::extract_package_name(request));
633 }
634 self.push_entry_path(value);
635 }
636 }
637
638 fn extend_entry_paths<I, S>(&mut self, values: I)
640 where
641 I: IntoIterator<Item = S>,
642 S: Into<String>,
643 {
644 for value in values {
645 self.push_entry_path(value.into());
646 }
647 }
648
649 fn push_entry_path(&mut self, value: String) {
657 if has_glob_syntax(&value) || has_source_extension(&value) {
658 self.push_entry_pattern(value);
659 return;
660 }
661 let base = value.trim_end_matches('/').to_owned();
662 self.push_entry_pattern(value);
663 self.push_entry_pattern(format!("{base}.{REQUEST_EXTENSIONS}"));
664 self.push_entry_pattern(format!("{base}/index.{REQUEST_EXTENSIONS}"));
665 }
666
667 fn push_checked_path_alias(&mut self, prefix: String, replacement: String) {
671 self.checked_alias_prefixes.push(prefix.clone());
672 self.path_aliases.push((prefix, replacement));
673 }
674
675 #[must_use]
682 const fn is_empty(&self) -> bool {
683 self.config_diagnostics.is_empty()
684 && self.entry_patterns.is_empty()
685 && self.used_exports.is_empty()
686 && self.entry_export_credits.is_empty()
687 && self.used_class_members.is_empty()
688 && self.referenced_dependencies.is_empty()
689 && self.package_referenced_dependencies.is_empty()
690 && self.required_dependencies.is_empty()
691 && self.always_used_files.is_empty()
692 && self.path_aliases.is_empty()
693 && self.setup_files.is_empty()
694 && self.fixture_patterns.is_empty()
695 && self.scss_include_paths.is_empty()
696 && self.static_dir_mappings.is_empty()
697 && self.framework_static_dir_mappings.is_empty()
698 && self.provided_dependencies.is_empty()
699 && self.federation_sources.is_empty()
700 && self.jsx_import_sources.is_empty()
701 && self.jsx_package_credits.is_empty()
702 && self.tsconfig_jsx_dirs.is_empty()
703 }
704}
705
706const REQUEST_EXTENSIONS: &str = "{ts,tsx,mts,cts,gts,js,jsx,mjs,cjs,gjs,vue,svelte,astro,mdx}";
710
711fn normalize_entry_pattern(pattern: String) -> String {
712 pattern
713 .strip_prefix("./")
714 .map(str::to_owned)
715 .unwrap_or(pattern)
716}
717
718#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)]
724pub struct PathRule {
725 pub pattern: String,
726 pub exclude_globs: Vec<String>,
727 pub exclude_regexes: Vec<String>,
728 pub exclude_segment_regexes: Vec<String>,
732 pub parent_relative: bool,
739 pub package_relative: bool,
743}
744
745impl PathRule {
746 #[must_use]
747 pub(crate) fn new(pattern: impl Into<String>) -> Self {
748 Self {
749 pattern: pattern.into(),
750 exclude_globs: Vec::new(),
751 exclude_regexes: Vec::new(),
752 exclude_segment_regexes: Vec::new(),
753 parent_relative: false,
754 package_relative: false,
755 }
756 }
757
758 #[must_use]
759 fn from_static(pattern: &'static str) -> Self {
760 Self::new(pattern)
761 }
762
763 #[must_use]
767 fn from_extglob(pattern: &str) -> Self {
768 let rewritten = fallow_config::extglob::rewrite_include(pattern);
769 Self::new(rewritten.include).with_excluded_globs(rewritten.excludes)
770 }
771
772 #[must_use]
776 fn with_excluded_extglobs<I, S>(self, patterns: I) -> Self
777 where
778 I: IntoIterator<Item = S>,
779 S: AsRef<str>,
780 {
781 let excluded: Vec<String> = patterns
782 .into_iter()
783 .filter_map(|pattern| fallow_config::extglob::rewrite_exclude(pattern.as_ref()))
784 .collect();
785 self.with_excluded_globs(excluded)
786 }
787
788 #[must_use]
789 pub(crate) fn with_excluded_globs<I, S>(mut self, patterns: I) -> Self
790 where
791 I: IntoIterator<Item = S>,
792 S: Into<String>,
793 {
794 self.exclude_globs
795 .extend(patterns.into_iter().map(Into::into));
796 self
797 }
798
799 #[must_use]
800 fn with_excluded_regexes<I, S>(mut self, patterns: I) -> Self
801 where
802 I: IntoIterator<Item = S>,
803 S: Into<String>,
804 {
805 self.exclude_regexes
806 .extend(patterns.into_iter().map(Into::into));
807 self
808 }
809
810 #[must_use]
811 fn with_excluded_segment_regexes<I, S>(mut self, patterns: I) -> Self
812 where
813 I: IntoIterator<Item = S>,
814 S: Into<String>,
815 {
816 self.exclude_segment_regexes
817 .extend(patterns.into_iter().map(Into::into));
818 self
819 }
820
821 #[must_use]
822 fn prefixed(&self, ws_prefix: &str) -> Self {
823 let prefix = |pattern: &str| {
824 if self.parent_relative && pattern.starts_with("../") {
825 resolve_parent_relative_pattern(pattern, ws_prefix)
826 } else if self.package_relative {
827 format!("{ws_prefix}/{pattern}")
828 } else {
829 prefix_workspace_pattern(pattern, ws_prefix)
830 }
831 };
832 Self {
833 pattern: prefix(&self.pattern),
834 exclude_globs: self
835 .exclude_globs
836 .iter()
837 .map(|pattern| prefix(pattern))
838 .collect(),
839 exclude_regexes: self
840 .exclude_regexes
841 .iter()
842 .map(|pattern| prefix_workspace_regex(pattern, ws_prefix))
843 .collect(),
844 exclude_segment_regexes: self.exclude_segment_regexes.clone(),
845 parent_relative: false,
846 package_relative: false,
847 }
848 }
849}
850
851#[derive(Debug, Clone, Default, PartialEq, Eq)]
853pub struct ProvidedDependencyRule {
854 pub(crate) path: PathRule,
855 exact_specifiers: Vec<String>,
856 specifier_prefixes: Vec<String>,
857}
858
859impl ProvidedDependencyRule {
860 #[must_use]
861 fn new(
862 pattern: impl Into<String>,
863 exact_specifiers: impl IntoIterator<Item = impl Into<String>>,
864 specifier_prefixes: impl IntoIterator<Item = impl Into<String>>,
865 ) -> Self {
866 Self {
867 path: PathRule::new(pattern),
868 exact_specifiers: exact_specifiers.into_iter().map(Into::into).collect(),
869 specifier_prefixes: specifier_prefixes.into_iter().map(Into::into).collect(),
870 }
871 }
872
873 #[must_use]
874 fn prefixed(&self, ws_prefix: &str) -> Self {
875 Self {
876 path: self.path.prefixed(ws_prefix),
877 exact_specifiers: self.exact_specifiers.clone(),
878 specifier_prefixes: self.specifier_prefixes.clone(),
879 }
880 }
881
882 #[must_use]
883 pub(crate) fn may_cover_package(&self, package_name: &str) -> bool {
884 self.exact_specifiers
885 .iter()
886 .chain(self.specifier_prefixes.iter())
887 .any(|specifier| crate::resolve::extract_package_name(specifier) == package_name)
888 }
889
890 #[must_use]
891 pub(crate) fn covers_specifier(&self, specifier: &str) -> bool {
892 self.exact_specifiers
893 .iter()
894 .any(|allowed| allowed == specifier)
895 || self
896 .specifier_prefixes
897 .iter()
898 .any(|prefix| specifier.starts_with(prefix))
899 }
900}
901
902pub(crate) fn entry_rule_glob(pattern: &str) -> Result<globset::Glob, globset::Error> {
906 globset::GlobBuilder::new(pattern)
907 .literal_separator(true)
908 .empty_alternates(true)
909 .build()
910}
911
912#[derive(Debug, Clone)]
917pub(crate) struct CompiledPathRule {
918 include: globset::GlobMatcher,
919 exclude_globs: Vec<globset::GlobMatcher>,
920 exclude_regexes: Vec<Regex>,
921 exclude_segment_regexes: Vec<Regex>,
922}
923
924impl CompiledPathRule {
925 pub(crate) fn for_entry_rule(rule: &PathRule, rule_kind: &str) -> Option<Self> {
926 let include = match entry_rule_glob(&rule.pattern) {
927 Ok(glob) => glob.compile_matcher(),
928 Err(err) => {
929 tracing::warn!("invalid {rule_kind} '{}': {err}", rule.pattern);
930 return None;
931 }
932 };
933 Some(Self {
934 include,
935 exclude_globs: compile_excluded_globs(&rule.exclude_globs, rule_kind, &rule.pattern),
936 exclude_regexes: compile_excluded_regexes(
937 &rule.exclude_regexes,
938 rule_kind,
939 &rule.pattern,
940 ),
941 exclude_segment_regexes: compile_excluded_segment_regexes(
942 &rule.exclude_segment_regexes,
943 rule_kind,
944 &rule.pattern,
945 ),
946 })
947 }
948
949 pub(crate) fn for_used_export_rule(rule: &PathRule, rule_kind: &str) -> Option<Self> {
950 Self::for_entry_rule(rule, rule_kind)
951 }
952
953 #[must_use]
954 pub(crate) fn matches(&self, path: &str) -> bool {
955 self.include.is_match(path)
956 && !self.exclude_globs.iter().any(|glob| glob.is_match(path))
957 && !self
958 .exclude_regexes
959 .iter()
960 .any(|regex| regex.is_match(path))
961 && !matches_segment_regex(path, &self.exclude_segment_regexes)
962 }
963}
964
965fn prefix_workspace_pattern(pattern: &str, ws_prefix: &str) -> String {
966 if pattern.starts_with(ws_prefix) || pattern.starts_with('/') {
967 pattern.to_string()
968 } else {
969 format!("{ws_prefix}/{pattern}")
970 }
971}
972
973fn resolve_parent_relative_pattern(pattern: &str, ws_prefix: &str) -> String {
979 if ws_prefix.starts_with('/') || Path::new(ws_prefix).is_absolute() {
980 return pattern.to_string();
981 }
982 let mut base: Vec<&str> = ws_prefix
985 .split(['/', '\\'])
986 .filter(|segment| !segment.is_empty())
987 .collect();
988 let mut rest = pattern;
989 while let Some(stripped) = rest.strip_prefix("../") {
990 if base.pop().is_none() {
991 return pattern.to_string();
992 }
993 rest = stripped;
994 }
995 if base.is_empty() {
996 rest.to_string()
997 } else {
998 format!("{}/{rest}", base.join("/"))
999 }
1000}
1001
1002fn prefix_workspace_regex(pattern: &str, ws_prefix: &str) -> String {
1003 if let Some(pattern) = pattern.strip_prefix('^') {
1004 format!("^{}/{}", regex::escape(ws_prefix), pattern)
1005 } else {
1006 format!("^{}/(?:{})", regex::escape(ws_prefix), pattern)
1007 }
1008}
1009
1010fn compile_excluded_globs(
1011 patterns: &[String],
1012 rule_kind: &str,
1013 rule_pattern: &str,
1014) -> Vec<globset::GlobMatcher> {
1015 patterns
1016 .iter()
1017 .filter_map(|pattern| {
1018 match globset::GlobBuilder::new(pattern)
1019 .literal_separator(true)
1020 .empty_alternates(true)
1021 .build()
1022 {
1023 Ok(glob) => Some(glob.compile_matcher()),
1024 Err(err) => {
1025 tracing::warn!(
1026 "skipping invalid excluded glob '{}' for {} '{}': {err}",
1027 pattern,
1028 rule_kind,
1029 rule_pattern
1030 );
1031 None
1032 }
1033 }
1034 })
1035 .collect()
1036}
1037
1038fn compile_excluded_regexes(
1039 patterns: &[String],
1040 rule_kind: &str,
1041 rule_pattern: &str,
1042) -> Vec<Regex> {
1043 patterns
1044 .iter()
1045 .filter_map(|pattern| match Regex::new(pattern) {
1046 Ok(regex) => Some(regex),
1047 Err(err) => {
1048 tracing::warn!(
1049 "skipping invalid excluded regex '{}' for {} '{}': {err}",
1050 pattern,
1051 rule_kind,
1052 rule_pattern
1053 );
1054 None
1055 }
1056 })
1057 .collect()
1058}
1059
1060fn compile_excluded_segment_regexes(
1061 patterns: &[String],
1062 rule_kind: &str,
1063 rule_pattern: &str,
1064) -> Vec<Regex> {
1065 patterns
1066 .iter()
1067 .filter_map(|pattern| match Regex::new(pattern) {
1068 Ok(regex) => Some(regex),
1069 Err(err) => {
1070 tracing::warn!(
1071 "skipping invalid excluded segment regex '{}' for {} '{}': {err}",
1072 pattern,
1073 rule_kind,
1074 rule_pattern
1075 );
1076 None
1077 }
1078 })
1079 .collect()
1080}
1081
1082fn matches_segment_regex(path: &str, regexes: &[Regex]) -> bool {
1085 path.split(std::path::is_separator)
1086 .any(|segment| regexes.iter().any(|regex| regex.is_match(segment)))
1087}
1088
1089impl From<String> for PathRule {
1090 fn from(pattern: String) -> Self {
1091 Self::new(pattern)
1092 }
1093}
1094
1095impl From<&str> for PathRule {
1096 fn from(pattern: &str) -> Self {
1097 Self::new(pattern)
1098 }
1099}
1100
1101impl std::ops::Deref for PathRule {
1102 type Target = str;
1103
1104 fn deref(&self) -> &Self::Target {
1105 &self.pattern
1106 }
1107}
1108
1109impl PartialEq<&str> for PathRule {
1110 fn eq(&self, other: &&str) -> bool {
1111 self.pattern == *other
1112 }
1113}
1114
1115impl PartialEq<str> for PathRule {
1116 fn eq(&self, other: &str) -> bool {
1117 self.pattern == other
1118 }
1119}
1120
1121impl PartialEq<String> for PathRule {
1122 fn eq(&self, other: &String) -> bool {
1123 &self.pattern == other
1124 }
1125}
1126
1127pub trait Plugin: Send + Sync {
1129 fn name(&self) -> &'static str;
1131
1132 fn enablers(&self) -> &'static [&'static str] {
1135 &[]
1136 }
1137
1138 fn is_enabled(&self, pkg: &PackageJson, root: &Path) -> bool {
1140 let deps = pkg.all_dependency_names();
1141 self.is_enabled_with_deps(&deps, root)
1142 }
1143
1144 fn is_enabled_with_deps(&self, deps: &[String], _root: &Path) -> bool {
1147 let enablers = self.enablers();
1148 if enablers.is_empty() {
1149 return false;
1150 }
1151 enablers.iter().any(|enabler| {
1152 if enabler.ends_with('/') {
1153 deps.iter().any(|d| d.starts_with(enabler))
1155 } else {
1156 deps.iter().any(|d| d == enabler)
1157 }
1158 })
1159 }
1160
1161 fn is_enabled_with_files(
1174 &self,
1175 deps: &[String],
1176 root: &Path,
1177 _discovered_files: &[PathBuf],
1178 _candidate_index: Option<®istry::ConfigCandidateIndex>,
1179 ) -> bool {
1180 self.is_enabled_with_deps(deps, root)
1181 }
1182
1183 fn script_enablers(&self) -> &'static [&'static str] {
1185 &[]
1186 }
1187
1188 fn is_enabled_with_scripts(
1190 &self,
1191 script_packages: &rustc_hash::FxHashSet<String>,
1192 _root: &Path,
1193 ) -> bool {
1194 let enablers = self.script_enablers();
1195 if enablers.is_empty() {
1196 return false;
1197 }
1198 enablers.iter().any(|enabler| {
1199 if enabler.ends_with('/') {
1200 script_packages
1201 .iter()
1202 .any(|package| package.starts_with(enabler))
1203 } else {
1204 script_packages.contains(*enabler)
1205 }
1206 })
1207 }
1208
1209 fn entry_patterns(&self) -> &'static [&'static str] {
1211 &[]
1212 }
1213
1214 fn entry_pattern_rules(&self) -> Vec<PathRule> {
1216 self.entry_patterns()
1217 .iter()
1218 .map(|pattern| PathRule::from_static(pattern))
1219 .collect()
1220 }
1221
1222 fn entry_point_role(&self) -> EntryPointRole {
1227 builtin_entry_point_role(self.name())
1228 }
1229
1230 fn config_patterns(&self) -> &'static [&'static str] {
1232 &[]
1233 }
1234
1235 fn config_default_export_opt_out(&self) -> &'static [&'static str] {
1244 &[]
1245 }
1246
1247 fn config_file_exports(&self) -> &'static [(&'static str, &'static [&'static str])] {
1256 &[]
1257 }
1258
1259 fn always_used(&self) -> &'static [&'static str] {
1261 &[]
1262 }
1263
1264 fn used_exports(&self) -> Vec<(&'static str, &'static [&'static str])> {
1266 vec![]
1267 }
1268
1269 fn used_export_rules(&self) -> Vec<UsedExportRule> {
1271 self.used_exports()
1272 .into_iter()
1273 .map(|(pattern, exports)| UsedExportRule::from_static(pattern, exports))
1274 .collect()
1275 }
1276
1277 fn used_class_members(&self) -> &'static [&'static str] {
1282 &[]
1283 }
1284
1285 fn used_class_member_rules(&self) -> Vec<UsedClassMemberRule> {
1293 Vec::new()
1294 }
1295
1296 fn framework_class_member_contracts(&self) -> Vec<SemanticFrameworkContract> {
1299 Vec::new()
1300 }
1301
1302 fn fixture_glob_patterns(&self) -> &'static [&'static str] {
1307 &[]
1308 }
1309
1310 fn discovery_hidden_dirs(&self) -> &'static [&'static str] {
1315 &[]
1316 }
1317
1318 fn tooling_dependencies(&self) -> &'static [&'static str] {
1321 &[]
1322 }
1323
1324 fn virtual_module_prefixes(&self) -> &'static [&'static str] {
1329 &[]
1330 }
1331
1332 fn virtual_package_suffixes(&self) -> &'static [&'static str] {
1338 &[]
1339 }
1340
1341 fn generated_import_patterns(&self) -> &'static [&'static str] {
1347 &[]
1348 }
1349
1350 fn generated_type_import_prefixes(&self) -> &'static [&'static str] {
1355 &[]
1356 }
1357
1358 fn virtual_module_package(&self) -> Option<&'static str> {
1369 None
1370 }
1371
1372 fn path_aliases(&self, _root: &Path) -> Vec<(&'static str, String)> {
1382 vec![]
1383 }
1384
1385 fn static_dir_mappings(&self, _root: &Path) -> Vec<(std::path::PathBuf, String)> {
1397 vec![]
1398 }
1399
1400 fn auto_imports(&self, _root: &Path) -> Vec<AutoImportRule> {
1418 Vec::new()
1419 }
1420
1421 fn provided_dependencies(&self) -> Vec<ProvidedDependencyRule> {
1423 Vec::new()
1424 }
1425
1426 fn is_enabled_with_package_json(&self, _pkg: &PackageJson, _root: &Path) -> bool {
1428 false
1429 }
1430
1431 fn resolve_package_json(&self, _pkg: &PackageJson, _root: &Path) -> PluginResult {
1433 PluginResult::default()
1434 }
1435
1436 fn package_json_referenced_dependencies(
1441 &self,
1442 _pkg: &PackageJson,
1443 _root: &Path,
1444 ) -> Vec<String> {
1445 Vec::new()
1446 }
1447
1448 fn resolve_config(&self, _config_path: &Path, _source: &str, _root: &Path) -> PluginResult {
1453 PluginResult::default()
1454 }
1455
1456 fn resolve_config_in_project(
1465 &self,
1466 config_path: &Path,
1467 source: &str,
1468 root: &Path,
1469 _project_root: &Path,
1470 ) -> PluginResult {
1471 self.resolve_config(config_path, source, root)
1472 }
1473
1474 fn resolve_script_config(
1478 &self,
1479 config_path: &Path,
1480 source: &str,
1481 root: &Path,
1482 project_root: &Path,
1483 ) -> PluginResult {
1484 self.resolve_config_in_project(config_path, source, root, project_root)
1485 }
1486
1487 fn script_config_binaries(&self) -> &'static [&'static str] {
1495 &[]
1496 }
1497
1498 fn package_json_config_key(&self) -> Option<&'static str> {
1502 None
1503 }
1504}
1505
1506macro_rules! define_plugin {
1567 (
1568 struct $name:ident => $display:expr,
1569 enablers: $enablers:expr
1570 $(, entry_patterns: $entry:expr)?
1571 $(, config_patterns: $config:expr)?
1572 $(, config_default_export_opt_out: $config_opt_out:expr)?
1573 $(, config_file_exports: $config_exports:expr)?
1574 $(, always_used: $always:expr)?
1575 $(, tooling_dependencies: $tooling:expr)?
1576 $(, fixture_glob_patterns: $fixtures:expr)?
1577 $(, discovery_hidden_dirs: $hidden_dirs:expr)?
1578 $(, virtual_module_prefixes: $virtual:expr)?
1579 $(, virtual_package_suffixes: $virtual_suffixes:expr)?
1580 $(, generated_type_import_prefixes: $generated_type_prefixes:expr)?
1581 $(, provided_dependencies: $provided_dependencies:expr)?
1582 $(, used_exports: [$( ($pat:expr, $exports:expr) ),* $(,)?])?
1583 , resolve_config: imports_only
1584 $(,)?
1585 ) => {
1586 pub struct $name;
1587
1588 impl Plugin for $name {
1589 fn name(&self) -> &'static str {
1590 $display
1591 }
1592
1593 fn enablers(&self) -> &'static [&'static str] {
1594 $enablers
1595 }
1596
1597 $( fn entry_patterns(&self) -> &'static [&'static str] { $entry } )?
1598 $( fn config_patterns(&self) -> &'static [&'static str] { $config } )?
1599 $( fn config_default_export_opt_out(&self) -> &'static [&'static str] { $config_opt_out } )?
1600 $( fn config_file_exports(&self) -> &'static [(&'static str, &'static [&'static str])] { $config_exports } )?
1601 $( fn always_used(&self) -> &'static [&'static str] { $always } )?
1602 $( fn tooling_dependencies(&self) -> &'static [&'static str] { $tooling } )?
1603 $( fn fixture_glob_patterns(&self) -> &'static [&'static str] { $fixtures } )?
1604 $( fn discovery_hidden_dirs(&self) -> &'static [&'static str] { $hidden_dirs } )?
1605 $( fn virtual_module_prefixes(&self) -> &'static [&'static str] { $virtual } )?
1606 $( fn virtual_package_suffixes(&self) -> &'static [&'static str] { $virtual_suffixes } )?
1607 $( fn generated_type_import_prefixes(&self) -> &'static [&'static str] { $generated_type_prefixes } )?
1608 $( fn provided_dependencies(&self) -> Vec<ProvidedDependencyRule> { $provided_dependencies } )?
1609
1610 $(
1611 fn used_exports(&self) -> Vec<(&'static str, &'static [&'static str])> {
1612 vec![$( ($pat, $exports) ),*]
1613 }
1614 )?
1615
1616 fn resolve_config(
1617 &self,
1618 config_path: &std::path::Path,
1619 source: &str,
1620 _root: &std::path::Path,
1621 ) -> PluginResult {
1622 let mut result = PluginResult::default();
1623 crate::plugins::add_import_referenced_dependencies(
1624 &mut result,
1625 source,
1626 config_path,
1627 );
1628 result
1629 }
1630 }
1631 };
1632
1633 (
1634 struct $name:ident => $display:expr,
1635 enablers: $enablers:expr
1636 $(, entry_patterns: $entry:expr)?
1637 $(, config_patterns: $config:expr)?
1638 $(, config_default_export_opt_out: $config_opt_out:expr)?
1639 $(, config_file_exports: $config_exports:expr)?
1640 $(, always_used: $always:expr)?
1641 $(, tooling_dependencies: $tooling:expr)?
1642 $(, fixture_glob_patterns: $fixtures:expr)?
1643 $(, discovery_hidden_dirs: $hidden_dirs:expr)?
1644 $(, virtual_module_prefixes: $virtual:expr)?
1645 $(, virtual_package_suffixes: $virtual_suffixes:expr)?
1646 $(, generated_type_import_prefixes: $generated_type_prefixes:expr)?
1647 $(, provided_dependencies: $provided_dependencies:expr)?
1648 $(, package_json_config_key: $pkg_key:expr)?
1649 $(, script_config_binaries: $script_binaries:expr)?
1650 $(, used_exports: [$( ($pat:expr, $exports:expr) ),* $(,)?])?
1651 , resolve_config($cp:ident, $src:ident, $root:ident) $body:block
1652 $(, resolve_config_in_project($pcp:ident, $psrc:ident, $proot:ident, $pproj:ident) $pbody:block)?
1653 $(,)?
1654 ) => {
1655 pub struct $name;
1656
1657 impl Plugin for $name {
1658 fn name(&self) -> &'static str {
1659 $display
1660 }
1661
1662 fn enablers(&self) -> &'static [&'static str] {
1663 $enablers
1664 }
1665
1666 $( fn entry_patterns(&self) -> &'static [&'static str] { $entry } )?
1667 $( fn config_patterns(&self) -> &'static [&'static str] { $config } )?
1668 $( fn config_default_export_opt_out(&self) -> &'static [&'static str] { $config_opt_out } )?
1669 $( fn config_file_exports(&self) -> &'static [(&'static str, &'static [&'static str])] { $config_exports } )?
1670 $( fn always_used(&self) -> &'static [&'static str] { $always } )?
1671 $( fn tooling_dependencies(&self) -> &'static [&'static str] { $tooling } )?
1672 $( fn fixture_glob_patterns(&self) -> &'static [&'static str] { $fixtures } )?
1673 $( fn discovery_hidden_dirs(&self) -> &'static [&'static str] { $hidden_dirs } )?
1674 $( fn virtual_module_prefixes(&self) -> &'static [&'static str] { $virtual } )?
1675 $( fn virtual_package_suffixes(&self) -> &'static [&'static str] { $virtual_suffixes } )?
1676 $( fn generated_type_import_prefixes(&self) -> &'static [&'static str] { $generated_type_prefixes } )?
1677 $( fn provided_dependencies(&self) -> Vec<ProvidedDependencyRule> { $provided_dependencies } )?
1678
1679 $(
1680 fn package_json_config_key(&self) -> Option<&'static str> {
1681 Some($pkg_key)
1682 }
1683 )?
1684
1685 $(
1686 fn used_exports(&self) -> Vec<(&'static str, &'static [&'static str])> {
1687 vec![$( ($pat, $exports) ),*]
1688 }
1689 )?
1690
1691 $( fn script_config_binaries(&self) -> &'static [&'static str] { $script_binaries } )?
1692
1693 fn resolve_config(
1694 &self,
1695 $cp: &std::path::Path,
1696 $src: &str,
1697 $root: &std::path::Path,
1698 ) -> PluginResult
1699 $body
1700
1701 $(
1702 fn resolve_config_in_project(
1703 &self,
1704 $pcp: &std::path::Path,
1705 $psrc: &str,
1706 $proot: &std::path::Path,
1707 $pproj: &std::path::Path,
1708 ) -> PluginResult
1709 $pbody
1710 )?
1711 }
1712 };
1713
1714 (
1715 struct $name:ident => $display:expr,
1716 enablers: $enablers:expr
1717 $(, entry_patterns: $entry:expr)?
1718 $(, config_patterns: $config:expr)?
1719 $(, config_default_export_opt_out: $config_opt_out:expr)?
1720 $(, config_file_exports: $config_exports:expr)?
1721 $(, always_used: $always:expr)?
1722 $(, tooling_dependencies: $tooling:expr)?
1723 $(, fixture_glob_patterns: $fixtures:expr)?
1724 $(, discovery_hidden_dirs: $hidden_dirs:expr)?
1725 $(, virtual_module_prefixes: $virtual:expr)?
1726 $(, virtual_package_suffixes: $virtual_suffixes:expr)?
1727 $(, generated_type_import_prefixes: $generated_type_prefixes:expr)?
1728 $(, provided_dependencies: $provided_dependencies:expr)?
1729 $(, package_json_config_key: $pkg_key:expr)?
1730 $(, used_exports: [$( ($pat:expr, $exports:expr) ),* $(,)?])?
1731 $(,)?
1732 ) => {
1733 pub struct $name;
1734
1735 impl Plugin for $name {
1736 fn name(&self) -> &'static str {
1737 $display
1738 }
1739
1740 fn enablers(&self) -> &'static [&'static str] {
1741 $enablers
1742 }
1743
1744 $( fn entry_patterns(&self) -> &'static [&'static str] { $entry } )?
1745 $( fn config_patterns(&self) -> &'static [&'static str] { $config } )?
1746 $( fn config_default_export_opt_out(&self) -> &'static [&'static str] { $config_opt_out } )?
1747 $( fn config_file_exports(&self) -> &'static [(&'static str, &'static [&'static str])] { $config_exports } )?
1748 $( fn always_used(&self) -> &'static [&'static str] { $always } )?
1749 $( fn tooling_dependencies(&self) -> &'static [&'static str] { $tooling } )?
1750 $( fn fixture_glob_patterns(&self) -> &'static [&'static str] { $fixtures } )?
1751 $( fn discovery_hidden_dirs(&self) -> &'static [&'static str] { $hidden_dirs } )?
1752 $( fn virtual_module_prefixes(&self) -> &'static [&'static str] { $virtual } )?
1753 $( fn virtual_package_suffixes(&self) -> &'static [&'static str] { $virtual_suffixes } )?
1754 $( fn generated_type_import_prefixes(&self) -> &'static [&'static str] { $generated_type_prefixes } )?
1755 $( fn provided_dependencies(&self) -> Vec<ProvidedDependencyRule> { $provided_dependencies } )?
1756
1757 $(
1758 fn package_json_config_key(&self) -> Option<&'static str> {
1759 Some($pkg_key)
1760 }
1761 )?
1762
1763 $(
1764 fn used_exports(&self) -> Vec<(&'static str, &'static [&'static str])> {
1765 vec![$( ($pat, $exports) ),*]
1766 }
1767 )?
1768 }
1769 };
1770}
1771
1772mod config_dependencies;
1773pub mod config_parser;
1774mod config_value_credits;
1775mod federation_source;
1776use config_value_credits::{
1777 canonical_test_environment, credit_config_value, credit_environment_optional_peers,
1778};
1779mod flue;
1780mod jasmine;
1781mod manifest;
1782mod module_request;
1783use module_request::{has_glob_syntax, has_source_extension, module_request, names_project_file};
1784pub mod manifest_entries;
1785mod mise;
1786mod osls;
1787mod path_rule_index;
1788mod project_glob;
1789mod railway;
1790pub mod registry;
1791mod rstest;
1792mod serverless_framework;
1793mod textlint;
1794mod tooling;
1795pub(crate) mod trace_provenance;
1796mod used_export_names;
1797mod used_export_rule;
1798
1799pub use config_dependencies::RequiredDependency;
1800use config_dependencies::add_import_referenced_dependencies;
1801pub use federation_source::{FederationSource, FederationSourceTarget};
1802pub(crate) use module_federation::runtime_remotes;
1803pub(crate) use path_rule_index::PathRuleIndex;
1804pub(crate) use registry::module_specifiers;
1805pub use registry::{
1806 AggregatedPluginResult, CheckedAliasPrefix, PluginRegistry, PluginToolingDependencies,
1807 PluginToolingEvidence, VirtualModuleMatch, VirtualModuleProviderRule,
1808};
1809pub use tooling::types_package_target;
1810pub(crate) use tooling::{
1811 cli_tooling_config_patterns, is_ambient_types_package, is_known_tooling_dependency,
1812};
1813pub use trace_provenance::ExportCredits;
1814pub use used_export_names::UsedExportNames;
1815pub(crate) use used_export_rule::{ConfigExportCredit, is_export_ignored};
1816pub use used_export_rule::{PluginUsedExportRule, UsedExportRule};
1817
1818mod adonis;
1819mod ag_ui;
1820mod alchemy;
1821mod alias_replacement;
1822mod angular;
1823mod astro;
1824mod ava;
1825mod babel;
1826mod biome;
1827mod browser_extension;
1828mod bun;
1829mod c8;
1830mod capacitor;
1831mod changesets;
1832mod coderabbit;
1833mod commit_and_tag_version;
1834mod commitizen;
1835mod commitlint;
1836mod content_collections;
1837mod contentlayer;
1838mod convex;
1839mod cspell;
1840mod cucumber;
1841mod cypress;
1842mod danger;
1843mod deno;
1844mod dependency_cruiser;
1845mod docusaurus;
1846mod dotenv;
1847mod drizzle;
1848mod dumi;
1849mod egg;
1850mod electron;
1851mod ember;
1852mod entry_point_roles;
1853mod eslint;
1854mod eve;
1855mod expo;
1856mod expo_packages;
1857mod expo_router;
1858mod extends_walk;
1859mod firebase;
1860mod fumadocs;
1861mod gatsby;
1862mod github_action;
1863mod gnome_shell_extension;
1864mod graphql_codegen;
1865mod graphql_config;
1866mod gulp;
1867mod hardhat;
1868mod husky;
1869mod i18next;
1870mod ionic;
1871mod jest;
1872mod k6;
1873mod karma;
1874mod kibana;
1875mod knex;
1876mod kysely;
1877mod lefthook;
1878mod lexical;
1879mod lint_staged;
1880mod lit;
1881mod markdownlint;
1882mod mintlify;
1883mod mkdocs;
1884mod mocha;
1885mod module_federation;
1886mod msw;
1887mod n8n;
1888mod napi_rs;
1889mod nest_commander;
1890mod nestjs;
1891mod nestjs_trpc;
1892mod next_intl;
1893mod nextjs;
1894mod nitro;
1895mod nodemon;
1896pub(crate) mod nuxt;
1897mod nx;
1898mod nyc;
1899mod obsidian;
1900mod openapi_ts;
1901mod opencode;
1902mod opennext_cloudflare;
1903mod opentelemetry;
1904mod oxfmt;
1905mod oxlint;
1906mod pandacss;
1907mod parcel;
1908mod pinia;
1909mod pkg_utils;
1910mod playwright;
1911mod plop;
1912mod pm2;
1913mod pnpm;
1914mod postcss;
1915mod prettier;
1916mod prisma;
1917mod qwik;
1918mod react_compiler;
1919mod react_native;
1920pub(crate) mod react_router;
1921mod redwoodsdk;
1922mod relay;
1923mod release_it;
1924mod remark;
1925mod remix;
1926mod rolldown;
1927mod rollup;
1928mod rsbuild;
1929mod rspack;
1930mod rspress;
1931mod sanity;
1932mod semantic_release;
1933mod sentry;
1934mod simple_git_hooks;
1935mod size_limit;
1936mod solid_start;
1937mod storybook;
1938mod stryker;
1939mod stylelint;
1940mod supabase;
1941mod sveltekit;
1942mod svgo;
1943mod svgr;
1944mod swc;
1945mod syncpack;
1946mod tailwind;
1947mod tanstack_router;
1948mod tap;
1949mod test_alias;
1950#[cfg(test)]
1951mod tests;
1952mod tsd;
1953mod tsdown;
1954mod tsup;
1955mod turborepo;
1956mod typedoc;
1957mod typeorm;
1958mod typescript;
1959mod typescript_content_mapper;
1960mod unocss;
1961pub(crate) mod unplugin_icons;
1962mod varlock;
1963mod velite;
1964mod vercel;
1965mod vite;
1966mod vite_plugin_pages;
1967pub(crate) mod vite_plus;
1968mod vite_pwa_assets_generator;
1969mod vitepress;
1970mod vitest;
1971mod vscode;
1972mod waku;
1973mod webdriverio;
1974mod webpack;
1975mod wrangler;
1976mod wuchale;
1977mod wxt;