Skip to content

Commit

Permalink
Make typescript default language
Browse files Browse the repository at this point in the history
Summary:
With this changes, projects that use "typescript" won't need to specify this in the compiler configuration.

This change is related to the discussion here: #3815.

Reviewed By: rbalicki2

Differential Revision: D35020338

fbshipit-source-id: ee93818091d24c6520a0ecf4b1c80ec91e4c2f1f
  • Loading branch information
alunyov authored and facebook-github-bot committed Mar 21, 2022
1 parent fd19b20 commit 8d824cf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,21 +372,24 @@ mod tests {
},
"projects": {
"public": {
"schema": "graphql/public.graphql"
"schema": "graphql/public.graphql",
"language": "flow"
},
"internal": {
"schema": "graphql/__generated__/internal.graphql"
"schema": "graphql/__generated__/internal.graphql",
"language": "flow"
},
"with_custom_generated_dir": {
"schema": "graphql/__generated__/custom.graphql",
"output": "graphql/custom-generated"
"output": "graphql/custom-generated",
"language": "flow"
},
"typescript": {
"schema": "graphql/ts_schema.graphql",
"language": "typescript"
"schema": "graphql/ts_schema.graphql"
},
"overlapping_generated_dir": {
"schema": "graphql/__generated__/custom.graphql"
"schema": "graphql/__generated__/custom.graphql",
"language": "flow"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/crates/relay-config/src/typegen_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub enum TypegenLanguage {

impl Default for TypegenLanguage {
fn default() -> Self {
Self::Flow
Self::TypeScript
}
}

Expand Down
4 changes: 3 additions & 1 deletion packages/relay-compiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ file sources, and "listen" to the file changes in the "watch" mode. If
enabling this the babel plugin needs `artifactDirectory` to be set as well.
[string]
- `language` The name of the language used for input files and generated
artifacts. ["flow" | "typescript"] [default: "flow"]
artifacts. ["typescript" | "flow"] [default: "typescript"]. Please, use "flow"
for plain JS projects: flow-types emitted as comments, and the generated
artifacts with "flow" are valid JS modules.
- `excludes` Directories to ignore under `src`. [array] [default:
["**/node_modules/**", "**/__mocks__/**", "**/__generated__/**"]]
- `schemaExtensions` List of directories with schema extensions. [array]
Expand Down
3 changes: 2 additions & 1 deletion scripts/config.tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"actor_change_support": {
"kind": "enabled"
}
}
},
"language": "flow"
}
},
"isDevVariableName": "__DEV__"
Expand Down

0 comments on commit 8d824cf

Please sign in to comment.