mirror of
https://github.com/denoland/deno.git
synced 2025-09-24 19:32:30 +00:00
feat: Codegen feature flags (#28920)
This commit adds "deno_features" crate that contains definitions of all unstable features in Deno. Based on these definitions, both Rust and JS code is generated ensuring that the two are always in sync. In addition some of flag handling was rewritten to use the generated definitions, instead of hand rolling these flag definitions. --------- Co-authored-by: snek <snek@deno.com>
This commit is contained in:
parent
4924731ac3
commit
189ccffdb9
19 changed files with 701 additions and 284 deletions
20
runtime/features/structs.rs
Normal file
20
runtime/features/structs.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2018-2025 the Deno authors. MIT license.
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum UnstableFeatureKind {
|
||||
Cli,
|
||||
Runtime,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[allow(dead_code)]
|
||||
pub struct UnstableFeatureDefinition {
|
||||
pub name: &'static str,
|
||||
pub flag_name: &'static str,
|
||||
pub help_text: &'static str,
|
||||
pub show_in_help: bool,
|
||||
pub id: i32,
|
||||
pub kind: UnstableFeatureKind,
|
||||
pub env_var: Option<&'static str>,
|
||||
pub config_file_option: &'static str,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue