Skip to content

Commit

Permalink
fix: Support underscore prefixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Jul 25, 2023
1 parent 6401277 commit 328939d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nextgen/common/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub static ID_CHARS: &str = r"[0-9A-Za-z/\._-]*";

// The @ is to support npm package scopes!
pub static ID_PATTERN: Lazy<Regex> =
Lazy::new(|| Regex::new(format!("^([A-Za-z@]{{1}}{})$", ID_CHARS).as_str()).unwrap());
Lazy::new(|| Regex::new(format!("^([A-Za-z@_]{{1}}{})$", ID_CHARS).as_str()).unwrap());

// This is to clean and ID and remove unwanted characters
pub static ID_CLEAN: Lazy<Regex> = Lazy::new(|| Regex::new(r"[^0-9A-Za-z/\._-]+").unwrap());
Expand Down
2 changes: 1 addition & 1 deletion nextgen/target/src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::{
// The @ is to support npm package scopes!
pub static TARGET_PATTERN: Lazy<Regex> = Lazy::new(|| {
Regex::new(&format!(
r"^(?P<scope>(?:[A-Za-z@#]{{1}}{chars}|\^|~))?:(?P<task>{chars})$",
r"^(?P<scope>(?:[A-Za-z@#_]{{1}}{chars}|\^|~))?:(?P<task>{chars})$",
chars = ID_CHARS
))
.unwrap()
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

#### 🚀 Updates

- Identifiers (project names, file groups, etc) can now be prefixed with underscores (`_`).

#### 🐞 Fixes

- Fixed an issue where newer moonbase secret keys would fail to sign in.
Expand Down

0 comments on commit 328939d

Please sign in to comment.