chore: changelog tools

This commit is contained in:
Rachel Powers
2024-04-28 12:45:01 -07:00
parent 4ac823a1bc
commit 8564709e68
6 changed files with 113 additions and 25 deletions

View File

@@ -1,10 +1,13 @@
## 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! ### Share VM State!
@@ -12,21 +15,21 @@ New in this release is the ability to share the entire VM with you share a link.
Additionally you can now save and load any number of sessions in your browser. Access this functionality from the main menu. 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 #### List of changes
- Move build system from Webpack to [Rsbuild](https://rsbuild.dev/) (way faster build times). - Move build system from Webpack to [Rsbuild](https://rsbuild.dev/) (way faster build times).
- VM now supports exporting and restoring a frozen state. - VM now supports exporting and restoring a frozen state.
- Share links updates to use frozen vm state. - Share links updates to use frozen vm state.
- Save and load sessions from the browser's IndexedDB storage. - Save and load sessions from the browser's IndexedDB storage.
- project now includes tailwindcss to make frontend dev easier. - project now includes tailwindcss to make frontend dev easier.
- Changelog dialog to notify users of updates. - Changelog dialog to notify users of updates.
## v0.1.0 ## [v0.1.0]
### **Initial Release**: ### **Initial Release**:
IC10emu is released to the public! edit and share your IC10 scripts! 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
CHANGELOG.md.jinja Normal file
View File

@@ -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
Cargo.lock generated
View File

@@ -560,7 +560,7 @@ dependencies = [
[[package]] [[package]]
name = "ic10emu" name = "ic10emu"
version = "0.2.1" version = "0.2.2"
dependencies = [ dependencies = [
"const-crc32", "const-crc32",
"convert_case", "convert_case",
@@ -580,7 +580,7 @@ dependencies = [
[[package]] [[package]]
name = "ic10emu_wasm" name = "ic10emu_wasm"
version = "0.2.1" version = "0.2.2"
dependencies = [ dependencies = [
"console_error_panic_hook", "console_error_panic_hook",
"ic10emu", "ic10emu",
@@ -617,7 +617,7 @@ dependencies = [
[[package]] [[package]]
name = "ic10lsp_wasm" name = "ic10lsp_wasm"
version = "0.2.1" version = "0.2.2"
dependencies = [ dependencies = [
"console_error_panic_hook", "console_error_panic_hook",
"futures", "futures",
@@ -1844,7 +1844,7 @@ checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
[[package]] [[package]]
name = "xtask" name = "xtask"
version = "0.2.1" version = "0.2.2"
dependencies = [ dependencies = [
"clap", "clap",
"thiserror", "thiserror",

View File

@@ -3,7 +3,7 @@ members = ["ic10lsp_wasm", "ic10emu_wasm", "ic10emu", "xtask"]
resolver = "2" resolver = "2"
[workspace.package] [workspace.package]
version = "0.2.1" version = "0.2.2"
edition = "2021" edition = "2021"
[profile.release] [profile.release]

View File

@@ -1,6 +1,6 @@
{ {
"name": "ic10emu", "name": "ic10emu",
"version": "0.2.1", "version": "0.2.2",
"description": "an IC10 emulator for IC10 mips from Stationeers", "description": "an IC10 emulator for IC10 mips from Stationeers",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@@ -19,6 +19,7 @@ struct Args {
} }
const PACKAGES: &[&str] = &["ic10lsp_wasm", "ic10emu_wasm"]; const PACKAGES: &[&str] = &["ic10lsp_wasm", "ic10emu_wasm"];
const VALID_VERSION_TYPE: &[&str] = &["patch", "minor", "major"];
#[derive(Debug, Subcommand)] #[derive(Debug, Subcommand)]
enum Task { enum Task {
@@ -41,6 +42,13 @@ enum Task {
Start {}, Start {},
/// Runs production page under 'www/dist', Run `build` first. /// Runs production page under 'www/dist', Run `build` first.
Deploy {}, 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)] #[derive(thiserror::Error)]
@@ -66,6 +74,7 @@ impl std::fmt::Debug for Error {
} }
} }
const VERSION: Option<&str> = option_env!("CARGO_PKG_VERSION");
fn main() -> Result<(), Error> { fn main() -> Result<(), Error> {
let args = Args::parse(); let args = Args::parse();
let workspace = { let workspace = {
@@ -100,7 +109,7 @@ fn main() -> Result<(), Error> {
cmd.args(["run", "start"]).status().map_err(|e| { cmd.args(["run", "start"]).status().map_err(|e| {
Error::Command(format!("{}", cmd.get_program().to_string_lossy()), e) Error::Command(format!("{}", cmd.get_program().to_string_lossy()), e)
})?; })?;
}, }
Task::Deploy {} => { Task::Deploy {} => {
pnpm_install(&args, &workspace)?; pnpm_install(&args, &workspace)?;
eprintln!("Production Build"); eprintln!("Production Build");
@@ -109,6 +118,33 @@ fn main() -> Result<(), Error> {
cmd.args(["run", "build"]).status().map_err(|e| { cmd.args(["run", "build"]).status().map_err(|e| {
Error::Command(format!("{}", cmd.get_program().to_string_lossy()), 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(()) Ok(())
@@ -160,10 +196,7 @@ fn build<P: AsRef<std::ffi::OsStr> + std::fmt::Debug + std::fmt::Display>(
Ok(()) Ok(())
} }
fn pnpm_install( fn pnpm_install(args: &Args, workspace: &std::path::Path) -> Result<ExitStatus, Error> {
args: &Args,
workspace: &std::path::Path,
) -> Result<ExitStatus, Error> {
eprintln!("Running `pnpm install`"); eprintln!("Running `pnpm install`");
let mut cmd = Command::new(&args.manager); let mut cmd = Command::new(&args.manager);
cmd.current_dir(&workspace.join("www")); cmd.current_dir(&workspace.join("www"));