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 web_server_app_dirs: Vec<PathBuf>,
222}
223
224#[must_use]
232fn federation_trace_provenance(
233 root: &Path,
234 files: &[crate::discover::DiscoveredFile],
235 sources: &[FederationSource],
236 modules: &[crate::extract::ModuleInfo],
237) -> fallow_types::trace::TraceProvenance {
238 let mut provenance = fallow_types::trace::TraceProvenance::default();
239 push_runtime_remote_sources(&mut provenance, root, files, modules);
240 if sources.is_empty() {
241 return provenance;
242 }
243 let mut exposed = Vec::new();
244 for source in sources {
245 let config = source
246 .config_path
247 .strip_prefix(root)
248 .unwrap_or(&source.config_path)
249 .to_path_buf();
250 let trace_source = fallow_types::trace::TraceSource {
251 kind: "module-federation".to_owned(),
252 plugin: source.plugin.clone(),
253 config,
254 key: source.key.to_owned(),
255 };
256 match &source.target {
257 FederationSourceTarget::Exposed(rule) => {
258 if let Some(compiled) =
259 CompiledPathRule::for_entry_rule(rule, "Module Federation exposes target")
260 {
261 exposed.push((compiled, trace_source));
262 }
263 }
264 FederationSourceTarget::Remote(alias) => {
265 provenance.push_dependency(alias.clone(), trace_source);
266 }
267 }
268 }
269 if exposed.is_empty() {
270 return provenance;
271 }
272 for file in files {
273 let Ok(relative) = file.path.strip_prefix(root) else {
274 continue;
275 };
276 let relative_str = relative.to_string_lossy().replace('\\', "/");
277 for (rule, source) in &exposed {
278 if rule.matches(&relative_str) {
279 provenance.push_file(relative.to_path_buf(), source.clone());
280 }
281 }
282 }
283 provenance
284}
285
286const CONFIG_ONLY_EXPORT_NAMES: &[&str] = &[
295 "dynamic",
296 "dynamicParams",
297 "revalidate",
298 "fetchCache",
299 "runtime",
300 "preferredRegion",
301 "maxDuration",
302 "prerender",
303 "config",
304 "metadata",
305 "viewport",
306];
307
308fn push_tooling_trace_credits(
312 provenance: &mut fallow_types::trace::TraceProvenance,
313 root: &Path,
314 workspaces: &[fallow_config::WorkspaceInfo],
315 plugin_result: &AggregatedPluginResult,
316) {
317 for entry in &plugin_result.plugin_tooling {
318 let Some(evidence) = entry.evidence(&plugin_result.script_used_packages) else {
319 continue;
320 };
321 let credit = match evidence {
322 PluginToolingEvidence::OwnConfig(config) => fallow_types::trace::ToolingCredit {
323 reason: "plugin-config".to_owned(),
324 plugin: Some(entry.plugin.clone()),
325 config: Some(config.strip_prefix(root).unwrap_or(config).to_path_buf()),
326 reference: None,
327 },
328 PluginToolingEvidence::Reference(name) => fallow_types::trace::ToolingCredit {
329 reason: "plugin-reference".to_owned(),
330 plugin: Some(entry.plugin.clone()),
331 config: None,
332 reference: Some(name.to_owned()),
333 },
334 };
335 for dependency in &entry.dependencies {
336 provenance.push_tooling_credit(dependency.clone(), credit.clone());
337 }
338 }
339 push_types_trace_credits(provenance, plugin_result);
340 push_catalogue_trace_credits(provenance, root, workspaces, plugin_result);
341}
342
343fn push_catalogue_trace_credits(
353 provenance: &mut fallow_types::trace::TraceProvenance,
354 root: &Path,
355 workspaces: &[fallow_config::WorkspaceInfo],
356 plugin_result: &AggregatedPluginResult,
357) {
358 let manifests = read_trace_manifests(root, workspaces);
359 let mut names: Vec<&String> = plugin_result.dev_dependency_names.iter().collect();
360 names.sort_unstable();
361 for name in names {
362 let declaring: Vec<&(PathBuf, serde_json::Value)> = manifests
363 .iter()
364 .filter(|(_, manifest)| manifest_lists(manifest, "devDependencies", name))
365 .collect();
366 if let Some(credit) = catalogue_credit(name, root, &declaring) {
367 provenance.push_tooling_credit(name.clone(), credit);
368 }
369 if let Some((path, _)) = declaring
370 .iter()
371 .find(|(_, manifest)| manifest_lists(manifest, "peerDependencies", name))
372 {
373 provenance.push_tooling_credit(
374 name.clone(),
375 fallow_types::trace::ToolingCredit {
376 reason: "own-peer".to_owned(),
377 plugin: None,
378 config: Some(path.strip_prefix(root).unwrap_or(path).to_path_buf()),
379 reference: None,
380 },
381 );
382 }
383 }
384}
385
386fn read_trace_manifests(
388 root: &Path,
389 workspaces: &[fallow_config::WorkspaceInfo],
390) -> Vec<(PathBuf, serde_json::Value)> {
391 std::iter::once(root)
392 .chain(
393 workspaces
394 .iter()
395 .map(|ws| ws.root.as_path())
396 .filter(|ws_root| *ws_root != root),
397 )
398 .filter_map(|package_root| {
399 let path = package_root.join("package.json");
400 let content = crate::discover::project_read::read_project_file(root, &path)?;
401 serde_json::from_str(&content)
402 .ok()
403 .map(|value| (path, value))
404 })
405 .collect()
406}
407
408fn manifest_lists(manifest: &serde_json::Value, section: &str, name: &str) -> bool {
409 manifest
410 .get(section)
411 .and_then(serde_json::Value::as_object)
412 .is_some_and(|deps| deps.contains_key(name))
413}
414
415fn catalogue_credit(
418 name: &str,
419 root: &Path,
420 declaring: &[&(PathBuf, serde_json::Value)],
421) -> Option<fallow_types::trace::ToolingCredit> {
422 if is_ambient_types_package(name) || types_package_target(name).is_some() {
423 return None;
424 }
425 let Some(patterns) = cli_tooling_config_patterns(name) else {
426 return is_known_tooling_dependency(name).then(|| fallow_types::trace::ToolingCredit {
427 reason: "known-tooling".to_owned(),
428 plugin: None,
429 config: None,
430 reference: None,
431 });
432 };
433 let config = declaring.iter().find_map(|(path, manifest)| {
434 crate::analyze::cli_tool_own_config(name, patterns, root, path, Some(manifest))
435 })?;
436 Some(fallow_types::trace::ToolingCredit {
437 reason: "known-tooling-config".to_owned(),
438 plugin: None,
439 config: Some(config.strip_prefix(root).unwrap_or(&config).to_path_buf()),
440 reference: None,
441 })
442}
443
444fn push_types_trace_credits(
449 provenance: &mut fallow_types::trace::TraceProvenance,
450 plugin_result: &AggregatedPluginResult,
451) {
452 let declared = plugin_result.dependency_binaries.declared_packages();
453 let mut names: Vec<&String> = plugin_result.dev_dependency_names.iter().collect();
454 names.sort_unstable();
455 for name in names {
456 let credit = if is_ambient_types_package(name) {
457 fallow_types::trace::ToolingCredit {
458 reason: "ambient-types".to_owned(),
459 plugin: None,
460 config: None,
461 reference: None,
462 }
463 } else if let Some(target) = types_package_target(name) {
464 if declared.contains(&target) {
465 fallow_types::trace::ToolingCredit {
466 reason: "types-target".to_owned(),
467 plugin: None,
468 config: None,
469 reference: Some(target),
470 }
471 } else if plugin_result.referenced_dependencies.contains(name) {
472 fallow_types::trace::ToolingCredit {
473 reason: "types-config".to_owned(),
474 plugin: None,
475 config: None,
476 reference: None,
477 }
478 } else {
479 continue;
480 }
481 } else {
482 continue;
483 };
484 provenance.push_tooling_credit(name.clone(), credit);
485 }
486}
487
488fn push_runtime_remote_sources(
490 provenance: &mut fallow_types::trace::TraceProvenance,
491 root: &Path,
492 files: &[crate::discover::DiscoveredFile],
493 modules: &[crate::extract::ModuleInfo],
494) {
495 for module in modules {
496 let mut file = None;
497 for fact in module.semantic_facts.iter() {
498 let fallow_types::extract::SemanticFact::FederationRuntimeRemote(fact) = fact else {
499 continue;
500 };
501 let Some(remote) = &fact.remote else {
502 continue;
503 };
504 let Some(path) = file.get_or_insert_with(|| {
505 files.get(module.file_id.0 as usize).map(|file| {
506 file.path
507 .strip_prefix(root)
508 .unwrap_or(&file.path)
509 .to_path_buf()
510 })
511 }) else {
512 break;
513 };
514 provenance.push_dependency(
515 remote.clone(),
516 fallow_types::trace::TraceSource {
517 kind: "module-federation".to_owned(),
518 plugin: "module-federation".to_owned(),
519 config: path.clone(),
520 key: fact.call.name().to_owned(),
521 },
522 );
523 }
524 }
525}
526
527impl PluginResult {
528 fn extend_config_dir_entry_patterns(
533 &mut self,
534 values: Vec<String>,
535 config_path: &Path,
536 root: &Path,
537 ) {
538 let (negated, positive): (Vec<String>, Vec<String>) =
539 values.into_iter().partition(|value| value.starts_with('!'));
540 let excluded: Vec<String> = negated
541 .iter()
542 .filter_map(|value| value.strip_prefix('!'))
543 .filter_map(|value| config_parser::normalize_config_path(value, config_path, root))
544 .collect();
545 self.entry_patterns.extend(
546 positive
547 .iter()
548 .filter_map(|value| config_parser::normalize_config_path(value, config_path, root))
549 .map(|pattern| {
550 PathRule::new(pattern).with_excluded_globs(excluded.iter().cloned())
551 }),
552 );
553 }
554
555 fn push_parent_relative_entry_pattern(&mut self, pattern: String) {
558 let mut rule = PathRule::new(pattern);
559 rule.parent_relative = true;
560 self.entry_patterns.push(rule);
561 }
562
563 fn push_entry_pattern(&mut self, pattern: impl Into<String>) {
564 self.entry_patterns
565 .push(PathRule::new(normalize_entry_pattern(pattern.into())));
566 }
567
568 fn extend_entry_patterns<I, S>(&mut self, patterns: I)
569 where
570 I: IntoIterator<Item = S>,
571 S: Into<String>,
572 {
573 self.entry_patterns.extend(
574 patterns
575 .into_iter()
576 .map(|pat| PathRule::new(normalize_entry_pattern(pat.into()))),
577 );
578 }
579
580 fn extend_entry_patterns_or_dependencies<I, S>(
595 &mut self,
596 values: I,
597 resolve_path: impl Fn(String) -> String,
598 ) where
599 I: IntoIterator<Item = S>,
600 S: Into<String>,
601 {
602 for value in values {
603 let value = value.into();
604 if let Some(request) = module_request(&value) {
605 self.referenced_dependencies
606 .push(crate::resolve::extract_package_name(request));
607 continue;
608 }
609 self.push_entry_path(resolve_path(value));
610 }
611 }
612
613 fn extend_entry_patterns_and_dependencies<I, S>(&mut self, values: I, root: &Path)
625 where
626 I: IntoIterator<Item = S>,
627 S: Into<String>,
628 {
629 for value in values {
630 let value = value.into();
631 if let Some(request) = module_request(&value)
632 && !names_project_file(root, request)
633 {
634 self.referenced_dependencies
635 .push(crate::resolve::extract_package_name(request));
636 }
637 self.push_entry_path(value);
638 }
639 }
640
641 fn extend_entry_paths<I, S>(&mut self, values: I)
643 where
644 I: IntoIterator<Item = S>,
645 S: Into<String>,
646 {
647 for value in values {
648 self.push_entry_path(value.into());
649 }
650 }
651
652 fn push_entry_path(&mut self, value: String) {
660 if has_glob_syntax(&value) || has_source_extension(&value) {
661 self.push_entry_pattern(value);
662 return;
663 }
664 let base = value.trim_end_matches('/').to_owned();
665 self.push_entry_pattern(value);
666 self.push_entry_pattern(format!("{base}.{REQUEST_EXTENSIONS}"));
667 self.push_entry_pattern(format!("{base}/index.{REQUEST_EXTENSIONS}"));
668 }
669
670 fn push_checked_path_alias(&mut self, prefix: String, replacement: String) {
674 self.checked_alias_prefixes.push(prefix.clone());
675 self.path_aliases.push((prefix, replacement));
676 }
677
678 #[must_use]
685 const fn is_empty(&self) -> bool {
686 self.config_diagnostics.is_empty() && self.has_no_credits() && self.has_no_paths()
687 }
688
689 const fn has_no_credits(&self) -> bool {
691 self.entry_patterns.is_empty()
692 && self.used_exports.is_empty()
693 && self.entry_export_credits.is_empty()
694 && self.used_class_members.is_empty()
695 && self.referenced_dependencies.is_empty()
696 && self.package_referenced_dependencies.is_empty()
697 && self.required_dependencies.is_empty()
698 && self.provided_dependencies.is_empty()
699 && self.jsx_import_sources.is_empty()
700 && self.jsx_package_credits.is_empty()
701 }
702
703 const fn has_no_paths(&self) -> bool {
705 self.always_used_files.is_empty()
706 && self.path_aliases.is_empty()
707 && self.setup_files.is_empty()
708 && self.fixture_patterns.is_empty()
709 && self.scss_include_paths.is_empty()
710 && self.static_dir_mappings.is_empty()
711 && self.framework_static_dir_mappings.is_empty()
712 && self.federation_sources.is_empty()
713 && self.tsconfig_jsx_dirs.is_empty()
714 && self.web_server_app_dirs.is_empty()
715 }
716}
717
718const REQUEST_EXTENSIONS: &str = "{ts,tsx,mts,cts,gts,js,jsx,mjs,cjs,gjs,vue,svelte,astro,mdx}";
722
723fn normalize_entry_pattern(pattern: String) -> String {
724 pattern
725 .strip_prefix("./")
726 .map(str::to_owned)
727 .unwrap_or(pattern)
728}
729
730#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)]
736pub struct PathRule {
737 pub pattern: String,
738 pub exclude_globs: Vec<String>,
739 pub exclude_regexes: Vec<String>,
740 pub exclude_segment_regexes: Vec<String>,
744 pub parent_relative: bool,
751 pub package_relative: bool,
755}
756
757impl PathRule {
758 #[must_use]
759 pub(crate) fn new(pattern: impl Into<String>) -> Self {
760 Self {
761 pattern: pattern.into(),
762 exclude_globs: Vec::new(),
763 exclude_regexes: Vec::new(),
764 exclude_segment_regexes: Vec::new(),
765 parent_relative: false,
766 package_relative: false,
767 }
768 }
769
770 #[must_use]
771 fn from_static(pattern: &'static str) -> Self {
772 Self::new(pattern)
773 }
774
775 #[must_use]
779 fn from_extglob(pattern: &str) -> Self {
780 let rewritten = fallow_config::extglob::rewrite_include(pattern);
781 Self::new(rewritten.include).with_excluded_globs(rewritten.excludes)
782 }
783
784 #[must_use]
788 fn with_excluded_extglobs<I, S>(self, patterns: I) -> Self
789 where
790 I: IntoIterator<Item = S>,
791 S: AsRef<str>,
792 {
793 let excluded: Vec<String> = patterns
794 .into_iter()
795 .filter_map(|pattern| fallow_config::extglob::rewrite_exclude(pattern.as_ref()))
796 .collect();
797 self.with_excluded_globs(excluded)
798 }
799
800 #[must_use]
801 pub(crate) fn with_excluded_globs<I, S>(mut self, patterns: I) -> Self
802 where
803 I: IntoIterator<Item = S>,
804 S: Into<String>,
805 {
806 self.exclude_globs
807 .extend(patterns.into_iter().map(Into::into));
808 self
809 }
810
811 #[must_use]
812 fn with_excluded_regexes<I, S>(mut self, patterns: I) -> Self
813 where
814 I: IntoIterator<Item = S>,
815 S: Into<String>,
816 {
817 self.exclude_regexes
818 .extend(patterns.into_iter().map(Into::into));
819 self
820 }
821
822 #[must_use]
823 fn with_excluded_segment_regexes<I, S>(mut self, patterns: I) -> Self
824 where
825 I: IntoIterator<Item = S>,
826 S: Into<String>,
827 {
828 self.exclude_segment_regexes
829 .extend(patterns.into_iter().map(Into::into));
830 self
831 }
832
833 #[must_use]
834 fn prefixed(&self, ws_prefix: &str) -> Self {
835 let prefix = |pattern: &str| {
836 if self.parent_relative && pattern.starts_with("../") {
837 resolve_parent_relative_pattern(pattern, ws_prefix)
838 } else if self.package_relative {
839 format!("{ws_prefix}/{pattern}")
840 } else {
841 prefix_workspace_pattern(pattern, ws_prefix)
842 }
843 };
844 Self {
845 pattern: prefix(&self.pattern),
846 exclude_globs: self
847 .exclude_globs
848 .iter()
849 .map(|pattern| prefix(pattern))
850 .collect(),
851 exclude_regexes: self
852 .exclude_regexes
853 .iter()
854 .map(|pattern| prefix_workspace_regex(pattern, ws_prefix))
855 .collect(),
856 exclude_segment_regexes: self.exclude_segment_regexes.clone(),
857 parent_relative: false,
858 package_relative: false,
859 }
860 }
861}
862
863#[derive(Debug, Clone, Default, PartialEq, Eq)]
865pub struct ProvidedDependencyRule {
866 pub(crate) path: PathRule,
867 exact_specifiers: Vec<String>,
868 specifier_prefixes: Vec<String>,
869}
870
871impl ProvidedDependencyRule {
872 #[must_use]
873 fn new(
874 pattern: impl Into<String>,
875 exact_specifiers: impl IntoIterator<Item = impl Into<String>>,
876 specifier_prefixes: impl IntoIterator<Item = impl Into<String>>,
877 ) -> Self {
878 Self {
879 path: PathRule::new(pattern),
880 exact_specifiers: exact_specifiers.into_iter().map(Into::into).collect(),
881 specifier_prefixes: specifier_prefixes.into_iter().map(Into::into).collect(),
882 }
883 }
884
885 #[must_use]
886 fn prefixed(&self, ws_prefix: &str) -> Self {
887 Self {
888 path: self.path.prefixed(ws_prefix),
889 exact_specifiers: self.exact_specifiers.clone(),
890 specifier_prefixes: self.specifier_prefixes.clone(),
891 }
892 }
893
894 #[must_use]
895 pub(crate) fn may_cover_package(&self, package_name: &str) -> bool {
896 self.exact_specifiers
897 .iter()
898 .chain(self.specifier_prefixes.iter())
899 .any(|specifier| crate::resolve::extract_package_name(specifier) == package_name)
900 }
901
902 #[must_use]
903 pub(crate) fn covers_specifier(&self, specifier: &str) -> bool {
904 self.exact_specifiers
905 .iter()
906 .any(|allowed| allowed == specifier)
907 || self
908 .specifier_prefixes
909 .iter()
910 .any(|prefix| specifier.starts_with(prefix))
911 }
912}
913
914pub(crate) fn entry_rule_glob(pattern: &str) -> Result<globset::Glob, globset::Error> {
918 globset::GlobBuilder::new(pattern)
919 .literal_separator(true)
920 .empty_alternates(true)
921 .build()
922}
923
924#[derive(Debug, Clone)]
929pub(crate) struct CompiledPathRule {
930 include: globset::GlobMatcher,
931 exclude_globs: Vec<globset::GlobMatcher>,
932 exclude_regexes: Vec<Regex>,
933 exclude_segment_regexes: Vec<Regex>,
934}
935
936impl CompiledPathRule {
937 pub(crate) fn for_entry_rule(rule: &PathRule, rule_kind: &str) -> Option<Self> {
938 let include = match entry_rule_glob(&rule.pattern) {
939 Ok(glob) => glob.compile_matcher(),
940 Err(err) => {
941 tracing::warn!("invalid {rule_kind} '{}': {err}", rule.pattern);
942 return None;
943 }
944 };
945 Some(Self {
946 include,
947 exclude_globs: compile_excluded_globs(&rule.exclude_globs, rule_kind, &rule.pattern),
948 exclude_regexes: compile_excluded_regexes(
949 &rule.exclude_regexes,
950 rule_kind,
951 &rule.pattern,
952 ),
953 exclude_segment_regexes: compile_excluded_segment_regexes(
954 &rule.exclude_segment_regexes,
955 rule_kind,
956 &rule.pattern,
957 ),
958 })
959 }
960
961 pub(crate) fn for_used_export_rule(rule: &PathRule, rule_kind: &str) -> Option<Self> {
962 Self::for_entry_rule(rule, rule_kind)
963 }
964
965 #[must_use]
966 pub(crate) fn matches(&self, path: &str) -> bool {
967 self.include.is_match(path)
968 && !self.exclude_globs.iter().any(|glob| glob.is_match(path))
969 && !self
970 .exclude_regexes
971 .iter()
972 .any(|regex| regex.is_match(path))
973 && !matches_segment_regex(path, &self.exclude_segment_regexes)
974 }
975}
976
977fn prefix_workspace_pattern(pattern: &str, ws_prefix: &str) -> String {
978 if pattern.starts_with(ws_prefix) || pattern.starts_with('/') {
979 pattern.to_string()
980 } else {
981 format!("{ws_prefix}/{pattern}")
982 }
983}
984
985fn resolve_parent_relative_pattern(pattern: &str, ws_prefix: &str) -> String {
991 if ws_prefix.starts_with('/') || Path::new(ws_prefix).is_absolute() {
992 return pattern.to_string();
993 }
994 let mut base: Vec<&str> = ws_prefix
997 .split(['/', '\\'])
998 .filter(|segment| !segment.is_empty())
999 .collect();
1000 let mut rest = pattern;
1001 while let Some(stripped) = rest.strip_prefix("../") {
1002 if base.pop().is_none() {
1003 return pattern.to_string();
1004 }
1005 rest = stripped;
1006 }
1007 if base.is_empty() {
1008 rest.to_string()
1009 } else {
1010 format!("{}/{rest}", base.join("/"))
1011 }
1012}
1013
1014fn prefix_workspace_regex(pattern: &str, ws_prefix: &str) -> String {
1015 if let Some(pattern) = pattern.strip_prefix('^') {
1016 format!("^{}/{}", regex::escape(ws_prefix), pattern)
1017 } else {
1018 format!("^{}/(?:{})", regex::escape(ws_prefix), pattern)
1019 }
1020}
1021
1022fn compile_excluded_globs(
1023 patterns: &[String],
1024 rule_kind: &str,
1025 rule_pattern: &str,
1026) -> Vec<globset::GlobMatcher> {
1027 patterns
1028 .iter()
1029 .filter_map(|pattern| {
1030 match globset::GlobBuilder::new(pattern)
1031 .literal_separator(true)
1032 .empty_alternates(true)
1033 .build()
1034 {
1035 Ok(glob) => Some(glob.compile_matcher()),
1036 Err(err) => {
1037 tracing::warn!(
1038 "skipping invalid excluded glob '{}' for {} '{}': {err}",
1039 pattern,
1040 rule_kind,
1041 rule_pattern
1042 );
1043 None
1044 }
1045 }
1046 })
1047 .collect()
1048}
1049
1050fn compile_excluded_regexes(
1051 patterns: &[String],
1052 rule_kind: &str,
1053 rule_pattern: &str,
1054) -> Vec<Regex> {
1055 patterns
1056 .iter()
1057 .filter_map(|pattern| match Regex::new(pattern) {
1058 Ok(regex) => Some(regex),
1059 Err(err) => {
1060 tracing::warn!(
1061 "skipping invalid excluded regex '{}' for {} '{}': {err}",
1062 pattern,
1063 rule_kind,
1064 rule_pattern
1065 );
1066 None
1067 }
1068 })
1069 .collect()
1070}
1071
1072fn compile_excluded_segment_regexes(
1073 patterns: &[String],
1074 rule_kind: &str,
1075 rule_pattern: &str,
1076) -> Vec<Regex> {
1077 patterns
1078 .iter()
1079 .filter_map(|pattern| match Regex::new(pattern) {
1080 Ok(regex) => Some(regex),
1081 Err(err) => {
1082 tracing::warn!(
1083 "skipping invalid excluded segment regex '{}' for {} '{}': {err}",
1084 pattern,
1085 rule_kind,
1086 rule_pattern
1087 );
1088 None
1089 }
1090 })
1091 .collect()
1092}
1093
1094fn matches_segment_regex(path: &str, regexes: &[Regex]) -> bool {
1097 path.split(std::path::is_separator)
1098 .any(|segment| regexes.iter().any(|regex| regex.is_match(segment)))
1099}
1100
1101impl From<String> for PathRule {
1102 fn from(pattern: String) -> Self {
1103 Self::new(pattern)
1104 }
1105}
1106
1107impl From<&str> for PathRule {
1108 fn from(pattern: &str) -> Self {
1109 Self::new(pattern)
1110 }
1111}
1112
1113impl std::ops::Deref for PathRule {
1114 type Target = str;
1115
1116 fn deref(&self) -> &Self::Target {
1117 &self.pattern
1118 }
1119}
1120
1121impl PartialEq<&str> for PathRule {
1122 fn eq(&self, other: &&str) -> bool {
1123 self.pattern == *other
1124 }
1125}
1126
1127impl PartialEq<str> for PathRule {
1128 fn eq(&self, other: &str) -> bool {
1129 self.pattern == other
1130 }
1131}
1132
1133impl PartialEq<String> for PathRule {
1134 fn eq(&self, other: &String) -> bool {
1135 &self.pattern == other
1136 }
1137}
1138
1139pub trait Plugin: Send + Sync {
1141 fn name(&self) -> &'static str;
1143
1144 fn enablers(&self) -> &'static [&'static str] {
1147 &[]
1148 }
1149
1150 fn is_enabled(&self, pkg: &PackageJson, root: &Path) -> bool {
1152 let deps = pkg.all_dependency_names();
1153 self.is_enabled_with_deps(&deps, root)
1154 }
1155
1156 fn is_enabled_with_deps(&self, deps: &[String], _root: &Path) -> bool {
1159 let enablers = self.enablers();
1160 if enablers.is_empty() {
1161 return false;
1162 }
1163 enablers.iter().any(|enabler| {
1164 if enabler.ends_with('/') {
1165 deps.iter().any(|d| d.starts_with(enabler))
1167 } else {
1168 deps.iter().any(|d| d == enabler)
1169 }
1170 })
1171 }
1172
1173 fn is_enabled_with_files(
1186 &self,
1187 deps: &[String],
1188 root: &Path,
1189 _discovered_files: &[PathBuf],
1190 _candidate_index: Option<®istry::ConfigCandidateIndex>,
1191 ) -> bool {
1192 self.is_enabled_with_deps(deps, root)
1193 }
1194
1195 fn script_enablers(&self) -> &'static [&'static str] {
1197 &[]
1198 }
1199
1200 fn is_enabled_with_scripts(
1202 &self,
1203 script_packages: &rustc_hash::FxHashSet<String>,
1204 _root: &Path,
1205 ) -> bool {
1206 let enablers = self.script_enablers();
1207 if enablers.is_empty() {
1208 return false;
1209 }
1210 enablers.iter().any(|enabler| {
1211 if enabler.ends_with('/') {
1212 script_packages
1213 .iter()
1214 .any(|package| package.starts_with(enabler))
1215 } else {
1216 script_packages.contains(*enabler)
1217 }
1218 })
1219 }
1220
1221 fn entry_patterns(&self) -> &'static [&'static str] {
1223 &[]
1224 }
1225
1226 fn entry_pattern_rules(&self) -> Vec<PathRule> {
1228 self.entry_patterns()
1229 .iter()
1230 .map(|pattern| PathRule::from_static(pattern))
1231 .collect()
1232 }
1233
1234 fn entry_point_role(&self) -> EntryPointRole {
1239 builtin_entry_point_role(self.name())
1240 }
1241
1242 fn config_patterns(&self) -> &'static [&'static str] {
1244 &[]
1245 }
1246
1247 fn config_default_export_opt_out(&self) -> &'static [&'static str] {
1256 &[]
1257 }
1258
1259 fn config_file_exports(&self) -> &'static [(&'static str, &'static [&'static str])] {
1268 &[]
1269 }
1270
1271 fn always_used(&self) -> &'static [&'static str] {
1273 &[]
1274 }
1275
1276 fn used_exports(&self) -> Vec<(&'static str, &'static [&'static str])> {
1278 vec![]
1279 }
1280
1281 fn used_export_rules(&self) -> Vec<UsedExportRule> {
1283 self.used_exports()
1284 .into_iter()
1285 .map(|(pattern, exports)| UsedExportRule::from_static(pattern, exports))
1286 .collect()
1287 }
1288
1289 fn used_class_members(&self) -> &'static [&'static str] {
1294 &[]
1295 }
1296
1297 fn used_class_member_rules(&self) -> Vec<UsedClassMemberRule> {
1305 Vec::new()
1306 }
1307
1308 fn framework_class_member_contracts(&self) -> Vec<SemanticFrameworkContract> {
1311 Vec::new()
1312 }
1313
1314 fn fixture_glob_patterns(&self) -> &'static [&'static str] {
1319 &[]
1320 }
1321
1322 fn discovery_hidden_dirs(&self) -> &'static [&'static str] {
1327 &[]
1328 }
1329
1330 fn tooling_dependencies(&self) -> &'static [&'static str] {
1333 &[]
1334 }
1335
1336 fn virtual_module_prefixes(&self) -> &'static [&'static str] {
1341 &[]
1342 }
1343
1344 fn virtual_package_suffixes(&self) -> &'static [&'static str] {
1350 &[]
1351 }
1352
1353 fn generated_import_patterns(&self) -> &'static [&'static str] {
1359 &[]
1360 }
1361
1362 fn generated_type_import_prefixes(&self) -> &'static [&'static str] {
1367 &[]
1368 }
1369
1370 fn virtual_module_package(&self) -> Option<&'static str> {
1381 None
1382 }
1383
1384 fn path_aliases(&self, _root: &Path) -> Vec<(&'static str, String)> {
1394 vec![]
1395 }
1396
1397 fn static_dir_mappings(&self, _root: &Path) -> Vec<(std::path::PathBuf, String)> {
1409 vec![]
1410 }
1411
1412 fn auto_imports(&self, _root: &Path) -> Vec<AutoImportRule> {
1430 Vec::new()
1431 }
1432
1433 fn provided_dependencies(&self) -> Vec<ProvidedDependencyRule> {
1435 Vec::new()
1436 }
1437
1438 fn is_enabled_with_package_json(&self, _pkg: &PackageJson, _root: &Path) -> bool {
1440 false
1441 }
1442
1443 fn resolve_package_json(&self, _pkg: &PackageJson, _root: &Path) -> PluginResult {
1445 PluginResult::default()
1446 }
1447
1448 fn package_json_referenced_dependencies(
1453 &self,
1454 _pkg: &PackageJson,
1455 _root: &Path,
1456 ) -> Vec<String> {
1457 Vec::new()
1458 }
1459
1460 fn resolve_config(&self, _config_path: &Path, _source: &str, _root: &Path) -> PluginResult {
1465 PluginResult::default()
1466 }
1467
1468 fn resolve_config_in_project(
1477 &self,
1478 config_path: &Path,
1479 source: &str,
1480 root: &Path,
1481 _project_root: &Path,
1482 ) -> PluginResult {
1483 self.resolve_config(config_path, source, root)
1484 }
1485
1486 fn resolve_script_config(
1490 &self,
1491 config_path: &Path,
1492 source: &str,
1493 root: &Path,
1494 project_root: &Path,
1495 ) -> PluginResult {
1496 self.resolve_config_in_project(config_path, source, root, project_root)
1497 }
1498
1499 fn script_config_binaries(&self) -> &'static [&'static str] {
1507 &[]
1508 }
1509
1510 fn package_json_config_key(&self) -> Option<&'static str> {
1514 None
1515 }
1516}
1517
1518macro_rules! define_plugin {
1579 (
1580 struct $name:ident => $display:expr,
1581 enablers: $enablers:expr
1582 $(, entry_patterns: $entry:expr)?
1583 $(, config_patterns: $config:expr)?
1584 $(, config_default_export_opt_out: $config_opt_out:expr)?
1585 $(, config_file_exports: $config_exports:expr)?
1586 $(, always_used: $always:expr)?
1587 $(, tooling_dependencies: $tooling:expr)?
1588 $(, fixture_glob_patterns: $fixtures:expr)?
1589 $(, discovery_hidden_dirs: $hidden_dirs:expr)?
1590 $(, virtual_module_prefixes: $virtual:expr)?
1591 $(, virtual_package_suffixes: $virtual_suffixes:expr)?
1592 $(, generated_type_import_prefixes: $generated_type_prefixes:expr)?
1593 $(, provided_dependencies: $provided_dependencies:expr)?
1594 $(, used_exports: [$( ($pat:expr, $exports:expr) ),* $(,)?])?
1595 , resolve_config: imports_only
1596 $(,)?
1597 ) => {
1598 pub struct $name;
1599
1600 impl Plugin for $name {
1601 fn name(&self) -> &'static str {
1602 $display
1603 }
1604
1605 fn enablers(&self) -> &'static [&'static str] {
1606 $enablers
1607 }
1608
1609 $( fn entry_patterns(&self) -> &'static [&'static str] { $entry } )?
1610 $( fn config_patterns(&self) -> &'static [&'static str] { $config } )?
1611 $( fn config_default_export_opt_out(&self) -> &'static [&'static str] { $config_opt_out } )?
1612 $( fn config_file_exports(&self) -> &'static [(&'static str, &'static [&'static str])] { $config_exports } )?
1613 $( fn always_used(&self) -> &'static [&'static str] { $always } )?
1614 $( fn tooling_dependencies(&self) -> &'static [&'static str] { $tooling } )?
1615 $( fn fixture_glob_patterns(&self) -> &'static [&'static str] { $fixtures } )?
1616 $( fn discovery_hidden_dirs(&self) -> &'static [&'static str] { $hidden_dirs } )?
1617 $( fn virtual_module_prefixes(&self) -> &'static [&'static str] { $virtual } )?
1618 $( fn virtual_package_suffixes(&self) -> &'static [&'static str] { $virtual_suffixes } )?
1619 $( fn generated_type_import_prefixes(&self) -> &'static [&'static str] { $generated_type_prefixes } )?
1620 $( fn provided_dependencies(&self) -> Vec<ProvidedDependencyRule> { $provided_dependencies } )?
1621
1622 $(
1623 fn used_exports(&self) -> Vec<(&'static str, &'static [&'static str])> {
1624 vec![$( ($pat, $exports) ),*]
1625 }
1626 )?
1627
1628 fn resolve_config(
1629 &self,
1630 config_path: &std::path::Path,
1631 source: &str,
1632 _root: &std::path::Path,
1633 ) -> PluginResult {
1634 let mut result = PluginResult::default();
1635 crate::plugins::add_import_referenced_dependencies(
1636 &mut result,
1637 source,
1638 config_path,
1639 );
1640 result
1641 }
1642 }
1643 };
1644
1645 (
1646 struct $name:ident => $display:expr,
1647 enablers: $enablers:expr
1648 $(, entry_patterns: $entry:expr)?
1649 $(, config_patterns: $config:expr)?
1650 $(, config_default_export_opt_out: $config_opt_out:expr)?
1651 $(, config_file_exports: $config_exports:expr)?
1652 $(, always_used: $always:expr)?
1653 $(, tooling_dependencies: $tooling:expr)?
1654 $(, fixture_glob_patterns: $fixtures:expr)?
1655 $(, discovery_hidden_dirs: $hidden_dirs:expr)?
1656 $(, virtual_module_prefixes: $virtual:expr)?
1657 $(, virtual_package_suffixes: $virtual_suffixes:expr)?
1658 $(, generated_type_import_prefixes: $generated_type_prefixes:expr)?
1659 $(, provided_dependencies: $provided_dependencies:expr)?
1660 $(, package_json_config_key: $pkg_key:expr)?
1661 $(, script_config_binaries: $script_binaries:expr)?
1662 $(, used_exports: [$( ($pat:expr, $exports:expr) ),* $(,)?])?
1663 , resolve_config($cp:ident, $src:ident, $root:ident) $body:block
1664 $(, resolve_config_in_project($pcp:ident, $psrc:ident, $proot:ident, $pproj:ident) $pbody:block)?
1665 $(,)?
1666 ) => {
1667 pub struct $name;
1668
1669 impl Plugin for $name {
1670 fn name(&self) -> &'static str {
1671 $display
1672 }
1673
1674 fn enablers(&self) -> &'static [&'static str] {
1675 $enablers
1676 }
1677
1678 $( fn entry_patterns(&self) -> &'static [&'static str] { $entry } )?
1679 $( fn config_patterns(&self) -> &'static [&'static str] { $config } )?
1680 $( fn config_default_export_opt_out(&self) -> &'static [&'static str] { $config_opt_out } )?
1681 $( fn config_file_exports(&self) -> &'static [(&'static str, &'static [&'static str])] { $config_exports } )?
1682 $( fn always_used(&self) -> &'static [&'static str] { $always } )?
1683 $( fn tooling_dependencies(&self) -> &'static [&'static str] { $tooling } )?
1684 $( fn fixture_glob_patterns(&self) -> &'static [&'static str] { $fixtures } )?
1685 $( fn discovery_hidden_dirs(&self) -> &'static [&'static str] { $hidden_dirs } )?
1686 $( fn virtual_module_prefixes(&self) -> &'static [&'static str] { $virtual } )?
1687 $( fn virtual_package_suffixes(&self) -> &'static [&'static str] { $virtual_suffixes } )?
1688 $( fn generated_type_import_prefixes(&self) -> &'static [&'static str] { $generated_type_prefixes } )?
1689 $( fn provided_dependencies(&self) -> Vec<ProvidedDependencyRule> { $provided_dependencies } )?
1690
1691 $(
1692 fn package_json_config_key(&self) -> Option<&'static str> {
1693 Some($pkg_key)
1694 }
1695 )?
1696
1697 $(
1698 fn used_exports(&self) -> Vec<(&'static str, &'static [&'static str])> {
1699 vec![$( ($pat, $exports) ),*]
1700 }
1701 )?
1702
1703 $( fn script_config_binaries(&self) -> &'static [&'static str] { $script_binaries } )?
1704
1705 fn resolve_config(
1706 &self,
1707 $cp: &std::path::Path,
1708 $src: &str,
1709 $root: &std::path::Path,
1710 ) -> PluginResult
1711 $body
1712
1713 $(
1714 fn resolve_config_in_project(
1715 &self,
1716 $pcp: &std::path::Path,
1717 $psrc: &str,
1718 $proot: &std::path::Path,
1719 $pproj: &std::path::Path,
1720 ) -> PluginResult
1721 $pbody
1722 )?
1723 }
1724 };
1725
1726 (
1727 struct $name:ident => $display:expr,
1728 enablers: $enablers:expr
1729 $(, entry_patterns: $entry:expr)?
1730 $(, config_patterns: $config:expr)?
1731 $(, config_default_export_opt_out: $config_opt_out:expr)?
1732 $(, config_file_exports: $config_exports:expr)?
1733 $(, always_used: $always:expr)?
1734 $(, tooling_dependencies: $tooling:expr)?
1735 $(, fixture_glob_patterns: $fixtures:expr)?
1736 $(, discovery_hidden_dirs: $hidden_dirs:expr)?
1737 $(, virtual_module_prefixes: $virtual:expr)?
1738 $(, virtual_package_suffixes: $virtual_suffixes:expr)?
1739 $(, generated_type_import_prefixes: $generated_type_prefixes:expr)?
1740 $(, provided_dependencies: $provided_dependencies:expr)?
1741 $(, package_json_config_key: $pkg_key:expr)?
1742 $(, used_exports: [$( ($pat:expr, $exports:expr) ),* $(,)?])?
1743 $(,)?
1744 ) => {
1745 pub struct $name;
1746
1747 impl Plugin for $name {
1748 fn name(&self) -> &'static str {
1749 $display
1750 }
1751
1752 fn enablers(&self) -> &'static [&'static str] {
1753 $enablers
1754 }
1755
1756 $( fn entry_patterns(&self) -> &'static [&'static str] { $entry } )?
1757 $( fn config_patterns(&self) -> &'static [&'static str] { $config } )?
1758 $( fn config_default_export_opt_out(&self) -> &'static [&'static str] { $config_opt_out } )?
1759 $( fn config_file_exports(&self) -> &'static [(&'static str, &'static [&'static str])] { $config_exports } )?
1760 $( fn always_used(&self) -> &'static [&'static str] { $always } )?
1761 $( fn tooling_dependencies(&self) -> &'static [&'static str] { $tooling } )?
1762 $( fn fixture_glob_patterns(&self) -> &'static [&'static str] { $fixtures } )?
1763 $( fn discovery_hidden_dirs(&self) -> &'static [&'static str] { $hidden_dirs } )?
1764 $( fn virtual_module_prefixes(&self) -> &'static [&'static str] { $virtual } )?
1765 $( fn virtual_package_suffixes(&self) -> &'static [&'static str] { $virtual_suffixes } )?
1766 $( fn generated_type_import_prefixes(&self) -> &'static [&'static str] { $generated_type_prefixes } )?
1767 $( fn provided_dependencies(&self) -> Vec<ProvidedDependencyRule> { $provided_dependencies } )?
1768
1769 $(
1770 fn package_json_config_key(&self) -> Option<&'static str> {
1771 Some($pkg_key)
1772 }
1773 )?
1774
1775 $(
1776 fn used_exports(&self) -> Vec<(&'static str, &'static [&'static str])> {
1777 vec![$( ($pat, $exports) ),*]
1778 }
1779 )?
1780 }
1781 };
1782}
1783
1784mod config_dependencies;
1785pub mod config_parser;
1786mod config_parser_array_pushes;
1787mod config_value_credits;
1788mod federation_source;
1789use config_value_credits::{
1790 canonical_test_environment, credit_config_value, credit_environment_optional_peers,
1791};
1792mod flue;
1793mod jasmine;
1794mod manifest;
1795mod module_request;
1796use module_request::{has_glob_syntax, has_source_extension, module_request, names_project_file};
1797pub mod manifest_entries;
1798mod mise;
1799mod osls;
1800mod path_rule_index;
1801mod project_glob;
1802mod railway;
1803pub mod registry;
1804mod rstest;
1805mod serverless_framework;
1806mod textlint;
1807mod tooling;
1808pub(crate) mod trace_provenance;
1809mod used_export_names;
1810mod used_export_rule;
1811mod web_server_app;
1812
1813pub use config_dependencies::RequiredDependency;
1814use config_dependencies::add_import_referenced_dependencies;
1815pub use federation_source::{FederationSource, FederationSourceTarget};
1816pub(crate) use module_federation::runtime_remotes;
1817pub(crate) use path_rule_index::PathRuleIndex;
1818pub(crate) use registry::module_specifiers;
1819pub use registry::{
1820 AggregatedPluginResult, CheckedAliasPrefix, PluginRegistry, PluginToolingDependencies,
1821 PluginToolingEvidence, VirtualModuleMatch, VirtualModuleProviderRule,
1822};
1823pub use tooling::types_package_target;
1824pub(crate) use tooling::{
1825 cli_tooling_config_patterns, is_ambient_types_package, is_known_tooling_dependency,
1826};
1827pub use trace_provenance::ExportCredits;
1828pub use used_export_names::UsedExportNames;
1829pub(crate) use used_export_rule::{ConfigExportCredit, is_export_ignored};
1830pub use used_export_rule::{PluginUsedExportRule, UsedExportRule};
1831
1832mod adonis;
1833mod ag_ui;
1834mod alchemy;
1835mod alias_replacement;
1836mod angular;
1837mod astro;
1838mod ava;
1839mod babel;
1840mod biome;
1841mod browser_extension;
1842mod bun;
1843mod c8;
1844mod capacitor;
1845mod changesets;
1846mod coderabbit;
1847mod commit_and_tag_version;
1848mod commitizen;
1849mod commitlint;
1850mod content_collections;
1851mod contentlayer;
1852mod convex;
1853mod cspell;
1854mod cucumber;
1855mod cypress;
1856mod danger;
1857mod deno;
1858mod dependency_cruiser;
1859mod docusaurus;
1860mod dotenv;
1861mod drizzle;
1862mod dumi;
1863mod egg;
1864mod electron;
1865mod ember;
1866mod entry_point_roles;
1867mod eslint;
1868mod eve;
1869mod expo;
1870mod expo_packages;
1871mod expo_router;
1872mod extends_walk;
1873mod firebase;
1874mod fumadocs;
1875mod gatsby;
1876mod github_action;
1877mod gnome_shell_extension;
1878mod graphql_codegen;
1879mod graphql_config;
1880mod gulp;
1881mod hardhat;
1882mod husky;
1883mod i18next;
1884mod ionic;
1885mod jest;
1886mod k6;
1887mod karma;
1888mod kibana;
1889mod knex;
1890mod kysely;
1891mod lefthook;
1892mod lexical;
1893mod lint_staged;
1894mod lit;
1895mod markdownlint;
1896mod mintlify;
1897mod mkdocs;
1898mod mocha;
1899mod module_federation;
1900mod msw;
1901mod n8n;
1902mod napi_rs;
1903mod nest_commander;
1904mod nestjs;
1905mod nestjs_trpc;
1906mod next_intl;
1907mod nextjs;
1908mod nitro;
1909mod nodemon;
1910pub(crate) mod nuxt;
1911mod nx;
1912mod nyc;
1913mod obsidian;
1914mod openapi_ts;
1915mod opencode;
1916mod opennext_cloudflare;
1917mod opentelemetry;
1918mod oxfmt;
1919mod oxlint;
1920mod pandacss;
1921mod parcel;
1922mod pinia;
1923mod pkg_utils;
1924mod playwright;
1925mod plop;
1926mod pm2;
1927mod pnpm;
1928mod postcss;
1929mod prettier;
1930mod prisma;
1931mod qwik;
1932mod react_compiler;
1933mod react_native;
1934pub(crate) mod react_router;
1935mod redwoodsdk;
1936mod relay;
1937mod release_it;
1938mod remark;
1939mod remix;
1940mod rolldown;
1941mod rollup;
1942mod rsbuild;
1943mod rspack;
1944mod rspress;
1945mod sanity;
1946mod semantic_release;
1947mod sentry;
1948mod simple_git_hooks;
1949mod size_limit;
1950mod solid_start;
1951mod storybook;
1952mod stryker;
1953mod stylelint;
1954mod supabase;
1955mod sveltekit;
1956mod svgo;
1957mod svgr;
1958mod swc;
1959mod syncpack;
1960mod tailwind;
1961mod tanstack_router;
1962mod tap;
1963mod test_alias;
1964#[cfg(test)]
1965mod tests;
1966mod tsd;
1967mod tsdown;
1968mod tsup;
1969mod turborepo;
1970mod typedoc;
1971mod typeorm;
1972mod typescript;
1973mod typescript_content_mapper;
1974mod unocss;
1975pub(crate) mod unplugin_icons;
1976mod varlock;
1977mod velite;
1978mod vercel;
1979mod vite;
1980mod vite_plugin_pages;
1981pub(crate) mod vite_plus;
1982mod vite_pwa_assets_generator;
1983mod vitepress;
1984mod vitest;
1985mod vscode;
1986mod waku;
1987mod webdriverio;
1988mod webpack;
1989mod wrangler;
1990mod wuchale;
1991mod wxt;