From e7e0561630823b1a09e9b593c74156085d6e4b59 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Sun, 23 Jun 2024 17:03:36 -0700 Subject: [PATCH] Don't remove deprecated config options. Do that in separate PR --- compiler/crates/relay-compiler/src/config.rs | 24 ++++++++++++++++++++ compiler/relay-compiler-config-schema.json | 16 +++++++++++++ 2 files changed, 40 insertions(+) diff --git a/compiler/crates/relay-compiler/src/config.rs b/compiler/crates/relay-compiler/src/config.rs index 1b9e0af0038a..ba4f9a97811e 100644 --- a/compiler/crates/relay-compiler/src/config.rs +++ b/compiler/crates/relay-compiler/src/config.rs @@ -27,6 +27,7 @@ use graphql_syntax::ExecutableDefinition; use indexmap::IndexMap; use intern::string_key::StringKey; use js_config_loader::LoaderSource; +use log::warn; use persist_query::PersistError; use rayon::prelude::*; use regex::Regex; @@ -729,6 +730,14 @@ pub struct SingleProjectConfigFile { /// the babel plugin needs `artifactDirectory` set as well. pub artifact_directory: Option, + /// \[DEPRECATED\] This is deprecated field, we're not using it in the V13. + /// Adding to the config, to show the warning, and not a parse error. + pub include: Vec, + + /// \[DEPRECATED\] This is deprecated field, we're not using it in the V13. + /// Adding to the config, to show the warning, and not a parse error. + pub extensions: Vec, + /// Directories to ignore under src /// default: ['**/node_modules/**', '**/__mocks__/**', '**/__generated__/**'], #[serde(alias = "exclude")] @@ -782,6 +791,8 @@ impl Default for SingleProjectConfigFile { schema: Default::default(), src: Default::default(), artifact_directory: Default::default(), + include: vec![], + extensions: vec![], excludes: get_default_excludes(), schema_extensions: vec![], schema_config: Default::default(), @@ -841,6 +852,19 @@ impl SingleProjectConfigFile { } fn create_multi_project_config(self, config_path: &Path) -> Result { + if !self.include.is_empty() { + warn!( + r#"The configuration contains `include: {:#?}` section. This configuration option is no longer supported. Consider removing it."#, + &self.include + ); + } + if !self.extensions.is_empty() { + warn!( + r#"The configuration contains `extensions: {:#?}` section. This configuration option is no longer supported. Consider removing it."#, + &self.extensions + ); + } + if self.typegen_phase.is_some() { return Err(Error::ConfigFileValidation { config_path: config_path.into(), diff --git a/compiler/relay-compiler-config-schema.json b/compiler/relay-compiler-config-schema.json index 02b31646c78a..3a3d30f06adc 100644 --- a/compiler/relay-compiler-config-schema.json +++ b/compiler/relay-compiler-config-schema.json @@ -90,6 +90,14 @@ "default": false, "type": "boolean" }, + "extensions": { + "description": "\\[DEPRECATED\\] This is deprecated field, we're not using it in the V13. Adding to the config, to show the warning, and not a parse error.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, "featureFlags": { "default": null, "type": [ @@ -1181,6 +1189,14 @@ }, "additionalProperties": false }, + "include": { + "description": "\\[DEPRECATED\\] This is deprecated field, we're not using it in the V13. Adding to the config, to show the warning, and not a parse error.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, "isDevVariableName": { "description": "We may generate some content in the artifacts that's stripped in production if __DEV__ variable is set This config option is here to define the name of that special variable", "default": null,