Skip to content

Commit

Permalink
chore: changelog tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryex committed Apr 28, 2024
1 parent 4ac823a commit 8564709
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 25 deletions.
31 changes: 17 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
## v0.2.1

- prevent borrow panics in VM during batch operations
- fix Maximize batch mode
- fix panic in parsing invalid numbers

## v0.2.0
<!-- insertion marker -->
## [v0.2.1]

- prevent borrow panics in VM during batch operations
- fix Maximize batch mode
- fix panic in parsing invalid numbers

## [v0.2.0]

### Share VM State!

New in this release is the ability to share the entire VM with you share a link. This means code; connected devices and their state; as well as the state of the stack, registers, and line number of the active IC!

Additionally you can now save and load any number of sessions in your browser. Access this functionality from the main menu.

Also! the project has officially moved to https://ic10emu.dev . Old share links *should* redirect, but if not simply copy the fragment (the part of the url starting with the `#` symbol)
Also! the project has officially moved to https://ic10emu.dev . Old share links _should_ redirect, but if not simply copy the fragment (the part of the url starting with the `#` symbol)

#### List of changes

- Move build system from Webpack to [Rsbuild](https://rsbuild.dev/) (way faster build times).
- VM now supports exporting and restoring a frozen state.
- Share links updates to use frozen vm state.
- Save and load sessions from the browser's IndexedDB storage.
- project now includes tailwindcss to make frontend dev easier.
- Changelog dialog to notify users of updates.
- Move build system from Webpack to [Rsbuild](https://rsbuild.dev/) (way faster build times).
- VM now supports exporting and restoring a frozen state.
- Share links updates to use frozen vm state.
- Save and load sessions from the browser's IndexedDB storage.
- project now includes tailwindcss to make frontend dev easier.
- Changelog dialog to notify users of updates.

## v0.1.0
## [v0.1.0]

### **Initial Release**:

IC10emu is released to the public! edit and share your IC10 scripts!

- view and edit stack and registers
- view and edit stack and registers
52 changes: 52 additions & 0 deletions CHANGELOG.md.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{#- macro: render_commit -#}
{%- macro render_commit(commit) -%}
- {{ commit.convention.subject|default(commit.subject) }} ([{{ commit.hash|truncate(7, True, '') }}]({{ commit.url }}) by {{ commit.author_name }}).
{%- if commit.text_refs.issues_not_in_subject %} Related issues/PRs: {% for issue in commit.text_refs.issues_not_in_subject -%}
{% if issue.url %}[{{ issue.ref }}]({{ issue.url }}){% else %}{{ issue.ref }}{% endif %}{% if not loop.last %}, {% endif -%}
{%- endfor -%}{%- endif -%}
{%- for trailer_name, trailer_value in commit.trailers.items() -%}
{%- if trailer_value|is_url %} [{{ trailer_name }}]({{ trailer_value }})
{%- else %} {{ trailer_name }}: {{ trailer_value }}{% endif %}
{%- if not loop.last %},{% endif %}
{%- endfor -%}
{%- endmacro -%}

{#- macro: render_section -#}
{%- macro render_section(section) -%}
### {{ section.type or "Misc" }}

{% for commit in section.commits|sort(attribute='author_date',reverse=true)|unique(attribute='subject') -%}
{{ render_commit(commit) }}
{% endfor %}
{%- endmacro -%}

{#- macro: render_version -#}
{%- macro render_version(version) -%}
{%- if version.tag or version.planned_tag -%}
## [{{ version.tag or version.planned_tag }}]{% if version.date %} - {{ version.date }}{% endif %}

<small>[Compare with {{ version.previous_version.tag|default("first commit") }}]({{ version.compare_url }})</small>
{%- else -%}
## Unreleased

<small>[Compare with latest]({{ version.compare_url }})</small>
{%- endif %}
{% for type in changelog.sections %}
{%- if type in version.sections_dict %}
{%- with section = version.sections_dict[type] %}
{{ render_section(section) }}
{%- endwith %}
{%- endif %}
{%- endfor %}
{%- if not (version.tag or version.planned_tag) %}
<!-- insertion marker -->{% endif %}
{% endmacro -%}

{#- template -#}
{%- if not in_place -%}
# Changelog

{% endif %}<!-- insertion marker -->
{% for version in changelog.versions_list -%}
{{ render_version(version) }}
{%- endfor -%}
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["ic10lsp_wasm", "ic10emu_wasm", "ic10emu", "xtask"]
resolver = "2"

[workspace.package]
version = "0.2.1"
version = "0.2.2"
edition = "2021"

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion www/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ic10emu",
"version": "0.2.1",
"version": "0.2.2",
"description": "an IC10 emulator for IC10 mips from Stationeers",
"main": "index.js",
"scripts": {
Expand Down
43 changes: 38 additions & 5 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct Args {
}

const PACKAGES: &[&str] = &["ic10lsp_wasm", "ic10emu_wasm"];
const VALID_VERSION_TYPE: &[&str] = &["patch", "minor", "major"];

#[derive(Debug, Subcommand)]
enum Task {
Expand All @@ -41,6 +42,13 @@ enum Task {
Start {},
/// Runs production page under 'www/dist', Run `build` first.
Deploy {},
/// bump the cargo.toml and package,json versions
Version {
#[arg(last = true, default_value = "patch", value_parser = clap::builder::PossibleValuesParser::new(VALID_VERSION_TYPE))]
version: String,
},
/// update changelog
Changelog {},
}

#[derive(thiserror::Error)]
Expand All @@ -66,6 +74,7 @@ impl std::fmt::Debug for Error {
}
}

const VERSION: Option<&str> = option_env!("CARGO_PKG_VERSION");
fn main() -> Result<(), Error> {
let args = Args::parse();
let workspace = {
Expand Down Expand Up @@ -100,7 +109,7 @@ fn main() -> Result<(), Error> {
cmd.args(["run", "start"]).status().map_err(|e| {
Error::Command(format!("{}", cmd.get_program().to_string_lossy()), e)
})?;
},
}
Task::Deploy {} => {
pnpm_install(&args, &workspace)?;
eprintln!("Production Build");
Expand All @@ -109,6 +118,33 @@ fn main() -> Result<(), Error> {
cmd.args(["run", "build"]).status().map_err(|e| {
Error::Command(format!("{}", cmd.get_program().to_string_lossy()), e)
})?;
}
Task::Version { version } => {
let mut cmd = Command::new("cargo");
cmd.current_dir(&workspace);
cmd.args(["set-version", "--bump", &version])
.status()
.map_err(|e| {
Error::Command(format!("{}", cmd.get_program().to_string_lossy()), e)
})?;
let mut cmd = Command::new(&args.manager);
cmd.current_dir(&workspace.join("www"));
cmd.args(["version", &version]).status().map_err(|e| {
Error::Command(format!("{}", cmd.get_program().to_string_lossy()), e)
})?;
},
Task::Changelog { } => {
let mut cmd = Command::new("git-changelog");
cmd.current_dir(&workspace);
cmd.args([
"-io", "CHANGELOG.md",
"-t", "path:CHANGELOG.md.jinja",
"--bump", VERSION.unwrap_or("auto"),
"--parse-refs",
"--trailers"
]).status().map_err(|e| {
Error::Command(format!("{}", cmd.get_program().to_string_lossy()), e)
})?;
},
}
Ok(())
Expand Down Expand Up @@ -160,10 +196,7 @@ fn build<P: AsRef<std::ffi::OsStr> + std::fmt::Debug + std::fmt::Display>(
Ok(())
}

fn pnpm_install(
args: &Args,
workspace: &std::path::Path,
) -> Result<ExitStatus, Error> {
fn pnpm_install(args: &Args, workspace: &std::path::Path) -> Result<ExitStatus, Error> {
eprintln!("Running `pnpm install`");
let mut cmd = Command::new(&args.manager);
cmd.current_dir(&workspace.join("www"));
Expand Down

0 comments on commit 8564709

Please sign in to comment.