Skip to content

Commit

Permalink
Merge pull request #140 from wasmerio/allow-period-in-package-name
Browse files Browse the repository at this point in the history
  • Loading branch information
ayys authored Feb 12, 2024
2 parents dcf446e + bafa228 commit 0b53563
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-wasmer --verbose --debug --version '^0.4'
args: cargo-wasmer --verbose --debug --version '^0.4' --locked
- name: Type Checking
uses: actions-rs/cargo@v1
with:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ change, where applicable.

## [Unreleased] - ReleaseDate

- Allow packages with `.` in their names. This is useful for packages
`my-website.com`. Internally, the `.` is converted into a `-` to
make it a valid binding name.

### Added
- Added ability to pass in a user-specified name for the generated
bindings. This can be done by passing in the `--name` flag in the
Expand Down
7 changes: 3 additions & 4 deletions crates/wasmer-pack/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,10 @@ fn parse_identifier(s: &str) -> Result<String, Error> {
);
anyhow::ensure!(
s.chars()
.all(|c| c.is_ascii_alphanumeric() || matches!(c, '-' | '_')),
"Identifiers can only contain '-', '_', ascii numbers, and letters"
.all(|c| c.is_ascii_alphanumeric() || matches!(c, '-' | '_' | '.')),
"Identifiers can only contain '-', '_', '.', ascii numbers, and letters"
);

Ok(s.to_string())
Ok(s.replace('.', "-"))
}

/// Information about the [`Package`] being generated.
Expand Down

0 comments on commit 0b53563

Please sign in to comment.