extension_cli: Include the list of what an extension provides in the generated manifest (#24295)
This PR updates the Zed extension CLI with support for populating the `provides` field in the generated extension manifest. This field will contain the set of features that the extension provides. For example: ``` "provides": ["themes", "icon-themes"] ``` Release Notes: - N/A
This commit is contained in:
parent
aaf432fcd2
commit
5a25751521
4 changed files with 81 additions and 12 deletions
|
@ -1,3 +1,4 @@
|
|||
use std::collections::BTreeSet;
|
||||
use std::str::FromStr;
|
||||
|
||||
use chrono::Utc;
|
||||
|
@ -370,6 +371,7 @@ fn metadata_from_extension_and_version(
|
|||
repository: version.repository,
|
||||
schema_version: Some(version.schema_version),
|
||||
wasm_api_version: version.wasm_api_version,
|
||||
provides: BTreeSet::default(),
|
||||
},
|
||||
|
||||
published_at: convert_time_to_chrono(version.published_at),
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
use std::collections::BTreeSet;
|
||||
use std::sync::Arc;
|
||||
|
||||
use super::Database;
|
||||
use crate::db::ExtensionVersionConstraints;
|
||||
use crate::{
|
||||
db::{queries::extensions::convert_time_to_chrono, ExtensionMetadata, NewExtensionVersion},
|
||||
test_both_dbs,
|
||||
};
|
||||
use std::sync::Arc;
|
||||
|
||||
test_both_dbs!(
|
||||
test_extensions,
|
||||
|
@ -97,6 +99,7 @@ async fn test_extensions(db: &Arc<Database>) {
|
|||
repository: "ext1/repo".into(),
|
||||
schema_version: Some(1),
|
||||
wasm_api_version: None,
|
||||
provides: BTreeSet::default(),
|
||||
},
|
||||
published_at: t0_chrono,
|
||||
download_count: 0,
|
||||
|
@ -111,6 +114,7 @@ async fn test_extensions(db: &Arc<Database>) {
|
|||
repository: "ext2/repo".into(),
|
||||
schema_version: Some(0),
|
||||
wasm_api_version: None,
|
||||
provides: BTreeSet::default(),
|
||||
},
|
||||
published_at: t0_chrono,
|
||||
download_count: 0
|
||||
|
@ -132,6 +136,7 @@ async fn test_extensions(db: &Arc<Database>) {
|
|||
repository: "ext2/repo".into(),
|
||||
schema_version: Some(0),
|
||||
wasm_api_version: None,
|
||||
provides: BTreeSet::default(),
|
||||
},
|
||||
published_at: t0_chrono,
|
||||
download_count: 0
|
||||
|
@ -172,6 +177,7 @@ async fn test_extensions(db: &Arc<Database>) {
|
|||
repository: "ext2/repo".into(),
|
||||
schema_version: Some(0),
|
||||
wasm_api_version: None,
|
||||
provides: BTreeSet::default(),
|
||||
},
|
||||
published_at: t0_chrono,
|
||||
download_count: 7
|
||||
|
@ -186,6 +192,7 @@ async fn test_extensions(db: &Arc<Database>) {
|
|||
repository: "ext1/repo".into(),
|
||||
schema_version: Some(1),
|
||||
wasm_api_version: None,
|
||||
provides: BTreeSet::default(),
|
||||
},
|
||||
published_at: t0_chrono,
|
||||
download_count: 5,
|
||||
|
@ -258,6 +265,7 @@ async fn test_extensions(db: &Arc<Database>) {
|
|||
repository: "ext2/repo".into(),
|
||||
schema_version: Some(0),
|
||||
wasm_api_version: None,
|
||||
provides: BTreeSet::default(),
|
||||
},
|
||||
published_at: t0_chrono,
|
||||
download_count: 7
|
||||
|
@ -272,6 +280,7 @@ async fn test_extensions(db: &Arc<Database>) {
|
|||
repository: "ext1/repo".into(),
|
||||
schema_version: Some(1),
|
||||
wasm_api_version: None,
|
||||
provides: BTreeSet::default(),
|
||||
},
|
||||
published_at: t0_chrono,
|
||||
download_count: 5,
|
||||
|
@ -378,6 +387,7 @@ async fn test_extensions_by_id(db: &Arc<Database>) {
|
|||
repository: "ext1/repo".into(),
|
||||
schema_version: Some(1),
|
||||
wasm_api_version: Some("0.0.4".into()),
|
||||
provides: BTreeSet::default(),
|
||||
},
|
||||
published_at: t0_chrono,
|
||||
download_count: 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue