diff --git a/.github/config-schema.json b/.github/config-schema.json index 5dc4696e6..3dc390b69 100644 --- a/.github/config-schema.json +++ b/.github/config-schema.json @@ -311,6 +311,7 @@ "detect_files": [ "deno.json", "deno.jsonc", + "deno.lock", "mod.ts", "deps.ts", "mod.js", @@ -2739,6 +2740,7 @@ "default": [ "deno.json", "deno.jsonc", + "deno.lock", "mod.ts", "deps.ts", "mod.js", diff --git a/docs/config/README.md b/docs/config/README.md index d627ffd47..83ae13328 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -1097,20 +1097,20 @@ format = 'via [🔰 $version](bold red) ' The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: -- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file +- The current directory contains a `deno.json`, `deno.jsonc`, `deno.lock`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Options -| Option | Default | Description | -| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `'via [$symbol($version )]($style)'` | The format for the module. | -| `version_format` | `'v${raw}'` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `'🦕 '` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `['deno.json', 'deno.jsonc', 'mod.ts', 'mod.js', 'deps.ts', 'deps.js']` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `style` | `'green bold'` | The style for the module. | -| `disabled` | `false` | Disables the `deno` module. | +| Option | Default | Description | +| ------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------- | +| `format` | `'via [$symbol($version )]($style)'` | The format for the module. | +| `version_format` | `'v${raw}'` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `'🦕 '` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `['deno.json', 'deno.jsonc', 'deno.lock', 'mod.ts', 'mod.js', 'deps.ts', 'deps.js']` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `style` | `'green bold'` | The style for the module. | +| `disabled` | `false` | Disables the `deno` module. | ### Variables diff --git a/src/configs/deno.rs b/src/configs/deno.rs index a562e1d01..9ad82bddd 100644 --- a/src/configs/deno.rs +++ b/src/configs/deno.rs @@ -30,6 +30,7 @@ impl<'a> Default for DenoConfig<'a> { detect_files: vec![ "deno.json", "deno.jsonc", + "deno.lock", "mod.ts", "deps.ts", "mod.js", diff --git a/src/modules/deno.rs b/src/modules/deno.rs index fc2c672b8..d46c354af 100644 --- a/src/modules/deno.rs +++ b/src/modules/deno.rs @@ -103,6 +103,16 @@ mod tests { dir.close() } + #[test] + fn folder_with_deno_lock() -> io::Result<()> { + let dir = tempfile::tempdir()?; + File::create(dir.path().join("deno.lock"))?.sync_all()?; + let actual = ModuleRenderer::new("deno").path(dir.path()).collect(); + let expected = Some(format!("via {}", Color::Green.bold().paint("🦕 v1.8.3 "))); + assert_eq!(expected, actual); + dir.close() + } + #[test] fn folder_with_mod_ts() -> io::Result<()> { let dir = tempfile::tempdir()?;