Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
**/node_modules/
**/.vitepress/cache/
**/.vitepress/dist/
articles.json
*.dbg.s
.idea/

.env

# Terraform state files
terraform.tfstate*

# Terraform plugins dir
.terraform

# Temporary terraform fs lock file
.terraform.tfstate.lock.info

# Terraform variables usually contain sensitive information
terraform.tfvars
terraform.tfvars.json
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
See the [changelog](https://elastio.github.io/bon/changelog) page on the website for details.
See the [changelog](https://bon-rs.com/changelog) page on the website for details.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
See the [contributing](https://elastio.github.io/bon/guide/internal/contributing) page on the website for details.
See the [contributing](https://bon-rs.com/guide/internal/contributing) page on the website for details.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<a href="https://elastio.github.io/bon/guide/overview">
<a href="https://bon-rs.com/guide/overview">
<!--
We use an absolute link to the image here because this README is hosted on crates.io,
lib.rs and docs.rs where this image isn't available through the relative link.
-->
<img
src="https://elastio.github.io/bon/bon-home.png"
src="https://bon-rs.com/bon-home.png"
alt="bon home"
/>
</a>
Expand Down Expand Up @@ -34,7 +34,7 @@

`bon` is a Rust crate for generating compile-time-checked builders for functions and structs. It also provides idiomatic partial application with optional and named parameters for functions and methods.

Visit the [guide for a complete overview of the crate](https://elastio.github.io/bon/guide/overview).
Visit the [guide for a complete overview of the crate](https://bon-rs.com/guide/overview).

## Quick examples

Expand Down Expand Up @@ -133,7 +133,7 @@ assert_eq!(user.level, Some(24));
assert!(user.is_admin);
```

See [the guide](https://elastio.github.io/bon/guide/overview) for the rest.
See [the guide](https://bon-rs.com/guide/overview) for the rest.

---

Expand Down
2 changes: 1 addition & 1 deletion bon-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = "0.1.0"
description = "Dev tool for working with the `bon` crate"

edition = "2021"
homepage = "https://elastio.github.io/bon/"
homepage = "https://bon-rs.com/"
license = "MIT OR Apache-2.0"
repository = "https://github.com/elastio/bon"

Expand Down
2 changes: 1 addition & 1 deletion bon-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ detail of the `bon` crate
"""

edition = "2021"
homepage = "https://elastio.github.io/bon/"
homepage = "https://bon-rs.com/"
license = "MIT OR Apache-2.0"
repository = "https://github.com/elastio/bon"

Expand Down
2 changes: 1 addition & 1 deletion bon-macros/src/builder/builder_gen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ impl BuilderGenCtx {

// The fields can't be hidden using Rust's privacy syntax.
// The details about this are described in the blog post:
// https://elastio.github.io/bon/blog/the-weird-of-function-local-types-in-rust.
// https://bon-rs.com/blog/the-weird-of-function-local-types-in-rust.
//
// We could use `#[cfg(not(rust_analyzer))]` to hide the private fields in IDE.
// However, RA would then not be able to type-check the generated code, which
Expand Down
2 changes: 1 addition & 1 deletion bon-macros/src/builder/builder_gen/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub(crate) struct BuilderGenCtx {
///
/// This is an unfortunate workaround due to the limitations of defining the
/// builder type inside of a nested module. See more details on this problem in
/// <https://elastio.github.io/bon/blog/the-weird-of-function-local-types-in-rust>
/// <https://bon-rs.com/blog/the-weird-of-function-local-types-in-rust>
pub(super) struct PrivateIdentsPool {
pub(super) phantom: syn::Ident,
pub(super) receiver: syn::Ident,
Expand Down
10 changes: 5 additions & 5 deletions bon-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ mod tests;
/// or setting the same field twice will be reported as compile-time errors.
///
/// See the full documentation for more details:
/// - [Guide](https://elastio.github.io/bon/guide/overview)
/// - [Attributes reference](https://elastio.github.io/bon/reference/builder)
/// - [Guide](https://bon-rs.com/guide/overview)
/// - [Attributes reference](https://bon-rs.com/reference/builder)
#[proc_macro_attribute]
pub fn builder(
params: proc_macro::TokenStream,
Expand Down Expand Up @@ -142,8 +142,8 @@ pub fn builder(
/// or setting the same field twice will be reported as compile-time errors.
///
/// See the full documentation for more details:
/// - [Guide](https://elastio.github.io/bon/guide/overview)
/// - [Attributes reference](https://elastio.github.io/bon/reference/builder)
/// - [Guide](https://bon-rs.com/guide/overview)
/// - [Attributes reference](https://bon-rs.com/reference/builder)
#[proc_macro_derive(Builder, attributes(builder))]
pub fn derive_builder(item: proc_macro::TokenStream) -> proc_macro::TokenStream {
builder::generate_from_derive(item.into()).into()
Expand Down Expand Up @@ -203,7 +203,7 @@ pub fn derive_builder(item: proc_macro::TokenStream) -> proc_macro::TokenStream
/// or setting the same field twice will be reported as compile-time errors.
///
/// For details on this macro including the reason why it's needed see
/// [this paragraph in the overview](https://elastio.github.io/bon/guide/overview#builder-for-an-associated-method).
/// [this paragraph in the overview](https://bon-rs.com/guide/overview#builder-for-an-associated-method).
///
/// [`builder`]: macro@builder
#[proc_macro_attribute]
Expand Down
2 changes: 1 addition & 1 deletion bon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categories = [
keywords = ["builder", "macro", "derive", "constructor", "setter"]

edition = "2021"
homepage = "https://elastio.github.io/bon/"
homepage = "https://bon-rs.com/"
license = "MIT OR Apache-2.0"
repository = "https://github.com/elastio/bon"

Expand Down
50 changes: 25 additions & 25 deletions bon/src/__/ide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,95 +8,95 @@
pub mod builder_top_level {
use super::*;

/// See the docs at <https://elastio.github.io/bon/reference/builder#builder-type>
/// See the docs at <https://bon-rs.com/reference/builder#builder-type>
pub const builder_type: Option<Identifier> = None;

pub mod builder_type {
use super::*;

/// See the docs at <https://elastio.github.io/bon/reference/builder#builder-type>
/// See the docs at <https://bon-rs.com/reference/builder#builder-type>
pub const name: Identifier = Identifier;

/// See the docs at <https://elastio.github.io/bon/reference/builder#builder-type>
/// See the docs at <https://bon-rs.com/reference/builder#builder-type>
pub const vis: VisibilityString = VisibilityString;

/// See the docs at <https://elastio.github.io/bon/reference/builder#builder-type>
/// See the docs at <https://bon-rs.com/reference/builder#builder-type>
pub const doc: DocComments = DocComments;
}

/// See the docs at <https://elastio.github.io/bon/reference/builder#finish-fn>
/// See the docs at <https://bon-rs.com/reference/builder#finish-fn>
pub const finish_fn: Option<Identifier> = None;

/// See the docs at <https://elastio.github.io/bon/reference/builder#finish-fn>
/// See the docs at <https://bon-rs.com/reference/builder#finish-fn>
pub mod finish_fn {
use super::*;

/// See the docs at <https://elastio.github.io/bon/reference/builder#finish-fn>
/// See the docs at <https://bon-rs.com/reference/builder#finish-fn>
pub const name: Identifier = Identifier;

/// See the docs at <https://elastio.github.io/bon/reference/builder#finish-fn>
/// See the docs at <https://bon-rs.com/reference/builder#finish-fn>
pub const vis: VisibilityString = VisibilityString;

/// See the docs at <https://elastio.github.io/bon/reference/builder#finish-fn>
/// See the docs at <https://bon-rs.com/reference/builder#finish-fn>
pub const doc: DocComments = DocComments;
}

/// See the docs at <https://elastio.github.io/bon/reference/builder#start-fn>
/// See the docs at <https://bon-rs.com/reference/builder#start-fn>
pub const start_fn: Option<Identifier> = None;

/// See the docs at <https://elastio.github.io/bon/reference/builder#start-fn>
/// See the docs at <https://bon-rs.com/reference/builder#start-fn>
pub mod start_fn {
use super::*;

/// See the docs at <https://elastio.github.io/bon/reference/builder#start-fn>
/// See the docs at <https://bon-rs.com/reference/builder#start-fn>
pub const name: Identifier = Identifier;

/// See the docs at <https://elastio.github.io/bon/reference/builder#start-fn>
/// See the docs at <https://bon-rs.com/reference/builder#start-fn>
pub const vis: VisibilityString = VisibilityString;

/// See the docs at <https://elastio.github.io/bon/reference/builder#start-fn>
/// See the docs at <https://bon-rs.com/reference/builder#start-fn>
pub const doc: DocComments = DocComments;
}

/// See the docs at <https://elastio.github.io/bon/reference/builder#state-mod>
/// See the docs at <https://bon-rs.com/reference/builder#state-mod>
pub const state_mod: Option<Identifier> = None;

/// See the docs at <https://elastio.github.io/bon/reference/builder#state-mod>
/// See the docs at <https://bon-rs.com/reference/builder#state-mod>
pub mod state_mod {
use super::*;

/// See the docs at <https://elastio.github.io/bon/reference/builder#state-mod>
/// See the docs at <https://bon-rs.com/reference/builder#state-mod>
pub const name: Identifier = Identifier;

/// See the docs at <https://elastio.github.io/bon/reference/builder#state-mod>
/// See the docs at <https://bon-rs.com/reference/builder#state-mod>
pub const vis: VisibilityString = VisibilityString;

/// See the docs at <https://elastio.github.io/bon/reference/builder#state-mod>
/// See the docs at <https://bon-rs.com/reference/builder#state-mod>
pub const doc: DocComments = DocComments;
}

/// See the docs at <https://elastio.github.io/bon/reference/builder#on>
/// See the docs at <https://bon-rs.com/reference/builder#on>
pub mod on {
use super::*;

/// See the docs at <https://elastio.github.io/bon/reference/builder#on>
/// See the docs at <https://bon-rs.com/reference/builder#on>
pub const into: Flag = Flag;
}

/// See the docs at <https://elastio.github.io/bon/reference/builder#derive>
/// See the docs at <https://bon-rs.com/reference/builder#derive>
pub mod derive {
/// See the docs at <https://elastio.github.io/bon/reference/builder#derive>
/// See the docs at <https://bon-rs.com/reference/builder#derive>
pub use core::fmt::Debug;

/// See the docs at <https://elastio.github.io/bon/reference/builder#derive>
/// See the docs at <https://bon-rs.com/reference/builder#derive>
pub use core::clone::Clone;
}

/// The real name of this parameter is `crate` (without the underscore).
/// It's hinted with an underscore due to the limitations of the current
/// completions limitation. This will be fixed in the future.
///
/// See the docs at <https://elastio.github.io/bon/reference/builder#crate>
/// See the docs at <https://bon-rs.com/reference/builder#crate>
pub const crate_: Option<Path> = None;
}

Expand Down
4 changes: 2 additions & 2 deletions bon/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![doc(
html_logo_url = "https://elastio.github.io/bon/bon-logo-thumb.png",
html_favicon_url = "https://elastio.github.io/bon/bon-logo-medium.png"
html_logo_url = "https://bon-rs.com/bon-logo-thumb.png",
html_favicon_url = "https://bon-rs.com/bon-logo-medium.png"
)]
#![doc = include_str!("../README.md")]
#![cfg_attr(not(feature = "std"), no_std)]
Expand Down
17 changes: 9 additions & 8 deletions website/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { defineConfig } from "vitepress";
import { abbr } from "@mdit/plugin-abbr";
import * as v1 from "../v1/config.mjs";

const base = "/bon/";

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Bon",
Expand All @@ -24,13 +22,16 @@ export default defineConfig({
},
},

base,

head: [
["link", { rel: "icon", href: `${base}bon-logo-thumb.png` }],
["link", { rel: "icon", href: `bon-logo-thumb.png` }],
["meta", { property: "og:image", content: `bon-logo-thumb.png` }],
[
"meta",
{ property: "og:image", content: `${base}bon-logo-thumb.png` },
"script",
{
defer: "",
src: "https://umami.bon-rs.com/script.js",
"data-website-id": "10c1ad05-7a6e-49ee-8633-5f8f75de4ab9",
},
],
],

Expand Down Expand Up @@ -134,7 +135,7 @@ export default defineConfig({
{
text: "Shared Configuration",
link: "/guide/patterns/shared-configuration",
}
},
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion website/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bon website

This folder contains the source code and markdown files that comprise the [bon website](https://elastio.github.io/bon/).
This folder contains the source code and markdown files that comprise the [bon website](https://bon-rs.com/).

The website is built using [VitePress](https://vitepress.dev/). It's a simple and elegant framework for static websites that hides a lot of complexity from you. You don't need to be a TypeScript expert let alone a Vue expert to get around this directory.

Expand Down
23 changes: 12 additions & 11 deletions website/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@ All the breaking changes are very unlikely to actually break your code that was

### Fixed

- Fixed `#[cfg/cfg_attr()]` not being expanded when used on function arguments with doc comments or other attributes.
- Fix `#[cfg/cfg_attr()]` not being expanded when used on function arguments with doc comments or other attributes.


### Other

- Added graceful internal panic handling. If some `bon` macro panics due to an internal bug, the macro will try to still generate a fallback for IDEs to still provide intellisense ([#145](https://github.com/elastio/bon/pull/145))
- Add graceful internal panic handling. If some `bon` macro panics due to an internal bug, the macro will try to still generate a fallback for IDEs to still provide intellisense ([#145](https://github.com/elastio/bon/pull/145))
- Switch from `elastio.github.io/bon` to a custom domain `bon-rs.com` ([#158](https://github.com/elastio/bon/pull/158))

## [2.3.0](https://github.com/elastio/bon/compare/v2.2.1...v2.3.0) - 2024-09-14

See the [blog post for this release](https://elastio.github.io/bon/blog/bon-builder-v2-3-release) that describes some of the most notable changes in detail.
See the [blog post for this release](https://bon-rs.com/blog/bon-builder-v2-3-release) that describes some of the most notable changes in detail.

### Added

Expand All @@ -67,13 +68,13 @@ See the [blog post for this release](https://elastio.github.io/bon/blog/bon-buil

## [2.2.0](https://github.com/elastio/bon/compare/v2.1.1...v2.2.0) - 2024-09-08

See the [blog post for this release](https://elastio.github.io/bon/blog/bon-builder-v2-2-release) that describes some of the most notable changes in detail.
See the [blog post for this release](https://bon-rs.com/blog/bon-builder-v2-2-release) that describes some of the most notable changes in detail.

### Changed

- The `#[bon::builder]` attribute was deprecated on structs. The new [`#[derive(bon::Builder)]`](https://elastio.github.io/bon/reference/builder) should be used to derive a builder from a struct. Starting with `bon` 2.3 (next minor release) all usages of `#[bon::builder]` on structs will generate deprecation warnings. ([#99](https://github.com/elastio/bon/pull/99)).
- The `#[bon::builder]` attribute was deprecated on structs. The new [`#[derive(bon::Builder)]`](https://bon-rs.com/reference/builder) should be used to derive a builder from a struct. Starting with `bon` 2.3 (next minor release) all usages of `#[bon::builder]` on structs will generate deprecation warnings. ([#99](https://github.com/elastio/bon/pull/99)).

There is a CLI to assist in migrating to the new syntax. See the [release blog post](https://elastio.github.io/bon/blog/bon-builder-v2-2-release#derive-builder-syntax-for-structs) for details about that.
There is a CLI to assist in migrating to the new syntax. See the [release blog post](https://bon-rs.com/blog/bon-builder-v2-2-release#derive-builder-syntax-for-structs) for details about that.

### Added

Expand All @@ -100,7 +101,7 @@ See the [blog post for this release](https://elastio.github.io/bon/blog/bon-buil

## [2.1.0](https://github.com/elastio/bon/compare/v2.0.1...v2.1.0) - 2024-09-01

See the [blog post for this release](https://elastio.github.io/bon/blog/bon-builder-v2-1-release) that describes some of the most notable changes in detail.
See the [blog post for this release](https://bon-rs.com/blog/bon-builder-v2-1-release) that describes some of the most notable changes in detail.

### Added

Expand All @@ -125,8 +126,8 @@ See the [blog post for this release](https://elastio.github.io/bon/blog/bon-buil

### Docs

- Add a new section ["`None` literals inference"](https://elastio.github.io/bon/guide/patterns/into-conversions-in-depth#none-literals-inference) to docs for "Into Conversions In-Depth"
- Fix the docs about the comparison of Into conversions on the ["Alternatives"](http://elastio.github.io/bon/guide/alternatives) page that were not updated during the v2 release
- Add a new section ["`None` literals inference"](https://bon-rs.com/guide/patterns/into-conversions-in-depth#none-literals-inference) to docs for "Into Conversions In-Depth"
- Fix the docs about the comparison of Into conversions on the ["Alternatives"](http://bon-rs.com/guide/alternatives) page that were not updated during the v2 release

### Fixed

Expand All @@ -139,7 +140,7 @@ See the [blog post for this release](https://elastio.github.io/bon/blog/bon-buil

## [2.0.0](https://github.com/elastio/bon/compare/v1.2.1...v2.0.0) - 2024-08-26

See the [blog post](https://elastio.github.io/bon/blog/bon-builder-generator-v2-release) for details.
See the [blog post](https://bon-rs.com/blog/bon-builder-generator-v2-release) for details.

## [1.2.1](https://github.com/elastio/bon/compare/v1.2.0...v1.2.1) - 2024-08-12

Expand Down Expand Up @@ -216,4 +217,4 @@ See the [blog post](https://elastio.github.io/bon/blog/bon-builder-generator-v2-

### Added

- Initial release 🎉. See the [`bon` crate overview for details](https://elastio.github.io/bon/guide/overview).
- Initial release 🎉. See the [`bon` crate overview for details](https://bon-rs.com/guide/overview).
Loading